api.saml.metadata.federations package

Submodules

api.saml.metadata.federations.incommon module

api.saml.metadata.federations.loader module

class api.saml.metadata.federations.loader.SAMLFederatedIdentityProviderLoader(loader, validator, parser)[source]

Bases: object

Loads metadata of federated IdPs from the specified metadata service.

ENGLISH_LANGUAGE_CODES = ('en', 'eng')
load(federation)[source]

Loads metadata of federated IdPs from the specified metadata service.

Parameters:

federation (api.saml.metadata.federations.model.SAMLFederation) – SAML federation where loaded IdPs belong to

Returns:

List of SAMLFederatedIdP objects

Return type:

Iterable[api.saml.configuration.SAMLFederatedIdentityProvider]

class api.saml.metadata.federations.loader.SAMLMetadataLoader[source]

Bases: object

Loads SAML metadata from a remote source (e.g. InCommon Metadata Service)

load_idp_metadata(url=None)[source]

Load IdP metadata in an XML format from the specified url.

Parameters:

url (Optional[string]) – URL of a metadata service

Returns:

XML string containing InCommon Metadata

Return type:

string

Raise:

MetadataLoadError

exception api.saml.metadata.federations.loader.SAMLMetadataLoadingError(message=None, inner_exception=None)[source]

Bases: BaseError

Raised in the case of any errors occurred during loading of SAML metadata from a remote source

api.saml.metadata.federations.model module

class api.saml.metadata.federations.model.SAMLFederatedIdentityProvider(federation, entity_id, display_name, xml_metadata)[source]

Bases: Base

Contains information about a federated IdP.

display_name
entity_id
federation
federation_id
id
xml_metadata
class api.saml.metadata.federations.model.SAMLFederation(federation_type, idp_metadata_service_url, certificate=None)[source]

Bases: Base

Contains information about a SAML federation (for example, InCommon).

certificate
id
identity_providers
idp_metadata_service_url
last_updated_at
type

api.saml.metadata.federations.validator module

class api.saml.metadata.federations.validator.SAMLFederatedMetadataExpirationValidator[source]

Bases: SAMLFederatedMetadataValidator

Verifies that federated SAML metadata has not expired.

MAX_CLOCK_SKEW = datetime.timedelta(seconds=300)
MAX_VALID_TIME = datetime.timedelta(days=28)
validate(federation, metadata)[source]

Verify that federated SAML metadata has not expired.

Parameters:
Raises:

SAMLFederatedMetadataValidationError – in the case of validation errors

exception api.saml.metadata.federations.validator.SAMLFederatedMetadataValidationError(message=None, inner_exception=None)[source]

Bases: BaseError

Raised in the case of any errors happened during SAML metadata validation.

class api.saml.metadata.federations.validator.SAMLFederatedMetadataValidator[source]

Bases: object

Base class for all validators checking correctness of SAML federated metadata.

validate(federation, metadata)[source]

Validate SAML federated metadata.

Parameters:
Raises:

SAMLFederatedMetadataValidationError – in the case of validation errors

class api.saml.metadata.federations.validator.SAMLFederatedMetadataValidatorChain(validators)[source]

Bases: SAMLFederatedMetadataValidator

validate(federation, metadata)[source]

Validate SAML federated metadata using a chain of inner validators.

Parameters:
Raises:

SAMLFederatedMetadataValidationError – in the case of validation errors

class api.saml.metadata.federations.validator.SAMLMetadataSignatureValidator[source]

Bases: SAMLFederatedMetadataValidator

Verifies the validity of federated SAML metadata’s signature.

validate(federation, metadata)[source]

Verify the validity of the SAML federated metadata’s signature.

Parameters:
Raises:

SAMLFederatedMetadataValidationError – in the case of validation errors

Module contents