Repository navigation
feat(prisma): Prisma.DomainOwnership, proved automatically for Website domains - #2701
sam-goodwin wants to merge 15 commits into
Conversation
|
Install the packages built from this commit: alchemypnpm install https://pkg.alchemy.run/alchemy/pr:2701:cd4484d@alchemy.run (28)pnpm install https://pkg.alchemy.run/@alchemy.run/better-auth/pr:2701:cd4484dpnpm install https://pkg.alchemy.run/@alchemy.run/git/pr:2701:cd4484dpnpm install https://pkg.alchemy.run/@alchemy.run/drizzle/pr:2701:cd4484dpnpm install https://pkg.alchemy.run/@alchemy.run/acme/pr:2701:cd4484dpnpm install https://pkg.alchemy.run/@alchemy.run/axiom/pr:2701:cd4484dpnpm install https://pkg.alchemy.run/@alchemy.run/doppler/pr:2701:cd4484dpnpm install https://pkg.alchemy.run/@alchemy.run/infisical/pr:2701:cd4484dpnpm install https://pkg.alchemy.run/@alchemy.run/turso/pr:2701:cd4484dpnpm install https://pkg.alchemy.run/@alchemy.run/planetscale/pr:2701:cd4484dpnpm install https://pkg.alchemy.run/@alchemy.run/neon/pr:2701:cd4484dpnpm install https://pkg.alchemy.run/@alchemy.run/prisma/pr:2701:cd4484dpnpm install https://pkg.alchemy.run/@alchemy.run/hetzner/pr:2701:cd4484dpnpm install https://pkg.alchemy.run/@alchemy.run/railway/pr:2701:cd4484dpnpm install https://pkg.alchemy.run/@alchemy.run/fly/pr:2701:cd4484dpnpm install https://pkg.alchemy.run/@alchemy.run/github/pr:2701:cd4484dpnpm install https://pkg.alchemy.run/@alchemy.run/stripe/pr:2701:cd4484dpnpm install https://pkg.alchemy.run/@alchemy.run/cloudflare/pr:2701:cd4484dpnpm install https://pkg.alchemy.run/@alchemy.run/gcp/pr:2701:cd4484dpnpm install https://pkg.alchemy.run/@alchemy.run/aws/pr:2701:cd4484dpnpm install https://pkg.alchemy.run/@alchemy.run/domain/pr:2701:cd4484dpnpm install https://pkg.alchemy.run/@alchemy.run/kubernetes/pr:2701:cd4484dpnpm install https://pkg.alchemy.run/@alchemy.run/docker/pr:2701:cd4484dpnpm install https://pkg.alchemy.run/@alchemy.run/redis/pr:2701:cd4484dpnpm install https://pkg.alchemy.run/@alchemy.run/sql/pr:2701:cd4484dpnpm install https://pkg.alchemy.run/@alchemy.run/cloudflare-runtime/pr:2701:cd4484dpnpm install https://pkg.alchemy.run/@alchemy.run/frontend-frameworks/pr:2701:cd4484dpnpm install https://pkg.alchemy.run/@alchemy.run/node-utils/pr:2701:cd4484dpnpm install https://pkg.alchemy.run/@alchemy.run/pkg/pr:2701:cd4484dTransitive Dependencies (19)pnpm install https://pkg.alchemy.run/@distilled.cloud/aws/pr:2701:cd4484dpnpm install https://pkg.alchemy.run/@distilled.cloud/acme/pr:2701:cd4484dpnpm install https://pkg.alchemy.run/@distilled.cloud/axiom/pr:2701:cd4484dpnpm install https://pkg.alchemy.run/@distilled.cloud/core/pr:2701:cd4484dpnpm install https://pkg.alchemy.run/@distilled.cloud/doppler/pr:2701:cd4484dpnpm install https://pkg.alchemy.run/@distilled.cloud/infisical/pr:2701:cd4484dpnpm install https://pkg.alchemy.run/@distilled.cloud/turso/pr:2701:cd4484dpnpm install https://pkg.alchemy.run/@distilled.cloud/planetscale/pr:2701:cd4484dpnpm install https://pkg.alchemy.run/@distilled.cloud/neon/pr:2701:cd4484dpnpm install https://pkg.alchemy.run/@distilled.cloud/prisma/pr:2701:cd4484dpnpm install https://pkg.alchemy.run/@distilled.cloud/hetzner/pr:2701:cd4484dpnpm install https://pkg.alchemy.run/@distilled.cloud/railway/pr:2701:cd4484dpnpm install https://pkg.alchemy.run/@distilled.cloud/fly-io/pr:2701:cd4484dpnpm install https://pkg.alchemy.run/@distilled.cloud/github/pr:2701:cd4484dpnpm install https://pkg.alchemy.run/@distilled.cloud/stripe/pr:2701:cd4484dpnpm install https://pkg.alchemy.run/@distilled.cloud/aws4signer/pr:2701:cd4484dpnpm install https://pkg.alchemy.run/@distilled.cloud/cloudflare/pr:2701:cd4484dpnpm install https://pkg.alchemy.run/@distilled.cloud/iceberg/pr:2701:cd4484dpnpm install https://pkg.alchemy.run/@distilled.cloud/gcp/pr:2701:cd4484dPublished |
|
@wmadden, a Management API question for you, since you know the Prisma side. Prisma now refuses a new custom domain until the workspace proves it owns the hostname: Alchemy publishes a site's DNS records before it registers the domain (
This PR works around that by requesting a domain on Request: a read-only endpoint that returns the verification record for a hostname. Something like: It would also help to put the record in the 422 body as structured fields ( With that endpoint, |
|
Hi Sam, The verification record is now returned as data. This is live in production. When you POST
Two things worth knowing for the DNS adapter:
This is documented in the OpenAPI spec at https://api.prisma.io/v1/doc on the 422 response of that route. Let me know if the shape doesn't fit what Alchemy needs. |
…rification # Conflicts: # packages/prisma/src/CustomDomain.ts
|
Thanks @wmadden, that's exactly what we needed, and thanks for documenting the ownership-before-DNS ordering in the spec. Both PRs now read
|
…m and workflow engine (#2601) Co-authored-by: Sam Goodwin <sam@alchemy.run>
…ain (#2762) Co-authored-by: Sam Goodwin <sam@alchemy.run>
Carries the Prisma parts of alchemy-run#2698 and alchemy-run#2701 onto main: Prisma.DomainOwnership, the internal DomainVerification and AuthoritativeDns helpers, Prisma.CustomDomain on distilled with an optional ownership, and the Website domain proving its hostname. Prisma now saves a domain ownership as unverified and returns it, so a successful create no longer proves anything. Proving creates the domain ownership, waits for the TXT record at the authoritative nameservers, then calls the verify route until Prisma reports verified. If it never does, the deploy fails with PrismaDomainOwnershipRequired and a domain ownership the deploy created is removed. Attributes add status and expiresAt; verifiedAt is null unless verified. The distilled pin is temporary: 51020e295 on the bot fork wmadden-electric/distilled (branch feat/prisma-routing-urls-on-alchemy-pin), which is Distilled's feature commits on top of 63ab82684, the commit Alchemy pins upstream. They expose httpStatus on createServiceDomain and createWorkspaceDomainOwnership and drop DomainOwnershipRequired from createWorkspaceDomainOwnership. Replace the pin with a Distilled main commit before the pull request opens. Signed-off-by: willbot <w.a.madden+machine@gmail.com> Signed-off-by: Will Madden <madden@prisma.io>
Carries the Prisma parts of alchemy-run#2698 and alchemy-run#2701 onto main: Prisma.DomainOwnership, the internal DomainVerification and AuthoritativeDns helpers, Prisma.CustomDomain on distilled with an optional ownership, and the Website domain proving its hostname. Prisma now saves a domain ownership as unverified and returns it, so a successful create no longer proves anything. Proving creates the domain ownership, waits for the TXT record at the authoritative nameservers, then calls the verify route until Prisma reports verified. If it never does, the deploy fails with PrismaDomainOwnershipRequired and a domain ownership the deploy created is removed. Attributes add status and expiresAt; verifiedAt is null unless verified. The distilled pin is temporary: 51020e295 on the bot fork wmadden-electric/distilled (branch feat/prisma-routing-urls-on-alchemy-pin), which is Distilled's feature commits on top of 63ab82684, the commit Alchemy pins upstream. They expose httpStatus on createServiceDomain and createWorkspaceDomainOwnership and drop DomainOwnershipRequired from createWorkspaceDomainOwnership. Replace the pin with a Distilled main commit before the pull request opens. Signed-off-by: willbot <w.a.madden+machine@gmail.com> Signed-off-by: Will Madden <madden@prisma.io>
|
Hi Sam. #3529 includes what this pull request does, updated for two changes in Prisma's API. Could you close this one if you agree? Same as here:
Different, because Prisma's API changed:
#3529 needs alchemy-run/distilled#1348 merged first. |
|
Superseded by #3529 (Prisma.RoutingUrl), which replaces the custom-domain routes. Closing. |
Prisma requires a workspace to prove it owns a hostname before it attaches a custom domain. A Prisma website with
domain: { name, dns }now proves ownership itself, in the same deploy:Prisma.DomainOwnershipproves a domain directly, e.g. a wildcard once for many apps:Destroying it deletes the ownership and its TXT record. An ownership this resource didn't create (another stack, or proved by hand) is
Unownedand needs--adopt, so destroying one stack never strips another's proof.Built on Prisma's new domain-ownership API (alchemy-run/distilled#1007):
GET /v1/workspaces/{id}/domain-ownerships/verification, so the.invalidprobe is gone.Prisma.CustomDomainmoves from the hand-written client to distilled's/v1/servicesroutes (/v1/appsis deprecated) and handles the typedDomainOwnershipRequired/DomainDnsNotConfigurederrors.🤖 Generated with Claude Code