Help us shape the future of Go! Take the 2026 Go Developer Survey

factservice

package
v0.38.1 Latest Latest
Warning

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

Go to latest
Published: Sep 27, 2026 License: Apache-2.0, Apache-2.0 Imports: 16 Imported by: 0

Documentation

Overview

Package factservice defines the small issuance lookup contract. Providers do not authenticate end users or implement administration to supply facts.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Handler

func Handler(users directory.Directory, hosts inventory.Hosts, caKey, controlKey sshcert.RawPublicKey) (http.Handler, error)

Handler serves one kind of fact; directory and inventory use separate audiences and transports. Either the CA reader or control key may read.

Types

type Client

type Client struct {
	// contains filtered or unexported fields
}

func NewClient

func NewClient(endpoint string, key sshcert.RawPrivateKey, audience string, cfg tlsconfig.Config) (*Client, error)

func (*Client) Host

func (c *Client) Host(ctx context.Context, name string) (*Host, error)

func (*Client) User

func (c *Client) User(ctx context.Context, id string) (*User, error)

type Host

type Host struct {
	wire.Host
	Revision Revision `json:"revision,omitzero"`
}

Host keeps the inventory account and principal validation contract while allowing optional revision metadata alongside it.

func (*Host) UnmarshalJSON

func (h *Host) UnmarshalJSON(data []byte) error

type Revision

type Revision struct {
	// contains filtered or unexported fields
}

Revision is optional opaque logging metadata, never a concurrency token.

func (Revision) IsZero

func (r Revision) IsZero() bool

IsZero distinguishes omitted metadata from a provider-supplied empty string.

func (Revision) MarshalJSON

func (r Revision) MarshalJSON() ([]byte, error)

func (Revision) String

func (r Revision) String() string

func (*Revision) UnmarshalJSON

func (r *Revision) UnmarshalJSON(data []byte) error

type User

type User struct {
	ID           string   `json:"id"`
	UserName     string   `json:"userName,omitempty"`
	Groups       []string `json:"groups,omitempty"`
	UserType     string   `json:"userType,omitempty"`
	Department   string   `json:"department,omitempty"`
	Organization string   `json:"organization,omitempty"`
	Revision     Revision `json:"revision,omitzero"`
}

Jump to

Keyboard shortcuts

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