Documentation ¶
Index ¶
- func CreateAccessToken(config config.Config, keyPairs []PublicPrivateRSAKeyPair, identifier string) (string, error)
- func CreateRefreshToken(config config.Config, keyPairs []PublicPrivateRSAKeyPair, identifier string) (string, error)
- func GetAllPublicKeys(keyPairs []PublicPrivateRSAKeyPair) []rsa.PublicKey
- type AllParseAttemptsFailed
- type ByValidFrom
- type DefaultClaims
- type InvalidTokenFound
- type PublicPrivateRSAKeyPair
- type TokenExpired
- type UserInfo
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CreateAccessToken ¶
func CreateRefreshToken ¶
func GetAllPublicKeys ¶
func GetAllPublicKeys(keyPairs []PublicPrivateRSAKeyPair) []rsa.PublicKey
Types ¶
type AllParseAttemptsFailed ¶
type AllParseAttemptsFailed struct{}
func (*AllParseAttemptsFailed) Error ¶
func (e *AllParseAttemptsFailed) Error() string
type ByValidFrom ¶
type ByValidFrom []PublicPrivateRSAKeyPair
func (ByValidFrom) Len ¶
func (v ByValidFrom) Len() int
func (ByValidFrom) Less ¶
func (v ByValidFrom) Less(i, j int) bool
func (ByValidFrom) Swap ¶
func (v ByValidFrom) Swap(i, j int)
type DefaultClaims ¶
type DefaultClaims struct { *jwt.StandardClaims TokenType string UserInfo }
func ValidateAccessToken ¶
func ValidateAccessToken(keyPairs []PublicPrivateRSAKeyPair, token string) (*DefaultClaims, error)
func ValidateRefreshToken ¶
func ValidateRefreshToken(keyPairs []PublicPrivateRSAKeyPair, token string) (*DefaultClaims, error)
type InvalidTokenFound ¶
type InvalidTokenFound struct{}
func (*InvalidTokenFound) Error ¶
func (e *InvalidTokenFound) Error() string
type PublicPrivateRSAKeyPair ¶
type PublicPrivateRSAKeyPair struct { ValidFrom int64 PrivateKey *rsa.PrivateKey PublicKeyPEM string PublicKey *rsa.PublicKey }
func GetKeyForTime ¶
func GetKeyForTime(keyPairs []PublicPrivateRSAKeyPair, time time.Time) *PublicPrivateRSAKeyPair
func KeyPairForTesting ¶
func KeyPairForTesting() []PublicPrivateRSAKeyPair
func ReadRSAKeysFromPath ¶
func ReadRSAKeysFromPath(path string) ([]PublicPrivateRSAKeyPair, error)
type TokenExpired ¶
type TokenExpired struct{}
func (*TokenExpired) Error ¶
func (e *TokenExpired) Error() string
Click to show internal directories.
Click to hide internal directories.