pyeudiw.federation package
Subpackages
- pyeudiw.federation.schemas package
- Submodules
- pyeudiw.federation.schemas.entity_configuration module
EntityConfigurationHeaderEntityConfigurationMetadataSchemaEntityConfigurationPayloadEntityStatementPayloadEntityStatementPayload.expEntityStatementPayload.iatEntityStatementPayload.issEntityStatementPayload.jwksEntityStatementPayload.metadataEntityStatementPayload.metadata_policyEntityStatementPayload.model_configEntityStatementPayload.source_endpointEntityStatementPayload.subEntityStatementPayload.trust_marks
- pyeudiw.federation.schemas.federation_configuration module
- pyeudiw.federation.schemas.federation_entity module
- pyeudiw.federation.schemas.openid_credential_verifier module
AcrValuesSupportedAuthorizationSignedResponseAlgEncryptionAlgValuesSupportedEncryptionEncValuesSupportedOpenIDCredentialVerifierOpenIDCredentialVerifier.application_typeOpenIDCredentialVerifier.authorization_encrypted_response_algOpenIDCredentialVerifier.authorization_encrypted_response_encOpenIDCredentialVerifier.authorization_signed_response_algOpenIDCredentialVerifier.client_idOpenIDCredentialVerifier.client_nameOpenIDCredentialVerifier.contactsOpenIDCredentialVerifier.default_acr_valuesOpenIDCredentialVerifier.id_token_encrypted_response_algOpenIDCredentialVerifier.id_token_encrypted_response_encOpenIDCredentialVerifier.id_token_signed_response_algOpenIDCredentialVerifier.jwksOpenIDCredentialVerifier.model_configOpenIDCredentialVerifier.redirect_urisOpenIDCredentialVerifier.request_urisOpenIDCredentialVerifier.vp_formats
SigningAlgValuesSupported
- Module contents
- pyeudiw.federation.trust_chain package
Submodules
pyeudiw.federation.exceptions module
pyeudiw.federation.policy module
- class pyeudiw.federation.policy.TrustChainPolicy[source]
Bases:
object
- pyeudiw.federation.policy.combine(superior: dict, sub: dict) dict[source]
- Parameters:
rule – Dictionary with two keys metadata_policy and metadata
sub – Dictionary with two keys metadata_policy and metadata
- Returns:
- pyeudiw.federation.policy.combine_claim_policy(superior, child)[source]
Combine policy rules. Applying the child policy can only make the combined policy more restrictive.
- Parameters:
superior – Superior policy
child – Intermediates policy
pyeudiw.federation.statements module
- class pyeudiw.federation.statements.EntityStatement(jwt: str, httpc_params: dict, filter_by_allowed_trust_marks: list[str] = [], trust_anchor_entity_conf: EntityStatement | None = None, trust_mark_issuers_entity_confs: list[EntityStatement] = [])[source]
Bases:
objectThe self issued/signed statement of a federation entity
- get_superiors(authority_hints: list[str] = [], max_authority_hints: int = 0, superiors_hints: list[dict] = []) dict[source]
get superiors entity configurations
- Parameters:
authority_hints (list[str]) – the authority hint list
max_authority_hints (int) – the number of max authority hint
superiors_hints (list[dict]) – the list of superior hints
- Returns:
a dict with the superior’s entity configurations
- Return type:
dict
- update_trust_anchor_conf(trust_anchor_entity_conf: EntityStatement) None[source]
Updates the internal Trust Anchor conf.
- Parameters:
trust_anchor_entity_conf (EntityStatement) – the trust anchor entity conf
- validate_by_allowed_trust_marks() bool[source]
validate the entity configuration ony if marked by a well known trust mark, issued by a trusted issuer
- validate_by_superior_statement(jwt: str, ec: EntityStatement) str[source]
validates self with the jwks contained in statement of the superior :param jwt: the statement issued by a superior in form of JWT :type jwt: str :param ec: is a superior entity configuration :type ec: EntityStatement
- Returns:
the entity configuration subject if is valid
- Return type:
str
- validate_by_superiors(superiors_entity_configurations: dict = {}) dict[source]
validates the entity configuration with the entity statements issued by its superiors this methods create self.verified_superiors and failed ones and self.verified_by_superiors and failed ones
- Parameters:
superiors_entity_configurations (dict) – an object containing the entity configurations of superiors
- Returns:
an object containing the superior validations
- Return type:
dict
- class pyeudiw.federation.statements.TrustMark(jwt: str, httpc_params: dict)[source]
Bases:
objectThe class representing a Trust Mark
- pyeudiw.federation.statements.get_entity_configurations(subjects: list[str] | str, httpc_params: dict, http_async: bool = False) list[bytes][source]
Fetches an entity configuration from the specified subjects.
- Parameters:
subjects (list[str] | str) – The url or a list of url where perform the GET HTTP calls
httpc_params (dict) – parameters to perform http requests.
http_async (bool) – if is set to True the operation will be performed in async (deafault True)
- Returns:
A list of entity statements.
- Return type:
list[Response]
- pyeudiw.federation.statements.get_entity_statements(urls: list[str] | str, httpc_params: dict, http_async: bool = True) list[bytes][source]
Fetches an entity statement from the specified urls.
- Parameters:
urls (list[str] | str) – The url or a list of url where perform the GET HTTP calls
httpc_params (dict) – parameters to perform http requests.
http_async (bool) – if is set to True the operation will be performed in async (deafault True)
- Returns:
A list of entity statements.
- Return type:
list[Response]
pyeudiw.federation.trust_chain_builder module
- class pyeudiw.federation.trust_chain_builder.TrustChainBuilder(subject: str, trust_anchor: str, httpc_params: dict, trust_anchor_configuration: EntityStatement | str | None = None, max_authority_hints: int = 10, subject_configuration: EntityStatement | None = None, required_trust_marks: list[dict] = [], **kwargs)[source]
Bases:
objectA trust walker that fetches statements and evaluate the evaluables
- apply_metadata_policy() dict[source]
filters the trust path from subject to trust anchor apply the metadata policies along the path.
- Returns:
the final metadata with policy applied
- Return type:
dict
- discovery() bool[source]
discovers the chain of verified statements from the lower up to the trust anchor and updates the internal representation of chain.
- Returns:
the validity status of the updated chain
- Return type:
bool
- property exp_datetime: datetime
The exp filed converted in datetime format
- get_subject_configuration() None[source]
Download and updates the internal field subject_configuration with the entity statement of leaf.
- Return type:
None
- get_trust_anchor_configuration() None[source]
Download and updates the internal field trust_anchor_configuration with the entity statement of trust anchor.
- get_trust_chain() list[str][source]
Retrieves the leaf and the Trust Anchor entity configurations.
- Returns:
the list containing the ECs
- Return type:
list[str]
pyeudiw.federation.trust_chain_validator module
- class pyeudiw.federation.trust_chain_validator.StaticTrustChainValidator(static_trust_chain: list[str], trust_anchor_jwks: list[dict[str, Any]], httpc_params: dict, **kwargs)[source]
Bases:
objectHelper class for Static Trust Chain validation
- property entity_id: str
Get the chain’s entity_id.
- property final_metadata: dict
Apply the metadata and returns the final metadata.
- property is_expired: int
Get the status of chain expiration.
- property is_valid: bool
Get the validity of chain.
- set_exp(exp: int) None[source]
Updates the self.exp field if the exp parameter is more recent than the previous one.
- Parameters:
exp (int) – an integer that represent the timestemp to check
- property trust_chain: list[str]
Get the list of the jwt that compones the trust chain.