Skip to content

Commit 2cc5a8c

Browse files
committed
make inmemory explicitly demo
1 parent 374580f commit 2cc5a8c

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

src/examples/server/inMemoryOAuthProvider.ts renamed to src/examples/server/demoInMemoryOAuthProvider.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import { AuthInfo } from 'src/server/auth/types.js';
1010
* Simple in-memory implementation of OAuth clients store for demo purposes.
1111
* In production, this should be backed by a persistent database.
1212
*/
13-
export class InMemoryClientsStore implements OAuthRegisteredClientsStore {
13+
export class DemoInMemoryClientsStore implements OAuthRegisteredClientsStore {
1414
private clients = new Map<string, OAuthClientInformationFull>();
1515

1616
async getClient(clientId: string) {
@@ -25,10 +25,10 @@ export class InMemoryClientsStore implements OAuthRegisteredClientsStore {
2525

2626
/**
2727
* Simple in-memory implementation of OAuth server provider for demo purposes.
28-
* In production, this should be backed by a persistent database with proper security measures.
28+
* Do not use this in production.
2929
*/
30-
export class InMemoryAuthProvider implements OAuthServerProvider {
31-
clientsStore = new InMemoryClientsStore();
30+
export class DemoInMemoryAuthProvider implements OAuthServerProvider {
31+
clientsStore = new DemoInMemoryClientsStore();
3232
private codes = new Map<string, {
3333
params: AuthorizationParams,
3434
client: OAuthClientInformationFull}>();

src/examples/server/simpleStreamableHttp.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import { mcpAuthRouter, mcpProtectedResourceRouter, getOAuthProtectedResourceMet
77
import { requireBearerAuth } from '../../server/auth/middleware/bearerAuth.js';
88
import { CallToolResult, GetPromptResult, isInitializeRequest, ReadResourceResult } from '../../types.js';
99
import { InMemoryEventStore } from '../shared/inMemoryEventStore.js';
10-
import { InMemoryAuthProvider } from './inMemoryOAuthProvider.js';
10+
import { DemoInMemoryAuthProvider } from './demoInMemoryOAuthProvider.js';
1111

1212
// Check for OAuth flag
1313
const useOAuth = process.argv.includes('--oauth');
@@ -174,7 +174,7 @@ app.use(express.json());
174174
// Set up OAuth if enabled
175175
let authMiddleware = null;
176176
if (useOAuth) {
177-
const provider = new InMemoryAuthProvider();
177+
const provider = new DemoInMemoryAuthProvider();
178178

179179
// Create auth middleware for MCP endpoints
180180
const mcpServerUrl = new URL(`http://localhost:${MCP_PORT}`);

0 commit comments

Comments
 (0)