Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type AuthMiddleware ¶
type AuthMiddleware struct {
// contains filtered or unexported fields
}
func NewAuthMiddleware ¶
func NewAuthMiddleware(jwtConf *JWTConfig) *AuthMiddleware
func (*AuthMiddleware) CheckAuth ¶
func (am *AuthMiddleware) CheckAuth(next http.Handler) http.Handler
func (*AuthMiddleware) RequireAuth ¶
func (am *AuthMiddleware) RequireAuth(next http.Handler) http.Handler
type JWTUtil ¶
type JWTUtil struct {
// contains filtered or unexported fields
}
func NewJWTUtil ¶
func (*JWTUtil) GenerateAccessToken ¶
func (*JWTUtil) GetUserIDFromJWT ¶
func (*JWTUtil) ParseJWTClaims ¶
func (jwu *JWTUtil) ParseJWTClaims(bearer string) (*jwt.StandardClaims, error)
type UserIDKeyType ¶
type UserIDKeyType string
UserIDKeyType is the key type for setting the context and to avoid collisions
const ( //UserIDKey is the key used to set the context value for User ID UserIDKey UserIDKeyType = "SimUserID" )
Click to show internal directories.
Click to hide internal directories.