Skip to content

Commit

Permalink
rename files to avoid ambiguity in docs
Browse files Browse the repository at this point in the history
Signed-off-by: Andrew Whitehead <[email protected]>
  • Loading branch information
andrewwhitehead committed Aug 22, 2021
1 parent 55cb279 commit 49f707e
Show file tree
Hide file tree
Showing 29 changed files with 130 additions and 93 deletions.
2 changes: 1 addition & 1 deletion aries_cloudagent/vc/ld_proofs/__init__.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
from .ld_proofs import sign, verify, derive
from .ProofSet import ProofSet
from .proof_set import ProofSet
from .purposes import (
ProofPurpose,
ControllerProofPurpose,
Expand Down
4 changes: 2 additions & 2 deletions aries_cloudagent/vc/ld_proofs/crypto/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from .KeyPair import KeyPair
from .WalletKeyPair import WalletKeyPair
from .key_pair import KeyPair
from .wallet_key_pair import WalletKeyPair

__all__ = ["KeyPair", "WalletKeyPair"]
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
from asynctest import TestCase
from asynctest import mock as async_mock
from asynctest import TestCase, mock as async_mock

from .....wallet.key_pair import KeyType

from ...error import LinkedDataProofException
from ..WalletKeyPair import WalletKeyPair

from ..wallet_key_pair import WalletKeyPair


class TestWalletKeyPair(TestCase):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,10 @@
from ....wallet.util import b58_to_bytes
from ....wallet.key_type import KeyType
from ....wallet.base import BaseWallet

from ..error import LinkedDataProofException
from .KeyPair import KeyPair

from .key_pair import KeyPair


class WalletKeyPair(KeyPair):
Expand Down
4 changes: 2 additions & 2 deletions aries_cloudagent/vc/ld_proofs/ld_proofs.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@

from typing import List

from .validation_result import DocumentVerificationResult
from .document_loader import DocumentLoaderMethod
from .ProofSet import ProofSet
from .proof_set import ProofSet
from .purposes import ProofPurpose
from .suites import LinkedDataProof
from .validation_result import DocumentVerificationResult


async def sign(
Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
"""Class to represent a Linked Data proof set."""

from typing import List, Union

from pyld.jsonld import JsonLdProcessor

from .error import LinkedDataProofException
from .validation_result import DocumentVerificationResult, ProofResult
from .constants import SECURITY_CONTEXT_URL
from .document_loader import DocumentLoaderMethod
from .purposes.ProofPurpose import ProofPurpose
from .error import LinkedDataProofException
from .purposes.proof_purpose import ProofPurpose
from .suites import LinkedDataProof
from .validation_result import DocumentVerificationResult, ProofResult


class ProofSet:
Expand Down
11 changes: 6 additions & 5 deletions aries_cloudagent/vc/ld_proofs/purposes/__init__.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
from .ProofPurpose import ProofPurpose
from .ControllerProofPurpose import ControllerProofPurpose
from .AssertionProofPurpose import AssertionProofPurpose
from .AuthenticationProofPurpose import AuthenticationProofPurpose
from .CredentialIssuancePurpose import CredentialIssuancePurpose
from .proof_purpose import ProofPurpose

from .assertion_proof_purpose import AssertionProofPurpose
from .authentication_proof_purpose import AuthenticationProofPurpose
from .controller_proof_purpose import ControllerProofPurpose
from .credential_issuance_purpose import CredentialIssuancePurpose

__all__ = [
"ProofPurpose",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

from datetime import datetime, timedelta

from .ControllerProofPurpose import ControllerProofPurpose
from .controller_proof_purpose import ControllerProofPurpose


class AssertionProofPurpose(ControllerProofPurpose):
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,17 @@
"""Authentication proof purpose class."""

from datetime import datetime, timedelta
from typing import TYPE_CHECKING

from ..document_loader import DocumentLoaderMethod
from ..error import LinkedDataProofException
from ..validation_result import PurposeResult
from ..document_loader import DocumentLoaderMethod
from ..suites import LinkedDataProof
from .ControllerProofPurpose import ControllerProofPurpose

from .controller_proof_purpose import ControllerProofPurpose

# Avoid circular dependency
if TYPE_CHECKING:
from ..suites import LinkedDataProof


class AuthenticationProofPurpose(ControllerProofPurpose):
Expand Down Expand Up @@ -37,7 +42,7 @@ def validate(
*,
proof: dict,
document: dict,
suite: LinkedDataProof,
suite: "LinkedDataProof",
verification_method: dict,
document_loader: DocumentLoaderMethod,
) -> PurposeResult:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,20 @@
"""Controller proof purpose class."""

from typing import TYPE_CHECKING

from pyld.jsonld import JsonLdProcessor
from pyld import jsonld

from ..error import LinkedDataProofException
from ..validation_result import PurposeResult
from ..constants import SECURITY_CONTEXT_URL
from ..suites import LinkedDataProof
from ..document_loader import DocumentLoaderMethod
from .ProofPurpose import ProofPurpose
from ..error import LinkedDataProofException
from ..validation_result import PurposeResult

from .proof_purpose import ProofPurpose

# Avoid circular dependency
if TYPE_CHECKING:
from ..suites import LinkedDataProof


class ControllerProofPurpose(ProofPurpose):
Expand All @@ -19,7 +25,7 @@ def validate(
*,
proof: dict,
document: dict,
suite: LinkedDataProof,
suite: "LinkedDataProof",
verification_method: dict,
document_loader: DocumentLoaderMethod,
) -> PurposeResult:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,15 +1,20 @@
"""Credential Issuance proof purpose class."""

from typing import List
from typing import List, TYPE_CHECKING

from pyld.jsonld import JsonLdProcessor
from pyld import jsonld

from ..constants import CREDENTIALS_ISSUER_URL
from ..document_loader import DocumentLoaderMethod
from ..error import LinkedDataProofException
from ..validation_result import PurposeResult
from ..suites import LinkedDataProof
from ..document_loader import DocumentLoaderMethod
from ..constants import CREDENTIALS_ISSUER_URL
from .AssertionProofPurpose import AssertionProofPurpose

from .assertion_proof_purpose import AssertionProofPurpose

# Avoid circular dependency
if TYPE_CHECKING:
from ..suites import LinkedDataProof


class CredentialIssuancePurpose(AssertionProofPurpose):
Expand All @@ -20,7 +25,7 @@ def validate(
*,
proof: dict,
document: dict,
suite: LinkedDataProof,
suite: "LinkedDataProof",
verification_method: dict,
document_loader: DocumentLoaderMethod,
) -> PurposeResult:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,16 @@
"""Base Proof Purpose class."""

from datetime import datetime, timedelta
from typing import TYPE_CHECKING

from ....messaging.util import str_to_datetime
from ..validation_result import PurposeResult

from ..document_loader import DocumentLoaderMethod
from ..suites import LinkedDataProof
from ..validation_result import PurposeResult

# Avoid circular dependency
if TYPE_CHECKING:
from ..suites import LinkedDataProof


class ProofPurpose:
Expand All @@ -24,7 +29,7 @@ def validate(
*,
proof: dict,
document: dict,
suite: LinkedDataProof,
suite: "LinkedDataProof",
verification_method: dict,
document_loader: DocumentLoaderMethod,
) -> PurposeResult:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
from asynctest import TestCase, mock as async_mock

from ...validation_result import PurposeResult
from ..ControllerProofPurpose import ControllerProofPurpose
from ..AuthenticationProofPurpose import AuthenticationProofPurpose
from ..controller_proof_purpose import ControllerProofPurpose
from ..authentication_proof_purpose import AuthenticationProofPurpose


class TestAuthenticationProofPurpose(TestCase):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@

from ....tests.data import TEST_VC_DOCUMENT_SIGNED_DID_KEY_ED25519
from ....tests.document_loader import custom_document_loader
from ..ProofPurpose import ProofPurpose
from ..ControllerProofPurpose import ControllerProofPurpose
from ..proof_purpose import ProofPurpose
from ..controller_proof_purpose import ControllerProofPurpose


class TestControllerProofPurpose(TestCase):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
from asynctest import TestCase, mock as async_mock

from ...validation_result import PurposeResult
from ..AssertionProofPurpose import AssertionProofPurpose
from ..CredentialIssuancePurpose import CredentialIssuancePurpose
from ..assertion_proof_purpose import AssertionProofPurpose
from ..credential_issuance_purpose import CredentialIssuancePurpose
from ....tests.data import TEST_VC_DOCUMENT_SIGNED_ED25519
from ....tests.document_loader import custom_document_loader

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
from asynctest import TestCase, mock as async_mock

from .....messaging.util import datetime_to_str
from ..ProofPurpose import ProofPurpose
from ..proof_purpose import ProofPurpose


class TestProofPurpose(TestCase):
Expand Down
12 changes: 6 additions & 6 deletions aries_cloudagent/vc/ld_proofs/suites/__init__.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
from .LinkedDataProof import LinkedDataProof
from .LinkedDataSignature import LinkedDataSignature
from .JwsLinkedDataSignature import JwsLinkedDataSignature
from .Ed25519Signature2018 import Ed25519Signature2018
from .BbsBlsSignature2020 import BbsBlsSignature2020
from .BbsBlsSignatureProof2020 import BbsBlsSignatureProof2020
from .linked_data_proof import LinkedDataProof
from .linked_data_signature import LinkedDataSignature
from .jws_linked_data_signature import JwsLinkedDataSignature
from .ed25519_signature_2018 import Ed25519Signature2018
from .bbs_bls_signature_2020 import BbsBlsSignature2020
from .bbs_bls_signature_proof_2020 import BbsBlsSignatureProof2020

__all__ = [
"LinkedDataProof",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,15 @@
from datetime import datetime
from typing import List, Union


from ....wallet.util import b64_to_bytes, bytes_to_b64

from ..crypto import KeyPair
from ..error import LinkedDataProofException
from ..validation_result import ProofResult
from ..document_loader import DocumentLoaderMethod
from ..error import LinkedDataProofException
from ..purposes import ProofPurpose
from .BbsBlsSignature2020Base import BbsBlsSignature2020Base
from ..validation_result import ProofResult

from .bbs_bls_signature_2020_base import BbsBlsSignature2020Base


class BbsBlsSignature2020(BbsBlsSignature2020Base):
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,16 @@
"""BbsBlsSignature2020Base class."""

from abc import ABCMeta, abstractmethod
from pyld import jsonld
from typing import List

from ..error import LinkedDataProofException
from pyld import jsonld

from ....utils.dependencies import is_ursa_bbs_signatures_module_installed

from ..document_loader import DocumentLoaderMethod
from .LinkedDataProof import LinkedDataProof
from ..error import LinkedDataProofException

from .linked_data_proof import LinkedDataProof


class BbsBlsSignature2020Base(LinkedDataProof, metaclass=ABCMeta):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,11 @@
import re

from os import urandom
from pyld import jsonld
from typing import List
from .BbsBlsSignature2020Base import BbsBlsSignature2020Base

from pyld import jsonld

from .bbs_bls_signature_2020_base import BbsBlsSignature2020Base

if BbsBlsSignature2020Base.BBS_SUPPORTED:
from ursa_bbs_signatures import (
Expand All @@ -21,13 +23,15 @@

from ....utils.dependencies import assert_ursa_bbs_signatures_installed
from ....wallet.util import b64_to_bytes, bytes_to_b64

from ..crypto import KeyPair
from ..error import LinkedDataProofException
from ..validation_result import ProofResult
from ..document_loader import DocumentLoaderMethod
from ..purposes import ProofPurpose
from .BbsBlsSignature2020 import BbsBlsSignature2020
from .LinkedDataProof import DeriveProofResult

from .bbs_bls_signature_2020 import BbsBlsSignature2020
from .linked_data_proof import DeriveProofResult


class BbsBlsSignatureProof2020(BbsBlsSignature2020Base):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@
from typing import Union

from ..crypto import KeyPair
from .JwsLinkedDataSignature import JwsLinkedDataSignature

from .jws_linked_data_signature import JwsLinkedDataSignature


class Ed25519Signature2018(JwsLinkedDataSignature):
Expand Down
Original file line number Diff line number Diff line change
@@ -1,15 +1,19 @@
"""JWS Linked Data class."""

from pyld.jsonld import JsonLdProcessor
import json

from datetime import datetime
from typing import Union
import json

from pyld.jsonld import JsonLdProcessor

from ....wallet.util import b64_to_bytes, bytes_to_b64, str_to_b64, b64_to_str

from ..crypto import KeyPair
from ..document_loader import DocumentLoaderMethod
from ..error import LinkedDataProofException
from .LinkedDataSignature import LinkedDataSignature

from .linked_data_signature import LinkedDataSignature


class JwsLinkedDataSignature(LinkedDataSignature):
Expand Down
Loading

0 comments on commit 49f707e

Please sign in to comment.