feat: add typed subdomain management for the KAS API#13
Merged
Conversation
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.
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.
Summary
Adds a fully typed wrapper for the KAS subdomain actions, mirroring the existing DNS implementation:
GetSubdomainsAsync,GetSubdomainAsync,AddSubdomainAsync,UpdateSubdomainAsync,DeleteSubdomainAsync,MoveSubdomainAsyncAddSubdomain,UpdateSubdomain,Subdomain(raw map + typed convenience properties), enumsRedirectStatus/WebalizerVersion/WebalizerLanguage+SubdomainEnumExtensionsToParameters/FromMaptests + wrapper-level contract tests overRecordingKasTransportCHANGELOG.md,README.mdVerification
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_subdomainreturns the full host name as theReturnInfoscalar (docs only mention "TRUE") →AddSubdomainAsyncreturnsTask<string>.subdomain_redirect_status(the request usesredirect_status).update_subdomainaccepts onlysubdomain_path/redirect_status/php_version— the webalizerstatistic_*fields are add-only.in_progress = TRUE) and rejects updates with anin_progressfault until that clears.php_version: the documented5.X|7.Xformat is outdated — live accounts run8.x, so it is treated as a free-form string.Status