コード例 #1
0
ファイル: test_30_mdstore.py プロジェクト: yaseendar/pysaml2
def test_load_remote_encoding():
    crypto = sigver._get_xmlsec_cryptobackend()
    sc = sigver.SecurityContext(crypto, key_type="", cert_type="")
    httpc = HTTPBase()
    mds = MetaDataExtern(ATTRCONV,
                         'http://metadata.aai.switch.ch/metadata.aaitest.xml',
                         sc, full_path('SWITCHaaiRootCA.crt.pem'), httpc)
    mds.load()
コード例 #2
0
def test_load_remote_encoding(mock_request):
    filepath = os.path.join(TESTS_DIR, "remote_data/metadata.aaitest.xml")
    with open(filepath) as fd:
        data = fd.read()
    mock_request.return_value.ok = True
    mock_request.return_value.status_code = 200
    mock_request.return_value.content = data

    crypto = sigver._get_xmlsec_cryptobackend()
    sc = sigver.SecurityContext(crypto, key_type="", cert_type="")
    httpc = HTTPBase()
    mds = MetaDataExtern(ATTRCONV, 'http://metadata.aai.switch.ch/metadata.aaitest.xml', sc, full_path('SWITCHaaiRootCA.crt.pem'), httpc)
    mds.load()
コード例 #3
0
ファイル: saml.py プロジェクト: syre/django-saml2-auth
def validate_metadata_url(url: str) -> bool:
    """Validates metadata URL

    Args:
        url (str): Metadata URL

    Returns:
        bool: Wether the metadata URL is valid or not
    """
    try:
        http_client = HTTPBase()
        metadata = MetaDataExtern(None, url=url, http=http_client)
        metadata.load()
    except:
        return False

    return True
コード例 #4
0
ファイル: test_30_mdstore.py プロジェクト: SUNET/pysaml2
def test_load_remote_encoding():
    crypto = sigver._get_xmlsec_cryptobackend()
    sc = sigver.SecurityContext(crypto, key_type="", cert_type="")
    httpc = HTTPBase()
    mds = MetaDataExtern(ATTRCONV, 'http://metadata.aai.switch.ch/metadata.aaitest.xml', sc, full_path('SWITCHaaiRootCA.crt.pem'), httpc)
    mds.load()