Skip to content

feat(httproute): read the request's viewer from host headers - #62

Merged
Quick104 merged 1 commit into
mainfrom
feat/http-route-viewer
Nov 18, 2026
Merged

Quick104 merged 1 commit into
mainfrom
feat/http-route-viewer

Conversation

@Quick104

@Quick104 Quick104 commented Nov 5, 2026 •

Copy link
Copy Markdown
Contributor

Problem

http_routes.v1 handlers parse X-Silo-User-Id, X-Silo-Profile-Id and the other viewer headers
by hand, and each plugin handles letter case and missing headers a little differently.

Approach

httproute.ViewerOf(req) returns the signed-in account, its role, the verified profile and the
display names, and reports false for a request with no signed-in account. Header lookups ignore
case.

Compatibility and release

Additive Go API; no proto or host change.

Related changes

Validation

  • go test ./..., go vet ./... and every example build: pass.
  • gofmt -l . lists only pkg/pluginsdk/runtime/scan_source_test.go, which is unformatted on main
    and not touched here.
  • Regenerating the protobuf code with the repo's buf leaves it unchanged. make proto itself stops
    at its protoc check on this machine, though generation doesn't use protoc.
  • On shared dev, a test plugin's route read the signed-in administrator and verified profile through
    ViewerOf.

AI Disclosure

  • Harness: Claude Code, run from T3 Code
  • Tool(s): Claude Code (implementation); Codex CLI (independent review)
  • Model(s): claude-opus-5-5 (implementation); gpt-6.1-sol (review)
  • Involvement: Fully AI-generated, human verified
  • Adversarial review: the same Codex (gpt-6.1-sol) review; no findings on this change.
  • Later review (2026-11-18): Claude Code (claude-fable-5-2) rebased this onto main and applied the fixes; claude-opus-5-5 and gpt-6.2-sol (Codex) each reviewed it independently. No findings on this change.

🤖 Generated with Claude Code

Note

Add httproute.ViewerOf to read the signed-in viewer from host headers

  • New httproute package in the plugin SDK reads viewer info that the host supplies as headers on http_routes.v1 requests (viewer.go)
  • ViewerOf parses the user ID, role, username, profile, and theme headers into a Viewer struct. It returns an empty Viewer with false when the user ID is missing, malformed, or non-positive
  • Only the exact role value "admin" sets admin status; only the exact value "true" sets profile-primary status
  • Header matches header names case-insensitively and trims surrounding whitespace from values
  • Documented the new package in README.md

Macroscope summarized 9ef5528.

@coderabbitai

coderabbitai Bot commented Nov 5, 2026 •

Copy link
Copy Markdown

Explain Change →

Caution

Review failed

The pull request is closed.

  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 5, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-18T18:43:24.511053Z 9ef5528 New commits
🔒 Security Review ✅ Completed 2026-11-18T18:45:55.630904Z 9ef5528 New commits
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@silo-triage silo-triage Bot added the size/M 50–199 added + deleted lines (all files); change volume, not priority. label Nov 5, 2026
@silo-kody

silo-kody Bot commented Nov 5, 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 ❌

Comment thread pkg/pluginsdk/httproute/viewer.go Resolved
http_routes.v1 handlers parse X-Silo-User-Id, X-Silo-Profile-Id and the
other viewer headers by hand. Add httproute.ViewerOf, which returns the
signed-in account, its role, the verified profile and display names, and
reports false for a request with no signed-in account. Header lookups
ignore case.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@Quick104
Quick104 force-pushed the feat/http-route-viewer branch from c197359 to 9ef5528 Compare November 18, 2026 18:42
@silo-kody

silo-kody Bot commented Nov 18, 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 ❌
⚠️ 3 Kody Rule(s) were not evaluated

These rules declare that they need repository context beyond this diff, and the review could not retrieve it, so they were not judged on this pull request:

  • Share optional authentication service resolution across interface types
  • Find the last complete-line boundary with bounded memory
  • Identify the actual first SDK release containing new Go APIs

@Quick104
Quick104 merged commit 9b5b81d into main Nov 18, 2026
3 checks passed
@Quick104
Quick104 deleted the feat/http-route-viewer branch November 18, 2026 18:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request go Pull requests that update go code size/M 50–199 added + deleted lines (all files); change volume, not priority.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant