Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func EncryptAccessToken ¶
Encrypt the access token using 128 bit AES, with a shared key given in encryptionKey
func EncryptRefreshToken ¶
Encrypt the refresh token using 2048 bit rsa key. publicKey should be &privateKey.PublicKey
func ValidateAccessToken ¶
func ValidateAccessToken(check func(token *Token, ctx *gin.Context) bool, encryptionKey interface{}) gin.HandlerFunc
ValidateAccessToken extracts an access token from the headers, checks that it's valid and then passes it on to the check-function
Types ¶
type Token ¶
type Token struct { IssueTime int64 `json:"iat"` ID string `json:"jti"` AccountID string `json:"sub"` Type string `json:"type"` Scope Scope `json:"scope"` }
func DecryptAccessToken ¶
Decrypt the access token in serialized form using 128 bit AES, with a shared key given in encryptionKey
func DecryptRefreshToken ¶
Decrypt the refresh token in serialized form using 2048 bit rsa key. privateKey should be &privateKey
func (*Token) HasCapability ¶
HasCapability checks if the access token contains the given capability
Click to show internal directories.
Click to hide internal directories.