aws / aws-secretsmanager-jdbc

The AWS Secrets Manager JDBC Library enables Java developers to easily connect to SQL databases using secrets stored in AWS Secrets Manager.
Apache License 2.0
161 stars 77 forks source link

Add PostgreSQL error code 28000 to authentication errors #224

Closed simonmarty closed 10 months ago

simonmarty commented 10 months ago

Issue #, if available:

Description of changes:

PostgreSQL Error Code 28000 is also considered as an authentication error

PostgreSQL Error Code 28000 is also considered as an authentication error in order to trigger secret refresh (together with 28P01 - invalid_password)

PostgreSQL Error Code 28000 (invalid_authorization_specification) is the error code returned by RDS Proxy when the secret is rotated in alternating user mode: refreshing the secret cache would address the issue https://github.com/aws/aws-secretsmanager-jdbc/issues/222.

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

codecov-commenter commented 10 months ago

Codecov Report

Attention: 1 lines in your changes are missing coverage. Please review.

Comparison is base (6073977) 72.47% compared to head (587d015) 72.20%.

Files Patch % Lines
...manager/sql/AWSSecretsManagerPostgreSQLDriver.java 0.00% 0 Missing and 1 partial :warning:
Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #224 +/- ## ============================================ - Coverage 72.47% 72.20% -0.28% - Complexity 124 125 +1 ============================================ Files 12 12 Lines 367 367 Branches 44 45 +1 ============================================ - Hits 266 265 -1 Misses 94 94 - Partials 7 8 +1 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.