fix(auth): use Header() instead of APIKeyHeader for WS compat#26
Merged
Leolebleis merged 1 commit intomainfrom May 2, 2026
Merged
fix(auth): use Header() instead of APIKeyHeader for WS compat#26Leolebleis merged 1 commit intomainfrom
Leolebleis merged 1 commit intomainfrom
Conversation
Security(APIKeyHeader) only works on HTTP routes — its __call__ requires a Request object that WebSocket routes don't pass, causing a 500 with "APIKeyHeader.__call__() missing 1 required positional argument: 'request'" on the terminal WS endpoint. Header() works on both transports. Trade-off: OpenAPI docs lose the security scheme annotation; auth still enforced identically. Also: pre-create /home/appuser/.claude in the image so the named volume inherits appuser ownership when Docker first populates it from the image. Without this the empty mount point is root-owned and 'claude login' can't write OAuth tokens.
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.
Summary
Brew terminal WS endpoint was 500'ing with `APIKeyHeader.call() missing 1 required positional argument: 'request'`. `fastapi.security.APIKeyHeader` only works on HTTP routes; `Header()` works on both HTTP and WS.
Bonus: Dockerfile now pre-creates `/home/appuser/.claude` so the named volume inherits appuser ownership when Docker first copies it from the image — otherwise the empty mount point is root-owned and `claude login` can't write OAuth tokens.
Test plan