Skip to content

Commit

Permalink
fix: Fix jwks body containing additional properties (#696)
Browse files Browse the repository at this point in the history
* FIx GwtJWKS response to not contain additional properties

* Bump package version and update CHANGELOG
  • Loading branch information
nkshah2 authored Sep 22, 2023
1 parent d3229cb commit 8af7acb
Show file tree
Hide file tree
Showing 10 changed files with 20 additions and 9 deletions.
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

0 comments on commit 8af7acb

Please sign in to comment.