Repository navigation
feat(cli): configure single-tenant servers from the register response - #129
Merged
Merged
Conversation
Registration responses now carry mode/role (atomic-storage SERVER_TENANT_SLUG
servers). When mode == "single":
- ServerConfig gains single_tenant (serde-default false, so existing configs
and pre-mode servers keep multi-tenant semantics with no migration).
- org_base_url() returns the bare host unchanged — single-tenant servers are
already tenant-scoped server-side, so the {org}. prefix would produce
bogus hosts (org.org.atomic.storage).
- identity register writes a correct profile from the response: typed URL
kept verbatim, default_org from the response slug, identity bound,
single_tenant set — registration against a single-tenant server now just
works, including the default-identity path (legacy [server] block).
Tests: org_base_url single-tenant (no prefix, trailing slash), legacy TOML
deserialization defaults to multi, register tenancy parsing for
single/multi/missing-field responses. Full atomic-cli + atomic-config
suites, clippy -D warnings, and fmt are green.
geekgonecrazy
force-pushed
the
feat/single-tenant-cli
branch
from
July 28, 2026 19:45
d8f9963 to
233c95d
Compare
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
Companion to atomicdotdev/atomic-storage#78 (single-tenant mode). Registration
responses now carry
mode/role; whenmode == "single"the CLI configuresitself correctly from the response alone — no manual URL/org fixups.
ServerConfig.single_tenant(serde-defaultfalse, skipped when false).Existing configs and pre-
modeservers keep multi-tenant semantics — nomigration, no config churn.
org_base_url()returns the bare host unchanged for single-tenantservers. They're already tenant-scoped server-side, so the
{org}.prefixwould produce bogus hosts like
org.org.example.com.identity registerwrites a correct profile straight from the response:typed URL kept verbatim,
default_orgfrom the response slug, identitybound,
single_tenantset — including the default-identity (legacy[server]) path.Usage
Register with a single-tenant server
The server responds
mode: "single", and the CLI writes a ready-to-useprofile (URLs are used as-is, no
{org}.prefix):Already on multi-tenant
atomic.storage, adding a single-tenant serverExisting multi-tenant setup is left untouched. Registering a single-tenant
server adds a profile but does not silently switch your active server:
atomic identity register https://storage.customer.com --identity alice-customer --server-name customer # Profile: 'customer' added (activate with: atomic server set customer)Switch between them:
Backwards compatibility
Multi-tenant is the default on both axes, so nothing changes for existing users:
single_tenantdeserializes tofalsefor configs writtenbefore the field existed; it's omitted from output when false. No migration.
modefield (older servers) is treated as multi-tenant,preserving org-prefixed URLs.
Test plan
atomic-config:org_base_urlsingle-tenant (no prefix, trailing slashstripped); legacy TOML deserialization defaults to multi.
atomic-cli: tenancy parsing for single / multi / missing-field responses.-D warnings, fmt.Verified end-to-end against a live single-tenant deployment on GKE (push/pull as
owner; member joins with zero implicit access).