Documentation ¶
Index ¶
- Constants
- func IsSameExistingRegistration(raw *runtime.RawExtension, realSecretHash string) bool
- func NormalizeNamespace(namespace string) string
- func WrapRegistration(raw []byte, secretHash string) ([]byte, error)
- type AssociatedObjects
- func (ao *AssociatedObjects) AddAssoc(src utils.IssuerKey, dst resources.ObjectName)
- func (ao *AssociatedObjects) DestinationsAsArray(src utils.IssuerKey) []resources.ObjectName
- func (ao *AssociatedObjects) DestinationsCount(src utils.IssuerKey) int
- func (ao *AssociatedObjects) RemoveByDest(dst resources.ObjectName)
- func (ao *AssociatedObjects) RemoveBySource(src utils.IssuerKey)
- func (ao *AssociatedObjects) Sources() []utils.IssuerKey
- type CompoundHandler
- func (h *CompoundHandler) DeletedIssuer(logger logger.LogContext, key resources.ClusterObjectKey) reconcile.Status
- func (h *CompoundHandler) DeletedSecret(logger logger.LogContext, key resources.ClusterObjectKey) reconcile.Status
- func (h *CompoundHandler) ReconcileIssuer(logger logger.LogContext, obj resources.Object) reconcile.Status
- func (h *CompoundHandler) ReconcileSecret(logger logger.LogContext, obj resources.Object) reconcile.Status
- func (h *CompoundHandler) Support() *Support
- type Enqueuer
- type IssuerDNSSelections
- func (s *IssuerDNSSelections) Add(key utils.IssuerKey, sel *v1alpha1.DNSSelection)
- func (s *IssuerDNSSelections) GetAll() map[utils.IssuerKey]*v1alpha1.DNSSelection
- func (s *IssuerDNSSelections) GetSelection(key utils.IssuerKey) *v1alpha1.DNSSelection
- func (s *IssuerDNSSelections) Issuers() []utils.IssuerKey
- func (s *IssuerDNSSelections) Remove(key utils.IssuerKey)
- type IssuerHandler
- type IssuerHandlerFactory
- type Quotas
- type RecoverableError
- type ReferencedSecrets
- func (rs *ReferencedSecrets) GetIssuerSecretHash(issuerKey utils.IssuerKey) string
- func (rs *ReferencedSecrets) IssuerNamesFor(secretKey utils.IssuerSecretKey) utils.IssuerKeySet
- func (rs *ReferencedSecrets) RememberIssuerSecret(issuerKey utils.IssuerKey, secretRef *v1.SecretReference, hash string) bool
- func (rs *ReferencedSecrets) RemoveIssuer(issuerKey utils.IssuerKey) bool
- type Support
- func (s *Support) AddCertificate(cert *api.Certificate)
- func (s *Support) AddIssuerDomains(issuer resources.ClusterObjectKey, sel *api.DNSSelection)
- func (s *Support) CalcSecretHash(secret *corev1.Secret) string
- func (s *Support) CertificateNamesForIssuer(issuer resources.ClusterObjectKey) []resources.ObjectName
- func (s *Support) ClearCertRenewalOverdue(certName resources.ObjectName)
- func (s *Support) ClearCertRevoked(certName resources.ObjectName)
- func (s *Support) Cluster(key resources.ClusterObjectKey) utils.Cluster
- func (s *Support) DefaultIssuerDomainRanges() []string
- func (s *Support) DefaultIssuerName() string
- func (s *Support) EnqueueKey(key resources.ClusterObjectKey) error
- func (s *Support) Failed(logger logger.LogContext, obj resources.Object, state string, itype *string, ...) reconcile.Status
- func (s *Support) FindIssuerKeyByBestMatch(domains []string) *utils.IssuerKey
- func (s *Support) FindIssuerKeyByName(namespace, issuerName string) *utils.IssuerKey
- func (s *Support) GetAllRenewalOverdue() []resources.ObjectName
- func (s *Support) GetAllRevoked() []resources.ObjectName
- func (s *Support) GetAltIssuerSecretHash(issuer utils.IssuerKey) string
- func (s *Support) GetIssuerResources(issuerKey utils.IssuerKey) resources.Interface
- func (s *Support) GetIssuerSecretHash(issuer utils.IssuerKey) string
- func (s *Support) GetIssuerSecretResources(issuerKey utils.IssuerKey) resources.Interface
- func (s *Support) IsDefaultIssuer(issuerKey utils.IssuerKey) bool
- func (s *Support) IssuerClusterObjectKey(_ string, spec *api.CertificateSpec) utils.IssuerKey
- func (s *Support) IssuerNamesForSecretOrEABSecret(secretKey resources.ClusterObjectKey) resources.ObjectNameSet
- func (s *Support) IssuerNamespace() string
- func (s *Support) LoadEABHmacKey(objKey *resources.ClusterObjectKey, issuerKey utils.IssuerKey, ...) (string, string, error)
- func (s *Support) LoadIssuer(issuerKey utils.IssuerKey) (*api.Issuer, error)
- func (s *Support) ReadIssuerSecret(issuerKey utils.IssuerKey, ref *corev1.SecretReference) (*corev1.Secret, error)
- func (s *Support) RememberAltIssuerSecret(issuer resources.ClusterObjectKey, secretRef *corev1.SecretReference, ...)
- func (s *Support) RememberIssuerEABSecret(issuer resources.ClusterObjectKey, secretRef *corev1.SecretReference, ...)
- func (s *Support) RememberIssuerQuotas(issuer resources.ClusterObjectKey, issuerRequestsPerDay *int) int
- func (s *Support) RememberIssuerSecret(issuer resources.ClusterObjectKey, secretRef *corev1.SecretReference, ...)
- func (s *Support) RemoveCertificate(certObjName resources.ObjectName)
- func (s *Support) RemoveIssuer(issuer resources.ClusterObjectKey) bool
- func (s *Support) RestoreRegUser(issuerKey utils.IssuerKey, issuer *api.Issuer) (*legobridge.RegistrationUser, error)
- func (s *Support) SetCertRenewalOverdue(certName resources.ObjectName)
- func (s *Support) SetCertRevoked(certName resources.ObjectName)
- func (s *Support) SucceededAndTriggerCertificates(logger logger.LogContext, obj resources.Object, itype *string, regRaw []byte) reconcile.Status
- func (s *Support) ToIssuerKey(issuer resources.ClusterObjectKey) utils.IssuerKey
- func (s *Support) TryAcceptCertificateRequest(issuer utils.IssuerKey) (bool, int)
- func (s *Support) UpdateIssuerSecret(issuerKey utils.IssuerKey, reguser *legobridge.RegistrationUser, ...) error
- func (s *Support) WriteIssuerSecretFromRegistrationUser(issuerKey utils.IssuerKey, issuerUID types.UID, ...) (*corev1.SecretReference, *corev1.Secret, error)
Constants ¶
const ( // ACMEType is the type name for ACME. ACMEType = "acme" // CAType is the type name for CA. CAType = "ca" )
const ( // OptDefaultIssuer is the default-issuer command line option. OptDefaultIssuer = "default-issuer" // OptIssuerNamespace is the issuer namespace command line option. OptIssuerNamespace = "issuer-namespace" // OptDNSNamespace is the DNS namespace command line option. OptDNSNamespace = "dns-namespace" // OptDNSClass is the DNS class command line option. OptDNSClass = "dns-class" // OptDNSOwnerID is the DNS owner identifier command line option. OptDNSOwnerID = "dns-owner-id" // OptDefaultIssuerDomainRanges are the domain ranges the default issuer is restricted to. OptDefaultIssuerDomainRanges = "default-issuer-domain-ranges" // OptRenewalWindow is the renewal window command line option. OptRenewalWindow = "renewal-window" // OptRenewalOverdueWindow is the renewal overdue window command line option. OptRenewalOverdueWindow = "renewal-overdue-window" // OptCascadeDelete is the cascade delete command line option. OptCascadeDelete = "cascade-delete" // OptPrecheckNameservers is a command line option to specify the DNS nameservers to check DNS propagation of the DNS challenge. OptPrecheckNameservers = "precheck-nameservers" // OptPrecheckAdditionalWait is a command line option to specify an additional wait time after DNS propagation check. OptPrecheckAdditionalWait = "precheck-additional-wait" // OptDefaultRequestsPerDayQuota allows to set a default value for requestsPerDayQuota if not set explicitly in the issuer spec. OptDefaultRequestsPerDayQuota = "default-requests-per-day-quota" // OptPropagationTimeout is the propagation timeout for the DNS01 challenge. OptPropagationTimeout = "propagation-timeout" // OptAllowTargetIssuers if true reconciles not only issuers on the default cluster, but also on the target cluster OptAllowTargetIssuers = "allow-target-issuers" // OptACMEDeactivateAuthorizations if true authorizations are always deactivated after each certificate request OptACMEDeactivateAuthorizations = "acme-deactivate-authorizations" )
Variables ¶
This section is empty.
Functions ¶
func IsSameExistingRegistration ¶ added in v0.12.0
func IsSameExistingRegistration(raw *runtime.RawExtension, realSecretHash string) bool
IsSameExistingRegistration returns true if status ACME has same secret hash or if it has in the old format without secret hash (for migration)
func NormalizeNamespace ¶
NormalizeNamespace returns the namespace or "default" for an empty input.
Types ¶
type AssociatedObjects ¶
type AssociatedObjects struct {
// contains filtered or unexported fields
}
AssociatedObjects stores bidi-associations between source and dest.
func NewAssociatedObjects ¶
func NewAssociatedObjects() *AssociatedObjects
NewAssociatedObjects creates an AssociatedObjects
func (*AssociatedObjects) AddAssoc ¶
func (ao *AssociatedObjects) AddAssoc(src utils.IssuerKey, dst resources.ObjectName)
AddAssoc adds an association.
func (*AssociatedObjects) DestinationsAsArray ¶
func (ao *AssociatedObjects) DestinationsAsArray(src utils.IssuerKey) []resources.ObjectName
DestinationsAsArray returns all destinations for the given source.
func (*AssociatedObjects) DestinationsCount ¶
func (ao *AssociatedObjects) DestinationsCount(src utils.IssuerKey) int
DestinationsCount counts the destinations for the given source.
func (*AssociatedObjects) RemoveByDest ¶
func (ao *AssociatedObjects) RemoveByDest(dst resources.ObjectName)
RemoveByDest removes an association by dest.
func (*AssociatedObjects) RemoveBySource ¶
func (ao *AssociatedObjects) RemoveBySource(src utils.IssuerKey)
RemoveBySource removes an association by src.
func (*AssociatedObjects) Sources ¶
func (ao *AssociatedObjects) Sources() []utils.IssuerKey
Sources returns all sources.
type CompoundHandler ¶
type CompoundHandler struct {
// contains filtered or unexported fields
}
CompoundHandler is an array of IssuerHandler
func NewCompoundHandler ¶ added in v0.12.0
func NewCompoundHandler(c controller.Interface, factories ...IssuerHandlerFactory) (*CompoundHandler, error)
NewCompoundHandler creates a cluster specific CompoundHandler
func (*CompoundHandler) DeletedIssuer ¶
func (h *CompoundHandler) DeletedIssuer(logger logger.LogContext, key resources.ClusterObjectKey) reconcile.Status
DeletedIssuer deletes an issuer
func (*CompoundHandler) DeletedSecret ¶
func (h *CompoundHandler) DeletedSecret(logger logger.LogContext, key resources.ClusterObjectKey) reconcile.Status
DeletedSecret updates issuers on deleted secret
func (*CompoundHandler) ReconcileIssuer ¶
func (h *CompoundHandler) ReconcileIssuer(logger logger.LogContext, obj resources.Object) reconcile.Status
ReconcileIssuer reconciles an issuer and forward it to the correct IssuerHandler
func (*CompoundHandler) ReconcileSecret ¶
func (h *CompoundHandler) ReconcileSecret(logger logger.LogContext, obj resources.Object) reconcile.Status
ReconcileSecret reconciles secrets (for issuers)
func (*CompoundHandler) Support ¶ added in v0.12.0
func (h *CompoundHandler) Support() *Support
Support returns the support object
type Enqueuer ¶
type Enqueuer interface {
EnqueueKey(key resources.ClusterObjectKey) error
}
Enqueuer is an interface to allow enqueue a key
type IssuerDNSSelections ¶ added in v0.12.0
type IssuerDNSSelections struct {
// contains filtered or unexported fields
}
IssuerDNSSelections stores last known DNS selection for an issuer
func NewIssuerDNSSelections ¶ added in v0.12.0
func NewIssuerDNSSelections() *IssuerDNSSelections
NewIssuerDNSSelections creates an IssuerDNSSelections
func (*IssuerDNSSelections) Add ¶ added in v0.12.0
func (s *IssuerDNSSelections) Add(key utils.IssuerKey, sel *v1alpha1.DNSSelection)
Add adds a DNS selection
func (*IssuerDNSSelections) GetAll ¶ added in v0.12.0
func (s *IssuerDNSSelections) GetAll() map[utils.IssuerKey]*v1alpha1.DNSSelection
GetAll returns a map with all selections
func (*IssuerDNSSelections) GetSelection ¶ added in v0.12.0
func (s *IssuerDNSSelections) GetSelection(key utils.IssuerKey) *v1alpha1.DNSSelection
GetSelection returns the selection for the given key.
func (*IssuerDNSSelections) Issuers ¶ added in v0.12.0
func (s *IssuerDNSSelections) Issuers() []utils.IssuerKey
Issuers returns all issuer keys.
func (*IssuerDNSSelections) Remove ¶ added in v0.12.0
func (s *IssuerDNSSelections) Remove(key utils.IssuerKey)
Remove removes a DNS selection
type IssuerHandler ¶
type IssuerHandler interface { Type() string CanReconcile(issuer *api.Issuer) bool Reconcile(logger logger.LogContext, obj resources.Object, issuer *api.Issuer) reconcile.Status }
IssuerHandler can reconcile issuers.
type IssuerHandlerFactory ¶
type IssuerHandlerFactory func(support *Support) (IssuerHandler, error)
IssuerHandlerFactory is a function type to create an issuer handler
type Quotas ¶ added in v0.2.16
type Quotas struct {
// contains filtered or unexported fields
}
Quotas stores references issuer quotas.
func (*Quotas) RememberQuotas ¶ added in v0.2.16
RememberQuotas stores the requests per days quota and creates a new ratelimiter if the quota changed.
func (*Quotas) RemoveIssuer ¶ added in v0.2.16
RemoveIssuer removes all secretRefs for an issuer.
func (*Quotas) RequestsPerDay ¶ added in v0.2.16
RequestsPerDay gets the request per day quota
type RecoverableError ¶ added in v0.12.0
RecoverableError is a recoverable error, i.e. reconcile after same backoff may help
func (*RecoverableError) Error ¶ added in v0.12.0
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 utils.IssuerKey) string
GetIssuerSecretHash gets the for an issuer secret
func (*ReferencedSecrets) IssuerNamesFor ¶
func (rs *ReferencedSecrets) IssuerNamesFor(secretKey utils.IssuerSecretKey) utils.IssuerKeySet
IssuerNamesFor finds issuers for given secret name.
func (*ReferencedSecrets) RememberIssuerSecret ¶
func (rs *ReferencedSecrets) RememberIssuerSecret(issuerKey utils.IssuerKey, secretRef *v1.SecretReference, hash string) bool
RememberIssuerSecret stores a secretRef for an issuer.
func (*ReferencedSecrets) RemoveIssuer ¶
func (rs *ReferencedSecrets) RemoveIssuer(issuerKey utils.IssuerKey) bool
RemoveIssuer removes all secretRefs for an issuer.
type Support ¶
type Support struct {
// contains filtered or unexported fields
}
Support provides common issuer/credentials functionality.
func NewHandlerSupport ¶
func NewHandlerSupport(c controller.Interface) (*Support, error)
NewHandlerSupport creates the shared Support object
func (*Support) AddCertificate ¶
func (s *Support) AddCertificate(cert *api.Certificate)
AddCertificate adds a certificate
func (*Support) AddIssuerDomains ¶ added in v0.12.0
func (s *Support) AddIssuerDomains(issuer resources.ClusterObjectKey, sel *api.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 ¶
func (s *Support) CertificateNamesForIssuer(issuer resources.ClusterObjectKey) []resources.ObjectName
CertificateNamesForIssuer returns the certificate names for an issuer
func (*Support) ClearCertRenewalOverdue ¶ added in v0.12.0
func (s *Support) ClearCertRenewalOverdue(certName resources.ObjectName)
ClearCertRenewalOverdue clears a certificate object as renewal overdue
func (*Support) ClearCertRevoked ¶ added in v0.12.0
func (s *Support) ClearCertRevoked(certName resources.ObjectName)
ClearCertRevoked clears a certificate object as revoked
func (*Support) Cluster ¶ added in v0.12.0
func (s *Support) Cluster(key resources.ClusterObjectKey) utils.Cluster
Cluster returns the cluster enum for the given `ClusterObjectKey`
func (*Support) DefaultIssuerDomainRanges ¶
DefaultIssuerDomainRanges returns the default issuer domain ranges.
func (*Support) DefaultIssuerName ¶
DefaultIssuerName returns the default issuer name
func (*Support) EnqueueKey ¶
func (s *Support) EnqueueKey(key resources.ClusterObjectKey) error
EnqueueKey forwards to an enqueuer
func (*Support) Failed ¶
func (s *Support) Failed(logger logger.LogContext, obj resources.Object, state string, itype *string, err error, retry bool) reconcile.Status
Failed handles failed.
func (*Support) FindIssuerKeyByBestMatch ¶ added in v0.12.0
FindIssuerKeyByBestMatch tries to find the best matching issuer with respect to the DNS selection
func (*Support) FindIssuerKeyByName ¶ added in v0.12.0
FindIssuerKeyByName tries to find an issuer key on target or default cluster
func (*Support) GetAllRenewalOverdue ¶ added in v0.12.0
func (s *Support) GetAllRenewalOverdue() []resources.ObjectName
GetAllRenewalOverdue gets all certificate object object names which are renewal overdue
func (*Support) GetAllRevoked ¶ added in v0.12.0
func (s *Support) GetAllRevoked() []resources.ObjectName
GetAllRevoked gets all certificate object object names which are revoked
func (*Support) GetAltIssuerSecretHash ¶ added in v0.12.0
GetAltIssuerSecretHash returns the issuer alternative secret hash code This method is only needed for a bugfix for migrating v0.7.x to v0.8.x an can be deleted after v0.9.0
func (*Support) GetIssuerResources ¶
GetIssuerResources returns the resources for issuer.
func (*Support) GetIssuerSecretHash ¶
GetIssuerSecretHash returns the issuer secret hash code
func (*Support) GetIssuerSecretResources ¶
GetIssuerSecretResources returns the resources for issuer secrets.
func (*Support) IsDefaultIssuer ¶ added in v0.12.0
IsDefaultIssuer returns true if the issuer key is the default issuer
func (*Support) IssuerClusterObjectKey ¶ added in v0.12.0
IssuerClusterObjectKey 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 ¶ added in v0.12.0
func (s *Support) IssuerNamesForSecretOrEABSecret(secretKey resources.ClusterObjectKey) resources.ObjectNameSet
IssuerNamesForSecretOrEABSecret returns issuer names for a secret name
func (*Support) IssuerNamespace ¶
IssuerNamespace returns the issuer namespace
func (*Support) LoadEABHmacKey ¶ added in v0.12.0
func (s *Support) LoadEABHmacKey(objKey *resources.ClusterObjectKey, issuerKey utils.IssuerKey, acme *api.ACMESpec) (string, string, error)
LoadEABHmacKey reads the external account binding MAC key from the referenced secret
func (*Support) LoadIssuer ¶ added in v0.12.0
LoadIssuer loads the issuer for the given Certificate
func (*Support) ReadIssuerSecret ¶
func (s *Support) ReadIssuerSecret(issuerKey utils.IssuerKey, ref *corev1.SecretReference) (*corev1.Secret, error)
ReadIssuerSecret reads a issuer secret
func (*Support) RememberAltIssuerSecret ¶ added in v0.12.0
func (s *Support) RememberAltIssuerSecret(issuer resources.ClusterObjectKey, secretRef *corev1.SecretReference, secret *corev1.Secret, email string)
RememberAltIssuerSecret stores issuer secret ref pair for migration from v0.7.x This method is only needed for a bugfix for migrating v0.7.x to v0.8.x an can be deleted after v0.9.0
func (*Support) RememberIssuerEABSecret ¶ added in v0.12.0
func (s *Support) RememberIssuerEABSecret(issuer resources.ClusterObjectKey, secretRef *corev1.SecretReference, hash string)
RememberIssuerEABSecret stores issuer EAB secret ref pair.
func (*Support) RememberIssuerQuotas ¶ added in v0.2.16
func (s *Support) RememberIssuerQuotas(issuer resources.ClusterObjectKey, issuerRequestsPerDay *int) int
RememberIssuerQuotas stores the issuer quotas.
func (*Support) RememberIssuerSecret ¶
func (s *Support) RememberIssuerSecret(issuer resources.ClusterObjectKey, secretRef *corev1.SecretReference, hash string)
RememberIssuerSecret stores issuer secret ref pair.
func (*Support) RemoveCertificate ¶
func (s *Support) RemoveCertificate(certObjName resources.ObjectName)
RemoveCertificate removes a certificate
func (*Support) RemoveIssuer ¶
func (s *Support) RemoveIssuer(issuer resources.ClusterObjectKey) bool
RemoveIssuer removes an issuer
func (*Support) RestoreRegUser ¶ added in v0.12.0
func (s *Support) RestoreRegUser(issuerKey utils.IssuerKey, issuer *api.Issuer) (*legobridge.RegistrationUser, error)
RestoreRegUser restores a legobridge user from an issuer
func (*Support) SetCertRenewalOverdue ¶ added in v0.12.0
func (s *Support) SetCertRenewalOverdue(certName resources.ObjectName)
SetCertRenewalOverdue sets a certificate object as renewal overdue
func (*Support) SetCertRevoked ¶ added in v0.12.0
func (s *Support) SetCertRevoked(certName resources.ObjectName)
SetCertRevoked sets a certificate object as revoked
func (*Support) SucceededAndTriggerCertificates ¶
func (s *Support) SucceededAndTriggerCertificates(logger logger.LogContext, obj resources.Object, itype *string, regRaw []byte) reconcile.Status
SucceededAndTriggerCertificates handles succeeded and trigger certificates.
func (*Support) ToIssuerKey ¶ added in v0.12.0
func (s *Support) ToIssuerKey(issuer resources.ClusterObjectKey) utils.IssuerKey
ToIssuerKey creates issuer key from issuer name
func (*Support) TryAcceptCertificateRequest ¶ added in v0.2.16
TryAcceptCertificateRequest tries to accept a certificate request according to the quotas. Return true if accepted and the requests per days quota value
func (*Support) UpdateIssuerSecret ¶
func (s *Support) UpdateIssuerSecret(issuerKey utils.IssuerKey, reguser *legobridge.RegistrationUser, secret *corev1.Secret) error
UpdateIssuerSecret updates an issuer secret
func (*Support) WriteIssuerSecretFromRegistrationUser ¶
func (s *Support) WriteIssuerSecretFromRegistrationUser(issuerKey utils.IssuerKey, issuerUID types.UID, reguser *legobridge.RegistrationUser, secretRef *corev1.SecretReference) (*corev1.SecretReference, *corev1.Secret, error)
WriteIssuerSecretFromRegistrationUser writes an issuer secret