pyeudiw.trust package
Subpackages
- pyeudiw.trust.default package
- pyeudiw.trust.handler package
- Submodules
- pyeudiw.trust.handler.commons module
- pyeudiw.trust.handler.direct_trust_jar module
- pyeudiw.trust.handler.direct_trust_sd_jwt_vc module
- pyeudiw.trust.handler.exceptions module
- pyeudiw.trust.handler.federation module
- pyeudiw.trust.handler.interface module
TrustHandlerInterfaceTrustHandlerInterface.build_metadata_endpoints()TrustHandlerInterface.default_client_idTrustHandlerInterface.extract_and_update_trust_materials()TrustHandlerInterface.extract_jwt_header_trust_parameters()TrustHandlerInterface.get_client_id()TrustHandlerInterface.get_handled_trust_material_name()TrustHandlerInterface.get_metadata()TrustHandlerInterface.is_it_me()TrustHandlerInterface.nameTrustHandlerInterface.validate_trust_material()
- pyeudiw.trust.handler.x509 module
- Module contents
- pyeudiw.trust.model package
Submodules
pyeudiw.trust.anchors_loader module
pyeudiw.trust.dynamic module
- class pyeudiw.trust.dynamic.CombinedTrustEvaluator(handlers: list[TrustHandlerInterface], db_engine: DBEngine, mode: Literal['update_first', 'cache_first'] = 'update_first')[source]
Bases:
BaseLoggerA trust evaluator that combines multiple trust models.
- build_metadata_endpoints(backend_name: str, entity_uri: str) list[tuple[str, Callable[[Context, Any], Response]]][source]
- static from_config(config: dict, db_engine: DBEngine, default_client_id: str, mode: Literal['update_first', 'cache_first'] = 'update_first') CombinedTrustEvaluator[source]
Create a CombinedTrustEvaluator from a configuration.
- Parameters:
config (dict) – The configuration
db_engine (DBEngine) – The database engine
- Returns:
The CombinedTrustEvaluator
- Return type:
- get_jwt_header_trust_parameters(issuer: str | None = None, force_update: bool = False) dict[str, Any][source]
Get the trust parameters of a certain issuer according to some trust model.
- Parameters:
issuer (str) – The issuer
- Returns:
The trust parameters
- Return type:
list[dict]
- get_metadata(issuer: str | None = None, force_update: bool = False) dict[source]
Yields a dictionary of metadata about an issuer, according to some trust model.
- Parameters:
issuer (str) – The issuer
force_update (bool) – If the metadata should be updated even if it is already present in the cache
- Returns:
The metadata
- Return type:
dict
- get_policies(issuer: str | None = None, force_update: bool = False) dict[str, any][source]
Get the policies of a certain issuer according to some trust model.
- Parameters:
issuer (str) – The issuer
- Returns:
The policies
- Return type:
dict[str, any]
- get_public_keys(issuer: str | None = None, static_trust_materials: dict = {}, force_update: bool = False) list[dict][source]
Yields a list of public keys for an issuer, according to some trust model. If trust materials are provided, they are used to derive the public keys. If not, the public keys are derived from a trust model that does not require trust materials to attest the trust.
- Parameters:
issuer (str) – The issuer
static_trust_materials (dict) – The static trust materials
force_update (bool) – If the public keys should be updated even if they are already present in the cache
- Returns:
The public keys
- Return type:
list[dict]
- has_client_id(client_id: str) bool[source]
Check if the trust source has a client id.
- Parameters:
issuer (str) – The issuer
- Returns:
If the trust source has a client id
- Return type:
bool
- is_revoked(issuer: str | None = None, force_update: bool = False) bool[source]
Yield if the trust toward the issuer was revoked according to some trust model; This asusmed that the isser exists, is valid, but is not trusted.
- Parameters:
issuer (str) – The issuer
- Returns:
If the trust toward the issuer was revoked
- Return type:
bool
pyeudiw.trust.exceptions module
pyeudiw.trust.interface module
- class pyeudiw.trust.interface.TrustEvaluator[source]
Bases:
objectTrustEvaluator is an interface that defined the expected behaviour of a class that, as the very core, can: (1) obtain the cryptographic material of an issuer, which might or might not be trusted according to some trust model (2) obtain the meta information about an issuer that is defined according to some trust model
- build_metadata_endpoints(base_path: str) list[tuple[str, Callable[[Context, Any], Response]]][source]
Return metadata endpoints for this trust evaluator (e.g. keys, config, policies).
Each item must be a tuple (regex: str, handler: Callable[[Context, Any], Response]) compatible with satosa.backend.BackendModule.register_endpoints.
base_path is the module base path and can be used when building the routes. Return an empty list if there are no endpoints to expose.
- get_metadata(issuer: str) dict[source]
yields a dictionary of metadata about an issuer, according to some trust model.
- get_public_keys(issuer: str) list[dict][source]
yields the public cryptographic material of the issuer
- Returns:
a list of jwk(s); note that those key are _not_ necessarely identified by a kid claim