本文整理汇总了Python中pymacaroons.Macaroon.inspect方法的典型用法代码示例。如果您正苦于以下问题:Python Macaroon.inspect方法的具体用法?Python Macaroon.inspect怎么用?Python Macaroon.inspect使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类pymacaroons.Macaroon
的用法示例。
在下文中一共展示了Macaroon.inspect方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_inspect
# 需要导入模块: from pymacaroons import Macaroon [as 别名]
# 或者: from pymacaroons.Macaroon import inspect [as 别名]
def test_inspect(self):
m = Macaroon(
location='http://mybank/',
identifier='we used our secret key',
key='this is our super secret key; only we should know it'
)
m.add_first_party_caveat('test = caveat')
assert_equal(m.inspect(), 'location http://mybank/\nidentifier we used\
our secret key\ncid test = caveat\nsignature 197bac7a044af33332865b9266e26d49\
3bdd668a660e44d88ce1a998c23dbd67')
示例2: test_inspect
# 需要导入模块: from pymacaroons import Macaroon [as 别名]
# 或者: from pymacaroons.Macaroon import inspect [as 别名]
def test_inspect(self):
m = Macaroon(
location='http://mybank/',
identifier='we used our secret key',
key='this is our super secret key; only we should know it'
)
m.add_first_party_caveat('test = caveat')
caveat_key = '4; guaranteed random by a fair toss of the dice'
identifier = 'this was how we remind auth of key/pred'
m.add_third_party_caveat(
'http://auth.mybank/',
caveat_key,
identifier,
nonce=ZERO_NONCE
)
assert_equal(m.inspect(), (
'location http://mybank/\n'
'identifier we used our secret key\n'
'cid test = caveat\n'
'cid this was how we remind auth of key/pred\n'
'vid AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA68NYajhiFuHnKGSNcVhkAwgbs0VZ0yK2o+q0Aq9+bONkXw7ky7HAuhCLO9hhaMMc\n'
'cl http://auth.mybank/\n'
'signature 7a9289bfbb92d725f748bbcb4f3e04e56b7021513ebeed8411bfba10a16a662e'))