Documentation
¶
Index ¶
- func AcmeDelegated(spec *CertificateGeneratorSpec) bool
- func ImmutableChanged(before, after *CertificateGeneratorSpec) string
- type AcmeChallenge
- type AcmeDirectoryUrl
- type AcmeGenerator
- type AzureDnsDns01
- type CertChallengeKind
- type CertificateGenerator
- type CertificateGeneratorProvider
- type CertificateGeneratorSpec
- type CertificateGeneratorStatus
- type CertificateGeneratorTags
- type CloudDnsDns01
- type CloudflareDns01
- type Dns01Challenge
- type Dns01Provider
- type ExternalAccountBinding
- type Http01Challenge
- type Route53Dns01
- type SecretLink
- type SecretRef
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AcmeDelegated ¶
func AcmeDelegated(spec *CertificateGeneratorSpec) bool
AcmeDelegated reports whether the generator's dns01 challenge is delegated to Control Plane — the domain CNAMEs _acme-challenge to us and we publish the TXT record. True for a dns01 block whose provider is absent (defaults cpln) or 'cpln' (certificateGenerator.ts certificateGeneratorAcmeDelegated, master b3c3358ad).
func ImmutableChanged ¶
func ImmutableChanged(before, after *CertificateGeneratorSpec) string
ImmutableChanged ports certificateGeneratorImmutableChanged: the spec parts that fix the ACME account. It returns the field path that changed, or "" when none did.
Types ¶
type AcmeChallenge ¶
type AcmeChallenge struct {
Http01 *Http01Challenge `json:"http01,omitzero"`
Dns01 *Dns01Challenge `json:"dns01,omitzero"`
}
AcmeChallenge carries exactly one challenge type (the .xor in validate.go).
func (AcmeChallenge) ValidationRule ¶
func (AcmeChallenge) ValidationRule() *validate.Rule
ValidationRule layers .xor('http01','dns01') — exactly one challenge type.
type AcmeDirectoryUrl ¶
type AcmeDirectoryUrl string
AcmeDirectoryUrl ports `Joi.string().uri({ scheme: ['https'] })` — the CA's ACME directory URL. https only, so a plaintext directory cannot be configured.
func (AcmeDirectoryUrl) ValidationRule ¶
func (AcmeDirectoryUrl) ValidationRule() *validate.Rule
type AcmeGenerator ¶
type AcmeGenerator struct {
Server AcmeDirectoryUrl `json:"server" validate:"required"`
Email string `json:"email,omitzero" validate:"email,optional"`
ExternalAccountBinding *ExternalAccountBinding `json:"externalAccountBinding,omitzero" validate:"optional"`
Challenge AcmeChallenge `json:"challenge" validate:"required"`
}
type AzureDnsDns01 ¶
type AzureDnsDns01 struct {
ResourceGroupName string `json:"resourceGroupName" validate:"required"`
HostedZoneName string `json:"hostedZoneName,omitzero" validate:"optional"`
SecretLink SecretLink `json:"secretLink" validate:"required"`
}
type CertChallengeKind ¶
type CertChallengeKind string
CertChallengeKind is the ACME challenge type a generator solves with.
const ( CertChallengeKindHttp01 CertChallengeKind = "http01" CertChallengeKindDns01 CertChallengeKind = "dns01" )
func ChallengeType ¶
func ChallengeType(spec *CertificateGeneratorSpec) CertChallengeKind
ChallengeType reports which ACME challenge a generator solves with. A spec with no dns01 block is http01, matching certificateGeneratorChallengeType.
type CertificateGenerator ¶
type CertificateGenerator struct {
Id string `json:"id,omitzero" validate:"uuid,readOnly"`
Name base.Name `json:"name,omitzero"`
Kind base.Kind `json:"kind,omitzero"`
Version *float64 `json:"version,omitzero" validate:"positive,integer,readOnly"`
Description string `json:"description,omitzero" validate:"trim,max=250,allow="`
Tags CertificateGeneratorTags `json:"tags,omitzero" validate:"default={}"`
Created string `json:"created,omitzero" validate:"date,readOnly"`
LastModified string `json:"lastModified,omitzero" validate:"date,readOnly"`
Links base.Links `json:"links,omitzero" validate:"readOnly"`
Spec CertificateGeneratorSpec `json:"spec" validate:"required"`
Status *CertificateGeneratorStatus `json:"status,omitzero"`
}
func (CertificateGenerator) ValidationRule ¶
func (CertificateGenerator) ValidationRule() *validate.Rule
ValidationRule reflects CertificateGenerator (Base.keys({spec: required, status})).
type CertificateGeneratorProvider ¶
type CertificateGeneratorProvider string
const (
CertificateGeneratorProviderAcme CertificateGeneratorProvider = "acme"
)
func (CertificateGeneratorProvider) EnumValues ¶
func (CertificateGeneratorProvider) EnumValues() []string
type CertificateGeneratorSpec ¶
type CertificateGeneratorSpec struct {
Provider CertificateGeneratorProvider `json:"provider,omitzero" validate:"required"`
Acme *AcmeGenerator `json:"acme,omitzero"`
}
CertificateGeneratorSpec is the discriminated union over `provider`; `acme` is required for provider acme and forbidden otherwise (the .when in validate.go).
func (CertificateGeneratorSpec) ValidationRule ¶
func (CertificateGeneratorSpec) ValidationRule() *validate.Rule
ValidationRule layers `acme.when('provider', {is:'acme', then:required, otherwise: forbidden})`. `provider` is declared first, so Joi's when-driven key reordering is a no-op here.
type CertificateGeneratorTags ¶
CertificateGeneratorTags aliases base.Tags so the reflection base-type registry resolves it to the shared TagsRule.
type CloudDnsDns01 ¶
type CloudDnsDns01 struct {
Project string `json:"project" validate:"required"`
SecretLink SecretLink `json:"secretLink" validate:"required"`
}
type CloudflareDns01 ¶
type CloudflareDns01 struct {
SecretLink SecretLink `json:"secretLink" validate:"required"`
}
type Dns01Challenge ¶
type Dns01Challenge struct {
Provider Dns01Provider `json:"provider,omitzero" validate:"default=cpln"`
Route53 *Route53Dns01 `json:"route53,omitzero"`
CloudDns *CloudDnsDns01 `json:"cloudDns,omitzero"`
AzureDns *AzureDnsDns01 `json:"azureDns,omitzero"`
Cloudflare *CloudflareDns01 `json:"cloudflare,omitzero"`
}
Dns01Challenge is the discriminated union over `provider`: the matching provider block is required and the other three are forbidden (the .when()s in validate.go).
func (Dns01Challenge) ValidationRule ¶
func (Dns01Challenge) ValidationRule() *validate.Rule
ValidationRule layers the `onlyFor(provider, …)` when on each dns01 provider block: the block matching `provider` is required and the other three are forbidden.
type Dns01Provider ¶
type Dns01Provider string
const ( Dns01ProviderCpln Dns01Provider = "cpln" Dns01ProviderRoute53 Dns01Provider = "route53" Dns01ProviderCloudDns Dns01Provider = "cloudDns" Dns01ProviderAzureDns Dns01Provider = "azureDns" Dns01ProviderCloudflare Dns01Provider = "cloudflare" )
func (Dns01Provider) EnumValues ¶
func (Dns01Provider) EnumValues() []string
type ExternalAccountBinding ¶
type ExternalAccountBinding struct {
KeyId string `json:"keyId" validate:"required"`
SecretLink SecretLink `json:"secretLink" validate:"required"`
}
type Http01Challenge ¶
type Http01Challenge struct{}
Http01Challenge is `Joi.object({})`: present-but-empty is the whole signal, so any key is rejected.
type Route53Dns01 ¶
type Route53Dns01 struct {
Region string `json:"region" validate:"required"`
HostedZoneId string `json:"hostedZoneId,omitzero" validate:"optional"`
SecretLink SecretLink `json:"secretLink" validate:"required"`
}
type SecretLink ¶
type SecretLink string
SecretLink ports `LocalLink.custom(toKind('secret'))`: the four dns01 provider credentials and the externalAccountBinding HMAC key all point at a secret.
func (SecretLink) ValidationRule ¶
func (SecretLink) ValidationRule() *validate.Rule
type SecretRef ¶
SecretRef is one secretLink the spec references and the secret type it must have.
func SecretLinks ¶
func SecretLinks(spec *CertificateGeneratorSpec) []SecretRef
SecretLinks ports certificateGeneratorSecretLinks: every secretLink in the spec with the secret type the provider requires. The order is the TS object's insertion order (externalAccountBinding, then the dns01 provider), which decides which link a caller is told about first.