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

fix: upgrade golang-jwt to v5 #1639

Merged
merged 3 commits into from
Jun 27, 2024
Merged

fix: upgrade golang-jwt to v5 #1639

merged 3 commits into from
Jun 27, 2024

Conversation

kangmingtay
Copy link
Member

@kangmingtay kangmingtay commented Jun 26, 2024

What kind of change does this PR introduce?

  • Upgrades the golang-jwt package to v5 based on the migration guide, which provides a much nicer API to interact with in-lieu of asymmetric jwts

Key Changes

  • github.com/golang-jwt/jwt/v5 deprecated StandardClaims and uses RegisteredClaims instead (uses exactly the same struct fields, just that it has more utility methods)
  • in github.com/golang-jwt/jwt/v5, you can't just pass set the valid methods when creating a Parser struct anymore, you need to use https://pkg.go.dev/github.com/golang-jwt/jwt/v5#NewParser
  • Getting the audience claim now returns a string slice instead of a string - this PR just aims to ensure that the dependency upgrade is backward compatible but i'll clean this up in a future PR as well as evaluate if it is still necessary to check the audience claim in the future
  • Since the aud claim is specified as an array of strings in RFC7519, the token json schema used needs to support the array type instead of string

@kangmingtay kangmingtay requested a review from a team as a code owner June 26, 2024 08:59
@coveralls
Copy link

coveralls commented Jun 26, 2024

Pull Request Test Coverage Report for Build 9677076219

Details

  • 20 of 20 (100.0%) changed or added relevant lines in 6 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage increased (+0.01%) to 57.688%

Totals Coverage Status
Change from base Build 9648353678: 0.01%
Covered Lines: 8704
Relevant Lines: 15088

💛 - Coveralls

@kangmingtay kangmingtay merged commit 2cb97f0 into master Jun 27, 2024
3 checks passed
@kangmingtay kangmingtay deleted the km/update-golang-jwt branch June 27, 2024 16:22
J0 pushed a commit that referenced this pull request Jul 3, 2024
🤖 I have created a release *beep* *boop*
---


##
[2.155.0](v2.154.2...v2.155.0)
(2024-07-03)


### Features

* add `password_hash` and `id` fields to admin create user
([#1641](#1641))
([20d59f1](20d59f1))


### Bug Fixes

* improve mfa verify logs
([#1635](#1635))
([d8b47f9](d8b47f9))
* invited users should have a temporary password generated
([#1644](#1644))
([3f70d9d](3f70d9d))
* upgrade golang-jwt to v5
([#1639](#1639))
([2cb97f0](2cb97f0))
* use pointer for `user.EncryptedPassword`
([#1637](#1637))
([bbecbd6](bbecbd6))

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
uxodb pushed a commit to uxodb/auth that referenced this pull request Nov 13, 2024
uxodb pushed a commit to uxodb/auth that referenced this pull request Nov 13, 2024
🤖 I have created a release *beep* *boop*
---


##
[2.155.0](supabase/auth@v2.154.2...v2.155.0)
(2024-07-03)


### Features

* add `password_hash` and `id` fields to admin create user
([supabase#1641](supabase#1641))
([20d59f1](supabase@20d59f1))


### Bug Fixes

* improve mfa verify logs
([supabase#1635](supabase#1635))
([d8b47f9](supabase@d8b47f9))
* invited users should have a temporary password generated
([supabase#1644](supabase#1644))
([3f70d9d](supabase@3f70d9d))
* upgrade golang-jwt to v5
([supabase#1639](supabase#1639))
([2cb97f0](supabase@2cb97f0))
* use pointer for `user.EncryptedPassword`
([supabase#1637](supabase#1637))
([bbecbd6](supabase@bbecbd6))

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
LashaJini pushed a commit to LashaJini/auth that referenced this pull request Nov 13, 2024
LashaJini pushed a commit to LashaJini/auth that referenced this pull request Nov 13, 2024
🤖 I have created a release *beep* *boop*
---


##
[2.155.0](supabase/auth@v2.154.2...v2.155.0)
(2024-07-03)


### Features

* add `password_hash` and `id` fields to admin create user
([supabase#1641](supabase#1641))
([20d59f1](supabase@20d59f1))


### Bug Fixes

* improve mfa verify logs
([supabase#1635](supabase#1635))
([d8b47f9](supabase@d8b47f9))
* invited users should have a temporary password generated
([supabase#1644](supabase#1644))
([3f70d9d](supabase@3f70d9d))
* upgrade golang-jwt to v5
([supabase#1639](supabase#1639))
([2cb97f0](supabase@2cb97f0))
* use pointer for `user.EncryptedPassword`
([supabase#1637](supabase#1637))
([bbecbd6](supabase@bbecbd6))

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
LashaJini pushed a commit to LashaJini/auth that referenced this pull request Nov 15, 2024
LashaJini pushed a commit to LashaJini/auth that referenced this pull request Nov 15, 2024
🤖 I have created a release *beep* *boop*
---


##
[2.155.0](supabase/auth@v2.154.2...v2.155.0)
(2024-07-03)


### Features

* add `password_hash` and `id` fields to admin create user
([supabase#1641](supabase#1641))
([20d59f1](supabase@20d59f1))


### Bug Fixes

* improve mfa verify logs
([supabase#1635](supabase#1635))
([d8b47f9](supabase@d8b47f9))
* invited users should have a temporary password generated
([supabase#1644](supabase#1644))
([3f70d9d](supabase@3f70d9d))
* upgrade golang-jwt to v5
([supabase#1639](supabase#1639))
([2cb97f0](supabase@2cb97f0))
* use pointer for `user.EncryptedPassword`
([supabase#1637](supabase#1637))
([bbecbd6](supabase@bbecbd6))

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants