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

feat: Add validateAccessToken function to providers #701

Merged
merged 7 commits into from
Sep 29, 2023

Conversation

nkshah2
Copy link
Contributor

@nkshah2 nkshah2 commented Sep 25, 2023

Summary of change

(A few sentences about this PR)

Related issues

  • Link to issue1 here
  • Link to issue1 here

Test Plan

(Write your test plan here. If you changed any code, please provide us with clear instructions on how you verified your changes work. Bonus points for screenshots and videos!)

Documentation changes

(If relevant, please create a PR in our docs repo, or create a checklist here highlighting the necessary changes)

Checklist for important updates

  • Changelog has been updated
  • coreDriverInterfaceSupported.json file has been updated (if needed)
    • Along with the associated array in lib/ts/version.ts
  • frontendDriverInterfaceSupported.json file has been updated (if needed)
  • Changes to the version if needed
    • In package.json
    • In package-lock.json
    • In lib/ts/version.ts
  • Had run npm run build-pretty
  • Had installed and ran the pre-commit hook
  • If new thirdparty provider is added,
    • update switch statement in recipe/thirdparty/providers/configUtils.ts file, createProvider function.
    • add an icon on the user management dashboard.
  • Issue this PR against the latest non released version branch.
    • To know which one it is, run find the latest released tag (git tag) in the format vX.Y.Z, and then find the latest branch (git branch --all) whose X.Y is greater than the latest released tag.
    • If no such branch exists, then create one from the latest released branch.
  • If have added a new web framework, update the add-ts-no-check.js file to include that
  • If added a new recipe / api interface, then make sure that the implementation of it uses NON arrow functions only (like someFunc: function () {..}).
  • If added a new recipe, then make sure to expose it inside the recipe folder present in the root of this repo. We also need to expose its types.

Remaining TODOs for this PR

  • ...

Comment on lines 343 to 349
if (impl.config.validateAccessToken !== undefined) {
await impl.config.validateAccessToken({
accessToken: accessToken,
clientConfig: impl.config,
userContext,
});
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this should happen before the above if and we need to check if the access token is undefined or not

Comment on lines 33 to 39
// if (input.config.validateAccessToken === undefined) {
// input.config.validateAccessToken = async ({ accessTokenPayload, clientConfig }) => {
// if (accessTokenPayload.aud !== clientConfig.clientId) {
// throw Error("accessTokenPayload.aud does not match clientId");
// }
// };
// }
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove it

@@ -12,7 +12,7 @@
* License for the specific language governing permissions and limitations
* under the License.
*/
export const version = "16.0.0";
export const version = "16.0.1";
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

16.2

@nkshah2 nkshah2 changed the base branch from 16.0 to 16.2 September 29, 2023 06:49
@rishabhpoddar rishabhpoddar merged commit 9ff8fb8 into 16.2 Sep 29, 2023
4 of 13 checks passed
@rishabhpoddar rishabhpoddar deleted the feat/access-token-validation branch September 29, 2023 08:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants