Repository navigation
Conversation
…anges An org ban or reserve list change is logged on the org with no server (serverId null), and auditVisibility gives an API key no owned orgs, so no key sees one, whatever its scope. A key that reads the audit trail of every server in the org, which is what an integration watching the whole org holds, missed exactly the changes those servers all enforce: an org-wide ban reached every server and never reached the key's audit read. A key with audit.read held to every server of its org (serverIds null) now also sees that org's list-entry changes: list.add, list.remove, list.update, list.import and list.expire (ORG_LIST_ROWS). Nothing else logged on the org: member grants, roles, keys, webhooks and list.members stay the owners'. A key held to some servers, a key without audit.read, a key of a suspended org, and every person's visibility are unchanged. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_011wkaN3kHsCQGhxCxeAqERQ
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 gap
An org ban or reserve list change is logged on the org, with
serverIdnull.auditVisibilitygives an API keyownedOrgIds: [], sovisibleWherenever lets a key see a row like that, whatever the key's scope. The result: a key that reads the audit trail of every server in its org cannot see the changes all of those servers enforce.We hit this with an integration that watches staff actions through
GET /api/audit, using a key withaudit.readon every server (serverIdsnull). A staff member's org-wide ban (list.addon the org list) never reached it. A server-list ban of the same player 35 seconds later did. Reading/api/auditwith that key returned the rows on either side of the org ban and not the ban itself.The change
A key with
audit.readheld to every server of its org (serverIds === null) now also sees that org's list-entry changes:list.add,list.remove,list.update,list.importandlist.expire(newORG_LIST_ROWSinaudit-rows.ts).AuditVisibilitygets an optionallistOrgIds, set only on that key path.visibleWhereaddsorg_id IN listOrgIds AND server_id IS NULL AND action IN ORG_LIST_ROWS.The line is narrow on purpose: an org list change takes effect on every server of the org, so anyone who can read every server's audit trail should see it. Everything else logged on the org stays the owners': member grants, roles, keys, webhooks, and
list.members(who may edit the lists).Unchanged
audit.read, see nothing new.coveredis empty there, and the new branch requires it.auditVisibilityreturns exactly what it did, andaccess.test.ts's exact-shape assertions still pass.Test
src/test/access.test.ts, "a key over every server sees its org's list changes, and nothing else logged on the org". It seeds org-levellist.add,list.expire,list.membersandorg.member.grantsrows, a server row, and an orglist.addin another org, then checks:keyAllsees the org'slist.addandlist.expireplus the server row, and not the others;keyElsewhere(one other server) sees none of them;keyView(noaudit.read) sees none of them;listOrgIds.CI on my fork with the TimescaleDB service from
ci.yml: lint, check andbun testall green, 848 pass, 0 fail, including this test. That run was jbob06#2, opened only for CI and now closed.If you would rather make this an explicit key setting than infer it from "every server", or extend the same rule to people whose
audit.readcovers every server of an org, I am happy to change it.🤖 Generated with Claude Code
https://claude.ai/code/session_011wkaN3kHsCQGhxCxeAqERQ