mirror of
https://github.com/gogrlx/nats-server.git
synced 2026-04-02 03:38:42 -07:00
fix jwt unit test by ensuring activation issue time is bigger than expiration (#3275)
Signed-off-by: Matthias Hanel <mh@synadia.com>
This commit is contained in:
@@ -4326,9 +4326,15 @@ func TestJWTActivationRevocation(t *testing.T) {
|
||||
aExp1Jwt := encodeClaim(t, aExpClaim, aExpPub)
|
||||
aExpCreds := newUser(t, aExpKp)
|
||||
|
||||
time.Sleep(1100 * time.Millisecond)
|
||||
aImpKp, aImpPub := createKey(t)
|
||||
|
||||
ac := &jwt.ActivationClaims{}
|
||||
ac.Subject = aImpPub
|
||||
ac.ImportSubject = "foo"
|
||||
ac.ImportType = jwt.Stream
|
||||
token, err := ac.Encode(aExpKp)
|
||||
require_NoError(t, err)
|
||||
|
||||
revPubKey := aImpPub
|
||||
if all {
|
||||
revPubKey = jwt.All
|
||||
@@ -4340,13 +4346,6 @@ func TestJWTActivationRevocation(t *testing.T) {
|
||||
aExpClaim.Exports[0].ClearRevocation(revPubKey)
|
||||
aExp3Jwt := encodeClaim(t, aExpClaim, aExpPub)
|
||||
|
||||
ac := &jwt.ActivationClaims{}
|
||||
ac.Subject = aImpPub
|
||||
ac.ImportSubject = "foo"
|
||||
ac.ImportType = jwt.Stream
|
||||
token, err := ac.Encode(aExpKp)
|
||||
require_NoError(t, err)
|
||||
|
||||
aImpClaim := jwt.NewAccountClaims(aImpPub)
|
||||
aImpClaim.Name = "Import"
|
||||
aImpClaim.Imports.Add(&jwt.Import{
|
||||
|
||||
Reference in New Issue
Block a user