Skip to content

fix(ratelimit): share request allowance across account credentials - #2719

Merged
Quick104 merged 7 commits into
mainfrom
fix/account-shared-rate-limit
Oct 20, 2026
Merged

Quick104 merged 7 commits into
mainfrom
fix/account-shared-rate-limit

Conversation

@Quick104

@Quick104 Quick104 commented Oct 19, 2026 •

Copy link
Copy Markdown
Contributor

Problem

An authenticated client whose transport peer is trusted for forwarding headers can rotate its reported address to get a fresh source allowance. This adds one stable account allowance, shared across household profiles, sessions, devices and API keys, so those changes cannot reset the account quota.

#2364 already caps this rotation on sign-in endpoints with a per-connection budget, which resolves the sign-in case #2329 describes. This change covers authenticated routes, where rotation still reset the per-address allowance.

Closes #2329
Related issue: N/A
Validation tasks: unblocks #1217 C1; unblocks #1218 C1; unblocks #1246 C1

Approach

The account allowance is four times the per-IP budget: 480 requests/second, 24000/minute and burst 480 at the defaults (120, 6000, 120). One login often spans several networks, and each address is already held to one per-IP budget, so a single busy address or integration can spend at most a quarter of its account. The per-IP settings still control both; there is no new setting. Existing source, API-key and global budgets remain. Narrower denials run before the global check. Separate accounts behind one proxy retain separate account allowances while still sharing applicable source and global controls.

Native v1/v2 and Jellyfin credentials charge the login account. The Jellyfin adapter carries only a rate-limit identity, without adding native authorization claims or key-tier enforcement. Credentialless address-only stream grants retain source/global protection without charging an inferred owner. Pre-authentication display-token and public lookup protection remains in place. Admin copy, admin settings search and developer docs explain the shared allowance.

Validation

  • Account size, isolated deployment, limits scaled to 20/s, 600/min, burst 20 (memory backend), two sessions on one account on different forwarded addresses: an integration at 18 req/s on one address and a device at 2 req/s on another for 90 s. With the account at one per-IP budget (bd7300e9d), the device was refused from 60 s (122/180 admitted). At four budgets (fb356e878) the device kept 180/180; the integration was refused from 75 s by its own address budget only. One session rotating X-Forwarded-For on 300 back-to-back requests: 25 admitted before, 101 after, so rotation stays bounded. Focused internal/ratelimit and internal/jellycompat tests pass, including the Redis account test against a real Redis with two middleware instances.
  • Live synthetic HTTP in an isolated deployment: rotating X-Forwarded-For, X-Real-IP and repeated X-Forwarded-For went from 24/24 admitted to 1/24 with a one-request budget; fixed/no-header controls stayed bounded. With a two-request budget, rotating two sessions, two API keys and device headers went from 12/12 to 2/12. A second account retained its own allowance. Existing named-public peer caps stayed bounded.
  • Deterministic recording tests verify the exact defaults, identity selection, pre-authentication behavior and rejection ordering. Focused native/Jellyfin tests and two independent middleware/Redis clients pass. The Redis check proves shared counters, not deployed replicas or failover.
  • Build, vet, formatting, changed-line lint, web lint/build/budget, all 8367 web tests, repository verification gates and Prometheus rules pass. The full Go suite has six failures also reproduced on the unchanged base: system-resource expectations, Dolby Vision routing and NFO case/permission tests. Exact cases are in the evidence.
  • Initial CI Repository checks failed fetching Go checksum data; GitHub refused a rerun while the workflow was still active. The corresponding local checks pass.
  • The 429 response keeps its shape and Retry-After, so no response-schema change is needed. Android media loads treat 429 as final (MediaLoadRetryPolicy), so a refused segment or range request ends playback instead of waiting; Apple media handling was not checked. No physical client or real playback test was performed.
  • Earlier review re-check, before the account size was raised, on main and head binaries against a throwaway database (memory backend, and two processes sharing Redis): rotating headers across two sessions, an API key and device headers went from 24/24 to 5/24 admitted, and a second account kept its allowance. At the defaults, four devices on separate addresses at about 5 requests/second each for 20 seconds were all admitted. With limits scaled to 20/second and 600/minute and an API key running near its tier rate, the server refused about a third of another address's requests on the same account after about 60 seconds; main refused none. Whole-board validation access was unavailable; the listed cases were inspected directly.

Evidence

