Documentation
¶
Index ¶
- Variables
- func PermissionCheckHandler(auth auth) func(h http.Handler) http.Handler
- func URLSignCheckHandler(auth auth) func(h http.Handler) http.Handler
- type Authenticator
- func (a *Authenticator) Authorize(password string) bool
- func (a *Authenticator) Enforce(apiKey, obj, act string) (bool, error)
- func (a *Authenticator) GenerateKey(role string, expiryDuration int) (string, error)
- func (a *Authenticator) RefreshKey(apiKey string, expiryDuration int) (string, error)
- func (a *Authenticator) SecretKey(apiKey string) (string, error)
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrExpiry = errors.New("expiry duration must be a positive number")
View Source
var ErrTokenExpired = errors.New("token expired")
Functions ¶
func PermissionCheckHandler ¶
Types ¶
type Authenticator ¶
type Authenticator struct {
// contains filtered or unexported fields
}
func (*Authenticator) Authorize ¶
func (a *Authenticator) Authorize(password string) bool
func (*Authenticator) Enforce ¶
func (a *Authenticator) Enforce(apiKey, obj, act string) (bool, error)
func (*Authenticator) GenerateKey ¶
func (a *Authenticator) GenerateKey(role string, expiryDuration int) (string, error)
func (*Authenticator) RefreshKey ¶
func (a *Authenticator) RefreshKey(apiKey string, expiryDuration int) (string, error)
Click to show internal directories.
Click to hide internal directories.