auth

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Apr 1, 2026 License: AGPL-3.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Claims

type Claims struct {
	Hostnames                  []string        `json:"hostnames"`
	TCPPorts                   []int           `json:"tcp_ports"`
	UDPRoutes                  []UDPRouteClaim `json:"udp_routes"`
	Weight                     int             `json:"weight"`
	SessionNonce               string          `json:"session_nonce"`
	HandshakeMaxAgeSeconds     *int            `json:"handshake_max_age_seconds"`
	ReauthIntervalSeconds      *int            `json:"reauth_interval_seconds"`
	ReauthGraceSeconds         *int            `json:"reauth_grace_seconds"`
	MaintenanceGraceCapSeconds *int            `json:"maintenance_grace_cap_seconds"`
	AuthorizerStatusURI        string          `json:"authorizer_status_uri"`
	PolicyVersion              string          `json:"policy_version"`
	IssuedAtQuote              string          `json:"issued_at_quote"`
	jwt.RegisteredClaims
}

Claims represents the JWT payload expected from attested backends.

func (*Claims) Copy

func (c *Claims) Copy() *Claims

Copy returns a deep copy of claims to avoid sharing state across goroutines.

type UDPRouteClaim

type UDPRouteClaim struct {
	Port                   int  `json:"port"`
	FlowIdleTimeoutSeconds *int `json:"flow_idle_timeout_seconds"`
}

type Validator

type Validator interface {
	Validate(ctx context.Context, token string) (*Claims, error)
}

Validator validates backend attestation tokens and returns parsed claims.

func NewValidator

func NewValidator(cfg *config.Config, httpClient *http.Client) (Validator, error)

NewValidator returns a Validator that uses a remote verifier when configured and falls back to local HMAC validation with backendsJWTSecret.

Jump to

Keyboard shortcuts

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