Versions in this module Expand all Collapse all v0 v0.17.2 Mar 6, 2026 Changes in this version + var UserContextKey = "user" + func CheckGlobalRequest(c *fiber.Ctx, bCtx *BusinessContext) (allow bool) + func CheckNamespacedRequest(c *fiber.Ctx, params map[string]string, ...) (allow bool, err error) + func ConfigureSecurity(router fiber.Router, opts SecurityOpts) fiber.Handler + func DecodeValue(decoders map[string]ValueDecoder, claims map[string]any, key string) (string, problems.Problem) + func IsMock(opts []Option[*JWTOpts]) bool + func IsObfuscated(ctx context.Context) bool + func IsReadyOnlyRequest(c *fiber.Ctx) bool + func NewBusinessCtxMiddleware(mwOpts BusinessContextOpts) fiber.Handler + func NewBusinessCtxMiddlewareWithOpts(opts ...Option[*BusinessContextOpts]) fiber.Handler + func NewCheckAccessMiddlewareWithOpts(opts ...Option[*CheckAccessOpts]) fiber.Handler + func NewJWT(opts JWTOpts) fiber.Handler + func NewJWTWithOpts(opts ...Option[*JWTOpts]) fiber.Handler + func ToContext(ctx context.Context, bCtx *BusinessContext) context.Context + type AccessType string + const AccessTypeObfuscated + const AccessTypeReadOnly + const AccessTypeReadWrite + func DetermineAccess(scopes []string, prefix string) (AccessType, error) + func (a AccessType) IsObfuscated() bool + func (a AccessType) IsRead() bool + func (a AccessType) IsWrite() bool + type BusinessContext struct + AccessType AccessType + ClientType ClientType + Environment string + Group string + Team string + func FromContext(ctx context.Context) (*BusinessContext, bool) + type BusinessContextOpts struct + DefaultScope string + Log logr.Logger + ScopePrefix string + ValuesDecoders map[string]ValueDecoder + type CheckAccessOpts struct + ExpectedResourcePath ResourcePathFunc + PathParamKeys []string + Prefix ResourcePathFunc + Templates map[ClientType]ComparisonTemplates + type ClientType string + const ClientTypeAdmin + const ClientTypeGroup + const ClientTypeTeam + func DetermineClientType(scopes []string, prefix string) (ClientType, error) + type CompareCtxInfo struct + B *BusinessContext + P map[string]string + func NewCompareCtxInfo(bCtx *BusinessContext, pathParams map[string]string) CompareCtxInfo + type ComparisonTemplates struct + ExpectedTemplate string + MatchType MatchType + UserInputTemplate string + func (c ComparisonTemplates) String() string + type JWTOpts struct + LmsBasePath string + PerformLMSCheck bool + TrustedIssuers []string + type MatchType string + const MatchTypeEqual + const MatchTypePrefix + type Matcher struct + ExpectedTemplate string + UserInputTemplate string + func NewMatcher(expectedTemplate, userInputTemplate string) *Matcher + func (m *Matcher) FullMatch(compareCtxInfo CompareCtxInfo) (bool, error) + func (m *Matcher) StartsWith(compareCtxInfo CompareCtxInfo) (bool, error) + func (m *Matcher) ToExpectedString(bCtx *BusinessContext, params map[string]string) (string, error) + func (m *Matcher) ToString(compareCtxInfo CompareCtxInfo) (string, string, error) + type MatcherFunc func(string, string) bool + type Option func(T) + func WithDefaultScope(scope string) Option[*BusinessContextOpts] + func WithExpectedResourcePathFunc(f ResourcePathFunc) Option[*CheckAccessOpts] + func WithLmsCheck(basePath string) Option[*JWTOpts] + func WithLog(log logr.Logger) Option[*BusinessContextOpts] + func WithPathParamKey(keys ...string) Option[*CheckAccessOpts] + func WithPrefixFunc(f ResourcePathFunc) Option[*CheckAccessOpts] + func WithScopePrefix(prefix string) Option[*BusinessContextOpts] + func WithTemplates(templates map[ClientType]ComparisonTemplates) Option[*CheckAccessOpts] + func WithTrustedIssuers(issuers []string) Option[*JWTOpts] + func WithValueDecoder(key string, decoder ValueDecoder) Option[*BusinessContextOpts] + func WithValueDecoders(decoders map[string]ValueDecoder) Option[*BusinessContextOpts] + type ResourcePathFunc func(*BusinessContext, map[string]string, map[ClientType]ComparisonTemplates) (string, error) + type SecurityOpts struct + BusinessContextOpts []Option[*BusinessContextOpts] + CheckAccessOpts []Option[*CheckAccessOpts] + Enabled bool + JWTOpts []Option[*JWTOpts] + Log logr.Logger + type ValueDecoder func(map[string]any, string) (string, problems.Problem)