Repository navigation
feat: migrate domain & dns commands to the v3 Domains API - #76
Merged
Merged
Conversation
Migrate the `domain` and `dns` command groups from the v1/v2 Domains API to the v3 Domain Lifecycle Management API, keeping v1 only where v3 has no equivalent yet. - domains-client: regenerate from a merged OAS3 spec (vendored v3 bundle + retained v1 ops, V1-prefixed) via new merge-spec.py / reworked trim-spec.py. - domain: available/suggest/get/quote/purchase/nameservers on v3; list + agreements stay on v1. Split each subcommand into its own module under src/domain/, with shared helpers in common.rs. - Strict two-step registration: `domain quote` locks a price + caches the quote (src/quote_cache.rs); `domain purchase --quote-token` accepts it, records consent, registers, and polls the async operation. - Central OAuth scope registry (src/scopes.rs) the client must mirror. - ISO-4217 minor-unit money formatting (iso_currency); contacts.toml mapped to the v3 Contact shape. - Fixes: suggest --limit panic, register response parsing (writeOnly quoteToken), QUOTE_MISMATCH from not re-sending the quoted profile. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
…ofile Address Copilot review on #76: - application commands: the 7 app-registry-mutating commands (init, update, enable, disable, archive, release, deploy) now declare [apps.app-registry:read, apps.app-registry:write] via with_scopes, so the write scope is requested on demand (OAuth step-up) rather than granted at every login. DEFAULT_OAUTH_SCOPES stays read-only — app-registry writes are a rarely-used operation for most customers. - domain quote: build_profile now returns InlineRegistrationProfile directly (it always produced Some(..)); dropped the misleading Option and corrected the doc comment. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Address Copilot re-review on #76 (all doc/test clarity, no behavior change): - quote_cache: module + Lookup::Found docs referenced a 'take' that consumes; the API is read-only get() + remove()-after-success. Reworded to match. - dns v3_records: doc said SRV/MX fields are 'clamped' to u16; they're converted via u16::try_from (out-of-range -> None), and clap already bounds them. - domains-client tests: availability/quote mock 'value's used the v1 micro-unit scale (11_990_000 / 23_980_000); v3 money is ISO-4217 minor units, so use 1199 / 2398 to match format_money and keep the contract clear. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
…o spec Address Copilot re-review round 2 on #76 (docs/tests, no behavior change): - scopes: APP_REGISTRY_WRITE docstring still said 'requested at login by default'; corrected to describe the on-demand step-up (declared per-command by the application mutations), matching the round-1 default-scope change. - domains-client tests: the register fixtures used consent actor type SHOPPER, which isn't a documented ConsentActorType; switched to DIRECT to match what production (domain purchase) sends and the spec's documented values. Not changed: adding CAA to the DNS record-type allowlist. The pre-migration allowlist was A/AAAA/CNAME/MX/NS/SOA/SRV/TXT (no CAA), so this migration preserves parity; proper CAA support also needs --flag/--tag plumbing that's out of scope here. Tracked as a follow-up. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
…e/suggest Address Copilot re-review round 3 on #76: - purchase: fail fast when a cached quote's profile can't be deserialized (was silently dropped -> confusing server-side QUOTE_MISMATCH); clear re-quote message instead. - purchase: check the cached quote's agreement types are non-empty *before* the --agree gate, so a corrupt/empty cache yields one accurate 're-quote' error rather than a 'requires agreeing…' prompt with an empty list that a rerun can't satisfy. Regression test added. - domain available / suggest: replace with_json_schema::<Availability/Suggestion> (raw API types) with explicit output_schema! matching the transformed JSON the handlers actually emit (formatted price/currency strings, headline term, listPrice), so --schema/help field metadata is accurate. - contacts: validate_country doc clarified — it checks the ISO-3166 alpha-2 *shape* (e.g. ZZ passes), not list membership; the API validates the code. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
…rchase/available/suggest) Address Copilot re-review round 4 on #76 (--schema/help accuracy, no runtime change): - available: price/currency/renewalPrice/period marked optional (emitted only when the API returns a headline price). - suggest: listPrice marked optional. - quote: DomainQuoteResult completed to mirror quote_to_json (added renewalPrice/expiresAt/irreversible/agreements/requiredAgreements/resolved) with the conditional fields marked optional. - purchase: operationId/price/currency marked optional. Deliberately not changing the runtime JSON to omit null keys: whether the CLI should emit explicit null vs. omit absent keys is a CLI-wide output-convention decision (it affects every command's json! output, not just these four), so it belongs in a dedicated change rather than this migration. Marking the schema fields optional already makes --schema/help accurate for both shapes. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
…ema optionality Address Copilot re-review round 5 on #76 (help/schema accuracy, no runtime change): - domain contacts: group help said contacts.toml is for 'domain purchase' only; the two-step flow reads it at quote time and binds it into the token, so the help now says edit-and-re-quote to change contacts. - domain group help: noted that 'nameservers set' needs domains.nameserver:update (previously only read + create scopes were mentioned). - nameservers: operationId/status marked optional in NameserversResult (they're serialized from Option values from the async operation). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Address Copilot review on 7bff139: the module doc read 'ttl required; defaults to 3600' which is contradictory — clarify that --ttl is optional on the CLI (defaults to 3600) while the v3 record payload itself requires a ttl. (Also refreshed the PR description: DNS is now fully on v3, not v1.) Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Address Copilot review on 8e4877f: - dns set: bail before mutating if any matching existing record lacks a recordId (v3 mutations are keyed by id) — silently dropping it would leave it behind and turn 'set' into an append. Mirrors the delete-side guard. - dns --ttl help: no longer says the 3600 default is add-only (set defaults too). - regenerate-spec.sh / merge-spec.py: header/docstring no longer claim v1 serves DNS record list/set/delete — v1 now retains only list + agreements. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Address Copilot review on 0d4c726: the doc said 'each --data value' but `dns delete` takes no --data — outcomes are keyed by each matched record's data value. Reworded. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
jbrooks2-godaddy
approved these changes
Jul 6, 2026
This was referenced Aug 12, 2026
This was referenced Aug 19, 2026
This was referenced Sep 10, 2026
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
Migrates the
domainanddnscommand groups from the v1/v2 Domains API to the v3 Domain Lifecycle Management API, keeping v1 only for the two operations v3 still doesn't serve (domain list,agreements).Highlights
V1) — viamerge-spec.py+trim-spec.py.build.rsstays hermetic.domain:available/suggest/get/quote/purchase/nameservers seton v3. Each subcommand lives in its own module undersrc/domain/, with shared helpers incommon.rs.domain quotelocks a price and caches the quote locally (src/quote_cache.rs);domain purchase --quote-token <tok> --agree --confirmaccepts that exact quote (no re-quote → charges the reviewed price), records consent, registers, and polls the async operation. A single idempotency key is minted at quote time and reused across purchase retries.dnsfully on v3:list(paginated GET with type/name filters),add(create),set, anddeleteall use/v3/domains/zones/{zone}/dns-records. v3 keys replace/delete on a serverrecordId, sosetreconciles in place (reuse ids, delete surplus, create shortfall) anddeletelists-then-deletes each — both report per record (non-atomic). This also unlocks CAA (new--flag/--tag) and ALIAS across the DNS commands. The retained v1 DNS record ops were dropped.GoDaddyAuthProvideris the sole provider.src/scopes.rs), drawn from by every command. Read scopes (apps.app-registry:read,domains.domain:read) are granted at login; write scopes are declared per-command and requested on demand (OAuth step-up) — e.g. the app-registry mutations declareapps.app-registry:writethemselves rather than defaulting it into every login.iso_currency);contacts.tomlmapped to the v3Contactshape.next_actionsnow render as a "Next steps" footer in human output.Notes
Suggestionschema change (listPrice/renewalPrice→prices[]);domain suggestwas adapted to surface the headline term price (unchanged output field).Testing
cargo fmt --check,cargo clippy --workspace --all-targets -- -D warnings(clean),cargo test --workspace(all pass).domain quote→purchaseregisters a domain (status: ACTIVE). Live DNS-v3 checks (dns add --type CAA …, list/set/delete) are pending an authenticated test-env run.🤖 Generated with Claude Code