Skip to content

feat: add typed subdomain management for the KAS API#13

Merged
emuuu merged 1 commit into
mainfrom
feat/subdomains
Jun 11, 2026
Merged

feat: add typed subdomain management for the KAS API#13
emuuu merged 1 commit into
mainfrom
feat/subdomains

Conversation

@emuuu

@emuuu emuuu commented Jun 11, 2026

Copy link
Copy Markdown
Owner

Summary

Adds a fully typed wrapper for the KAS subdomain actions, mirroring the existing DNS implementation:

  • Actions: GetSubdomainsAsync, GetSubdomainAsync, AddSubdomainAsync, UpdateSubdomainAsync, DeleteSubdomainAsync, MoveSubdomainAsync
  • Models: AddSubdomain, UpdateSubdomain, Subdomain (raw map + typed convenience properties), enums RedirectStatus / WebalizerVersion / WebalizerLanguage + SubdomainEnumExtensions
  • Tests: model ToParameters/FromMap tests + wrapper-level contract tests over RecordingKasTransport
  • Docs: CHANGELOG.md, README.md

Verification

All parameters verified against the official KAS phpdoc (verbatim parameter blocks, not summaries). Response field shapes, the add-return scalar and the redirect/provisioning behaviour verified live against a real account.

Notable, non-obvious findings baked into the code & docs:

  • add_subdomain returns the full host name as the ReturnInfo scalar (docs only mention "TRUE") → AddSubdomainAsync returns Task<string>.
  • The redirect status is returned as subdomain_redirect_status (the request uses redirect_status).
  • update_subdomain accepts only subdomain_path / redirect_status / php_version — the webalizer statistic_* fields are add-only.
  • KAS provisions a new subdomain asynchronously (in_progress = TRUE) and rejects updates with an in_progress fault until that clears.
  • php_version: the documented 5.X|7.X format is outdated — live accounts run 8.x, so it is treated as a free-form string.

Status

  • Build net8.0/9.0/10.0: 0 warnings, 0 errors
  • 279 tests green on net10.0
  • No change to the existing public API

Wrap the KAS subdomain actions (get_subdomains, add_subdomain,
update_subdomain, delete_subdomain, move_subdomain) with the same typed
surface as the DNS actions: AddSubdomain/UpdateSubdomain input models, the
Subdomain read model, and the RedirectStatus/WebalizerVersion/WebalizerLanguage
enums.

Parameters verified against the official KAS phpdoc; response field shapes and
the add return scalar verified live against a real account. Notable findings:
add_subdomain returns the created host name as the ReturnInfo scalar (despite
the docs only mentioning TRUE); the response field is subdomain_redirect_status
(the request uses redirect_status); and KAS provisions a new subdomain
asynchronously (in_progress = TRUE), rejecting updates until that clears.
@emuuu emuuu merged commit 9aaf6ef into main Jun 11, 2026
4 checks passed
@emuuu emuuu deleted the feat/subdomains branch June 11, 2026 12:23
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.

1 participant