src.issuer_agent.issuer_agent_port

Issuer Agent Port module.

 1"""Issuer Agent Port module."""
 2
 3from abc import ABC, abstractmethod
 4
 5from src.credentials.credential import CredentialResponse
 6from src.metadata.credential_issuer_metadata import CredentialIssuerMetadata
 7
 8
 9class MetadataError(Exception):
10    """Exception raised when there is an error in the metadata."""
11
12    pass
13
14
15class IssuerAgentError(Exception):
16    """Exception raised when there is an error in the issuer agent."""
17
18    pass
19
20
21class IssuerAgentPort(ABC):
22    """Port for Issuer Agent Adapters."""
23
24    @abstractmethod
25    def credential_issuer_metadata(self) -> CredentialIssuerMetadata:
26        """Return Credential Issuer Metadata.
27
28        Returns:
29            CredentialIssuerMetadata object.
30        """
31        ...
32
33    @abstractmethod
34    def credential_request(
35        self,
36        format: str,
37        credential_configuration_id: str,
38        proof: dict[str, object],
39        issuer_state: str,
40        access_token: str,
41    ) -> CredentialResponse:
42        """Request a credential from the issuer agent.
43
44        Args:
45            format: The credential format.
46            credential_configuration_id: The credential configuration identifier.
47            proof: The proof object containing proof_type and jwt.
48            issuer_state: The issuer state from the offer.
49            access_token: The access token for authorization.
50
51        Returns:
52            CredentialResponse containing the issued credential(s).
53        """
54        ...
55
56    @abstractmethod
57    def request_nonce(self) -> dict[str, str]:
58        """Request a nonce from the issuer agent.
59
60        Returns:
61            A dictionary containing the c_nonce.
62        """
63        ...
class MetadataError(builtins.Exception):
10class MetadataError(Exception):
11    """Exception raised when there is an error in the metadata."""
12
13    pass

Exception raised when there is an error in the metadata.

class IssuerAgentError(builtins.Exception):
16class IssuerAgentError(Exception):
17    """Exception raised when there is an error in the issuer agent."""
18
19    pass

Exception raised when there is an error in the issuer agent.

class IssuerAgentPort(abc.ABC):
22class IssuerAgentPort(ABC):
23    """Port for Issuer Agent Adapters."""
24
25    @abstractmethod
26    def credential_issuer_metadata(self) -> CredentialIssuerMetadata:
27        """Return Credential Issuer Metadata.
28
29        Returns:
30            CredentialIssuerMetadata object.
31        """
32        ...
33
34    @abstractmethod
35    def credential_request(
36        self,
37        format: str,
38        credential_configuration_id: str,
39        proof: dict[str, object],
40        issuer_state: str,
41        access_token: str,
42    ) -> CredentialResponse:
43        """Request a credential from the issuer agent.
44
45        Args:
46            format: The credential format.
47            credential_configuration_id: The credential configuration identifier.
48            proof: The proof object containing proof_type and jwt.
49            issuer_state: The issuer state from the offer.
50            access_token: The access token for authorization.
51
52        Returns:
53            CredentialResponse containing the issued credential(s).
54        """
55        ...
56
57    @abstractmethod
58    def request_nonce(self) -> dict[str, str]:
59        """Request a nonce from the issuer agent.
60
61        Returns:
62            A dictionary containing the c_nonce.
63        """
64        ...

Port for Issuer Agent Adapters.

@abstractmethod
def credential_issuer_metadata(self) -> src.metadata.CredentialIssuerMetadata:
25    @abstractmethod
26    def credential_issuer_metadata(self) -> CredentialIssuerMetadata:
27        """Return Credential Issuer Metadata.
28
29        Returns:
30            CredentialIssuerMetadata object.
31        """
32        ...

Return Credential Issuer Metadata.

Returns: CredentialIssuerMetadata object.

@abstractmethod
def credential_request( self, format: str, credential_configuration_id: str, proof: dict[str, object], issuer_state: str, access_token: str) -> src.credentials.credential.CredentialResponse:
34    @abstractmethod
35    def credential_request(
36        self,
37        format: str,
38        credential_configuration_id: str,
39        proof: dict[str, object],
40        issuer_state: str,
41        access_token: str,
42    ) -> CredentialResponse:
43        """Request a credential from the issuer agent.
44
45        Args:
46            format: The credential format.
47            credential_configuration_id: The credential configuration identifier.
48            proof: The proof object containing proof_type and jwt.
49            issuer_state: The issuer state from the offer.
50            access_token: The access token for authorization.
51
52        Returns:
53            CredentialResponse containing the issued credential(s).
54        """
55        ...

Request a credential from the issuer agent.

Args: format: The credential format. credential_configuration_id: The credential configuration identifier. proof: The proof object containing proof_type and jwt. issuer_state: The issuer state from the offer. access_token: The access token for authorization.

Returns: CredentialResponse containing the issued credential(s).

@abstractmethod
def request_nonce(self) -> dict[str, str]:
57    @abstractmethod
58    def request_nonce(self) -> dict[str, str]:
59        """Request a nonce from the issuer agent.
60
61        Returns:
62            A dictionary containing the c_nonce.
63        """
64        ...

Request a nonce from the issuer agent.

Returns: A dictionary containing the c_nonce.