Пример #1
0
def get_config_for_acs(acs_url):
    """
    Return SP configuration instance that handles acs_url.
    """
    for friendlyname, config in SAML2IDP_REMOTES.items():
        if config['acs_url'] == acs_url:
            return config
    msg = 'SAML2IDP_REMOTES is not configured to handle the AssertionConsumerService at "%s"'
    raise ImproperlyConfigured(msg % resource_name)
Пример #2
0
def get_config_for_acs(acs_url):
    """
    Return SP configuration instance that handles acs_url.
    """
    for friendlyname, config in SAML2IDP_REMOTES.items():
        if config['acs_url'] == acs_url:
            return config
    msg = 'SAML2IDP_REMOTES is not configured to handle the AssertionConsumerService at "%s"'
    raise ImproperlyConfigured(msg % resource_name)
Пример #3
0
def get_config_for_resource(resource_name):
    """
    Return the SP configuration that handles a deep-link resource_name.
    """
    for friendlyname, config in SAML2IDP_REMOTES.items():
        links = get_links(config)
        for name, pattern in links:
            if name == resource_name:
                return config
    msg = 'SAML2IDP_REMOTES is not configured to handle a link resource "%s"'
    raise ImproperlyConfigured(msg % resource_name)
Пример #4
0
def get_config_for_resource(resource_name):
    """
    Return the SP configuration that handles a deep-link resource_name.
    """
    for friendlyname, config in SAML2IDP_REMOTES.items():
        links = get_links(config)
        for name, pattern in links:
            if name == resource_name:
                return config
    msg = 'SAML2IDP_REMOTES is not configured to handle a link resource "%s"'
    raise ImproperlyConfigured(msg % resource_name)
Пример #5
0
def get_deeplink_resources():
    """
    Returns a list of resources that can be used for deep-linking.
    """
    resources = []
    for key, sp_config in SAML2IDP_REMOTES.items():
        links = get_links(sp_config)
        for resource, patterns in links:
            if '/' not in resource:
                # It's a simple deeplink, which is handled by 'login_init' URL.
                continue
            resources.append(resource)
    return resources
Пример #6
0
def get_deeplink_resources():
    """
    Returns a list of resources that can be used for deep-linking.
    """
    resources = []
    for key, sp_config in SAML2IDP_REMOTES.items():
        links = get_links(sp_config)
        for resource, patterns in links:
            if '/' not in resource:
                # It's a simple deeplink, which is handled by 'login_init' URL.
                continue
            resources.append(resource)
    return resources