Repository navigation
Added Microsoft Entra ID Support for Keyless Auth - #1778
lavaman131 wants to merge 4 commits into
Conversation
|
All contributors have signed the CLA ✍️ ✅ |
|
I have read the CLA Document and I hereby sign the CLA |
| pub fn load_auth( | ||
| codex_home: &Path, | ||
| model_provider_name: &str, | ||
| env_key: &Option<String>, |
There was a problem hiding this comment.
It is better to use Option<&str> than &Option<String>.
With Option<&str>, you can pass None directly without reference and convert Option<String> to Option<&str> by calling as_deref() method
|
hi @lavaman131 any news on this PR? |
|
much needed this! |
|
Bumping again, would really like this. |
|
Thanks for the contribution, and apologies for the slow response. We've received many PRs, and we don't have the bandwidth on the codex team to review all of them. We've updated our contribution guidelines to clarify that we're currently accepting contributions for bugs and security fixes, but we're not generally accepting new features at this time. We need to make sure that all new features compose well with both existing and upcoming features and fit into our roadmap. If you would like to propose a new feature, please file or upvote an enhancement request in the issue tracker. We will generally prioritize new features based on community feedback. |
|
Any chance to get it merged? |
Problem
This PR introduces support for Microsoft Entra ID as a keyless authentication method for Azure OpenAI, refactors token handling, and enhances configuration and error management across multiple modules. The changes primarily focus on enabling seamless integration with Azure services, improving token caching mechanisms, and updating the authentication logic. It follows up on some of @thegovind's work [#769, #92] adding support for Azure OpenAI, but now in the new Rust API and without introducing any new dependencies to the project.
Why?
Many companies have API keys disabled (Microsoft is one example) for security reasons preventing access to
codex. This would allow for more developers to be able to use the CLI.Changes
Support for Microsoft Entra ID and Azure OpenAI Integration:
AuthMode::MicrosoftEntraIDto support keyless authentication via Microsoft Entra ID. Updated token retrieval logic to use Azure CLI for fetching access tokens and implemented caching with expiration checks (codex-rs/login/src/lib.rs). [1] [2]load_authfunction to handle Azure-specific configurations, including environment variables and model provider names (codex-rs/login/src/lib.rs). [1] [2]run_login_status,run_main,init_codex, etc.) to pass model provider details for authentication (codex-rs/cli/src/login.rs,codex-rs/cli/src/proto.rs,codex-rs/core/src/codex_wrapper.rs,codex-rs/tui/src/lib.rs). [1] [2] [3] [4]Configuration Enhancements:
config.md, including instructions for setting up Azure CLI and modifying thecodexconfiguration file (codex-rs/config.md). [1] [2]ModelClientfor Azure-specific API requirements, ensuring proper URL construction (codex-rs/core/src/client.rs). [1] [2]Code Refactoring and Cleanup:
client.rsto improve readability and removed unused dependencies (codex-rs/core/src/client.rs). [1] [2]codex-rs/login/src/lib.rs). [1] [2]Error Handling Improvements:
codex-rs/core/src/client.rs,codex-rs/login/src/lib.rs). [1] [2]codex-rs/login/src/lib.rs).