Repository navigation
test(oidc-auth): port the OIDC authorization tests to testkit - #5787
matthewgrossman wants to merge 16 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-5787.docs.buildwithfern.com/openshell |
|
/ok to test c29be49 |
|
Label |
|
/ok to test 8b9ac69 |
|
/ok to test 6740fa3 |
|
/ok to test 82b5c06 |
7ed684b to
84a2058
Compare
84a2058 to
1dc7b8b
Compare
Signed-off-by: Matthew Grossman <mgrossman@nvidia.com>
Signed-off-by: Matthew Grossman <mgrossman@nvidia.com>
Signed-off-by: Matthew Grossman <mgrossman@nvidia.com>
Signed-off-by: Matthew Grossman <mgrossman@nvidia.com>
Signed-off-by: Matthew Grossman <mgrossman@nvidia.com>
Signed-off-by: Matthew Grossman <mgrossman@nvidia.com>
Signed-off-by: Matthew Grossman <mgrossman@nvidia.com>
Signed-off-by: Matthew Grossman <mgrossman@nvidia.com>
Signed-off-by: Matthew Grossman <mgrossman@nvidia.com>
…eflight Signed-off-by: Matthew Grossman <mgrossman@nvidia.com>
Signed-off-by: Matthew Grossman <mgrossman@nvidia.com>
…file Signed-off-by: Matthew Grossman <mgrossman@nvidia.com>
… list Signed-off-by: Matthew Grossman <mgrossman@nvidia.com>
…rkspace imports Signed-off-by: Matthew Grossman <mgrossman@nvidia.com>
1dc7b8b to
24bcadb
Compare
…uth-tests/matthewgrossman Signed-off-by: Matthew Grossman <mgrossman@nvidia.com> # Conflicts: # tests/suites/features/Cargo.toml # tests/tmachine/config.nix
TaylorMutch
left a comment
There was a problem hiding this comment.
gator-agent
PR Review Status
The initial code-only review found no blocking issues in the OIDC test migration, including bearer-only authentication, workspace authorization assertions, legacy coverage removal, and environment-owned Keycloak and operator certificate setup. Required checks and the selected OIDC suite are green; maintainer approval remains.
Action required: A maintainer should review and approve the PR.
Blocking findings: None.
Carried findings: None.
Gator metadata
- Validation: Concentrated test migration closing #5731, part of #5281.
- Docs: Published docs not needed for this internal test migration; testing/support documentation updated.
- Checks: All current-head required checks pass: DCO, Branch Checks, E2E, and Helm Lint.
- E2E: Existing test:e2e selected suites passed, including features/oidc-auth on ubuntu-docker-rootful-oidc. No workflows dispatched or approved.
- Head SHA:
e387e9f5bb51b436707a0803e4cca6aa8d28f9e5 - Base SHA:
967c594c311007bc74969666502efa348a0ff41d - Merge base SHA:
967c594c311007bc74969666502efa348a0ff41d - Patch ID:
c1ef44157453d62116c201ffc3cc912e6db73268 - Gator payload:
16 - Review mode:
initial - Previous reviewed SHA: none
- Review budget exhausted: no
- Maintainer decision required: no
- Next state:
gator:approval-needed
TaylorMutch
left a comment
There was a problem hiding this comment.
Approved based on the completed current-head review with no blocking or carried findings and the approval-needed disposition.
…uth-tests/matthewgrossman Signed-off-by: Matthew Grossman <mgrossman@nvidia.com> # Conflicts: # tests/support/README.md # tests/testkit/testkit/src/gateway.rs # tests/testkit/testkit/src/lib.rs
Summary
Port the OIDC tests in
e2e/rust/tests/oidc_pkce.rsto 13 testkit tests intests/suites/features/oidc-auth. They run in a new<base>-oidctmachine environment that reuses the Keycloak setup.Related Issue
Closes #5731
Part of #5281
Builds on #5780's
gateway_overridesrole, environment contract table and typedProfile/Credentialbuilders, now on main.Changes
<base>-oidcenvironment (tests/tmachine): theoidc_gatewayrole applies anoidcoverride block throughgateway_overrides. It sets[openshell.gateway.oidc]to trust the Keycloak realm and sets[openshell.gateway.mtls_auth] operator_enabled = truein place ofenabled. It also re-signs testkit's client certificate as an operator (OU=operator), so testkit's own connection sets up and cleans up without signing in as a user. The suite's setup fails with a pointer to the role if the certificate signs in as a user.The block also sets
[openshell.gateway.tls]to the pathsgenerate-certswrites.config preflight(the unit's firstExecStartPre) acceptsoperator_enabledonly with an explicit client CA, and doesn't pick up the local TLS files the packaged gateway otherwise finds on its own.keycloak-support:User,Session(a signed-in user's SDK client and CLI),browser_login(the PKCE flow with a recordedxdg-open) and token-claim helpers. These are shaped so test(e2e): migrate the Python E2E suites to Rust #5624'soidc_authz.rscan move onto them.Cli::without_envandCli::in_workspace;Workspace::track_sandbox,track_providerandimport_profile.oidc-authsuite: 13 tests following the issue's mapping table. Per-user clients verify the gateway against its CA and send only a bearer token (no--gateway-insecure, no client certificate). Denials are checked by gRPC code and message. One CLI test checks the remediation command a workspace user sees.ubuntu-docker-rootful-oidcwithdeb. All 13 tests pass there, so the suite has notests/suites/unsupported.yamlentries. The test target isoidc-authwithharness = falseand atestkit::main()entry point.oidc_pkce.rskeeps only the 4 tests decision D drops:admin_can_delete_workspace,second_workspace_user_cannot_read_first_users_workspace,workspace_admin_can_create_sandboxandworkspace_admin_can_delete_sandbox. Thee2e:oidc-pkcetasks stay.Notes for review:
role 'openshell-admin' required,not a member of workspace '<ws>', and so on).client_credentials_grantare left to test(e2e): migrate the Python E2E suites to Rust #5624.Testing
cargo clippy -D warningsandcargo fmtfor testkit,keycloak-supportand the features workspaceoidc_pkce.rscompiles clean of new warnings with--features e2e-oidc-pkceubuntu-docker-rootful-oidcCI row passesChecklist