storage
storage copied to clipboard
fix(jwt): support multi-algorithm of JWT verify
What kind of change does this PR introduce?
- To make supabase storage support multiple JWT verify algorithm (e.g. RS256)
- To support base64 of
PGRST_JWT_SECRET
What is the current behavior?
The verifyJWT function does not support RS256 here https://github.com/supabase/storage-api/blob/9bf39cd2b5f897b55b60a4af7cadc8b5f53b33af/src/utils/index.ts#L37
What is the new behavior?
The verifyJWT function support RS256 and other algorithms.
@xenirio thanks for the contribution!
The PR looks good, the only thing I'm not convinced yet is to allow base64 encoded parameters. Probably would be better to decode the string upstream
PGRST_JWT_SECRET="$(echo $PGRST_JWT_SECRET | base64 -d) node index.js
@fenos I've updated my PR by remove PGRST_JWT_SECRET_IS_BASE64. Please check.
Thank you.
Hey @xenirio looks good! Was about to merge but there is some linting that prevents me to do that. Can you please run prettier on the files:
warn] src/utils/config.ts
[warn] src/utils/index.ts
I will merge and run prettier on it 👍
:tada: This PR is included in version 0.24.1 :tada:
The release is available on GitHub release
Your semantic-release bot :package::rocket: