Help us shape the future of Go! Take the 2026 Go Developer Survey

credsutil

package
v0.7.3 Latest Latest
Warning

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

Go to latest
Published: Jun 7, 2017 License: MPL-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RandomAlphaNumericOfLen added in v0.7.3

func RandomAlphaNumericOfLen(len int) ([]byte, error)

RandomAlphaNumericOfLen returns a random byte slice of characters [A-Za-z0-9] of the provided length.

Types

type CredentialsProducer

type CredentialsProducer interface {
	GenerateUsername(usernameConfig dbplugin.UsernameConfig) (string, error)
	GeneratePassword() (string, error)
	GenerateExpiration(ttl time.Time) (string, error)
}

CredentialsProducer can be used as an embeded interface in the Database definition. It implements the methods for generating user information for a particular database type and is used in all the builtin database types.

type SQLCredentialsProducer

type SQLCredentialsProducer struct {
	DisplayNameLen int
	RoleNameLen    int
	UsernameLen    int
	Separator      string
}

SQLCredentialsProducer implements CredentialsProducer and provides a generic credentials producer for most sql database types.

func (*SQLCredentialsProducer) GenerateExpiration

func (scp *SQLCredentialsProducer) GenerateExpiration(ttl time.Time) (string, error)

func (*SQLCredentialsProducer) GeneratePassword

func (scp *SQLCredentialsProducer) GeneratePassword() (string, error)

func (*SQLCredentialsProducer) GenerateUsername

func (scp *SQLCredentialsProducer) GenerateUsername(config dbplugin.UsernameConfig) (string, error)

Jump to

Keyboard shortcuts

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