Repository navigation
fix(cdn): create TLS activations for issued Fastly subscriptions - #14114
Conversation
Split out of #14009 so it can be judged on its own. When FastlyTls has a TLS configuration id, an issued or renewing subscription gets a TLS activation for every hostname on it, using the certificate that expires last. A 409 is re-checked rather than taken as success, since it can mean another certificate already holds the hostname. An issued subscription that carries no certificate yet reports processing. Fastly takes the id as a constructor parameter and forwards it; it was hardcoded empty. Empty keeps today's behaviour exactly: the subscription stays unpinned and nothing is activated.
✨ Benchmark resultsComparing
Per-scenario breakdown & investigation detailsMetrics below reflect the current branch (after). Δ P95 compares against the base.
Top API waits (after)
|
…tions No behaviour change. - Comments and docblocks cut to the density of the rest of FastlyTls. - tlsConfigurationId moves to the end of Fastly's constructor, so positional callers keep working. - getCertificateStatus checks activation before the existing issued branch, which is identical to main again. - hostnames() and references() lose guards for ids Fastly never returns empty, and issuedCertificateId() a check array_last() already covers. - Tests use the file's existing subscription() and json() helpers instead of a second fixture builder and hand-built responses. The www case is dropped: the apex and multi-SAN cases already cover it.
69b1b6b to
0deb57f
Compare
🟢 Tier S · Ready to merge
Adds optional TLS configuration forwarding to Fastly and ensures hostname activations before reporting issued or renewing subscriptions. It selects the latest-expiring certificate, reports processing when none is available, and updates existing activations only when their certificate belongs to the same subscription. The latest changes inline the test helper's relationship-ID extraction without changing its behavior. Latest changes: The new commit inlines relationship-ID extraction in the activation test helper, removes the separate reference helper, and broadens the return type annotation.
📂 Walkthrough · 4
Reviewed the commits since |
Activate once extractRenewDate() finds an issued or renewing certificate instead of reading the state again, and build the hostname list where it is used.
…cate The activation lookup filtered on the new certificate, so after a renewal it missed the activation still on the previous one, the create conflicted, and every retry threw. Look the hostname's activation up on the TLS configuration alone: keep it when it already holds the new certificate, move it when it holds one of the subscription's older certificates, and fail as before when another certificate holds the hostname.
Merges main a2cca78 (#14009, #14106, #14117, #14115, #14119, #14114, #14101, #14125, #14129, #14127) so cloud#5410 can require a train head that contains main at or after 0ed7232. Conflicts: none. Database 8.0 port: none needed. Main's new code only uses Document getAttribute/setAttribute and Query::equal/lessThan/orderAsc/limit (Tasks/Interval.php), all unchanged in database 8.0; no removed Database::* constants, config collections, or model magic reads. composer.json and composer.lock are untouched by main, so the train's database and migration pins stay as they are. Co-Authored-By: Claude Opus 5.5 <[email protected]>
What does this PR do?
Draft. Hold until it is confirmed that TLS activations are how subscription-issued certificates get attached to hostnames. Fastly documents
POST /tls/activationsas enabling TLS for a domain using a custom certificate; this PR uses it for certificates issued through a TLS subscription. Before merging, check a custom domain that already serves HTTPS correctly: if it has no TLS activation either, activations are not the mechanism and this PR should be closed.When
FastlyTlshas a TLS configuration id, it ensures a TLS activation exists for every hostname on an issued or renewing subscription before reporting that status:not_after, so a renewal attaches the new certificate.processing.FastlytakestlsConfigurationIdas a constructor parameter and forwards it; it was hardcoded empty. An empty id keeps today's behaviour exactly: the subscription stays unpinned and nothing is activated, so nothing changes until a deployment sets the id. A Site custom domain is handled by the network provider (Proxy::select()routessite,networkandredirectthere), so that is the provider that needs it.Test Plan
FastlyTlsTest: activates a missing apex, www and multi-SAN certificate (newestnot_after); skips an existing activation; accepts a 409 once our certificate is confirmed attached and fails when another certificate holds the hostname; reportsprocessingfor an issued or renewing subscription with no certificate; throws when activation fails; sends no activation request without a TLS configuration.FastlyTest: given an id, an issued subscription gets aPOST /tls/activationscarrying it; given none, no activation request is made.packages/cdnpasses locally: tests, Pint, PHPStan against the package baseline, Rector. These are canned-response tests. They prove the request is built correctly, not that Fastly accepts it or that the edge then serves the right certificate.Related PRs and Issues
unverified.Checklist
Generated by Claude Code