Documentation ¶
Index ¶
- Variables
- func RsaPrivateKeyFromPem(source func() []byte) (*rsa.PrivateKey, error)
- func RsaPublicKeyFromPem(source func() []byte) (func(*jwt.Token) (interface{}, error), error)
- type Token
- func (this *Token) Add(key string, value interface{}) *Token
- func (this *Token) Get(key string) interface{}
- func (this *Token) GetString(key string) string
- func (this *Token) HasKey(key string) bool
- func (this *Token) SetExpiration(d time.Duration)
- func (this *Token) SetHeader(header http.Header, key func() []byte) error
- func (this *Token) SignedString(key func() []byte) (string, error)
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrNoPublicKeyFunc = errors.New("no-public-key-func") ErrNoPrivateKeyFunc = errors.New("no-private-key-func") ErrInvalidAuthToken = errors.New("invalid-token") ErrExpiredAuthToken = errors.New("token-expired") ErrNoAuthToken = errors.New("no-auth-token") )
View Source
var (
EmptyExpiringToken = NewToken(0 * time.Second)
)
Functions ¶
func RsaPrivateKeyFromPem ¶
func RsaPrivateKeyFromPem(source func() []byte) (*rsa.PrivateKey, error)
func RsaPublicKeyFromPem ¶
Types ¶
type Token ¶
type Token struct {
// contains filtered or unexported fields
}
JWT token that uses RSA public/private key pairs for signing and verification. The signer uses a RSA private key to sign while the receiver verifies the key using the public key to verify the signature.
func TokenFromHttp ¶
parses from header or query https://github.com/dgrijalva/jwt-go/blob/master/token.go#L94 Either Authorization: Bearer .... Or query parameter 'access_token=...'
func TokenFromString ¶
func (*Token) SetExpiration ¶
Click to show internal directories.
Click to hide internal directories.