Documentation ¶
Index ¶
- type TokenAuth
- func (TokenAuth) AddRecord(uid types.Uid, secret []byte, lifetime time.Duration) (int, auth.AuthErr)
- func (ta *TokenAuth) Authenticate(token []byte) (types.Uid, int, time.Time, auth.AuthErr)
- func (ta *TokenAuth) GenSecret(uid types.Uid, authLvl int, lifetime time.Duration) ([]byte, time.Time, auth.AuthErr)
- func (ta *TokenAuth) Init(jsonconf string) error
- func (TokenAuth) IsUnique(token []byte) (bool, auth.AuthErr)
- func (TokenAuth) UpdateRecord(uid types.Uid, secret []byte, lifetime time.Duration) auth.AuthErr
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type TokenAuth ¶
type TokenAuth struct {
// contains filtered or unexported fields
}
TokenAuth is a singleton instance of the authenticator.
func (TokenAuth) AddRecord ¶
func (TokenAuth) AddRecord(uid types.Uid, secret []byte, lifetime time.Duration) (int, auth.AuthErr)
AddRecord is not supprted, will produce an error.
func (*TokenAuth) Authenticate ¶
Authenticate checks validity of provided token.
func (*TokenAuth) GenSecret ¶
func (ta *TokenAuth) GenSecret(uid types.Uid, authLvl int, lifetime time.Duration) ([]byte, time.Time, auth.AuthErr)
GenSecret generates a new token.
func (*TokenAuth) Init ¶
Init initializes the authenticator: parses the config and sets salt, serial number and lifetime.
Click to show internal directories.
Click to hide internal directories.