-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
option to add extra dynamic fields to ice token, expose them in Claims (
#54)
- Loading branch information
1 parent
7e85e3d
commit 47dd6f8
Showing
9 changed files
with
42 additions
and
26 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -23,18 +23,19 @@ var ( | |
type ( | ||
Client interface { | ||
VerifyToken(token string) (*internal.Token, error) | ||
GenerateTokens(now *time.Time, userID, deviceUniqueID, email string, hashCode, seq int64, role string) (accessToken, refreshToken string, err error) | ||
GenerateTokens(now *time.Time, userID, deviceID, email string, hashCode, seq int64, role string, extra map[string]any) (access, refresh string, err error) | ||
VerifyTokenFields(token string, res jwt.Claims) error | ||
GenerateMetadata(now *time.Time, tokenID string, metadata map[string]any) (string, error) | ||
} | ||
|
||
Token struct { | ||
*jwt.RegisteredClaims | ||
Role string `json:"role" example:"1"` | ||
Email string `json:"email" example:"[email protected]"` | ||
DeviceUniqueID string `json:"deviceUniqueId" example:"6FB988F3-36F4-433D-9C7C-555887E57EB2"` | ||
HashCode int64 `json:"hashCode,omitempty" example:"12356789"` | ||
Seq int64 `json:"seq" example:"1"` | ||
Claims map[string]any `json:"claims,omitempty"` | ||
Role string `json:"role" example:"1"` | ||
Email string `json:"email" example:"[email protected]"` | ||
DeviceUniqueID string `json:"deviceUniqueId" example:"6FB988F3-36F4-433D-9C7C-555887E57EB2"` | ||
HashCode int64 `json:"hashCode,omitempty" example:"12356789"` | ||
Seq int64 `json:"seq" example:"1"` | ||
} | ||
) | ||
|
||
|
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