auth

package
v1.10.1 Latest Latest
Warning

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

Go to latest
Published: Oct 28, 2024 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrInvalidCredentialsPasswordMissing = fmt.Errorf("invalid_credentials_password_missing")

Functions

func GetSourceDataFromDSN

func GetSourceDataFromDSN(ctx context.Context, cli client.Reader, dbClaim *v1.DatabaseClaim) (string, error)

GetSourceDataFromDSN returns the DSN from the source data from DSN field or secretRef.

func NewContext

func NewContext(ctx context.Context, creds *Creds) context.Context

NewContext returns a new context with the Creds

func UpdateDSNWithPassword

func UpdateDSNWithPassword(dsn, password string) (string, error)

UpdateDSNWithPassword updates the DSN with the password

Types

type Creds

type Creds struct {
	SourceDSN, TargetDSN   string
	SourceUser, TargetUser string
}

Creds contains the many authentications available during a request

func FromContext

func FromContext(ctx context.Context) *Creds

FromContext returns the Creds from the context

func PopulateCreds

func PopulateCreds(ctx context.Context, cli client.Reader, dbClaim *v1.DatabaseClaim, serviceNS string) (*Creds, error)

PopulateCreds attempts to find creds from the variety of places they can be found in

Jump to

Keyboard shortcuts

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