Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func HashToken ¶
HashToken produces an argon2id hash of the given token, encoded in the PHC-style format expected by VerifyToken.
func VerifyToken ¶
VerifyToken checks token against an argon2id PHC string.
Types ¶
type APIKey ¶
type APIKey struct {
ID string `yaml:"id"`
SecretHash string `yaml:"secret_hash"`
Scopes []string `yaml:"scopes"`
Description string `yaml:"description,omitempty"`
}
APIKey is one entry from auth/keys.yaml.
func ParseKeysYAML ¶
ParseKeysYAML parses an `auth/keys.yaml` file body.
type Host ¶
type Host struct {
ID string `yaml:"id"`
Addr string `yaml:"addr"` // "unix" or "user@host"
Socket string `yaml:"socket"` // path on the host
SSHKey string `yaml:"ssh_key,omitempty"` // optional
Labels map[string]string `yaml:"labels,omitempty"`
// Drain, when true, makes the API refuse to *create* new instances on
// this host. Replace-shaped writes against existing pods, lifecycle
// ops, and reads are unaffected. Hot-reloadable via SIGHUP.
Drain bool `yaml:"drain,omitempty"`
// Prune is the optional per-host host-health cleanup policy. nil means "use
// the global flag defaults". Pointer fields inside distinguish "unset"
// (inherit default) from an explicit zero value.
Prune *PruneConfig `yaml:"prune,omitempty"`
}
Host is the in-memory representation of a single hosts/*.yaml file.
type Operator ¶
type Operator struct {
Username string `yaml:"username"`
PasswordHash string `yaml:"password_hash"`
}
Operator is the single-operator UI credential, parsed from the -operator-file YAML. PasswordHash is an argon2id PHC string (produce one with `podman-api hash-token <plaintext>`).
func ParseOperatorYAML ¶
ParseOperatorYAML parses an operator credential file. Username defaults to "operator" when omitted; password_hash is required.
type PruneConfig ¶
type PruneConfig struct {
Enabled *bool `yaml:"enabled,omitempty"`
Interval *string `yaml:"interval,omitempty"` // Go duration, e.g. "12h"
DiskThreshold *int `yaml:"disk_threshold_pct,omitempty"`
Scope *[]string `yaml:"scope,omitempty"`
DryRun *bool `yaml:"dry_run,omitempty"`
}
PruneConfig is the raw per-host prune policy as parsed from hosts/*.yaml. Every field is a pointer so an omitted field inherits the global default rather than overriding it with a zero value. Resolution lives in the prune package (config must not depend on prune).