Resolve an address from an id - #45
Merged
Merged
Conversation
…ing a name A product stores UOA's ids and no slug of its own, because the slug belongs to UOA. So it could route a tenant hostname it was handed but could not build one — half a feature. Concretely: a team picker cannot move the address bar, and a product cannot tell an operator what address an existing organisation is at. GET /domain/organisations/:id/address -> org_slug (+ name, icon) GET /domain/teams/:id/address -> team_slug AND org_slug The team route returns both labels in one read because an address is `<team.slug>.<organisation.slug>.<base domain>` and the caller holds neither; a picker that moves the address bar would otherwise make a request per row. Both are scoped to the calling client domain, like every other /domain/* read. For teams that scoping is load-bearing rather than decorative: team ids are globally unique, so a bare id would be a cross-tenant read — the query is confined by an organisation-domain predicate, and a test pins that. Suite: 1882 passed. The two failures in email-registration-link.route.test.ts are pre-existing and unrelated — clean main fails the same file harder (four cases to this branch's two). Co-Authored-By: Claude Opus 5 <[email protected]>
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 the inverse of resolving a hostname:
A product stores UOA's ids and no slug of its own — the slug belongs to UOA. So until now it could route a tenant hostname it was handed, but could not build one. That is half a feature, and it showed up in two concrete ways: a team picker cannot move the address bar, and there is no way to ask what address an existing organisation is at.
The team route returns both labels in one read, because an address is
<team.slug>.<organisation.slug>.<base domain>and the caller holds neither. A picker that moves the address bar would otherwise make one request per row.Scoping is load-bearing here
Both reads are confined to the calling client domain like every other
/domain/*read. For teams that is not decoration: team ids are globally unique, so a bare id would be a cross-tenant read. The query is confined by an organisation-domain predicate, and a test pins exactly that shape so it can't be refactored away.Testing
email-registration-link.route.test.tsare pre-existing and unrelated — cleanmainfails that same file harder (four cases to this branch's two). Worth someone's attention separately: UOA's main is red again.Not verified
No consumer yet — the Nessie side that uses this follows, and this must deploy first.
🤖 Generated with Claude Code