-
Notifications
You must be signed in to change notification settings - Fork 2
feat: Add IAM authentication support #125
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
35df88c to
83f27cd
Compare
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 adds support for IAM (Identity and Access Management) authentication alongside existing password-based authentication for connecting to AWS ElastiCache and MemoryDB services.
- Introduces new authentication types including
ServerCredentials,IamAuthConfig, andServiceTypeenums - Updates configuration builders to support both password-based and IAM authentication modes
- Adds a manual IAM token refresh capability via
RefreshIamTokenAsync()
Reviewed Changes
Copilot reviewed 12 out of 12 changed files in this pull request and generated 14 comments.
Show a summary per file
| File | Description |
|---|---|
| sources/Valkey.Glide/ServiceType.cs | Defines enum for AWS service types (ElastiCache and MemoryDB) |
| sources/Valkey.Glide/IamAuthConfig.cs | Configuration class for IAM authentication parameters |
| sources/Valkey.Glide/ServerCredentials.cs | Unified credentials class supporting both password and IAM auth modes |
| sources/Valkey.Glide/ConnectionConfiguration.cs | Updated builders with new authentication methods and credential handling |
| sources/Valkey.Glide/Internals/FFI.structs.cs | Extended FFI structures to include IAM credentials and service type enum |
| sources/Valkey.Glide/Internals/FFI.methods.cs | Added FFI method declaration for IAM token refresh |
| sources/Valkey.Glide/BaseClient.cs | Added public RefreshIamTokenAsync() method for manual token refresh |
| sources/Valkey.Glide/Abstract/ConnectionMultiplexer.cs | Updated to use new WithAuthentication method |
| rust/src/lib.rs | Implemented Rust FFI function for IAM token refresh |
| tests/Valkey.Glide.UnitTests/ServerCredentialsTests.cs | Unit tests for ServerCredentials class |
| tests/Valkey.Glide.UnitTests/ConnectionConfigurationTests.cs | Unit tests for authentication configuration |
| README.md | Updated examples to demonstrate IAM authentication usage |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
de11510 to
0cf4a7e
Compare
jbrinkman
left a comment
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.
LGTM with minor change. ![]()
dbc5eac to
5e74218
Compare
Signed-off-by: currantw <[email protected]>
…ntials` struct. Signed-off-by: currantw <[email protected]>
Signed-off-by: currantw <[email protected]>
Signed-off-by: currantw <[email protected]>
Signed-off-by: currantw <[email protected]>
Signed-off-by: currantw <[email protected]>
…FI method in `lib.rs`. Also add some documentation. Signed-off-by: currantw <[email protected]>
Signed-off-by: currantw <[email protected]>
Signed-off-by: currantw <[email protected]>
…ke cluster name and region non null. Signed-off-by: currantw <[email protected]>
Signed-off-by: currantw <[email protected]>
… enum to FFI, fix linting errors Signed-off-by: currantw <[email protected]>
Signed-off-by: currantw <[email protected]>
Signed-off-by: currantw <[email protected]>
Signed-off-by: currantw <[email protected]>
Signed-off-by: currantw <[email protected]>
Signed-off-by: currantw <[email protected]>
Signed-off-by: currantw <[email protected]>
5e74218 to
c217dd9
Compare
Overview
This PR implements IAM authentication support, enabling secure connections to AWS ElastiCache and MemoryDB clusters using IAM credentials instead of static passwords.
Key Features
IamAuthConfigServerCredentials, andServiceTypeclasses for configuring IAM authentication. Matches other clients. Type-safe constructors prevent invalid statesRefreshIamTokenAsync()method for manual IAM token refreshWithAuthentication()methods supporting IAM parameters to configuration buildersImplementation Details
Core Components
IamAuthConfig,ServiceType,ServerCredentials.RefreshIamTokenFfimethod with comprehensive error handling.refresh_iam_tokenfunction callingglide-core.Testing
Usage Example
Compatibility