Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BasicAuthMiddleware ¶
func BasicAuthMiddleware() gin.HandlerFunc
func HashPassword ¶
func VerifyPassword ¶
Types ¶
type JwtAuthImpl ¶
type JwtAuthImpl struct { PrivateKey *rsa.PrivateKey PublicKey *rsa.PublicKey }
func ConstructJwtAuth ¶
func ConstructJwtAuth() (*JwtAuthImpl, error)
Load public-private key pair from env
func (*JwtAuthImpl) JwtAuthMiddleware ¶
func (u *JwtAuthImpl) JwtAuthMiddleware() gin.HandlerFunc
type JwtPayload ¶
type JwtPayload struct { jwt.StandardClaims Username string `json:"username,omitempty"` }
func GetJwtUser ¶
func GetJwtUser(c *gin.Context) (user *JwtPayload, err error)
Click to show internal directories.
Click to hide internal directories.