Skip to content

Commit cfd160b

Browse files
authored
feat(api): add managed custom-domain TLS types (#12)
* feat(api): support managed custom-domain TLS * fix(api): align managed TLS types with the hosting contract Vendor the managed custom-domain TLS schemas from the current Hosting bundle: the create request uses the flat FrontendCustomDomainTLSConfig with managed and byoc modes, responses expose failure_reason, and the domain and PEM fields carry length limits. Drop the discriminated create request types that Hosting no longer defines. * test(api): guard custom-domain responses against certificate fields * test(api): cover both TLS modes and key fields in custom-domain guards * test(api): round-trip managed TLS wire shapes through generated models * test(api): type the certificate guard against any attrs model * test(api): encode managed TLS requests through constructors and cover the domain feed * test(api): clarify managed TLS fixture names and sources * fix(api): vendor the final managed TLS contract Take the custom-domain TLS area from the final Hosting bundle: responses expose routing_target_hostname and deprecate required_routing_record, the routing record drops zone_apex_record_type, verification_status includes failed, and createFrontendCustomDomain returns a typed 409 with the caller's ownership record. Pin the new shapes in native tests. * test(api): cover BYOC chains, repeat creates, and failed or legacy domain feeds * test(api): pin managed TLS fixtures to the documented Hosting responses * test(api): decode domain status through the generated GET operation * test(api): pin re-encoding of routing target and failure reason * fix(api): vendor final managed TLS contract text Restore the BYOC default on the custom-domain TLS mode and take the final Hosting wording for verification_status, the ownership failure reason, and createFrontendCustomDomain takeover rules. Regenerate the client: FrontendCustomDomainTLSConfig now defaults mode to byoc on construction and always sends it, while decoding still requires it. * fix(api): accept manifest TLS blocks without a mode Take Hosting's manifest TLS contract: BYOCProjectConfigFrontendCustomDomainTLSConfig no longer requires mode, and ProjectConfigFrontendCustomDomainTLSConfig drops its mode discriminator and documents the BYOC default. Regenerate the client so a manifest TLS block without mode decodes as BYOC and round-trips without adding one, while mode: managed still selects the managed variant.
1 parent eecb0c6 commit cfd160b

18 files changed

Lines changed: 1049 additions & 111 deletions

‎openapi/openapi.yaml‎

Lines changed: 135 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -4800,6 +4800,8 @@ paths:
48004800
Configures one custom domain for a frontend.
48014801
The default Volcano-generated frontend URL remains active.
48024802
Wildcard Volcano frontend TLS remains valid and isolated from custom-domain certificate changes.
4803+
Managed TLS returns the DNS records currently required for setup. Volcano may require a tenant-specific TXT ownership challenge before returning the certificate authority's validation record. After ownership verification succeeds, Volcano permanently assigns the hostname to the account, including after the domain is deleted. A required but unverified ownership reservation expires after 72 hours.
4804+
An unverified reservation does not block an account that proves ownership. When another account holds one, a managed TLS request gets `409` with `code: ownership_verification_required` and the caller's own `required_record`; after publishing it, the same request takes over the reservation. A BYOC request with a publicly trusted certificate and key for the hostname also takes it over; other BYOC requests get a `409` without `code`. Hostnames claimed through ownership verification and BYOC domains are never taken over.
48034805
operationId: createFrontendCustomDomain
48044806
security:
48054807
- UserToken: []
@@ -4850,11 +4852,11 @@ paths:
48504852
schema:
48514853
$ref: '#/components/schemas/Error'
48524854
'409':
4853-
description: Conflict - custom domain already in use, still detaching, or frontend already has a custom domain
4855+
description: Conflict - custom domain already in use, reserved by another account until ownership is proven, still detaching, or frontend already has a custom domain
48544856
content:
48554857
application/json:
48564858
schema:
4857-
$ref: '#/components/schemas/Error'
4859+
$ref: '#/components/schemas/FrontendCustomDomainConflictError'
48584860
'500':
48594861
description: Internal server error
48604862
content:
@@ -14600,10 +14602,12 @@ components:
1460014602
- text_body
1460114603
CreateFrontendCustomDomainRequest:
1460214604
type: object
14605+
additionalProperties: false
1460314606
properties:
1460414607
domain:
1460514608
type: string
14606-
description: Fully-qualified domain name (hostname only, no scheme/path)
14609+
maxLength: 253
14610+
description: 'Fully-qualified domain name (hostname only, no scheme/path). Managed TLS (`tls.mode: managed`) accepts at most 219 characters; BYOC accepts 253.'
1460714611
example: app.example.com
1460814612
tls:
1460914613
$ref: '#/components/schemas/FrontendCustomDomainTLSConfig'
@@ -16436,12 +16440,23 @@ components:
1643616440
enum:
1643716441
- pending
1643816442
- verified
16443+
- failed
16444+
description: '`verified`: the domain is served by a validated certificate. `pending`: it is not served yet, is being re-validated after its certificate material was withdrawn, or Volcano is retrying after a failure. `failed`: a failure left the domain unserved, alongside `domain_status: failed`; managed domains report the cause in `failure_reason`.'
16445+
failure_reason:
16446+
type: string
16447+
description: Failure category, present only when managed TLS setup has failed. Current values are provider, certificate, ownership, and internal; ownership means another account has already claimed the hostname through ownership verification. Treat unrecognized values as internal.
1643916448
verification_records:
1644016449
type: array
1644116450
items:
1644216451
$ref: '#/components/schemas/FrontendDomainVerificationRecord'
1644316452
required_routing_record:
16444-
$ref: '#/components/schemas/FrontendDomainRoutingRecord'
16453+
allOf:
16454+
- $ref: '#/components/schemas/FrontendDomainRoutingRecord'
16455+
deprecated: true
16456+
description: Deprecated and no longer returned. Use routing_target_hostname as the DNS routing target.
16457+
routing_target_hostname:
16458+
type: string
16459+
description: DNS routing target hostname for this frontend. The DNS record type depends on whether the custom domain is a zone apex.
1644516460
effective_urls:
1644616461
type: array
1644716462
items:
@@ -16462,26 +16477,60 @@ components:
1646216477
- updated_at
1646316478
FrontendCustomDomainTLSConfig:
1646416479
type: object
16480+
description: 'TLS for a new custom domain. With `mode: managed`, Volcano issues and renews the certificate; omit every PEM field. With `mode: byoc`, send both `certificate_pem` and `private_key_pem`, plus an optional `certificate_chain_pem`.'
16481+
additionalProperties: false
16482+
not:
16483+
anyOf:
16484+
- allOf:
16485+
- properties:
16486+
mode:
16487+
enum:
16488+
- managed
16489+
required:
16490+
- mode
16491+
- anyOf:
16492+
- required:
16493+
- certificate_pem
16494+
- required:
16495+
- private_key_pem
16496+
- required:
16497+
- certificate_chain_pem
16498+
- allOf:
16499+
- properties:
16500+
mode:
16501+
enum:
16502+
- byoc
16503+
required:
16504+
- mode
16505+
- anyOf:
16506+
- not:
16507+
required:
16508+
- certificate_pem
16509+
- not:
16510+
required:
16511+
- private_key_pem
1646516512
properties:
1646616513
mode:
1646716514
type: string
1646816515
enum:
16516+
- managed
1646916517
- byoc
1647016518
default: byoc
16471-
description: BYOC is mandatory for custom domain creation.
16519+
description: managed for a Volcano-issued certificate; byoc to supply your own.
1647216520
certificate_pem:
1647316521
type: string
16474-
description: Required. PEM-encoded certificate.
16522+
maxLength: 65536
16523+
description: PEM-encoded certificate. Required when mode is byoc; not allowed when mode is managed.
1647516524
private_key_pem:
1647616525
type: string
16477-
description: Required. PEM-encoded private key.
16526+
maxLength: 65536
16527+
description: PEM-encoded private key. Required when mode is byoc; not allowed when mode is managed.
1647816528
certificate_chain_pem:
1647916529
type: string
16480-
description: Optional PEM-encoded certificate chain.
16530+
maxLength: 65536
16531+
description: Optional PEM-encoded certificate chain when mode is byoc; not allowed when mode is managed.
1648116532
required:
1648216533
- mode
16483-
- certificate_pem
16484-
- private_key_pem
1648516534
FrontendDeployment:
1648616535
type: object
1648716536
properties:
@@ -16586,6 +16635,7 @@ components:
1658616635
- value
1658716636
FrontendDomainVerificationRecord:
1658816637
type: object
16638+
description: The DNS records currently required for managed TLS. Volcano may require a tenant-specific TXT ownership record before returning a CNAME that authorizes certificate issuance and renewal. Clients must follow the records returned for the current lifecycle state instead of assuming a fixed sequence.
1658916639
properties:
1659016640
name:
1659116641
type: string
@@ -16597,6 +16647,14 @@ components:
1659716647
- name
1659816648
- type
1659916649
- value
16650+
FrontendCustomDomainConflictError:
16651+
description: 'Custom domain create conflict. With `code: ownership_verification_required`, another account holds an unverified managed TLS reservation for the hostname: publish `required_record` in DNS and send the same request again. The retry succeeds once Volcano can see the record. Other conflicts omit both fields.'
16652+
allOf:
16653+
- $ref: '#/components/schemas/Error'
16654+
- type: object
16655+
properties:
16656+
required_record:
16657+
$ref: '#/components/schemas/FrontendDomainVerificationRecord'
1660016658
FrontendUsageDailyEntry:
1660116659
type: object
1660216660
description: One day of request and error counts for a single frontend.
@@ -18551,17 +18609,21 @@ components:
1855118609
type: object
1855218610
additionalProperties: false
1855318611
description: |
18554-
Custom domain with BYOC TLS (SUPERAGENT plan). `tls` is required when the
18555-
domain is first created and optional afterwards: providing new TLS
18556-
material for the same domain rotates the certificate in place (zero
18557-
downtime); omitting `tls` keeps the stored certificate. TLS material is
18558-
write-only and omitted from config export.
18612+
Custom domain with managed or BYOC TLS (SUPERAGENT plan). `tls` is required
18613+
when the domain is first created and optional afterwards. For an existing
18614+
domain, omitting `tls` or sending only `tls.mode` keeps the stored
18615+
certificate; new BYOC material for the same domain rotates the
18616+
certificate in place (zero downtime). Changing `tls.mode` for the same
18617+
hostname, or the hostname of a managed domain, requires deleting the
18618+
domain first. BYOC TLS material is write-only; exports render only
18619+
`tls.mode`.
1855918620
properties:
1856018621
domain:
1856118622
type: string
18562-
description: Fully-qualified domain name (hostname only, no scheme/path)
18623+
maxLength: 253
18624+
description: 'Fully-qualified domain name (hostname only, no scheme/path). Managed TLS (`tls.mode: managed`) accepts at most 219 characters; BYOC accepts 253.'
1856318625
tls:
18564-
$ref: '#/components/schemas/FrontendCustomDomainTLSConfig'
18626+
$ref: '#/components/schemas/ProjectConfigFrontendCustomDomainTLSConfig'
1856518627
required:
1856618628
- domain
1856718629
ProjectConfigDatabase:
@@ -20404,6 +20466,62 @@ components:
2040420466
$ref: '#/components/schemas/AuthPageTheme'
2040520467
layouts:
2040620468
$ref: '#/components/schemas/ProjectConfigAuthPageLayouts'
20469+
ManagedProjectConfigFrontendCustomDomainTLSConfig:
20470+
type: object
20471+
description: Volcano issues and renews the certificate. Certificate fields are not allowed.
20472+
additionalProperties: false
20473+
properties:
20474+
mode:
20475+
type: string
20476+
enum:
20477+
- managed
20478+
required:
20479+
- mode
20480+
BYOCProjectConfigFrontendCustomDomainTLSConfig:
20481+
type: object
20482+
description: 'Your own certificate. Send `certificate_pem` and `private_key_pem` together, with an optional `certificate_chain_pem`, to create the domain or rotate its certificate. For an existing BYOC domain, `mode: byoc` without certificate fields keeps the stored certificate; exports render only the mode.'
20483+
additionalProperties: false
20484+
not:
20485+
anyOf:
20486+
- required:
20487+
- certificate_pem
20488+
not:
20489+
required:
20490+
- private_key_pem
20491+
- required:
20492+
- private_key_pem
20493+
not:
20494+
required:
20495+
- certificate_pem
20496+
- required:
20497+
- certificate_chain_pem
20498+
not:
20499+
required:
20500+
- certificate_pem
20501+
- private_key_pem
20502+
properties:
20503+
mode:
20504+
type: string
20505+
enum:
20506+
- byoc
20507+
description: Optional; a TLS block without `mode` is BYOC.
20508+
certificate_pem:
20509+
type: string
20510+
maxLength: 65536
20511+
description: PEM-encoded certificate for create or rotation. Requires private_key_pem. Omitted from exports.
20512+
private_key_pem:
20513+
type: string
20514+
maxLength: 65536
20515+
description: PEM-encoded private key for create or rotation. Requires certificate_pem. Omitted from exports.
20516+
certificate_chain_pem:
20517+
type: string
20518+
maxLength: 65536
20519+
description: Optional PEM-encoded certificate chain. Requires certificate_pem and private_key_pem. Omitted from exports.
20520+
ProjectConfigFrontendCustomDomainTLSConfig:
20521+
description: TLS for the custom domain. `mode` defaults to `byoc` when omitted.
20522+
oneOf:
20523+
- $ref: '#/components/schemas/ManagedProjectConfigFrontendCustomDomainTLSConfig'
20524+
- $ref: '#/components/schemas/BYOCProjectConfigFrontendCustomDomainTLSConfig'
2040720525
DatabaseQueryPerformanceDatabase:
2040820526
type: object
2040920527
properties:

0 commit comments

Comments
 (0)