Documentation ¶
Index ¶
- Variables
- func ConfigPropertiesNamesAndDocs() ([]string, []string)
- func ConfigVarDocs() []string
- func GetAllConfigProperties() []string
- func GetAllowedConfigProperties() []string
- func GetKeyrings() []string
- func IsEncryptedToken(textToken string) bool
- func IsKeyringManaged() (keyring string, ok bool)
- func Location() (path string, err error)
- func ParseToken(textToken string) (token *jwt.Token, err error)
- func Remove() error
- func Save(cfg *Config) error
- type Config
- type JWETokenHeader
Constants ¶
This section is empty.
Variables ¶
var ( UpsertConfigToKeyring = securestore.UpsertConfigToKeyring RemoveConfigFromKeyring = securestore.RemoveConfigFromKeyring GetConfigFromKeyring = securestore.GetConfigFromKeyring )
var DisallowedSetConfigProperties = []string{"scopes"}
Functions ¶
func ConfigPropertiesNamesAndDocs ¶ added in v1.2.37
func ConfigVarDocs ¶ added in v1.2.37
func ConfigVarDocs() []string
func GetAllConfigProperties ¶ added in v1.2.37
func GetAllConfigProperties() []string
func GetAllowedConfigProperties ¶ added in v1.2.37
func GetAllowedConfigProperties() []string
func GetKeyrings ¶ added in v1.2.38
func GetKeyrings() []string
Returns the available keyrings on the current host
func IsEncryptedToken ¶
func IsKeyringManaged ¶ added in v1.2.38
IsKeyringManaged returns the keyring name and a boolean indicating if the config is managed by the keyring.
func Location ¶
Location returns the location of the configuration file. If a configuration file already exists in the HOME directory, it uses that, otherwise it prefers to use the XDG config directory.
func ParseToken ¶
Types ¶
type Config ¶
type Config struct { AccessToken string `json:"access_token,omitempty" doc:"Bearer access token."` ClientID string `json:"client_id,omitempty" doc:"OpenID client identifier."` ClientSecret string `json:"client_secret,omitempty" doc:"OpenID client secret."` Insecure bool `json:"insecure,omitempty" doc:"Enables insecure communication with the server."` RefreshToken string `json:"refresh_token,omitempty" doc:"Offline or refresh token."` Scopes []string `json:"scopes,omitempty" doc:"OpenID scope."` TokenURL string `json:"token_url,omitempty" doc:"OpenID token URL."` URL string `json:"url,omitempty" doc:"URL of the API gateway."` FedRAMP bool `json:"fedramp,omitempty" doc:"Indicates FedRAMP."` }
Config is the type used to store the configuration of the client.
func Load ¶
Loads the configuration from the OS keyring if requested, load from the configuration file if not
func (*Config) Armed ¶
Armed checks if the configuration contains either credentials or tokens that haven't expired, so that it can be used to perform authenticated requests.
func (*Config) Connection ¶
func (c *Config) Connection() (connection *sdk.Connection, err error)
Connection creates a connection using this configuration.