From ec1aa28c6eebd414bcb01cdf913eb53b7226c903 Mon Sep 17 00:00:00 2001 From: Ankit Tiwari Date: Thu, 8 Aug 2024 17:04:46 +0530 Subject: [PATCH] fix: Add revocation_endpoint --- lib/build/recipe/openid/api/getOpenIdDiscoveryConfiguration.js | 1 + lib/build/recipe/openid/index.d.ts | 1 + lib/build/recipe/openid/recipeImplementation.js | 1 + lib/build/recipe/openid/types.d.ts | 2 ++ lib/build/recipe/session/index.d.ts | 1 + lib/ts/recipe/openid/api/getOpenIdDiscoveryConfiguration.ts | 1 + lib/ts/recipe/openid/recipeImplementation.ts | 3 ++- lib/ts/recipe/openid/types.ts | 2 ++ test/with-typescript/index.ts | 1 + 9 files changed, 12 insertions(+), 1 deletion(-) diff --git a/lib/build/recipe/openid/api/getOpenIdDiscoveryConfiguration.js b/lib/build/recipe/openid/api/getOpenIdDiscoveryConfiguration.js index 6cd6f8ec5..227295247 100644 --- a/lib/build/recipe/openid/api/getOpenIdDiscoveryConfiguration.js +++ b/lib/build/recipe/openid/api/getOpenIdDiscoveryConfiguration.js @@ -17,6 +17,7 @@ async function getOpenIdDiscoveryConfiguration(apiImplementation, options, userC authorization_endpoint: result.authorization_endpoint, token_endpoint: result.token_endpoint, userinfo_endpoint: result.userinfo_endpoint, + revocation_endpoint: result.revocation_endpoint, subject_types_supported: result.subject_types_supported, id_token_signing_alg_values_supported: result.id_token_signing_alg_values_supported, response_types_supported: result.response_types_supported, diff --git a/lib/build/recipe/openid/index.d.ts b/lib/build/recipe/openid/index.d.ts index 6c78c266e..4b3c30cea 100644 --- a/lib/build/recipe/openid/index.d.ts +++ b/lib/build/recipe/openid/index.d.ts @@ -11,6 +11,7 @@ export default class OpenIdRecipeWrapper { authorization_endpoint: string; token_endpoint: string; userinfo_endpoint: string; + revocation_endpoint: string; subject_types_supported: string[]; id_token_signing_alg_values_supported: string[]; response_types_supported: string[]; diff --git a/lib/build/recipe/openid/recipeImplementation.js b/lib/build/recipe/openid/recipeImplementation.js index 61726ce5d..70de44644 100644 --- a/lib/build/recipe/openid/recipeImplementation.js +++ b/lib/build/recipe/openid/recipeImplementation.js @@ -25,6 +25,7 @@ function getRecipeInterface(config, jwtRecipeImplementation, appInfo) { authorization_endpoint: apiBasePath + constants_2.AUTH_PATH, token_endpoint: apiBasePath + constants_2.TOKEN_PATH, userinfo_endpoint: apiBasePath + constants_2.USER_INFO_PATH, + revocation_endpoint: apiBasePath + constants_2.REVOKE_TOKEN_PATH, subject_types_supported: ["public"], id_token_signing_alg_values_supported: ["RS256"], response_types_supported: ["code", "id_token", "id_token token"], diff --git a/lib/build/recipe/openid/types.d.ts b/lib/build/recipe/openid/types.d.ts index 246c57ac5..24dc22887 100644 --- a/lib/build/recipe/openid/types.d.ts +++ b/lib/build/recipe/openid/types.d.ts @@ -69,6 +69,7 @@ export declare type APIInterface = { authorization_endpoint: string; token_endpoint: string; userinfo_endpoint: string; + revocation_endpoint: string; subject_types_supported: string[]; id_token_signing_alg_values_supported: string[]; response_types_supported: string[]; @@ -86,6 +87,7 @@ export declare type RecipeInterface = { authorization_endpoint: string; token_endpoint: string; userinfo_endpoint: string; + revocation_endpoint: string; subject_types_supported: string[]; id_token_signing_alg_values_supported: string[]; response_types_supported: string[]; diff --git a/lib/build/recipe/session/index.d.ts b/lib/build/recipe/session/index.d.ts index 73a99d24e..7c397dc28 100644 --- a/lib/build/recipe/session/index.d.ts +++ b/lib/build/recipe/session/index.d.ts @@ -180,6 +180,7 @@ export default class SessionWrapper { authorization_endpoint: string; token_endpoint: string; userinfo_endpoint: string; + revocation_endpoint: string; subject_types_supported: string[]; id_token_signing_alg_values_supported: string[]; response_types_supported: string[]; diff --git a/lib/ts/recipe/openid/api/getOpenIdDiscoveryConfiguration.ts b/lib/ts/recipe/openid/api/getOpenIdDiscoveryConfiguration.ts index 2dfe7a2bd..8bd134a78 100644 --- a/lib/ts/recipe/openid/api/getOpenIdDiscoveryConfiguration.ts +++ b/lib/ts/recipe/openid/api/getOpenIdDiscoveryConfiguration.ts @@ -37,6 +37,7 @@ export default async function getOpenIdDiscoveryConfiguration( authorization_endpoint: result.authorization_endpoint, token_endpoint: result.token_endpoint, userinfo_endpoint: result.userinfo_endpoint, + revocation_endpoint: result.revocation_endpoint, subject_types_supported: result.subject_types_supported, id_token_signing_alg_values_supported: result.id_token_signing_alg_values_supported, response_types_supported: result.response_types_supported, diff --git a/lib/ts/recipe/openid/recipeImplementation.ts b/lib/ts/recipe/openid/recipeImplementation.ts index a01377cbc..c8b302788 100644 --- a/lib/ts/recipe/openid/recipeImplementation.ts +++ b/lib/ts/recipe/openid/recipeImplementation.ts @@ -17,7 +17,7 @@ import { RecipeInterface as JWTRecipeInterface, JsonWebKey } from "../jwt/types" import NormalisedURLPath from "../../normalisedURLPath"; import { GET_JWKS_API } from "../jwt/constants"; import { NormalisedAppinfo, UserContext } from "../../types"; -import { AUTH_PATH, TOKEN_PATH, USER_INFO_PATH } from "../oauth2provider/constants"; +import { AUTH_PATH, REVOKE_TOKEN_PATH, TOKEN_PATH, USER_INFO_PATH } from "../oauth2provider/constants"; export default function getRecipeInterface( config: TypeNormalisedInput, @@ -39,6 +39,7 @@ export default function getRecipeInterface( authorization_endpoint: apiBasePath + AUTH_PATH, token_endpoint: apiBasePath + TOKEN_PATH, userinfo_endpoint: apiBasePath + USER_INFO_PATH, + revocation_endpoint: apiBasePath + REVOKE_TOKEN_PATH, subject_types_supported: ["public"], id_token_signing_alg_values_supported: ["RS256"], response_types_supported: ["code", "id_token", "id_token token"], diff --git a/lib/ts/recipe/openid/types.ts b/lib/ts/recipe/openid/types.ts index 32f3bc958..a798e1eaa 100644 --- a/lib/ts/recipe/openid/types.ts +++ b/lib/ts/recipe/openid/types.ts @@ -86,6 +86,7 @@ export type APIInterface = { authorization_endpoint: string; token_endpoint: string; userinfo_endpoint: string; + revocation_endpoint: string; subject_types_supported: string[]; id_token_signing_alg_values_supported: string[]; response_types_supported: string[]; @@ -104,6 +105,7 @@ export type RecipeInterface = { authorization_endpoint: string; token_endpoint: string; userinfo_endpoint: string; + revocation_endpoint: string; subject_types_supported: string[]; id_token_signing_alg_values_supported: string[]; response_types_supported: string[]; diff --git a/test/with-typescript/index.ts b/test/with-typescript/index.ts index d67684458..40fc4c6f6 100644 --- a/test/with-typescript/index.ts +++ b/test/with-typescript/index.ts @@ -1596,6 +1596,7 @@ Session.init({ token_endpoint: "http://localhost:3000/auth/oauth2/token", authorization_endpoint: "http://localhost:3000/auth/oauth2/auth", userinfo_endpoint: "http://localhost:3000/auth/oauth2/userinfo", + revocation_endpoint: "http://localhost:3000/auth/oauth2/revoke", id_token_signing_alg_values_supported: [], response_types_supported: [], subject_types_supported: [],