stdpgxiamfx

package
v0.0.246 Latest Latest
Warning

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

Go to latest
Published: Nov 6, 2026 License: MIT Imports: 10 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package stdpgxiamfx provides RDS IAM authentication for stdpgxfx connection pools.

It provides a stdpgxfx.IamTokenFunc that builds a fresh RDS IAM auth token for every new connection. It requires an aws.Config in the fx graph (e.g., from stdawsfx.Provide()) and only takes effect when STDPGX_IAM_AUTH is enabled.

The signing region is derived per-connection from the RDS hostname (e.g., "mycluster.cluster-xxx.eu-central-1.rds.amazonaws.com" → "eu-central-1"). This means a derived pool that points at a different regional endpoint (e.g., a reader endpoint in another region, possibly set through STDPGX_HOSTS) signs tokens against that region automatically. The hostname must match the standard regional RDS pattern; non-RDS hostnames (e.g., custom domains, RDS Proxy aliases, the global writer endpoint) are not supported.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DeriveSigningRegion

func DeriveSigningRegion(host string) string

DeriveSigningRegion attempts to extract the AWS region from the given host using the standard RDS regional hostname format. Returns an empty string if the host doesn't match the regional pattern.

func New

func New(awsCfg aws.Config, logs *zap.Logger) (stdpgxfx.IamTokenFunc, error)

New constructs the IAM token func that stdpgxfx uses when IAM auth is enabled.

func Provide

func Provide() fx.Option

Provide the IAM token func as an fx dependency for stdpgxfx.

Types

This section is empty.

Jump to

Keyboard shortcuts

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