Documentation ¶
Index ¶
- func CheckRolesFromLoginClientMiddleware(loginClient string, roleCheckingHandlerFunc auth.RoleCheckingHandlerFunc) gin.HandlerFunc
- func CheckRolesMiddleware(roleCheckingHandlerFunc auth.RoleCheckingHandlerFunc) gin.HandlerFunc
- func JwtIssuerFromRequestContext(c *gin.Context) (string, bool)
- func LoginClientFromRequestContext(ctx *gin.Context) (string, bool)
- func PerformRoleChecking(gCtx *gin.Context, loginClient string, ...)
- func RawTokenFromRequestContext(c *gin.Context) (string, bool)
- func RequireRolesFromLoginClientMiddleware(loginClient string, roles ...string) gin.HandlerFunc
- func RequireRolesMiddleware(roles ...string) gin.HandlerFunc
- func SetJwtIssuerIntoRequestContext(ctx *gin.Context, jwtIssuer string)
- func SetLoginClientIntoRequestContext(ctx *gin.Context, loginClient string)
- func SetRawTokenIntoRequestContext(ctx *gin.Context, rawToken string)
- func SetRawTokenMiddleware(c *gin.Context)
- func StaticJwtIssuerMiddleware(jwtIssuer string) gin.HandlerFunc
- func StaticLoginClientMiddleware(loginClient string) gin.HandlerFunc
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CheckRolesFromLoginClientMiddleware ¶
func CheckRolesFromLoginClientMiddleware(loginClient string, roleCheckingHandlerFunc auth.RoleCheckingHandlerFunc) gin.HandlerFunc
CheckRolesFromLoginClientMiddleware takes the <raw token> and the <jwt issuer> from the current ginContext and uses the given handler <roleCheckingHandlerFunc> Any error returned from <roleCheckingHandlerFunc> will result in a rejected request It requires SetRawTokenIntoRequestContext and SetJwtIssuerIntoRequestContext to be called before its usage the target login client will be taken from <loginClient>
func CheckRolesMiddleware ¶
func CheckRolesMiddleware(roleCheckingHandlerFunc auth.RoleCheckingHandlerFunc) gin.HandlerFunc
CheckRolesMiddleware takes all needed information from the current ginContext and uses the given handler <roleCheckingHandlerFunc> Any error returned from <roleCheckingHandlerFunc> will result in a rejected request It requires SetRawTokenIntoRequestContext, SetJwtIssuerIntoRequestContext and SetLoginClientIntoRequestContext to be called before its usage
func PerformRoleChecking ¶
func PerformRoleChecking(gCtx *gin.Context, loginClient string, roleCheckingHandlerFunc auth.RoleCheckingHandlerFunc)
PerformRoleChecking takes the <raw token> and the <jwt issuer> from the current ginContext and uses the given handler <roleCheckingHandlerFunc> It requires SetRawTokenIntoRequestContext and SetJwtIssuerIntoRequestContext to be called before its usage the target login client will be taken from <loginClient>
func RequireRolesFromLoginClientMiddleware ¶
func RequireRolesFromLoginClientMiddleware(loginClient string, roles ...string) gin.HandlerFunc
RequireRolesFromLoginClientMiddleware takes the <raw token> and the <jwt issuer> from the current ginContext and checks the existence of the required roles It requires SetRawTokenIntoRequestContext and SetJwtIssuerIntoRequestContext to be called before its usage the target login client will be taken from <loginClient>
func RequireRolesMiddleware ¶
func RequireRolesMiddleware(roles ...string) gin.HandlerFunc
RequireRolesMiddleware takes all needed information from the current ginContext and checks the existence of the required roles within the current loginClient (taken from LoginClientFromRequestContext) It requires SetRawTokenIntoRequestContext, SetJwtIssuerIntoRequestContext and SetLoginClientIntoRequestContext to be called before its usage
func SetRawTokenMiddleware ¶
func StaticJwtIssuerMiddleware ¶
func StaticJwtIssuerMiddleware(jwtIssuer string) gin.HandlerFunc
func StaticLoginClientMiddleware ¶
func StaticLoginClientMiddleware(loginClient string) gin.HandlerFunc
Types ¶
This section is empty.