Skip to content

Conversation

@gpeal
Copy link
Collaborator

@gpeal gpeal commented Oct 7, 2025

This lets users/companies explicitly choose whether to force/disallow the keyring/fallback file storage for mcp credentials.

People who develop with Codex will want to use this until we sign binaries or else each ad-hoc debug builds will require keychain access on every build. I don't love this and am open to other ideas for how to handle that.

mcp_oauth_credentials_store = "auto"
mcp_oauth_credentials_store = "file"
mcp_oauth_credentials_store = "keyrung"

Defaults to auto

@gpeal gpeal requested a review from bolinfest October 7, 2025 01:17
@gpeal gpeal force-pushed the gpeal/oauth-store-config branch from 18b8e7c to 072c57b Compare October 7, 2025 02:31
@gpeal gpeal force-pushed the gpeal/oauth-store-config branch from 072c57b to 0f21d19 Compare October 7, 2025 02:34
@gpeal
Copy link
Collaborator Author

gpeal commented Oct 7, 2025

@codex review this

@chatgpt-codex-connector
Copy link
Contributor

Codex Review: Didn't find any major issues. More of your lovely PRs please.

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting

pub mcp_servers: HashMap<String, McpServerConfig>,

/// Preferred store for MCP OAuth credentials.
/// keyring: Use an OS-specific keyring service.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This implies we are guaranteed to support only one keyring service per OS. Does that feel future-proof?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we could achieve that with a second level field like keyring_provider but it's hard to know exactly what we'll want in the future here.

url: &str,
store_mode: OAuthCredentialsStoreMode,
) -> Result<bool> {
let keyring_store = RealKeyringStore;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I find it a bit hard to follow why some functions take a KeyringStore and others inline RealKeyringStore.

I would expect taking it as a param (or expanding the trait to have more methods, which can have default implementations) to be more common.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The public one doesn't take a store, then there is an internal wrapper that takes the store as a param so the public API can pass in the default impl while tests can pass in a mock. tl;dr it's for unit tests.

@gpeal gpeal merged commit 496cb80 into main Oct 8, 2025
20 checks passed
@gpeal gpeal deleted the gpeal/oauth-store-config branch October 8, 2025 02:39
@github-actions github-actions bot locked and limited conversation to collaborators Oct 8, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants