Documentation ¶
Index ¶
- func GenerateClient(session Session, app app.Info, auth string, expire int32) (string, error)
- func GenerateServer(session Session, app app.Info, auth string, expire int32) (string, error)
- func GenerateServerToken(source app.Source) string
- func IsClientAuthenticate(source app.Source) bool
- func IsServerAuthenticate(source app.Source) bool
- func SetClientAuthenticate(auth Check)
- func SetServerAuthenticate(auth Check)
- func SourceAt(source string) string
- func SourceKeyForClient(source app.Source) string
- func SourceKeyForServer(source app.Source) string
- func UserTokenToServerToken(userToken, source string) (string, error)
- type Authenticate
- func (t *Authenticate) Check(source app.Source, token string) (*Token, error)
- func (t *Authenticate) Generate(session Session, app app.Info, auth string, expire int32) (string, error)
- func (t *Authenticate) IsEnabled(source app.Source) bool
- func (t *Authenticate) SetEnabled(source app.Source, enable bool)
- type AuthenticateFunc
- type Check
- type Item
- type Mgr
- func (mgr *Mgr) AddItem(source app.Source, item Item)
- func (mgr *Mgr) AddItemWithKey(key string, item Item)
- func (mgr *Mgr) AddSecret(source app.Source, secret server.Secret)
- func (mgr *Mgr) AddSecretWithKey(key string, secret server.Secret)
- func (mgr *Mgr) GetSecret(source app.Source) server.Secret
- func (mgr *Mgr) IsEnabled(source app.Source) bool
- func (mgr *Mgr) Load(file string) error
- func (mgr *Mgr) SetEnabled(source app.Source, enable bool)
- type SecretMgr
- type Session
- type SourceKeyFuncs
- type Token
- type TokenKey
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GenerateClient ¶ added in v0.2.6
func GenerateServer ¶ added in v0.2.6
func GenerateServerToken ¶ added in v0.2.6
func IsClientAuthenticate ¶ added in v0.2.6
func IsServerAuthenticate ¶ added in v0.2.6
func SetClientAuthenticate ¶ added in v0.2.6
func SetClientAuthenticate(auth Check)
func SetServerAuthenticate ¶ added in v0.2.6
func SetServerAuthenticate(auth Check)
func SourceKeyForClient ¶
func SourceKeyForServer ¶
func UserTokenToServerToken ¶ added in v0.2.6
UserTokenToServerToken 从用户端到服务器,服务器到服务器之间需要的认证
Types ¶
type Authenticate ¶
type Authenticate struct {
// contains filtered or unexported fields
}
func New ¶
func New(mgr SecretMgr) *Authenticate
func (*Authenticate) Generate ¶
func (t *Authenticate) Generate(session Session, app app.Info, auth string, expire int32) (string, error)
Generate implement server.Authenticate interface
func (*Authenticate) IsEnabled ¶
func (t *Authenticate) IsEnabled(source app.Source) bool
IsEnabled implement server.Authenticate interface
func (*Authenticate) SetEnabled ¶
func (t *Authenticate) SetEnabled(source app.Source, enable bool)
SetEnabled implement server.Authenticate interface
type AuthenticateFunc ¶ added in v0.2.6
type Mgr ¶
type Mgr struct {
// contains filtered or unexported fields
}
func NewMgr ¶
func NewMgr(skFuncs SourceKeyFuncs) *Mgr
func (*Mgr) AddItemWithKey ¶
type SourceKeyFuncs ¶
SourceKeyFuncs source to key function
type Token ¶ added in v0.2.6
func AuthenticateWithClient ¶ added in v0.2.6
func AuthenticateWithServer ¶ added in v0.2.6
func (*Token) GetAuthType ¶ added in v0.2.6
Click to show internal directories.
Click to hide internal directories.