Repository navigation
Conversation
…gs-record key check goes by permissions when the backend reports them (only ingest:write may go in) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… typetorch groups and typetorch members (backend plans/38); an older backend is named as such keys create|list|revoke stay and also take groups; --role is an alias of one group (game = fleet). A 403 that says why shows the backend's reason. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…servers send data with it; admin key = your CLI); TYPETORCH_FLEET_KEY shown when used Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ey in plain words; TYPETORCH_FLEET_KEY Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ests for init and backend setup with the alias alone; server strings in key lists cleaned for the terminal Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
The CLI side of the backend permissions redesign (plans/38). Pairs with typetorch/backend#93, and works against an older backend.
What changes
typetorch apikeys create --name <n> --group fleet[,viewer…]creates a key in one or more groups.--roleis kept as an alias for one group (game=fleet).apikeys listshows a groups column. It also explains the built-in env keys in plain words, using the backend'saboutline.apikeys groups <id> --group …(PATCH) replaces a key's groups.apikeys revokeis unchanged.typetorch keys create|list|revoke|groupsstill works and runs the same code.typetorch groups list|create|edit|deleteandtypetorch members list|add|edit|removeare new, insrc/groups.tsandsrc/commands/groups.ts.memberstakes a UserId or a username. Usernames are looked up with the backend's existingGET /v1/identity?name=.TYPETORCH_FLEET_KEYis read as an alias ofTYPETORCH_API_KEYin backendCredentials, init (key generation and the existing-backend prompts), repair and doctor.initstill writesTYPETORCH_API_KEY, and the server env writers are unchanged, so an older backend build still works.backend setupstill writes the env key intobackend.key/fleet.token. That is now tested with the alias alone.doctorexplains which key is which in its Config section: the fleet key is what game servers send data with, and the admin key is what your CLI uses.endpoints.ts): when/v1/auth/checkreportspermissions, the key must hold exactlyingest:write. Otherwise the check fails and--forcecan't override it.ingest:writeand noexplorer:read. A custom group that addsaccess:managewould otherwise pass and be signed into a record every game script can read.permissions(an older backend), the check still goes by role.need), not "refused the admin token". New examples are "can't grant permissions you don't hold" and "can't change the key you are using".Older backends (no groups or members)
roletoo, so an older backend makes the same key.role. The older backend then answers 400 "role is one of", and the CLI says it predates groups and that no key was made. It never makes a narrower key.apikeys groups: an older backend answers 405, and the CLI says it predates groups.{error:"not found"}. The CLI then asks/v1/auth/check:permissionsin the answer: the backend predates groups;permissionspresent: the route is unknown to this backend.apikeys list: groups are derived from each key's role, with a note saying so.Judgment calls
ingest:writeand nothing else), with no--forceescape. A key infleetplus any other group is refused.admin, which means every permission. A narrower key is named by what it may do, not accepted./v1/identity?name=returns identity rows. There is no fallback to users.roblox.com; for anyone else the CLI asks for the UserId.apikeys groupsandmembers edit --groupreplace the groups rather than add to them.--groupis only checked for shape, not against a fixed list, because custom groups exist.src/commands/backend.tsis untouched (Security fixes from the 2026-12-05 audit #48 and typetorch settings secrets: move the record's tokens to the Roblox Secrets Store #50 edit it), so its messages still name onlyTYPETORCH_API_KEY.apikeys,groupsandmemberscommands get their own "Backend access" group intypetorch help.Expected conflicts
src/env.ts(SECRET_VARS / comments),src/commands/doctor.ts(imports, Config rows),test/endpoints.test.ts.src/commands/keys.ts(import line, the subcommand routing), README,test/keys.test.ts.src/index.ts(command table),src/commands/doctor.ts.Checks
bunx tsc --noEmit: clean.bun test: 932 pass, 0 fail. An earlier run under load had twodebug-macrostimeouts; they pass alone and in the final run.bun run buildandnode scripts/smoke.mjs: pass.test/groups.test.ts, with additions totest/apikeys.test.ts,test/endpoints.test.ts,test/backend.test.tsandtest/init-backend.test.ts.🤖 Generated with Claude Code