Skip to content

feat(api): add managed custom-domain TLS types - #12

Merged
swkeever merged 18 commits into
mainfrom
skeever/vol-314-managed-tls
Oct 6, 2026
Merged

swkeever merged 18 commits into
mainfrom
skeever/vol-314-managed-tls

Conversation

@swkeever

@swkeever swkeever commented Aug 31, 2026 •

Copy link
Copy Markdown
Collaborator

Vendors the managed custom-domain TLS contract from Kong/volcano-hosting#1021, so SDK users get typed managed and BYOC custom domains.

What changes

  • Create request: tls.mode is managed or byoc and defaults to byoc. mode stays required and the TLS config stays a flat object, so clients already generated from the BYOC-only contract still compile. Managed requests send no certificate fields. BYOC requests send a certificate and key, plus an optional chain.
  • Domain response: adds verification_status (pending, verified or failed), failure_reason for managed domains (provider, certificate, ownership or internal), verification_records, and routing_target_hostname. required_routing_record is deprecated, and the server no longer returns it.
  • 409 on create: decodes as FrontendCustomDomainConflictError. This is Error plus an optional required_record. A managed request for a hostname that another account has reserved without proving ownership gets code: ownership_verification_required and the _volcano.<host> TXT record to publish.
  • Project config: custom_domain.tls is a oneOf on mode, either {mode: managed} or {mode: byoc} with certificate and key.

Only the custom-domain TLS part of the hosting spec is vendored. Unrelated hosting drift is left to the regular OpenAPI sync. Generated code stays private under volcano_sdk._generated, and no handwritten code depends on the changed models.

Review guide

  1. openapi/openapi.yaml: the TLS schemas and the custom-domain operations.
  2. src/volcano_sdk/_generated/: regenerated. Don't review it line by line.
  3. src/volcano_sdk/_tests/test_managed_tls_contract.py: request and response round-trips using fixtures from the hosting docs. Covers the 409 conflict decoding, 400 and 503 still decoding as Error, and the byoc default.

Validation

uv run --locked poe checks passes: policy, audit, generated-code freshness, ruff, mypy, basedpyright, the full test suite at 100% coverage, and the package checks.

