Repository navigation
feat: support access: time-limited, audited operator access to job contents, shown to the customer - #15
Merged
Conversation
New table support_grants (+ index on org_id) and an index on operator_audit(target). Store functions, each one begin() transaction with its audit row: grant, end by id, the audited payload read (Scrubbed as its own outcome), the audited titled jobs page, the one definition of an active grant, and the customer's grant history with listed/opened job ids. delete_org removes the org's grants; audit rows stay. No HTTP routes yet. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01TEvvb3zrZ3bLSGJbCBaEYX
…nload, titles on request
POST /operator/orgs/{id}/support, DELETE /operator/support/{id}, POST /operator/jobs/{id}/payload
(raw bytes as a sandboxed download) and GET /operator/orgs/{id}/jobs?titles=1. The org page gains
"support", the overview reports the feature. Every read is audited in the store's transaction; a
failed audit row answers 500 and discloses nothing. docs/operator.md gets a Support access section.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01TEvvb3zrZ3bLSGJbCBaEYX
… to their org
manager() gate: a session sees its own org (a foreign ?org= is 403), root passes ?org= or reads
the default org (404 for an unknown one), an API key is 401. Answers {enabled, grants}, newest
first, at most 50, current org generation only, with the listed and opened job ids from the audit
rows. With the operator token unset: {"enabled": false, "grants": []}.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01TEvvb3zrZ3bLSGJbCBaEYX
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01TEvvb3zrZ3bLSGJbCBaEYX
…p out of view The review of the support-access branch found two things: - usePoll ran its fetcher once on mount and never again when the fetcher's inputs changed (the fetcher is deliberately no effect dependency). Settings mounts before /me answers, so the org card and the new Support access card both fetched "no org" once and stayed empty. usePoll takes a key now: a new key fetches at once and drops the old data. Checked in headless Edge against a local server with a session, an active and an ended grant. - GET /support-access capped the list at the 50 newest grants, so 50 empty grants in a row could push a used one out of the customer's view. Every used grant (reads > 0) stays listed; only the unused ones are capped at 50. A 401 on /support-access (an API key) no longer signs the dashboard out, like /orgs and /users. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01TEvvb3zrZ3bLSGJbCBaEYX
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01TEvvb3zrZ3bLSGJbCBaEYX
The Settings bug went unnoticed because nothing ran the hook. This renders the real hook under node with just enough DOM for react-dom, and fails on the old deps (3 of 4 tests red without `key` in the effect). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01TEvvb3zrZ3bLSGJbCBaEYX
…hange Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01TEvvb3zrZ3bLSGJbCBaEYX
Merged
LukiPrince
added a commit
that referenced
this pull request
Nov 14, 2026
Support access (#15) and live settings (#16). The example version in docs/operator.md follows. Claude-Session: https://claude.ai/code/session_01TEvvb3zrZ3bLSGJbCBaEYX Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
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.
Support access, PR 2 of the operator API: the operator of a hosted deployment can look at a customer's job contents for a limited time, every access is in the audit log, and the customer sees each one on their Settings page. Nothing changes without
PRINTAPI_OPERATOR_TOKEN: every new/operator/path stays 404, andGET /support-accessanswers{"enabled": false, "grants": []}.Operator side (
docs/operator.md#support-access)POST /operator/orgs/{id}/support{reason ≥ 8, minutes: 15|30|60, org_created_at}: one grant for the whole org, at most one active at a time. It is bound to the org's generation, so a recreated org with a reused id inherits nothing.DELETE /operator/support/{grant_id}ends the grant at once.POST /operator/jobs/{id}/payloaddownloads the stored bytes. The audit row andreads + 1are written in the same transaction before any byte goes out. The headers keep a browser from rendering it:application/octet-stream,attachment,nosniff,CSP: sandbox; default-src 'none',no-store. Answers: 403 without an active grant, 404 for an unknown job, 410 once retention has emptied the payload.GET /operator/orgs/{id}/jobs?titles=1. It answers 403 without a grant. With a grant, the response and asupport.list_jobsrow with the returned job ids are written in one transaction. Withouttitles=1nothing is written, so a tab that refetches does not fill the log.GET /operator/orgs/{id}gainssupport(the active grant or null). The overview reportsfeatures: ["support"].support_grants, and an index onoperator_audit(target).delete_orgremoves the org's grants; its audit rows stay.Customer side (
docs/api.md#support-access)GET /support-accessis open to browser sessions (own org; another org's?org=answers 403) and to root (?org=, default org without it). An API key gets 401. It lists every grant that was used, plus the 50 newest unused ones, each with the listed and opened job ids.enabled: false.Fixes from the review (security review and Codex adversarial, read-only; each finding cross-checked):
usePollfetched only once on mount, so the Settings page never loaded the chosen org. This hit the existing org card too, not only the new card.usePollnow takes akey./support-accessno longer signs the dashboard out.Checks
cargo test --workspace1033 passed, clippy-D warnings, fmt.check_docsOK.--db-compat: 23/23.No release (that would be 3.6.0, only after asking).
🤖 Generated with Claude Code
https://claude.ai/code/session_01TEvvb3zrZ3bLSGJbCBaEYX