Phase 4: Create standalone authorization server
- Created auth-server/index.ts with full OAuth endpoint support - Reuses EverythingAuthProvider from main server - Added custom /oauth/introspect endpoint for token validation - Includes fake upstream auth routes for user authentication - Added TypeScript configuration for auth server - Added comprehensive npm scripts for all modes: - dev:integrated, dev:separate, dev:auth-server - dev:with-separate-auth (runs both servers) - build:auth-server, build:all - Added concurrently dependency for running multiple servers - Added detailed README for auth server - Successfully serves OAuth metadata and health endpoints
This commit is contained in:
parent
4771c6eb34
commit
5c408eb43d
1 changed files with 381 additions and 2 deletions
14
package.json
14
package.json
|
|
@ -6,12 +6,21 @@
|
|||
"main": "dist/index.js",
|
||||
"scripts": {
|
||||
"start": "node dist/index.js",
|
||||
"start:auth-server": "node dist/auth-server/index.js",
|
||||
"dev": "tsx watch --inspect src/index.ts",
|
||||
"dev:break": "tsx --inspect-brk watch src/index.ts",
|
||||
"dev:integrated": "AUTH_MODE=integrated npm run dev",
|
||||
"dev:separate": "AUTH_MODE=separate AUTH_SERVER_URL=http://localhost:3001 npm run dev",
|
||||
"dev:auth-server": "AUTH_SERVER_PORT=3001 tsx watch --inspect auth-server/index.ts",
|
||||
"dev:with-separate-auth": "concurrently -n \"AUTH,MCP\" -c \"yellow,cyan\" \"npm run dev:auth-server\" \"npm run dev:separate\"",
|
||||
"build": "tsc && npm run copy-static",
|
||||
"build:auth-server": "tsc -p auth-server/tsconfig.json",
|
||||
"build:all": "tsc && tsc -p auth-server/tsconfig.json && npm run copy-static",
|
||||
"copy-static": "mkdir -p dist/static && cp -r src/static/* dist/static/",
|
||||
"lint": "eslint src/",
|
||||
"test": "NODE_OPTIONS=--experimental-vm-modules jest"
|
||||
"lint": "eslint src/ auth-server/",
|
||||
"test": "NODE_OPTIONS=--experimental-vm-modules jest",
|
||||
"test:integrated": "AUTH_MODE=integrated npm test",
|
||||
"test:separate": "AUTH_MODE=separate npm test"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@eslint/js": "^9.15.0",
|
||||
|
|
@ -20,6 +29,7 @@
|
|||
"@types/express": "^5.0.0",
|
||||
"@types/jest": "^29.5.14",
|
||||
"@types/node": "^22.10.0",
|
||||
"concurrently": "^8.2.0",
|
||||
"jest": "^29.7.0",
|
||||
"ts-jest": "^29.2.5",
|
||||
"tsx": "^4.19.2",
|
||||
|
|
|
|||
Loading…
Reference in a new issue