本文整理匯總了Python中oic.oic.message.OpenIDSchema.jws_header方法的典型用法代碼示例。如果您正苦於以下問題:Python OpenIDSchema.jws_header方法的具體用法?Python OpenIDSchema.jws_header怎麽用?Python OpenIDSchema.jws_header使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類oic.oic.message.OpenIDSchema
的用法示例。
在下文中一共展示了OpenIDSchema.jws_header方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: trace_output
# 需要導入模塊: from oic.oic.message import OpenIDSchema [as 別名]
# 或者: from oic.oic.message.OpenIDSchema import jws_header [as 別名]
def trace_output(lines, index, end):
cont = False
seq = []
_cls = None
_data = []
_sent = {}
_recv = {}
phase = ""
while index < end:
line = lines[index]
if cont:
if line == "}":
_data.append(line)
cont = False
_args = json.loads("".join(_data))
if _cls == "JWKS":
try:
_inst = jwks_load("".join(_data))
except TypeError:
pass
elif _cls == "UserInfo":
_int = Message(**_args)
try:
_inst = OpenIDSchema(**_int["claims"])
except KeyError:
_inst = OpenIDSchema(**_args)
else:
try:
_inst.jwe_header = _int["jwe header parameters"]
except KeyError:
pass
try:
_inst.jws_header = _int["jws header parameters"]
except KeyError:
pass
else:
try:
_inst = oic_factory(_cls)(**_args)
except KeyError:
_inst = oauth2_factory(_cls)(**args)
seq.append((_cls, _inst))
else:
_data.append(line)
index += 1
continue
if line == DIV:
break
elif line == "Trace output" or line == "":
pass
else:
for phase in ORDER:
m = PATTERN[phase].match(line)
if m:
if phase == "head":
seq.append(m.groups()[0])
elif phase == "sent":
key, val = m.groups()
_sent[key] = val
elif phase == "recv":
key, val = m.groups()
_recv[key] = val
elif phase == "quer":
_recv["QUERY"] = m.groups()[0]
phase = "recv"
elif phase == "data":
m = DATA.match(line)
cont = True
_cls = m.groups()[0]
_data = ['{']
elif phase == "tag":
seq.append(("info", m.groups()[0]))
if phase in ["head", "data", "end"]:
if _sent:
seq.append(("sent", _sent))
_sent = {}
if _recv:
seq.append(("recv", _recv))
_recv = {}
break
if phase == "end":
break
index += 1
return index, seq