feat(org): fold custom domains into iblai-api-org - #23
Open
mamigot wants to merge 1 commit into
Open
Conversation
Adds the /api/custom-domains/ surface to the org skill: list an org's vanity hostnames, attach one, repoint it at a different SPA (by id or by hostname), soft-delete/restore, and hard delete. It belongs here rather than in its own skill — six endpoints configuring one org-wide concern, alongside the other org-wide settings — so the skill now carries two surfaces and splits Reads/Writes with ### subheadings per the multi-resource convention in CLAUDE.md. Endpoints, required fields, permissions, enum values, and response shapes are read off the iblai-dm-pro URLconf, view, and model (dl_iblai_services_app custom_domain), per "source of truth = the repo URLconf". The published OpenAPI schema documents these paths with no request or response bodies at all, so it could not have produced the field names. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
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
Adds the
/api/custom-domains/surface to/iblai-api-org: list an org's vanity hostnames, attach one, repoint it at a different SPA (by id or by hostname), soft-delete/restore, and hard delete. Six endpoints, previously uncovered anywhere in the repo.Why fold in rather than add a skill
Six endpoints configuring one org-wide concern. A standalone
/iblai-api-custom-domainwould be a very thin skill sitting next to/iblai-api-org, and the two would be reached for in the same breath ("set this org up"). So the skill now carries two surfaces — org settings and custom domains — and splitsReads/Writeswith###subheadings per the multi-resource convention inCLAUDE.md. Reads/Writes stays the top-level split.Sourcing
Per
CLAUDE.md("source of truth = the repo URLconf, not the docs"), everything is read offiblai-dm-pro—dl_iblai_services_app/{urls.py, views/custom_domain.py, models/custom_domain.py}.This mattered more here than usual: the published OpenAPI schema documents all six paths with
"No response body"and no request schema whatsoever. It could not have produced a single field name. Everything below came from the view and model:platform_key+custom_domainrequired on create;spa/is_deletedoptionalspaenum —auth·skillsai·mentorai·analyticsai, defaultauth(wire values, kept verbatim per the terminology rule)GET /api/custom-domains/is public — no authentication or permission checks at all. Every write requires an admin token. Worth knowing before wiring it up.platform_keyordomain; neither is a400?include_deletedand the?status=truthy/falsy vocabulary filtering onregistered_with_dns_pro{}, not an empty list — an easy client crashdeleted-status/, reversible) vs hard delete (delete/, permanent) — genuinely different operations behind similar-looking URLsregistered_with_dns_prois non-editable, set by a backend signal;instructionscarries the DNS setup stepsNotable behavior worth a reviewer's eye
The public list endpoint is the one I'd want confirmed as intentional.
@authentication_classes([])+@permission_classes([])onget_custom_domainsmeans anyone can enumerate an org's domains, and the response embedsplatform_metadata. I documented it as-is because that's what the code does and callers need to know they can hit it pre-login — but if it's meant to be scoped, the skill should be corrected alongside the fix rather than describing the current behavior.Also:
{domain_id}/status/and{domain_id}/deleted-status/useCustomDomainOwnerPermissionwhileby-name/{domain_name}/status/andcreate/useIsPlatformAdmin. I've described both as requiring admin, which is right for the latter two; if owner-permission is meaningfully broader than admin for the id-addressed routes, that nuance is worth adding.Also
/iblai-api-orgrow now mentions custom domains.🤖 Generated with Claude Code