Documentation ¶
Index ¶
Constants ¶
View Source
const (
NoneLength int = -1
)
Variables ¶
This section is empty.
Functions ¶
func RandomAlphaNumeric ¶
RandomAlphaNumeric returns a random string of characters [A-Za-z0-9-] of the provided length. The string generated takes up to 4 characters of space that are predefined and prepended to ensure password character requirements. It also requires a min length of 10 characters.
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 embedded 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)
Click to show internal directories.
Click to hide internal directories.