Documentation
¶
Overview ¶
Package inventoryapi defines the v2 resolver protocol independently of Writ and storage implementations. CA projects policy inputs from validated results.
Index ¶
Constants ¶
const InventoryRelation = "https://epithet.dev/rel/inventory"
const Version = 2
Version is the inventory resolution wire version.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ControlRequest ¶ added in v0.31.0
type ControlRequest struct {
Action string `json:"action"`
ID string `json:"id,omitempty"`
Revision uint64 `json:"revision,omitempty"`
Host *inventory.Proposal `json:"host,omitempty"`
Token string `json:"token,omitempty"`
LifetimeSeconds int64 `json:"lifetime-seconds,omitempty"`
}
ControlRequest is one operation at the complete advertised inventory URL. An optional single-use token preapproves enrollment. Admin authentication is the OIDC bearer header. Revision binds review/edit to the displayed record.
type ControlResponse ¶ added in v0.31.0
type ControlResponse struct {
CAURL string `json:"ca-url,omitempty"`
Host *inventory.HostRecord `json:"host,omitempty"`
Hosts []inventory.HostRecord `json:"hosts,omitempty"`
Token *inventory.EnrollmentToken `json:"token,omitempty"`
Tokens []inventory.EnrollmentToken `json:"tokens,omitempty"`
Audit []inventory.AuditEvent `json:"audit,omitempty"`
Error string `json:"error,omitempty"`
}
type DirectorySnapshot ¶
func (*DirectorySnapshot) UnmarshalJSON ¶
func (d *DirectorySnapshot) UnmarshalJSON(data []byte) error
type Host ¶
type Host struct {
facts.HostResource
Principal Principal `json:"principal"`
}
func (*Host) UnmarshalJSON ¶ added in v0.31.0
UnmarshalJSON decodes the complete inventory host, including principal metadata. Using a plain resource prevents promotion of HostResource's custom decoder, which would otherwise consume the enclosing object by itself.
type HostSnapshot ¶
func (*HostSnapshot) UnmarshalJSON ¶
func (h *HostSnapshot) UnmarshalJSON(data []byte) error
type Resolution ¶
type Resolution struct {
Version int `json:"version"`
Authentication facts.Authentication `json:"authentication"`
Target string `json:"target"`
Directory DirectorySnapshot `json:"directory"`
Inventory HostSnapshot `json:"inventory"`
}
func (*Resolution) Validate ¶
func (r *Resolution) Validate(host string) error
Validate checks both request binding and all fields whose omission could broaden authorization. Absence of an entity is represented only by null.