Documentation ¶
Index ¶
Constants ¶
View Source
const TOKENLIFE = 30 * time.Minute
TOKENLIFE the lifetime of proxy tokens we create
View Source
const TOKENREFRESH = 10 * time.Minute
TOKENREFRESH how long before expiry a token can be refreshed
Variables ¶
View Source
var API = api.ClientConfig()
API api client object
View Source
var OperationMode = ""
OperationMode the mode of operation
View Source
var ResourceType = ""
ResourceType the type of resource to search for
SATokens a cache of service account tokens for the user name
Functions ¶
func GetGroups ¶
func GetGroups(name string)
GetGroups queries the API for a group list and adds a slice of strings as a list of groups to the user.
func GetNameFromToken ¶
GetNameFromToken returns a username for an unexpired token otherwise it returns ""
func WriteAPIToken ¶
WriteAPIToken returns an API token json object from a username
Types ¶
type APIToken ¶
type APIToken struct { APIVersion string `json:"apiVersion"` Kind string `json:"kind"` Status map[string]string `json:"status"` }
APIToken structured format for JSON api token
Click to show internal directories.
Click to hide internal directories.