Repository navigation
feat(auth): authenticate gateway-mediated application requests - #4963
TaylorMutch wants to merge 8 commits into
Conversation
|
Auto-sync is disabled for draft pull requests in this repository. Workflows must be run manually. Contributors can view more details about this message here. |
|
🌿 Preview your docs: https://nvidia-preview-pr-4963.docs.buildwithfern.com/openshell |
18b394a to
ce2a99e
Compare
2574b9a to
70e365e
Compare
ce2a99e to
de94456
Compare
30cf9ce to
6b2fe9c
Compare
de94456 to
3b08d4c
Compare
6b2fe9c to
dae4a9d
Compare
c35e581 to
caacd27
Compare
66220a7 to
3dc01d7
Compare
c37b455 to
dd566cd
Compare
b71991c to
ad8be4d
Compare
00061b6 to
acc3754
Compare
2273f0d to
75d3340
Compare
2c15db3 to
15f0afb
Compare
75d3340 to
7224961
Compare
15f0afb to
6903eaa
Compare
7224961 to
5f66489
Compare
6903eaa to
433b9b9
Compare
Compatibility review (advisory)New or updated breaking changes; see the full report for all findings. 1. api-behavior — No explicit risk acceptance foundTLS loopback gateways now advertise
2. api-behavior — No explicit risk acceptance foundThe supervisor application listener now drops every
Review details
Advisory review; publication gates are unchanged. |
433b9b9 to
35e2d05
Compare
5f66489 to
2bc4518
Compare
Compatibility review (advisory)New or updated breaking changes; see the full report for all findings. 1. helm — No explicit risk acceptance foundhelm upgrade --reuse-values previously accepted saved chart values but now renders service_auth_enabled = "" when the new server.serviceAuthEnabled key is absent.
Review details
Advisory review; publication gates are unchanged. |
2bc4518 to
f79878c
Compare
35e2d05 to
c503a94
Compare
0b04cc3 to
c0123e1
Compare
Require configured gateway authentication for application HTTP requests and WebSocket upgrades, with or without the independent app listener. Add browser sessions, application credential separation, shared revocation, request authorization, documentation, and browser coverage. Closes #4722 Signed-off-by: Taylor Mutch <taylormutch@gmail.com>
Signed-off-by: Taylor Mutch <taylormutch@gmail.com>
Signed-off-by: Taylor Mutch <taylormutch@gmail.com>
Signed-off-by: Taylor Mutch <taylormutch@gmail.com>
Signed-off-by: Taylor Mutch <taylormutch@gmail.com>
Signed-off-by: Taylor Mutch <taylormutch@gmail.com>
Signed-off-by: Taylor Mutch <taylormutch@gmail.com>
Signed-off-by: Taylor Mutch <taylormutch@gmail.com>
c0123e1 to
e5927f4
Compare
Summary
Opt in to authentication and authorization for gateway-mediated application HTTP requests and WebSocket upgrades using
service_auth_enabled = truein[openshell.gateway]. The default is false, preserving existing application routing. This setting is independent of the supervisor app listener and compute driver.Based on main at
bf9f55cdf. Stacked onfeat/4953-authoritative-app-urls/TaylorMutch.Related Issue
Closes #4722. Part of RFC 0017.
Changes
Log service authentication as enabled/disabled only when gateway-mediated service routing is enabled.
Apply service authentication and mount
/auth/servicesonly while gateway service routing is enabled.service_routing_enabled = falsedisables the gateway application path regardless ofservice_auth_enabled.Add
service_auth_enabled(default false),--service-auth-enabled true,OPENSHELL_SERVICE_AUTH_ENABLED=true, and Helmserver.serviceAuthEnabled/ canonicalgatewayConfig."openshell.gateway".service_auth_enabled. Explicit false overrides are supported.Preserve existing forwarding, application-owned paths, headers, and cookies when service authentication is disabled.
Store browser application-session tokens through the credential issuer using an explicit session owner, preserving existing backend scopes, opaque handles, and expiration checks.
Resolve browser login origins through the gateway route index for both readable and hashed service hosts, preserving workspace authorization and the control-plane login boundary.
Apply gateway identity, workspace access, and forwarding role/scope authorization before upstream connection.
Add browser login with single-use bootstrap codes and bounded Secure/HttpOnly/SameSite=Strict host-only sessions.
Use configured credential storage for sessions and shared revocation across gateway replicas.
Separate gateway credentials from application bearer tokens/cookies, strip reserved credentials, and enforce origin/Fetch Metadata protections.
Configuration
[openshell.gateway]→service_auth_enabled = true--service-auth-enabled=trueOPENSHELL_SERVICE_AUTH_ENABLED=truegatewayConfig."openshell.gateway".service_auth_enabled: trueserver.serviceAuthEnabled: trueservice_auth_enableddefaults tofalse. Precedence is CLI > environment > TOML > default; canonical Helm values override the legacy Helm setting.404; do not mount/auth/servicesThese flags are independent of
supervisor.app_listener.enabled. Direct app-listener access delegates authentication to the ingress provider/application.Release Notes
Opt-in behavior change: enabling
service_auth_enabledrequires application clients to supply configured gateway authentication, with the app listener enabled or disabled. The default remains false. Direct app-listener authentication remains the ingress provider/application responsibility.Compatibility
With service authentication disabled, configuring mTLS, operator auth, or OIDC preserves existing loopback HTTP URLs. Enabling service authentication selects HTTPS when gateway TLS is configured. Direct supervisor ingress strips only the two gateway service session/login cookies; other application cookies retain their behavior.
Testing
Startup logging: all eight app-listener/gateway-routing/service-auth combinations verified against the real gateway binary, with strict server Clippy and formatting checks. Full chart checks passed after correcting canonical routing/auth Helm examples and tests.
Gateway routing opt-out validation: 2,767 combined-stack server tests passed (43 PostgreSQL-dependent tests skipped), all nine proxy tests passed, and strict all-target server/proxy Clippy passed. Full Helm tests, Markdown lint, Rust formatting, and whitespace checks passed.
Previous validation on main
e8ba30fde: standalone discovery passed 2,725 server tests (42 PostgreSQL-dependent tests skipped locally).Combined stack passed 2,761 server tests (43 PostgreSQL-dependent tests skipped), nine proxy tests, and 19 supervisor listener regressions. Strict all-target server/supervisor/proxy Clippy passed.
TypeScript SDK validation passed: protobuf generation/lint, lint, type checking, 207 tests, coverage, and build.
Helm lint and all three chart unit suites passed, including gateway TOML parsing, resource coherence, ownership, and supervisor scaling checks. Markdown lint and Rust formatting passed.
Compatibility regressions cover recorded replay URLs across origin/port changes and disabled ingress, existing TypeScript object shapes, auth-disabled loopback schemes, application-cookie preservation, and real-TLS discovery-certificate opt-in behavior.
Earlier local k3d validation covered dedicated/shared owner changes, HTTP/WebSockets, network-policy isolation, discovery withdrawal, and two proxy replicas. This revision has no new live-cluster or production-load qualification. New-head CI is pending.
Qualification limits
Live HA validation exercised supervisor process/Pod loss on a local k3d cluster. Whole-node failure, real network partitions, metric-driven HPA, sustained production load, and published release artifacts remain unqualified. Grant-file projection contributes to revocation propagation time. Both ingress paths now share the gateway hostname format and label generator. The same installation identity and public HTTPS domain/port preserve service URLs when switching ingress. Installation-status presentation (#4670) remains separate work. Live Kubernetes runs above preceded hostname integration; the naming and shutdown-fence integration is validated by focused Rust regressions.
The example Kubernetes HTTPRoute controller is a deferred compatibility POC outside this stack.
Checklist
PR dependency order: #4956 → #4963 → #4964 → #4957.
Replaces #4959, which GitHub automatically marked merged into its former SDK base when the rebased branches were published. This draft isolates the auth change against the URL layer; main was unchanged by that event.