Repository navigation
fix(cdn): report blocked Fastly domain validation instead of pending - #300
Merged
Merged
Conversation
Fastly keeps a TLS subscription `pending` while its authorization is `blocked` on a `_acme-challenge` CNAME only the domain owner can add, so mapping the subscription state alone made a blocked order look like progress and callers polled it forever. `FastlyTls::getCertificateStatus()` now includes the subscription's TLS authorizations in the lookup and throws `Exception\Certificate` when one is blocked or the subscription has failed. The exception carries the status, the DNS challenges to publish as `Certificates\Challenge` values, and Fastly's warnings, such as a conflicting record at the challenge name. The managed Fastly provider keeps a hostname on its current service while its TLS order is blocked. Co-Authored-By: Claude Fable 5.1 <[email protected]>
Meldiron
requested review from
abnegate,
eldadfux and
loks0n
as code owners
September 18, 2026 12:34
2 tasks done
Contributor
|
Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>
Meldiron
added a commit
that referenced
this pull request
Sep 21, 2026
Drops the parts of this branch that #300 and #304 already landed on main, and keeps only what is still unique to it. Superseded, now taken from main: - `Exception\Certificate`: main's carries `Challenge` objects, `getWarnings()` and `isBlocked()` where this branch had a raw `getDnsRecords()` array. - `Status::BLOCKED` and the `Provider::getCertificateStatus()` `@throws`. - `FastlyTls::getCertificateStatus()` blocked-authorization reporting, the `tls_authorizations` include, and the ~210 lines of tests covering them. - The README paragraph describing the old `getDnsRecords()` shape. Kept from this branch: - `Fastly`: unlinked and classic-route domain ownership, `fqdn_match=exact` with a truncation guard, and `stdClass` response handling. - `FastlyTls`: the exclusive-ownership check before a `force=true` delete, and the `findSubscription()` hardening. `Fastly::issueCertificate()` now uses main's `catch (Certificate)` around `getCertificateStatus()` on the reassignment path, since that call throws on a blocked authorization rather than returning a status. `bin/monorepo check cdn` passes; 204 CDN tests pass. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What does this PR do?
Fastly keeps a TLS subscription
pendingwhile its authorization isblockedon a_acme-challengeCNAME that only the domain owner can add.FastlyTls::getCertificateStatus()mapped the subscription state alone, so a blocked order looked like progress and a consumer polling for completion waited forever. The Cloud-specific adapter this package replaced used to read the authorizations and report the record; that was lost in the switch, and two customer domains sat in "Generating certificate" for over a week with nothing in their logs but "still waiting".findSubscription()includestls_authorizationsalongsidetls_certificates.getCertificateStatus()throwsUtopia\Cdn\Exception\Certificatewhen a referenced authorization for the domain isblocked, or the subscription hasfailed. The exception carriesgetStatus()(Status::BLOCKEDorStatus::FAILED),getChallenges()(typedCertificates\Challengevalues:type,recordType,recordName,values) andgetWarnings()(Fastly'swarnings[].instructions, for example "Conflicting record(s) found at _acme-challenge.example.com…"). The message is self-contained for callers that only log it.Status::BLOCKEDis added. It is reported through the exception rather than returned, so a poller cannot mistake it for progress.FastlyTls::CHALLENGE_MANAGED_DNSnames the_acme-challengechallenge, the one that proves ownership without pointing the domain itself at Fastly.Fastlyprovider catches the exception in its reassign path, so a blocked order never moves a live hostname.pending) stay pending.The shape this reads, from
GET /tls/subscriptions?filter[tls_domains.id]=www.example.com&include=tls_certificates,tls_authorizationsin the reported case:{ "data": [{ "id": "…", "attributes": { "state": "pending" }, "relationships": { "tls_authorizations": { "data": [{ "id": "auth_1", "type": "tls_authorization" }] } } }], "included": [{ "id": "auth_1", "type": "tls_authorization", "attributes": { "state": "blocked", "challenges": [{ "type": "managed-dns", "record_type": "CNAME", "record_name": "_acme-challenge.www.example.com", "values": ["zl4aax3f2fd367mi8h.fastly-validations.com"] }], "warnings": [{ "type": "dns", "instructions": "Conflicting record(s) found at …" }] } }] }Test plan
bin/monorepo test cdn: 90 tests, 221 assertions (13 new).bin/monorepo check cdn: Pint, PHPStan level 6 and Rector clean.pending/processing/renewingsubscriptions; warnings forwarded; apendingauthorization is still waited on;failedsubscription with and without authorizations;issuedignores a stale authorization; other-domain and unreferenced authorizations ignored; malformed challenges skipped; several challenges offered as alternatives; managed provider leaves a hostname on its service while TLS is blocked.Related
cdn/0.0.12tag after merge.🤖 Generated with Claude Code