Repository navigation
test(oidc-auth): port the OIDC authorization tests to testkit - #5787
Draft
matthewgrossman wants to merge 74 commits into
Draft
matthewgrossman wants to merge 74 commits into
matthewgrossman wants to merge 74 commits into
Conversation
create_provider and install_provider return a builder that creates the provider when awaited, so tests can chain .config(key, value) for provider create --config. Existing callers are unchanged. Signed-off-by: Matthew Grossman <mgrossman@nvidia.com>
Move provider_files and provider_auto_create from e2e/rust into a providers conformance suite. The auto-create test imports a run-unique profile instead of relying on a globally imported claude-code profile, so it no longer changes shared gateway state. Signed-off-by: Matthew Grossman <mgrossman@nvidia.com>
Requests go to the gateway's endpoint with the service URL's host as the Host header, which is how the gateway routes service traffic. Over TLS the client trusts the gateway CA and presents the registered gateway's client certificate, through openshell-crypto's rustls configuration. Signed-off-by: Matthew Grossman <mgrossman@nvidia.com>
… suite Signed-off-by: Matthew Grossman <mgrossman@nvidia.com>
Signed-off-by: Matthew Grossman <mgrossman@nvidia.com>
…mage 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>
…er-tests/matthewgrossman Signed-off-by: Matthew Grossman <mgrossman@nvidia.com>
…lder::providers Signed-off-by: Matthew Grossman <mgrossman@nvidia.com>
…olicy set helpers Signed-off-by: Matthew Grossman <mgrossman@nvidia.com>
…vers to host-server 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>
…ewrite tests 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>
… tests These tests now run in the conformance suite and the routable-host-ip feature package. Signed-off-by: Matthew Grossman <mgrossman@nvidia.com>
…suites Signed-off-by: Matthew Grossman <mgrossman@nvidia.com>
…er limit The gateway rejects sandbox names longer than 19 characters, which leaves 5 for a suffix after test-<run-id>-. The static credential binding test also needs the Python workload image, which has the sandbox user that the base policy runs as. Signed-off-by: Matthew Grossman <mgrossman@nvidia.com>
Drops the include of a conformance client script from another workspace. Signed-off-by: Matthew Grossman <mgrossman@nvidia.com>
Replace conformance's support module and generic client scripts with testkit's run_python, last_json, policy readers, providers and binaries_yaml, and the connect, http and http_raw probes. Protocol and specialized clients move to the sandbox-clients scripts module. The pipelined request tests now count every response in the reply; the 403 follows the first response's body with no line break, so the old line-based count missed it. The policy update tests use the Python image, which has the sandbox user the base policy runs as. Signed-off-by: Matthew Grossman <mgrossman@nvidia.com>
Signed-off-by: Matthew Grossman <mgrossman@nvidia.com>
Signed-off-by: Matthew Grossman <mgrossman@nvidia.com>
|
🌿 Preview your docs: https://nvidia-preview-pr-5787.docs.buildwithfern.com/openshell |
… arrives on loopback Signed-off-by: Matthew Grossman <mgrossman@nvidia.com>
Signed-off-by: Matthew Grossman <mgrossman@nvidia.com>
Signed-off-by: Matthew Grossman <mgrossman@nvidia.com>
…settings 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>
…an empty file Signed-off-by: Matthew Grossman <mgrossman@nvidia.com>
Add the authority key identifier to server certificates, which strict verifiers such as Python 3.13 require, time out TLS handshakes, report CA load failures as such, and keep test CA files in temporary directories. The contract table now names environment-chosen ports OPENSHELL_TEST_<SERVICE>_PORT, matching HttpRecorder's port option. Signed-off-by: Matthew Grossman <mgrossman@nvidia.com>
Member
Author
|
/ok to test c29be49 |
|
Label |
…eflight Signed-off-by: Matthew Grossman <mgrossman@nvidia.com>
…ers/matthewgrossman' into test/5731-port-oidc-auth-tests/matthewgrossman Signed-off-by: Matthew Grossman <mgrossman@nvidia.com> # Conflicts: # TESTING.md # tests/support/README.md # tests/support/host-server/src/http.rs # tests/support/host-server/src/lib.rs # tests/support/host-server/src/tls.rs # tests/tmachine/ansible/playbooks/drivers/podman/userns.yaml # tests/tmachine/ansible/roles/gateway_overrides/defaults/main.yaml # tests/tmachine/ansible/roles/gateway_overrides/tasks/main.yaml
…tthewgrossman' into test/5731-port-oidc-auth-tests/matthewgrossman Signed-off-by: Matthew Grossman <mgrossman@nvidia.com>
…uth-tests/matthewgrossman Signed-off-by: Matthew Grossman <mgrossman@nvidia.com>
Member
Author
|
/ok to test 8b9ac69 |
Signed-off-by: Matthew Grossman <mgrossman@nvidia.com>
Member
Author
|
/ok to test 6740fa3 |
…file Signed-off-by: Matthew Grossman <mgrossman@nvidia.com>
Member
Author
|
/ok to test 82b5c06 |
…k-l7-policy/matthewgrossman Signed-off-by: Matthew Grossman <mgrossman@nvidia.com>
…uth-tests/matthewgrossman Signed-off-by: Matthew Grossman <mgrossman@nvidia.com>
Signed-off-by: Matthew Grossman <mgrossman@nvidia.com>
…/matthewgrossman' into test/5728-share-environment-helpers/matthewgrossman Signed-off-by: Matthew Grossman <mgrossman@nvidia.com>
…ers/matthewgrossman' into test/5731-port-oidc-auth-tests/matthewgrossman Signed-off-by: Matthew Grossman <mgrossman@nvidia.com>
Signed-off-by: Matthew Grossman <mgrossman@nvidia.com>
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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
This branch merges #5780 (the
gateway_overridesrole and environment contract table, for #5728) and #5657 (provider test port). Merge those first; this PR's diff shrinks to its own commits after they land.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.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 passes (waiting on/ok to test)Checklist