Skip to content

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
mainfrom
feat/one-org-computer-token
Open

davidmckayv wants to merge 2 commits into
mainfrom
feat/one-org-computer-token

Conversation

@davidmckayv

@davidmckayv davidmckayv commented Nov 19, 2026 •

Copy link
Copy Markdown
Contributor

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_TOKEN over whose computer it is (shared/computer-token.ts); until now that was only person:<id> or bot:<id>, so one person's computers in two organizations would derive the same token.

What changes:

  • ComputerIdentity takes an optional organizationId.
  • Outside the default organization the label is org/<encodeURIComponent(org)>/<kind>:<id>. The organization id is encoded, so a / or : in it can't make one label read as another.
  • In default, and when no organization is given, the label is byte for byte what it was, so a computer already running in default (every OpenBot Desktop install) keeps its token and is not replaced as stale.

Also computer.limit_reached gets 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.ts pins the default tokens 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.

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.
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.
@davidmckayv davidmckayv changed the title Name the organization in a computer's own token outside default Keep a person's computers apart per organization: token label and the limit event's words Nov 19, 2026

This branch has not been deployed

No deployments
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