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

refactor(schemas,core,cli): alter signing key type to json object #4582

Conversation

charIeszhao
Copy link
Member

@charIeszhao charIeszhao commented Sep 25, 2023

Summary

Alter Logto signing key type, convert it from string to JSON Object, in order to provide additional information in Console, such as key ID and creation time.

Testing

Alteration script works fine, both upgrade and downgrade.

Checklist

  • .changeset
  • unit tests
  • integration tests
  • docs: Will update in a separate PR

OR

- [ ] This PR is not applicable for the checklist

@linear
Copy link

linear bot commented Sep 25, 2023

LOG-7146 Alter oidc private key type to support additional properties

Existing oidc private keys are string[], need to alter the type to support additional properties such as id and createdAt etc.

Provide DB alter script to migrate existing config data

@github-actions github-actions bot added enhancement Make it better size/s labels Sep 25, 2023
@github-actions
Copy link

github-actions bot commented Sep 25, 2023

COMPARE TO master

Total Size Diff 📈 +4.22 KB

Diff by File
Name Diff
.changeset/lucky-brooms-hide.md 📈 +217 Bytes
packages/cli/src/commands/database/seed/oidc-config.ts 📈 +302 Bytes
packages/cli/src/commands/database/utils.ts 📈 +328 Bytes
packages/core/src/env-set/oidc.ts 📈 +34 Bytes
packages/core/src/middleware/koa-auth/utils.ts 📈 +8 Bytes
packages/schemas/alterations/next-1695647183-update-private-key-type.ts 📈 +3.16 KB
packages/schemas/src/types/logto-config.ts 📈 +197 Bytes

@charIeszhao charIeszhao force-pushed the charles-log-7146-alter-oidc-private-key-type-to-json-object branch from 0559a9c to 21e61f8 Compare September 25, 2023 10:59
@charIeszhao charIeszhao changed the title refactor(schemas, core, cli): alterate signing key type to json object refactor(schemas,core,cli): alterate signing key type to json object Sep 25, 2023
@charIeszhao charIeszhao force-pushed the charles-log-7146-alter-oidc-private-key-type-to-json-object branch 2 times, most recently from 747369a to a0dae10 Compare September 25, 2023 15:07
@github-actions github-actions bot added size/m and removed size/s labels Sep 25, 2023
@charIeszhao charIeszhao marked this pull request as ready for review September 25, 2023 15:17
@charIeszhao charIeszhao changed the title refactor(schemas,core,cli): alterate signing key type to json object refactor(schemas,core,cli): alter signing key type to json object Sep 25, 2023
@simeng-li
Copy link
Contributor

Since we don't have a design for this. What is the use case for the keyId and createdAt attributes?

@charIeszhao
Copy link
Member Author

charIeszhao commented Sep 27, 2023

Since we don't have a design for this. What is the use case for the keyId and createdAt attributes?

We do have a design for Cloud console. The key ID will be displayed as the unique identifier of the key, since it's not suitable to expose the private key itself. And the createdAt will be helpful to determine which key is the current active one.

image

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
Copy link
Contributor

darcyYe commented Oct 7, 2023

Since we don't have a design for this. What is the use case for the keyId and createdAt attributes?

We do have a design for Cloud console. The key ID will be displayed as the unique identifier of the key, since it's not suitable to expose the private key itself. And the createdAt will be helpful to determine which key is the current active one.

image

How to know which key is currently in use? The latest created one?

Copy link
Contributor

@darcyYe darcyYe left a comment

Choose a reason for hiding this comment

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

Overall LGTM

@charIeszhao charIeszhao force-pushed the charles-log-7146-alter-oidc-private-key-type-to-json-object branch 3 times, most recently from 04a1891 to 4be62e3 Compare October 7, 2023 09:11
@charIeszhao charIeszhao enabled auto-merge (squash) October 7, 2023 09:11
@charIeszhao charIeszhao force-pushed the charles-log-7146-alter-oidc-private-key-type-to-json-object branch from 4be62e3 to 5e4820f Compare October 7, 2023 09:22
@charIeszhao charIeszhao merged commit 46d0d4c into master Oct 8, 2023
24 checks passed
@charIeszhao charIeszhao deleted the charles-log-7146-alter-oidc-private-key-type-to-json-object branch October 8, 2023 17:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Make it better size/m
Development

Successfully merging this pull request may close these issues.

5 participants