enrollproto

package
v0.4.26 Latest Latest
Warning

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

Go to latest
Published: Nov 7, 2026 License: Apache-2.0 Imports: 0 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package enrollproto is the wire contract for enrollment: the request an agent sends to exchange a pairing token for an identity, and the response it gets.

It lives here, in the public repository, for the same reason pkg/tunnelproto does. Both sides must agree on these shapes, and a contract defined twice is a contract neither side owns — the SaaS imports this rather than restating it.

The client that speaks this protocol stays agent-side and unexported; only the shapes are shared.

Index

Constants

View Source
const Path = "/api/v1/enroll"

Path is the endpoint an agent posts to.

Variables

This section is empty.

Functions

This section is empty.

Types

type Request

type Request struct {
	ClusterID string `json:"clusterId"`

	// CSR is PEM, carrying the public key and the node's and cluster's names
	// (CommonName and OrganizationalUnit, respectively).
	CSR string `json:"csr"`

	// Fingerprint is the agent's own derivation from its public key. The
	// service recomputes it from the CSR and refuses a mismatch: an operator
	// compares this string on two screens, so the two sides must agree on it
	// before anyone is asked to trust it.
	Fingerprint string `json:"fingerprint"`

	AgentVersion string `json:"agentVersion"`

	// ProtocolVersion is the tunnel protocol this agent speaks, so the
	// Advisor can refuse an incompatible agent by name (#216). Zero from
	// agents that predate it.
	ProtocolVersion int `json:"protocolVersion,omitempty"`
}

Request is what the agent sends.

Note what is absent: any private key. The agent generates its keypair on the cluster and sends only a certificate signing request, so the service never holds material that would let it impersonate the cluster.

type Response

type Response struct {
	// Certificate is the signed per-node certificate, PEM.
	Certificate string `json:"certificate"`

	// CA is the enrollment authority, PEM. The agent pins it as the only root
	// it trusts for the tunnel, so it talks to the service that enrolled it
	// rather than anything holding a publicly-issued certificate.
	CA string `json:"ca"`

	// ActionLevel and Consent are the dials the Advisor will serve this
	// cluster at — the cluster's own settings clamped by its tenants — and
	// are what the node writes beside its identity. Empty from an Advisor
	// that predates them; the node then keeps whatever it already has.
	ActionLevel string `json:"actionLevel,omitempty"`
	Consent     string `json:"consent,omitempty"`

	// ConsoleCA is the Advisor's console SSH CA, one authorized-keys line —
	// what a node puts in TrustedUserCAKeys so recorded console sessions can
	// log in. Public material; the node installs it only when its token
	// granted console access. Empty when the Advisor has no console.
	ConsoleCA string `json:"consoleCa,omitempty"`
}

Response is what the service returns on success.

Jump to

Keyboard shortcuts

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