config

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Apr 8, 2021 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Load

func Load(file string)

Load loads the config form the provided filepath

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.MytokenProvider `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 Get

func Get() *Config

Get returns the config

func (*Config) GetToken added in v0.2.0

func (c *Config) GetToken(issuer, name string) (string, error)

type TokenEntry

type TokenEntry struct {
	Name   string `json:"name"`
	GPGKey string `json:"gpg_key,omitempty"`
	Token  string `json:"token"`
}

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) Save added in v0.2.0

func (f *TokenFileContent) Save() error

Jump to

Keyboard shortcuts

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