summaryrefslogtreecommitdiff
path: root/jws_validator.go
diff options
context:
space:
mode:
Diffstat (limited to 'jws_validator.go')
-rw-r--r--jws_validator.go9
1 files changed, 7 insertions, 2 deletions
diff --git a/jws_validator.go b/jws_validator.go
index 0b2467f..9abaaae 100644
--- a/jws_validator.go
+++ b/jws_validator.go
@@ -1,11 +1,12 @@
1package main 1package main
2 2
3import ( 3import (
4 "net/url"
5 "time"
6
4 "github.com/pkg/errors" 7 "github.com/pkg/errors"
5 "gopkg.in/square/go-jose.v2" 8 "gopkg.in/square/go-jose.v2"
6 "gopkg.in/square/go-jose.v2/jwt" 9 "gopkg.in/square/go-jose.v2/jwt"
7 "net/url"
8 "time"
9) 10)
10 11
11// TODO 12// TODO
@@ -26,6 +27,10 @@ type Claims struct {
26 jwt.Claims 27 jwt.Claims
27} 28}
28 29
30func (c *Claims) Age() int64 {
31 return int64(time.Since(c.IssuedAt.Time()).Minutes())
32}
33
29type JWSValidationContext struct { 34type JWSValidationContext struct {
30 KeyFetcher JWKSFetcher 35 KeyFetcher JWKSFetcher
31 Issuer string 36 Issuer string