Documentation ¶
Index ¶
- Variables
- func GetExpiryTimeFromClaims(claims jwt.Claims) (int64, error)
- func GetIDFromClaims(claims jwt.Claims) (string, error)
- func GetKeyFromClaims(claims jwt.Claims, key string) (string, error)
- func GetSubjectFromClaims(claims jwt.Claims) (string, error)
- type AuthedIdentity
- type Claims
- type ClaimsWithSubject
Constants ¶
This section is empty.
Variables ¶
var DefaultDuration = 1 * time.Hour
DefaultDuration is the default time for which the token is valid. Used to generate the expiration time. TODO investigate what a good "Default" duration should be TODO, include refresh tokens and other complicated things as options needed for short durations like this. less needed for longer auth
var DefaultSigningMethod = jwt.SigningMethodHS512
DefaultSigningMethod is the signing method used to sign the token.
Functions ¶
func GetExpiryTimeFromClaims ¶
func GetIDFromClaims ¶
func GetKeyFromClaims ¶
func GetSubjectFromClaims ¶
Types ¶
type AuthedIdentity ¶
type AuthedIdentity struct { Viewer viewer.ViewerContext Token string }
AuthedIdentity is returned by the Authenticate method. Contains information about the identity which was just logged in
type Claims ¶
type Claims interface {
jwt.Claims
ID() string
}
Claims is needed to parse the logged in entity out of the Claims object so that we can pass to VCFromID after using a custom Claims object The ID should reference the underlying ID
type ClaimsWithSubject ¶
ClaimsWithSubject is used to get the subject out of a the Claims object so that we can then fetch information about that subject