Documentation
¶
Overview ¶
Package testauthority builds an xpki authority.Authority for unit tests: a root and an issuing CA generated with xpki's testca, their keys in memory (inmemcrypto), and the profiles of testdata/ca-config.yaml (the chart's profiles without the Helm templating) loaded through authority.LoadConfig. It is imported by tests only (internal/controller, internal/operator/*); no non-test code depends on it.
ca := testauthority.New(t) // issuer label testauthority.IssuerLabel
Index ¶
Constants ¶
View Source
const ( // IssuerLabel is the label of the issuer the Authority serves, the same // as the chart's. IssuerLabel = "kubeca.svc" // Profiles of the example configuration. ProfilePeer = "peer-24h" ProfileServer = "server-24h" ProfileClient = "client-24h" ProfileWebhook = "webhook" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CA ¶
type CA struct {
*authority.Authority
// Root and Issuer are the generated CA entities (certificate and key).
Root *testca.Entity
Issuer *testca.Entity
// Dir holds issuer.pem, issuer.key, root.pem and ca-config.yaml.
Dir string
}
CA is a test Authority with its generated certificates.
func FromEntities ¶
FromEntities builds the Authority around the given root and issuing CA, so a test can control their validity (an expiring CA).
Click to show internal directories.
Click to hide internal directories.