Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
from jwcrypto.jwk import JWKSet
from os import path
jwkeys = JWKSet()
jwk_sets = [
'google'
]
key_path = path.abspath(path.dirname(__file__))
for key in jwk_sets:
key_name = key + '.jwk.json'
with open(path.join(key_path, key_name), 'r') as keyfile:
jwkeys.import_keyset(keyfile.read())
from urllib.request import urlopen
from jwcrypto.jwk import JWKSet
jwkeys = JWKSet()
jwk_sets = [
'https://www.googleapis.com/oauth2/v3/certs'
]
def load_keys():
for keyurl in jwk_sets:
with urlopen(keyurl) as key:
jwkeys.import_keyset(key.read().decode())