Documentation
¶
Index ¶
- func NewMainModule() *application.ModuleBuilder
- func NewTestModule() *application.ModuleBuilder
- type Context
- type ContextFactory
- type Session
- type SessionGetter
- type SessionLoader
- type SessionManager
- type SessionProvider
- type SessionRegistration
- type SessionRegistry
- type SessionSaver
- type SessionService
- type SessionSetter
- type Token
- type TokenGetter
- type TokenLoader
- type TokenManager
- type TokenSaver
- type TokenSetter
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewMainModule ¶ added in v1.0.45
func NewMainModule() *application.ModuleBuilder
NewMainModule 导出模块[github.com/starter-go/security]
func NewTestModule ¶ added in v1.0.45
func NewTestModule() *application.ModuleBuilder
NewTestModule 导出模块[github.com/starter-go/security#test]
Types ¶
type Context ¶ added in v1.0.48
type Context struct {
Parent context.Context
// token
DirtyToken Token // 表示还没有保存的数据集
Token Token
TokenManager TokenManager
// session
DirtySession Session // 表示还没有保存的数据集
Session Session
SessionManager SessionManager
}
Context 包含当前上下文中跟安全问题相关的信息
type ContextFactory ¶ added in v1.0.48
ContextFactory ...
type Session ¶ added in v1.0.20
type Session interface {
SessionID() rbac.SessionID
UserID() rbac.UserID
UUID() lang.UUID
GetProperties() properties.Table
SetProperty(name, value string)
Get() *rbac.SessionDTO
Set(s *rbac.SessionDTO)
UserName() rbac.UserName
Nickname() string
Avatar() string
Language() string
Roles() rbac.RoleNameList
HasRole(role rbac.RoleName) bool
Authenticated() bool
Create() error
// 提交已修改的内容
Commit() error
}
Session 代表当前会话
type SessionGetter ¶ added in v1.0.48
SessionGetter ...
type SessionLoader ¶ added in v1.0.48
SessionLoader ...
type SessionManager ¶ added in v1.0.48
type SessionManager interface {
SessionGetter
SessionSetter
SessionLoader
SessionSaver
}
SessionManager ...
type SessionProvider ¶ added in v1.0.20
type SessionProvider interface {
Support(c context.Context) bool
Current(c context.Context) (Session, error)
}
SessionProvider 会话的实现方案
type SessionRegistration ¶ added in v1.0.20
type SessionRegistration struct {
Name string
Enabled bool
Priority int
Provider SessionProvider
}
SessionRegistration 会话方案的注册信息
type SessionRegistry ¶ added in v1.0.20
type SessionRegistry interface {
Registration() *SessionRegistration
}
SessionRegistry 会话方案的注册接口
type SessionSaver ¶ added in v1.0.48
SessionSaver ...
type SessionService ¶ added in v1.0.20
SessionService 是针对 SessionDTO 的服务
type SessionSetter ¶ added in v1.0.48
SessionSetter ...
type Token ¶ added in v1.0.48
type Token interface {
Get() *rbac.TokenDTO
Set(t *rbac.TokenDTO)
GetProperties() properties.Table
SetProperty(name, value string)
SetSessionID(sid rbac.SessionID)
GetSessionID() rbac.SessionID
Roles() rbac.RoleNameList
HasRole(role rbac.RoleName) bool
// 提交已修改的内容
Commit() error
}
Token ... 表示一个安全令牌
type TokenGetter ¶ added in v1.0.48
TokenGetter ...
type TokenLoader ¶ added in v1.0.48
TokenLoader ...
type TokenManager ¶ added in v1.0.48
type TokenManager interface {
TokenGetter
TokenSetter
TokenLoader
TokenSaver
}
TokenManager ...
type TokenSaver ¶ added in v1.0.48
TokenSaver ...
type TokenSetter ¶ added in v1.0.48
TokenSetter ...
Click to show internal directories.
Click to hide internal directories.