pyeudiw.satosa.frontends.openid4vci.storage package
Submodules
pyeudiw.satosa.frontends.openid4vci.storage.engine module
- class pyeudiw.satosa.frontends.openid4vci.storage.engine.OpenId4VciDBEngineHandler(config: dict)[source]
Bases:
objectEngine for managing OpenID4VCI storage operations.
This class provides a wrapper around the configured storage backend, typically a MongoDB-based engine, used for persisting and retrieving OpenID4VCI-related data. It lazily initializes the DB engine and ensures it is connected when accessed.
- Attributes:
- _storage (str): The name or URI of the configured storage backend,
typically loaded from self.config[“storage”].
- _db_engine (OpenId4VciStorage | None): The lazily initialized instance
of the storage engine.
pyeudiw.satosa.frontends.openid4vci.storage.entity module
- class pyeudiw.satosa.frontends.openid4vci.storage.entity.OpenId4VCIEntity(*, document_id: str = <factory>, creation_date: float = <factory>, state: str, client_id: str, code_challenge: str, code_challenge_method: str, session_id: str, remote_flow_typ: str, request_uri_part: str, redirect_uri: str, authorization_details: ~typing.List[~pyeudiw.satosa.frontends.openid4vci.models.auhtorization_detail.AuthorizationDetail] | None = None, scope: str | None = None, c_nonce: str | None = None, finalized: bool = False, attributes: dict | None = None)[source]
Bases:
BaseModel- attributes: dict | None
- authorization_details: List[AuthorizationDetail] | None
- c_nonce: str | None
- client_id: str
- code_challenge: str
- code_challenge_method: str
- creation_date: float
- document_id: str
- finalized: bool
- model_config: ClassVar[ConfigDict] = {}
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- static new_entity(context: Context, request_uri_part: str, par_request: ParRequest | SignedParRequest, force_same_device_flow_referer_criteria: List[str] | None = None) OpenId4VCIEntity[source]
- redirect_uri: str
- remote_flow_typ: str
- request_uri_part: str
- scope: str | None
- session_id: str
- state: str
pyeudiw.satosa.frontends.openid4vci.storage.openid4vci_storage module
- class pyeudiw.satosa.frontends.openid4vci.storage.openid4vci_storage.OpenId4VciStorage(conf: dict, url: str, connection_params=None)[source]
Bases:
MongoStorageA storage class extending MongoStorage to manage sessions related to OpenID4VCI interactions.
This class provides methods to initialize, retrieve, and update session data stored in a MongoDB database.
- get_by_session_id(session_id: str = '') OpenId4VCIEntity[source]
Retrieve a session entity by its session ID.
- Parameters:
session_id – The session ID associated with the entity.
- Returns:
An instance of OpenId4VCIEntity containing the retrieved data.
- Raises:
ValueError if the session is not found or cannot be parsed.
- init_session(entity: OpenId4VCIEntity) str[source]
Store a new session entity in the MongoDB collection.
- Parameters:
entity – An instance of OpenId4VCIEntity containing session data.
- Returns:
The document ID assigned to the stored session.
- update_attributes_by_session_id(session_id: str, attributes: dict) UpdateResult[source]
Update the nonce value of a session based on the session ID.
- Parameters:
session_id – The session ID identifying the session document.
attributes – The attributes value to set.
- Returns:
The result of the update operation.
- Raises:
ValueError if the document cannot be updated.
- update_nonce_by_session_id(session_id: str, c_nonce: str) UpdateResult[source]
Update the nonce value of a session based on the session ID.
- Parameters:
session_id – The session ID identifying the session document.
c_nonce – The new nonce value to set.
- Returns:
The result of the update operation.
- Raises:
ValueError if the document cannot be updated.