Skip to content

refactor: look up the HMAC key for each row in the KMS PostgreSQL trigger - #216

Open
aaron-congo wants to merge 1 commit into
mainfrom
fix/kms-pg-trigger-cache
Open

aaron-congo wants to merge 1 commit into
mainfrom
fix/kms-pg-trigger-cache

Conversation

@aaron-congo

Copy link
Copy Markdown
Contributor

The PostgreSQL trigger now reads the column's HMAC key from key_storage for every row instead of keeping a per-transaction copy in a setting, which simplifies the trigger SQL.

Measured on PostgreSQL 16, the lookup adds about 3 microseconds per row for multi-row transactions and no measurable cost for single-row transactions.

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

…gger

The PostgreSQL trigger now reads the column's HMAC key from key_storage
for every row instead of keeping a per-transaction copy in a setting,
which simplifies the trigger SQL.

Measured on PostgreSQL 16, the lookup adds about 3 microseconds per row
for multi-row transactions and no measurable cost for single-row
transactions.
@aaron-congo
aaron-congo requested a review from a team as a code owner October 20, 2026 00:11
Comment thread CHANGELOG.md
- [Federated Authentication Plugin](https://aws.github.io/aws-advanced-wrapper-docs/ruby/using-plugins/federated-auth), which authenticates with Active Directory Federation Services (AD FS), exchanges the resulting SAML assertion for temporary AWS credentials via STS, and connects to the database with an RDS IAM authentication token. Enabled with the `federated_auth` plugin code ([PR #207](https://github.com/aws/aws-advanced-ruby-driver-wrapper/pull/207)).

### :crab: Changed
- Simplified the KMS Encryption Plugin's PostgreSQL trigger SQL to read the column's HMAC key from `key_storage` for every row. Re-run the trigger SQL from the [documentation](https://aws.github.io/aws-advanced-wrapper-docs/ruby/using-plugins/kms-encryption) to update existing deployments ([PR #216](https://github.com/aws/aws-advanced-ruby-driver-wrapper/pull/216)).

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could we add a more specific link in the docs ie. the specific section of the page so people can find the trigger easier?

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.

2 participants