ciecplib.utils module

ciecplib.utils.EcpIdentityProvider

alias of IdP

ciecplib.utils.get_ecpcookie_path()

Returns the default path for the ECP cookie file

Returns:

path (pathlib.Path)

ciecplib.utils.get_idp_url(url_or_name, idplist_url='https://cilogon.org/include/ecpidps.txt', kerberos=False)

Return the unique IdP URL for a given institution or URL stub

Parameters:
  • url_or_name (str) – the name of an institution, or a URL for the endpoint, or part thereof

  • idplist_url (str, optional) – the URL to query for the list of enabled ECP IdPs

  • kerberos (bool, optional) – if True return a Kerberos URL, if available, otherwise return a standard SAML/ECP endpoint URL

Returns:

url (str) – the formatted URL of the IdP ECP endpoint

Raises:

ValueError – if there isn’t a unique match for either the institution name, or the IdP URL

Examples

>>> get_idp_url("LIGO")
'https://login.ligo.org/idp/profile/SAML2/SOAP/ECP'
>>> get_idp_url("ligo.org")
'https://login.ligo.org/idp/profile/SAML2/SOAP/ECP'
ciecplib.utils.get_idps(url='https://cilogon.org/include/ecpidps.txt')

Download the list of known ECP IdPs from the given URL

The output is a list of EcpIdentityProvider objects.

Some institutions may have two entries if they also support Kerberos.

Parameters:

url (str) – the URL of the IDP list file

ciecplib.utils.get_x509_proxy_path()

Returns the default path for the X.509 certificate file

Returns:

path (pathlib.Path)

ciecplib.utils.random_string(length, outof='abcdefghijklmnopqrstuvwxyz0123456789')