Skip to content

feat(control): let a workspace require Google sign-in of its members - #659

Merged
kalaspuff merged 9 commits into
mainfrom
fctl/1677-workspace-sign-in
Nov 29, 2026
Merged

kalaspuff merged 9 commits into
mainfrom
fctl/1677-workspace-sign-in

Conversation

@fctl-sh

@fctl-sh fctl-sh Bot commented Nov 26, 2026 •

Copy link
Copy Markdown
Contributor

Summary

A workspace's admins can now require Google of its members at their domains: in the workspace's Settings → Access, or with fctl workspaces set --require-google acme.com,acme.dev. Members who are in the workspace as an address at those domains open it, its projects and sessions only once they've signed in with Google as that address. A password sign-in, or a personal Google account's, finds the workspace closed, the way its two-factor requirement closes it, and the page says how to open it. Members in it as other addresses (contractors) sign in as before, and their other workspaces stay open. This is the "workspace's own requirement" item of #618, for Google, and it's what an organization on app.fctl.sh, with no instance admin of its own, uses.

  • Where it shows. The workspace's header names it; a closed workspace's page, the home page and the sidebar say why and link Google's sign-in; fctl workspaces show says so too. An API request it refuses names the domains to sign in as.
  • How it's checked. Each query that reads a workspace with its member gets the rule only where it covers that member, by the address the workspace knows them by. The account row a request carries now keeps how that request's sign-in was made, so the 25 places that already close a workspace for two-factor close it for this too. Requests without a person's sign-in (service accounts, autopilots, notifications) aren't held to it.
  • Open sockets too: a covered member's open tabs and session views close with the rest, each by the sign-in it was opened with.
  • No admin closes it to themselves: saving answers 409 until they've signed in with Google as their address there. Requiring less takes confirming it's you, where the instance asks for that.
  • Docs: organizations.md (a new section), security.md, api.md, cli.md, llms.txt, architecture.md, and ADR 0103, which amends ADR 0099's "a workspace of its own doesn't require a provider".

I tested the rule in Rust. A D1 test checks that a covered member's project closes to a password or personal-Google sign-in and opens to Google as their address, while a contractor isn't held. The web app has tests, and cargo xtask check passes. Against cargo xtask serve, with placeholder Google settings and Google sign-ins written to D1, a script drove the API and the CLI. Ada's password sign-in couldn't close Acme to herself (409, with the way out), while her Google sign-in as ada@acme.com could require it. Bob's password and personal-Google sign-ins then found Acme and its project closed (404, and "Acme requires its members to sign in with Google…"), and his Google sign-in as bob@acme.com opened them. Cy, a contractor in it as cy@contractor.io, wasn't held, and stopping the requirement opened Acme again.

With #657 (session policies), this completes #618 for Google: once both merge, #618 can close. The parts that need other providers are #650, #651, #652 and #653.

Refs #618

Screenshots

At 556bc9f, against cargo xtask serve.

A workspace's Settings → Access, requiring Google at acme.com: whom it covers before it saves (light, dark), and the refusal when it would close the workspace to the admin, with the way out:

Requiring Google, light

Requiring Google, dark

Refused: it would close the workspace to the admin

Once it's required:

Required at acme.com and acme.dev

A covered member signed in with a password, in the browser and on a phone (dark):

The workspace closed to a password sign-in

The same on a phone, dark

Worth confirming

  • Decision: it covers members by the address the workspace knows them by, not by every address on their account. People can't switch that address in place, and disconnecting it takes them out of the workspace, so nobody slips out of the requirement.
  • Decision: no proof that the domains are the workspace's. The requirement only closes its own workspace, and its admins can already remove anyone. Sending people at a domain to a workspace's own provider would need proof, and waits for Workspaces on app.fctl.sh bring their own identity provider, with verified domains #653.
  • Decision: service accounts and autopilots acting for a covered member aren't held to it. The workspace's admins chose them, and holding them to it would stop bots and autopilots that no person signs in for.
  • Decision: the workspace's primary admin can stop or change the requirement even while it closes the workspace to them, and nothing else, so that a workspace where nobody can meet it (Google sign-in no longer set up, their Google accounts closed) doesn't stay closed for good. Someone holding only their password could lift it, unless the instance asks people to confirm sensitive actions.
  • Decision: the primary instance owner isn't exempt here, unlike the instance's rules. Their exemption is the instance's way in while Google is down, and a workspace's requirement closes nothing but that workspace.

