-
Notifications
You must be signed in to change notification settings - Fork 882
Enhance Bearer Authentication Support with Azure IMDS #2523
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
base: master
Are you sure you want to change the base?
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 PR enhances the Schema Registry client with Azure Instance Metadata Service (IMDS) authentication support, adding a new OAuth bearer authentication method that uses Azure's metadata service for secret-less token retrieval.
- Introduces
OAuthBearerAzureIMDS
authentication method with supporting infrastructure - Refactors existing authentication providers to use a builder pattern for better extensibility
- Adds comprehensive test coverage for the new Azure IMDS authentication scenarios
Reviewed Changes
Copilot reviewed 24 out of 24 changed files in this pull request and generated 6 comments.
Show a summary per file
File | Description |
---|---|
src/Confluent.SchemaRegistry/AuthCredentialsSource.cs |
Adds new OAuthBearerAzureIMDS enum value |
src/Confluent.SchemaRegistry/SchemaRegistryConfig.cs |
Adds new token endpoint query property and configuration mapping |
src/Confluent.SchemaRegistry/Rest/RestService.cs |
Refactors authentication provider creation to use builder pattern |
src/Confluent.SchemaRegistry/Rest/Authentication/OAuth/AzureIMDS/ |
Implements Azure IMDS authentication provider and builder |
src/Confluent.SchemaRegistry/Rest/Authentication/OAuth/ |
Introduces builder pattern classes for authentication providers |
src/Confluent.SchemaRegistry/Rest/Authentication/AbstractBearerAuthenticationHeaderValueProvider.cs |
Creates abstract base class for bearer authentication providers |
src/Confluent.SchemaRegistry/Rest/Authentication/BearerAuthenticationHeaderValueProvider.cs |
Refactors to extend abstract base class |
src/Confluent.SchemaRegistry/CachedSchemaRegistryClient.cs |
Updates property validation to include new Azure IMDS configuration |
test/Confluent.SchemaRegistry.UnitTests/CachedSchemaRegistryClient.cs |
Adds comprehensive test cases for Azure IMDS authentication |
examples/ |
Adds example demonstrating Azure IMDS usage |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
...chemaRegistry.UnitTests/Rest/Authentication/StaticBearerAuthenticationHeaderValueProvider.cs
Show resolved
Hide resolved
...stry/Rest/Authentication/OAuth/AzureIMDS/AzureIMDSBearerAuthenticationHeaderValueProvider.cs
Outdated
Show resolved
Hide resolved
This comment has been minimized.
This comment has been minimized.
- Introduced OAuthBearerAzureIMDS as a new authentication method in AuthCredentialsSource. - Updated CachedSchemaRegistryClient to support new Azure IMDS authentication configuration. - Implemented AzureIMDSBearerAuthenticationHeaderValueProvider for token retrieval using Azure Instance Metadata Service. - Added AzureIMDSBearerAuthenticationHeaderValueProviderBuilder to construct the new provider. - Refactored existing authentication header value providers to use a builder pattern for better extensibility. - Updated SchemaRegistryConfig to include new properties for Azure IMDS token endpoint and query parameters. - Enhanced unit tests to cover new Azure IMDS authentication scenarios.
62fd1b8
to
8ac4f79
Compare
OAuthBearerAzureIMDS
as a new authentication method inAuthCredentialsSource
.CachedSchemaRegistryClient
to support new Azure IMDS authentication configuration.AzureIMDSBearerAuthenticationHeaderValueProvider
for token retrieval using Azure Instance Metadata Service.AzureIMDSBearerAuthenticationHeaderValueProviderBuilder
to construct the new provider.SchemaRegistryConfig
to include new properties for Azure IMDS token endpoint and query parameters.What
Checklist
References
JIRA:
Test & Review
Unit tests are present. Will attach test results on an Azure instance.
Open questions / Follow-ups