本文整理汇总了Python中oic.oic.message.OpenIDSchema.jwe_header方法的典型用法代码示例。如果您正苦于以下问题:Python OpenIDSchema.jwe_header方法的具体用法?Python OpenIDSchema.jwe_header怎么用?Python OpenIDSchema.jwe_header使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类oic.oic.message.OpenIDSchema
的用法示例。
在下文中一共展示了OpenIDSchema.jwe_header方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: trace_output
# 需要导入模块: from oic.oic.message import OpenIDSchema [as 别名]
# 或者: from oic.oic.message.OpenIDSchema import jwe_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