本文整理汇总了Python中saml2.assertion.Policy.get_attribute_restrictions方法的典型用法代码示例。如果您正苦于以下问题:Python Policy.get_attribute_restrictions方法的具体用法?Python Policy.get_attribute_restrictions怎么用?Python Policy.get_attribute_restrictions使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类saml2.assertion.Policy
的用法示例。
在下文中一共展示了Policy.get_attribute_restrictions方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_filter_attribute_value_assertions_2
# 需要导入模块: from saml2.assertion import Policy [as 别名]
# 或者: from saml2.assertion.Policy import get_attribute_restrictions [as 别名]
def test_filter_attribute_value_assertions_2(AVA):
p = Policy({
"default": {
"attribute_restrictions": {
"givenName": ["^R.*"],
}
}
})
ava = filter_attribute_value_assertions(AVA[0].copy(),
p.get_attribute_restrictions(""))
print ava
assert _eq(ava.keys(), [])
ava = filter_attribute_value_assertions(AVA[1].copy(),
p.get_attribute_restrictions(""))
print ava
assert _eq(ava.keys(), ["givenName"])
assert ava["givenName"] == ["Ryan"]
ava = filter_attribute_value_assertions(AVA[3].copy(),
p.get_attribute_restrictions(""))
print ava
assert _eq(ava.keys(), ["givenName"])
assert ava["givenName"] == ["Roland"]
示例2: test_filter_attribute_value_assertions_1
# 需要导入模块: from saml2.assertion import Policy [as 别名]
# 或者: from saml2.assertion.Policy import get_attribute_restrictions [as 别名]
def test_filter_attribute_value_assertions_1(AVA):
p = Policy({"default": {"attribute_restrictions": {"surName": None, "givenName": [".*er.*"]}}})
ava = filter_attribute_value_assertions(AVA[0].copy(), p.get_attribute_restrictions(""))
print ava
assert _eq(ava.keys(), ["givenName", "surName"])
assert ava["surName"] == ["Jeter"]
assert ava["givenName"] == ["Derek"]
ava = filter_attribute_value_assertions(AVA[1].copy(), p.get_attribute_restrictions(""))
print ava
assert _eq(ava.keys(), ["surName"])
assert ava["surName"] == ["Howard"]
示例3: test_filter_attribute_value_assertions_0
# 需要导入模块: from saml2.assertion import Policy [as 别名]
# 或者: from saml2.assertion.Policy import get_attribute_restrictions [as 别名]
def test_filter_attribute_value_assertions_0(AVA):
p = Policy({"default": {"attribute_restrictions": {"surName": [".*berg"]}}})
ava = filter_attribute_value_assertions(AVA[3].copy(), p.get_attribute_restrictions(""))
print ava
assert ava.keys() == ["surName"]
assert ava["surName"] == ["Hedberg"]