Documentation
¶
Index ¶
- Constants
- func DomainsString(domains []string) string
- func IsSameExistingRegistration(raw *runtime.RawExtension, realSecretHash string) bool
- func NormalizeNamespace(namespace string) string
- func ObjectKeyFromSecretReference(secretRef *corev1.SecretReference) client.ObjectKey
- func WrapRegistration(raw []byte, secretHash string) ([]byte, error)
- func WrapRegistrationFromResource(raw []byte) (*wrappedRegistration, error)
- type AssociatedObjects
- func (ao *AssociatedObjects) AddAssoc(issuer IssuerKey, cert client.ObjectKey)
- func (ao *AssociatedObjects) AllIssuers() []IssuerKey
- func (ao *AssociatedObjects) CertificateCount(issuer IssuerKey) int
- func (ao *AssociatedObjects) Certificates(issuer IssuerKey) []client.ObjectKey
- func (ao *AssociatedObjects) RemoveByCertificate(cert client.ObjectKey)
- func (ao *AssociatedObjects) RemoveByIssuer(issuer IssuerKey)
- type IssuerDNSSelections
- func (s *IssuerDNSSelections) Add(key IssuerKey, sel *v1alpha1.DNSSelection)
- func (s *IssuerDNSSelections) GetAll() map[IssuerKey]*v1alpha1.DNSSelection
- func (s *IssuerDNSSelections) GetSelection(key IssuerKey) *v1alpha1.DNSSelection
- func (s *IssuerDNSSelections) Issuers() []IssuerKey
- func (s *IssuerDNSSelections) Remove(key IssuerKey)
- type IssuerHandler
- type IssuerHandlerFactory
- type IssuerKey
- type Quotas
- type RecoverableError
- type ReferencedSecrets
- func (rs *ReferencedSecrets) GetIssuerSecretHash(issuerKey IssuerKey) string
- func (rs *ReferencedSecrets) IssuerNamesFor(secretKey SecretKey) sets.Set[IssuerKey]
- func (rs *ReferencedSecrets) RememberIssuerSecret(issuerKey IssuerKey, secretRef *v1.SecretReference, hash string) bool
- func (rs *ReferencedSecrets) RemoveIssuer(issuerKey IssuerKey) bool
- type SecretKey
- type Support
- func (s *Support) AddCertificate(cert *v1alpha1.Certificate)
- func (s *Support) AddIssuerDomains(issuerKey IssuerKey, sel *v1alpha1.DNSSelection)
- func (s *Support) CalcSecretHash(secret *corev1.Secret) string
- func (s *Support) CertificateNamesForIssuer(key IssuerKey) []client.ObjectKey
- func (s *Support) ClearCertRenewalOverdue(certName client.ObjectKey)
- func (s *Support) ClearCertRevoked(certName client.ObjectKey)
- func (s *Support) FindIssuerKeyByName(namespace, issuerName string) *IssuerKey
- func (s *Support) GetAllRenewalOverdue() []client.ObjectKey
- func (s *Support) GetAllRevoked() []client.ObjectKey
- func (s *Support) GetIssuerSecretHash(issuer IssuerKey) string
- func (s *Support) IssuerKeyFromCertSpec(spec *v1alpha1.CertificateSpec) IssuerKey
- func (s *Support) IssuerNamesForSecretOrEABSecret(key SecretKey) sets.Set[IssuerKey]
- func (s *Support) LoadEABHmacKey(ctx context.Context, client client.Client, issuerKey IssuerKey, ...) (string, string, error)
- func (s *Support) RememberIssuerEABSecret(issuerKey IssuerKey, secretRef *corev1.SecretReference, hash string)
- func (s *Support) RememberIssuerQuotas(issuerKey IssuerKey, issuerRequestsPerDay *int) int
- func (s *Support) RememberIssuerSecret(issuerKey IssuerKey, secretRef *corev1.SecretReference, hash string)
- func (s *Support) RemoveCertificate(certObjName client.ObjectKey)
- func (s *Support) RemoveIssuer(issuerKey IssuerKey) bool
- func (s *Support) SetCertRenewalOverdue(certName client.ObjectKey)
- func (s *Support) SetCertRevoked(certName client.ObjectKey)
- func (s *Support) TryAcceptCertificateRequest(issuer IssuerKey) (bool, int)
Constants ¶
const ( // ACMEType is the type name for ACME. ACMEType = "acme" // CAType is the type name for CA. CAType = "ca" )
const (
// AnnotationClass is the annotation to set the cert class.
AnnotationClass = "cert.gardener.cloud/class"
)
Variables ¶
This section is empty.
Functions ¶
func DomainsString ¶
DomainsString creates a comma separated string.
func IsSameExistingRegistration ¶
func IsSameExistingRegistration(raw *runtime.RawExtension, realSecretHash string) bool
IsSameExistingRegistration returns true if status ACME has same secret hash.
func NormalizeNamespace ¶
NormalizeNamespace returns the namespace or "default" for an empty input.
func ObjectKeyFromSecretReference ¶
func ObjectKeyFromSecretReference(secretRef *corev1.SecretReference) client.ObjectKey
ObjectKeyFromSecretReference returns an ObjectKey for a secret reference.
func WrapRegistration ¶
WrapRegistration wraps registration.
func WrapRegistrationFromResource ¶
WrapRegistrationFromResource unmarshalls a wrapped registration.
Types ¶
type AssociatedObjects ¶
type AssociatedObjects struct {
// contains filtered or unexported fields
}
AssociatedObjects stores bidi-associations between issuer and associated certificates.
func NewAssociatedObjects ¶
func NewAssociatedObjects() *AssociatedObjects
NewAssociatedObjects creates an AssociatedObjects
func (*AssociatedObjects) AddAssoc ¶
func (ao *AssociatedObjects) AddAssoc(issuer IssuerKey, cert client.ObjectKey)
AddAssoc adds an association.
func (*AssociatedObjects) AllIssuers ¶
func (ao *AssociatedObjects) AllIssuers() []IssuerKey
AllIssuers returns all sources.
func (*AssociatedObjects) CertificateCount ¶
func (ao *AssociatedObjects) CertificateCount(issuer IssuerKey) int
CertificateCount counts the certificates for the given issuer.
func (*AssociatedObjects) Certificates ¶
func (ao *AssociatedObjects) Certificates(issuer IssuerKey) []client.ObjectKey
Certificates returns all certificates for the given issuer.
func (*AssociatedObjects) RemoveByCertificate ¶
func (ao *AssociatedObjects) RemoveByCertificate(cert client.ObjectKey)
RemoveByCertificate removes an association by dest.
func (*AssociatedObjects) RemoveByIssuer ¶
func (ao *AssociatedObjects) RemoveByIssuer(issuer IssuerKey)
RemoveByIssuer removes an association by issuer.
type IssuerDNSSelections ¶
type IssuerDNSSelections struct {
// contains filtered or unexported fields
}
IssuerDNSSelections stores last known DNS selection for an issuer
func NewIssuerDNSSelections ¶
func NewIssuerDNSSelections() *IssuerDNSSelections
NewIssuerDNSSelections creates an IssuerDNSSelections
func (*IssuerDNSSelections) Add ¶
func (s *IssuerDNSSelections) Add(key IssuerKey, sel *v1alpha1.DNSSelection)
Add adds a DNS selection
func (*IssuerDNSSelections) GetAll ¶
func (s *IssuerDNSSelections) GetAll() map[IssuerKey]*v1alpha1.DNSSelection
GetAll returns a map with all selections
func (*IssuerDNSSelections) GetSelection ¶
func (s *IssuerDNSSelections) GetSelection(key IssuerKey) *v1alpha1.DNSSelection
GetSelection returns the selection for the given key.
func (*IssuerDNSSelections) Issuers ¶
func (s *IssuerDNSSelections) Issuers() []IssuerKey
Issuers returns all issuer keys.
func (*IssuerDNSSelections) Remove ¶
func (s *IssuerDNSSelections) Remove(key IssuerKey)
Remove removes a DNS selection
type IssuerHandler ¶
type IssuerHandler interface {
Type() string
CanReconcile(issuer *v1alpha1.Issuer) bool
Reconcile(ctx context.Context, log logr.Logger, issuer *v1alpha1.Issuer) (reconcile.Result, error)
Delete(ctx context.Context, log logr.Logger, issuer *v1alpha1.Issuer) (reconcile.Result, error)
}
IssuerHandler can reconcile issuers.
type IssuerHandlerFactory ¶
type IssuerHandlerFactory func(support *Support) (IssuerHandler, error)
IssuerHandlerFactory is a function type to create an issuer handler
type IssuerKey ¶
IssuerKey provides object key and cluster of an issuer.
func NewIssuerKey ¶
NewIssuerKey creates key for an issuer.
type Quotas ¶
type Quotas struct {
// contains filtered or unexported fields
}
Quotas stores references issuer quotas.
func (*Quotas) RememberQuotas ¶
RememberQuotas stores the requests per days quota and creates a new ratelimiter if the quota changed.
func (*Quotas) RemoveIssuer ¶
RemoveIssuer removes all secretRefs for an issuer.
func (*Quotas) RequestsPerDay ¶
RequestsPerDay gets the request per day quota
type RecoverableError ¶
RecoverableError is a recoverable error, i.e. reconcile after same backoff may help
func (*RecoverableError) Error ¶
func (err *RecoverableError) Error() string
type ReferencedSecrets ¶
type ReferencedSecrets struct {
// contains filtered or unexported fields
}
ReferencedSecrets stores references between issuers and their secrets.
func NewReferencedSecrets ¶
func NewReferencedSecrets() *ReferencedSecrets
NewReferencedSecrets create a ReferencedSecrets
func (*ReferencedSecrets) GetIssuerSecretHash ¶
func (rs *ReferencedSecrets) GetIssuerSecretHash(issuerKey IssuerKey) string
GetIssuerSecretHash gets the for an issuer secret
func (*ReferencedSecrets) IssuerNamesFor ¶
func (rs *ReferencedSecrets) IssuerNamesFor(secretKey SecretKey) sets.Set[IssuerKey]
IssuerNamesFor finds issuers for given secret name.
func (*ReferencedSecrets) RememberIssuerSecret ¶
func (rs *ReferencedSecrets) RememberIssuerSecret(issuerKey IssuerKey, secretRef *v1.SecretReference, hash string) bool
RememberIssuerSecret stores a secretRef for an issuer.
func (*ReferencedSecrets) RemoveIssuer ¶
func (rs *ReferencedSecrets) RemoveIssuer(issuerKey IssuerKey) bool
RemoveIssuer removes all secretRefs for an issuer.
type SecretKey ¶
SecretKey provides object key and cluster of a secret
func NewSecretKey ¶
NewSecretKey creates key for a secret.
func (SecretKey) IsFromSecondaryCluster ¶
IsFromSecondaryCluster returns true if secret is from secondary cluster.
type Support ¶
type Support struct {
// contains filtered or unexported fields
}
Support provides common issuer/credentials functionality.
func NewHandlerSupport ¶
func NewHandlerSupport(defaultIssuerName string, issuerNamespace string, defaultRequestsPerDayQuota int) (*Support, error)
NewHandlerSupport creates the shared Support object
func (*Support) AddCertificate ¶
func (s *Support) AddCertificate(cert *v1alpha1.Certificate)
AddCertificate adds a certificate
func (*Support) AddIssuerDomains ¶
func (s *Support) AddIssuerDomains(issuerKey IssuerKey, sel *v1alpha1.DNSSelection)
AddIssuerDomains remembers the DNS selection for an ACME issuer
func (*Support) CalcSecretHash ¶
CalcSecretHash calculates the secret hash If real is true, precalculated hash value of `IssuerSecretHashKey` is ignored
func (*Support) CertificateNamesForIssuer ¶
CertificateNamesForIssuer returns the certificate names for an issuer
func (*Support) ClearCertRenewalOverdue ¶
ClearCertRenewalOverdue clears a certificate object as renewal overdue
func (*Support) ClearCertRevoked ¶
ClearCertRevoked clears a certificate object as revoked
func (*Support) FindIssuerKeyByName ¶
FindIssuerKeyByName tries to find an issuer key on target or default cluster
func (*Support) GetAllRenewalOverdue ¶
GetAllRenewalOverdue gets all certificate object object names which are renewal overdue
func (*Support) GetAllRevoked ¶
GetAllRevoked gets all certificate object keys which are revoked
func (*Support) GetIssuerSecretHash ¶
GetIssuerSecretHash returns the issuer secret hash code
func (*Support) IssuerKeyFromCertSpec ¶
func (s *Support) IssuerKeyFromCertSpec(spec *v1alpha1.CertificateSpec) IssuerKey
IssuerKeyFromCertSpec returns either the specified issuer or it tries to find a matching issuer by matching domains. It tries to find the issuer first on the target cluster, then on the default cluster
func (*Support) IssuerNamesForSecretOrEABSecret ¶
IssuerNamesForSecretOrEABSecret returns issuer names for a secret name
func (*Support) LoadEABHmacKey ¶
func (s *Support) LoadEABHmacKey(ctx context.Context, client client.Client, issuerKey IssuerKey, acme *v1alpha1.ACMESpec) (string, string, error)
LoadEABHmacKey reads the external account binding MAC key from the referenced secret
func (*Support) RememberIssuerEABSecret ¶
func (s *Support) RememberIssuerEABSecret(issuerKey IssuerKey, secretRef *corev1.SecretReference, hash string)
RememberIssuerEABSecret stores issuer EAB secret ref pair.
func (*Support) RememberIssuerQuotas ¶
RememberIssuerQuotas stores the issuer quotas.
func (*Support) RememberIssuerSecret ¶
func (s *Support) RememberIssuerSecret(issuerKey IssuerKey, secretRef *corev1.SecretReference, hash string)
RememberIssuerSecret stores issuer secret ref pair.
func (*Support) RemoveCertificate ¶
RemoveCertificate removes a certificate
func (*Support) RemoveIssuer ¶
RemoveIssuer removes an issuer
func (*Support) SetCertRenewalOverdue ¶
SetCertRenewalOverdue sets a certificate object as renewal overdue
func (*Support) SetCertRevoked ¶
SetCertRevoked sets a certificate object as revoked