Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( LocalsUserKey = "__user__" AccessTokenUUIDKey = "__access_token_uuid__" JWTClaimsKey = "__jwtClaims__" )
View Source
var AuthMiddlewareConfigDefault = AuthMiddlewareConfig{ Filter: nil, Decode: nil, Unauthorized: nil, }
Functions ¶
func ExtractAssessTokenFromCookies ¶
func ExtractAssessTokenFromCookies(ctx fiber.Ctx) string
func ExtractRefreshTokenFromCookies ¶
func ExtractRefreshTokenFromCookies(ctx fiber.Ctx) string
func ExtractUser ¶
func ExtractUser(ctx fiber.Ctx) *models.UsersModel
func NewAuthMiddleware ¶
func NewAuthMiddleware(config AuthMiddlewareConfig) fiber.Handler
NewAuthMiddleware validate accessToken in Keycloak and parse it, extract user from DB
func ResetCookies ¶
func ResetCookies(c fiber.Ctx)
Types ¶
type AuthMiddlewareConfig ¶
type AuthMiddlewareConfig struct { Filter func(ctx fiber.Ctx) bool UR *repositories.UserRepository JWT *services.JWTAuthenticator Decode func(ctx fiber.Ctx) (*jwt.MapClaims, error) }
Click to show internal directories.
Click to hide internal directories.