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
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.
Click to show internal directories.
Click to hide internal directories.