Return 404 JSON for oauth-protected-resource discovery probes.
Stop 302ing Claude well-known checks to /login without advertising OAuth. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
import test from 'node:test'
|
||||
import assert from 'node:assert/strict'
|
||||
import { existsSync, readFileSync } from 'node:fs'
|
||||
import { readFileSync } from 'node:fs'
|
||||
import { fileURLToPath } from 'node:url'
|
||||
import { dirname, join } from 'node:path'
|
||||
import {
|
||||
@@ -77,7 +77,7 @@ test('aigen routes exist, stay on the studio-2 enqueue path, and 404 on xAIGen',
|
||||
assert.match(middleware, /aigenApiPathAllowed/)
|
||||
assert.match(middleware, /\/\.well-known\/oauth-authorization-server/)
|
||||
assert.match(middleware, /\/\.well-known\/openid-configuration/)
|
||||
assert.doesNotMatch(middleware, /oauth-protected-resource/)
|
||||
assert.match(middleware, /\/\.well-known\/oauth-protected-resource/)
|
||||
assert.match(authPaths, /path === '\/mcp'/)
|
||||
assert.match(mcp, /mcpBearerOk/)
|
||||
assert.match(mcp, /text\/event-stream/)
|
||||
@@ -98,10 +98,14 @@ test('aigen routes exist, stay on the studio-2 enqueue path, and 404 on xAIGen',
|
||||
|
||||
const as = readFileSync(join(root, 'server/routes/.well-known/oauth-authorization-server.get.ts'), 'utf8')
|
||||
const oidc = readFileSync(join(root, 'server/routes/.well-known/openid-configuration.get.ts'), 'utf8')
|
||||
const opr = readFileSync(join(root, 'server/routes/.well-known/oauth-protected-resource.get.ts'), 'utf8')
|
||||
const oprMcp = readFileSync(join(root, 'server/routes/.well-known/oauth-protected-resource/mcp.get.ts'), 'utf8')
|
||||
assert.match(as, /not found/)
|
||||
assert.match(oidc, /not found/)
|
||||
assert.equal(existsSync(join(root, 'server/routes/.well-known/oauth-protected-resource.get.ts')), false)
|
||||
assert.equal(existsSync(join(root, 'server/routes/.well-known/oauth-protected-resource/mcp.get.ts')), false)
|
||||
assert.match(opr, /not found/)
|
||||
assert.match(oprMcp, /not found/)
|
||||
assert.doesNotMatch(opr, /authorization_servers/)
|
||||
assert.doesNotMatch(oprMcp, /authorization_servers/)
|
||||
})
|
||||
|
||||
test('defaultLibraryFolderId prefers Inbox then the first folder', () => {
|
||||
|
||||
Reference in New Issue
Block a user