Repository navigation
Keep a person's computers apart per organization: token label and the limit event's words - #1896
Open
davidmckayv wants to merge 2 commits into
Open
davidmckayv wants to merge 2 commits into
davidmckayv wants to merge 2 commits into
Conversation
A person in two organizations gets a computer in each, and the two must not open each other. The token derivation now takes an optional organization: outside default the label is org/<encoded org>/<kind>:<id>; in default, or with none given, it is exactly the label it was, so a computer already running in default keeps its token.
davidmckayv
requested review from
MikeRyanDev,
dustywusty,
guidovizoso,
mxmzb,
samjulien and
tylerslaton
as code owners
November 19, 2026 21:20
Where a deployment caps how many computers an organization, or one person in it, may have, a refused new computer is written to that organization's trail. Activity and Audit show it in words like every other event.
This branch has not been 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.
A person can belong to several organizations, and their cloud computer in one must not open their computer in another. Each computer's own token is an HMAC of the deployment's
COMPUTER_TOKENover whose computer it is (shared/computer-token.ts); until now that was onlyperson:<id>orbot:<id>, so one person's computers in two organizations would derive the same token.What changes:
ComputerIdentitytakes an optionalorganizationId.defaultorganization the label isorg/<encodeURIComponent(org)>/<kind>:<id>. The organization id is encoded, so a/or:in it can't make one label read as another.default, and when no organization is given, the label is byte for byte what it was, so a computer already running indefault(every OpenBot Desktop install) keeps its token and is not replaced as stale.Also
computer.limit_reachedgets its words for Activity and Audit ("Start a new computer"): where a deployment caps how many computers an organization, or one person in it, may have, the refused new computer is written to that organization's trail.Tests:
shared/tests/computer-token.test.tspins thedefaulttokens to values taken from the derivation before this change, checks that one person in two organizations gets two different tokens, and that an organization id with a slash or colon can't collide with another computer's label.