Skip to content

feat: typed account-management API#10

Merged
emuuu merged 1 commit into
mainfrom
feat/account-management
Jun 8, 2026
Merged

feat: typed account-management API#10
emuuu merged 1 commit into
mainfrom
feat/account-management

Conversation

@emuuu

@emuuu emuuu commented Jun 8, 2026

Copy link
Copy Markdown
Owner

Summary

Covers the KAS account-administration actions with typed models, mirroring the existing mailbox/forward style (ToParameters()/FromMap(), DI, NUnit). Previously these were only reachable via the generic RequestAsync escape hatch.

New API

  • Subaccounts: AddAccountAsync, GetAccountsAsync, GetAccountAsync, UpdateAccountAsync, DeleteAccountAsync
  • Settings / superuser / ownership: UpdateAccountSettingsAsync, UpdateSuperuserSettingsAsync, UpdateChownAsync
  • Typed read models: GetAccountSettingsTypedAsync, GetAccountResourcesTypedAsync (existing dict-returning methods stay — non-breaking)

Models

  • Shared AccountQuota (12 max_* fields) reused by add/update
  • Enums for hostname_art, logging, statistic, kas_access_forbidden (tri-state)
  • Read models SubAccount, AccountSettings, AccountResources/AccountResource

Verification

  • All request parameters verified against the official phpdoc
  • Live-verified against a disposable test account: add_account returns the generated account_login as a scalar; the get_accounts quota fields use names that differ from the request params (max_databases, max_mail_list) — documented on SubAccount
  • 104 tests; builds clean on net8.0/net9.0/net10.0

Cover the KAS account-administration actions with typed models, mirroring
the existing mailbox/forward style (ToParameters/FromMap, DI, NUnit).

Actions:
- Subaccounts: AddAccountAsync, GetAccountsAsync, GetAccountAsync,
  UpdateAccountAsync, DeleteAccountAsync
- Settings/superuser/ownership: UpdateAccountSettingsAsync,
  UpdateSuperuserSettingsAsync, UpdateChownAsync
- Typed read models: GetAccountSettingsTypedAsync, GetAccountResourcesTypedAsync

Models:
- Shared AccountQuota (12 max_* fields) reused by add/update
- Enums for hostname_art, logging, statistic, kas_access_forbidden
- Read models SubAccount, AccountSettings, AccountResources/AccountResource

All parameters verified against the official phpdoc; response field shapes,
the add_account scalar return and the get_accounts quota field naming quirk
(max_databases/max_mail_list) verified live against a test account.

104 tests; builds clean on net8.0/net9.0/net10.0.
@emuuu emuuu merged commit 28261e5 into main Jun 8, 2026
4 checks passed
@emuuu emuuu deleted the feat/account-management branch June 8, 2026 06:43
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