Skip to content

Add support for AWS IAM authentication to RDS instances#4036

Open
wronghost wants to merge 3 commits intonuts-foundation:masterfrom
wronghost:master
Open

Add support for AWS IAM authentication to RDS instances#4036
wronghost wants to merge 3 commits intonuts-foundation:masterfrom
wronghost:master

Conversation

@wronghost
Copy link

This pull request introduces AWS RDS IAM authentication support for the SQL storage backend, enabling secure database connections using temporary IAM tokens instead of static passwords. The implementation is opt-in, backward compatible, and includes comprehensive documentation, configuration options, and automated token management for both PostgreSQL and MySQL. Several new files, configuration parameters, and dependencies have been added to support this feature.

Major features and changes:

1. AWS RDS IAM Authentication Implementation

  • Added new implementation in storage/rds_iam.go for managing IAM token generation, connection string modification, and background token refresh logic.
  • Unit tests (storage/rds_iam_test.go), documentation (storage/RDS_IAM_AUTHENTICATION.md), and example configuration (storage/rds_iam_example_config.yaml) have been included.
  • Quick start guide provided in storage/QUICKSTART_RDS_IAM.md for rapid setup and troubleshooting.

2. Configuration and Usage

  • New configuration options added for enabling and customizing RDS IAM authentication (storage.sql.rdsiam.enabled, region, dbuser, tokenrefreshinterval) with detailed descriptions in README.rst.
  • Example YAML configuration and usage instructions provided in documentation. [1] [2]

3. Codebase and Dependency Updates

  • storage/config.go and storage/engine.go updated to integrate RDS IAM authentication, including token management and background refresh routines.
  • AWS SDK v2 dependencies added to go.mod to enable IAM token generation and AWS integration. [1] [2]

4. Security and Compatibility

  • No passwords stored in configuration when IAM is enabled; relies on AWS credential chain and best practices.
  • Feature is fully backward compatible and disabled by default, ensuring no breaking changes for existing users.

5. Documentation and Testing

  • Comprehensive documentation and testing provided, including implementation summary, setup guides, and passing unit tests for all new logic. [1] [2]

These changes collectively provide a secure, automated, and well-documented way to use AWS RDS IAM authentication with the Nuts node SQL storage backend.

@qltysh
Copy link

qltysh bot commented Feb 18, 2026

Qlty

Coverage Impact

⬇️ Merging this pull request will decrease total coverage on master by 0.30%.

Modified Files with Diff Coverage (3)

RatingFile% DiffUncovered Line #s
Coverage rating: C Coverage rating: D
storage/engine.go29.3%124-126, 261-269...
Coverage rating: F Coverage rating: F
storage/cmd/cmd.go0.0%52-62
New file Coverage rating: F
storage/rds_iam.go48.3%66, 74-75, 83-86...
Total40.7%
🤖 Increase coverage with AI coding...

In the `master` branch, add test coverage for this new code:

- `storage/cmd/cmd.go` -- Line 52-62
- `storage/engine.go` -- Lines 124-126, 261-269, 278, 287-293, and 306-522
- `storage/rds_iam.go` -- Lines 66, 74-75, 83-86, 102, 104, 109-139, 146-147, 171-172, 181-184, 195-197, 205-206, and 219-260

🚦 See full report on Qlty Cloud »

🛟 Help
  • Diff Coverage: Coverage for added or modified lines of code (excludes deleted files). Learn more.

  • Total Coverage: Coverage for the whole repository, calculated as the sum of all File Coverage. Learn more.

  • File Coverage: Covered Lines divided by Covered Lines plus Missed Lines. (Excludes non-executable lines including blank lines and comments.)

    • Indirect Changes: Changes to File Coverage for files that were not modified in this PR. Learn more.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant

Comments