feat: deferred credential resolution with user consent#1111
Closed
huang195 wants to merge 1 commit intoNVIDIA:mainfrom
Closed
feat: deferred credential resolution with user consent#1111huang195 wants to merge 1 commit intoNVIDIA:mainfrom
huang195 wants to merge 1 commit intoNVIDIA:mainfrom
Conversation
Add runtime credential resolution that prompts the user (via OS-native dialog) before sharing secrets with sandboxes. When a provider is created with the sentinel value "openshell:deferred", credentials are not stored on the gateway. Instead, the CLI registers as a credential authority via a bidirectional gRPC stream, and the sandbox L7 proxy requests credentials on-demand when outbound API calls require them. Key components: - Proto: ResolveCredential and RegisterCredentialAuthority RPCs - Server: CredentialAuthorityRegistry with generation-based unregister - Sandbox: DeferredCredentialResolver with fail-closed semantics - CLI: credential_authority module with macOS/Linux dialog support The feature is fully backward compatible — existing providers with real credential values continue to work unchanged. Deferred mode is opt-in via the "openshell:deferred" sentinel in the credential value. Signed-off-by: Hai Huang <haihuang@us.ibm.com> Signed-off-by: Hai Huang <huang195@gmail.com>
|
Thank you for your submission! We ask that you sign our Developer Certificate of Origin before we can accept your contribution. You can sign the DCO by adding a comment below using this text: I have read the DCO document and I hereby sign the DCO. You can retrigger this bot by commenting recheck in this Pull Request. Posted by the DCO Assistant Lite bot. |
|
Thank you for your interest in contributing to OpenShell, @huang195. This project uses a vouch system for first-time contributors. Before submitting a pull request, you need to be vouched by a maintainer. To get vouched:
See CONTRIBUTING.md for details. |
Author
|
I have read the DCO document and I hereby sign the DCO. |
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 runtime credential resolution that prompts the user via OS-native dialog before sharing secrets with sandboxes. Secrets never leave the user's machine until explicitly approved per-request.
ResolveCredential,RegisterCredentialAuthority) + 4 additive messagesCredentialAuthorityRegistrywith generation-based unregister to prevent race conditionsDeferredCredentialResolverwith fail-closed semantics in the L7 proxycredential_authoritymodule with macOS (AppleScript) and Linux (zenity) dialog supportHow to use deferred credentials
Automatic (interactive sandbox connect)
When connecting to a sandbox that requires a provider but no local credentials are found:
Explicit (manual provider creation)
How it works
The secret is held in sandbox memory only for the session duration - it is never persisted to disk or stored on the gateway.
Analogy
Like
ssh-add -c(SSH agent with confirmation): your API key stays on your laptop, and the remote sandbox can only use it when you explicitly approve - one request at a time.Backward compatibility
config_environmentfield (proto default: empty map)openshell:deferredsentinel valueTest plan
cargo build -p openshell-sandbox -p openshell-server -p openshell-clicargo test -p openshell-sandbox- existing tests passcargo test -p openshell-server- provider env resolution tests updated--credential KEY=openshell:deferred- deferred provider storedsandbox connectspawns credential authority (visible in debug logs)