Documentation ¶
Index ¶
- func ComparePassword(hashed string, normal string) error
- func GenerateToken(username string, callbacks ...func(*Claims)) (string, error)
- func HashPassword(s string) string
- func RefreshToken(tknStr string) (string, error)
- type ApiSecurityOptions
- type Claims
- type CustomClaims
- type LedgerValidator
- type UserInfo
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ComparePassword ¶
func GenerateToken ¶
func HashPassword ¶
func RefreshToken ¶
Types ¶
type ApiSecurityOptions ¶
type Claims ¶
type Claims struct { Username string `json:"username"` jwt.RegisteredClaims }
Create a struct that will be encoded to a JWT. We add jwt.RegisteredClaims as an embedded type, to provide fields like expiry time
func ValidateToken ¶
type CustomClaims ¶
type LedgerValidator ¶ added in v1.8.0
type LedgerValidator interface { ValidateToken(authString string) error GetJWTMiddleware() gin.HandlerFunc }
func New ¶ added in v1.8.0
func New(cfg ApiSecurityOptions) LedgerValidator
Click to show internal directories.
Click to hide internal directories.