Skip to content

Current PgErrorText doesn't work when using AWS RDS IAM Authentication #437

@bradbeck

Description

@bradbeck

The current definition of PgErrorText prevents re-authentication when using awsrds.

The authentication error when using awsrds is as follows:

... PAM authentication failed for user ...

Since PgErrorText is currently password authentication failed for user, it fails to match in the AuthError handler.

Changing PgErrorText to authentication failed for user appears to allow it to function as expected.
I've tested this locally by overriding PostgreSQLAuthError before creating a store or connector: e.g.

driver.PostgreSQLAuthError = func(e error) bool {
  return strings.Contains(strings.ToLower(e.Error()), "authentication failed for user") || errors.Is(e, sqldriver.ErrBadConn)
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions