Documentation
¶
Overview ¶
Package endpoint keeps the named claim-machinery-api endpoints of ~/.config/claims/config.yaml (claims#116), like the contexts of a kubeconfig: one per lab, each with its URL and the ZITADEL `claims login` uses for it. Nothing is pre-seeded: the file holds what the user added.
Index ¶
- Constants
- func DefaultPath() (string, error)
- func NormalizeURL(u string) string
- type Config
- func (c *Config) Add(name string, e Endpoint) error
- func (c *Config) AddVault(lab string, v Vault) error
- func (c *Config) ByURL(url string) (string, Endpoint, bool)
- func (c *Config) Get(name string) (Endpoint, error)
- func (c *Config) GetVault(lab string) (Vault, bool)
- func (c *Config) Names() []string
- func (c *Config) Remove(name string) error
- func (c *Config) RemoveVault(lab string) error
- func (c *Config) Save(path string) error
- func (c *Config) Use(name string) error
- func (c *Config) UseVault(lab string) error
- func (c *Config) VaultNames() []string
- type Endpoint
- type Vault
Constants ¶
const EnvConfigFile = "CLAIMS_CONFIG_FILE"
EnvConfigFile overrides where the config file lives.
const EnvEndpoint = "CLAIM_ENDPOINT"
EnvEndpoint names the endpoint to use (like --endpoint).
Variables ¶
This section is empty.
Functions ¶
func DefaultPath ¶
DefaultPath is $CLAIMS_CONFIG_FILE, else <user config dir>/claims/config.yaml.
func NormalizeURL ¶
NormalizeURL makes URLs comparable (no surrounding space or trailing slash).
Types ¶
type Config ¶
type Config struct {
Current string `yaml:"current,omitempty"`
Endpoints map[string]Endpoint `yaml:"endpoints,omitempty"`
// Vaults are the labs' Vaults for `claims secret` (claims#122), keyed by
// lab: the <lab> of secrets/<lab>/<mount>/<path>.enc.yaml.
CurrentVault string `yaml:"current-vault,omitempty"`
Vaults map[string]Vault `yaml:"vaults,omitempty"`
}
Config is the config file.
func (*Config) RemoveVault ¶ added in v0.32.0
RemoveVault deletes the Vault of lab.
func (*Config) VaultNames ¶ added in v0.32.0
VaultNames lists the labs with a Vault, sorted.
type Endpoint ¶
type Endpoint struct {
URL string `yaml:"url"`
Issuer string `yaml:"issuer,omitempty"` // OIDC issuer for `claims login`
ClientID string `yaml:"client-id,omitempty"` // native app of the issuer
CAFile string `yaml:"ca-file,omitempty"` // extra PEM roots for the issuer
// OrdersURL is the lab's machinery-order-service, for claims order and
// claims orders (docs/adr/0002-order-through-the-order-service.md).
OrdersURL string `yaml:"orders-url,omitempty"`
}
Endpoint is one claim-machinery-api.
type Vault ¶ added in v0.32.0
type Vault struct {
Addr string `yaml:"addr"`
CAFile string `yaml:"ca-file,omitempty"`
Auth string `yaml:"auth,omitempty"` // token | approle ("" = token, else approle if VAULT_ROLE_ID is set)
AppRoleMount string `yaml:"approle-mount,omitempty"` // default approle
}
Vault is the Vault of one lab.