Documentation ¶
Index ¶
- func AccessTokenKey() string
- func Adapt(hf http.HandlerFunc, adapters ...HandlerFuncAdapter) http.HandlerFunc
- func AttemptTokenExchange(accessToken string, refreshToken string, expires time.Time) (string, string, error)
- func BakeCookie(name string, value string, expires time.Time) *http.Cookie
- func GenerateRandomByteArray(length int) ([]byte, error)
- func HashData(algorithm Algorithm, data []byte, salt []byte, pepper []byte) []byte
- func NewACL(roleKey string) *acl
- func NewToken(expires time.Time, data map[string]string) (string, error)
- func NewTokenPair(expires time.Time, data map[string]string) (string, string, error)
- func RefreshTokenKey() string
- func TokenDuration() time.Duration
- func VerifyData(algorithm Algorithm, data []byte, salt []byte, pepper []byte, hash []byte) bool
- func VerifyToken(encodedSignedToken string) (bool, token, error)
- type Algorithm
- type Configuration
- type CreateToken
- type CreateTokenPair
- type HandlerFuncAdapter
- type RequestToken
- type RequestTokenPair
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AccessTokenKey ¶
func AccessTokenKey() string
func Adapt ¶
func Adapt(hf http.HandlerFunc, adapters ...HandlerFuncAdapter) http.HandlerFunc
func AttemptTokenExchange ¶
func GenerateRandomByteArray ¶
func NewTokenPair ¶
func RefreshTokenKey ¶
func RefreshTokenKey() string
func TokenDuration ¶
func VerifyData ¶
func VerifyToken ¶
Types ¶
type Configuration ¶
type Configuration struct {
// contains filtered or unexported fields
}
func (*Configuration) AddACLRule ¶
func (config *Configuration) AddACLRule(role string, route string, httpMethods []string)
func (*Configuration) CheckAccess ¶
func (*Configuration) SetACL ¶
func (config *Configuration) SetACL(acl *acl)
type CreateTokenPair ¶
type HandlerFuncAdapter ¶
type HandlerFuncAdapter func(http.HandlerFunc) http.HandlerFunc
func CheckAccess ¶
func CheckAccess(config Configuration) HandlerFuncAdapter
func CheckToken ¶
func CheckToken() HandlerFuncAdapter
func GenerateToken ¶
func GenerateToken(requestToken RequestToken) HandlerFuncAdapter
func GenerateTokenPair ¶
func GenerateTokenPair(requestTokenPair RequestTokenPair) HandlerFuncAdapter
type RequestToken ¶
type RequestTokenPair ¶
Click to show internal directories.
Click to hide internal directories.