-
Notifications
You must be signed in to change notification settings - Fork 352
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: custom json and base64 encoders for Token and Parser
Co-Authored-By: Christian Banse <oxisto@aybaze.com>
- Loading branch information
Showing
7 changed files
with
180 additions
and
17 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
package jwt | ||
|
||
// Base64Encoder is an interface that allows to implement custom Base64 encoding | ||
// algorithms. | ||
type Base64EncodeFunc func(src []byte) string | ||
|
||
// Base64Decoder is an interface that allows to implement custom Base64 decoding | ||
// algorithms. | ||
type Base64DecodeFunc func(s string) ([]byte, error) | ||
|
||
// JSONEncoder is an interface that allows to implement custom JSON encoding | ||
// algorithms. | ||
type JSONMarshalFunc func(v any) ([]byte, error) | ||
|
||
// JSONUnmarshal is an interface that allows to implement custom JSON unmarshal | ||
// algorithms. | ||
type JSONUnmarshalFunc func(data []byte, v any) error |
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.