The current page compares bd7300e9d (account at one per-IP budget) with head fb356e878 (four budgets): the wire results above and desktop and phone captures of the admin rate-limit row, whose description now says the account budget is four times larger. Runtime revision metadata was unavailable; the sandbox source files matched the branch by hash. Earlier versions of the page, comparing base 365e3d436 with implementation da300507d, remain in its version list.

Evidence: https://evidence.siloserver.org/r/silo-server/issue-2329/

Risks

An account can still be throttled when four addresses' worth of traffic arrives at once, and a client rotating forwarding headers gets up to four per-IP budgets. Raising a key tier does not raise the account allowance; raising the per-IP settings does. Successful native API-key headers still describe the key budget and can overstate the account's remaining capacity. Memory counters remain per process; Redis retains its existing fail-open behavior. Proxy trust defaults are unchanged. No migration is required.

User manual: Silo-Server/siloserver.org#257. The tested docs branch is prepared; its draft PR is blocked because the current evidence publisher rejects the repository name siloserver.org.

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: Codex in T3 Code; Claude Code in T3 Code.
  • Tool(s): Codex, Claude Code, T3 Code delegated review tools.
  • Model(s): gpt-6.1-sol (xhigh), claude-opus-5-5 (high).
  • Involvement: Fully AI-generated at maintainer direction; human verification pending.
  • Adversarial review: Claude plan review required a rate-only Jellyfin identity, preserved credentialless grants and key-tier behavior, and deterministic default-policy tests; those changes are included. Independent Codex reviews covered identity, ordering, contracts, scale and validation, with no remaining findings; the final sweep reviewed ec1bacb6a. The post-PR Claude review of ec1bacb6a completed with no verified defects and nothing posted. A later Claude Code (claude-opus-5-5) review of ec1bacb6a, with a read-only Codex (gpt-6.1-sol) round, posted one fixed finding (admin search label, bd7300e9d) and one open product decision on the account budget's size. The maintainer chose four per-IP budgets after a Claude Code (claude-opus-5-5) survey of server routes and Apple, Android and web request patterns; that change is fb356e878.

Note

Add shared per-account rate-limit budget for authenticated requests

  • Authenticated requests now spend a shared account budget, applied after per-IP and API-key checks and before the global check. The budget covers native API keys, compat sessions, profiles, sessions, and devices, and is sized at four times the configured per-address rates (middleware.go).
  • Adds ratelimit.WithAccount so non-native listeners (Jellyfin compat sessions and admin API keys) can attach an account identity without granting native authorization claims (account.go).
  • In Jellyfin compat, playback requests charge the account only when a resolved credential or explicit PlaySessionId is present; address-only static-stream grants do not (auth.go).
  • Renames the admin setting label to 'Per address and account' and updates the API docs (SecurityAccessSettings.tsx).
  • Behavioral Change: authenticated accounts now hit a shared allowance across all their credentials and IP addresses, and account rejection stops requests before downstream handling.

Macroscope summarized fb356e8.

@silo-triage silo-triage Bot added the size/XL 500–999 added + deleted lines (all files); change volume, not priority. label Oct 19, 2026
@silo-kody

silo-kody Bot commented Oct 19, 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 19, 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: 314ac402-b182-4d6a-8559-8b5d88dbeea6
📥 Commits

Reviewing files that changed from the base of the PR and between ec1bacb and fb356e8.

📒 Files selected for processing: 9
  • docs/auth-api.md
  • internal/jellycompat/ratelimit_account_test.go
  • internal/ratelimit/account_redis_test.go
  • internal/ratelimit/account_test.go
  • internal/ratelimit/forwarded_rotation_test.go
  • internal/ratelimit/middleware.go
  • web/src/lib/adminSettingsSearch.test.ts
  • web/src/lib/adminSettingsSearch.ts
  • web/src/pages/admin-settings/SecurityAccessSettings.tsx
🚧 Files skipped from review as they are similar to previous changes: 1
  • web/src/pages/admin-settings/SecurityAccessSettings.tsx

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

📝 Walkthrough

The rate limiter now applies a shared account budget to authenticated requests alongside existing budgets. Native and Jellycompat authentication paths provide account identity under documented rules. Documentation and admin settings describe the account budget, and tests cover sharing, exclusions, forwarding rotation, and Redis-backed behavior.

Changes: Shared account rate limits

