feat: rename to laravel-iam-auth and add AWS credential caching#2
Merged
feat: rename to laravel-iam-auth and add AWS credential caching#2
Conversation
A single cache_store config now controls both RDS token caching and AWS credential caching (with separate cache keys and TTLs). This removes the redundant credential_cache option.
…ovider type Extract duplicated assertSafeCacheStore logic from RdsTokenProvider and AwsCredentialCache into a shared ValidatesCacheStore trait. Change RdsTokenProvider constructor type from mixed to \Closure.
… constraint - Prefix credential cache key to iam_auth:aws_credentials to avoid collisions - Flush file cache in test to prevent flakiness from prior runs - Re-add explicit aws/aws-sdk-php ^3.249 constraint as a guard - Update README requirements to reflect both dependencies
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 22 out of 22 changed files in this pull request and generated no new comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Add resolveCacheStore() to ValidatesCacheStore trait so that misconfigured store names produce an error pointing to iam-auth config. Add tests for valid and nonexistent cache stores. Clean up unnecessary curly braces and replace qualified class names with imports.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 22 out of 22 changed files in this pull request and generated 2 comments.
Comments suppressed due to low confidence (1)
tests/RdsTokenProviderTest.php:69
test_caches_token_in_laravel_cache_storedoesn’t clear thefilecache store before assertingcreateToken()is called exactly once. If another test run (or a prior test in this suite) has already populated the same cache key,createToken()may be called 0 times and the test becomes order-dependent/flaky. Flush the configured store at the start of this test (or use a unique cache key per test).
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
…re once Return a rejected promise instead of throwing when credential resolution fails, preserving the AWS SDK credential provider contract. Also resolve the Laravel cache store into a local variable to avoid redundant lookups.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 22 out of 22 changed files in this pull request and generated no new comments.
Comments suppressed due to low confidence (1)
tests/RdsTokenProviderTest.php:68
test_caches_token_in_laravel_cache_store()doesn’t clear thefilecache store before assertingcreateToken()is called exactly once. If that cache key exists from a prior test run (or if test order changes), this test can incorrectly skip token generation and fail. Flush/forget the relevant cache key (or flush the store) at the start of this test to make it order-independent.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
hackthebox/laravel-rds-iam-authtohackthebox/laravel-iam-authAwsCredentialCacheinto the AWS SDK viaaws/aws-sdk-php-laravelextension, so all SDK calls (S3, SQS, SES, etc.) benefit from cached credentialscredential_providerconfig to apply globally to all SDK operationsRdsTokenProviderto use injected credential provider from the SDK singletonBreaking Changes (v2.0.0)
hackthebox/laravel-rds-iam-auth->hackthebox/laravel-iam-authHackthebox\RdsIamAuth->Hackthebox\IamAuthrds-iam-auth.php->iam-auth.phpRDS_IAM_*->IAM_AUTH_*RdsIamMySqlConnector->IamMySqlConnector)aws/aws-sdk-php-laravel(required)Migration from v1.x
hackthebox/laravel-rds-iam-authtohackthebox/laravel-iam-authconfig/rds-iam-auth.phptoconfig/iam-auth.phpRDS_IAM_*toIAM_AUTH_*Hackthebox\RdsIamAuthtoHackthebox\IamAuthTest plan