Skip to content

fix(access): take admin reach on profile routes from the acting profile - #2370

Merged
Quick104 merged 5 commits into
mainfrom
fix/acting-admin-profile-routes
Oct 12, 2026
Merged

Quick104 merged 5 commits into
mainfrom
fix/acting-admin-profile-routes

Conversation

@Quick104

@Quick104 Quick104 commented Oct 12, 2026 •

Copy link
Copy Markdown
Contributor

Problem

Related issue: #1179
Validation tasks: none

Not run: #1202 C1 (request permissions) has no recorded result; it now treats a non-primary profile on an admin account as a regular requester. The #1179 cases have not run.

On an admin account, a child profile, or any profile other than the primary one, still gets admin powers on routes outside the admin groups. #2019 stopped the admin role from standing in for the primary profile on the admin routes, so the admin request queue refuses that profile. But the ordinary routes still read the account's role. As the child profile, a caller can:

  • read and cancel every other account's media requests, including their download-server details and errors on v2, and get another account's request ID in search and discover results;
  • delete other accounts' downloaded subtitles;
  • see on-disk file paths;
  • read any admin job, with its unsanitized payloads;
  • add an admin-only home section;
  • receive the administrator channels and every account's events on the v1 events socket.

This affects admin households whose primary profile has a PIN, which is the setup the earlier fix protects.

Approach

apimw.ActingAdmin answers whether a request may use admin powers. It uses the same decision the acting-admin gate makes: the primary profile (with its PIN proof), an admin API key, or a profile-less login session while no profile on the account has a PIN or a limit. The router builds that decider once and hands it to both the gate and ProvideActingAdmin, so a route outside the admin groups can't drift from the gate. The helper counts a declared profile only after the viewer gate has verified it, and it answers false when no decider is installed. Routes that widen what an admin sees or does now call it instead of reading claims.Role, on v1 and v2:

  • media requests: read, cancel, request state, and the v2 download-server fields;
  • downloaded subtitle deletion;
  • file-path visibility;
  • the admin job reads;
  • admin-only home section recipes;
  • the v1 events socket.

A household profile still sees its own account's requests, as before.

Some surfaces needed more than the call swap:

  • The v1 events socket decides on the profile its ticket was minted for, because browsers can't set X-Profile-Id on the handshake. It rechecks the decision with its existing session check, as the v2 socket already does.
  • v2 getAdminJob and getLibraryJob move from authenticated to profile_scoped with an optional profile, so the viewer gate verifies a declared profile. The contract change is additive: an optional X-Profile-Id/X-Profile-Token and a 403.
  • A child profile on an admin account still sees file paths when metadata curation is assigned to the account explicitly, the same bar the curation gate applies. This only changes the admin branch of canViewFilePaths; fix(auth): require marker grants for secondary admin profiles #2177 changes the non-admin branch.

The v1 change is a critical bridge fix and is recorded in docs/architecture/v1-scope.md. jellycompat already reports every user as a non-administrator and grants admin reach only to unscoped admin API keys. The Audiobookshelf layer doesn't read the role. Neither needs a change.

