-
Notifications
You must be signed in to change notification settings - Fork 654
Implement GitHub Actions OIDC processing #10520
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This pull request implements GitHub Actions OIDC processing and refactors the federated credential token validation system to support multiple identity providers. The changes introduce a new extensible architecture using the ITokenPolicyValidator
interface, allowing the system to handle both Entra ID and GitHub Actions tokens.
Key Changes:
- Introduced
ITokenPolicyValidator
interface to support multiple identity providers through a common pattern - Added GitHub Actions OIDC token validation and policy evaluation with
GitHubTokenPolicyValidator
- Refactored existing Entra ID validation to use the new interface pattern with
EntraIdTokenPolicyValidator
Reviewed Changes
Copilot reviewed 22 out of 22 changed files in this pull request and generated 4 comments.
Show a summary per file
File | Description |
---|---|
GitHubTokenPolicyValidator.cs | New validator for GitHub Actions OIDC tokens with comprehensive policy evaluation |
EntraIdTokenPolicyValidator.cs | Refactored Entra ID validator to implement new interface pattern |
ITokenPolicyValidator.cs | New interface defining contract for token validation and policy evaluation |
FederatedCredentialPolicyEvaluator.cs | Updated to work with multiple validators through the new interface |
OidcTokenEvaluationResult.cs | New result type replacing EvaluatedFederatedCredentialPolicies |
ServicesConstants.cs | Added NuGetAudience constant and converted string fields to const |
✨ Overview
This pull request introduces enhancements to the handling of federated credentials and token validation. The changes are meant to make the code easier to extend and support more identity providers like GitHub Actions
🔐 Token Validation Refactoring
Interface Renaming & Extension
Renamed
ITokenValidator
toITokenPolicyValidator
and extended it to support matchingFederatedCredentialPolicy
instances with incoming OIDC tokens.Entra ID Logic Isolation
Renamed
EntraIdTokenValidator
toEntraIdTokenPolicyValidator
and moved Entra ID-specific policy evaluation logic fromFederatedCredentialPolicyEvaluator
into this class.GitHub Actions Support
Introduced
GitHubTokenPolicyValidator
to handle validation of GitHub Actions OIDC tokens and evaluate trusted publishing policies for GitHub.Evaluator Refactor
Updated
FederatedCredentialPolicyEvaluator
to operate with a collection ofITokenPolicyValidator
implementations, enabling support for multiple identity providers.API Key Generation Flow
No changes were made to the API key generation process. Once an OIDC token is matched to a
FederatedCredentialPolicy
, the key generation logic remains consistent across providers.🧠 Policy Evaluation Improvements
Naming Clarity
Renamed
EvaluatedFederatedCredentialPolicies
toOidcTokenEvaluationResult
to reduce confusion withFederatedCredentialPolicyResult
.Documentation Enhancements
Added inline comments to both
OidcTokenEvaluationResult
andFederatedCredentialPolicyResult
to clarify their roles and usage.⚙️ Configuration Updates
Added
FederatedCredentialConfiguration.NuGetAudience
to support audience validation for tokens issued by publishers like GitHub Actions.Addresses https://github.com/NuGet/Engineering/issues/5887