Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func LoadDefault ¶
func LoadDefault()
LoadDefault loads the config from one of the default config locations
Types ¶
type Config ¶ added in v0.2.0
type Config struct {
URL string `yaml:"instance"`
Mytoken *mytokenlib.MytokenServer `yaml:"-"`
DefaultGPGKey string `yaml:"default_gpg_key"`
DefaultProvider string `yaml:"default_provider"`
DefaultOIDCFlow string `yaml:"default_oidc_flow"`
DefaultTokenCapabilities struct {
Stored []string `yaml:"stored"`
Returned []string `yaml:"returned"`
} `yaml:"default_token_capabilities"`
TokenNamePrefix string `yaml:"token_name_prefix"`
Providers model.Providers `yaml:"providers"`
TokensFilePath string `yaml:"tokens_file"`
TokensFileContent *TokenFileContent `yaml:"-"`
// contains filtered or unexported fields
}
func (*Config) GetTokenEntry ¶ added in v0.4.0
func (c *Config) GetTokenEntry( issuer string, name string, nameUpdater func(string), requiredCapability ...api. Capability, ) ( t TokenEntry, err error, )
type GPGAndPasswordCombinedCrypter ¶ added in v0.4.0
type GPGAndPasswordCombinedCrypter struct{}
type StoreToken ¶ added in v0.4.0
type StoreToken struct {
// contains filtered or unexported fields
}
func NewEncryptedStoreToken ¶ added in v0.4.0
func NewEncryptedStoreToken(encrypted string) StoreToken
func NewPlainStoreToken ¶ added in v0.4.0
func NewPlainStoreToken(plain string) StoreToken
func (*StoreToken) Encrypted ¶ added in v0.4.0
func (t *StoreToken) Encrypted(secret string) (string, error)
func (StoreToken) MarshalJSON ¶ added in v0.4.0
func (t StoreToken) MarshalJSON() ([]byte, error)
func (*StoreToken) Plain ¶ added in v0.4.0
func (t *StoreToken) Plain(secret string) (string, error)
func (*StoreToken) UnmarshalJSON ¶ added in v0.4.0
func (t *StoreToken) UnmarshalJSON(data []byte) error
type TokenEntry ¶
type TokenEntry struct {
Name string `json:"name"`
GPGKey string `json:"gpg_key,omitempty"`
Token StoreToken `json:"token"`
Capabilities api.Capabilities `json:"capabilities"`
}
func (TokenEntry) MarshalJSON ¶ added in v0.4.0
func (e TokenEntry) MarshalJSON() ([]byte, error)
type TokenFileContent ¶ added in v0.2.0
type TokenFileContent struct {
TokenMapping tokenNameMapping `json:"mapping"`
Tokens tokenEntries `json:"tokens"`
}
func LoadTokens ¶
func LoadTokens() (*TokenFileContent, error)
func (*TokenFileContent) Add ¶ added in v0.2.0
func (f *TokenFileContent) Add(t TokenEntry, iss string)
func (TokenFileContent) Has ¶ added in v0.2.0
func (f TokenFileContent) Has(name, iss string) bool
func (*TokenFileContent) Remove ¶ added in v0.4.0
func (f *TokenFileContent) Remove(name, iss string)
func (*TokenFileContent) Save ¶ added in v0.2.0
func (f *TokenFileContent) Save() error
func (*TokenFileContent) Update ¶ added in v0.4.0
func (f *TokenFileContent) Update(name, iss string, token StoreToken)
Click to show internal directories.
Click to hide internal directories.