iampostgres

package
v0.0.0-...-c407d37 Latest Latest
Warning

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

Go to latest
Published: Apr 12, 2024 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

View Source
const CustomPostgres string = "custompostgres"

CustomPostgres is used to set the driverName to the custom postgres driver

Variables

This section is empty.

Functions

func EnableIAM

func EnableIAM(host string, port string, region string, user string, passTemplate string, creds aws.CredentialsProvider, rus RDSUtilService, waitDuration time.Duration, logger *zap.Logger, shouldQuitChan chan bool) error

EnableIAM enables the use of IAM and pulls first credential set as a sanity check Note: This method is intended to be non-blocking, so please add any changes to the goroutine Note: Ensure the timer is on an interval lower than 15 minutes (AWS RDS IAM auth limit)

Types

type RDSPostgresDriver

type RDSPostgresDriver struct {
}

RDSPostgresDriver implemements driver.DriverContext

func (*RDSPostgresDriver) Open

func (d *RDSPostgresDriver) Open(_ string) (driver.Conn, error)

func (*RDSPostgresDriver) OpenConnector

func (d *RDSPostgresDriver) OpenConnector(dsn string) (driver.Connector, error)

From go's documentation:

If a Driver implements DriverContext, then sql.DB will call OpenConnector to obtain a Connector and then invoke that Connector's Connect method to obtain each needed connection, instead of invoking the Driver's Open method for each connection. The two-step sequence allows drivers to parse the name just once and also provides access to per-Conn contexts.

Milmove wants this for IAM Authentication so we can update the auth token before connect

type RDSU

type RDSU struct{}

RDSU type

func (RDSU) GetToken

func (r RDSU) GetToken(ctx context.Context, endpoint string, region string, user string, iamcreds aws.CredentialsProvider) (string, error)

GetToken is implementation around AWS RDS Utils BuildAuthToken

type RDSUtilService

type RDSUtilService interface {
	GetToken(context.Context, string, string, string, aws.CredentialsProvider) (string, error)
}

RDSUtilService Lightweight Interface for AWS RDS Utils

Jump to

Keyboard shortcuts

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