Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
b90d5ba
add type and schema for protected resource metadata
Apr 27, 2025
0ce2da8
add private variable to keep track of
Apr 27, 2025
3c69e5d
change auth flow to use authroization server and
Apr 27, 2025
9f6aa38
add/modify tests for new added auth functions
Apr 27, 2025
bfabc37
modify test to use the authorization server
Apr 27, 2025
956094b
remove unused variable
Apr 27, 2025
130b4fe
add resource parameter when building auth url
Apr 28, 2025
d6772e0
Change resource to use the protected resource metadata
Apr 28, 2025
6316d4f
Merge branch 'main' into auth-client
0Itsuki0 Apr 28, 2025
eb43c47
resolve typo.
0Itsuki0 May 20, 2025
4024554
Update src/client/sse.ts import.
0Itsuki0 May 20, 2025
6a63681
remove log.
0Itsuki0 May 20, 2025
ff65f81
Update section title.
0Itsuki0 May 20, 2025
c3cd5af
remove log.
0Itsuki0 May 20, 2025
b2878fb
remove resource parameter.
0Itsuki0 May 20, 2025
a3e2f71
remove resource parameter.
0Itsuki0 May 20, 2025
ed06b11
remove resource parameter.
0Itsuki0 May 20, 2025
42ee88b
remove resource parameter.
0Itsuki0 May 20, 2025
2dac816
remove resource parameter.
0Itsuki0 May 20, 2025
17b970e
remove resource parameter.
0Itsuki0 May 20, 2025
68eaf7a
remove resource parameter.
0Itsuki0 May 20, 2025
0a632bf
remove resource parameter.
0Itsuki0 May 20, 2025
cfd572a
remove resource parameter.
0Itsuki0 May 20, 2025
3ed83d3
Merge remote-tracking branch 'upstream/main' into auth-client
May 20, 2025
421959e
make backwards compatibile
pcarleton May 21, 2025
2bd1780
Merge branch 'main' into auth-client
pcarleton May 21, 2025
7c12e61
s/resourceServerUrl/serverUrl/g for backwards compat
pcarleton May 21, 2025
7ce3f85
fix test comment
pcarleton May 21, 2025
File filter

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Merge remote-tracking branch 'upstream/main' into auth-client
  • Loading branch information
itsuki committed May 20, 2025
commit 3ed83d3c6a8b4adf9fddd25411f7bded4c6899f2
11 changes: 9 additions & 2 deletions src/client/auth.ts
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,14 @@ export class UnauthorizedError extends Error {
*/
export async function auth(
provider: OAuthClientProvider,
{ resourceServerUrl, authorizationCode, protectedResourceMetadata }: { resourceServerUrl: string | URL, authorizationCode?: string, protectedResourceMetadata?: OAuthProtectedResourceMetadata }): Promise<AuthResult> {
{ resourceServerUrl,
authorizationCode,
scope,
protectedResourceMetadata }: {
resourceServerUrl: string | URL;
authorizationCode?: string;
scope?: string;
protectedResourceMetadata?: OAuthProtectedResourceMetadata }): Promise<AuthResult> {

let resourceMetadata = protectedResourceMetadata ?? await discoverOAuthProtectedResourceMetadata(resourceServerUrl);

Expand Down Expand Up @@ -333,7 +340,7 @@ export async function startAuthorization(
codeChallengeMethod,
);
authorizationUrl.searchParams.set("redirect_uri", String(redirectUrl));

if (scope) {
authorizationUrl.searchParams.set("scope", scope);
}
Expand Down
18 changes: 1 addition & 17 deletions src/client/sse.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -618,22 +618,6 @@ describe("SSEClientTransport", () => {
return;
}

if (auth === "Bearer new-token") {
res.writeHead(200, {
"Content-Type": "text/event-stream",
"Cache-Control": "no-cache, no-transform",
Connection: "keep-alive",
});
res.write("event: endpoint\n");
res.write(`data: ${baseUrl.href}\n\n`);
connectionAttempts++;
return;
}

res.writeHead(401).end();
return;
}

if (auth === "Bearer new-token") {
res.writeHead(200, {
"Content-Type": "text/event-stream",
Expand All @@ -646,7 +630,7 @@ describe("SSEClientTransport", () => {
return;
}

res.writeHead(401).end();
res.writeHead(401).end();
});

await new Promise<void>(resolve => {
Expand Down
You are viewing a condensed version of this merge commit. You can view the full changes here.