fix(backend): derive the caller organisation server-side in eval and registry resolvers - #168
Merged
Merged
Conversation
added 2 commits
September 18, 2026 04:53
…and writes List-by-org reads scope to the caller's claim via resolveScopedOrgFromEvent (admins may pass an explicit orgId); by-id reads fetch then verify with canCallerSeeRow and return null or [] across organisations so there is no existence oracle; writes stamp the caller organisation and reject a mismatching client orgId. Adds dispatch-gate enumeration guards for the three eval resolvers.
…nd metrics reads createApp stamps the caller's organisation and rejects a mismatching client orgId, accepting only the org-less sentinel now single-sourced in utils/org-sentinel.ts; listAppApiKeys and getAppMetrics require viewer access to the app. The dispatch-gate guard now checks structurally that gated operations receive the event instead of trusting an exemption list.
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.
Summary
orgIdon writes.createAppstamps the caller organisation (org-less sentinel single-sourced inutils/org-sentinel.ts);listAppApiKeysandgetAppMetricsrequire viewer access.Resolves findings a352ffdd and 13ffaca1; server-side half of d34ac46f.
Verification
jest: 8065 passed, tsc clean