Merge before the hosting stack (Kong/volcano-hosting#1020 → #1167 → #1168 → #1576 → #1021). Part of VOL-314.

@swkeever

swkeever commented Sep 2, 2026

Copy link
Copy Markdown
Collaborator Author

@codex review

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 2, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-05T23:47:17.721886Z 077de0f Manual request
🔒 Security Review ✅ Completed 2026-10-05T23:46:51.810433Z 077de0f Manual request
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Hooray!

Reviewed commit: 530d589179

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@swkeever
swkeever force-pushed the skeever/vol-314-managed-tls branch from 530d589 to 7e1347c Compare September 3, 2026 14:18
@swkeever

swkeever commented Sep 3, 2026

Copy link
Copy Markdown
Collaborator Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 7e1347c8a2

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread openapi/openapi.yaml Outdated
Comment on lines +9482 to +9484
type: object
description: OAuth provider API response envelope
required:
- provider
- endpoint
- status_code
- data
properties:
provider:
type: string
enum: [google, github, microsoft, apple]
endpoint:
type: string
status_code:
type: integer
minimum: 100
maximum: 599
data:
description: Raw JSON value returned by the OAuth provider's API
additionalProperties: true
description: Raw response from the OAuth provider's API

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Allow non-object provider JSON responses

The response is now described and returned as the provider's raw JSON, but this schema still restricts it to an object. For endpoints with a top-level array—most notably the documented GitHub /user/repos example—the generated transport passes the list to CallOAuthProviderAPIResponse200.from_dict(), where dict(src_dict) raises instead of returning the JSON through Auth.call_oauth_api; scalar or null responses fail similarly. The previous test fixture even exercised a repository list before being changed to an artificial wrapper object. Model the response as an arbitrary JSON value rather than type: object.

Useful? React with 👍 / 👎.

Comment on lines 36 to 38
mode: BYOCFrontendCustomDomainTLSConfigMode
certificate_pem: str
private_key_pem: str

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Preserve the existing BYOC TLS model API

Existing custom-domain clients import FrontendCustomDomainTLSConfig and can construct it with only certificate_pem and private_key_pem, because mode previously defaulted to byoc. This regeneration deletes that module and class, replaces it with BYOCFrontendCustomDomainTLSConfig, and makes mode mandatory, so every existing BYOC integration fails at import time (or at construction after changing the import) even though BYOC remains supported. Retain a compatibility alias/model with the prior constructor behavior while adding the managed variant.

Useful? React with 👍 / 👎.

@swkeever
swkeever force-pushed the skeever/vol-314-managed-tls branch from 7e1347c to 679db2b Compare September 3, 2026 15:40
@swkeever

swkeever commented Sep 3, 2026

Copy link
Copy Markdown
Collaborator Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Delightful!

Reviewed commit: 679db2b86a

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@swkeever
swkeever force-pushed the skeever/vol-314-managed-tls branch from 679db2b to c0cc37b Compare September 3, 2026 16:14
@swkeever

swkeever commented Sep 3, 2026

Copy link
Copy Markdown
Collaborator Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Bravo.

Reviewed commit: c0cc37b539

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@swkeever
swkeever force-pushed the skeever/vol-314-managed-tls branch from c0cc37b to 57a3843 Compare September 3, 2026 16:56
@swkeever

swkeever commented Sep 3, 2026

Copy link
Copy Markdown
Collaborator Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Swish!

Reviewed commit: 57a3843351

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

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.
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.
@swkeever

swkeever commented Oct 5, 2026

Copy link
Copy Markdown
Collaborator Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

🛡️ Codex Security Review · Automatically triggered

Security review completed. No security issues were found in this pull request.

Reviewed commit: 077de0f5fa

View security finding report

Only the user who started this review can view the report in Codex.

ℹ️ About Codex security reviews in GitHub

This is an experimental Codex feature. Security reviews are triggered when:

  • You comment "@codex security review"
  • A regular code review gets triggered (for example, "@codex review" or when a PR is opened), and you’re opted in so security review runs alongside code review

Once complete, Codex will leave suggestions, or a comment if no findings are found.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 077de0f5fa

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +41 to 43
certificate_pem: str | Unset = UNSET
private_key_pem: str | Unset = UNSET
certificate_chain_pem: str | Unset = UNSET

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Model TLS modes as distinct request variants

When a caller selects BYOC, these optional fields make FrontendCustomDomainTLSConfig(mode="byoc") a well-typed request that serializes only the mode, even though the documented create contract requires both certificate and key; conversely, managed mode accepts and serializes forbidden PEM fields. The surrounding OpenAPI not rules are not represented in the generated constructor, so invalid combinations survive type checking and fail only at the API. Express the create-time modes as a native discriminated oneOf, as the project-config schema already does, so generation produces variant-specific constructors.

AGENTS.md reference: AGENTS.md:L3-L5

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not changing. This SDK vendors the hosting wire contract verbatim and doesn't hand-edit generated code, so contract shape is decided in Kong/volcano-hosting#1021. Main's create schema is already flat with mode required, so widening the enum to [managed, byoc] keeps every existing generated client source-compatible, including the CLI's. A oneOf would be a breaking change for them. The server enforces the mode-specific rules and the schema descriptions state them. None of the SDKs exposes a public custom-domain facade over this generated type.

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.
@swkeever
swkeever marked this pull request as ready for review October 6, 2026 06:19
@swkeever
swkeever requested a review from a team as a code owner October 6, 2026 06:19
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.
Take the openapi-python-client 0.29.1 bump and regenerate the client from
the vendored spec, so the custom-domain TLS models pick up the new
generator output.

@marckong marckong left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

PR Review

Verdict: approve
Reviewed head: cb1ab5182b304bac044b3488c235924fa14e43d6

Overview

The PR regenerates the private Python wire models and custom-domain create operation for managed TLS, ownership-conflict records, failure states, and manifest TLS. No confirmed diff-scoped defect was found.

Verification

  • Read the complete diff and exact-head request/response models, enum checks, union decoding, operation status mapping, and tests. Traced optional-field omission with UNSET, BYOC constructor defaults, managed serialization, mode-less manifest BYOC fallback, and 409 conflict decoding while other failures retain Error.
  • Independently parsed and compared all nine affected schemas with Hosting #1021; each matches structurally.
  • Parsed all 998 Python source files with Python 3.14 ast.parse; all passed. The system Python 3.9 could not parse pre-existing pattern matching, consistent with the SDK's declared Python >=3.11 requirement; validation was repeated with a supported interpreter. No PR module was imported or executed.
  • Captured GitHub metadata shows passing Python 3.11–3.14 test jobs, quality/mutation gates, CodeQL, and security checks. I did not rerun the native suite, generator freshness, package checks, or live acceptance locally.

Findings

No findings.

Lane completeness

Completed contract/compatibility, correctness, security, resource/performance, maintainability, and test coverage passes.

Strengths and notes

Tests cover request round trips, lifecycle DNS records, unknown failure categories, omitted ownership fields, legacy routing records, manifest variants, and error/status mapping. Generated code remains private and handwritten public facades do not depend on these changed transport models.

@swkeever
swkeever merged commit cfd160b into main Oct 6, 2026
76 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants