Documentation
¶
Index ¶
- Variables
- type AccountConfig
- type AcmeAccount
- type AcmeDomainValidation
- type AcmeEndpoint
- type AcmeExternalAccountBinding
- type Certificate
- type CreateAcmeDomainValidationParams
- type CreateAcmeEABParams
- type CreateAcmeEndpointParams
- type DNSPrevalidationParams
- type DomainValidationOption
- type Handler
- func (h *Handler) ChaosOperations() []string
- func (h *Handler) ChaosRegions() []string
- func (h *Handler) ChaosServiceName() string
- func (h *Handler) ExtractOperation(c *echo.Context) string
- func (h *Handler) ExtractResource(c *echo.Context) string
- func (h *Handler) GetSupportedOperations() []string
- func (h *Handler) Handler() echo.HandlerFunc
- func (h *Handler) MatchPriority() int
- func (h *Handler) Name() string
- func (h *Handler) Reset()
- func (h *Handler) Restore(ctx context.Context, data []byte) error
- func (h *Handler) RouteMatcher() service.Matcher
- func (h *Handler) Shutdown(ctx context.Context)
- func (h *Handler) Snapshot(ctx context.Context) []byte
- func (h *Handler) StartWorker(ctx context.Context) error
- type InMemoryBackend
- func (b *InMemoryBackend) AddInUseBy(ctx context.Context, certARN, resourceARN string)
- func (b *InMemoryBackend) ApplyDomainValidationOverrides(ctx context.Context, certARN string, overrides map[string]string) error
- func (b *InMemoryBackend) CertExists(ctx context.Context, certARN string) bool
- func (b *InMemoryBackend) Close()
- func (b *InMemoryBackend) CreateAcmeDomainValidation(ctx context.Context, p CreateAcmeDomainValidationParams) (*AcmeDomainValidation, error)
- func (b *InMemoryBackend) CreateAcmeEndpoint(ctx context.Context, p CreateAcmeEndpointParams) (*AcmeEndpoint, error)
- func (b *InMemoryBackend) CreateAcmeExternalAccountBinding(ctx context.Context, p CreateAcmeEABParams) (*AcmeExternalAccountBinding, error)
- func (b *InMemoryBackend) DeleteAcmeDomainValidation(ctx context.Context, dvARN string) error
- func (b *InMemoryBackend) DeleteAcmeEndpoint(ctx context.Context, epARN string) error
- func (b *InMemoryBackend) DeleteAcmeExternalAccountBinding(ctx context.Context, eabARN string) error
- func (b *InMemoryBackend) DeleteCertificate(ctx context.Context, certARN string) error
- func (b *InMemoryBackend) DescribeAcmeAccount(ctx context.Context, epARN, accountURL string) (*AcmeAccount, error)
- func (b *InMemoryBackend) DescribeAcmeDomainValidation(ctx context.Context, dvARN string) (*AcmeDomainValidation, error)
- func (b *InMemoryBackend) DescribeAcmeEndpoint(ctx context.Context, epARN string) (*AcmeEndpoint, error)
- func (b *InMemoryBackend) DescribeAcmeExternalAccountBinding(ctx context.Context, eabARN string) (*AcmeExternalAccountBinding, error)
- func (b *InMemoryBackend) DescribeCertificate(ctx context.Context, arn string) (*Certificate, error)
- func (b *InMemoryBackend) DomainValidationExists(ctx context.Context, dvARN string) bool
- func (b *InMemoryBackend) EABExists(ctx context.Context, eabARN string) bool
- func (b *InMemoryBackend) EndpointExists(ctx context.Context, epARN string) bool
- func (b *InMemoryBackend) ExpireCertificate(ctx context.Context, certARN string) error
- func (b *InMemoryBackend) ExportCertificate(ctx context.Context, certARN string, passphrase []byte) (*Certificate, error)
- func (b *InMemoryBackend) FailCertificate(ctx context.Context, certARN, reason string) error
- func (b *InMemoryBackend) GetAccountConfiguration(ctx context.Context) AccountConfig
- func (b *InMemoryBackend) GetAcmeExternalAccountBindingCredentials(ctx context.Context, eabARN string) (string, string, error)
- func (b *InMemoryBackend) GetCertificate(ctx context.Context, certARN string) (string, string, error)
- func (b *InMemoryBackend) ImportCertificate(ctx context.Context, certBody, privateKey, certChain, certARNToUpdate string) (*Certificate, error)
- func (b *InMemoryBackend) InactivateCertificate(ctx context.Context, certARN string) error
- func (b *InMemoryBackend) ListAcmeAccounts(ctx context.Context, epARN, nextToken string, maxResults int) (page.Page[AcmeAccount], error)
- func (b *InMemoryBackend) ListAcmeDomainValidations(ctx context.Context, epARN, nextToken string, maxResults int) (page.Page[AcmeDomainValidation], error)
- func (b *InMemoryBackend) ListAcmeEndpoints(ctx context.Context, nextToken string, maxResults int) (page.Page[AcmeEndpoint], error)
- func (b *InMemoryBackend) ListAcmeExternalAccountBindings(ctx context.Context, epARN, nextToken string, maxResults int) (page.Page[AcmeExternalAccountBinding], error)
- func (b *InMemoryBackend) ListCertificates(ctx context.Context, p ListCertificatesParams) (page.Page[Certificate], error)
- func (b *InMemoryBackend) PutAccountConfiguration(ctx context.Context, idempotencyToken string, daysBeforeExpiry *int32) error
- func (b *InMemoryBackend) Region() string
- func (b *InMemoryBackend) RemoveInUseBy(ctx context.Context, certARN, resourceARN string)
- func (b *InMemoryBackend) RenewCertificate(ctx context.Context, certARN string) error
- func (b *InMemoryBackend) RequestCertificate(ctx context.Context, ...) (*Certificate, error)
- func (b *InMemoryBackend) ResendValidationEmail(ctx context.Context, certARN, domain, validationDomain string) error
- func (b *InMemoryBackend) Reset()
- func (b *InMemoryBackend) Restore(ctx context.Context, data []byte) error
- func (b *InMemoryBackend) RevokeAcmeAccount(ctx context.Context, epARN, accountURL string) error
- func (b *InMemoryBackend) RevokeAcmeExternalAccountBinding(ctx context.Context, eabARN string) error
- func (b *InMemoryBackend) RevokeCertificate(ctx context.Context, certARN, revocationReason string) error
- func (b *InMemoryBackend) RunJanitor(ctx context.Context, interval time.Duration)
- func (b *InMemoryBackend) SearchCertificates(ctx context.Context, p SearchCertificatesParams) (page.Page[Certificate], error)
- func (b *InMemoryBackend) SetExportPreference(ctx context.Context, certARN, exportPref string) error
- func (b *InMemoryBackend) SetManagedBy(ctx context.Context, certARN, managedBy string) error
- func (b *InMemoryBackend) Snapshot(ctx context.Context) []byte
- func (b *InMemoryBackend) TimeoutPendingValidation(ctx context.Context, certARN string) error
- func (b *InMemoryBackend) UpdateAcmeDomainValidation(ctx context.Context, dvARN string, dns *DNSPrevalidationParams) error
- func (b *InMemoryBackend) UpdateAcmeEndpoint(ctx context.Context, epARN string, p UpdateAcmeEndpointParams) error
- func (b *InMemoryBackend) UpdateCertificateOptions(ctx context.Context, certARN, transparencyLoggingPref string) error
- type ListCertificatesParams
- type Provider
- type RenewalSummary
- type ResourceRecord
- type SearchCertificatesParams
- type UpdateAcmeEndpointParams
Constants ¶
This section is empty.
Variables ¶
var ( ErrCertNotFound = errors.New("ResourceNotFoundException") ErrInvalidParameter = errors.New("ValidationException") ErrNotEligible = errors.New("RequestInProgressException") ErrRequestInProgress = errors.New("RequestInProgressException") ErrAlreadyRevoked = errors.New("InvalidStateException") ErrInvalidState = errors.New("InvalidStateException") ErrResourceInUse = errors.New("ResourceInUseException") ErrConflict = errors.New("ConflictException") // ErrInvalidArn is returned when a CertificateArn does not match the // expected ACM ARN shape (arn:<partition>:acm:<region>:<account>:certificate/<id>). // Real AWS returns InvalidArnException for malformed ARNs, distinct from // ResourceNotFoundException (well-formed ARN, no such resource). ErrInvalidArn = errors.New("InvalidArnException") // ErrLimitExceeded is returned when an ACM account/resource quota (e.g. the // per-certificate domain-name count) is exceeded. ErrLimitExceeded = errors.New("LimitExceededException") // ErrTooManyTags is returned when a tagging operation would exceed the // maximum of 50 tags per certificate. ErrTooManyTags = errors.New("TooManyTagsException") // ErrInvalidTag is returned when a tag key or value fails AWS tag // constraints (e.g. the reserved "aws:" prefix). ErrInvalidTag = errors.New("InvalidTagException") // ErrInvalidDomainValidationOptions is returned when the // DomainValidationOptions input to RequestCertificate references a domain // not in the request, or specifies a ValidationDomain that is not the // same as or a superdomain of its DomainName. ErrInvalidDomainValidationOptions = errors.New("InvalidDomainValidationOptionsException") // ErrAcmeResourceNotFound is returned when an ACME endpoint, external // account binding, ACME account, or domain validation referenced by ARN // (or, for accounts, by AccountUrl) does not exist. It maps to the same // ResourceNotFoundException code as ErrCertNotFound but is kept as a // distinct identity so acme_*.go call sites read clearly and do not imply // a certificate was involved. ErrAcmeResourceNotFound = errors.New("ResourceNotFoundException") )
Functions ¶
This section is empty.
Types ¶
type AccountConfig ¶
type AccountConfig struct {
DaysBeforeExpiry int32 `json:"daysBeforeExpiry"`
}
AccountConfig holds account-level ACM configuration.
type AcmeAccount ¶ added in v1.2.0
type AcmeAccount struct {
CreatedAt time.Time `json:"createdAt"`
AccountURL string `json:"accountUrl"`
Region string `json:"region"`
AcmeEndpointArn string `json:"acmeEndpointArn"`
AcmeExternalAccountBindingArn string `json:"acmeExternalAccountBindingArn,omitempty"`
PublicKeyThumbprint string `json:"publicKeyThumbprint,omitempty"`
Status string `json:"status"`
Contacts []string `json:"contacts,omitempty"`
}
AcmeAccount is an ACME account registered with an endpoint. Real ACME accounts are created by an ACME client's own "newAccount" protocol call against the endpoint's EndpointUrl (RFC 8555 section 7.3) -- a real ACME protocol server is explicitly out of scope for this rollout (see CLAUDE.md's parity principles: no fabricated verified state). gopherstack therefore never populates this table itself; DescribeAcmeAccount/ ListAcmeAccounts/RevokeAcmeAccount are wired against real (honestly empty) backend state and validate their AcmeEndpointArn foreign key for real, but will only ever operate over accounts that do not exist until a real ACME protocol front-end is added -- see PARITY.md's gaps entry for this family. Owned by exactly one AcmeEndpoint, cascade-deleted with it.
type AcmeDomainValidation ¶ added in v1.2.0
type AcmeDomainValidation struct {
CreatedAt time.Time `json:"createdAt"`
UpdatedAt time.Time `json:"updatedAt"`
ResourceRecord *ResourceRecord `json:"resourceRecord,omitempty"`
ARN string `json:"arn"`
Region string `json:"region"`
AcmeEndpointArn string `json:"acmeEndpointArn"`
DomainName string `json:"domainName"`
Status string `json:"status"`
PrevalidationType string `json:"prevalidationType"`
DomainScopeExact string `json:"domainScopeExact,omitempty"`
DomainScopeSub string `json:"domainScopeSub,omitempty"`
DomainScopeWild string `json:"domainScopeWild,omitempty"`
HostedZoneID string `json:"hostedZoneId,omitempty"`
IdempotencyToken string `json:"idempotencyToken,omitempty"`
}
AcmeDomainValidation authorizes an ACME endpoint to issue certificates for a domain name via DNS prevalidation. Owned by exactly one AcmeEndpoint (AcmeEndpointArn), cascade-deleted with it -- see DeleteAcmeEndpoint in acme_endpoints.go.
Status is always VALIDATING: gopherstack has no real DNS resolver to check the synthesized ResourceRecord against, so it never claims VALID (a verification that never actually happened) or INVALID. This mirrors the task's explicit instruction not to fabricate a validated state -- see PARITY.md's gaps entry for this family.
type AcmeEndpoint ¶ added in v1.2.0
type AcmeEndpoint struct {
CreatedAt time.Time `json:"createdAt"`
UpdatedAt time.Time `json:"updatedAt"`
ARN string `json:"arn"`
Region string `json:"region"`
AuthorizationBehavior string `json:"authorizationBehavior"`
Contact string `json:"contact,omitempty"`
EndpointURL string `json:"endpointUrl"`
Status string `json:"status"`
FailureReason string `json:"failureReason,omitempty"`
IdempotencyToken string `json:"idempotencyToken,omitempty"`
AllowedKeyAlgorithms []string `json:"allowedKeyAlgorithms,omitempty"`
CertificateTags []svcTags.KV `json:"certificateTags,omitempty"`
}
AcmeEndpoint is a managed ACME server (RFC 8555) endpoint. It is the root of the ACME resource family: external account bindings (acme_eab.go), ACME accounts (acme_accounts.go), and domain validations (acme_domain_validations.go) all belong to exactly one endpoint and are cascade-deleted with it -- see DeleteAcmeEndpoint below.
type AcmeExternalAccountBinding ¶ added in v1.2.0
type AcmeExternalAccountBinding struct {
CreatedAt time.Time `json:"createdAt"`
UpdatedAt time.Time `json:"updatedAt"`
ExpiresAt *time.Time `json:"expiresAt,omitempty"`
LastUsedAt *time.Time `json:"lastUsedAt,omitempty"`
RevokedAt *time.Time `json:"revokedAt,omitempty"`
ARN string `json:"arn"`
Region string `json:"region"`
AcmeEndpointArn string `json:"acmeEndpointArn"`
RoleArn string `json:"roleArn"`
// KeyID/MacKey are the synthetic ACME EAB credentials returned by
// GetAcmeExternalAccountBindingCredentials. Real cryptographic ACME
// protocol participation is out of scope (see CLAUDE.md parity
// principles); these are deterministic, per-EAB random values -- not
// values ACM ever validates a real ACME client's request against, so
// nothing downstream treats them as cryptographically meaningful.
KeyID string `json:"keyId"`
MacKey string `json:"macKey"`
IdempotencyToken string `json:"idempotencyToken,omitempty"`
}
AcmeExternalAccountBinding (EAB) authorizes an ACME client to register an account with an endpoint, scoped to a single IAM role. Owned by exactly one AcmeEndpoint (AcmeEndpointArn), cascade-deleted with it -- see DeleteAcmeEndpoint in acme_endpoints.go.
type Certificate ¶
type Certificate struct {
CreatedAt time.Time `json:"createdAt"`
NotBefore time.Time `json:"notBefore"`
NotAfter time.Time `json:"notAfter"`
RevokedAt *time.Time `json:"revokedAt,omitempty"`
IssuedAt *time.Time `json:"issuedAt,omitempty"`
ImportedAt *time.Time `json:"importedAt,omitempty"`
RenewalSummary *RenewalSummary `json:"renewalSummary,omitempty"`
CertificateBody string `json:"certificateBody,omitempty"`
IdempotencyToken string `json:"idempotencyToken,omitempty"`
Subject string `json:"subject,omitempty"`
Issuer string `json:"issuer,omitempty"`
// SubjectCommonName/IssuerCommonName are the CommonName (CN) RDN component
// parsed/generated separately from the flattened Subject/Issuer strings
// above. Real AWS's X509Attributes.Subject/Issuer are structured
// DistinguishedName objects whose CommonName member is just the CN, e.g.
// "example.com" -- not the whole rendered DN
// ("CN=example.com,OU=...,O=...,C=US") that Subject/Issuer hold here for
// display. See crypto.go and SearchCertificates' Subject filter (CommonName
// is the only member the real SubjectFilter union defines).
SubjectCommonName string `json:"subjectCommonName,omitempty"`
IssuerCommonName string `json:"issuerCommonName,omitempty"`
KeyAlgorithm string `json:"keyAlgorithm,omitempty"`
SignatureAlgorithm string `json:"signatureAlgorithm,omitempty"`
Status string `json:"status"`
Type string `json:"type"`
RevocationReason string `json:"revocationReason,omitempty"`
DomainName string `json:"domainName"`
ValidationMethod string `json:"validationMethod,omitempty"`
RenewalEligibility string `json:"renewalEligibility,omitempty"`
CertificateChain string `json:"certificateChain,omitempty"`
Serial string `json:"serial,omitempty"`
CertificateTransparencyLoggingPref string `json:"certTransparencyLoggingPref,omitempty"`
PrivateKey string `json:"privateKey,omitempty"`
CertificateAuthorityArn string `json:"certificateAuthorityArn,omitempty"`
KeyID string `json:"keyId,omitempty"`
ExportPref string `json:"exportPref,omitempty"`
FailureReason string `json:"failureReason,omitempty"`
ARN string `json:"arn"`
ManagedBy string `json:"managedBy,omitempty"`
InUseBy []string `json:"inUseBy,omitempty"`
KeyUsage []string `json:"keyUsage,omitempty"`
ExtendedKeyUsage []string `json:"extendedKeyUsage,omitempty"`
SubjectAlternativeNames []string `json:"subjectAlternativeNames,omitempty"`
DomainValidationOptions []DomainValidationOption `json:"domainValidationOptions,omitempty"`
Exported bool `json:"exported,omitempty"`
// contains filtered or unexported fields
}
Certificate represents an ACM certificate.
type CreateAcmeDomainValidationParams ¶ added in v1.2.0
type CreateAcmeDomainValidationParams struct {
AcmeEndpointArn string
DomainName string
IdempotencyToken string
DNSPrevalidation *DNSPrevalidationParams
Tags []svcTags.KV
}
CreateAcmeDomainValidationParams holds the parsed CreateAcmeDomainValidation input.
type CreateAcmeEABParams ¶ added in v1.2.0
type CreateAcmeEABParams struct {
AcmeEndpointArn string
RoleArn string
IdempotencyToken string
ExpirationType string
Tags []svcTags.KV
ExpirationValue int64
}
CreateAcmeEABParams holds the parsed CreateAcmeExternalAccountBinding input.
type CreateAcmeEndpointParams ¶ added in v1.2.0
type CreateAcmeEndpointParams struct {
AuthorizationBehavior string
Contact string
IdempotencyToken string
AllowedKeyAlgorithms []string
CertificateTags []svcTags.KV
}
CreateAcmeEndpointParams holds the parsed CreateAcmeEndpoint input.
type DNSPrevalidationParams ¶ added in v1.2.0
type DNSPrevalidationParams struct {
DomainScopeExact string
DomainScopeSub string
DomainScopeWild string
HostedZoneID string
}
DNSPrevalidationParams is the parsed PrevalidationOptions.DnsPrevalidation member -- the only PrevalidationOptions union member the real API defines.
type DomainValidationOption ¶
type DomainValidationOption struct {
ResourceRecord *ResourceRecord `json:"resourceRecord,omitempty"`
DomainName string `json:"domainName"`
ValidationDomain string `json:"validationDomain"`
ValidationStatus string `json:"validationStatus"`
ValidationMethod string `json:"validationMethod"`
// ValidationEmails is populated when ValidationMethod is EMAIL.
ValidationEmails []string `json:"validationEmails,omitempty"`
}
DomainValidationOption holds the validation details for a single domain.
type Handler ¶
type Handler struct {
Backend *InMemoryBackend
// contains filtered or unexported fields
}
Handler is the Echo HTTP handler for ACM operations.
func NewHandler ¶
func NewHandler(backend *InMemoryBackend) *Handler
NewHandler creates a new ACM handler.
func (*Handler) ChaosOperations ¶
ChaosOperations returns all operations that can be fault-injected.
func (*Handler) ChaosRegions ¶
ChaosRegions returns all regions this ACM instance handles.
func (*Handler) ChaosServiceName ¶
ChaosServiceName returns the lowercase AWS service name for fault rule matching.
func (*Handler) ExtractOperation ¶
ExtractOperation extracts the ACM action from the X-Amz-Target header.
func (*Handler) ExtractResource ¶
ExtractResource returns the resource ARN from the JSON body -- the certificate ARN for certificate ops, or the equivalent ARN field for the ACME endpoint/EAB/domain-validation/generic-tagging operations.
func (*Handler) GetSupportedOperations ¶
GetSupportedOperations returns supported ACM operations.
func (*Handler) Handler ¶
func (h *Handler) Handler() echo.HandlerFunc
Handler returns the Echo handler function.
func (*Handler) MatchPriority ¶
MatchPriority returns the routing priority.
func (*Handler) Reset ¶
func (h *Handler) Reset()
Reset clears all handler tag state and delegates to the backend Reset.
func (*Handler) Restore ¶
Restore implements persistence.Persistable by delegating to the backend and restoring the handler's tag state.
func (*Handler) RouteMatcher ¶
RouteMatcher returns a function that matches ACM JSON-protocol requests.
func (*Handler) Shutdown ¶
Shutdown stops the background janitor and all in-flight certificate auto-validation timers so no goroutine outlives the service.
type InMemoryBackend ¶
type InMemoryBackend struct {
// contains filtered or unexported fields
}
InMemoryBackend is the in-memory store for ACM certificates. InMemoryBackend stores ACM state. certs is a single flat store.Table keyed by the composite "region|arn" string (see regionKey) with a companion byRegion Index, replacing the previous map[region]map[arn]*Certificate nesting -- see store_setup.go. The remaining maps are non-*T value maps (their values are plain structs, not pointers) and stay nested by region as plain maps.
func NewInMemoryBackend ¶
func NewInMemoryBackend(accountID, region string) *InMemoryBackend
NewInMemoryBackend creates a new InMemoryBackend.
func (*InMemoryBackend) AddInUseBy ¶
func (b *InMemoryBackend) AddInUseBy(ctx context.Context, certARN, resourceARN string)
AddInUseBy records that a resource ARN is using the certificate. It is a no-op if the certificate does not exist or the ARN is already present.
func (*InMemoryBackend) ApplyDomainValidationOverrides ¶ added in v1.2.0
func (b *InMemoryBackend) ApplyDomainValidationOverrides( ctx context.Context, certARN string, overrides map[string]string, ) error
ApplyDomainValidationOverrides applies a RequestCertificate DomainValidationOptions input (already validated by validateDomainValidationOptions) to a just-created certificate, overriding the ValidationDomain -- and, for EMAIL validation, the well-known validation email addresses derived from it -- for each named domain. It is a no-op when overrides is empty.
func (*InMemoryBackend) CertExists ¶
func (b *InMemoryBackend) CertExists(ctx context.Context, certARN string) bool
CertExists reports whether a certificate with the given ARN exists in the backend. This is used by the handler to validate tag operations.
func (*InMemoryBackend) Close ¶
func (b *InMemoryBackend) Close()
Close stops all in-flight certificate auto-validation timers so their goroutines do not outlive the backend, without otherwise clearing state. It is safe to call multiple times.
func (*InMemoryBackend) CreateAcmeDomainValidation ¶ added in v1.2.0
func (b *InMemoryBackend) CreateAcmeDomainValidation( ctx context.Context, p CreateAcmeDomainValidationParams, ) (*AcmeDomainValidation, error)
CreateAcmeDomainValidation creates a new domain validation under an existing endpoint.
func (*InMemoryBackend) CreateAcmeEndpoint ¶ added in v1.2.0
func (b *InMemoryBackend) CreateAcmeEndpoint( ctx context.Context, p CreateAcmeEndpointParams, ) (*AcmeEndpoint, error)
CreateAcmeEndpoint creates a new ACME endpoint. AuthorizationBehavior must be PRE_APPROVED (the only value the real API defines) and a PublicCertificateAuthority (the only CertificateAuthority union member AWS defines) must have been supplied -- both checked by the caller via jsonCreateAcmeEndpoint before AllowedKeyAlgorithms reaches here. Endpoints go ACTIVE synchronously: gopherstack has no async provisioning pipeline to model CREATING against, and a synchronous ACTIVE result never claims a real ACME client interaction (directory fetch, account registration, cert issuance) that did not happen.
func (*InMemoryBackend) CreateAcmeExternalAccountBinding ¶ added in v1.2.0
func (b *InMemoryBackend) CreateAcmeExternalAccountBinding( ctx context.Context, p CreateAcmeEABParams, ) (*AcmeExternalAccountBinding, error)
CreateAcmeExternalAccountBinding creates a new EAB under an existing endpoint.
func (*InMemoryBackend) DeleteAcmeDomainValidation ¶ added in v1.2.0
func (b *InMemoryBackend) DeleteAcmeDomainValidation(ctx context.Context, dvARN string) error
DeleteAcmeDomainValidation removes the domain validation with the given ARN.
func (*InMemoryBackend) DeleteAcmeEndpoint ¶ added in v1.2.0
func (b *InMemoryBackend) DeleteAcmeEndpoint(ctx context.Context, epARN string) error
DeleteAcmeEndpoint removes the endpoint and cascade-deletes every external account binding, ACME account, and domain validation that belongs to it -- real AWS ACME endpoints own their EABs/accounts/domain-validations (their ARNs are literally nested under the endpoint's), so leaving them behind as orphans after the parent endpoint disappears would misrepresent gopherstack's own resource-ownership model, not just the real API's.
func (*InMemoryBackend) DeleteAcmeExternalAccountBinding ¶ added in v1.2.0
func (b *InMemoryBackend) DeleteAcmeExternalAccountBinding(ctx context.Context, eabARN string) error
DeleteAcmeExternalAccountBinding removes the EAB with the given ARN.
func (*InMemoryBackend) DeleteCertificate ¶
func (b *InMemoryBackend) DeleteCertificate(ctx context.Context, certARN string) error
DeleteCertificate removes the certificate with the given ARN.
func (*InMemoryBackend) DescribeAcmeAccount ¶ added in v1.2.0
func (b *InMemoryBackend) DescribeAcmeAccount(ctx context.Context, epARN, accountURL string) (*AcmeAccount, error)
DescribeAcmeAccount looks up an ACME account by endpoint + AccountUrl.
func (*InMemoryBackend) DescribeAcmeDomainValidation ¶ added in v1.2.0
func (b *InMemoryBackend) DescribeAcmeDomainValidation( ctx context.Context, dvARN string, ) (*AcmeDomainValidation, error)
DescribeAcmeDomainValidation returns the domain validation with the given ARN.
func (*InMemoryBackend) DescribeAcmeEndpoint ¶ added in v1.2.0
func (b *InMemoryBackend) DescribeAcmeEndpoint(ctx context.Context, epARN string) (*AcmeEndpoint, error)
DescribeAcmeEndpoint returns the endpoint with the given ARN.
func (*InMemoryBackend) DescribeAcmeExternalAccountBinding ¶ added in v1.2.0
func (b *InMemoryBackend) DescribeAcmeExternalAccountBinding( ctx context.Context, eabARN string, ) (*AcmeExternalAccountBinding, error)
DescribeAcmeExternalAccountBinding returns the EAB with the given ARN.
func (*InMemoryBackend) DescribeCertificate ¶
func (b *InMemoryBackend) DescribeCertificate(ctx context.Context, arn string) (*Certificate, error)
DescribeCertificate returns the certificate with the given ARN.
func (*InMemoryBackend) DomainValidationExists ¶ added in v1.2.0
func (b *InMemoryBackend) DomainValidationExists(ctx context.Context, dvARN string) bool
DomainValidationExists reports whether a domain validation with the given ARN exists in the request region. Used by generic resource tagging (handler_resource_tags.go).
func (*InMemoryBackend) EABExists ¶ added in v1.2.0
func (b *InMemoryBackend) EABExists(ctx context.Context, eabARN string) bool
EABExists reports whether an EAB with the given ARN exists in the request region. Used by generic resource tagging (handler_resource_tags.go).
func (*InMemoryBackend) EndpointExists ¶ added in v1.2.0
func (b *InMemoryBackend) EndpointExists(ctx context.Context, epARN string) bool
EndpointExists reports whether an ACME endpoint with the given ARN exists in the request region. Used by sibling families (EAB, domain validation, generic resource tagging) to validate ownership FKs.
func (*InMemoryBackend) ExpireCertificate ¶
func (b *InMemoryBackend) ExpireCertificate(ctx context.Context, certARN string) error
ExpireCertificate transitions an ISSUED certificate to EXPIRED status. Returns ErrCertNotFound if no such certificate exists, ErrInvalidParameter if the certificate is not in ISSUED status.
func (*InMemoryBackend) ExportCertificate ¶
func (b *InMemoryBackend) ExportCertificate( ctx context.Context, certARN string, passphrase []byte, ) (*Certificate, error)
ExportCertificate returns the PEM certificate body, chain, and private key for an eligible certificate -- IMPORTED/PRIVATE unconditionally, AMAZON_ISSUED only when opted in via Options.Export=ENABLED (see validateCertExportable). When the stored certificate has no associated chain, a fake chain (intermediate + root) is returned in PEM format to simulate AWS ACM behaviour. If passphrase is non-nil and non-empty, the private key is returned encrypted using AES-256.
func (*InMemoryBackend) FailCertificate ¶
func (b *InMemoryBackend) FailCertificate(ctx context.Context, certARN, reason string) error
FailCertificate transitions a PENDING_VALIDATION certificate to FAILED status with the given failure reason. Returns ErrCertNotFound if no such certificate exists, ErrInvalidParameter if the certificate is not in PENDING_VALIDATION status.
func (*InMemoryBackend) GetAccountConfiguration ¶
func (b *InMemoryBackend) GetAccountConfiguration(ctx context.Context) AccountConfig
GetAccountConfiguration returns the account-level ACM configuration for the request region.
func (*InMemoryBackend) GetAcmeExternalAccountBindingCredentials ¶ added in v1.2.0
func (b *InMemoryBackend) GetAcmeExternalAccountBindingCredentials( ctx context.Context, eabARN string, ) (string, string, error)
GetAcmeExternalAccountBindingCredentials returns the KeyId/MacKey for an active (non-revoked) EAB.
func (*InMemoryBackend) GetCertificate ¶
func (b *InMemoryBackend) GetCertificate(ctx context.Context, certARN string) (string, string, error)
GetCertificate returns the PEM certificate body and chain for any certificate.
func (*InMemoryBackend) ImportCertificate ¶
func (b *InMemoryBackend) ImportCertificate( ctx context.Context, certBody, privateKey, certChain, certARNToUpdate string, ) (*Certificate, error)
ImportCertificate stores a PEM-encoded certificate, private key, and optional certificate chain, returning the ARN of the newly created or updated entry. When certARNToUpdate is non-empty, the existing certificate is updated in-place (re-import), matching AWS behavior where CertificateArn may be passed to replace an existing imported certificate.
func (*InMemoryBackend) InactivateCertificate ¶
func (b *InMemoryBackend) InactivateCertificate(ctx context.Context, certARN string) error
InactivateCertificate transitions an ISSUED certificate to INACTIVE status. Returns ErrCertNotFound if no such certificate exists, ErrInvalidParameter if the certificate is not in ISSUED status.
func (*InMemoryBackend) ListAcmeAccounts ¶ added in v1.2.0
func (b *InMemoryBackend) ListAcmeAccounts( ctx context.Context, epARN, nextToken string, maxResults int, ) (page.Page[AcmeAccount], error)
ListAcmeAccounts returns a paginated list of ACME accounts registered with epARN.
func (*InMemoryBackend) ListAcmeDomainValidations ¶ added in v1.2.0
func (b *InMemoryBackend) ListAcmeDomainValidations( ctx context.Context, epARN, nextToken string, maxResults int, ) (page.Page[AcmeDomainValidation], error)
ListAcmeDomainValidations returns a paginated list of domain validations owned by epARN.
func (*InMemoryBackend) ListAcmeEndpoints ¶ added in v1.2.0
func (b *InMemoryBackend) ListAcmeEndpoints( ctx context.Context, nextToken string, maxResults int, ) (page.Page[AcmeEndpoint], error)
ListAcmeEndpoints returns a paginated list of ACME endpoints in the request region, sorted by ARN for stable ordering.
func (*InMemoryBackend) ListAcmeExternalAccountBindings ¶ added in v1.2.0
func (b *InMemoryBackend) ListAcmeExternalAccountBindings( ctx context.Context, epARN, nextToken string, maxResults int, ) (page.Page[AcmeExternalAccountBinding], error)
ListAcmeExternalAccountBindings returns a paginated list of EABs owned by epARN.
func (*InMemoryBackend) ListCertificates ¶
func (b *InMemoryBackend) ListCertificates( ctx context.Context, p ListCertificatesParams, ) (page.Page[Certificate], error)
ListCertificates returns a paginated list of certificates, with optional filtering and sorting.
func (*InMemoryBackend) PutAccountConfiguration ¶
func (b *InMemoryBackend) PutAccountConfiguration( ctx context.Context, idempotencyToken string, daysBeforeExpiry *int32, ) error
PutAccountConfiguration stores the account-level ACM configuration. idempotencyToken must be non-empty; repeated calls with the same token are silently accepted only when the configuration is identical (AWS behavior). A conflicting call with the same token but different settings returns ErrConflict.
func (*InMemoryBackend) Region ¶
func (b *InMemoryBackend) Region() string
Region returns the AWS region this backend is configured for.
func (*InMemoryBackend) RemoveInUseBy ¶
func (b *InMemoryBackend) RemoveInUseBy(ctx context.Context, certARN, resourceARN string)
RemoveInUseBy removes a resource ARN from the certificate's InUseBy list. It is a no-op if the certificate does not exist or the ARN is not present.
func (*InMemoryBackend) RenewCertificate ¶
func (b *InMemoryBackend) RenewCertificate(ctx context.Context, certARN string) error
RenewCertificate regenerates the certificate material for an AMAZON_ISSUED certificate, extending its validity by one year. Returns ErrNotEligible for IMPORTED certificates, as AWS ACM does not support renewing imported certificates.
func (*InMemoryBackend) RequestCertificate ¶
func (b *InMemoryBackend) RequestCertificate( ctx context.Context, domainName, certType, validationMethod, idempotencyToken, keyAlgorithm, caArn, optionsPref string, sans []string, ) (*Certificate, error)
RequestCertificate creates a new certificate for the given domain. When validationMethod is "DNS" or "EMAIL" the certificate starts in PENDING_VALIDATION and automatically transitions to ISSUED after a short delay. idempotencyToken, if non-empty, deduplicates the request — repeated calls with the same token return the previously created certificate ARN.
func (*InMemoryBackend) ResendValidationEmail ¶
func (b *InMemoryBackend) ResendValidationEmail(ctx context.Context, certARN, domain, validationDomain string) error
ResendValidationEmail re-triggers the EMAIL validation flow for a certificate that is still in PENDING_VALIDATION status with EMAIL validation method.
func (*InMemoryBackend) Reset ¶
func (b *InMemoryBackend) Reset()
Reset clears all certificate state and stops any pending auto-validate timers.
func (*InMemoryBackend) Restore ¶
func (b *InMemoryBackend) Restore(ctx context.Context, data []byte) error
Restore loads backend state from a JSON snapshot. It implements persistence.Persistable.
func (*InMemoryBackend) RevokeAcmeAccount ¶ added in v1.2.0
func (b *InMemoryBackend) RevokeAcmeAccount(ctx context.Context, epARN, accountURL string) error
RevokeAcmeAccount revokes an ACME account by endpoint + AccountUrl.
func (*InMemoryBackend) RevokeAcmeExternalAccountBinding ¶ added in v1.2.0
func (b *InMemoryBackend) RevokeAcmeExternalAccountBinding(ctx context.Context, eabARN string) error
RevokeAcmeExternalAccountBinding marks an EAB revoked. Revoking an already-revoked EAB returns ErrInvalidState (InvalidStateException), matching RevokeCertificate's already-revoked handling elsewhere in this package.
func (*InMemoryBackend) RevokeCertificate ¶
func (b *InMemoryBackend) RevokeCertificate(ctx context.Context, certARN, revocationReason string) error
RevokeCertificate marks the certificate as REVOKED with the given reason. Returns ErrAlreadyRevoked if the certificate is already revoked. Only ISSUED certificates can be revoked; PENDING_VALIDATION certs return ErrInvalidParameter.
func (*InMemoryBackend) RunJanitor ¶
func (b *InMemoryBackend) RunJanitor(ctx context.Context, interval time.Duration)
RunJanitor periodically cleans up expired idempotency tokens.
func (*InMemoryBackend) SearchCertificates ¶ added in v1.2.0
func (b *InMemoryBackend) SearchCertificates( ctx context.Context, p SearchCertificatesParams, ) (page.Page[Certificate], error)
SearchCertificates returns certificates in the request region matching p.Filter (or all of them, if p.Filter is nil), sorted and paginated per p.
func (*InMemoryBackend) SetExportPreference ¶ added in v1.2.0
func (b *InMemoryBackend) SetExportPreference(ctx context.Context, certARN, exportPref string) error
SetExportPreference records a just-created certificate's RequestCertificate Options.Export choice (ENABLED/DISABLED). Real AWS treats Export as immutable once the certificate exists, so this is only ever called once, immediately after RequestCertificate, from jsonRequestCertificate. A blank pref is a no-op (the Certificate's zero value already reads as DISABLED).
func (*InMemoryBackend) SetManagedBy ¶ added in v1.2.0
func (b *InMemoryBackend) SetManagedBy(ctx context.Context, certARN, managedBy string) error
SetManagedBy records a just-created certificate's RequestCertificate ManagedBy choice. The value must already be validated (see validateManagedBy, called before the certificate is created so an invalid value never leaves an orphaned certificate behind -- same reasoning as DomainValidationOptions, see ApplyDomainValidationOverrides). Like SetExportPreference, this is only ever called once, immediately after RequestCertificate, from jsonRequestCertificate. A blank value is a no-op (the Certificate's zero value already reads as caller-managed).
func (*InMemoryBackend) Snapshot ¶
func (b *InMemoryBackend) Snapshot(ctx context.Context) []byte
Snapshot serialises the backend state to JSON. It implements persistence.Persistable.
func (*InMemoryBackend) TimeoutPendingValidation ¶
func (b *InMemoryBackend) TimeoutPendingValidation(ctx context.Context, certARN string) error
TimeoutPendingValidation transitions a PENDING_VALIDATION certificate to VALIDATION_TIMED_OUT. Returns ErrCertNotFound if no such certificate exists, ErrInvalidParameter if the certificate is not in PENDING_VALIDATION status.
func (*InMemoryBackend) UpdateAcmeDomainValidation ¶ added in v1.2.0
func (b *InMemoryBackend) UpdateAcmeDomainValidation( ctx context.Context, dvARN string, dns *DNSPrevalidationParams, ) error
UpdateAcmeDomainValidation replaces an existing domain validation's prevalidation options (the only field the real API allows updating), regenerating its DNS resource record. Status is left at VALIDATING for the same reason CreateAcmeDomainValidation never sets anything else.
func (*InMemoryBackend) UpdateAcmeEndpoint ¶ added in v1.2.0
func (b *InMemoryBackend) UpdateAcmeEndpoint( ctx context.Context, epARN string, p UpdateAcmeEndpointParams, ) error
UpdateAcmeEndpoint applies a partial update to an existing endpoint.
func (*InMemoryBackend) UpdateCertificateOptions ¶
func (b *InMemoryBackend) UpdateCertificateOptions(ctx context.Context, certARN, transparencyLoggingPref string) error
UpdateCertificateOptions sets the CertificateTransparencyLoggingPreference for a certificate. Only ISSUED certificates may be updated.
type ListCertificatesParams ¶
type ListCertificatesParams struct {
NextToken string
SortBy string
SortOrder string
StatusFilter []string
KeyTypes []string
KeyUsage []string
ExtendedKeyUsage []string
MaxItems int
}
ListCertificatesParams holds all filter and sorting options for ListCertificates.
type Provider ¶
type Provider struct{}
Provider implements service.Provider for ACM.
func (*Provider) Init ¶
func (p *Provider) Init(ctx *service.AppContext) (service.Registerable, error)
Init initializes the ACM service backend and handler.
type RenewalSummary ¶
type RenewalSummary struct {
// UpdatedAt is when the renewal summary was last updated. Required
// (always present) on the real AWS wire.
UpdatedAt time.Time `json:"updatedAt"`
// RenewalStatus is the status of the renewal (e.g. PENDING_VALIDATION, SUCCESS).
RenewalStatus string `json:"RenewalStatus"`
// RenewalStatusReason is set when RenewalStatus is FAILED, describing why.
RenewalStatusReason string `json:"renewalStatusReason,omitempty"`
// DomainValidationOptions contains per-domain validation details for the renewal.
DomainValidationOptions []DomainValidationOption `json:"DomainValidationOptions,omitempty"`
}
RenewalSummary describes the state of an ACM managed renewal for a certificate.
type ResourceRecord ¶
type ResourceRecord struct {
Name string `json:"name"`
Type string `json:"type"`
Value string `json:"value"`
}
ResourceRecord holds the CNAME record used for DNS certificate validation.
type SearchCertificatesParams ¶ added in v1.2.0
type SearchCertificatesParams struct {
Filter *certFilterStatement
SortBy string
SortOrder string
NextToken string
MaxResults int
}
SearchCertificatesParams holds the parsed SearchCertificates input.
type UpdateAcmeEndpointParams ¶ added in v1.2.0
type UpdateAcmeEndpointParams struct {
AuthorizationBehavior *string
Contact *string
AllowedKeyAlgorithms *[]string
}
UpdateAcmeEndpointParams holds the parsed UpdateAcmeEndpoint input. Every field is optional on the real wire; an empty/nil value means "leave unchanged" (see jsonUpdateAcmeEndpoint, which only sets a field here when the caller's JSON body actually included it).
Source Files
¶
- account.go
- acme_accounts.go
- acme_domain_validations.go
- acme_eab.go
- acme_endpoints.go
- acme_models.go
- certificate_lifecycle.go
- certificate_validation.go
- certificates.go
- crypto.go
- errors.go
- handler.go
- handler_account.go
- handler_acme_accounts.go
- handler_acme_domain_validations.go
- handler_acme_eab.go
- handler_acme_endpoints.go
- handler_certificates.go
- handler_resource_tags.go
- handler_search_certificates.go
- handler_tags.go
- janitor.go
- models.go
- persistence.go
- provider.go
- search_certificates.go
- store.go
- store_setup.go