Repository navigation
feat(control): limit how long sign-ins last, and where they come from - #657
Merged
kalaspuff merged 11 commits intoNov 28, 2026
Merged
Conversation
Instance admins set how long a browser stays signed in (from its sign-in, and unused), how long a CLI stays signed in, the longest an access token lasts and whether members make them. Every request checks its token against them, and saving one ends at once what it doesn't let last. `fctl admin sign-in policies` shows and changes them, with what a change ends before it saves.
A draft of a change shows what saving it ends at once before its Save button. Settings' access tokens last no longer than the instance lets them, members see who makes them where only admins do, and Devices says how long sign-ins last where the instance limits them.
…works Instance admins name the IP ranges people sign in and send requests from (InstanceSettings.networks): browsers, CLIs, access tokens, admin tokens and service accounts elsewhere are refused, while runners, webhooks and published links connect from anywhere. The primary instance owner signs in from anywhere in a browser or the CLI, and an admin can't save ranges their own address is outside of. Admin → Sign-in has them beside the admin's address, `fctl admin sign-in policies --networks` sets them, and the sign-in page says when a browser is outside them.
The policy section ends with what it doesn't hold (admin tokens and service accounts' secrets) instead of repeating its controls, a lone member's token reads as one, its switch stays beside its label on a phone, and Devices names browsers once.
This comment has been minimized.
This comment has been minimized.
…tworks before writing Access tokens store the end their makers chose, and every request applies the policy's longest from when they were made, so relaxing the policy gives that choice back. Open sockets count as use. Sign-up from outside the networks is refused before the account and the invitation are written, and a CLI's approved code waits for a poll from inside one rather than being used up. The longest token life is named in days, and Save waits for the preview of the draft as it is.
Contributor
Author
|
On the summary's finding about sign-up from outside the networks: fixed in b9791d8. |
This comment has been minimized.
This comment has been minimized.
An open socket's checks read its sign-in as in use without the end its last recorded use gave it, and record that use as a request does, so that its end slides and the hourly job doesn't delete it.
This comment has been minimized.
This comment has been minimized.
…last Its cookie lasts until the policy's longest from its sign-in, and 30 days at most, rather than its time unused, which only requests renew: a tab that holds a socket open keeps its cookie, and the server still ends a sign-in unused too long.
This was referenced Nov 26, 2026
kalaspuff
approved these changes
Nov 28, 2026
kalaspuff
deleted the
fctl/1677-sign-in-with-the-organization-s-own-iden
branch
November 28, 2026 09:55
This was referenced Nov 28, 2026
Merged
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
Instance admins now set session policies under Admin → Sign-in, or with
fctl admin sign-in policies: how long a browser stays signed in after its sign-in and how long it may sit unused, how long a CLI stays signed in, the longest an access token may last, whether members make access tokens, and the networks (IP ranges) people sign in and send requests from. With Google required for a domain, this is what makes closing someone's Google account take them out of fctl: their browser and CLI sign in again through Google once the policy ends their sign-ins. Google sends apps no logout signal, so signals from providers are left to #652.I tested the domain rules in Rust, and a D1 test checks that the SQL saving ends exactly what each request refuses. The CLI and the web app have tests too, and
cargo xtask checkpasses. Againstcargo xtask serve, a script signed people in and drove the CLI and API. An access token backdated 40 days was refused, saying why. Members' tokens ended when only admins could make them. A 13-hour-old browser signed out under a 12-hour limit, and so did one unused for 2 hours under a 1-hour limit. An admin couldn't save networks that left out his own address. Outside the networks, the owner's access token was refused while her password sign-in went through, and a member's sign-in was refused.This is the "Session policies" item of #618. What's left of #618 for Google, a workspace's own requirement, is in #659; once both merge, #618 can close. The parts that need other identity providers moved to new issues: #650 (Okta, Entra ID and other OpenID Connect providers, with their test sign-in and directory-managed names), #651 (SAML through a bridge), #652 (ending sign-ins on the provider's signal, Google's Cross-Account Protection included) and #653 (workspaces' own providers and verified domains on app.fctl.sh).
Refs #618
Screenshots
At c4fcb9f, against
cargo xtask serve.Admin → Sign-in → Staying signed in, as it is by default, then with a change waiting to be saved (light, dark, and dark at 390 px):
Admin → Sign-in → Networks, with ranges typed and the admin's own address beside them (light, dark):
The sign-in page from outside the networks:
Settings → Security → Devices under a policy, the new access token dialog under a 90-day limit, and a member's access tokens where only admins make them:
Worth confirming
fctl session
Warning
High risk. It changes how every browser, CLI and access token is accepted or refused on each request, saving a policy deletes the sign-ins it ends, and network limits can lock people out.
What it does. Lets instance admins set session policies: how long browsers and CLIs stay signed in, how long a browser may sit unused, the longest an access token may last, whether members make access tokens, and the networks people sign in from. Every request checks its token against the policy, saving a policy ends the sign-ins it rules out at once, and the admin page and CLI preview what a change will end. Open viewer sockets count as use, and a browser's cookie lasts as long as its sign-in may, with the server ending sign-ins unused too long.
Saving deletes sign-ins. Saving a stricter policy deletes the browsers, CLIs and member access tokens it ends, and relaxing it later doesn't bring them back.
fctl review's first look at
537a336· 53 files, +3391 −75 · Review agent settings