Skip to content

fix(backend): derive the caller organisation server-side in eval and registry resolvers - #168

Merged
gibbsie merged 2 commits into
mainfrom
fix/server-derived-org-resolvers
Sep 18, 2026
Merged

gibbsie merged 2 commits into
mainfrom
fix/server-derived-org-resolvers

Conversation

@gibbsie

@gibbsie gibbsie commented Sep 18, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Eval suite/run/comparison resolvers scope list reads to the caller's claim, fetch-then-verify by-id reads (null, no oracle), and reject mismatching client orgId on writes.
  • createApp stamps the caller organisation (org-less sentinel single-sourced in utils/org-sentinel.ts); listAppApiKeys and getAppMetrics require viewer access.
  • Dispatch-gate guards for the three eval resolvers; registry guard now checks structurally that gated operations receive the event.

Resolves findings a352ffdd and 13ffaca1; server-side half of d34ac46f.

Verification

  • backend jest: 8065 passed, tsc clean
  • frontend tsc clean; no frontend changes needed (eval suite/run reads have no UI callers; comparison reads and createApp keep working)

Oliver Gibbs 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.
@gibbsie
gibbsie merged commit 9e1c5ac into main Sep 18, 2026
15 checks passed
@gibbsie
gibbsie deleted the fix/server-derived-org-resolvers branch September 18, 2026 06:39
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