Skip to content

fix(tui): correctly handle plaintext and cloudflare_jwt gateway auth#1876

Draft
alexclewontin wants to merge 2 commits into
NVIDIA:mainfrom
alexclewontin:tui-plaintext-jwt
Draft

fix(tui): correctly handle plaintext and cloudflare_jwt gateway auth#1876
alexclewontin wants to merge 2 commits into
NVIDIA:mainfrom
alexclewontin:tui-plaintext-jwt

Conversation

@alexclewontin

@alexclewontin alexclewontin commented Jun 11, 2026

Copy link
Copy Markdown
Contributor

Summary

Fix TUI gateway switching for non-mTLS gateways. This PR makes the TUI honor explicit plaintext
gateway metadata and adds a dedicated cloudflare_jwt path so edge-authenticated gateways no
longer fall through to the mTLS flow.

This was identified in the review process of #1625 but since it pre-dates that PR and is not really directly related to it, I wanted to split it out.

Related Issue

N/A — split from review feedback on system-gateway-dir.

Changes

  • honor auth_mode = "plaintext" when selecting the TUI transport instead of defaulting HTTPS
    endpoints to mTLS
  • add an explicit GatewayChannelMode::Edge path for auth_mode = "cloudflare_jwt"
  • load stored edge tokens and build the TUI client with EdgeAuthInterceptor for
    edge-authenticated gateways
  • add crates/openshell-tui/src/edge_tunnel.rs to bridge local gRPC traffic over the gateway
    /_ws_tunnel WebSocket endpoint for HTTPS edge gateways
  • add unit coverage for gateway mode selection across plaintext, edge, OIDC, and HTTP fallback
    cases
  • add tokio-tungstenite and futures to support the edge tunnel client

Testing

  • mise run pre-commit passes
  • Unit tests added/updated
  • E2E tests added/updated (if applicable) <- working on this, will take out of draft when it is done

Additional testing:

  • cargo test -p openshell-tui --lib
  • cargo clippy -p openshell-tui --all-targets -- -D warnings

Checklist

  • Follows Conventional Commits
  • Commits are signed off (DCO)
  • Architecture docs updated (if applicable)

Signed-off-by: Alex Lewontin <alex.lewontin@canonical.com>
Signed-off-by: Alex Lewontin <alex.lewontin@canonical.com>
@copy-pr-bot

copy-pr-bot Bot commented Jun 11, 2026

Copy link
Copy Markdown

This pull request requires additional validation before any workflows can run on NVIDIA's runners.

Pull request vetters can view their responsibilities here.

Contributors can view more details about this message here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant