From 49f707eba4cf56f42786f0e2536ce3680552ba45 Mon Sep 17 00:00:00 2001 From: Andrew Whitehead Date: Sun, 22 Aug 2021 15:06:58 -0700 Subject: [PATCH 1/2] rename files to avoid ambiguity in docs Signed-off-by: Andrew Whitehead --- aries_cloudagent/vc/ld_proofs/__init__.py | 2 +- .../vc/ld_proofs/crypto/__init__.py | 4 ++-- .../crypto/{KeyPair.py => key_pair.py} | 0 ...WalletKeyPair.py => test_wallet_key_pair.py} | 7 ++++--- .../{WalletKeyPair.py => wallet_key_pair.py} | 4 +++- aries_cloudagent/vc/ld_proofs/ld_proofs.py | 4 ++-- .../vc/ld_proofs/{ProofSet.py => proof_set.py} | 7 ++++--- .../vc/ld_proofs/purposes/__init__.py | 11 ++++++----- ...oofPurpose.py => assertion_proof_purpose.py} | 2 +- ...rpose.py => authentication_proof_purpose.py} | 13 +++++++++---- ...ofPurpose.py => controller_proof_purpose.py} | 16 +++++++++++----- ...urpose.py => credential_issuance_purpose.py} | 17 +++++++++++------ .../{ProofPurpose.py => proof_purpose.py} | 11 ++++++++--- ....py => test_authentication_proof_purpose.py} | 4 ++-- ...pose.py => test_controller_proof_purpose.py} | 4 ++-- ...e.py => test_credential_issuance_purpose.py} | 4 ++-- ...st_ProofPurpose.py => test_proof_purpose.py} | 2 +- .../vc/ld_proofs/suites/__init__.py | 12 ++++++------ ...gnature2020.py => bbs_bls_signature_2020.py} | 9 +++++---- ...20Base.py => bbs_bls_signature_2020_base.py} | 9 ++++++--- ...f2020.py => bbs_bls_signature_proof_2020.py} | 12 ++++++++---- ...gnature2018.py => ed25519_signature_2018.py} | 3 ++- ...ignature.py => jws_linked_data_signature.py} | 10 +++++++--- ...{LinkedDataProof.py => linked_data_proof.py} | 15 ++++++--------- ...ataSignature.py => linked_data_signature.py} | 11 ++++++----- ...re2020.py => test_bbs_bls_signature_2020.py} | 10 +++++----- ....py => test_bbs_bls_signature_proof_2020.py} | 9 +++++---- ...re2018.py => test_ed25519_signature_2018.py} | 8 +++++--- .../vc/vc_ld/tests/test_validation_result.py | 3 --- 29 files changed, 130 insertions(+), 93 deletions(-) rename aries_cloudagent/vc/ld_proofs/crypto/{KeyPair.py => key_pair.py} (100%) rename aries_cloudagent/vc/ld_proofs/crypto/tests/{test_WalletKeyPair.py => test_wallet_key_pair.py} (95%) rename aries_cloudagent/vc/ld_proofs/crypto/{WalletKeyPair.py => wallet_key_pair.py} (98%) rename aries_cloudagent/vc/ld_proofs/{ProofSet.py => proof_set.py} (99%) rename aries_cloudagent/vc/ld_proofs/purposes/{AssertionProofPurpose.py => assertion_proof_purpose.py} (89%) rename aries_cloudagent/vc/ld_proofs/purposes/{AuthenticationProofPurpose.py => authentication_proof_purpose.py} (92%) rename aries_cloudagent/vc/ld_proofs/purposes/{ControllerProofPurpose.py => controller_proof_purpose.py} (93%) rename aries_cloudagent/vc/ld_proofs/purposes/{CredentialIssuancePurpose.py => credential_issuance_purpose.py} (90%) rename aries_cloudagent/vc/ld_proofs/purposes/{ProofPurpose.py => proof_purpose.py} (93%) rename aries_cloudagent/vc/ld_proofs/purposes/tests/{test_AuthenticationProofPurpose.py => test_authentication_proof_purpose.py} (97%) rename aries_cloudagent/vc/ld_proofs/purposes/tests/{test_ControllerProofPurpose.py => test_controller_proof_purpose.py} (97%) rename aries_cloudagent/vc/ld_proofs/purposes/tests/{test_CredentialIssuancePurpose.py => test_credential_issuance_purpose.py} (97%) rename aries_cloudagent/vc/ld_proofs/purposes/tests/{test_ProofPurpose.py => test_proof_purpose.py} (98%) rename aries_cloudagent/vc/ld_proofs/suites/{BbsBlsSignature2020.py => bbs_bls_signature_2020.py} (99%) rename aries_cloudagent/vc/ld_proofs/suites/{BbsBlsSignature2020Base.py => bbs_bls_signature_2020_base.py} (98%) rename aries_cloudagent/vc/ld_proofs/suites/{BbsBlsSignatureProof2020.py => bbs_bls_signature_proof_2020.py} (98%) rename aries_cloudagent/vc/ld_proofs/suites/{Ed25519Signature2018.py => ed25519_signature_2018.py} (95%) rename aries_cloudagent/vc/ld_proofs/suites/{JwsLinkedDataSignature.py => jws_linked_data_signature.py} (99%) rename aries_cloudagent/vc/ld_proofs/suites/{LinkedDataProof.py => linked_data_proof.py} (95%) rename aries_cloudagent/vc/ld_proofs/suites/{LinkedDataSignature.py => linked_data_signature.py} (99%) rename aries_cloudagent/vc/ld_proofs/suites/tests/{test_BbsBlsSignature2020.py => test_bbs_bls_signature_2020.py} (96%) rename aries_cloudagent/vc/ld_proofs/suites/tests/{test_BbsBlsSignatureProof2020.py => test_bbs_bls_signature_proof_2020.py} (97%) rename aries_cloudagent/vc/ld_proofs/suites/tests/{test_Ed25519Signature2018.py => test_ed25519_signature_2018.py} (95%) diff --git a/aries_cloudagent/vc/ld_proofs/__init__.py b/aries_cloudagent/vc/ld_proofs/__init__.py index fa4dc4bde0..9843f069be 100644 --- a/aries_cloudagent/vc/ld_proofs/__init__.py +++ b/aries_cloudagent/vc/ld_proofs/__init__.py @@ -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, diff --git a/aries_cloudagent/vc/ld_proofs/crypto/__init__.py b/aries_cloudagent/vc/ld_proofs/crypto/__init__.py index fb8986a785..ccb10f82da 100644 --- a/aries_cloudagent/vc/ld_proofs/crypto/__init__.py +++ b/aries_cloudagent/vc/ld_proofs/crypto/__init__.py @@ -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"] diff --git a/aries_cloudagent/vc/ld_proofs/crypto/KeyPair.py b/aries_cloudagent/vc/ld_proofs/crypto/key_pair.py similarity index 100% rename from aries_cloudagent/vc/ld_proofs/crypto/KeyPair.py rename to aries_cloudagent/vc/ld_proofs/crypto/key_pair.py diff --git a/aries_cloudagent/vc/ld_proofs/crypto/tests/test_WalletKeyPair.py b/aries_cloudagent/vc/ld_proofs/crypto/tests/test_wallet_key_pair.py similarity index 95% rename from aries_cloudagent/vc/ld_proofs/crypto/tests/test_WalletKeyPair.py rename to aries_cloudagent/vc/ld_proofs/crypto/tests/test_wallet_key_pair.py index ba9d125fd1..705ca244be 100644 --- a/aries_cloudagent/vc/ld_proofs/crypto/tests/test_WalletKeyPair.py +++ b/aries_cloudagent/vc/ld_proofs/crypto/tests/test_wallet_key_pair.py @@ -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): diff --git a/aries_cloudagent/vc/ld_proofs/crypto/WalletKeyPair.py b/aries_cloudagent/vc/ld_proofs/crypto/wallet_key_pair.py similarity index 98% rename from aries_cloudagent/vc/ld_proofs/crypto/WalletKeyPair.py rename to aries_cloudagent/vc/ld_proofs/crypto/wallet_key_pair.py index 43e6df5eeb..f666b739ac 100644 --- a/aries_cloudagent/vc/ld_proofs/crypto/WalletKeyPair.py +++ b/aries_cloudagent/vc/ld_proofs/crypto/wallet_key_pair.py @@ -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): diff --git a/aries_cloudagent/vc/ld_proofs/ld_proofs.py b/aries_cloudagent/vc/ld_proofs/ld_proofs.py index cdb284fc73..284e328f61 100644 --- a/aries_cloudagent/vc/ld_proofs/ld_proofs.py +++ b/aries_cloudagent/vc/ld_proofs/ld_proofs.py @@ -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( diff --git a/aries_cloudagent/vc/ld_proofs/ProofSet.py b/aries_cloudagent/vc/ld_proofs/proof_set.py similarity index 99% rename from aries_cloudagent/vc/ld_proofs/ProofSet.py rename to aries_cloudagent/vc/ld_proofs/proof_set.py index 8eace9e6c4..4ff176d679 100644 --- a/aries_cloudagent/vc/ld_proofs/ProofSet.py +++ b/aries_cloudagent/vc/ld_proofs/proof_set.py @@ -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: diff --git a/aries_cloudagent/vc/ld_proofs/purposes/__init__.py b/aries_cloudagent/vc/ld_proofs/purposes/__init__.py index 454f9aa7b3..091c726be9 100644 --- a/aries_cloudagent/vc/ld_proofs/purposes/__init__.py +++ b/aries_cloudagent/vc/ld_proofs/purposes/__init__.py @@ -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", diff --git a/aries_cloudagent/vc/ld_proofs/purposes/AssertionProofPurpose.py b/aries_cloudagent/vc/ld_proofs/purposes/assertion_proof_purpose.py similarity index 89% rename from aries_cloudagent/vc/ld_proofs/purposes/AssertionProofPurpose.py rename to aries_cloudagent/vc/ld_proofs/purposes/assertion_proof_purpose.py index 1f36127496..c988b3f2a2 100644 --- a/aries_cloudagent/vc/ld_proofs/purposes/AssertionProofPurpose.py +++ b/aries_cloudagent/vc/ld_proofs/purposes/assertion_proof_purpose.py @@ -2,7 +2,7 @@ from datetime import datetime, timedelta -from .ControllerProofPurpose import ControllerProofPurpose +from .controller_proof_purpose import ControllerProofPurpose class AssertionProofPurpose(ControllerProofPurpose): diff --git a/aries_cloudagent/vc/ld_proofs/purposes/AuthenticationProofPurpose.py b/aries_cloudagent/vc/ld_proofs/purposes/authentication_proof_purpose.py similarity index 92% rename from aries_cloudagent/vc/ld_proofs/purposes/AuthenticationProofPurpose.py rename to aries_cloudagent/vc/ld_proofs/purposes/authentication_proof_purpose.py index 8dfa13a840..4ed8c0731a 100644 --- a/aries_cloudagent/vc/ld_proofs/purposes/AuthenticationProofPurpose.py +++ b/aries_cloudagent/vc/ld_proofs/purposes/authentication_proof_purpose.py @@ -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): @@ -37,7 +42,7 @@ def validate( *, proof: dict, document: dict, - suite: LinkedDataProof, + suite: "LinkedDataProof", verification_method: dict, document_loader: DocumentLoaderMethod, ) -> PurposeResult: diff --git a/aries_cloudagent/vc/ld_proofs/purposes/ControllerProofPurpose.py b/aries_cloudagent/vc/ld_proofs/purposes/controller_proof_purpose.py similarity index 93% rename from aries_cloudagent/vc/ld_proofs/purposes/ControllerProofPurpose.py rename to aries_cloudagent/vc/ld_proofs/purposes/controller_proof_purpose.py index fa0cb6fd0e..84167348ac 100644 --- a/aries_cloudagent/vc/ld_proofs/purposes/ControllerProofPurpose.py +++ b/aries_cloudagent/vc/ld_proofs/purposes/controller_proof_purpose.py @@ -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): @@ -19,7 +25,7 @@ def validate( *, proof: dict, document: dict, - suite: LinkedDataProof, + suite: "LinkedDataProof", verification_method: dict, document_loader: DocumentLoaderMethod, ) -> PurposeResult: diff --git a/aries_cloudagent/vc/ld_proofs/purposes/CredentialIssuancePurpose.py b/aries_cloudagent/vc/ld_proofs/purposes/credential_issuance_purpose.py similarity index 90% rename from aries_cloudagent/vc/ld_proofs/purposes/CredentialIssuancePurpose.py rename to aries_cloudagent/vc/ld_proofs/purposes/credential_issuance_purpose.py index 5e24cf3de7..151857fbf2 100644 --- a/aries_cloudagent/vc/ld_proofs/purposes/CredentialIssuancePurpose.py +++ b/aries_cloudagent/vc/ld_proofs/purposes/credential_issuance_purpose.py @@ -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): @@ -20,7 +25,7 @@ def validate( *, proof: dict, document: dict, - suite: LinkedDataProof, + suite: "LinkedDataProof", verification_method: dict, document_loader: DocumentLoaderMethod, ) -> PurposeResult: diff --git a/aries_cloudagent/vc/ld_proofs/purposes/ProofPurpose.py b/aries_cloudagent/vc/ld_proofs/purposes/proof_purpose.py similarity index 93% rename from aries_cloudagent/vc/ld_proofs/purposes/ProofPurpose.py rename to aries_cloudagent/vc/ld_proofs/purposes/proof_purpose.py index 8d9b7168ef..49fc7a48c8 100644 --- a/aries_cloudagent/vc/ld_proofs/purposes/ProofPurpose.py +++ b/aries_cloudagent/vc/ld_proofs/purposes/proof_purpose.py @@ -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: @@ -24,7 +29,7 @@ def validate( *, proof: dict, document: dict, - suite: LinkedDataProof, + suite: "LinkedDataProof", verification_method: dict, document_loader: DocumentLoaderMethod, ) -> PurposeResult: diff --git a/aries_cloudagent/vc/ld_proofs/purposes/tests/test_AuthenticationProofPurpose.py b/aries_cloudagent/vc/ld_proofs/purposes/tests/test_authentication_proof_purpose.py similarity index 97% rename from aries_cloudagent/vc/ld_proofs/purposes/tests/test_AuthenticationProofPurpose.py rename to aries_cloudagent/vc/ld_proofs/purposes/tests/test_authentication_proof_purpose.py index 4f902db3a4..957c5d56c1 100644 --- a/aries_cloudagent/vc/ld_proofs/purposes/tests/test_AuthenticationProofPurpose.py +++ b/aries_cloudagent/vc/ld_proofs/purposes/tests/test_authentication_proof_purpose.py @@ -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): diff --git a/aries_cloudagent/vc/ld_proofs/purposes/tests/test_ControllerProofPurpose.py b/aries_cloudagent/vc/ld_proofs/purposes/tests/test_controller_proof_purpose.py similarity index 97% rename from aries_cloudagent/vc/ld_proofs/purposes/tests/test_ControllerProofPurpose.py rename to aries_cloudagent/vc/ld_proofs/purposes/tests/test_controller_proof_purpose.py index 156f4a8dbc..8ae1dc33c6 100644 --- a/aries_cloudagent/vc/ld_proofs/purposes/tests/test_ControllerProofPurpose.py +++ b/aries_cloudagent/vc/ld_proofs/purposes/tests/test_controller_proof_purpose.py @@ -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): diff --git a/aries_cloudagent/vc/ld_proofs/purposes/tests/test_CredentialIssuancePurpose.py b/aries_cloudagent/vc/ld_proofs/purposes/tests/test_credential_issuance_purpose.py similarity index 97% rename from aries_cloudagent/vc/ld_proofs/purposes/tests/test_CredentialIssuancePurpose.py rename to aries_cloudagent/vc/ld_proofs/purposes/tests/test_credential_issuance_purpose.py index 8d0ee90886..60442b73da 100644 --- a/aries_cloudagent/vc/ld_proofs/purposes/tests/test_CredentialIssuancePurpose.py +++ b/aries_cloudagent/vc/ld_proofs/purposes/tests/test_credential_issuance_purpose.py @@ -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 diff --git a/aries_cloudagent/vc/ld_proofs/purposes/tests/test_ProofPurpose.py b/aries_cloudagent/vc/ld_proofs/purposes/tests/test_proof_purpose.py similarity index 98% rename from aries_cloudagent/vc/ld_proofs/purposes/tests/test_ProofPurpose.py rename to aries_cloudagent/vc/ld_proofs/purposes/tests/test_proof_purpose.py index 7d6dcef890..ffde15d366 100644 --- a/aries_cloudagent/vc/ld_proofs/purposes/tests/test_ProofPurpose.py +++ b/aries_cloudagent/vc/ld_proofs/purposes/tests/test_proof_purpose.py @@ -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): diff --git a/aries_cloudagent/vc/ld_proofs/suites/__init__.py b/aries_cloudagent/vc/ld_proofs/suites/__init__.py index b669ff0348..3e680e142b 100644 --- a/aries_cloudagent/vc/ld_proofs/suites/__init__.py +++ b/aries_cloudagent/vc/ld_proofs/suites/__init__.py @@ -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", diff --git a/aries_cloudagent/vc/ld_proofs/suites/BbsBlsSignature2020.py b/aries_cloudagent/vc/ld_proofs/suites/bbs_bls_signature_2020.py similarity index 99% rename from aries_cloudagent/vc/ld_proofs/suites/BbsBlsSignature2020.py rename to aries_cloudagent/vc/ld_proofs/suites/bbs_bls_signature_2020.py index a0d1ddcbe8..b089bcc2c4 100644 --- a/aries_cloudagent/vc/ld_proofs/suites/BbsBlsSignature2020.py +++ b/aries_cloudagent/vc/ld_proofs/suites/bbs_bls_signature_2020.py @@ -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): diff --git a/aries_cloudagent/vc/ld_proofs/suites/BbsBlsSignature2020Base.py b/aries_cloudagent/vc/ld_proofs/suites/bbs_bls_signature_2020_base.py similarity index 98% rename from aries_cloudagent/vc/ld_proofs/suites/BbsBlsSignature2020Base.py rename to aries_cloudagent/vc/ld_proofs/suites/bbs_bls_signature_2020_base.py index b236df21b1..4c0a1e8938 100644 --- a/aries_cloudagent/vc/ld_proofs/suites/BbsBlsSignature2020Base.py +++ b/aries_cloudagent/vc/ld_proofs/suites/bbs_bls_signature_2020_base.py @@ -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): diff --git a/aries_cloudagent/vc/ld_proofs/suites/BbsBlsSignatureProof2020.py b/aries_cloudagent/vc/ld_proofs/suites/bbs_bls_signature_proof_2020.py similarity index 98% rename from aries_cloudagent/vc/ld_proofs/suites/BbsBlsSignatureProof2020.py rename to aries_cloudagent/vc/ld_proofs/suites/bbs_bls_signature_proof_2020.py index 3b00e8ed5f..ad951e7bab 100644 --- a/aries_cloudagent/vc/ld_proofs/suites/BbsBlsSignatureProof2020.py +++ b/aries_cloudagent/vc/ld_proofs/suites/bbs_bls_signature_proof_2020.py @@ -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 ( @@ -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): diff --git a/aries_cloudagent/vc/ld_proofs/suites/Ed25519Signature2018.py b/aries_cloudagent/vc/ld_proofs/suites/ed25519_signature_2018.py similarity index 95% rename from aries_cloudagent/vc/ld_proofs/suites/Ed25519Signature2018.py rename to aries_cloudagent/vc/ld_proofs/suites/ed25519_signature_2018.py index 203b2bff91..df77ff8b75 100644 --- a/aries_cloudagent/vc/ld_proofs/suites/Ed25519Signature2018.py +++ b/aries_cloudagent/vc/ld_proofs/suites/ed25519_signature_2018.py @@ -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): diff --git a/aries_cloudagent/vc/ld_proofs/suites/JwsLinkedDataSignature.py b/aries_cloudagent/vc/ld_proofs/suites/jws_linked_data_signature.py similarity index 99% rename from aries_cloudagent/vc/ld_proofs/suites/JwsLinkedDataSignature.py rename to aries_cloudagent/vc/ld_proofs/suites/jws_linked_data_signature.py index e40399bb72..9aa749a8ee 100644 --- a/aries_cloudagent/vc/ld_proofs/suites/JwsLinkedDataSignature.py +++ b/aries_cloudagent/vc/ld_proofs/suites/jws_linked_data_signature.py @@ -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): diff --git a/aries_cloudagent/vc/ld_proofs/suites/LinkedDataProof.py b/aries_cloudagent/vc/ld_proofs/suites/linked_data_proof.py similarity index 95% rename from aries_cloudagent/vc/ld_proofs/suites/LinkedDataProof.py rename to aries_cloudagent/vc/ld_proofs/suites/linked_data_proof.py index 979b28b260..1c5c5cd63a 100644 --- a/aries_cloudagent/vc/ld_proofs/suites/LinkedDataProof.py +++ b/aries_cloudagent/vc/ld_proofs/suites/linked_data_proof.py @@ -2,21 +2,18 @@ from abc import ABC -from pyld import jsonld -from typing import List, TYPE_CHECKING, Union +from typing import List, Union +from pyld import jsonld from typing_extensions import TypedDict from ..check import get_properties_without_context from ..constants import SECURITY_CONTEXT_URL -from ..error import LinkedDataProofException from ..document_loader import DocumentLoaderMethod +from ..error import LinkedDataProofException +from ..purposes import ProofPurpose from ..validation_result import ProofResult -# ProofPurpose and LinkedDataProof depend on each other -if TYPE_CHECKING: - from ..purposes.ProofPurpose import ProofPurpose - class DeriveProofResult(TypedDict): """Result dict for deriving a proof.""" @@ -44,7 +41,7 @@ async def create_proof( self, *, document: dict, - purpose: "ProofPurpose", + purpose: ProofPurpose, document_loader: DocumentLoaderMethod, ) -> dict: """Create proof for document. @@ -67,7 +64,7 @@ async def verify_proof( *, proof: dict, document: dict, - purpose: "ProofPurpose", + purpose: ProofPurpose, document_loader: DocumentLoaderMethod, ) -> ProofResult: """Verify proof against document and proof purpose. diff --git a/aries_cloudagent/vc/ld_proofs/suites/LinkedDataSignature.py b/aries_cloudagent/vc/ld_proofs/suites/linked_data_signature.py similarity index 99% rename from aries_cloudagent/vc/ld_proofs/suites/LinkedDataSignature.py rename to aries_cloudagent/vc/ld_proofs/suites/linked_data_signature.py index 6d29daf945..502920a7c6 100644 --- a/aries_cloudagent/vc/ld_proofs/suites/LinkedDataSignature.py +++ b/aries_cloudagent/vc/ld_proofs/suites/linked_data_signature.py @@ -1,16 +1,17 @@ """Linked Data Signature class.""" +from abc import abstractmethod, ABCMeta from datetime import datetime from hashlib import sha256 from typing import Union -from abc import abstractmethod, ABCMeta -from ..error import LinkedDataProofException -from ..validation_result import ProofResult +from ..constants import SECURITY_CONTEXT_URL from ..document_loader import DocumentLoaderMethod +from ..error import LinkedDataProofException from ..purposes import ProofPurpose -from ..constants import SECURITY_CONTEXT_URL -from .LinkedDataProof import LinkedDataProof +from ..validation_result import ProofResult + +from .linked_data_proof import LinkedDataProof class LinkedDataSignature(LinkedDataProof, metaclass=ABCMeta): diff --git a/aries_cloudagent/vc/ld_proofs/suites/tests/test_BbsBlsSignature2020.py b/aries_cloudagent/vc/ld_proofs/suites/tests/test_bbs_bls_signature_2020.py similarity index 96% rename from aries_cloudagent/vc/ld_proofs/suites/tests/test_BbsBlsSignature2020.py rename to aries_cloudagent/vc/ld_proofs/suites/tests/test_bbs_bls_signature_2020.py index 484a028180..f8bfdf6533 100644 --- a/aries_cloudagent/vc/ld_proofs/suites/tests/test_BbsBlsSignature2020.py +++ b/aries_cloudagent/vc/ld_proofs/suites/tests/test_bbs_bls_signature_2020.py @@ -1,7 +1,6 @@ from asynctest import TestCase, mock as async_mock import pytest - from .....did.did_key import DIDKey from .....wallet.key_pair import KeyType from .....wallet.in_memory import InMemoryWallet @@ -14,12 +13,13 @@ TEST_VC_DOCUMENT, TEST_VC_DOCUMENT_SIGNED_BBS, ) -from ...error import LinkedDataProofException -from ...crypto.WalletKeyPair import WalletKeyPair -from ...purposes.AssertionProofPurpose import AssertionProofPurpose +from ...error import LinkedDataProofException +from ...crypto.wallet_key_pair import WalletKeyPair +from ...purposes.assertion_proof_purpose import AssertionProofPurpose from ...ld_proofs import sign, verify -from ..BbsBlsSignature2020 import BbsBlsSignature2020 + +from ..bbs_bls_signature_2020 import BbsBlsSignature2020 @pytest.mark.ursa_bbs_signatures diff --git a/aries_cloudagent/vc/ld_proofs/suites/tests/test_BbsBlsSignatureProof2020.py b/aries_cloudagent/vc/ld_proofs/suites/tests/test_bbs_bls_signature_proof_2020.py similarity index 97% rename from aries_cloudagent/vc/ld_proofs/suites/tests/test_BbsBlsSignatureProof2020.py rename to aries_cloudagent/vc/ld_proofs/suites/tests/test_bbs_bls_signature_proof_2020.py index b72d0daeec..e8a79e2297 100644 --- a/aries_cloudagent/vc/ld_proofs/suites/tests/test_BbsBlsSignatureProof2020.py +++ b/aries_cloudagent/vc/ld_proofs/suites/tests/test_bbs_bls_signature_proof_2020.py @@ -21,13 +21,14 @@ TEST_VC_DOCUMENT_PARTIAL_PROOF_BBS, TEST_VC_DOCUMENT_NESTED_REVEAL, ) -from ...crypto.WalletKeyPair import WalletKeyPair -from ...purposes.AssertionProofPurpose import AssertionProofPurpose +from ....vc_ld import derive_credential, verify_credential +from ...crypto.wallet_key_pair import WalletKeyPair +from ...purposes.assertion_proof_purpose import AssertionProofPurpose from ...error import LinkedDataProofException from ...ld_proofs import verify, derive -from ....vc_ld import derive_credential, verify_credential -from ..BbsBlsSignatureProof2020 import BbsBlsSignatureProof2020 + +from ..bbs_bls_signature_proof_2020 import BbsBlsSignatureProof2020 @pytest.mark.ursa_bbs_signatures diff --git a/aries_cloudagent/vc/ld_proofs/suites/tests/test_Ed25519Signature2018.py b/aries_cloudagent/vc/ld_proofs/suites/tests/test_ed25519_signature_2018.py similarity index 95% rename from aries_cloudagent/vc/ld_proofs/suites/tests/test_Ed25519Signature2018.py rename to aries_cloudagent/vc/ld_proofs/suites/tests/test_ed25519_signature_2018.py index 7999a07da6..613aec46ab 100644 --- a/aries_cloudagent/vc/ld_proofs/suites/tests/test_Ed25519Signature2018.py +++ b/aries_cloudagent/vc/ld_proofs/suites/tests/test_ed25519_signature_2018.py @@ -5,6 +5,7 @@ from .....wallet.key_pair import KeyType from .....wallet.in_memory import InMemoryWallet from .....core.in_memory import InMemoryProfile + from ....tests.document_loader import custom_document_loader from ....tests.data import ( TEST_LD_DOCUMENT, @@ -13,11 +14,12 @@ TEST_VC_DOCUMENT, TEST_VC_DOCUMENT_SIGNED_ED25519, ) -from ...crypto.WalletKeyPair import WalletKeyPair -from ...purposes.AssertionProofPurpose import AssertionProofPurpose +from ...crypto.wallet_key_pair import WalletKeyPair +from ...purposes.assertion_proof_purpose import AssertionProofPurpose from ...ld_proofs import sign, verify -from ..Ed25519Signature2018 import Ed25519Signature2018 + +from ..ed25519_signature_2018 import Ed25519Signature2018 class TestEd25519Signature2018(TestCase): diff --git a/aries_cloudagent/vc/vc_ld/tests/test_validation_result.py b/aries_cloudagent/vc/vc_ld/tests/test_validation_result.py index d9e69269f4..26f027d4a6 100644 --- a/aries_cloudagent/vc/vc_ld/tests/test_validation_result.py +++ b/aries_cloudagent/vc/vc_ld/tests/test_validation_result.py @@ -1,7 +1,4 @@ from asynctest import TestCase -from datetime import datetime - -import pytest from ..validation_result import PresentationVerificationResult From e853da27d061957ce196c572db266701c58d704a Mon Sep 17 00:00:00 2001 From: Andrew Whitehead Date: Sun, 22 Aug 2021 15:52:15 -0700 Subject: [PATCH 2/2] clean up warnings during unit tests Signed-off-by: Andrew Whitehead --- .../core/tests/test_dispatcher.py | 9 ++++---- aries_cloudagent/core/tests/test_error.py | 2 +- aries_cloudagent/resolver/base.py | 10 ++++---- aries_cloudagent/resolver/default/indy.py | 11 +-------- aries_cloudagent/resolver/default/key.py | 11 +-------- .../resolver/default/tests/test_indy.py | 6 ----- .../resolver/default/tests/test_key.py | 10 -------- aries_cloudagent/resolver/default/web.py | 6 +---- aries_cloudagent/resolver/tests/test_base.py | 23 +++++++++++++++---- .../resolver/tests/test_did_resolver.py | 16 +++++++++---- 10 files changed, 44 insertions(+), 60 deletions(-) diff --git a/aries_cloudagent/core/tests/test_dispatcher.py b/aries_cloudagent/core/tests/test_dispatcher.py index b66b675329..3b5e245367 100644 --- a/aries_cloudagent/core/tests/test_dispatcher.py +++ b/aries_cloudagent/core/tests/test_dispatcher.py @@ -1,19 +1,17 @@ -import asyncio import json +import pytest + from asynctest import TestCase as AsyncTestCase, mock as async_mock from marshmallow import EXCLUDE from ...config.injection_context import InjectionContext -from ...connections.models.conn_record import ConnRecord from ...core.event_bus import EventBus from ...core.in_memory import InMemoryProfile from ...core.profile import Profile from ...core.protocol_registry import ProtocolRegistry from ...messaging.agent_message import AgentMessage, AgentMessageSchema -from ...messaging.responder import MockResponder from ...messaging.request_context import RequestContext -from ...messaging.util import datetime_now from ...protocols.didcomm_prefix import DIDCommPrefix from ...protocols.issue_credential.v2_0.message_types import CRED_20_PROBLEM_REPORT from ...protocols.issue_credential.v2_0.messages.cred_problem_report import ( @@ -393,7 +391,8 @@ async def test_create_send_webhook(self): context = RequestContext(profile) message = StubAgentMessage() responder = test_module.DispatcherResponder(context, message, None) - await responder.send_webhook("topic", {"pay": "load"}) + with pytest.deprecated_call(): + await responder.send_webhook("topic", {"pay": "load"}) async def test_create_enc_outbound(self): profile = make_profile() diff --git a/aries_cloudagent/core/tests/test_error.py b/aries_cloudagent/core/tests/test_error.py index 02d962b989..9a7dea11d3 100644 --- a/aries_cloudagent/core/tests/test_error.py +++ b/aries_cloudagent/core/tests/test_error.py @@ -1,6 +1,6 @@ import asyncio -from asynctest import TestCase as AsyncTestCase, mock as async_mock +from asynctest import TestCase as AsyncTestCase from ..error import BaseError diff --git a/aries_cloudagent/resolver/base.py b/aries_cloudagent/resolver/base.py index 1374a50578..994bfe94b2 100644 --- a/aries_cloudagent/resolver/base.py +++ b/aries_cloudagent/resolver/base.py @@ -1,10 +1,11 @@ """Base Class for DID Resolvers.""" +import re +import warnings + from abc import ABC, abstractmethod from enum import Enum -import re from typing import NamedTuple, Pattern, Sequence, Union -import warnings from pydid import DID @@ -116,7 +117,8 @@ async def supports(self, profile: Profile, did: str) -> bool: try: supported_did_regex = self.supported_did_regex except NotImplementedError as error: - if not self.supported_methods: + methods = self.supported_methods + if not methods: raise error warnings.warn( "BaseResolver.supported_methods is deprecated; " @@ -125,7 +127,7 @@ async def supports(self, profile: Profile, did: str) -> bool: ) supported_did_regex = re.compile( - "^did:(?:{}):.*$".format("|".join(self.supported_methods)) + "^did:(?:{}):.*$".format("|".join(methods)) ) return bool(supported_did_regex.match(did)) diff --git a/aries_cloudagent/resolver/default/indy.py b/aries_cloudagent/resolver/default/indy.py index b6df684f9c..dddaf08683 100644 --- a/aries_cloudagent/resolver/default/indy.py +++ b/aries_cloudagent/resolver/default/indy.py @@ -3,7 +3,7 @@ Resolution is performed using the IndyLedger class. """ -from typing import Sequence, Pattern +from typing import Pattern from pydid import DID, DIDDocumentBuilder from pydid.verification_method import Ed25519VerificationKey2018 @@ -34,15 +34,6 @@ def __init__(self): async def setup(self, context: InjectionContext): """Perform required setup for Indy DID resolution.""" - @property - def supported_methods(self) -> Sequence[str]: - """ - Return supported methods of Indy DID Resolver. - - DEPRECATED: Use supported_did_regex instead. - """ - return ["sov"] - @property def supported_did_regex(self) -> Pattern: """Return supported_did_regex of Indy DID Resolver.""" diff --git a/aries_cloudagent/resolver/default/key.py b/aries_cloudagent/resolver/default/key.py index 53286b1896..2f9f10edf9 100644 --- a/aries_cloudagent/resolver/default/key.py +++ b/aries_cloudagent/resolver/default/key.py @@ -3,7 +3,7 @@ Resolution is performed using the IndyLedger class. """ -from typing import Sequence, Pattern +from typing import Pattern from ...did.did_key import DIDKey from ...config.injection_context import InjectionContext @@ -23,15 +23,6 @@ def __init__(self): async def setup(self, context: InjectionContext): """Perform required setup for Key DID resolution.""" - @property - def supported_methods(self) -> Sequence[str]: - """ - Return supported methods of Key DID Resolver. - - DEPRECATED: Use supported_did_regex instead. - """ - return ["key"] - @property def supported_did_regex(self) -> Pattern: """Return supported_did_regex of Key DID Resolver.""" diff --git a/aries_cloudagent/resolver/default/tests/test_indy.py b/aries_cloudagent/resolver/default/tests/test_indy.py index 468e60ad37..a82f7ba427 100644 --- a/aries_cloudagent/resolver/default/tests/test_indy.py +++ b/aries_cloudagent/resolver/default/tests/test_indy.py @@ -44,12 +44,6 @@ def profile(ledger): class TestIndyResolver: - @pytest.mark.asyncio - async def test_supported_methods(self, profile, resolver: IndyDIDResolver): - """Test the supported_methods.""" - assert resolver.supported_methods == ["sov"] - assert await resolver.supports(profile, TEST_DID0) - @pytest.mark.asyncio async def test_supported_did_regex(self, profile, resolver: IndyDIDResolver): """Test the supported_did_regex.""" diff --git a/aries_cloudagent/resolver/default/tests/test_key.py b/aries_cloudagent/resolver/default/tests/test_key.py index 2d06a8517d..2ec6587006 100644 --- a/aries_cloudagent/resolver/default/tests/test_key.py +++ b/aries_cloudagent/resolver/default/tests/test_key.py @@ -27,16 +27,6 @@ def profile(): yield profile -@pytest.mark.asyncio -async def test_supported_methods(profile, resolver: KeyDIDResolver): - """Test the supported_methods.""" - assert resolver.supported_methods == ["key"] - assert await resolver.supports( - profile, - TEST_DID0, - ) - - @pytest.mark.asyncio async def test_supported_did_regex(profile, resolver: KeyDIDResolver): """Test the supported_did_regex.""" diff --git a/aries_cloudagent/resolver/default/web.py b/aries_cloudagent/resolver/default/web.py index 3475ca2a8d..30aa5ce440 100644 --- a/aries_cloudagent/resolver/default/web.py +++ b/aries_cloudagent/resolver/default/web.py @@ -2,7 +2,7 @@ import urllib.parse -from typing import Sequence, Pattern +from typing import Pattern import aiohttp @@ -35,10 +35,6 @@ def supported_did_regex(self) -> Pattern: """Return supported_did_regex of Web DID Resolver.""" return DIDWeb.PATTERN - def supported_methods(self) -> Sequence[str]: - """Return list of supported methods.""" - return ["web"] - def __transform_to_url(self, did): """ Transform did to url. diff --git a/aries_cloudagent/resolver/tests/test_base.py b/aries_cloudagent/resolver/tests/test_base.py index 4f049c16b6..cdae76a91e 100644 --- a/aries_cloudagent/resolver/tests/test_base.py +++ b/aries_cloudagent/resolver/tests/test_base.py @@ -18,10 +18,6 @@ def __init__(self): async def setup(self, context): pass - @property - def supported_methods(self): - return ["test"] - @property def supported_did_regex(self): return re.compile("^did:example:[a-zA-Z0-9_.-]+$") @@ -66,3 +62,22 @@ async def test_resolve_x(native_resolver): with pytest.raises(DIDMethodNotSupported) as x_did: await native_resolver.resolve(None, "did:nosuchmethod:xxx") assert "does not support DID method" in str(x_did.value) + + +@pytest.mark.asyncio +async def test_supported_methods(): + class TestDIDResolver(BaseDIDResolver): + async def setup(self, context): + pass + + @property + def supported_methods(self): + return ["example"] + + async def _resolve(self, profile, did) -> DIDDocument: + return DIDDocument("did:example:123") + + with pytest.deprecated_call(): + assert await TestDIDResolver().supports( + profile, "did:example:WgWxqztrNooG92RXvxSTWv" + ) diff --git a/aries_cloudagent/resolver/tests/test_did_resolver.py b/aries_cloudagent/resolver/tests/test_did_resolver.py index 3a7fae83fe..b08480e805 100644 --- a/aries_cloudagent/resolver/tests/test_did_resolver.py +++ b/aries_cloudagent/resolver/tests/test_did_resolver.py @@ -1,5 +1,9 @@ """Test did resolver registry.""" +from typing import Pattern + +import re + import pytest from asynctest import mock as async_mock @@ -64,16 +68,18 @@ class MockResolver(BaseDIDResolver): def __init__(self, supported_methods, resolved=None, native: bool = False): super().__init__(ResolverType.NATIVE if native else ResolverType.NON_NATIVE) - self._supported_methods = supported_methods + self._did_regex = re.compile( + "^did:(?:{}):.*$".format("|".join(supported_methods)) + ) self.resolved = resolved + @property + def supported_did_regex(self) -> Pattern: + return self._did_regex + async def setup(self, context): pass - @property - def supported_methods(self): - return self._supported_methods - async def _resolve(self, profile, did): if isinstance(self.resolved, Exception): raise self.resolved