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(schemas): update logto_configs table related types #5453

Merged
merged 5 commits into from
Mar 7, 2024

Conversation

darcyYe
Copy link
Contributor

@darcyYe darcyYe commented Feb 29, 2024

Summary

We will support two custom JWT scenarios, AccessToken (for end-user) and ClientCredentials (for machine connection), Logto users can customize the logic to manipulate the raw token payload, and the result of the parsed token payload will be further processed by Logto OIDC service and then issued to the client.
For each scenario, Logto user can customize the token payload manipulation by providing a code snippet, env variables, and sample token/context (for testing purposes). This is a group of data that will be stored in logto_config table as a single DB record.

This PR is the preparation for upcoming custom JWT-related APIs, with the following update/refactor:

  1. Enable new key column value LogtoJwtTokenKey for logto_config table.
  2. For each LogtoJwtTokenKey, we provide the corresponding data guards (jwtCustomizerAccessTokenGuard and jwtCustomizerClientCredentialsGuard) and types (JwtCustomizerAccessToken and JwtCustomizerClientCredentials).
  • All fields in data guards are optional to make the data flexible. Some fields have default values, but the backend does not care what the value is. The console will handle all of the value fallback logic.

Testing

N/A

Checklist

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

@darcyYe darcyYe requested a review from a team February 29, 2024 09:35
@github-actions github-actions bot added feature Cool stuff size/m labels Feb 29, 2024
Copy link

github-actions bot commented Feb 29, 2024

COMPARE TO master

Total Size Diff 📈 +4.96 KB

Diff by File
Name Diff
packages/schemas/src/types/index.ts 📈 +6 Bytes
packages/schemas/src/types/logto-config.ts 📈 +3.88 KB
packages/schemas/src/types/logto-config/index.ts 📈 +5.54 KB
packages/schemas/src/types/logto-config/oidc-provider.ts 📈 +3.29 KB

@darcyYe darcyYe force-pushed the yemq-log-8281-update-logto-config-table-types branch 3 times, most recently from 527222c to 1caf9da Compare March 1, 2024 10:00
@darcyYe darcyYe force-pushed the yemq-log-8281-update-logto-config-table-types branch from 1caf9da to 1fd9f8e Compare March 5, 2024 08:02
Copy link
Contributor

@wangsijie wangsijie left a comment

Choose a reason for hiding this comment

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

The token is just a simple string?

Copy link
Contributor

@simeng-li simeng-li left a comment

Choose a reason for hiding this comment

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

LGTM

@darcyYe darcyYe merged commit 038733e into master Mar 7, 2024
19 checks passed
@darcyYe darcyYe deleted the yemq-log-8281-update-logto-config-table-types branch March 7, 2024 06:09
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