docs: add MCP OAuth documentation and fix lint
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -1,9 +1,9 @@
|
||||
import { createHash, randomBytes } from "node:crypto";
|
||||
import { beforeEach, describe, expect, it } from "bun:test";
|
||||
import { createHash, randomBytes } from "node:crypto";
|
||||
import { Hono } from "hono";
|
||||
import { createUser } from "../../src/server/services/auth.service.ts";
|
||||
import { oauthRoutes, wellKnownRoute } from "../../src/server/routes/oauth.ts";
|
||||
import { mcpRoutes } from "../../src/server/mcp/index.ts";
|
||||
import { oauthRoutes, wellKnownRoute } from "../../src/server/routes/oauth.ts";
|
||||
import { createUser } from "../../src/server/services/auth.service.ts";
|
||||
import { createTestDb } from "../helpers/db.ts";
|
||||
|
||||
function createTestApp() {
|
||||
@@ -59,7 +59,10 @@ describe("OAuth Routes", () => {
|
||||
expect(body.token_endpoint).toContain("/oauth/token");
|
||||
expect(body.registration_endpoint).toContain("/oauth/register");
|
||||
expect(body.response_types_supported).toEqual(["code"]);
|
||||
expect(body.grant_types_supported).toEqual(["authorization_code", "refresh_token"]);
|
||||
expect(body.grant_types_supported).toEqual([
|
||||
"authorization_code",
|
||||
"refresh_token",
|
||||
]);
|
||||
expect(body.code_challenge_methods_supported).toEqual(["S256"]);
|
||||
expect(body.token_endpoint_auth_methods_supported).toEqual(["none"]);
|
||||
});
|
||||
@@ -276,7 +279,9 @@ describe("OAuth Routes", () => {
|
||||
}).toString(),
|
||||
},
|
||||
);
|
||||
const code = new URL(authRes.headers.get("location")!).searchParams.get("code")!;
|
||||
const code = new URL(authRes.headers.get("location")!).searchParams.get(
|
||||
"code",
|
||||
)!;
|
||||
|
||||
// 3. Exchange code for tokens
|
||||
const tokenRes = await app.request("/oauth/token", {
|
||||
|
||||
Reference in New Issue
Block a user