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(core): add denyAccess api context to customJwt script #6532

Merged
merged 5 commits into from
Sep 3, 2024

Conversation

simeng-li
Copy link
Contributor

Summary

Add API context to the customJwt script payload, including the new denyAccess API.

  • Only localVM environment jwtCustomizer is updated in this PR. Cloud azureFunction updates will be made in the cloud repo.

example:

const getCustomJwtClaims = async ({ token, context, environmentVariables, api }) => {
  api.denyAccess('You are not allowed to access this resource.');
};

Testing

test locally
image

Checklist

  • .changeset
  • unit tests
  • integration tests
  • necessary TSDoc comments

@simeng-li simeng-li requested review from a team August 30, 2024 03:33
Copy link

github-actions bot commented Aug 30, 2024

COMPARE TO master

Total Size Diff 📈 +6.3 KB

Diff by File
Name Diff
packages/core/src/libraries/jwt-customizer.ts 📈 +816 Bytes
packages/core/src/oidc/extra-token-claims.ts 📈 +690 Bytes
packages/core/src/routes/logto-config/jwt-customizer.ts 📈 +160 Bytes
packages/core/src/utils/custom-jwt/index.ts 📈 +1.57 KB
packages/integration-tests/src/mocks/jwt-customizer.ts 📈 +474 Bytes
packages/integration-tests/src/tests/api/logto-config.test.ts 📈 +1.28 KB
packages/schemas/src/types/logto-config/jwt-customizer.ts 📈 +1.37 KB

@simeng-li simeng-li force-pushed the simeng-log-9923-add-accessdeny-function branch from bb40b2d to b2dc181 Compare September 2, 2024 03:29
Base automatically changed from simeng-log-9924-refactor-local-vm-customjwt-handler to master September 2, 2024 03:36
@github-actions github-actions bot added size/l and removed size/m labels Sep 2, 2024
@simeng-li simeng-li force-pushed the simeng-log-9923-add-accessdeny-function branch from b2dc181 to 30d2026 Compare September 2, 2024 03:37
@github-actions github-actions bot added size/m and removed size/l labels Sep 2, 2024
@simeng-li simeng-li force-pushed the simeng-log-9923-add-accessdeny-function branch 3 times, most recently from cd7b28e to 3a91011 Compare September 3, 2024 02:53
@simeng-li simeng-li force-pushed the simeng-log-9923-add-accessdeny-function branch 2 times, most recently from 2660453 to 9479d13 Compare September 3, 2024 09:06
@github-actions github-actions bot added size/l and removed size/m labels Sep 3, 2024
@simeng-li simeng-li changed the base branch from master to simeng-bump-withtyped-version September 3, 2024 09:25
@github-actions github-actions bot added size/m and removed size/l labels Sep 3, 2024
Base automatically changed from simeng-bump-withtyped-version to master September 3, 2024 09:51
@github-actions github-actions bot added size/l and removed size/m labels Sep 3, 2024
@simeng-li simeng-li force-pushed the simeng-log-9923-add-accessdeny-function branch from 0cb3597 to dac04cd Compare September 3, 2024 09:54
@github-actions github-actions bot added size/m and removed size/l labels Sep 3, 2024
@simeng-li simeng-li merged commit b51680a into master Sep 3, 2024
35 checks passed
@simeng-li simeng-li deleted the simeng-log-9923-add-accessdeny-function branch September 3, 2024 10:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

Successfully merging this pull request may close these issues.

3 participants