Documentation ¶
Index ¶
- func EncryptUserDetails(userDetails UserDetails) (string, error)
- type AppData
- type BaseJwt
- func (base *BaseJwt) ParseToken(typeClaims, jwtToken string) (*JwtMapClaims, error)
- func (base *BaseJwt) SetClaim(userDetails UserDetails) (*BaseJwt, error)
- func (base *BaseJwt) SetClaimApp(appData AppData) *BaseJwt
- func (base *BaseJwt) SetCtx(ctx *http.Request) *BaseJwt
- func (base *BaseJwt) SetIssuer(issuer string) *BaseJwt
- func (base *BaseJwt) SetOrigin(origin string) *BaseJwt
- func (base *BaseJwt) SetRoles(allowedRoles []string, defaultRoles string) *BaseJwt
- func (base *BaseJwt) SignClaims() (signedToken *SignedToken, err error)
- type HasuraClaim
- type JwtMapClaims
- type SignedToken
- type TokenData
- type TokenGenerator
- type UserDetails
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func EncryptUserDetails ¶
func EncryptUserDetails(userDetails UserDetails) (string, error)
Types ¶
type BaseJwt ¶
type BaseJwt struct {
// contains filtered or unexported fields
}
func (*BaseJwt) ParseToken ¶
func (base *BaseJwt) ParseToken(typeClaims, jwtToken string) (*JwtMapClaims, error)
func (*BaseJwt) SetClaimApp ¶
func (*BaseJwt) SignClaims ¶
func (base *BaseJwt) SignClaims() (signedToken *SignedToken, err error)
type HasuraClaim ¶
type JwtMapClaims ¶
type JwtMapClaims struct { Uuid string `json:"uuid"` TokenData TokenData `json:"token_data"` UserDetails *UserDetails `json:"user_details"` HasuraClaim HasuraClaim `json:"hasura_claim"` jwt.StandardClaims }
type SignedToken ¶
type TokenGenerator ¶
type TokenGenerator struct {
Type string `json:"type"`
}
type UserDetails ¶
type UserDetails struct { ID string `json:"id,omitempty"` Email string `json:"email,omitempty"` Username string `json:"username,omitempty"` UserRoles []string `json:"user_roles"` }
func DecryptUserDetails ¶
func DecryptUserDetails(secretMessage string) (UserDetails, error)
Click to show internal directories.
Click to hide internal directories.