Repository navigation
feat(http): per-user OAuth resource server mode - #1
Merged
Merged
Conversation
MCP_AUTH_MODE=oauth makes the HTTP transport an OAuth resource server per the MCP authorization spec: protected resource metadata, Bearer challenges, and JWT validation against MCP_OAUTH_ISSUER with this server's URL as the required audience. Each verified token is exchanged (RFC 8693) for a BookStack API token, so BookStack acts as the signed-in user; the inbound token is never forwarded.
gusocegodk
force-pushed
the
feat/oauth-resource-server
branch
from
October 6, 2026 09:16
4dc536f to
8520130
Compare
A v* tag (pushed, or dispatched for tags release-please created) checks the tag against package.json, builds the image, runs the image smoke suite against it and only then pushes it to GHCR with provenance and an SBOM.
Image tags are now v<package.json version>-r<N>, so changes on top of the same package version can be re-released, and plain vX.Y.Z tags build nothing. The release version is baked in as SERVER_VERSION and the image smoke suite asserts the version the container reports.
gusocegodk
marked this pull request as ready for review
October 6, 2026 09:31
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
MCP_AUTH_MODE=oauthlets each user sign in with an OIDC provider, and BookStack then acts as that user instead of one shared API token.401with aWWW-Authenticatechallenge. It checks each JWT's signature against the issuer's published keys, plusiss,exp,sub, the token type, and anaudnaming this server.Authorization: Bearer. The token the MCP client sent is never forwarded.MCP_AUTH_TOKEN,BOOKSTACK_API_TOKEN,BOOKSTACK_UPLOAD_ROOTand thex-bookstack-*overrides./healthchecks issuer discovery and that BookStack answers at all.v<version>-r<revision>tag (e.g.v2.1.0-r1) builds the Docker image, runs the image smoke suite against it, and pushesghcr.io/<owner>/bookstack-mcp-server:2.1.0-r1with provenance and an SBOM.<version>must matchpackage.json, and the image reports the full version.Needs BookStack with OIDC access-token API auth (https://codeberg.org/bookstack/bookstack/pulls/6237).
Testing
tests/unit/oauth-*,tests/unit/token-exchange.test.tsandtests/transport/oauth.test.tsrun against an RS256-signing OIDC stub.