Documentation
¶
Index ¶
- type Facts
- func ServeFacts(t *testing.T, inv *Static, issuer string, key sshcert.RawPublicKey) *Facts
- func ServeFactsWithConfig(t *testing.T, inv *Static, cfg oidc.ValidatorConfig, key sshcert.RawPublicKey) *Facts
- func ServeFactsWithSources(t *testing.T, users directory.Directory, hosts inventory.Hosts, ...) *Facts
- type Static
- type StaticOption
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Facts ¶
type Facts struct {
DirectoryURL, InventoryURL string
Identity oidc.ValidatorConfig
}
func ServeFacts ¶
func ServeFactsWithConfig ¶
func ServeFactsWithConfig(t *testing.T, inv *Static, cfg oidc.ValidatorConfig, key sshcert.RawPublicKey) *Facts
func ServeFactsWithSources ¶
type Static ¶
type Static struct {
// contains filtered or unexported fields
}
Static is a combined YAML fact fixture for integration tests: directory users and hosts loaded once at startup. Reload is a process restart, like the policy itself.
inventory.Host entries come in two forms. An exact entry (`names:`) is one registered host. A pattern entry (`pattern:`) uses the same DNS-label-aware hostname patterns as Writ host selectors. Exact entries expose all their names; pattern entries adopt the requested name. Principal realms are separate issuance metadata and never replace host names. Patterns are the escape hatch for fleets of short-lived hosts (VM pools, CI runners) that follow a naming pattern but cannot be enumerated in a file.
func NewStatic ¶
func NewStatic(paths []string, options ...StaticOption) (*Static, error)
NewStatic loads an inventory from one or more YAML files. Files concatenate; a missing id, duplicate id/userName, or duplicate exact host name across the set is a load error. All IDs belong to the inventory service's single configured provider/tenant. Decoding is strict — an unknown field is an error, not a silently ignored typo.
func (*Static) LookupHost ¶
LookupHost implements Hosts: exact entries first, then pattern entries in file order, first match wins.
type StaticOption ¶
type StaticOption func(*staticOptions) error
StaticOption configures static inventory loading.
func WithDefaultPrincipalMode ¶
func WithDefaultPrincipalMode(mode inventory.PrincipalMode) StaticOption
WithDefaultPrincipalMode sets the mode inherited by host entries that omit principal-mode. The default is inventory.AccountNamePrincipals.
func WithoutHosts ¶
func WithoutHosts() StaticOption
WithoutHosts loads only directory facts, independently of host configuration.
func WithoutUsers ¶
func WithoutUsers() StaticOption
WithoutUsers loads only host facts; user records cannot become a fallback.