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

inventoryserver

package
v0.30.0 Latest Latest
Warning

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

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

Documentation

Overview

Package inventoryserver serves CA-authenticated resolution reads. It exposes no administration or enrollment operations in the static implementation.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewHandler

func NewHandler(config Config) (http.Handler, error)

NewHandler dispatches GET discovery and POST resolution by method at the configured endpoint. A mounting proxy must preserve the signed host and path.

Types

type Client

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

func NewClient

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

NewClient uses a separate transport for inventory so a Unix policy socket cannot accidentally receive inventory requests. Redirects are never followed.

func (*Client) FetchDiscovery

func (c *Client) FetchDiscovery(ctx context.Context) (*wire.Discovery, error)

FetchDiscovery reads inventory-owned login configuration using service authentication.

func (*Client) Resolve

type Config

type Config struct {
	CAPublicKey sshcert.RawPublicKey
	Resolver    *Resolver
	Validator   *oidc.Validator
	Discovery   *wire.Discovery
}

type OIDCConfig

type OIDCConfig struct {
	IdentityMode oidc.IdentityMode `yaml:"identity_mode,omitempty" json:"identity_mode,omitempty"`
	UserIDClaim  string            `yaml:"user_id_claim,omitempty" json:"user_id_claim,omitempty"`
	Issuer       string            `yaml:"issuer" json:"issuer"`
	ClientID     string            `yaml:"client_id" json:"client_id"`
	ClientSecret string            `yaml:"client_secret,omitempty" json:"client_secret,omitempty"` // Optional, for confidential clients
}

OIDCConfig represents OIDC configuration for token validation

type Resolver

type Resolver struct {
	Directory         directory.Directory
	Hosts             inventory.Hosts
	DirectoryRevision string
	InventoryRevision string
}

Resolver combines independently owned directory and host snapshots. Static data is immutable for the lifetime of this resolver; future dynamic sources must supply coherent snapshot reads and explicit freshness semantics.

func (*Resolver) Resolve

type ServerConfig

type ServerConfig struct {
	CAPublicKey string     `yaml:"ca_pubkey" json:"ca_pubkey"`
	OIDC        OIDCConfig `yaml:"oidc" json:"oidc"`
}

ServerConfig contains inventory-owned authentication settings loaded at startup.

func (*ServerConfig) BootstrapAuth

func (c *ServerConfig) BootstrapAuth() wire.AuthConfig

BootstrapAuth returns the auth configuration for the bootstrap endpoint.

func (*ServerConfig) Validate

func (c *ServerConfig) Validate() error

Validate checks that the ServerConfig is valid.

Jump to

Keyboard shortcuts

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