当前位置: 首页>>代码示例>>Python>>正文


Python MetadataStore.entities方法代码示例

本文整理汇总了Python中saml2.mdstore.MetadataStore.entities方法的典型用法代码示例。如果您正苦于以下问题:Python MetadataStore.entities方法的具体用法?Python MetadataStore.entities怎么用?Python MetadataStore.entities使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在saml2.mdstore.MetadataStore的用法示例。


在下文中一共展示了MetadataStore.entities方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: test_incommon_1

# 需要导入模块: from saml2.mdstore import MetadataStore [as 别名]
# 或者: from saml2.mdstore.MetadataStore import entities [as 别名]
def test_incommon_1():
    mds = MetadataStore(ONTS.values(), ATTRCONV, xmlsec_path,
                        disable_ssl_certificate_validation=True)

    mds.imp(METADATACONF["2"])

    print mds.entities()
    assert mds.entities() == 169
    idps = mds.with_descriptor("idpsso")
    print idps.keys()
    assert len(idps) == 53 # !!!!???? < 10%
    assert mds.single_sign_on_service('urn:mace:incommon:uiuc.edu') == []
    idpsso = mds.single_sign_on_service('urn:mace:incommon:alaska.edu')
    assert len(idpsso) == 1
    print idpsso
    assert destinations(idpsso) == ['https://idp.alaska.edu/idp/profile/SAML2/Redirect/SSO']

    sps = mds.with_descriptor("spsso")

    acs_sp = []
    for nam, desc in sps.items():
        if "attribute_consuming_service" in desc:
            acs_sp.append(nam)

    assert len(acs_sp) == 0

    # Look for attribute authorities
    aas = mds.with_descriptor("attribute_authority")

    print aas.keys()
    assert len(aas) == 53
开发者ID:GSA,项目名称:pysaml2,代码行数:33,代码来源:test_30_mdstore.py

示例2: test_incommon_1

# 需要导入模块: from saml2.mdstore import MetadataStore [as 别名]
# 或者: from saml2.mdstore.MetadataStore import entities [as 别名]
def test_incommon_1():
    mds = MetadataStore(ONTS.values(), ATTRCONV, sec_config, disable_ssl_certificate_validation=True)

    mds.imp(METADATACONF["2"])

    print mds.entities()
    assert mds.entities() > 1700
    idps = mds.with_descriptor("idpsso")
    print idps.keys()
    assert len(idps) > 300  # ~ 18%
    try:
        _ = mds.single_sign_on_service("urn:mace:incommon:uiuc.edu")
    except UnknownPrincipal:
        pass

    idpsso = mds.single_sign_on_service("urn:mace:incommon:alaska.edu")
    assert len(idpsso) == 1
    print idpsso
    assert destinations(idpsso) == ["https://idp.alaska.edu/idp/profile/SAML2/Redirect/SSO"]

    sps = mds.with_descriptor("spsso")

    acs_sp = []
    for nam, desc in sps.items():
        if "attribute_consuming_service" in desc:
            acs_sp.append(nam)

    assert len(acs_sp) == 0

    # Look for attribute authorities
    aas = mds.with_descriptor("attribute_authority")

    print aas.keys()
    assert len(aas) == 180
开发者ID:balagopalraj,项目名称:clearlinux,代码行数:36,代码来源:test_30_mdstore.py


注:本文中的saml2.mdstore.MetadataStore.entities方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。