Layer / File(s) Summary
Account identity and rate-limit enforcement
internal/ratelimit/account.go, internal/ratelimit/middleware.go, internal/ratelimit/*_test.go
The middleware resolves authenticated account IDs and checks a four-times-scaled account budget before the global limit. Tests cover identity handling, limiter order, sharing across credentials and IPs, API-key ownership, forwarding rotation, and Redis-backed behavior.
Jellycompat account propagation
internal/jellycompat/auth.go, internal/jellycompat/auth_api_key.go, internal/jellycompat/ratelimit.go, internal/jellycompat/ratelimit_account_test.go, docs/jellycompat-api.md
Session and API-key authentication add account identity to the rate-limit context. Credential-less static-stream grants do not add an inferred account. Tests cover session sharing, API-key owner status, and explicit playback grants.
Account budget documentation and settings
docs/api-keys-api.md, docs/auth-api.md, web/src/pages/admin-settings/*, web/src/lib/adminSettingsSearch.*
The documentation and admin settings describe the shared account allowance across signed-in profiles, sessions, devices, and API keys, alongside existing rate budgets.

Priority: ➖ Normal

Estimated code review effort: 3 (Moderate) | ~25 minutes

Change: Bug fix

Sequence Diagram(s)

sequenceDiagram
  participant Client
  participant JellycompatAuth
  participant RateLimitMiddleware
  participant SharedLimiter
  participant Handler
  Client->>JellycompatAuth: Authenticate session or API key
  JellycompatAuth->>RateLimitMiddleware: Attach account ID to context
  RateLimitMiddleware->>SharedLimiter: Check account budget
  SharedLimiter-->>RateLimitMiddleware: Allow or reject request
  RateLimitMiddleware->>Handler: Continue allowed request
Loading

Suggested reviewers: rhainland

Merge Risk: ⚪ Minimal · up to fb356

The revised shared account allowance has no established issue blocking merge; normal validation remains appropriate.

Pre-merge checks: Passed 4 · Failed 1

Failed Failed checks: 1 warning

Check name Status Explanation Resolution
Docstring Coverage Warning Docstring coverage is 23.81% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 21 functions across 14 files. (1 skipped:… Write docstrings for the functions missing them to satisfy the coverage threshold.
Passed Passed checks: 4 passed
Check name Status Explanation
Title check Passed The title clearly and concisely describes the main change: sharing the rate-limit allowance across credentials belonging to one account.
Linked Issues check Passed The PR meets the coding requirements in directly linked issue #2329. The existing auth-endpoint handler applies a transport-peer budget when a trusted forwarded address differs from the peer, so heade…
Out of Scope Changes check Passed The changes remain within #2329 and the stated account-allowance solution. Middleware changes prevent authenticated-route allowance resets. Native and Jellyfin identity adapters supply validated accou…
Description check Passed The pull request description directly explains the account-level rate-limit changes, affected credentials and routes, implementation approach, validation, risks, and documentation updates.
Full details: Linked Issues check

Explanation

The PR meets the coding requirements in directly linked issue #2329. The existing auth-endpoint handler applies a transport-peer budget when a trusted forwarded address differs from the peer, so header rotation cannot obtain unlimited sign-in allowances. The handler still keeps separate resolved-client budgets for legitimate proxy clients. This PR adds an account budget keyed by authenticated account ID, independent of forwarded address, profile, session, device, and credential. The account check runs before the global check. Tests cover forwarded-header rotation, shared credentials, separate accounts, rejection order, and native/Jellyfin identity handling.

Full details: Out of Scope Changes check

Explanation

The changes remain within #2329 and the stated account-allowance solution. Middleware changes prevent authenticated-route allowance resets. Native and Jellyfin identity adapters supply validated account identities. Tests verify the behavior. Admin labels and API documentation describe the new account budget. No unrelated product behavior is demonstrated.

Full details: Docstring Coverage

Explanation

Docstring coverage is 23.81% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 21 functions across 14 files. (1 skipped: 1 unsupported.)

Resolution

Write docstrings for the functions missing them to satisfy the coverage threshold.

✨ Finishing Touches: 💡 1
📝 Generate docstrings: 💡
  • Commit to this branch
  • Create a new PR
🧪 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: P1 Core-path bug; painful workaround — next after P0 labels Oct 19, 2026
@macroscopeapp

macroscopeapp Bot commented Oct 19, 2026

Copy link
Copy Markdown

The Validation tasks: line overstates the impact on the passed user-management cases and omits two changed paths. #1196 C1/C2 and #1197 C1/C2 exercise policy and authorization outcomes, not rate throttling; their authenticated requests now spend the account bucket, but the recorded steps do not exercise that threshold, so those results do not need re-validation. Remove changes #1196 C1,C2.

The rate-limit label and description changed in Web admin task #1218 C1, and the Jellyfin authenticated browse/play path in #1246 C1 now spends the account budget. Both tasks are currently Not run, so these are pending manual runs, not previously validated results. Keep #1217 C1, which directly exercises throttling.

Suggested line:
Validation tasks: changes #1217 C1; changes #1218 C1; changes #1246 C1

Automated check: Macroscope check run agent (gpt-6-luna). No validation was performed.

Posted via Macroscope — v1 validation impact

The rate-limit row was renamed to "Per address and account", but the
admin settings search still listed it as "Per client address", a label
the page no longer shows.

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

@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 ec1bacb6a. The account budget does what the PR says: in a live run, rotating X-Forwarded-For across two sessions, an API key and device headers went from 24/24 admitted on main to 5/24, both with one process and with two processes sharing Redis, and a second account kept its own allowance. Identity selection holds up: I found no path that charges the account twice, charges it before authentication, or takes the account from anything but a validated credential. Two findings below; one needs a maintainer decision.

Other notes, not diff-line findings:

  • Issue scope. #2364 already caps forwarded-header rotation on sign-in with the per-connection authpeer: budget, which is the scenario #2329 describes. This PR covers authenticated routes, a step beyond that. Closing #2329 on merge is still right because it is resolved, but the PR body should say #2364 fixed the sign-in case. I'm updating the body.
  • Validation tasks. The passed #1196 cases test authorization outcomes far below any throttle, so they don't change. #1217 C1, #1218 C1 and #1246 C1 are affected but not yet run, so the line should be unblocks #1217 C1; unblocks #1218 C1; unblocks #1246 C1. I'm updating the body.
  • Redis outage (low). With Redis unreachable, each limiter check waits about 2 s before failing open. The extra account check raises an authenticated request from about 6.3 s on main to about 8.4 s here. The slow fail-open predates this PR and is filed as #2749.
  • Apple notification display route (low, pre-existing). Its pre-auth limiter spends the global budget for requests that then fail authentication, so the new docs sentence about rejected requests not consuming global capacity does not hold on that route. Filed as #2750; the fix should follow this PR.
  • Success headers (low, disclosed). A successful API-key response still reports the key tier in X-RateLimit-*, so an integration pacing itself on those headers can hit an account 429 it did not see coming. The Risks section already names this.

Reviewed with a multi-agent pass at high effort and a read-only cross-provider round (Codex, gpt-6.1-sol). The live checks ran on base and head binaries against a throwaway database. AI-generated review (Claude Code in T3 Code, claude-opus-5-5).

Comment thread internal/ratelimit/middleware.go Resolved
@silo-kody

silo-kody Bot commented Oct 20, 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 ❌

@Quick104

Copy link
Copy Markdown
Contributor Author

Review summary

Fit: 7/10 · Readiness: 7/10 — conditional (assuming CI is green)

Reviewed head: bd7300e9d (the PR's ec1bacb6a plus one review fix).

Addressed

Open

  • Needs your call: how large the account budget should be, and whether it should keep sharing the per-IP settings. The inline finding has the measurements and three options. At the defaults, a single-address household is unaffected. An integration on the owner's account can spend the whole allowance, though, and on Android a refused media request ends playback.
  • Successful API-key responses still report the key tier in X-RateLimit-*. The Risks section discloses this.

Pre-existing defects found during review, both filed separately and outside this PR's scope:

Verification

  • Focused Go tests for internal/ratelimit and internal/jellycompat pass. Changed-line lint is clean. The two web test files touched by the PR and the fix pass.
  • Live checks ran on main and head binaries against a throwaway database:
    • Rotating forwarding headers across two sessions, an API key and device headers went from 24/24 admitted on main to 5/24, on both the memory backend and two processes sharing Redis. A second account kept its own allowance.
    • At the defaults, four devices on separate addresses at about 5 requests/second each were all admitted.
    • With Redis stopped, requests still fail open.
  • No real playback or client device test was run.

Validated features. #1196 C1/C2 and #1197 C1/C2 are passed and unaffected: they check authorization results at request rates far below any budget. #1217 C1, #1218 C1 and #1246 C1 reach the changed behavior but have no recorded result, so the line is Validation tasks: unblocks #1217 C1; unblocks #1218 C1; unblocks #1246 C1. The validation-impact bot's comment had the right cases but used changes, which the repository reserves for passed cases. Board status could not be read; I read the task issues directly.

User manual. Silo-Server/siloserver.org#257 covers the settings label, defaults and the API key tier note. Nothing more is needed from this review.

Apple and Android. No API shape changes. If the account budget stays shared with integrations (option 3 in the inline finding), Android should retry 429 media loads using Retry-After. That needs an issue in silo-android. Apple's media handling of 429 was not checked.

Fit 7. Bounding what one account can take, independent of proxy headers, suits a server that runs behind proxies and across nodes. It works on both the memory and Redis backends. What holds the score down: it adds a new throttle to every authenticated request, including media, and couples it to the per-address settings, so tuning one silently tunes the other.

Readiness 7. The code is correct and tested, and I found no wrong-account, double-charge or pre-auth path. The open condition is the budget-size decision above, together with the Android 429 behavior it exposes.

Reviewed with a multi-agent pass at high effort and a read-only cross-provider round (Codex, gpt-6.1-sol). AI-generated review: Claude Code in T3 Code, claude-opus-5-5.

@macroscopeapp

macroscopeapp Bot commented Oct 20, 2026

Copy link
Copy Markdown

The settings search label change lacks evidence for the current head. web/src/lib/adminSettingsSearch.ts changes the visible Rate limiting search result from “Per client address” to “Per address and account,” but the Evidence section names captures from da300507d, before this search-index change. Please add before-and-after desktop and phone-width captures of the same admin settings search query and results to the evidence page.

Automated check: Macroscope check run agent (gpt-6-luna). Evidence was not reviewed for correctness.

Posted via Macroscope — Visible change evidence

@macroscopeapp

macroscopeapp Bot commented Oct 20, 2026

Copy link
Copy Markdown

7 cases examined; most severe classification: major change.

task case surface validated build classification reason
silo-server#1217 C1 Server Not run Major change The new account bucket changes the rate-limit and global-interaction behavior under test.
silo-server#1218 C1 Web admin Not run Major change The IP settings now govern a shared account budget; the admin label and description also changed.
silo-server#1246 C1 Jellyfin compatibility Not run Major change Authenticated Jellyfin browse/play now charges the owner's shared account budget.
silo-server#1196 C1 Server 7cc2c1f2 No behavior change Policy precedence and enforcement are tested, not rate throttling; their requests do not exercise the new threshold.
silo-server#1196 C2 Server 7cc2c1f2 No behavior change Authorization stays unchanged; public invitation acceptance has no authenticated account identity.
silo-server#1197 C1 Web admin 807 · d4e35ba9 No behavior change Admin forms and policy checks do not exercise the new request-rate threshold.
silo-server#1197 C2 Web admin 807 · d4e35ba9 No behavior change Membership checks remain unchanged; public invitation acceptance does not spend an account budget.

The three major-change cases are currently Not run, so they need initial manual runs on a merged build, not re-validation or unblocking. The PR should explain how the shared account allowance changes these case paths. None is failed or blocked, so unblocks is inaccurate.

Validation tasks: changes #1217 C1; changes #1218 C1; changes #1246 C1

Automated check: Macroscope check run agent (gpt-6-luna). No validation was performed.

Posted via Macroscope — v1 validation impact

One login often spans several networks, and each address is already held
to one per-address budget. Sizing the shared account allowance at the
same budget let one busy address or integration spend the whole account
and refuse playback on the account's other networks. Four address
budgets (480/s, 24000/min, burst 480 at the defaults) keep any single
address to a quarter of its account while still bounding a client that
rotates forwarding headers.

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

silo-kody Bot commented Oct 20, 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 ❌

@macroscopeapp

macroscopeapp Bot commented Oct 20, 2026

Copy link
Copy Markdown

The linked evidence predates the latest visible changes:

  • internal/ratelimit/middleware.go: head fb356e8 raises the shared account allowance to four times the per-address settings, while the evidence identifies da300507 as the implementation. Please add before-and-after API response excerpts for the current head and base that show the account-threshold behavior.
  • web/src/pages/admin-settings/SecurityAccessSettings.tsx: head changes the visible description to say the account budget is four times larger, but the cited desktop and phone captures are from da300507. Please add current-head desktop and phone-width captures of the same settings screen.

Suggested fix: No diff — update the evidence page with results and captures from the current head.

Automated check: Macroscope check run agent (gpt-6-luna). Evidence was not reviewed for correctness.

Posted via Macroscope — Visible change evidence

@macroscopeapp

macroscopeapp Bot commented Oct 20, 2026

Copy link
Copy Markdown

The three cases listed in Validation tasks: are Not run in their task results; none is failed or blocked, so unblocks is inaccurate. These are major changes to the rate-limit, admin-settings, and authenticated Jellyfin browse/play paths. The PR should explain their case impact; because the results are Not run, these cases need initial manual runs on a merged build, not re-validation.

task case surface validated build classification reason
silo-server#1217 C1 Server Not run Major change Adds an account-wide throttle to the rate-limit behavior this case exercises.
silo-server#1218 C1 Web admin Not run Major change The configured address limits now also govern a shared account allowance; the row label and description changed.
silo-server#1246 C1 Jellyfin compatibility Not run Major change Authenticated compat browse/play requests now spend the owner's shared account allowance.
silo-server#1196 C1 Server 7cc2c1f2 No behavior change Tests policy precedence and enforcement; it does not exercise a rate threshold.
silo-server#1196 C2 Server 7cc2c1f2 No behavior change Authorization and group-policy outcomes are unchanged; invitation acceptance has no authenticated account identity.
silo-server#1197 C1 Web admin 807 · d4e35ba9 No behavior change Forms and policy outcomes are unchanged; this case does not test rate limiting.
silo-server#1197 C2 Web admin 807 · d4e35ba9 No behavior change Membership and invitation checks do not exercise request-rate thresholds.

Suggested fix:
Validation tasks: changes #1217 C1; changes #1218 C1; changes #1246 C1

Automated check: Macroscope check run agent (gpt-6-luna). No validation was performed.

Posted via Macroscope — v1 validation impact

@Quick104

Copy link
Copy Markdown
Contributor Author

Review summary for fb356e878

Addressed

  • Account budget size (needs-your-call thread, now decided): the account allowance is four per-IP budgets (480/s, 24000/min, burst 480 at the defaults) instead of one. On an isolated deployment with scaled limits, a device on a second network kept 180/180 requests while an integration ran near its address limit on the same account. Before, the device was refused from 60 s. Header rotation stays bounded: 101 of 300 requests admitted, against 25 at the old size.
  • Admin settings search label, fixed earlier in bd7300e9d.

Remaining

Validated features: #1217 C1, #1218 C1 and #1246 C1 can be reached but have not been run. The passed #1196 cases test authorization far below any throttle and are unaffected.

User manual: Silo-Server/siloserver.org#257 is updated for the four-times sizing. Its prepared docs branch predates the change and needs the same update before its draft PR opens.

Apple and Android: the API contract is unchanged (same 429 shape and Retry-After). Neither app retries a 429 on media loads; that is a client follow-up and does not block this PR.

Fit: 9/10 · Readiness: 8/10 — conditional

  • Fit: it closes the authenticated-route half of [bug] A direct client in a trusted proxy range can bypass per-IP sign-in limits #2329 inside the existing rate limiter. It adds no setting: the account size follows the per-IP settings, as the sign-in peer budget already does. The cost is one more counter check per authenticated request.
  • Readiness: the approach is sound, CI is green, and the behavior was checked live before and after. It stays conditional until someone plays media on a real client against these limits.

AI-generated review (Claude Code in T3 Code, claude-opus-5-5).

@Quick104
Quick104 merged commit 7093814 into main Oct 20, 2026
22 checks passed
@Quick104
Quick104 deleted the fix/account-shared-rate-limit branch October 20, 2026 23:24
zZebrahz added a commit to Silo-Server/siloserver.org that referenced this pull request Nov 1, 2026
* docs: explain the shared account request allowance


* docs: size the shared account allowance at four address budgets

Silo-Server/silo-server#2719 sized the account allowance at four times the per-address settings. Correct the defaults, explain the four-times size, and give the API key rate limit its own section.

---------

Co-authored-by: Quick104 <[email protected]>
Co-authored-by: zZebrahz <[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: P1 Core-path bug; painful workaround — next after P0 size/XL 500–999 added + deleted lines (all files); change volume, not priority.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[bug] A direct client in a trusted proxy range can bypass per-IP sign-in limits

1 participant