awsauth

package
v1.1.0-beta.6 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 4, 2026 License: ISC Imports: 5 Imported by: 0

Documentation

Overview

Package awsauth provides shared AWS IAM authentication helpers for PostgreSQL connectors.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GenerateDBAuthToken

func GenerateDBAuthToken(ctx context.Context, host, port, username, region string) (string, error)

GenerateDBAuthToken uses the AWS SDK to build a short-lived RDS IAM authentication token. Credentials are resolved via the standard SDK chain: environment variables, ~/.aws/credentials, EC2/ECS instance metadata, etc.

auth.BuildAuthToken has a bug (https://github.com/aws/aws-sdk-go-v2/issues/3365) where it produces a token without a "/" path component (host:port?Action=... instead of host:port/?Action=...). The SigV4 canonical URI is therefore "" instead of "/", which does not match what RDS expects, causing PAM authentication failure. We insert the missing slash after the fact.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL