pygamlastan.metadata

Parse and inspect SAML metadata. See the Metadata guide. Errors raise pygamlastan.SamlMetadataError (or pygamlastan.SamlXmlError for malformed XML).

pygamlastan.metadata.parse_entity(xml: str) EntityDescriptor

Parse a single <md:EntityDescriptor> document.

pygamlastan.metadata.parse_entities(xml: str) list[EntityDescriptor]

Parse a <md:EntitiesDescriptor> aggregate into its child entities.

pygamlastan.metadata.validate_entity(entity: EntityDescriptor) None

Validate an entity against basic metadata requirements.

class pygamlastan.metadata.EntityDescriptor
entity_id: str
valid_until
has_signature: bool
is_idp() bool
is_sp() bool
single_sign_on_services() list[EndpointInfo]

IdP SingleSignOnService endpoints.

assertion_consumer_services() list[EndpointInfo]

SP AssertionConsumerService endpoints (indexed).

single_logout_services(role: str = 'idp') list[EndpointInfo]
name_id_formats(role: str = 'idp') list[str]
signing_certificates(role: str = 'idp') list[bytes]

DER X.509 signing certificates for the role.

encryption_certificates(role: str = 'sp') list[bytes]
to_xml() str
class pygamlastan.metadata.EndpointInfo

A resolved endpoint.

binding: str
location: str
response_location: str | None
index: int | None
is_default: bool | None