Beispiel #1
0
 def test_verify_bad_signature(self):
     token = sign_task("xyz", pvt_key=PVT_KEY)
     self.assertRaises(jws.JWSError, jws.verify, token, OTHER_PUB_KEY,
                       [ALGORITHMS.RS512])
Beispiel #2
0
 def test_exp_int(self):
     token = sign_task("xyz", pvt_key=PVT_KEY)
     claims = jwt.decode(token, PUB_KEY, algorithms=[ALGORITHMS.RS512])
     assert isinstance(claims["exp"], int)
Beispiel #3
0
 def test_verify(self):
     token = sign_task("xyz", pvt_key=PVT_KEY)
     claims = jws.verify(token, PUB_KEY, algorithms=[ALGORITHMS.RS512])
     assert claims["taskId"] == "xyz"
Beispiel #4
0
 def test_task_id(self):
     token = sign_task("xyz", pvt_key=PVT_KEY)
     claims = jwt.decode(token, PUB_KEY, algorithms=[ALGORITHMS.RS512])
     assert claims["taskId"] == "xyz"
Beispiel #5
0
 def test_exp(self):
     token = sign_task("xyz", pvt_key=PVT_KEY)
     claims = jwt.decode(token, PUB_KEY, algorithms=[ALGORITHMS.RS512])
     assert "exp" in claims
Beispiel #6
0
 def test_verify_bad_signature(self):
     token = sign_task("xyz", pvt_key=PVT_KEY)
     self.assertRaises(jws.JWSError, jws.verify, token, OTHER_PUB_KEY,
                       [ALGORITHMS.RS512])
Beispiel #7
0
 def test_verify(self):
     token = sign_task("xyz", pvt_key=PVT_KEY)
     claims = jws.verify(token, PUB_KEY, algorithms=[ALGORITHMS.RS512])
     assert claims["taskId"] == "xyz"
Beispiel #8
0
 def test_exp_int(self):
     token = sign_task("xyz", pvt_key=PVT_KEY)
     claims = jwt.decode(token, PUB_KEY, algorithms=[ALGORITHMS.RS512])
     assert isinstance(claims["exp"], int)
Beispiel #9
0
 def test_exp(self):
     token = sign_task("xyz", pvt_key=PVT_KEY)
     claims = jwt.decode(token, PUB_KEY, algorithms=[ALGORITHMS.RS512])
     assert "exp" in claims
Beispiel #10
0
 def test_task_id(self):
     token = sign_task("xyz", pvt_key=PVT_KEY)
     claims = jwt.decode(token, PUB_KEY, algorithms=[ALGORITHMS.RS512])
     assert claims["taskId"] == "xyz"