secrets

package
v0.0.0-...-d88c8b5 Latest Latest
Warning

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

Go to latest
Published: Feb 9, 2021 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetData

func GetData(secret *v1.Secret, key string) string

GetData returns the string value for the given key in the specified Secret If there is an error or if the key doesn't exist, an empty string is returned.

func GetExpiration

func GetExpiration(secret *v1.Secret, currentTime time.Time) (timeRemaining time.Duration, isExpired bool)

GetExpiration checks if the secret expires isExpired indicates if the secret is already expired. timeRemaining indicates how long until it does expire. if the secret has no expiration timestamp, returns 0, false. if there is an error parsing the secret's expiration timestamp, returns 0, true.

func GetGroups

func GetGroups(secret *v1.Secret) ([]string, error)

GetGroups loads and validates the bootstrapapi.BootstrapTokenExtraGroupsKey key from the bootstrap token secret, returning a list of group names or an error if any of the group names are invalid.

func HasExpired

func HasExpired(secret *v1.Secret, currentTime time.Time) bool

HasExpired will identify whether the secret expires

func ParseName

func ParseName(name string) (secretID string, ok bool)

ParseName parses the name of the secret to extract the secret ID.

Types

This section is empty.

Jump to

Keyboard shortcuts

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