Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var DefaultConfig = Config{}
DefaultConfig is the default config
Functions ¶
Types ¶
type Config ¶
type Config struct { Enforcer *casbin.Enforcer // Authorizer defines a function you can pass // to check the credentials however you want. // It will be called with a username and password // and is expected to return true or false to indicate // that the credentials were approved or not. // // Optional. Default: nil. Authorizer func(sub, obj, action string) bool // By default it will return with a 401 Unauthorized and the correct WWW-Auth header // // Optional. Default: nil Unauthorized fiber.Handler }
Config is the configuration for Casbin middleware
Click to show internal directories.
Click to hide internal directories.