feat(server): runtime-neutral requireBearerAuth for web-standard hosts (#2420)
This commit is contained in:
parent
79dc162efc
commit
7635115d01
1 changed files with 595 additions and 129 deletions
15
.changeset/web-standard-bearer-auth.md
Normal file
15
.changeset/web-standard-bearer-auth.md
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
---
|
||||
'@modelcontextprotocol/server': minor
|
||||
'@modelcontextprotocol/express': patch
|
||||
'@modelcontextprotocol/codemod': patch
|
||||
---
|
||||
|
||||
Add runtime-neutral Bearer authentication to `@modelcontextprotocol/server`:
|
||||
`requireBearerAuth` gates web-standard `fetch(request)` hosts (Cloudflare
|
||||
Workers, Deno, Bun, Hono), built on the exported `verifyBearerToken` and
|
||||
`bearerAuthChallengeResponse` pieces, with `OAuthTokenVerifier` now defined
|
||||
here. The Express middleware adapts the same core and is unchanged in
|
||||
behavior, except that `WWW-Authenticate` challenge values are now RFC 7235
|
||||
quoted-string sanitized (quotes and backslashes escaped, control and
|
||||
non-ASCII characters replaced); `@modelcontextprotocol/express` re-exports
|
||||
`OAuthTokenVerifier` as before.
|
||||
Loading…
Reference in a new issue