feat: support oidc discovery in client sdk (#652)

Co-authored-by: Paul Carleton <paulc@anthropic.com>
Co-authored-by: Claude <noreply@anthropic.com>
This commit is contained in:
Xiao Yijun 2025-07-24 21:11:48 +08:00 • committed by GitHub
commit bb7cccc3ba
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -352,6 +352,11 @@ describe("SSEClientTransport", () => {
});
describe("auth handling", () => {
const authServerMetadataUrls = [
"/.well-known/oauth-authorization-server",
"/.well-known/openid-configuration",
];
let mockAuthProvider: jest.Mocked<OAuthClientProvider>;
beforeEach(() => {
@ -608,7 +613,7 @@ describe("SSEClientTransport", () => {
authServer.close();
authServer = createServer((req, res) => {
if (req.url === "/.well-known/oauth-authorization-server") {
if (req.url && authServerMetadataUrls.includes(req.url)) {
res.writeHead(404).end();
return;
}
@ -730,7 +735,7 @@ describe("SSEClientTransport", () => {
authServer.close();
authServer = createServer((req, res) => {
if (req.url === "/.well-known/oauth-authorization-server") {
if (req.url && authServerMetadataUrls.includes(req.url)) {
res.writeHead(404).end();
return;
}
@ -875,7 +880,7 @@ describe("SSEClientTransport", () => {
authServer.close();
authServer = createServer((req, res) => {
if (req.url === "/.well-known/oauth-authorization-server") {
if (req.url && authServerMetadataUrls.includes(req.url)) {
res.writeHead(404).end();
return;
}