Documentation
¶
Overview ¶
Package serviceaccount contains service accounts related logic.
Index ¶
Constants ¶
View Source
const ( // SideroServiceAccountKeyEnvVar is the name of the environment variable // that contains the base64-encoded service account key JSON. SideroServiceAccountKeyEnvVar = "SIDERO_SERVICE_ACCOUNT_KEY" // OmniServiceAccountKeyEnvVar is the name of the environment variable // that contains the base64-encoded service account key JSON. OmniServiceAccountKeyEnvVar = "OMNI_SERVICE_ACCOUNT_KEY" )
Variables ¶
This section is empty.
Functions ¶
func Encode ¶
Encode encodes the given service account name and pgp key into a base64 encoded JSON string.
func GetFromEnv ¶
func GetFromEnv() (envKey, valueBase64 string)
GetFromEnv checks if a service account is available in the environment variables. If a known environment variable is found, its name and value are returned.
Types ¶
type JSON ¶
type JSON struct { // Name is the name (identity) of the service account. Name string `json:"name"` // PGPKey is the armored PGP private key of the service account. PGPKey string `json:"pgp_key"` }
JSON is the JSON representation of a service account.
type ServiceAccount ¶
ServiceAccount represents a service account with an identity and a pgp key.
func Decode ¶
func Decode(valueBase64 string) (*ServiceAccount, error)
Decode parses and decodes a service account from a base64 encoded JSON string.
Click to show internal directories.
Click to hide internal directories.