Documentation ¶
Index ¶
- type BaseConfig
- type CacheConfig
- type Config
- type FrontConfig
- type MongodbConfig
- type Service
- func (self *Service) BearerAuth(r *http.Request) (string, bool)
- func (self *Service) CheckRight(reqPath, httpMethod string, userID primitive.ObjectID) (allow bool)
- func (self *Service) CreateToken(ctx context.Context, u model.User, ip, userAgent string, geo [2]float64) (m help.M, err error)
- func (self *Service) GetApplications(userID primitive.ObjectID, checkRole bool) help.M
- func (self *Service) GetClaims(r *http.Request) (claims *predefined.JWTTokenClaims)
- func (self *Service) GetPermissionCode(appsSorted []help.M) []string
- func (self *Service) GetRoute(appsSorted []help.M) []help.M
- func (self *Service) GetRoutePath(appPath, modulePath, actionPath, method string) string
- func (self *Service) GetUserInfo(r *http.Request) (u model.User, found bool)
- func (self *Service) GetValidClaims(r *http.Request) (claims *predefined.JWTTokenClaims, u model.User)
- func (self *Service) Login(username, password, ip, userAgent string, geo [2]float64) (m help.M, err error)
- func (self *Service) Logout(r *http.Request)
- func (self *Service) SortApps(apps map[string]model.Application) []help.M
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BaseConfig ¶
type BaseConfig struct { URBAC bool `json:"urbac"` CheckRight bool `json:"check_right"` TokenByUrlQuery bool `json:"token_by_url_query"` TokenByUrlQueryName string `json:"token_by_url_query_name"` DefaultEnableApp bool `json:"default_enable_app"` DefaultEnableModule bool `json:"default_enable_module"` DefaultEnableAction bool `json:"default_enable_action"` IgnoreAppModuleInfo []string `json:"ignore_app_module_info"` IgnoreCheckLoginPath map[string][]string `json:"ignore_check_login_path"` IgnoreCheckRightPath map[string][]string `json:"ignore_check_right_path"` TokenExpireDuration config.Duration `json:"token_expire_duration"` AllowMultiLogin bool `json:"allow_multi_login"` AllowMultiLoginNum int64 `json:"allow_multi_login_num"` }
type CacheConfig ¶
type Config ¶
type Config struct { MongodbConfig CacheConfig BaseConfig FrontConfig }
type FrontConfig ¶
type MongodbConfig ¶
type Service ¶
func (*Service) CheckRight ¶
func (*Service) CreateToken ¶
func (*Service) GetApplications ¶
func (*Service) GetClaims ¶
func (self *Service) GetClaims(r *http.Request) (claims *predefined.JWTTokenClaims)
func (*Service) GetPermissionCode ¶
func (*Service) GetRoutePath ¶
func (*Service) GetUserInfo ¶
func (*Service) GetValidClaims ¶
func (self *Service) GetValidClaims(r *http.Request) (claims *predefined.JWTTokenClaims, u model.User)
Click to show internal directories.
Click to hide internal directories.