feat(planning): grille hebdomadaire complète avec API et filtres
- Connexion API via proxy Angular (résolution CORS, base path /api) - Import CSS ng-zorro global pour les modales et composants - Filtres Camion/Show câblés sur l'affichage de la grille - Camions affichés via TrucksService (linkés au show du même créneau) - Panneau de détails : spectacles + camions du jour sélectionné - Modale de création de spectacle stylisée avec fond et centrage - Positionnement précis des events à la minute dans leur créneau - Auto-scroll vers l'heure courante au chargement - Ligne "maintenant" sur la colonne du jour actuel - Régénération des services OpenAPI (nouveaux noms de types) Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Generated
Vendored
+3
-3
@@ -1,6 +1,6 @@
|
||||
import { RequestHandler } from 'express';
|
||||
import { OAuthServerProvider } from '../provider.js';
|
||||
import { Options as RateLimitOptions } from 'express-rate-limit';
|
||||
import { RequestHandler } from "express";
|
||||
import { OAuthServerProvider } from "../provider.js";
|
||||
import { Options as RateLimitOptions } from "express-rate-limit";
|
||||
export type AuthorizationHandlerOptions = {
|
||||
provider: OAuthServerProvider;
|
||||
/**
|
||||
|
||||
Generated
Vendored
+1
-1
@@ -1 +1 @@
|
||||
{"version":3,"file":"authorize.d.ts","sourceRoot":"","sources":["../../../../../src/server/auth/handlers/authorize.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AAGzC,OAAO,EAAE,mBAAmB,EAAE,MAAM,gBAAgB,CAAC;AACrD,OAAO,EAAa,OAAO,IAAI,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAI5E,MAAM,MAAM,2BAA2B,GAAG;IACtC,QAAQ,EAAE,mBAAmB,CAAC;IAC9B;;;OAGG;IACH,SAAS,CAAC,EAAE,OAAO,CAAC,gBAAgB,CAAC,GAAG,KAAK,CAAC;CACjD,CAAC;AAqBF,wBAAgB,oBAAoB,CAAC,EAAE,QAAQ,EAAE,SAAS,EAAE,eAAe,EAAE,EAAE,2BAA2B,GAAG,cAAc,CAgH1H"}
|
||||
{"version":3,"file":"authorize.d.ts","sourceRoot":"","sources":["../../../../../src/server/auth/handlers/authorize.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AAGzC,OAAO,EAAE,mBAAmB,EAAE,MAAM,gBAAgB,CAAC;AACrD,OAAO,EAAa,OAAO,IAAI,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAW5E,MAAM,MAAM,2BAA2B,GAAG;IACxC,QAAQ,EAAE,mBAAmB,CAAC;IAC9B;;;OAGG;IACH,SAAS,CAAC,EAAE,OAAO,CAAC,gBAAgB,CAAC,GAAG,KAAK,CAAC;CAC/C,CAAC;AAkBF,wBAAgB,oBAAoB,CAAC,EAAE,QAAQ,EAAE,SAAS,EAAE,eAAe,EAAE,EAAE,2BAA2B,GAAG,cAAc,CAkH1H"}
|
||||
Generated
Vendored
+32
-50
@@ -1,58 +1,32 @@
|
||||
"use strict";
|
||||
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
||||
if (k2 === undefined) k2 = k;
|
||||
var desc = Object.getOwnPropertyDescriptor(m, k);
|
||||
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
||||
desc = { enumerable: true, get: function() { return m[k]; } };
|
||||
}
|
||||
Object.defineProperty(o, k2, desc);
|
||||
}) : (function(o, m, k, k2) {
|
||||
if (k2 === undefined) k2 = k;
|
||||
o[k2] = m[k];
|
||||
}));
|
||||
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
||||
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
||||
}) : function(o, v) {
|
||||
o["default"] = v;
|
||||
});
|
||||
var __importStar = (this && this.__importStar) || function (mod) {
|
||||
if (mod && mod.__esModule) return mod;
|
||||
var result = {};
|
||||
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
||||
__setModuleDefault(result, mod);
|
||||
return result;
|
||||
};
|
||||
var __importDefault = (this && this.__importDefault) || function (mod) {
|
||||
return (mod && mod.__esModule) ? mod : { "default": mod };
|
||||
};
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.authorizationHandler = authorizationHandler;
|
||||
const z = __importStar(require("zod/v4"));
|
||||
const zod_1 = require("zod");
|
||||
const express_1 = __importDefault(require("express"));
|
||||
const express_rate_limit_1 = require("express-rate-limit");
|
||||
const allowedMethods_js_1 = require("../middleware/allowedMethods.js");
|
||||
const errors_js_1 = require("../errors.js");
|
||||
// Parameters that must be validated in order to issue redirects.
|
||||
const ClientAuthorizationParamsSchema = z.object({
|
||||
client_id: z.string(),
|
||||
redirect_uri: z
|
||||
.string()
|
||||
.optional()
|
||||
.refine(value => value === undefined || URL.canParse(value), { message: 'redirect_uri must be a valid URL' })
|
||||
const ClientAuthorizationParamsSchema = zod_1.z.object({
|
||||
client_id: zod_1.z.string(),
|
||||
redirect_uri: zod_1.z.string().optional().refine((value) => value === undefined || URL.canParse(value), { message: "redirect_uri must be a valid URL" }),
|
||||
});
|
||||
// Parameters that must be validated for a successful authorization request. Failure can be reported to the redirect URI.
|
||||
const RequestAuthorizationParamsSchema = z.object({
|
||||
response_type: z.literal('code'),
|
||||
code_challenge: z.string(),
|
||||
code_challenge_method: z.literal('S256'),
|
||||
scope: z.string().optional(),
|
||||
state: z.string().optional(),
|
||||
resource: z.string().url().optional()
|
||||
const RequestAuthorizationParamsSchema = zod_1.z.object({
|
||||
response_type: zod_1.z.literal("code"),
|
||||
code_challenge: zod_1.z.string(),
|
||||
code_challenge_method: zod_1.z.literal("S256"),
|
||||
scope: zod_1.z.string().optional(),
|
||||
state: zod_1.z.string().optional(),
|
||||
resource: zod_1.z.string().url().optional(),
|
||||
});
|
||||
function authorizationHandler({ provider, rateLimit: rateLimitConfig }) {
|
||||
// Create a router to apply middleware
|
||||
const router = express_1.default.Router();
|
||||
router.use((0, allowedMethods_js_1.allowedMethods)(['GET', 'POST']));
|
||||
router.use((0, allowedMethods_js_1.allowedMethods)(["GET", "POST"]));
|
||||
router.use(express_1.default.urlencoded({ extended: false }));
|
||||
// Apply rate limiting unless explicitly disabled
|
||||
if (rateLimitConfig !== false) {
|
||||
@@ -65,7 +39,8 @@ function authorizationHandler({ provider, rateLimit: rateLimitConfig }) {
|
||||
...rateLimitConfig
|
||||
}));
|
||||
}
|
||||
router.all('/', async (req, res) => {
|
||||
router.all("/", async (req, res) => {
|
||||
var _a;
|
||||
res.setHeader('Cache-Control', 'no-store');
|
||||
// In the authorization flow, errors are split into two categories:
|
||||
// 1. Pre-redirect errors (direct response with 400)
|
||||
@@ -81,18 +56,18 @@ function authorizationHandler({ provider, rateLimit: rateLimitConfig }) {
|
||||
redirect_uri = result.data.redirect_uri;
|
||||
client = await provider.clientsStore.getClient(client_id);
|
||||
if (!client) {
|
||||
throw new errors_js_1.InvalidClientError('Invalid client_id');
|
||||
throw new errors_js_1.InvalidClientError("Invalid client_id");
|
||||
}
|
||||
if (redirect_uri !== undefined) {
|
||||
if (!client.redirect_uris.includes(redirect_uri)) {
|
||||
throw new errors_js_1.InvalidRequestError('Unregistered redirect_uri');
|
||||
throw new errors_js_1.InvalidRequestError("Unregistered redirect_uri");
|
||||
}
|
||||
}
|
||||
else if (client.redirect_uris.length === 1) {
|
||||
redirect_uri = client.redirect_uris[0];
|
||||
}
|
||||
else {
|
||||
throw new errors_js_1.InvalidRequestError('redirect_uri must be specified when client has multiple registered URIs');
|
||||
throw new errors_js_1.InvalidRequestError("redirect_uri must be specified when client has multiple registered URIs");
|
||||
}
|
||||
}
|
||||
catch (error) {
|
||||
@@ -107,7 +82,7 @@ function authorizationHandler({ provider, rateLimit: rateLimitConfig }) {
|
||||
res.status(status).json(error.toResponseObject());
|
||||
}
|
||||
else {
|
||||
const serverError = new errors_js_1.ServerError('Internal Server Error');
|
||||
const serverError = new errors_js_1.ServerError("Internal Server Error");
|
||||
res.status(500).json(serverError.toResponseObject());
|
||||
}
|
||||
return;
|
||||
@@ -125,7 +100,14 @@ function authorizationHandler({ provider, rateLimit: rateLimitConfig }) {
|
||||
// Validate scopes
|
||||
let requestedScopes = [];
|
||||
if (scope !== undefined) {
|
||||
requestedScopes = scope.split(' ');
|
||||
requestedScopes = scope.split(" ");
|
||||
const allowedScopes = new Set((_a = client.scope) === null || _a === void 0 ? void 0 : _a.split(" "));
|
||||
// Check each requested scope against allowed scopes
|
||||
for (const scope of requestedScopes) {
|
||||
if (!allowedScopes.has(scope)) {
|
||||
throw new errors_js_1.InvalidScopeError(`Client was not registered with scope ${scope}`);
|
||||
}
|
||||
}
|
||||
}
|
||||
// All validation passed, proceed with authorization
|
||||
await provider.authorize(client, {
|
||||
@@ -133,7 +115,7 @@ function authorizationHandler({ provider, rateLimit: rateLimitConfig }) {
|
||||
scopes: requestedScopes,
|
||||
redirectUri: redirect_uri,
|
||||
codeChallenge: code_challenge,
|
||||
resource: resource ? new URL(resource) : undefined
|
||||
resource: resource ? new URL(resource) : undefined,
|
||||
}, res);
|
||||
}
|
||||
catch (error) {
|
||||
@@ -142,7 +124,7 @@ function authorizationHandler({ provider, rateLimit: rateLimitConfig }) {
|
||||
res.redirect(302, createErrorRedirect(redirect_uri, error, state));
|
||||
}
|
||||
else {
|
||||
const serverError = new errors_js_1.ServerError('Internal Server Error');
|
||||
const serverError = new errors_js_1.ServerError("Internal Server Error");
|
||||
res.redirect(302, createErrorRedirect(redirect_uri, serverError, state));
|
||||
}
|
||||
}
|
||||
@@ -154,13 +136,13 @@ function authorizationHandler({ provider, rateLimit: rateLimitConfig }) {
|
||||
*/
|
||||
function createErrorRedirect(redirectUri, error, state) {
|
||||
const errorUrl = new URL(redirectUri);
|
||||
errorUrl.searchParams.set('error', error.errorCode);
|
||||
errorUrl.searchParams.set('error_description', error.message);
|
||||
errorUrl.searchParams.set("error", error.errorCode);
|
||||
errorUrl.searchParams.set("error_description", error.message);
|
||||
if (error.errorUri) {
|
||||
errorUrl.searchParams.set('error_uri', error.errorUri);
|
||||
errorUrl.searchParams.set("error_uri", error.errorUri);
|
||||
}
|
||||
if (state) {
|
||||
errorUrl.searchParams.set('state', state);
|
||||
errorUrl.searchParams.set("state", state);
|
||||
}
|
||||
return errorUrl.href;
|
||||
}
|
||||
|
||||
Generated
Vendored
+1
-1
File diff suppressed because one or more lines are too long
Generated
Vendored
+2
-2
@@ -1,4 +1,4 @@
|
||||
import { RequestHandler } from 'express';
|
||||
import { OAuthMetadata, OAuthProtectedResourceMetadata } from '../../../shared/auth.js';
|
||||
import { RequestHandler } from "express";
|
||||
import { OAuthMetadata, OAuthProtectedResourceMetadata } from "../../../shared/auth.js";
|
||||
export declare function metadataHandler(metadata: OAuthMetadata | OAuthProtectedResourceMetadata): RequestHandler;
|
||||
//# sourceMappingURL=metadata.d.ts.map
|
||||
+2
-2
@@ -12,8 +12,8 @@ function metadataHandler(metadata) {
|
||||
const router = express_1.default.Router();
|
||||
// Configure CORS to allow any origin, to make accessible to web-based MCP clients
|
||||
router.use((0, cors_1.default)());
|
||||
router.use((0, allowedMethods_js_1.allowedMethods)(['GET', 'OPTIONS']));
|
||||
router.get('/', (req, res) => {
|
||||
router.use((0, allowedMethods_js_1.allowedMethods)(['GET']));
|
||||
router.get("/", (req, res) => {
|
||||
res.status(200).json(metadata);
|
||||
});
|
||||
return router;
|
||||
|
||||
Generated
Vendored
+1
-1
@@ -1 +1 @@
|
||||
{"version":3,"file":"metadata.js","sourceRoot":"","sources":["../../../../../src/server/auth/handlers/metadata.ts"],"names":[],"mappings":";;;;;AAKA,0CAaC;AAlBD,sDAAkD;AAElD,gDAAwB;AACxB,uEAAiE;AAEjE,SAAgB,eAAe,CAAC,QAAwD;IACpF,wEAAwE;IACxE,MAAM,MAAM,GAAG,iBAAO,CAAC,MAAM,EAAE,CAAC;IAEhC,kFAAkF;IAClF,MAAM,CAAC,GAAG,CAAC,IAAA,cAAI,GAAE,CAAC,CAAC;IAEnB,MAAM,CAAC,GAAG,CAAC,IAAA,kCAAc,EAAC,CAAC,KAAK,EAAE,SAAS,CAAC,CAAC,CAAC,CAAC;IAC/C,MAAM,CAAC,GAAG,CAAC,GAAG,EAAE,CAAC,GAAG,EAAE,GAAG,EAAE,EAAE;QACzB,GAAG,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;IACnC,CAAC,CAAC,CAAC;IAEH,OAAO,MAAM,CAAC;AAClB,CAAC"}
|
||||
{"version":3,"file":"metadata.js","sourceRoot":"","sources":["../../../../../src/server/auth/handlers/metadata.ts"],"names":[],"mappings":";;;;;AAKA,0CAaC;AAlBD,sDAAkD;AAElD,gDAAwB;AACxB,uEAAiE;AAEjE,SAAgB,eAAe,CAAC,QAAwD;IACtF,wEAAwE;IACxE,MAAM,MAAM,GAAG,iBAAO,CAAC,MAAM,EAAE,CAAC;IAEhC,kFAAkF;IAClF,MAAM,CAAC,GAAG,CAAC,IAAA,cAAI,GAAE,CAAC,CAAC;IAEnB,MAAM,CAAC,GAAG,CAAC,IAAA,kCAAc,EAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;IACpC,MAAM,CAAC,GAAG,CAAC,GAAG,EAAE,CAAC,GAAG,EAAE,GAAG,EAAE,EAAE;QAC3B,GAAG,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;IACjC,CAAC,CAAC,CAAC;IAEH,OAAO,MAAM,CAAC;AAChB,CAAC"}
|
||||
Generated
Vendored
+4
-4
@@ -1,6 +1,6 @@
|
||||
import { RequestHandler } from 'express';
|
||||
import { OAuthRegisteredClientsStore } from '../clients.js';
|
||||
import { Options as RateLimitOptions } from 'express-rate-limit';
|
||||
import { RequestHandler } from "express";
|
||||
import { OAuthRegisteredClientsStore } from "../clients.js";
|
||||
import { Options as RateLimitOptions } from "express-rate-limit";
|
||||
export type ClientRegistrationHandlerOptions = {
|
||||
/**
|
||||
* A store used to save information about dynamically registered OAuth clients.
|
||||
@@ -25,5 +25,5 @@ export type ClientRegistrationHandlerOptions = {
|
||||
*/
|
||||
clientIdGeneration?: boolean;
|
||||
};
|
||||
export declare function clientRegistrationHandler({ clientsStore, clientSecretExpirySeconds, rateLimit: rateLimitConfig, clientIdGeneration }: ClientRegistrationHandlerOptions): RequestHandler;
|
||||
export declare function clientRegistrationHandler({ clientsStore, clientSecretExpirySeconds, rateLimit: rateLimitConfig, clientIdGeneration, }: ClientRegistrationHandlerOptions): RequestHandler;
|
||||
//# sourceMappingURL=register.d.ts.map
|
||||
Generated
Vendored
+1
-1
@@ -1 +1 @@
|
||||
{"version":3,"file":"register.d.ts","sourceRoot":"","sources":["../../../../../src/server/auth/handlers/register.ts"],"names":[],"mappings":"AAAA,OAAgB,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AAIlD,OAAO,EAAE,2BAA2B,EAAE,MAAM,eAAe,CAAC;AAC5D,OAAO,EAAa,OAAO,IAAI,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAI5E,MAAM,MAAM,gCAAgC,GAAG;IAC3C;;OAEG;IACH,YAAY,EAAE,2BAA2B,CAAC;IAE1C;;;;OAIG;IACH,yBAAyB,CAAC,EAAE,MAAM,CAAC;IAEnC;;;;OAIG;IACH,SAAS,CAAC,EAAE,OAAO,CAAC,gBAAgB,CAAC,GAAG,KAAK,CAAC;IAE9C;;;;OAIG;IACH,kBAAkB,CAAC,EAAE,OAAO,CAAC;CAChC,CAAC;AAIF,wBAAgB,yBAAyB,CAAC,EACtC,YAAY,EACZ,yBAAgE,EAChE,SAAS,EAAE,eAAe,EAC1B,kBAAyB,EAC5B,EAAE,gCAAgC,GAAG,cAAc,CA0EnD"}
|
||||
{"version":3,"file":"register.d.ts","sourceRoot":"","sources":["../../../../../src/server/auth/handlers/register.ts"],"names":[],"mappings":"AAAA,OAAgB,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AAIlD,OAAO,EAAE,2BAA2B,EAAE,MAAM,eAAe,CAAC;AAC5D,OAAO,EAAa,OAAO,IAAI,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAS5E,MAAM,MAAM,gCAAgC,GAAG;IAC7C;;OAEG;IACH,YAAY,EAAE,2BAA2B,CAAC;IAE1C;;;;OAIG;IACH,yBAAyB,CAAC,EAAE,MAAM,CAAC;IAEnC;;;;OAIG;IACH,SAAS,CAAC,EAAE,OAAO,CAAC,gBAAgB,CAAC,GAAG,KAAK,CAAC;IAE9C;;;;OAIG;IACH,kBAAkB,CAAC,EAAE,OAAO,CAAC;CAC9B,CAAC;AAIF,wBAAgB,yBAAyB,CAAC,EACxC,YAAY,EACZ,yBAAgE,EAChE,SAAS,EAAE,eAAe,EAC1B,kBAAyB,GAC1B,EAAE,gCAAgC,GAAG,cAAc,CA0EnD"}
|
||||
+9
-7
@@ -12,15 +12,15 @@ const express_rate_limit_1 = require("express-rate-limit");
|
||||
const allowedMethods_js_1 = require("../middleware/allowedMethods.js");
|
||||
const errors_js_1 = require("../errors.js");
|
||||
const DEFAULT_CLIENT_SECRET_EXPIRY_SECONDS = 30 * 24 * 60 * 60; // 30 days
|
||||
function clientRegistrationHandler({ clientsStore, clientSecretExpirySeconds = DEFAULT_CLIENT_SECRET_EXPIRY_SECONDS, rateLimit: rateLimitConfig, clientIdGeneration = true }) {
|
||||
function clientRegistrationHandler({ clientsStore, clientSecretExpirySeconds = DEFAULT_CLIENT_SECRET_EXPIRY_SECONDS, rateLimit: rateLimitConfig, clientIdGeneration = true, }) {
|
||||
if (!clientsStore.registerClient) {
|
||||
throw new Error('Client registration store does not support registering clients');
|
||||
throw new Error("Client registration store does not support registering clients");
|
||||
}
|
||||
// Nested router so we can configure middleware and restrict HTTP method
|
||||
const router = express_1.default.Router();
|
||||
// Configure CORS to allow any origin, to make accessible to web-based MCP clients
|
||||
router.use((0, cors_1.default)());
|
||||
router.use((0, allowedMethods_js_1.allowedMethods)(['POST']));
|
||||
router.use((0, allowedMethods_js_1.allowedMethods)(["POST"]));
|
||||
router.use(express_1.default.json());
|
||||
// Apply rate limiting unless explicitly disabled - stricter limits for registration
|
||||
if (rateLimitConfig !== false) {
|
||||
@@ -33,7 +33,7 @@ function clientRegistrationHandler({ clientsStore, clientSecretExpirySeconds = D
|
||||
...rateLimitConfig
|
||||
}));
|
||||
}
|
||||
router.post('/', async (req, res) => {
|
||||
router.post("/", async (req, res) => {
|
||||
res.setHeader('Cache-Control', 'no-store');
|
||||
try {
|
||||
const parseResult = auth_js_1.OAuthClientMetadataSchema.safeParse(req.body);
|
||||
@@ -43,7 +43,9 @@ function clientRegistrationHandler({ clientsStore, clientSecretExpirySeconds = D
|
||||
const clientMetadata = parseResult.data;
|
||||
const isPublicClient = clientMetadata.token_endpoint_auth_method === 'none';
|
||||
// Generate client credentials
|
||||
const clientSecret = isPublicClient ? undefined : node_crypto_1.default.randomBytes(32).toString('hex');
|
||||
const clientSecret = isPublicClient
|
||||
? undefined
|
||||
: node_crypto_1.default.randomBytes(32).toString('hex');
|
||||
const clientIdIssuedAt = Math.floor(Date.now() / 1000);
|
||||
// Calculate client secret expiry time
|
||||
const clientsDoExpire = clientSecretExpirySeconds > 0;
|
||||
@@ -52,7 +54,7 @@ function clientRegistrationHandler({ clientsStore, clientSecretExpirySeconds = D
|
||||
let clientInfo = {
|
||||
...clientMetadata,
|
||||
client_secret: clientSecret,
|
||||
client_secret_expires_at: clientSecretExpiresAt
|
||||
client_secret_expires_at: clientSecretExpiresAt,
|
||||
};
|
||||
if (clientIdGeneration) {
|
||||
clientInfo.client_id = node_crypto_1.default.randomUUID();
|
||||
@@ -67,7 +69,7 @@ function clientRegistrationHandler({ clientsStore, clientSecretExpirySeconds = D
|
||||
res.status(status).json(error.toResponseObject());
|
||||
}
|
||||
else {
|
||||
const serverError = new errors_js_1.ServerError('Internal Server Error');
|
||||
const serverError = new errors_js_1.ServerError("Internal Server Error");
|
||||
res.status(500).json(serverError.toResponseObject());
|
||||
}
|
||||
}
|
||||
|
||||
Generated
Vendored
+1
-1
@@ -1 +1 @@
|
||||
{"version":3,"file":"register.js","sourceR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,CAAC,CAAC;gBAC7D,GAAG,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,WAAW,CAAC,gBAAgB,EAAE,CAAC,CAAC;YACvD,CAAC;QACH,CAAC;IACH,CAAC,CAAC,CAAC;IAEH,OAAO,MAAM,CAAC;AAChB,CAAC"}
|
||||
+4
-4
@@ -1,6 +1,6 @@
|
||||
import { OAuthServerProvider } from '../provider.js';
|
||||
import { RequestHandler } from 'express';
|
||||
import { Options as RateLimitOptions } from 'express-rate-limit';
|
||||
import { OAuthServerProvider } from "../provider.js";
|
||||
import { RequestHandler } from "express";
|
||||
import { Options as RateLimitOptions } from "express-rate-limit";
|
||||
export type RevocationHandlerOptions = {
|
||||
provider: OAuthServerProvider;
|
||||
/**
|
||||
@@ -9,5 +9,5 @@ export type RevocationHandlerOptions = {
|
||||
*/
|
||||
rateLimit?: Partial<RateLimitOptions> | false;
|
||||
};
|
||||
export declare function revocationHandler({ provider, rateLimit: rateLimitConfig }: RevocationHandlerOptions): RequestHandler;
|
||||
export declare function revocationHandler({ provider, rateLimit: rateLimitConfig, }: RevocationHandlerOptions): RequestHandler;
|
||||
//# sourceMappingURL=revoke.d.ts.map
|
||||
Generated
Vendored
+1
-1
@@ -1 +1 @@
|
||||
{"version":3,"file":"revoke.d.ts","sourceRoot":"","sources":["../../../../../src/server/auth/handlers/revoke.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,gBAAgB,CAAC;AACrD,OAAgB,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AAIlD,OAAO,EAAa,OAAO,IAAI,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAI5E,MAAM,MAAM,wBAAwB,GAAG;IACnC,QAAQ,EAAE,mBAAmB,CAAC;IAC9B;;;OAGG;IACH,SAAS,CAAC,EAAE,OAAO,CAAC,gBAAgB,CAAC,GAAG,KAAK,CAAC;CACjD,CAAC;AAEF,wBAAgB,iBAAiB,CAAC,EAAE,QAAQ,EAAE,SAAS,EAAE,eAAe,EAAE,EAAE,wBAAwB,GAAG,cAAc,CA4DpH"}
|
||||
{"version":3,"file":"revoke.d.ts","sourceRoot":"","sources":["../../../../../src/server/auth/handlers/revoke.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,gBAAgB,CAAC;AACrD,OAAgB,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AAIlD,OAAO,EAAa,OAAO,IAAI,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAS5E,MAAM,MAAM,wBAAwB,GAAG;IACrC,QAAQ,EAAE,mBAAmB,CAAC;IAC9B;;;OAGG;IACH,SAAS,CAAC,EAAE,OAAO,CAAC,gBAAgB,CAAC,GAAG,KAAK,CAAC;CAC/C,CAAC;AAEF,wBAAgB,iBAAiB,CAAC,EAChC,QAAQ,EACR,SAAS,EAAE,eAAe,GAC3B,EAAE,wBAAwB,GAAG,cAAc,CA8D3C"}
|
||||
+9
-9
@@ -11,15 +11,15 @@ const auth_js_1 = require("../../../shared/auth.js");
|
||||
const express_rate_limit_1 = require("express-rate-limit");
|
||||
const allowedMethods_js_1 = require("../middleware/allowedMethods.js");
|
||||
const errors_js_1 = require("../errors.js");
|
||||
function revocationHandler({ provider, rateLimit: rateLimitConfig }) {
|
||||
function revocationHandler({ provider, rateLimit: rateLimitConfig, }) {
|
||||
if (!provider.revokeToken) {
|
||||
throw new Error('Auth provider does not support revoking tokens');
|
||||
throw new Error("Auth provider does not support revoking tokens");
|
||||
}
|
||||
// Nested router so we can configure middleware and restrict HTTP method
|
||||
const router = express_1.default.Router();
|
||||
// Configure CORS to allow any origin, to make accessible to web-based MCP clients
|
||||
router.use((0, cors_1.default)());
|
||||
router.use((0, allowedMethods_js_1.allowedMethods)(['POST']));
|
||||
router.use((0, allowedMethods_js_1.allowedMethods)(["POST"]));
|
||||
router.use(express_1.default.urlencoded({ extended: false }));
|
||||
// Apply rate limiting unless explicitly disabled
|
||||
if (rateLimitConfig !== false) {
|
||||
@@ -28,14 +28,14 @@ function revocationHandler({ provider, rateLimit: rateLimitConfig }) {
|
||||
max: 50, // 50 requests per windowMs
|
||||
standardHeaders: true,
|
||||
legacyHeaders: false,
|
||||
message: new errors_js_1.TooManyRequestsError('You have exceeded the rate limit for token revocation requests').toResponseObject(),
|
||||
...rateLimitConfig
|
||||
message: new errors_js_1.TooManyRequestsError("You have exceeded the rate limit for token revocation requests").toResponseObject(),
|
||||
...rateLimitConfig,
|
||||
}));
|
||||
}
|
||||
// Authenticate and extract client details
|
||||
router.use((0, clientAuth_js_1.authenticateClient)({ clientsStore: provider.clientsStore }));
|
||||
router.post('/', async (req, res) => {
|
||||
res.setHeader('Cache-Control', 'no-store');
|
||||
router.post("/", async (req, res) => {
|
||||
res.setHeader("Cache-Control", "no-store");
|
||||
try {
|
||||
const parseResult = auth_js_1.OAuthTokenRevocationRequestSchema.safeParse(req.body);
|
||||
if (!parseResult.success) {
|
||||
@@ -44,7 +44,7 @@ function revocationHandler({ provider, rateLimit: rateLimitConfig }) {
|
||||
const client = req.client;
|
||||
if (!client) {
|
||||
// This should never happen
|
||||
throw new errors_js_1.ServerError('Internal Server Error');
|
||||
throw new errors_js_1.ServerError("Internal Server Error");
|
||||
}
|
||||
await provider.revokeToken(client, parseResult.data);
|
||||
res.status(200).json({});
|
||||
@@ -55,7 +55,7 @@ function revocationHandler({ provider, rateLimit: rateLimitConfig }) {
|
||||
res.status(status).json(error.toResponseObject());
|
||||
}
|
||||
else {
|
||||
const serverError = new errors_js_1.ServerError('Internal Server Error');
|
||||
const serverError = new errors_js_1.ServerError("Internal Server Error");
|
||||
res.status(500).json(serverError.toResponseObject());
|
||||
}
|
||||
}
|
||||
|
||||
Generated
Vendored
+1
-1
@@ -1 +1 @@
|
||||
{"version":3,"file":"revoke.js","sourceRoot":"","sources":["../../../../../src/server/auth/handlers/revoke.ts"],"names":[],"mappings":";;;;;AAkBA,8CA4DC;AA7ED,sDAAkD;AAClD,gDAAwB;A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thServerProvider } from '../provider.js';
|
||||
import { Options as RateLimitOptions } from 'express-rate-limit';
|
||||
import { RequestHandler } from "express";
|
||||
import { OAuthServerProvider } from "../provider.js";
|
||||
import { Options as RateLimitOptions } from "express-rate-limit";
|
||||
export type TokenHandlerOptions = {
|
||||
provider: OAuthServerProvider;
|
||||
/**
|
||||
|
||||
Generated
Vendored
+1
-1
@@ -1 +1 @@
|
||||
{"version":3,"file":"token.d.ts","sourceRoot":"","sources":["../../../../../src/server/auth/handlers/token.ts"],"names":[],"mappings":"AACA,OAAgB,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AAClD,OAAO,EAAE,mBAAmB,EAAE,MAAM,gBAAgB,CAAC;AAIrD,OAAO,EAAa,OAAO,IAAI,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAW5E,MAAM,MAAM,mBAAmB,GAAG;IAC9B,QAAQ,EAAE,mBAAmB,CAAC;IAC9B;;;OAGG;IACH,SAAS,CAAC,EAAE,OAAO,CAAC,gBAAgB,CAAC,GAAG,KAAK,CAAC;CACjD,CAAC;AAmBF,wBAAgB,YAAY,CAAC,EAAE,QAAQ,EAAE,SAAS,EAAE,eAAe,EAAE,EAAE,mBAAmB,GAAG,cAAc,CA+G1G"}
|
||||
{"version":3,"file":"token.d.ts","sourceRoot":"","sources":["../../../../../src/server/auth/handlers/token.ts"],"names":[],"mappings":"AACA,OAAgB,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AAClD,OAAO,EAAE,mBAAmB,EAAE,MAAM,gBAAgB,CAAC;AAIrD,OAAO,EAAa,OAAO,IAAI,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAW5E,MAAM,MAAM,mBAAmB,GAAG;IAChC,QAAQ,EAAE,mBAAmB,CAAC;IAC9B;;;OAGG;IACH,SAAS,CAAC,EAAE,OAAO,CAAC,gBAAgB,CAAC,GAAG,KAAK,CAAC;CAC/C,CAAC;AAmBF,wBAAgB,YAAY,CAAC,EAAE,QAAQ,EAAE,SAAS,EAAE,eAAe,EAAE,EAAE,mBAAmB,GAAG,cAAc,CA4G1G"}
|
||||
+25
-48
@@ -1,33 +1,10 @@
|
||||
"use strict";
|
||||
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
||||
if (k2 === undefined) k2 = k;
|
||||
var desc = Object.getOwnPropertyDescriptor(m, k);
|
||||
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
||||
desc = { enumerable: true, get: function() { return m[k]; } };
|
||||
}
|
||||
Object.defineProperty(o, k2, desc);
|
||||
}) : (function(o, m, k, k2) {
|
||||
if (k2 === undefined) k2 = k;
|
||||
o[k2] = m[k];
|
||||
}));
|
||||
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
||||
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
||||
}) : function(o, v) {
|
||||
o["default"] = v;
|
||||
});
|
||||
var __importStar = (this && this.__importStar) || function (mod) {
|
||||
if (mod && mod.__esModule) return mod;
|
||||
var result = {};
|
||||
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
||||
__setModuleDefault(result, mod);
|
||||
return result;
|
||||
};
|
||||
var __importDefault = (this && this.__importDefault) || function (mod) {
|
||||
return (mod && mod.__esModule) ? mod : { "default": mod };
|
||||
};
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.tokenHandler = tokenHandler;
|
||||
const z = __importStar(require("zod/v4"));
|
||||
const zod_1 = require("zod");
|
||||
const express_1 = __importDefault(require("express"));
|
||||
const cors_1 = __importDefault(require("cors"));
|
||||
const pkce_challenge_1 = require("pkce-challenge");
|
||||
@@ -35,32 +12,32 @@ const clientAuth_js_1 = require("../middleware/clientAuth.js");
|
||||
const express_rate_limit_1 = require("express-rate-limit");
|
||||
const allowedMethods_js_1 = require("../middleware/allowedMethods.js");
|
||||
const errors_js_1 = require("../errors.js");
|
||||
const TokenRequestSchema = z.object({
|
||||
grant_type: z.string()
|
||||
const TokenRequestSchema = zod_1.z.object({
|
||||
grant_type: zod_1.z.string(),
|
||||
});
|
||||
const AuthorizationCodeGrantSchema = z.object({
|
||||
code: z.string(),
|
||||
code_verifier: z.string(),
|
||||
redirect_uri: z.string().optional(),
|
||||
resource: z.string().url().optional()
|
||||
const AuthorizationCodeGrantSchema = zod_1.z.object({
|
||||
code: zod_1.z.string(),
|
||||
code_verifier: zod_1.z.string(),
|
||||
redirect_uri: zod_1.z.string().optional(),
|
||||
resource: zod_1.z.string().url().optional(),
|
||||
});
|
||||
const RefreshTokenGrantSchema = z.object({
|
||||
refresh_token: z.string(),
|
||||
scope: z.string().optional(),
|
||||
resource: z.string().url().optional()
|
||||
const RefreshTokenGrantSchema = zod_1.z.object({
|
||||
refresh_token: zod_1.z.string(),
|
||||
scope: zod_1.z.string().optional(),
|
||||
resource: zod_1.z.string().url().optional(),
|
||||
});
|
||||
function tokenHandler({ provider, rateLimit: rateLimitConfig }) {
|
||||
// Nested router so we can configure middleware and restrict HTTP method
|
||||
const router = express_1.default.Router();
|
||||
// Configure CORS to allow any origin, to make accessible to web-based MCP clients
|
||||
router.use((0, cors_1.default)());
|
||||
router.use((0, allowedMethods_js_1.allowedMethods)(['POST']));
|
||||
router.use((0, allowedMethods_js_1.allowedMethods)(["POST"]));
|
||||
router.use(express_1.default.urlencoded({ extended: false }));
|
||||
// Apply rate limiting unless explicitly disabled
|
||||
if (rateLimitConfig !== false) {
|
||||
router.use((0, express_rate_limit_1.rateLimit)({
|
||||
windowMs: 15 * 60 * 1000, // 15 minutes
|
||||
max: 50, // 50 requests per windowMs
|
||||
max: 50, // 50 requests per windowMs
|
||||
standardHeaders: true,
|
||||
legacyHeaders: false,
|
||||
message: new errors_js_1.TooManyRequestsError('You have exceeded the rate limit for token requests').toResponseObject(),
|
||||
@@ -69,7 +46,7 @@ function tokenHandler({ provider, rateLimit: rateLimitConfig }) {
|
||||
}
|
||||
// Authenticate and extract client details
|
||||
router.use((0, clientAuth_js_1.authenticateClient)({ clientsStore: provider.clientsStore }));
|
||||
router.post('/', async (req, res) => {
|
||||
router.post("/", async (req, res) => {
|
||||
res.setHeader('Cache-Control', 'no-store');
|
||||
try {
|
||||
const parseResult = TokenRequestSchema.safeParse(req.body);
|
||||
@@ -80,22 +57,22 @@ function tokenHandler({ provider, rateLimit: rateLimitConfig }) {
|
||||
const client = req.client;
|
||||
if (!client) {
|
||||
// This should never happen
|
||||
throw new errors_js_1.ServerError('Internal Server Error');
|
||||
throw new errors_js_1.ServerError("Internal Server Error");
|
||||
}
|
||||
switch (grant_type) {
|
||||
case 'authorization_code': {
|
||||
case "authorization_code": {
|
||||
const parseResult = AuthorizationCodeGrantSchema.safeParse(req.body);
|
||||
if (!parseResult.success) {
|
||||
throw new errors_js_1.InvalidRequestError(parseResult.error.message);
|
||||
}
|
||||
const { code, code_verifier, redirect_uri, resource } = parseResult.data;
|
||||
const skipLocalPkceValidation = provider.skipLocalPkceValidation;
|
||||
// Perform local PKCE validation unless explicitly skipped
|
||||
// Perform local PKCE validation unless explicitly skipped
|
||||
// (e.g. to validate code_verifier in upstream server)
|
||||
if (!skipLocalPkceValidation) {
|
||||
const codeChallenge = await provider.challengeForAuthorizationCode(client, code);
|
||||
if (!(await (0, pkce_challenge_1.verifyChallenge)(code_verifier, codeChallenge))) {
|
||||
throw new errors_js_1.InvalidGrantError('code_verifier does not match the challenge');
|
||||
throw new errors_js_1.InvalidGrantError("code_verifier does not match the challenge");
|
||||
}
|
||||
}
|
||||
// Passes the code_verifier to the provider if PKCE validation didn't occur locally
|
||||
@@ -103,21 +80,21 @@ function tokenHandler({ provider, rateLimit: rateLimitConfig }) {
|
||||
res.status(200).json(tokens);
|
||||
break;
|
||||
}
|
||||
case 'refresh_token': {
|
||||
case "refresh_token": {
|
||||
const parseResult = RefreshTokenGrantSchema.safeParse(req.body);
|
||||
if (!parseResult.success) {
|
||||
throw new errors_js_1.InvalidRequestError(parseResult.error.message);
|
||||
}
|
||||
const { refresh_token, scope, resource } = parseResult.data;
|
||||
const scopes = scope?.split(' ');
|
||||
const scopes = scope === null || scope === void 0 ? void 0 : scope.split(" ");
|
||||
const tokens = await provider.exchangeRefreshToken(client, refresh_token, scopes, resource ? new URL(resource) : undefined);
|
||||
res.status(200).json(tokens);
|
||||
break;
|
||||
}
|
||||
// Additional auth methods will not be added on the server side of the SDK.
|
||||
case 'client_credentials':
|
||||
// Not supported right now
|
||||
//case "client_credentials":
|
||||
default:
|
||||
throw new errors_js_1.UnsupportedGrantTypeError('The grant type is not supported by this authorization server.');
|
||||
throw new errors_js_1.UnsupportedGrantTypeError("The grant type is not supported by this authorization server.");
|
||||
}
|
||||
}
|
||||
catch (error) {
|
||||
@@ -126,7 +103,7 @@ function tokenHandler({ provider, rateLimit: rateLimitConfig }) {
|
||||
res.status(status).json(error.toResponseObject());
|
||||
}
|
||||
else {
|
||||
const serverError = new errors_js_1.ServerError('Internal Server Error');
|
||||
const serverError = new errors_js_1.ServerError("Internal Server Error");
|
||||
res.status(500).json(serverError.toResponseObject());
|
||||
}
|
||||
}
|
||||
|
||||
Generated
Vendored
+1
-1
@@ -1 +1 @@
|
||||
{"version":3,"file":"token.js","sourceRoot":"","sources":["../../../../../src/server/auth/handlers/token.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AA2CA,oCA+GC;AA1JD,0CAA4B;AAC5B,sDAAkD;AAElD,gDAAwB;AACxB,mDAAiD;AACjD,+DAAiE;AACjE,2DAA4E;AAC5E,uEAAiE;AACjE,4CAOsB;AAWtB,MAAM,kBAAkB,GAAG,CAAC,CAAC,MAAM,CAAC;IAChC,UAAU,EAAE,CAAC,CAAC,MAAM,EAAE;CACzB,CAAC,CAAC;AAEH,MAAM,4BAA4B,GAAG,CAAC,CAAC,MAAM,CAAC;IAC1C,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE;IAChB,aAAa,EAAE,CAAC,CAAC,MAAM,EAAE;IACzB,YAAY,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