auth

package
v0.6.2 Latest Latest
Warning

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

Go to latest
Published: Feb 13, 2026 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Overview

Package auth provides functionality for dynamic database authentication.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewAuthToken added in v0.6.2

func NewAuthToken(
	ctx context.Context,
	cfg *config.DatabaseConfig,
	user string,
) (string, error)

NewAuthToken creates a new dynamic authentication token for the given user. Returns an empty string if dynamic authentication is not configured. The returned token can be used as a password in a PostgreSQL connection string. This is useful for short-lived connections (e.g., migrations) where a BeforeConnect hook cannot be used.

func NewDynamicAuth

func NewDynamicAuth(
	ctx context.Context,
	cfg *config.DatabaseConfig,
	user string,
) (func(ctx context.Context, connConfig *pgx.ConnConfig) error, error)

NewDynamicAuth creates a new dynamic authentication function based on the configuration.

Types

This section is empty.

Directories

Path Synopsis
Package aws implements dynamic authentication for AWS RDS IAM.
Package aws implements dynamic authentication for AWS RDS IAM.

Jump to

Keyboard shortcuts

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