Repository navigation
feat(jellycompat): sign Jellyfin apps in with Quick Connect - #2339
Conversation
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
…k-connect Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 35 minutes. View limit details
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. Comment |
Silo Kody — review completeReview finished. Check the inline comments for findings and verify each suggestion against the code and tests. Reviewing changes in Silo
Review settingsReview OptionsThe following review options are enabled or disabled:
|
Quick104
left a comment
There was a problem hiding this comment.
Adversarial review (gpt-6.1-sol, reviewed ffd7d2c)
One P2 finding on recovery after Quick Connect collection. Focused Go checks passed. Failure injection exercised the production compat resolver and handler with a one-shot collector double; the database commit order was verified from source. PostgreSQL tests skipped because no test database was configured. Web tests could not start because Vitest was unavailable, and native Jellyfin apps were not exercised.
AI-generated review: Codex (gpt-6.1-sol) in T3 Code, requested by the PR's automated run.
… session is stored Co-Authored-By: Claude Opus 5.5 <[email protected]>
…h a moved request after decline Co-Authored-By: Claude Opus 5.5 <[email protected]>
Silo Kody — review completeReview finished. Check the inline comments for findings and verify each suggestion against the code and tests. Reviewing changes in Silo
Review settingsReview OptionsThe following review options are enabled or disabled:
|
Problem
Closes #2144
Related issue: N/A
Validation tasks: none
Jellyfin apps can't use Quick Connect with Silo.
/QuickConnect/Enabledanswersfalseand the other Quick Connect routes don't exist, so people type a password with a TV remote and pick a profile with theusername#profile/password#pinsyntax. An account without a Silo password, such as one that signs in only through SSO, can't sign in from a Jellyfin app at all.This adds Jellyfin's Quick Connect on top of Silo's device sign-in. The Jellyfin app shows a six-digit code, and the person approves it where they are signed in to Silo (the
/activatepage, or a Jellyfin app that is already signed in), choosing which profile the app uses.Approach
client_purpose,jellyfin_quick_connect; the migration only widens the CHECK constraint. It shares device sign-in's lifetimes, opened hold, states, revocation and multi-node behavior, with all state in Postgres./QuickConnect/Enabled,/QuickConnect/Initiate(POST, and GET for Jellyfin 10.8 apps),/QuickConnect/Connect,/QuickConnect/Authorize, and theAuthenticateWithQuickConnectsign-in underUsers. Collecting an approved request mints a compat session the way password sign-in does, bound to the approved profile. That session is written in the transaction that consumes the request, and asking again with the same secret while the request lives returns the same session, as Jellyfin does, so an app that lost the answer can still sign in.Connectcan return it on every poll (Jellyfin's Android TV app redraws the code from the poll) while the server keeps storing codes only as hashes.approve-handoff, whose profile comes from the verifiedX-Profile-IdandX-Profile-Token, so a PIN-protected profile needs its PIN. A signed-in Jellyfin app approves with/QuickConnect/Authorizefor its own profile.approveanswers 409 for these requests, and the native poll never collects them, since a native session could pick any profile.getDeviceLoginstays public but now reads a bearer token when one is sent (a newAttachSessiongate): without a valid one a six-digit lookup answers 401, from an impersonation session 403, the same for every code. Every six-digit lookup or decision also spends a per-account budget of 20 per 15 minutes, kept in Redis when the server has it, on top of the per-addressdevice_lookupbudget. The frozen/api/v1routes never see a Quick Connect request./api/v2changes are additive:jellyfin_quick_connectin the device capability, the newclient_purposevalue, 401/403/429 on the lookup for six-digit codes, andapprove-handoffaccepting Quick Connect requests./activatepage takes six-digit codes, asks a signed-out person to sign in first, and for a Quick Connect request lists the account's profiles with a PIN field for protected ones. It doesn't re-read a Quick Connect request after a decision, because each lookup spends the budget.docs/jellycompat-api.md,docs/architecture/device-login.md,docs/auth-api.md.Validation
AttachSession. Postgres tests cover start, approval and collection, the budget, deny and expiry, two nodes, approval from a Jellyfin session, expired codes being freed, the temporary-password refusal, and a failed session write leaving the request collectable, alongside the existing device sign-in, provider re-check and password-change database tests. All pass./activateflows: six-digit entry, sign-in first, profile and PIN approval, wrong PIN, PIN lockout, declining, impersonation and the rate limit. All pass.internal/mediasample's real-FFmpeg tests, which fail the same way on main in this environment.Enabledansweredfalse,Initiate404, and an account with local password sign-in turned off got 401 fromAuthenticateByName./activatefor a PIN-protected profile, and the stored compat session was bound to that profile. A repeated exchange returned the same session, and after sign-out the secret got 404.Retry-After.Connectcomes from its source.Evidence
Evidence: https://evidence.siloserver.org/r/silo-server/issue-2144/
Risks
device_startbudget. Many addresses could fill a noticeable share of the six-digit space while their requests live, which makes a mistyped code more likely to land on someone else's request. The approval card shows the device, its app, when it asked and its masked address. Eight-digit codes derived the same way would remove the six-digit special handling (Jellyfin Web accepts longer codes); this keeps Jellyfin's six digits.approveand get 409./activateworks in a phone browser meanwhile.getDeviceLoginnow checks a bearer token when one is sent, one session read, as on any authenticated route.Follow-ups: Apple and Android approval of Quick Connect codes.
User manual: Silo-Server/siloserver.org#184, draft docs PR Silo-Server/siloserver.org#185
Checklist
AI Disclosure
🤖 Generated with Claude Code