コード例 #1
0
ファイル: jwt_spec.py プロジェクト: davedoesdev/python-jwt
 def topic(self, topic):
     """ Set clock and verify token with minted key """
     clock, sjwt = topic
     clock_load(clock)
     pubk = None if keyless else generated_keys[alg]
     return jwt.verify_jwt(sjwt, pubk, ['none'] if keyless else [alg],
                           timedelta(seconds=iat_skew))
コード例 #2
0
ファイル: jwt_spec.py プロジェクト: davedoesdev/python-jwt
 def topic(self, topic):
     """ Set clock and verify token """
     clock, sjwt = topic
     clock_load(clock)
     if callable(pubk):
         return pubk(sjwt, timedelta(seconds=iat_skew))
     return jwt.verify_jwt(sjwt, pubk, ['none'] if keyless else [alg],
                           timedelta(seconds=iat_skew))
コード例 #3
0
 def topic(self, topic):
     """ Verify the token without requiring all claims """
     adjust = orig_datetime.utcnow() - orig_datetime.utcfromtimestamp(0)
     clock_tick(-adjust)
     r = jwt.verify_jwt(topic,
                        None,
                        ['RS256', 'none'],
                        iat_skew=adjust,
                        checks_optional=True)
     clock_reset()
     return r
コード例 #4
0
 def topic(self, topic):
     """ Verify the token """
     return jwt.verify_jwt(topic, key, [])
コード例 #5
0
 def topic(self, topic):
     """ Verify the token """
     return jwt.verify_jwt(topic, key, {alg: True})
コード例 #6
0
 def topic(self, topic):
     """ Verify the token with some public key """
     return jwt.verify_jwt(
         topic, JWK(kty='oct', k=base64url_encode('anysecrethere')))
コード例 #7
0
 def topic(self, topic):
     """ Verify the token """
     return jwt.verify_jwt(topic, pem_key, ['RS256'])
コード例 #8
0
 def topic(self, topic):
     """ Verify the token with no public key """
     return jwt.verify_jwt(topic)
コード例 #9
0
 def topic(self, topic):
     """ Verify the token with some public key and none alg allowed """
     return jwt.verify_jwt(topic, JWK(kty='oct', k=base64url_encode('anysecrethere')), ['none'])
コード例 #10
0
 def topic(self, topic):
     """ Verify the token """
     return jwt.verify_jwt(topic, pem_key, ['RS256'])
コード例 #11
0
 def topic(self, topic):
     """ Verify the token """
     return jwt.verify_jwt(topic, None, ['RS256', 'none'])
コード例 #12
0
 def topic(self, topic):
     """ Verify token """
     return jwt.verify_jwt(topic, key, [alg])
コード例 #13
0
 def topic(self, topic):
     """ Verify token with no public key and allow RS256 """
     return jwt.verify_jwt(topic, None, ['RS256'])
コード例 #14
0
 def topic(self, topic):
     """ Verify the token with no public key """
     return jwt.verify_jwt(topic)
コード例 #15
0
 def topic(self, topic):
     """ Verify the token """
     return jwt.verify_jwt(topic, key, [a for a in all_algs if a != alg])
コード例 #16
0
 def topic(self, topic):
     """ Verify the token """
     return jwt.verify_jwt(topic, rsa_pub_key)
コード例 #17
0
 def topic(self, topic):
     """ Verify the token """
     return jwt.verify_jwt(topic, key, [alg], checks_optional=True)
コード例 #18
0
 def topic(self, topic):
     """ Verify the token """
     return jwt.verify_jwt(topic, None, ['none'])
コード例 #19
0
 def topic(self, topic):
     """ Verify the token """
     return jwt.verify_jwt(topic, None, ['none'], checks_optional=True)
コード例 #20
0
 def topic(self, topic):
     """ Verify the token with some public key """
     return jwt.verify_jwt(topic, JWK(kty='oct', k=base64url_encode('anysecrethere')))
コード例 #21
0
 def topic(self, topic):
     """ Verify the token """
     return jwt.verify_jwt(topic, key, all_algs)
コード例 #22
0
 def topic(self, topic):
     """ Verify token with no public key and allow RS256 """
     return jwt.verify_jwt(topic, None, ['RS256'])
コード例 #23
0
 def topic(self, topic):
     """ Verify the token """
     return jwt.verify_jwt(topic, key, [a for a in all_algs if a != alg])
コード例 #24
0
 def topic(self, topic):
     """ Verify the token """
     return jwt.verify_jwt(topic, pub_key)
コード例 #25
0
 def topic(self, topic):
     """ Verify the token with some public key and none alg allowed """
     return jwt.verify_jwt(
         topic, JWK(kty='oct', k=base64url_encode('anysecrethere')),
         ['none'])