Skip to content

feat(auth): let strangers join on a proved domain, not a claimed one - #351

Merged
artempartos merged 3 commits into
developfrom
artempartos/domain-verification
Sep 29, 2026
Merged

artempartos merged 3 commits into
developfrom
artempartos/domain-verification

Conversation

@artempartos

Copy link
Copy Markdown
Contributor

Why

Signing a workspace up proves a mailbox: that somebody receives mail at an
address. Domain auto-join then grants far more than that — every person who later
signs in from the domain joins that workspace, with their name and address
visible to whoever registered first. One proved mailbox was buying a claim on the
whole domain.

What

Auto-join now waits for a DNS record only the domain's owner can publish:

_aixle-challenge.<domain>  TXT  aixle-domain-verification=<token>

Until it is there, nothing else changes: people join by invitation, which is
the ordinary path and is untouched by this. The Access tab of company settings
carries the record to publish, says plainly what is withheld until then, and has
a "Check now" button.

A record of its own rather than a value at the root, because the root TXT set is
shared with SPF, DMARC and every other vendor's proof, and has a length budget
those already strain.

Dns::TxtLookup

The one place this application resolves a name. An adapter, so the thing that
decides whether a customer owns a domain can be driven in a test without a
network, and so a nameserver that hangs cannot hang the request of the person
waiting on the button. Anything that is not an answer — no record, a refusal, no
network — reads as not proved, never as broken.

Existing companies

Marked proved by the migration. They predate the rule, and leaving them unproved
would switch auto-join off for all of them, ours included. The test factory
defaults the same way, for the same reason.

What this does not fix

Squatting. Whoever claimed acme.com still holds the string, and the real
Acme still cannot sign up. Ending that means letting several workspaces sit on an
unproved domain — which the sign-in screen cannot do today, because step one
resolves a workspace by domain and duplicates make that ambiguous. Its own
change, deliberately not smuggled in here.

Checks

rubocop (2008 files), tsc, eslint, steiger clean. Backend: the policy,
auth and company suites 629/629, plus 39/39 across the new and changed files.
Frontend: the settings pages 17/17. Run with DEPLOYMENT_MODE=self_hosted to
match CI; the full suite is left to CI, since a worktree run shares a Postgres
with the main checkout.

db/schema.rb was regenerated from a test database rebuilt for this branch
alone — the development one still carries another branch's migration, and dumping
from it would have committed columns this branch does not add.

🤖 Generated with Claude Code

Signing a workspace up proves a mailbox: that somebody receives mail at an
address. Domain auto-join then grants far more than that — everyone who later
signs in from the domain joins that workspace — on the strength of the same one
mailbox. Whoever registered first held the door for everybody else at their
company.

A TXT record at _aixle-challenge.<domain> is the part only the domain's owner can
publish, and auto-join now waits for it. Until then nothing about the workspace
changes: people join by invitation, which is the ordinary path and is untouched.

A record of its own rather than a value at the root, because the root TXT set is
shared with SPF, DMARC and every other vendor's proof and has a length budget
those already strain.

Dns::TxtLookup is the one place this application resolves a name — an adapter so
a test can drive the decision without a network, and so a nameserver that hangs
cannot hang the request of the person waiting on "check now". Anything that is
not an answer (no record, a refusal, no network) reads as "not proved", never as
"broken".

Every company that already exists is marked proved by the migration: they
predate the rule, and leaving them unproved would switch auto-join off for all of
them, ours included.

This does not end domain squatting. Whoever claimed acme.com still holds the
string, and the real Acme still cannot sign up. Ending that means letting several
workspaces sit on an unproved domain, which the sign-in screen cannot do today —
step one resolves a workspace BY domain, and duplicates make it ambiguous. That
is its own change.

Signed-off-by: Artem Petrov <[email protected]>
Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
@artempartos
artempartos force-pushed the artempartos/domain-verification branch from ed0603b to 593733d Compare September 29, 2026 02:37
artempartos and others added 2 commits September 29, 2026 10:39
The signup, the domain proof, the queue price and the free allowance shipped
across four pull requests, and the only place the whole shape existed was in
those descriptions. Someone answering "why can't I sign up", "why did it stop" or
"when do you ask for a card" had nowhere to look.

One page for the customer's side: the path in and what the form refuses, what a
proved domain unlocks (auto-join) against what works without it (invitations),
queues and the list price, the allowance and the fact that the workspace sets the
rate it burns at, what stopping does and does not do, and the two ledgers.

One for the operator's: the meter, product, metered price and webhook that have
to exist in Stripe before any of the billing half can ship, which key to issue,
and why a dashboard login is never the credential for it. Marked clearly as
setup-before-integration, because the integration is not built.

Signed-off-by: Artem Petrov <[email protected]>
Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
…hey are in

The pricing and the free allowance existed only in our own docs directory, which
customers never see, and the portal said nothing about how people get into a
workspace beyond the members list.

Two pages rather than one, because the answer differs by product and a reader has
no way of telling which one they are in. Hosted Flow has a list price, a hundred
free queue-hours spent at whatever rate the workspace runs, and a stop at the end
of them. A Marketplace installation meters to the customer's own AWS bill in whole
queue-minutes, has no allowance and no card, and cannot leave a company
unbounded because "unlimited" has no encoding in a metering record. Each page
opens by saying which product it is about and links to the other.

Team & access gains the part it never had: that people get in by invitation, that
domain auto-join is the alternative, and that it waits on a DNS record — with the
record to publish, because the screen that shows it is the one an admin reaches
only after going looking.

Signed-off-by: Artem Petrov <[email protected]>
Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
@artempartos
artempartos merged commit e00b30d into develop Sep 29, 2026
7 checks passed
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