Skip to content

Commit

Permalink
Merge pull request #4678 from hypothesis/remove-future-token-verify-t…
Browse files Browse the repository at this point in the history
…ests

Don't test that JWT's issued in future are invalid

I'm optimistically going to assume that there aren't any objections. :)
  • Loading branch information
robertknight authored Nov 8, 2017
2 parents 34438d3 + ddec2c4 commit bd8f6e5
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 14 deletions.
5 changes: 0 additions & 5 deletions tests/h/auth/tokens_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,11 +48,6 @@ def test_token_with_past_expiry_is_not_valid(self):
lambda k: jwt.encode({'exp': _seconds_from_now(-3600)},
key=k),

# Issued in the future
lambda k: jwt.encode({'exp': _seconds_from_now(3600),
'iat': _seconds_from_now(1800)},
key=k),

# Incorrect encoding key
lambda k: jwt.encode({'exp': _seconds_from_now(3600)},
key='somethingelse'),
Expand Down
9 changes: 0 additions & 9 deletions tests/h/oauth/jwt_grant_token_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -173,15 +173,6 @@ def test_init_raises_for_nbf_claim_in_future(self, claims):

assert exc.value.description == 'Grant token is not yet valid.'

def test_init_raises_for_iat_claim_in_future(self, claims):
claims['iat'] = epoch(delta=timedelta(minutes=13))
jwttok = jwt_token(claims)

with pytest.raises(InvalidGrantError) as exc:
VerifiedJWTGrantToken(jwttok, 'top-secret', 'test-audience')

assert exc.value.description == 'Grant token issue time (iat) is in the future.'

def test_expiry_returns_exp_claim(self, claims):
now = datetime.utcnow().replace(microsecond=0)
delta = timedelta(minutes=2)
Expand Down

0 comments on commit bd8f6e5

Please sign in to comment.