Documentation
¶
Overview ¶
Package kapmtls manages credentials for the node-local KAP mTLS agent.
Index ¶
Constants ¶
const ( DefaultAgentBinaryPath = "/usr/local/bin/kaproxy-mtls-agent" DefaultAgentUnitPath = "/etc/systemd/system/kaproxy-mtls-agent.service" AgentService = "kaproxy-mtls-agent.service" AgentReadyURL = "http://127.0.0.1:8440/readyz" ReleasesDirectoryName = "releases" CurrentSymlinkName = "current" AgentEnvironmentFileName = "agent.env" ClientCertificateFileName = "client.crt" ClientPrivateKeyFileName = "client.key" GatewayCAFileName = "gateway-ca.crt" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Credentials ¶
type Credentials struct {
CertificatePEM []byte
PrivateKeyPEM []byte
GatewayCAPEM []byte
GatewayEndpoint string
ServerName string
ClientCAFingerprint string
GatewayCAFingerprint string
}
Credentials is one complete agent credential generation. Certificate and key bytes are sensitive and must not be logged.
type Manager ¶
type Manager struct {
// contains filtered or unexported fields
}
func NewManager ¶
func (*Manager) Activate ¶
Activate restarts the agent against the already selected credential release. It does not stage or rotate private key material.
func (*Manager) UpdateCredentials ¶
func (m *Manager) UpdateCredentials(ctx context.Context, machineID string, credentials Credentials) error
UpdateCredentials commits one complete immutable generation, atomically points current at it, and restarts the agent. Restarting on each five-day certificate rotation is intentionally simpler than coordinating hot reload and rollback: agent startup validates the selected cert/key before readiness can succeed.
type Paths ¶
type Paths struct {
StateDir string
AgentBinary string
AgentUnitFile string
AgentVersionFile string
}
func DefaultPaths ¶
type Status ¶
type Status struct {
CredentialsInstalled bool
CertificateSerial string
CertificateNotAfter time.Time
AgentInstalled bool
AgentActive bool
AgentReady bool
AgentVersion string
GatewayEndpoint string
ServerName string
ClientCAFingerprint string
GatewayCAFingerprint string
}
Status contains only non-secret state used by gpud-manager reconciliation.