Skip to content

use jwtk for es512 - #5062

Merged
mergify[bot] merged 3 commits into
databendlabs:mainfrom
junnplus:es512
Apr 27, 2022
Merged

mergify[bot] merged 3 commits into
databendlabs:mainfrom
junnplus:es512

Conversation

@junnplus

@junnplus junnplus commented Apr 26, 2022 •

Copy link
Copy Markdown
Contributor

Signed-off-by: Ye Sijun [email protected]

I hereby agree to the terms of the CLA available at: https://databend.rs/dev/policies/cla/

Summary

jwt-simple does not support ES512 algorithm, see https://github.com/jedisct1/rust-jwt-simple#jwt-simple

So I found jwtk, supports almost all JWS algorithms, both JWT and JWKS are supported.

Changelog

  • New Feature

Related Issues

Fixes #4928

@vercel

vercel Bot commented Apr 26, 2022 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for Git ↗︎

1 Ignored Deployment
Name Status Preview Updated
databend ⬜️ Ignored (Inspect) Apr 27, 2022 at 0:53AM (UTC)

@mergify

mergify Bot commented Apr 26, 2022

Copy link
Copy Markdown
Contributor

Thanks for the contribution!
I have applied any labels matching special text in your PR Changelog.

Please review the labels and make any necessary changes.

@mergify mergify Bot added the pr-feature this PR introduces a new feature to the codebase label Apr 26, 2022
@junnplus
junnplus marked this pull request as ready for review April 27, 2022 03:19
@junnplus
junnplus requested a review from bohutang as a code owner April 27, 2022 03:19

@flaneur2020 flaneur2020 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM

@bohutang

Copy link
Copy Markdown
Member

This PR can not build in MacOS from CI:

 cargo:rerun-if-env-changed=PKG_CONFIG_SYSROOT_DIR
  run pkg_config fail: "pkg-config has not been configured to support cross-compilation.\n\nInstall a sysroot for the target platform and configure it via\nPKG_CONFIG_SYSROOT_DIR and PKG_CONFIG_PATH, or install a\ncross-compiling wrapper for pkg-config and set it via\nPKG_CONFIG environment variable."

Not sure where caused it.

@youngsofun

Copy link
Copy Markdown
Member

@junnplus is there any other choice that does not depend on openssl (like jwt-simple) ?

@youngsofun

youngsofun commented Apr 27, 2022 •

Copy link
Copy Markdown
Member

is this strongly required?giving jwt-simple already support Ed25519 mentioned in #4928 (comment)

. I'd love to limit the algorithm choices to Ed25519

author of jwt-simple said https://github.com/jedisct1/rust-jwt-simple#jwt-simple

@junnplus

Copy link
Copy Markdown
Contributor Author

giving jwt-simple already support Ed25519

It seems that kms of AWS do not support the Ed25519 algorithm, we need to use kms to generate JWT token

@junnplus

Copy link
Copy Markdown
Contributor Author

@junnplus is there any other choice that does not depend on openssl (like jwt-simple) ?

jwt-simple does not support ES512 algorithm.

In addition, the API design of jwt-simple is not good, like ES256PublicKey, it lacks the api to convert from JWK to public key.

@junnplus
junnplus force-pushed the es512 branch 2 times, most recently from 0813f40 to d38380b Compare April 27, 2022 10:58
@Xuanwo

Xuanwo commented Apr 27, 2022

Copy link
Copy Markdown
Collaborator

reqsign uses jsonwebtoken for JWT, does it looks good to you?

@Xuanwo

Xuanwo commented Apr 27, 2022

Copy link
Copy Markdown
Collaborator

reqsign uses jsonwebtoken for JWT, does it looks good to you?

Ooops, jsonwebtoken seems to lack ES512. Does it has anything special? It looks like we just need to add a new enum?

Signed-off-by: Ye Sijun <[email protected]>
@mergify
mergify Bot merged commit 296f9ea into databendlabs:main Apr 27, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

pr-feature this PR introduces a new feature to the codebase

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Support JWT with ES512 algorithm

7 participants