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

ca

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: 18 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrInvalidAuthentication = errors.New("invalid user authentication")
	ErrAccessDenied          = errors.New("access denied")
	ErrAuthorizationPending  = errors.New("authorization pending")
	ErrDependency            = errors.New("CA dependency failed")
	ErrInvalidPublicKey      = errors.New("invalid public key")
)

Error classes carry CA semantics independently of a private service's HTTP status. Wrapped diagnostics are for server logs, never public response bodies.

Functions

This section is empty.

Types

type AuditMetadata added in v0.31.0

type AuditMetadata struct {
	ID                string
	PolicyID          string
	DirectoryRevision string
	InventoryRevision string
}

AuditMetadata identifies the identity and source revisions used for issuance.

type CA

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

CA performs CA operations.

func New

func New(privateKey sshcert.RawPrivateKey, evaluator policyserver.PolicyEvaluator, options ...Option) (*CA, error)

New creates the issuing authority with its in-process policy evaluator.

func (*CA) FetchDiscovery added in v0.14.0

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

FetchDiscovery returns this CA's configured login information.

func (*CA) Issue added in v0.31.0

func (c *CA) Issue(ctx context.Context, token string, conn wire.Connection, publicKey sshcert.RawPublicKey) (*IssuedCertificate, error)

Issue obtains policy approval and signs the requested key using inventory facts and policy-provided limits. It returns a result only after signing succeeds; callers never handle intermediate authorization or signing parameters.

func (*CA) PublicKey

func (c *CA) PublicKey() sshcert.RawPublicKey

PublicKey returns the ssh on-disk format public key for the CA.

type IssuedCertificate added in v0.31.0

type IssuedCertificate struct {
	Certificate sshcert.RawCertificate
	Audit       AuditMetadata
}

IssuedCertificate contains a signed certificate and its private audit metadata. Audit metadata is for server-side logging and is not part of the client response.

type Option

type Option interface {
	// contains filtered or unexported methods
}

Option configures the CA.

func WithFacts added in v0.38.0

func WithFacts(directoryURL, inventoryURL string, identity oidc.Config, discovery wire.AuthConfig, cfg tlsconfig.Config) Option

WithFacts configures independent read providers and CA-owned OIDC validation.

func WithLogger added in v0.3.3

func WithLogger(logger *slog.Logger) Option

WithLogger configures the CA to use the specified logger.

Jump to

Keyboard shortcuts

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