Documentation
¶
Index ¶
- Variables
- type Controller
- func (x *Controller) GetRefreshCode(ctx context.Context, c *app.RequestContext)
- func (x *Controller) GetUser(ctx context.Context, c *app.RequestContext)
- func (x *Controller) Login(ctx context.Context, c *app.RequestContext)
- func (x *Controller) Logout(ctx context.Context, c *app.RequestContext)
- func (x *Controller) Options(ctx context.Context, c *app.RequestContext)
- func (x *Controller) Ping(ctx context.Context, c *app.RequestContext)
- func (x *Controller) RefreshToken(ctx context.Context, c *app.RequestContext)
- func (x *Controller) SetUser(ctx context.Context, c *app.RequestContext)
- func (x *Controller) UnsetUser(ctx context.Context, c *app.RequestContext)
- func (x *Controller) Verify(ctx context.Context, c *app.RequestContext)
- type LoginDto
- type OptionsDto
- type RefreshTokenDto
- type Service
- func (x *Service) GetRefreshCode(ctx context.Context, userId string) (code string, err error)
- func (x *Service) GetUser(ctx context.Context, userId string) (data utils.H, err error)
- func (x *Service) Login(ctx context.Context, email string, password string, ...) (ts string, err error)
- func (x *Service) Logout(ctx context.Context, userId string) (err error)
- func (x *Service) RefreshToken(ctx context.Context, claims passport.Claims, code string) (ts string, err error)
- func (x *Service) SetUser(ctx context.Context, userId string, update bson.M) (result interface{}, err error)
- func (x *Service) Verify(ctx context.Context, ts string) (claims passport.Claims, err error)
- func (x *Service) WriteLoginLog(ctx context.Context, metadata model.LoginMetadata, data model.LoginData) (err error)
- type SetUserDto
- type UnsetUserDto
Constants ¶
This section is empty.
Variables ¶
View Source
var MsgAuthenticationExpired = "authentication has expired, please log in again"
Functions ¶
This section is empty.
Types ¶
type Controller ¶
func (*Controller) GetRefreshCode ¶
func (x *Controller) GetRefreshCode(ctx context.Context, c *app.RequestContext)
GetRefreshCode @router /code [GET]
func (*Controller) GetUser ¶
func (x *Controller) GetUser(ctx context.Context, c *app.RequestContext)
GetUser @router /user [GET]
func (*Controller) Login ¶ added in v0.0.29
func (x *Controller) Login(ctx context.Context, c *app.RequestContext)
Login @router /login [POST]
func (*Controller) Logout ¶ added in v0.0.29
func (x *Controller) Logout(ctx context.Context, c *app.RequestContext)
Logout @router /logout [POST]
func (*Controller) Options ¶ added in v0.0.29
func (x *Controller) Options(ctx context.Context, c *app.RequestContext)
Options 返回通用配置
func (*Controller) Ping ¶ added in v0.0.29
func (x *Controller) Ping(ctx context.Context, c *app.RequestContext)
Ping @router / [GET]
func (*Controller) RefreshToken ¶ added in v0.0.29
func (x *Controller) RefreshToken(ctx context.Context, c *app.RequestContext)
RefreshToken @router /refresh_token [POST]
func (*Controller) SetUser ¶
func (x *Controller) SetUser(ctx context.Context, c *app.RequestContext)
SetUser @router /user [POST]
func (*Controller) UnsetUser ¶
func (x *Controller) UnsetUser(ctx context.Context, c *app.RequestContext)
func (*Controller) Verify ¶ added in v0.0.29
func (x *Controller) Verify(ctx context.Context, c *app.RequestContext)
Verify @router /verify [GET]
type OptionsDto ¶ added in v0.0.29
type OptionsDto struct {
Type string `query:"type"`
}
type RefreshTokenDto ¶ added in v0.0.29
type RefreshTokenDto struct {
Code string `json:"code,required"`
}
type Service ¶
type Service struct {
*common.Inject
Passport *passport.Passport
Locker *locker.Locker
Captcha *captcha.Captcha
SessionsService *sessions.Service
OpenAPIService *openapi.Service
}
func (*Service) GetRefreshCode ¶
func (*Service) RefreshToken ¶ added in v0.0.29
func (*Service) WriteLoginLog ¶ added in v0.0.29
type SetUserDto ¶ added in v0.0.29
type SetUserDto struct {
Set string `json:"$set,required" vd:"in($, 'email', 'name', 'avatar', 'password', 'backup_email')"`
Email string `json:"email,omitempty" vd:"(Set)$!='Email' || email($);msg:'must be email'"`
BackupEmail string `json:"backup_email,omitempty" vd:"(Set)$!='BackupEmail' || email($);msg:'must be email'"`
Name string `json:"name,omitempty"`
Avatar string `json:"avatar,omitempty"`
Password string `json:"password,omitempty" vd:"(Set)$!='Password' || len($)>8;msg:'must be greater than 8 characters'"`
}
type UnsetUserDto ¶ added in v0.0.29
type UnsetUserDto struct {
Key string `path:"key,required" vd:"in($, 'feishu')"`
}
Click to show internal directories.
Click to hide internal directories.