本文整理汇总了Python中oic.utils.keyio.KeyBundle.imp_jwks方法的典型用法代码示例。如果您正苦于以下问题:Python KeyBundle.imp_jwks方法的具体用法?Python KeyBundle.imp_jwks怎么用?Python KeyBundle.imp_jwks使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类oic.utils.keyio.KeyBundle
的用法示例。
在下文中一共展示了KeyBundle.imp_jwks方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_reload
# 需要导入模块: from oic.utils.keyio import KeyBundle [as 别名]
# 或者: from oic.utils.keyio.KeyBundle import imp_jwks [as 别名]
def test_reload():
"""
Emulates what happens if you fetch keys from a remote site and
you get back the same JWKS as the last time.
"""
_jwks = JWK0
kb = KeyBundle()
kb.imp_jwks = _jwks
kb.do_keys(kb.imp_jwks['keys'])
assert len(kb) == 1
kb.do_keys(kb.imp_jwks['keys'])
assert len(kb) == 1
示例2: add_software_statement
# 需要导入模块: from oic.utils.keyio import KeyBundle [as 别名]
# 或者: from oic.utils.keyio.KeyBundle import imp_jwks [as 别名]
def add_software_statement(oper, arg):
argkeys = list(arg.keys())
kwargs = {}
tre = oper.conf.TRUSTED_REGISTRATION_ENTITY
iss = tre['iss']
kb = KeyBundle()
kb.imp_jwks = json.load(open(tre['jwks']))
kb.do_keys(kb.imp_jwks['keys'])
oper.conv.entity.keyjar.add_kb(iss, kb)
if arg['redirect_uris'] is None:
kwargs['redirect_uris'] = oper.conv.entity.redirect_uris
else:
kwargs['redirect_uris'] = arg['redirect_uris']
argkeys.remove('redirect_uris')
if 'jwks_uri' in argkeys:
if arg['jwks_uri'] is None:
kwargs['jwks_uri'] = oper.conv.entity.jwks_uri
else:
kwargs['jwks_uri'] = arg['jwks_uri']
argkeys.remove('jwks_uri')
elif 'jwks' in argkeys:
if arg['jwks'] is None:
kwargs['jwks'] = {
"keys": oper.conv.entity.keyjar.dump_issuer_keys("")}
else:
kwargs['jwks'] = arg['jwks']
argkeys.remove('jwks')
for a in argkeys:
kwargs[a] = arg[a]
oper.req_args['software_statement'] = make_software_statement(
oper.conv.entity.keyjar, iss=iss, owner=iss, **kwargs)
示例3: KeyBundle
# 需要导入模块: from oic.utils.keyio import KeyBundle [as 别名]
# 或者: from oic.utils.keyio.KeyBundle import imp_jwks [as 别名]
config.baseurl = config.baseurl[:-1]
OAS.baseurl = "%s:%d" % (config.baseurl, args.port)
if not OAS.baseurl.endswith("/"):
OAS.baseurl += "/"
# load extra keys
try:
extern = config.TRUSTED_REGISTRATION_ENTITIES
except AttributeError:
pass
else:
for ent in extern:
iss = ent['iss']
kb = KeyBundle()
kb.imp_jwks = json.load(open(ent['jwks']))
kb.do_keys(kb.imp_jwks['keys'])
OAS.keyjar.add_kb(iss, kb)
LOGGER.debug("URLS: '%s" % (URLS,))
# Initiate the web server
SRV = wsgiserver.CherryPyWSGIServer(('0.0.0.0', args.port), application)
https = ""
if config.SERVICE_URL.startswith("https"):
https = " using HTTPS"
# SRV.ssl_adapter = ssl_pyopenssl.pyOpenSSLAdapter(
# config.SERVER_CERT, config.SERVER_KEY, config.CERT_CHAIN)
SRV.ssl_adapter = BuiltinSSLAdapter(config.SERVER_CERT,
config.SERVER_KEY,
config.CERT_CHAIN)