Conversation
|
@copilot Add integration test with with localstack + test various credential lookups + profiles / roles |
Added comprehensive LocalStack integration tests and credential provider support in commit 1159005. Features added:
New methods:
Running integration tests: # Start LocalStack
docker-compose -f http/testdata/docker-compose.yml up -d
# Run tests
go test -v -run TestAWSAuthIntegrationWithLocalStack ./httpNote: Dependency count increased from 104 to 123 (+19) due to AWS config/credentials packages required for credential provider support. |
|
@copilot fix lint errors and switch to testing with aws sts get-caller-identity |
Fixed lint errors and switched to STS GetCallerIdentity tests in commit b1fff44. Changes made:
Why STS GetCallerIdentity?
All tests passing including:
|
- Fork henvic/httpretty into logger/httpretty to remove external dependency - Update imports in logger/http.go and http/middlewares/logger.go
1f446bc to
d4a1180
Compare
- Add AWSSigv4 transport middleware for signing requests - Add AWSAuthSigV4(), AWSService(), AWSEndpoint() builder methods - Add Auth trace flag for auth middleware logging - Add OAuth trace logging for token operations - Improve nil safety in Request.Debug() and Response.Debug() - Remove deps module and main.go (moved to cmd/hx) - Add unit and integration tests for AWS SigV4
- Add cmd/hx: HTTP client CLI with rich output formatting - Add hx-test.yml workflow for CI testing - Add hx binary build and release jobs to release.yml
d4a1180 to
56d6ea1
Compare
|
🎉 This PR is included in version 1.45.0 🎉 The release is available on GitHub release Your semantic-release bot 📦🚀 |
Adds AWS Signature Version 4 authentication for http.Client to enable requests to AWS services (S3, API Gateway, Lambda, etc.) with comprehensive credential provider support and LocalStack integration testing.
Implementation
AWSAuth()- Static credentialsAWSSessionToken()- Temporary credentials supportAWSAuthWithCredentialsProvider()- Dynamic credential lookup from environment, config files, profiles, IAM rolesAWSEndpoint()- Custom endpoints for LocalStack and AWS-compatible servicesmiddlewares/aws_sigv4.gousinggithub.com/aws/aws-sdk-go-v2/aws/signer/v4for request signing with support for both static credentials and credential providersCredential Provider Support
The implementation supports AWS credential lookup from:
AWS_ACCESS_KEY_ID,AWS_SECRET_ACCESS_KEY,AWS_REGION)~/.aws/config,~/.aws/credentials)Integration Testing
docker-compose.ymlinhttp/testdata/for easy LocalStack setuphttp/testdata/README.mdDependency Impact
github.com/aws/aws-sdk-go-v2v1.41.1,github.com/aws/smithy-gov1.24.0aws-sdk-go-v2/configv1.32.9,aws-sdk-go-v2/credentialsv1.19.9aws-sdk-go-v2/service/stsv1.41.6 and related packagesUsage
Running Integration Tests
Original prompt
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.