node: set JWT expiry to 60 seconds (#25416)

* node: set JWT expiry to 60 seconds

* node: rename var
This commit is contained in:
Marius van der Wijden
2022-07-28 09:30:50 +03:00
committed by GitHub
parent c02b0488fb
commit f26b63089a
2 changed files with 6 additions and 4 deletions
+2 -2
View File
@@ -356,11 +356,11 @@ func TestJWT(t *testing.T) {
expFail := []func() string{
// future
func() string {
return fmt.Sprintf("Bearer %v", issueToken(secret, nil, testClaim{"iat": time.Now().Unix() + 6}))
return fmt.Sprintf("Bearer %v", issueToken(secret, nil, testClaim{"iat": time.Now().Unix() + int64(jwtExpiryTimeout.Seconds()) + 1}))
},
// stale
func() string {
return fmt.Sprintf("Bearer %v", issueToken(secret, nil, testClaim{"iat": time.Now().Unix() - 6}))
return fmt.Sprintf("Bearer %v", issueToken(secret, nil, testClaim{"iat": time.Now().Unix() - int64(jwtExpiryTimeout.Seconds()) - 1}))
},
// wrong algo
func() string {