Validation

  • Reproduced on a sandbox built from main. The child profile read another account's request on v1 and v2 (200, with last_error). The admin queue refused its cancel (403). It then cancelled the request through POST /api/v1/requests/{id}/cancel and v2 cancelRequest (200, cancelled). After rebuilding with this branch, all five calls return 403, the requests stay active, and the PIN-verified primary profile still reads them.
  • A database test against the real request service fails on main (child reads and cancels another account's request) and passes here. The new v2 request, job-poll, events-socket and home-section tests also fail on the old checks.
  • Focused Go tests for internal/api/..., internal/apiv2/..., internal/requests/... and internal/policy/... on Linux with a test database: pass, except TestAdminSubtitleListPageDB and TestCatalogTransferPersistsJobsAndSignedLink, which fail the same way on main.
  • make test-go on Linux: the remaining failures are database tests in packages this change doesn't touch. The failing set changes between runs on main and on this branch, and the branch-only ones pass when run serially.
  • go build, gofmt, go vet, make lint-changed (0 issues), and the OpenAPI, contract diff (additive only), route inventory, migration ledger, scenario catalog, offline route, settings binding, playback fixture, fixture, web types and local path checks: pass. The web types typecheck.

Evidence

Evidence: https://evidence.siloserver.org/r/silo-server/pr-2370/

No screen changes for the primary profile or regular accounts. A child profile on an admin account no longer gets the curator view (file paths and metadata actions) in item detail, because the server now reports viewer_curates: false for it. The curation routes behind those actions already refused it. The evidence page has the API calls before and after.

Risks

Checklist

  • I read and can explain the complete diff.
  • This pull request addresses one concern.
  • The Evidence section shows every change a user can see, or says there is none.

AI Disclosure

  • Harness: Claude Code in T3 Code
  • Tool(s): Claude Code
  • Model(s): claude-opus-5-5 (implementation and review finders), claude-sonnet-5-5 (cleanup finder, validation check)
  • Involvement: Fully AI-generated; a maintainer authorized the work, and human verification happens in review
  • Adversarial review: a multi-agent review of the diff (callers and removed behavior, contract and failure modes, cleanup) before opening. It found that the v1 events socket ignored the profile its ticket was minted for, and that the admin-only home section recipe still read the role. Both are fixed. A cross-provider review (gpt-6.1-sol, reviewed 4d4891f) found two issues on the v1 socket recheck. A failed recheck now closes the socket (1b2bdb3). The socket still doesn't recheck a primary profile's PIN proof after a PIN change; v1 never checked profile proof there, so this is left for [bug] v1 events socket keeps admin channels after the primary profile's PIN changes #2383. A second review on 10d5ba3 (multi-agent review with claude-opus-5-5 and claude-sonnet-5-5, and a cross-provider round with gpt-6.1-sol) found that ActingAdminAs passed on a decider's (true, err), which the legacy decider returns when a household lookup fails, and that the v1 ticket comment no longer matched the code. Both are fixed in 5609deb.

🤖 Generated with Claude Code

Routes outside the admin groups granted admin powers from the account's
admin role, so a child profile on an admin account could read and cancel
every account's media requests (and see their download-server details),
delete other accounts' downloaded subtitles, see on-disk file paths, read
any admin job, add admin-only home sections, and receive administrator
events on the v1 socket. The admin routes already refuse that profile.

Add apimw.ActingAdmin, which answers with the same decider the
acting-admin gate uses (installed by ProvideActingAdmin) and only counts
a profile the viewer gate verified. Use it on those routes in v1 and v2.
The v2 job polls now run the viewer gate so a declared profile is
verified; the v1 events socket decides on its ticket's profile and
rechecks the decision while it holds the admin channels.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@silo-kody

silo-kody Bot commented Oct 12, 2026 •

Copy link
Copy Markdown

Silo Kody — review complete

Review finished. Check the inline comments for findings and verify each suggestion against the code and tests.

Reviewing changes in Silo
  • Include the related issue, expected behavior, and validation steps in the PR description.
  • For API changes, describe the effect on Apple and Android clients and Jellyfin compatibility.
  • For plugin changes, identify the affected SDK contract, plugin, and catalog entry.
  • Follow this repository's AGENTS.md and CONTRIBUTING.md.
  • Request another review with @kody start-review in a PR comment.
  • React with 👍 or 👎 to give feedback on individual suggestions.
Review settings
Review Options

The following review options are enabled or disabled:

Options Enabled
Bug ✅
Performance ✅
Security ✅
Business Logic ❌

@coderabbitai

coderabbitai Bot commented Oct 12, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 391e168b-d798-4be5-b2d8-8699708c52fe
📥 Commits

Reviewing files that changed from the base of the PR and between 4d4891f and 5609deb.

📒 Files selected for processing (7)
  • contracts/api/v2/route-inventory.json
  • docs/realtime-api.md
  • internal/api/handlers/events_ws.go
  • internal/api/handlers/events_ws_session_check_test.go
  • internal/api/middleware/acting_admin.go
  • internal/api/middleware/acting_admin_decision_test.go
  • internal/routeinventory/classify.go
💤 Files with no reviewable changes (1)
  • contracts/api/v2/route-inventory.json

Included review availability: This review used your included allowance. Your plan provides up to 4 included reviews per hour; 1 remain after this review.

📝 Walkthrough

Walkthrough

The change adds a shared acting-admin decision based on the active profile and applies it to v1 and v2 resource access, job responses, and WebSocket channels. API contracts and documentation describe profile-scoped job access rules. Tests cover primary and alternate profile behavior.

Changes

Acting-admin access

Layer / File(s) Summary
Shared acting-admin decision and routing
internal/api/middleware/*, internal/api/router.go, internal/apiv2/router.go, internal/apiv2/gates.go, internal/routeinventory/classify.go, contracts/api/v2/route-inventory.json, related tests, docs/architecture/api-contract.md
Middleware defines the acting-admin decider and verifies declared profile scope before using it. The routers provide the same decision to v1 and v2 operations.
v1 resource access checks
internal/api/handlers/admin.go, internal/api/handlers/admin_jobs.go, internal/api/handlers/items.go, internal/api/handlers/requests.go, internal/api/handlers/sections.go, internal/api/handlers/subtitle_*.go, related tests, docs/architecture/media-requests.md, docs/architecture/v1-scope.md, docs/subtitles-api.md
v1 handlers use acting-admin status for job reads, requests, file paths, profile overrides, and subtitle deletion. Tests cover alternate-profile restrictions and denied cross-account actions.
WebSocket channels and session checks
internal/api/handlers/events_ws.go, internal/api/handlers/events_ws_*_test.go, docs/realtime-api.md
The handler selects administrator or user channels based on the request or ticket profile. It checks acting-admin status during the session and closes connections when that status changes.
v2 request and job access
internal/apiv2/admin_catalog_item_metadata.go, internal/apiv2/admin_jobs.go, internal/apiv2/admin_task_jobs.go, internal/apiv2/requests.go, internal/apiv2/request_lifecycle.go, internal/apiv2/watchlist_titles.go, related tests
v2 handlers use acting-admin status for job and request access. Job operations use profile-scoped access, and tests cover primary and alternate profiles.
Profile-scoped contracts and access rules
contracts/api/v2/openapi.json, web/src/api/v2/schema.ts, docs/admin-tasks-api.md, docs/libraries-api.md, docs/architecture/api-contract.md, related architecture docs
The API schemas document profile headers and forbidden responses for job operations. The documentation states the acting-admin access rules for affected routes.

Priority: ⬆️ High

Estimated code review effort: 4 (Complex) | ~60 minutes

Change: Bug fix

Sequence Diagram(s)

sequenceDiagram
  participant Router as api.Router
  participant ViewerGate as v2.ViewerGate
  participant ActingAdmin as apimw.ActingAdmin
  participant Decider as ActingAdminDecider
  participant JobHandler as getAdminJob
  Router->>ViewerGate: Verify declared profile scope
  ViewerGate->>ActingAdmin: Provide verified request scope
  ActingAdmin->>Decider: Evaluate claims, profile ID, and device ID
  Decider-->>ActingAdmin: Return acting-admin decision
  ActingAdmin-->>JobHandler: Provide decision for job access
Loading

Suggested reviewers: rhainland

Merge Risk: ⚪ Minimal · up to 5609d

The change limits admin reach on profile routes to the acting profile and fails closed on errors. No concrete merge-blocking risk is established from the supplied context.

Pre-merge checks · Passed 4 · Failed 1

Failed Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage Warning Docstring coverage is 61.19% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 67 functions across 37 files. (2 skipped:… Write docstrings for the functions missing them to satisfy the coverage threshold.
Passed Passed checks (4 passed)
Check name Status Explanation
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Title check Passed The title clearly and concisely describes the main change: admin access now follows the acting profile on profile-scoped routes.
Description check Passed The description directly explains the access-control issue, implementation, affected routes, contract changes, validation, risks, and evidence.
Full details: Docstring Coverage

Explanation

Docstring coverage is 61.19% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 67 functions across 37 files. (2 skipped: 2 unsupported.)

  • Fix all pre-merge checks with AI
✨ Finishing Touches 💡 2
📝 Generate docstrings 💡
  • Commit to this branch
  • Create a new PR
⚔️ Resolve merge conflicts 💡
  • Resolve merge conflict in branch fix/acting-admin-profile-routes
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@silo-triage silo-triage Bot added bug Something isn't working go Pull requests that update go code impact: security Auth, privacy, or permission boundary priority: P0 Fix/merge first: data-loss, security, or widespread breakage labels Oct 12, 2026

@Quick104 Quick104 left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Adversarial review (gpt-6.1-sol, reviewed 4d4891f)

Two findings in the v1 events socket's authority recheck. Focused acting-admin, HTTP-route, PIN-token and socket tests pass; the new v1 recheck test exercises a false decision but does not exercise PIN-revision invalidation or a decider error.

if claims.Role == models.RoleAdmin {
stillActingAdmin = apimw.ActingAdmin
if apimw.GetProfileID(r.Context()) == "" && boundProfileID != "" {
stillActingAdmin = func(ctx context.Context) (bool, error) { return apimw.ActingAdminAs(ctx, boundProfileID) }

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[P1] Revalidate primary-profile PIN proof during socket checks

Open a v1 administrator socket with a ticket minted for the primary profile, then set or change that profile's PIN while the login session stays active. Every recheck calls ActingAdminAs with only the profile ID; the router's primary checker reads IsPrimary, and neither the ticket nor this callback retains the PIN proof or revision. The decision therefore remains allowed after the old proof has been invalidated, and the socket keeps administrator channels and other accounts' events indefinitely. The header-based path has the same problem because ActingAdmin reads the handshake's unchanged ProfileVerified scope. CheckProfileToken rejects a changed PIN revision, and the v2 socket re-resolves that proof on each check. Retain session-bound profile proof in the v1 ticket and re-resolve viewer verification at the handshake and each interval; close when it no longer verifies. Cover a real PIN-revision change in the socket test.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The mechanism is real, but this PR does not introduce it, so I am leaving it out of this change. On main, the v1 socket gives the administrator channels to every profile on an admin account and never looks at profile proof. A PIN change could not narrow it before, and this PR only narrows it further. Rechecking the proof on v1 needs new plumbing on the frozen bridge: the viewer resolver in the events handler, plus the PIN token kept with the ticket, which the v1 ticket store does not carry today. The v2 socket already re-resolves the proof on each check, and current clients use v2. I will raise it with the maintainer as a follow-up rather than widen this bridge fix.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Filed as #2383, confirmed against main and this branch. The fix needs the profile token kept with the v1 ticket, plus changes to the recheck this PR rewrites, so it should land after this PR. The related v2 events-socket gap from the Risks section is #2384. It is narrower than the Risks line says: only the events socket is open to new profile-less admin sessions, admin-logs only for sockets opened before the household changed, and playback control and Watch Together not at all.

Comment thread internal/api/handlers/events_ws.go Resolved
Quick104 and others added 2 commits October 12, 2026 14:45
A v1 events connection holding the administrator channels kept them
while the acting-admin decision could not be made (profile store or
policy evaluation down). Treat a failed recheck as lost authority, like
the HTTP routes do, so the client reconnects and is decided afresh.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
…ture

ProvideActingAdmin only makes the acting-admin decision available to
handlers and admits nothing, so it belongs with the base stack. Without
it every route carried an unclassified_middleware trait and the
migration ledger disagreed with the inventory.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Comment on lines +1627 to +1628
actingAdmin, _ := apimw.ActingAdmin(r.Context())
writeJSON(w, http.StatusAccepted, adminJobToResponseFor(r, job, nil, actingAdmin))

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

kody code-review Security critical

Administrator visibility leak in internal/api/handlers/admin.go occurs because discarding the apimw.ActingAdmin error accepts the legacy decider’s (true, err) result when a profile-less household lookup fails, exposing the unsanitized item-refresh request, including scan_path and canonical_root_path, instead of failing closed. Set actingAdmin to false on any lookup error here and in internal/apiv2/admin_catalog_item_metadata.go:86, while still returning the already-created job.

actingAdmin, adminErr := apimw.ActingAdmin(r.Context())
if adminErr != nil {
	actingAdmin = false
}
writeJSON(w, http.StatusAccepted, adminJobToResponseFor(r, job, nil, actingAdmin))
Prompt for LLM

File internal/api/handlers/admin.go:

Line 1627 to 1628:

Administrator visibility leak in `internal/api/handlers/admin.go` occurs because discarding the `apimw.ActingAdmin` error accepts the legacy decider’s `(true, err)` result when a profile-less household lookup fails, exposing the unsanitized item-refresh request, including `scan_path` and `canonical_root_path`, instead of failing closed. Set `actingAdmin` to false on any lookup error here and in `internal/apiv2/admin_catalog_item_metadata.go:86`, while still returning the already-created job.

Suggested Code:

actingAdmin, adminErr := apimw.ActingAdmin(r.Context())
if adminErr != nil {
	actingAdmin = false
}
writeJSON(w, http.StatusAccepted, adminJobToResponseFor(r, job, nil, actingAdmin))

Talk to Kody by mentioning @kody

Was this suggestion helpful? React with 👍 or 👎 to help Kody learn from this interaction.

​

​

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The mechanism is real, but production doesn't hit it. I'm fixing it in a commit on this branch, so there's no need to change it yourself.

  • Trigger: the legacy decider (NewActingAdminDecider) returns !refused, err. When the household-profile lookup fails for a profile-less admin session, that comes back as (true, err). ActingAdminAs passes the pair through, and the two refresh handlers keep the true.
  • Reach: the router installs the legacy decider only without a policy system, which means proxy and test wiring. Production API modes use NewPolicyActingAdminDecider, which returns false on every error. On v2, adminTaskJobOf already leaves request payloads and paths out of an item-refresh result, whatever the flag says.
  • Repair: make ActingAdminAs return false whenever the decider errors. Its doc comment already says callers fail closed, and the two "narrow on error" call sites then do what their comments say. A test case will have the decider return (true, err).

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agreed—the mechanism is valid, but my original critical-severity framing and v2 payload-exposure claim were overstated given the wiring and serialization behavior you describe:

  • The (true, err) result is reachable through the legacy decider in proxy/test wiring, not the production policy decider.
  • v2’s adminTaskJobOf already omits item-refresh request payloads and paths regardless of the flag.

Fixing ActingAdminAs centrally is preferable to adding defensive checks in both handlers: return (false, err) whenever the decider errors, preserving the error while enforcing the helper’s fail-closed contract. The regression test should assert both that a decider returning (true, err) produces false and that the original error remains available.

That also preserves the intended behavior: return the already-created job with restricted visibility rather than fail the response.

I’ll leave the branch changes to you.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in 5609deb. ActingAdminAs now returns false whenever the decider errors, so both refresh handlers narrow the response as their comments say. TestActingAdminFailsClosed now asserts false for a (true, err) decider and for the real legacy decider with a failing household lookup. It fails on the previous head with ActingAdmin = true, profile store down. Middleware, events, request, job and section tests pass, and make lint-changed reports 0 issues.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks—based on your description, 5609deb66 addresses this finding at the right boundary.

Making ActingAdminAs return false whenever the decider errors enforces the fail-closed contract centrally. Both refresh handlers can still return the already-created job, but with restricted visibility; no handler-specific workaround is needed.

The regression coverage targets the original failure mode:

  • A decider returning (true, err).
  • The real legacy decider with a failing household lookup.

The reported failure on the previous head confirms the test catches the bug. With the focused tests and lint passing as reported, I have no further changes to suggest for this finding.

@Quick104 Quick104 left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review of 10d5ba3: one new finding (below), plus a reply in the existing thread on admin.go confirming the (true, err) fail-open. Both are low severity, and I'm fixing both in commits on this branch. A summary with scores follows once the fixes are pushed.

Comment thread internal/api/handlers/events_ws.go Resolved
ActingAdminAs passed the decider's result through unchanged, and the
legacy decider returns (true, err) when a profile-less session's
household lookup fails. The two item-refresh handlers that narrow on
error kept the true. ActingAdminAs now answers false whenever the
decider errors, as its doc comment promises.

Also correct the v1 events ticket comment and realtime doc: a rejected
ticket now also decides an admin account's channels, since the
connection is judged as acting with no profile.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@silo-kody

silo-kody Bot commented Oct 12, 2026 •

Copy link
Copy Markdown

Silo Kody — review complete

Review finished. Check the inline comments for findings and verify each suggestion against the code and tests.

Reviewing changes in Silo
  • Include the related issue, expected behavior, and validation steps in the PR description.
  • For API changes, describe the effect on Apple and Android clients and Jellyfin compatibility.
  • For plugin changes, identify the affected SDK contract, plugin, and catalog entry.
  • Follow this repository's AGENTS.md and CONTRIBUTING.md.
  • Request another review with @kody start-review in a PR comment.
  • React with 👍 or 👎 to give feedback on individual suggestions.
Review settings
Review Options

The following review options are enabled or disabled:

Options Enabled
Bug ✅
Performance ✅
Security ✅
Business Logic ❌

…ile-routes

# Conflicts:
#	docs/architecture/v1-scope.md
@Quick104

Copy link
Copy Markdown
Contributor Author

Review summary

Fit: 9/10 · Readiness: 9/10 — ready

Reviewed head: 1c9a964. The review covered 10d5ba3; after it came the fix commit 5609deb and a merge of main.

Addressed

  • ActingAdminAs could report true together with an error (low, from Kody's thread). The legacy decider returns (true, err) when a profile-less session's household lookup fails, and the two item-refresh handlers kept the true. Production wires the policy decider, which returns false on error, so no production path was affected. Fixed in 5609deb: the helper returns false on any decider error. The extended TestActingAdminFailsClosed fails on the previous head.
  • The v1 events ticket comment said the binding grants nothing (low). It now decides an admin account's channels: a rejected ticket leaves the socket judged as acting with no profile. The comment and docs/realtime-api.md now say so; behaviour is unchanged.
  • Merge conflict with main in docs/architecture/v1-scope.md, where both sides added a row. Kept both.

Checked and not changed

  • Moving v2 getAdminJob and getLibraryJob to profile-scoped tightens polls that name a PIN-locked profile without proof. The PR discloses this. The web client sends the token, and code search finds no job-poll callers in silo-apple or silo-android.
  • The v1 socket's handshake 500 and its close when a recheck fails match the v2 events socket, which fails the handshake on a validation error and closes on any recheck error within the same 2-second budget.
  • No claims.Role reads that widen admin reach remain outside the admin groups. The subtitle AI quota exemption already requires the primary profile, and the collection-job poll is behind the acting-admin gate.
  • The admin-account path makes uncached decider calls (a profile lookup and a policy evaluation per call). I measured nothing, so I'm not raising it as a finding.

Follow-ups filed (pre-existing, not in this PR)

Validated features

No passed case on the v1.0 board is reached. Branding (#1227, #1228, #1229 C1) goes through the refactored acting-admin gate with the same decision, so behaviour doesn't change. Calendar and person cases share no code with the diff. The #1179 multi-profile cases and #1202 C1 have not run. Validation tasks: none stands; I moved the not-run note to its own line.

User manual

No change needed. I checked the Requests, Profiles, Subtitles and Home sections pages. The only related statement, that "a server administrator" can manage profiles, is already tracked in Silo-Server/siloserver.org#114 for #2019. No page describes admin reach over other accounts' requests, subtitles or file paths.

Apple and Android

No client change needed. Both apps use the v2 admin approval queue, which has been behind the acting-admin gate since #2019. A child profile's own request list now shows only its account's requests.

Scores

  • Fit 9: it closes a real access-control gap in the household and profile model, and it reuses the admin gate's own decision instead of adding a parallel check. The v2 contract change is additive (an optional profile and a 403) and is documented.
  • Readiness 9: all required checks pass on the current head, review findings are fixed with regression coverage, and no validated case regresses. The remaining socket gaps predate the change and are tracked separately.

Review method

Multi-agent review at high effort: three finders, a validation-impact check and a verification pass, using claude-opus-5-5 and claude-sonnet-5-5. One cross-provider round with gpt-6.1-sol at xhigh reported no findings that this diff introduces. Focused Go tests for internal/api/middleware, internal/api/handlers, internal/apiv2 and internal/routeinventory, plus make lint-changed, passed locally on the merged tree. Nothing was re-run on a sandbox. The fixes change an error path that production wiring can't reach, a comment, and a doc, so the unit test is the verification.

🤖 Generated with Claude Code

@Quick104
Quick104 merged commit 7608d6b into main Oct 12, 2026
22 checks passed
@Quick104
Quick104 deleted the fix/acting-admin-profile-routes branch October 12, 2026 22:48
Quick104 added a commit to Rhainland/silo-server that referenced this pull request Nov 2, 2026
Resolve conflicts with current main:

- internal/auth/permissions_test.go: Silo-Server#2817 kept tests for
  HasEffectivePermission, which this branch removes; keep the branch's
  PolicyPermissions table and drop the default-permissions test as Silo-Server#2817 did.
- internal/api/handlers/items.go: Silo-Server#2370 added a secondary-admin file-path
  check through HasAssignedPermission. A secondary admin now falls through
  to the shared masked check; groups never mask an admin, so it still needs
  metadata_curation assigned to the account.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working go Pull requests that update go code impact: security Auth, privacy, or permission boundary priority: P0 Fix/merge first: data-loss, security, or widespread breakage

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant