Documentation ¶
Index ¶
- type Claims
- type Issuer
- func (i *Issuer) Claims(hash string, refresh int, identifier, role string) *Claims
- func (i *Issuer) Copy() *Issuer
- func (i *Issuer) Token(hash string, refresh int, identifier, role string) (string, error)
- func (i *Issuer) Validate(signedString string) (*Claims, error)
- func (i *Issuer) WithAud(aud string) *Issuer
- func (i *Issuer) WithDur(dur time.Duration) *Issuer
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Claims ¶
type Claims struct { Hash string `json:"covidtrace:hash,omitempty"` Identifier string `json:"covidtrace:identifier,omitempty"` Refreshed int `json:"covidtrace:refreshed"` Role string `json:"covidtrace:role,omitempty"` jwt.StandardClaims }
Claims represents the JWT claims covidtrace cares about
type Issuer ¶
type Issuer struct {
// contains filtered or unexported fields
}
Issuer is the core covidtrace/jwt type. It exposes methods to issue and verify tokens.
func (*Issuer) Token ¶
Token handles generating a signed JWT token with the given `hash` and `refresh` count
func (*Issuer) Validate ¶
Validate handles ensuring `signedString` is a valid JWT issued by this issuer. It returns the `hash` and `refreshed` claims, or an `error` if the token is invalid
Click to show internal directories.
Click to hide internal directories.