Documentation
¶
Index ¶
- 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 GetAccessTokenKey() string
- func GetRefreshTokenKey() string
- func GetTokenDuration() time.Duration
- 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 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 TokenPairRequester
- type TokenRequester
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Adapt ¶
func Adapt(hf http.HandlerFunc, adapters ...HandlerFuncAdapter) http.HandlerFunc
func AttemptTokenExchange ¶
func GenerateRandomByteArray ¶
func GetAccessTokenKey ¶
func GetAccessTokenKey() string
func GetRefreshTokenKey ¶
func GetRefreshTokenKey() string
func GetTokenDuration ¶
func NewTokenPair ¶
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(tokenRequester TokenRequester, adaptToken bool) HandlerFuncAdapter
func GenerateTokenPair ¶
func GenerateTokenPair(tokenPairRequester TokenPairRequester, adaptTokens bool) HandlerFuncAdapter
type TokenPairRequester ¶
Click to show internal directories.
Click to hide internal directories.