Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CasbinService ¶
type CasbinService struct { TokenService *TokenService `inject:""` Enforcer *casbin.Enforcer `inject:""` UserRepo *repo.UserRepo `inject:""` TokenRepo *repo.TokenRepo `inject:""` }
func NewCasbinService ¶
func NewCasbinService() *CasbinService
func (*CasbinService) Check ¶
Check checks the username, request's method and path and returns true if permission grandted otherwise false.
func (*CasbinService) Serve ¶
func (m *CasbinService) Serve(ctx iris.Context)
type JwtService ¶
type JwtService struct {
Config middlewareUtils.Config
}
JwtService the middleware for JSON Web tokens authentication method
func NewJwtService ¶
func NewJwtService() *JwtService
New constructs a new Secure instance with supplied options.
func (*JwtService) CheckJWT ¶
func (m *JwtService) CheckJWT(ctx iris.Context) error
CheckJWT the main functionality, checks for token
func (*JwtService) Serve ¶
func (m *JwtService) Serve(ctx iris.Context)
Serve the middleware's action
type TokenService ¶
type TokenService struct { Middleware *JwtService `inject:""` Enforcer *casbin.Enforcer `inject:""` UserRepo *repo.UserRepo `inject:""` TokenRepo *repo.TokenRepo `inject:""` }
func NewTokenService ¶
func NewTokenService() *TokenService
func (*TokenService) Get ¶
func (m *TokenService) Get(ctx iris.Context) *jwt.Token
Get returns the user (&token) information for this client/request
func (*TokenService) GetCredentials ¶
func (m *TokenService) GetCredentials(value *jwt.Token, ctx iris.Context) ( credentials *domain.UserCredentials, err error)
func (*TokenService) Serve ¶
func (m *TokenService) Serve(ctx iris.Context)
Click to show internal directories.
Click to hide internal directories.