forked from remote/oauth2
Introduction of cache interface and a file cacher.
This commit is contained in:
6
jwt.go
6
jwt.go
@@ -66,6 +66,7 @@ type JWTConfig struct {
|
||||
opts *JWTOptions
|
||||
aud string
|
||||
signature []byte
|
||||
cache Cache
|
||||
}
|
||||
|
||||
// Options returns JWT options.
|
||||
@@ -153,3 +154,8 @@ func (c *JWTConfig) FetchToken(existing *Token) (token *Token, err error) {
|
||||
token.Expiry = time.Now().Add(time.Duration(b.ExpiresIn) * time.Second)
|
||||
return
|
||||
}
|
||||
|
||||
// Cache returns a cache if specified, otherwise nil.
|
||||
func (c *JWTConfig) Cache() Cache {
|
||||
return c.cache
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user