feat(providers): add credential refresh foundation#1349
Open
johntmyers wants to merge 6 commits into
Open
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. |
043004c to
1b9aea7
Compare
|
🌿 Preview your docs: https://nvidia-preview-pr-1349.docs.buildwithfern.com/openshell |
5afb156 to
39d9d66
Compare
49554d0 to
67e675d
Compare
|
Label |
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
Adds the first provider credential refresh implementation slice for #1306. This PR wires refresh metadata through profiles, providers, gateway APIs, provider environment resolution, and sandbox placeholder resolution, and now includes gateway-owned token minting for OAuth2 refresh-token, OAuth2 client-credentials, and Google service-account JWT credentials.
Related Issue
Refs #1306
Changes
openshell provider refresh status NAME [--credential-key KEY]openshell provider refresh configure NAME --credential-key KEY --strategy STRATEGY --material KEY=VALUE --secret-material-key KEY --credential-expires-at TIMESTAMP_MSopenshell provider refresh rotate NAME --credential-key KEYopenshell provider refresh delete NAME --credential-key KEYopenshell provider update NAME --credential-expires-at KEY=TIMESTAMP_MSobjectstable usingscope = provider_id.provider refresh rotatepath that mint short-lived access tokens and write the current token back to the provider record.token_url/token_uri, and profile-required refresh material is validated at configure time.max_lifetime_secondsas a cap on minted token lifetime even when the provider token endpoint returns a longerexpires_in.outlookandgoogle-drive.UX Changes
Static credential flows continue to work. Users can still create providers with injected current credentials and optionally annotate expiration timestamps:
Refresh-backed providers can now be created before a current access token exists when the profile's required credentials are gateway-mintable. Profiles that still require a static credential continue to require that credential at create time.
OAuth2 refresh-token providers can be configured with refresh material and then rotated immediately:
OAuth2 client-credentials providers use the same flow:
Google Drive service-account refresh follows the same provider lifecycle:
Refresh status now exposes operational state without printing secrets:
Empty status output now distinguishes whole-provider checks from single-credential checks:
openshell provider refresh delete NAME --credential-key KEYremoves the refresh state. It clearscredential_expires_at_msonly when that expiry was owned by the refresh state; manually set expiry fromopenshell provider update --credential-expires-atis preserved.When
providers_v2_enabled=true, these profiles also contribute provider policy layers and profile-backed credential injection for attached/created sandboxes:Current Behavior
provider refresh configureaccepts gateway-mintable strategies only:oauth2_refresh_token,oauth2_client_credentials, andgoogle_service_account_jwt.openshell provider update, notprovider refresh configure.provider refresh rotateperforms an immediate gateway-managed refresh for supported strategies.openshell provider update.Testing
RUSTC_WRAPPER= cargo test -p openshell-server -p openshell-cli -p openshell-providers -p openshell-sandbox --no-runRUSTC_WRAPPER= cargo test -p openshell-server provider_refresh -- --nocaptureRUSTC_WRAPPER= cargo test -p openshell-providers -- --nocaptureRUSTC_WRAPPER= cargo test -p openshell-server provider_validation_errors -- --nocaptureRUSTC_WRAPPER= cargo test -p openshell-cli provider_create_allows_empty_credentials_for_gateway_refresh_profiles -- --nocaptureRUSTC_WRAPPER= cargo test -p openshell-cli provider_refresh_cli_run_functions_wire_requests -- --nocaptureRUSTC_WRAPPER= cargo test -p openshell-cli --lib -j1 refresh_status_table_includes_operational_fields -- --nocaptureRUSTC_WRAPPER= cargo test -p openshell-server --lib -j1 configure_provider_refresh_stores_scoped_status_and_provider_expiry -- --nocaptureRUSTC_WRAPPER= cargo test -p openshell-server -j1 delete_provider_refresh_preserves_manually_updated_expiry -- --nocaptureRUSTC_WRAPPER= cargo clippy -p openshell-server --all-targets -- -D warningsRUSTC_WRAPPER= cargo clippy -p openshell-cli --lib --tests -j1 -- -D warningsRUSTC_WRAPPER= cargo test -p openshell-cli http_health_check_supports_plain_http_endpoints -- --nocapturemise run pre-commitChecklist