[AAPRFE-955] feat: add OAuth2 Client Credentials managed credential type#1541
[AAPRFE-955] feat: add OAuth2 Client Credentials managed credential type#1541amasolov wants to merge 1 commit into
Conversation
|
Warning Rate limit exceeded
To keep reviews running without waiting, you can enable usage-based add-on for your organization. This allows additional reviews beyond the hourly cap. Account admins can enable it under billing. ⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Enterprise Run ID: ⛔ Files ignored due to path filters (1)
📒 Files selected for processing (7)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Review rate limit: 0/1 reviews remaining, refill in 12 minutes and 44 seconds.Comment |
Add a new managed credential type that fetches OAuth2 access tokens using the client_credentials grant. This enables external credential lookups against any OAuth2 provider (Microsoft Entra/Azure AD, Keycloak, Okta, etc.) for use in rulebook activations and other EDA workflows. Changes: - Register oauth2_client_credentials_plugin in PLUGIN_TYPES - Add DefaultCredentialType.OAUTH2_CLIENT_CREDENTIALS enum value - Define OAUTH2_CLIENT_CREDENTIALS_INPUTS schema and seed via create_initial_data management command - Add credentials-oauth2-client-credentials extra to awx-plugins-core dependency - Add unit tests for plugin registration, dispatch, and initial data seeding Depends-On: ansible/awx-plugins#185 Signed-off-by: Alexey Masolov <amasolov@redhat.com> Made-with: Cursor
afd616a to
3d37929
Compare
|
Note on CI failures: All current CI failures are expected. This PR adds a dependency on the The extra is introduced in ansible/awx-plugins#185. CI will pass once that PR merges and a new |
|
@amasolov thanks for the contribution. Lets put this PR in draft state pending the release of the dependency in awx-plugins. |
|
@ttuffin done, thanks for not minding me trying to understand how it all works |
Add a new managed credential type that fetches OAuth2 access tokens using the
client_credentialsgrant. This enables external credential lookups against any OAuth2-compliant identity provider (Microsoft Entra/Azure AD, Keycloak, Okta, etc.) for use in rulebook activations and other EDA workflows.This addresses AAPRFE-955, which requests Azure Service Principal authentication support as an alternative to PATs. The credential type implemented here is the prerequisite for that capability.
What is being changed?
oauth2_client_credentials_pluginfromawx_plugins.credentials.oauth2in thePLUGIN_TYPESregistryDefaultCredentialType.OAUTH2_CLIENT_CREDENTIALSenum valueOAUTH2_CLIENT_CREDENTIALS_INPUTSschema (fields:token_url,client_id,client_secret; metadata:scope) and seed viacreate_initial_datacredentials-oauth2-client-credentialsextra to theawx-plugins-coredependency inpyproject.tomlrun_plugindispatch, and initial data seedingWhy is this change needed?
Customers using Azure DevOps with Microsoft Entra service principals, or other OAuth2 providers for machine-to-machine authentication, currently have no built-in way to fetch short-lived access tokens as EDA credentials. This credential type fills that gap with a generic, provider-agnostic implementation.
Does this change introduce any new dependencies, blockers, or breaking changes?
This PR depends on ansible/awx-plugins#185, which adds the
oauth2_client_credentials_plugintoawx-plugins-core. It cannot merge until that PR lands and a newawx-plugins-corerelease includes thecredentials-oauth2-client-credentialsoptional extra. No breaking changes.How can it be tested?
pytest tests/unit/test_oauth2_credential_plugin.py tests/unit/test_credential_plugins.py tests/unit/commands/test_create_initial_data.pycreate_initial_data, verify the "OAuth2 Client Credentials Token Lookup" credential type appears in the API at/api/eda/v1/credential-types/Note: This PR was developed with assistance from Claude AI assistant.
Made with Cursor