Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Fix jwks body containing additional properties #696

Merged
merged 2 commits into from
Sep 22, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [unreleased]

## [15.2.1] - 2023-09-22

### Fixes

- Fixes an issue where the response for the JWKs API would contain additional properties

## [15.2.0] - 2023-09-11

### Added
Expand Down
4 changes: 3 additions & 1 deletion lib/build/recipe/jwt/api/implementation.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,9 @@ function getAPIImplementation() {
if (resp.validityInSeconds !== undefined) {
options.res.setHeader("Cache-Control", `max-age=${resp.validityInSeconds}, must-revalidate`, false);
}
return resp;
return {
keys: resp.keys,
};
});
},
};
Expand Down
2 changes: 1 addition & 1 deletion lib/build/version.d.ts

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion lib/build/version.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 3 additions & 1 deletion lib/ts/recipe/jwt/api/implementation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,9 @@ export default function getAPIImplementation(): APIInterface {
options.res.setHeader("Cache-Control", `max-age=${resp.validityInSeconds}, must-revalidate`, false);
}

return resp;
return {
keys: resp.keys,
};
},
};
}
2 changes: 1 addition & 1 deletion lib/ts/recipe/jwt/recipeImplementation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ export default function getRecipeInterface(
}
},

getJWKS: async function (): Promise<{ keys: JsonWebKey[]; validityInSeconds: number }> {
getJWKS: async function (): Promise<{ keys: JsonWebKey[]; validityInSeconds?: number }> {
const { body, headers } = await querier.sendGetRequestWithResponseHeaders(
new NormalisedURLPath("/.well-known/jwks.json"),
{}
Expand Down
2 changes: 1 addition & 1 deletion lib/ts/version.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
* License for the specific language governing permissions and limitations
* under the License.
*/
export const version = "15.2.0";
export const version = "15.2.1";

export const cdiSupported = ["3.0"];

Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "supertokens-node",
"version": "15.2.0",
"version": "15.2.1",
"description": "NodeJS driver for SuperTokens core",
"main": "index.js",
"scripts": {
Expand Down
1 change: 1 addition & 0 deletions test/jwt/getJWKS.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,7 @@ describe(`getJWKS: ${printPath("[test/jwt/getJWKS.test.js]")}`, function () {
});

assert(response !== undefined);
assert(Object.keys(response).length === 1);
assert(response.keys !== undefined);
assert(response.keys.length > 0);
assert.strictEqual(headers["cache-control"], "max-age=60, must-revalidate");
Expand Down
Loading