-
-
Notifications
You must be signed in to change notification settings - Fork 140
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(api,pkg)!: new jwt decoding implementation
We’re refactoring the `AuthRequest` handler. The handler will no longer use the `AuthMiddleware`, and JWT decoding is now the responsibility of the `jwttoken` package, which already handles token encoding. The main reason for this change is the deprecation of `github.com/labstack/echo/v4/middleware.JWTWithConfig`. The `UserAuthClaims` and `DeviceAuthClaims` have also been moved to the `authorizer` package. The `jwttoken` package now uses these types to encode and decode tokens. Consequently, the `EncodeUserClaims` and `EncodeDeviceClaims` functions replace the old generic `Encode` function, which is now used only internally. The `ClaimsFromBearerToken` function is now responsible for decoding a token into either user or device claims. The handler’s documentation has been updated to describe its use as a "proxy-level" middleware, including a sequential diagram. All related tests have also been improved.
- Loading branch information
1 parent
55161a8
commit 839be80
Showing
20 changed files
with
361 additions
and
262 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.