fctl session


Warning

High risk. It adds a per-workspace sign-in requirement that decides who may open a workspace, so authentication and permission checks change, including for open sockets, and a new D1 migration adds a column.

What it does. Lets a workspace require its members to sign in with Google, optionally limited to given email domains and optionally allowing passkeys. Members whose current sign-in doesn't meet the rule see the workspace as closed, over HTTP and on live sockets, while the primary admin can always stop or change the rule. The pull request adds the API, CLI flag --require-google, a settings panel in the web app, a migration, and docs including ADR 0103.

Migration. 0077_workspace_sign_in.sql adds a column to workspaces, so it has to be applied on deploy.

fctl review's first look at 5ecab6b · 34 files, +1333 −100 · Review agent settings

fctl-sh Bot added 6 commits November 26, 2026 00:14
A workspace's admins require its provider of the members in it as an
address at some domains (workspaces.sign_in): such a member's sign-in
made another way finds it, its projects and sessions closed, until they
sign in with Google as that address. Members in it as other addresses
sign in as before, and requests without a person's sign-in (service
accounts, notifications) aren't held to it. An admin can't save one
that would close it to them, and requiring less takes confirming it's
them.
@fctl-sh
fctl-sh Bot requested a review from kalaspuff as a code owner November 26, 2026 00:54
@fctl-sh fctl-sh Bot changed the title feat(control): let a workspace require its members to sign in with Google feat(control): let a workspace require Google sign-in of its members Nov 26, 2026
@fctl-review

This comment has been minimized.

Comment thread crates/fctl/src/cmd/workspaces.rs Resolved
… and let its primary admin lift it

Sockets' rechecks and the feeds a workspace change refreshes read each
socket's own sign-in, so a covered member's open tab closes with the
rest. The workspace's primary admin can stop or change its requirement
while it closes the workspace to them, where nobody can meet it. Stop
requiring it shows whether Google is set up or not, the closed page
links Google only where it is, the copy no longer says a closed Google
account ends the sign-ins a person has, and --require-google clears it
only on off or none.
@fctl-sh

fctl-sh Bot commented Nov 26, 2026

Copy link
Copy Markdown
Contributor Author

On the summary's finding about live sockets: fixed in 1f4876a. by_token_id now gives its holder the token's own sign-in (request_sign_in), so recheck_feed and recheck_viewer hold a covered member's open sockets to the requirement. workspaces_changed reads each feed socket's own token rather than one account row for all of a person's sockets, so one browser signed in with Google keeps the workspace while another, signed in with a password, loses it, and it closes a socket whose token no longer signs anyone in. The D1 test now checks the holder of a password-made token and of a Google-made one.

fctl-sh Bot added 2 commits November 28, 2026 10:01
…ign-in

# Conflicts:
#	crates/fctl-domain/src/verify.rs
#	docs/adr/README.md
#	docs/api.md
#	docs/architecture.md
#	docs/llms.txt
#	docs/organizations.md
#	docs/security.md
@kalaspuff
kalaspuff merged commit 81f4253 into main Nov 29, 2026
14 of 15 checks passed
@kalaspuff
kalaspuff deleted the fctl/1677-workspace-sign-in branch November 29, 2026 08:57
fctl-sh Bot added a commit that referenced this pull request Nov 29, 2026
Main's workspace sign-in requirement (#659) took migration 0077 and
ADR 0103, so this branch's Slack migration becomes 0078 (it never
shipped) and its ADR 0104, with the links that name it. The workspace
page keeps both sides' imports.
fctl-sh Bot added a commit that referenced this pull request Nov 29, 2026
…ed their account

A request from Slack carried no fctl sign-in, so a workspace's own
Google requirement (#659) and the instance's sign-in rules held none of
it: a member who signs in with a password could link Slack and start
and steer the workspace's sessions from it. A link now keeps how the
browser that made it signed in (slack_accounts.auth_method and
auth_domain, as tokens keep it), and its requests carry it:

- a workspace's requirement closes its projects to a link made another
  way, and fctl asks the person in Slack to sign in with Google and link
  again, keeping their request or reply until they do;
- the instance's rules end a link they don't let in, at its next request
  and as they're saved, as they end such tokens;
- signing out everywhere unlinks it, so that nothing made while someone
  else held the account outlasts it;
- an address match is no sign-in, and meets no rule.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant