Documentation
¶
Overview ¶
Package targetenrollment binds one-use enrollment to an existing Core issuer.
Index ¶
- Constants
- Variables
- func AdmitTLSNode(ctx context.Context, state tls.ConnectionState, scope Scope, ...) error
- func NormalizeCertificateSerial(serial string) (string, error)
- type Authority
- func (a *Authority) Create(ctx context.Context, scope Scope, lifetime, certificateTTL time.Duration) (Bootstrap, error)
- func (a *Authority) CreateRenewal(ctx context.Context, scope Scope, lifetime, certificateTTL time.Duration) (Bootstrap, error)
- func (a *Authority) Disconnect(ctx context.Context, scope Scope) error
- func (a *Authority) Enroll(ctx context.Context, request Request) (Result, error)
- func (a *Authority) Status(ctx context.Context, scope Scope) (NodeStatus, error)
- type Bootstrap
- type CurrentNodeTrust
- type Grant
- type HTTPHandler
- type NodeLifecycleStore
- type NodeRegistry
- type NodeStatus
- type RenewalStore
- type Request
- type Result
- type Scope
- type ScopeResolver
- type Store
Constants ¶
const ( AuthorizationPath = "/api/v1/connectors/authorizations" RenewalAuthorizationPath = "/api/v1/connectors/renewal-authorizations" EnrollmentPath = "/api/v1/connectors/enroll" StatusPath = "/api/v1/connectors/status" DisconnectPath = "/api/v1/connectors/disconnect" )
Variables ¶
var ErrDenied = errors.New("enrollment authorization is invalid, expired, or consumed")
Functions ¶
func AdmitTLSNode ¶
func AdmitTLSNode(ctx context.Context, state tls.ConnectionState, scope Scope, registry NodeRegistry) error
AdmitTLSNode must be called after a server-side RequireAndVerifyClientCert TLS 1.3 handshake and again when binding Hello/capabilities to the Core scope. It does not advertise a capability or execute a runtime request.
Types ¶
type Authority ¶
type Authority struct {
// contains filtered or unexported fields
}
func (*Authority) CreateRenewal ¶
func (*Authority) Disconnect ¶ added in v0.4.24
type CurrentNodeTrust ¶
CurrentNodeTrust is consulted for active sessions as well as new admission. Handshake-time VerifiedChains alone cannot detect removal of a former CA.
type Grant ¶
type Grant struct {
Scope Scope
TokenDigest string
NonceDigest string
ExpiresAt time.Time
CertificateTTL time.Duration
}
Grant contains only digests, never the bootstrap bearer credential or nonce.
type HTTPHandler ¶
type HTTPHandler struct {
// contains filtered or unexported fields
}
func NewHTTP ¶
func NewHTTP(authority *Authority, resolve ScopeResolver) (*HTTPHandler, error)
func (*HTTPHandler) ServeHTTP ¶
func (h *HTTPHandler) ServeHTTP(w http.ResponseWriter, r *http.Request)
type NodeLifecycleStore ¶ added in v0.4.24
type NodeRegistry ¶
NodeRegistry admits only a currently active certificate bound to the exact persisted tenant/Target/node/runtime. A trusted CA alone is not admission.
func WithLiveTrust ¶
func WithLiveTrust(registry NodeRegistry, load func(context.Context) (*x509.CertPool, error)) (NodeRegistry, error)
WithLiveTrust keeps persisted certificate admission and current CA trust as independent requirements. Neither a trusted CA nor an active row is enough.
type NodeStatus ¶ added in v0.4.24
type RenewalStore ¶
RenewalStore explicitly authorizes replacement of an existing node's active certificate. Ordinary initial enrollment cannot replace an issued identity.
type Result ¶
type Result struct {
Certificate serviceaccess.IssuedCertificate
Trust serviceaccess.TrustBundle
}
type Scope ¶
Scope is selected and authorized by Core before creating a bootstrap grant. The Connector cannot choose another tenant, Target, runtime, or identity.
type ScopeResolver ¶
ScopeResolver must use Core's Target registry, tenant ownership and effective policy. User-supplied runtime and tenant fields are deliberately not accepted.
type Store ¶
type Store interface {
Create(context.Context, Grant) error
Consume(context.Context, Scope, string, string, string, time.Time) (Grant, error)
RecordIssued(context.Context, Scope, string, string, time.Time) error
}
Store must persist consumption before returning success, including under concurrent requests and process restarts. Signing failures do not unconsume.