Repository navigation
feat(j5): a server joins J5 Connect by its owner signing in - #1323
Merged
Merged
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Jacksondr5
force-pushed
the
j5code/j5-connect-self-registration
branch
from
December 1, 2026 02:19
130dcac to
4443e90
Compare
Jacksondr5
force-pushed
the
j5code/j5-connect-self-registration
branch
from
December 1, 2026 02:20
4443e90 to
90cefb4
Compare
Merged
7 of 8 tasks
Jacksondr5
force-pushed
the
j5code/j5-connect-self-registration
branch
from
December 1, 2026 02:27
d5c6780 to
bb58f8b
Compare
6 of 8 tasks
8 tasks done
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 51 minutes. View limit details
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. |
The image gains a registration endpoint: a J5 server starts a registration server to server, its owner signs in through the image's own registrar client, and when J5_CONNECT_REGISTER's policy (allow-list, everyone, or group:<name>) lets the account add servers, the server's client is created through Dex's API and claimed by the server with a token only it holds, together with the account it approved. `j5-connect allow add|remove|list` manages the allow-list live. Co-Authored-By: Claude Opus 5.5 <[email protected]>
`j5.identity.startJoin` registers the server at a J5 Connect's registration endpoint, with every address of it, to come back to the address the owner's browser is at; over SSH or a relay there is none, and it is refused. Back from the J5 Connect, the server claims its client, joins, and signs the owner in with it, so the account the J5 Connect approved becomes their sign-in. A refusal is kept for Settings as `joinRefused`. Leaving, or joining in place of another client, keeps the asking device, tied to no sign-in, and `thisDeviceSignedIn` says whether this device came from sign-in. A leave drops a join still on its way back. `j5 auth connect join <issuer>` joins by signing in; with a client id and secret it is the operator's by-hand path. Co-Authored-By: Claude Opus 5.5 <[email protected]>
… rule The runbook gains self-registration: J5_CONNECT_REGISTER's allow-list, everyone and group rules, and the allow-list commands, which the public J5 Connect section now points to. Registering by hand stays, for recovery. The migration runbook joins by signing in. Co-Authored-By: Claude Opus 5.5 <[email protected]>
A redirect URI is checked as the raw string it is stored and redirected to, so CR, LF and other characters a URL parser drops can't reach Dex or a redirect's headers. The server's state must be URL-safe, a callback with any other state settles nothing, and the endpoint refuses a negative or over-deep body, times out a stalled client, and holds more registrations. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
The join on its way back is taken only after J5 Connect hands over its registration, so a leave meanwhile leaves it nothing to finish; it finishes only while its Owner still is one (AC1). A sign-in answered after a switch to another client at the same J5 Connect records nothing (AC7). When the account J5 Connect approved is already another person's, the joining Owner is told whose, as adding a sign-in would tell them (AC20). Co-Authored-By: Claude Opus 5.5 <[email protected]>
…at once The pending join is taken, its Owner's level read, the old client's accounts forgotten and the new client installed in one transaction, after every check against J5 Connect. A leave, a lowered Owner, or a sign-in through the old client that lands at any point before it is refused or forgotten (AC1, AC7). The client's secret is stored only once the join holds. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…was added A switch ends the old client's devices before the new secret is stored, so a secret that can't be written strands none of them. A join whose second sign-in is another account than the one J5 Connect approved answers as a sign-in not added (AC3). A copied dev database drops joins on their way back and the last refusal, with their claim token and account. Co-Authored-By: Claude Opus 5.5 <[email protected]>
The client row and the secret store change apart, so two joins, or a join and a leave, interleaving could leave a secret for another client, or one for a server that left. Each now finishes before the next starts. Co-Authored-By: Claude Opus 5.5 <[email protected]>
The switch's last step, ending the old devices and storing the new secret, runs to the end once begun, and stores the secret even when some devices don't end, so the client row and the secret always name the same client. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Jacksondr5
force-pushed
the
j5code/j5-connect-self-registration
branch
from
December 1, 2026 02:59
980e525 to
5e73c27
Compare
Co-Authored-By: Claude Opus 5.5 <[email protected]>
7 of 8 tasks
2 of 3 tasks
This branch was successfully deployed
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.
Problem
To join a J5 Connect, a J5 server needed its operator to register an OIDC client by hand and pass the server's Owner an id and secret. J5 Connect's "Joining" criteria (AC2, AC3, AC5–AC7, AC9) say instead that the Owner joins by signing in, and the J5 Connect decides under its own policy whether that account may add servers.
Closes #1272. The contracts and server for the admin UI (#1271) landed first in #1316, which this builds on.
What changed
J5 Connect image (
infra/j5-connect)register.pyis a stdlib service on loopback. Caddy routes/j5/registrations*to it; everything else still goes to Dex.j5-connect-registrar.j5-connect clientsuses (feat(infra): manage J5 Connect clients without restarting #1264).{clientId, clientSecret, subject}or{error: "not_allowed", account}.J5_CONNECT_REGISTER:allow-list: the default. Verified emails only, managed live withj5-connect allow add|remove|list.everyone: for a company J5 Connect whose identity provider admits only employees.group:<name>: oidc only, matched against the groups claim.http(s)://host[:port]/api/j5/identity/callback, checked as the raw string, so CR/LF can't reach Dex or a redirect's headers. The endpoint also caps body size, nesting, registrations in progress and stalled clients.j5-connect clients addis unchanged, as an operator's runbook tool.Server
j5.identity.startJoin({ issuer, returnAddress, addresses })replaces the client-id-and-secretjoinRPC andreturnUrls. It registers the server with every address it has, to come back to the address the Owner's browser is on.JoinNeedsAddressError(AC6).J5ConnectUnreachableError.OidcError(AC5).purpose = 'join'), and binds only the account the J5 Connect approved (AC3, admin-ux item 2).joinRefusedfor Settings to put into words (item 1). The browser lands on/pair?j5-join=joined|refused|failed.leave, and joining in place of another client, keep the asking device as a plain owner device tied to no sign-in (AC7, item 10).leave(null)keeps none, for J5 Connect: managed policy key limits.j5Connect #1275's forced leave. A leave also drops a join still in progress.j5.identity.getgainsthisDeviceSignedIn(item 9).j5 auth connect join <issuer>joins by signing in: it prints an address to open on the server's machine, and binds the first owner. With--client-idand--client-secret-file, it's the runbook's by-hand path.join_subjecton the sign-in row. A copied dev database drops the first two.Runbooks (their own commits, for Jackson's OK)
j5-connect.mdgains self-registration: the policy, the allow-list commands, and Caddy's second route.j5-connect-migration.mdnow joins by signing in.One thing to know. Joining goes through the identity provider twice: once to approve the account, and once to give the server a refresh token for its new client. With GitHub, or an IdP that has a session, the second trip is usually an instant redirect. With Google it may ask for consent again (
promptType: consent); I haven't tried it.Live testing
test/offboarding.py, extended).j5-connect allow add, the same account registers, the client is listed, and a sign-in through it exchanges a code for tokens.Identity.test.tsagainst the in-process fake J5 Connect: joining, a refusal, unreachable, non-HTTPS, no return address, the approved-account check, a taken account, keeping the asker, and a leave or lowered Owner landing mid-join. The tests also cover a sign-in through the old client after a switch, a leave waiting for a switch, and an interrupted switch.Checklist
FORK.md(case text and file-table row) in this PR — none toucheddocs/j5/product/upstream.md— noneAGENTS.md)docs/j5/product/and user docs rewritten where this changes them — runbooks only; the definition already describes thisReviews
Built by Claude Opus 5.5 in Claude Code, running in J5 Code.
🤖 Generated with Claude Code