provision

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Mar 18, 2026 License: MIT Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Cleaner

type Cleaner struct {
	// contains filtered or unexported fields
}

Cleaner periodically drops idle dynamic PG users.

func NewCleaner

func NewCleaner(adminUser, adminPassword, adminDatabase, backend, userPrefix string, ttl time.Duration, store *restrict.RedisStore, m *metrics.Metrics, logger *slog.Logger) *Cleaner

NewCleaner creates a new user cleanup worker.

func (*Cleaner) Run

func (c *Cleaner) Run(ctx context.Context)

Run starts the cleanup loop. Blocks until ctx is cancelled.

type Provisioner

type Provisioner struct {
	// contains filtered or unexported fields
}

Provisioner manages dynamic PostgreSQL user lifecycle.

func NewProvisioner

func NewProvisioner(adminUser, adminPassword, adminDatabase, backend, userPrefix string, store *restrict.RedisStore, logger *slog.Logger) *Provisioner

NewProvisioner creates a new Provisioner.

func (*Provisioner) EnsureUser

func (p *Provisioner) EnsureUser(ctx context.Context, loginName, nodeName, database string, perms *auth.DBPermissions) (string, string, error)

EnsureUser creates or updates a dynamic PG role for the given identity, node, and database. Returns the PG username and password.

type SQLTemplateData

type SQLTemplateData struct {
	Role string // Sanitized PG role identifier
}

SQLTemplateData holds the variables available in SQL templates.

Jump to

Keyboard shortcuts

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