Skip to content

Commit

Permalink
Revert "did:tdw resolver (openwallet-foundation#3237)"
Browse files Browse the repository at this point in the history
This reverts commit f5c49b0.

Signed-off-by: ff137 <[email protected]>
  • Loading branch information
ff137 committed Dec 2, 2024
1 parent 9cf64cd commit 9a144a6
Show file tree
Hide file tree
Showing 8 changed files with 478 additions and 721 deletions.
19 changes: 0 additions & 19 deletions acapy_agent/messaging/tests/test_valid.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
CREDENTIAL_TYPE_VALIDATE,
DID_KEY_VALIDATE,
DID_POSTURE_VALIDATE,
DID_TDW_VALIDATE,
ENDPOINT_TYPE_VALIDATE,
ENDPOINT_VALIDATE,
INDY_CRED_DEF_ID_VALIDATE,
Expand Down Expand Up @@ -115,24 +114,6 @@ def test_indy_did(self):
INDY_DID_VALIDATE("Q4zqM7aXqm7gDQkUVLng9h")
INDY_DID_VALIDATE("did:sov:Q4zqM7aXqm7gDQkUVLng9h")

def test_tdw_did(self):
valid_tdw_dids = [
"did:tdw:QmUchSB5f5DJQks9CeyLJjhAy4iKJcYzRyiuYq3sjV13px:example.com",
"did:tdw:QmZiKXwQVfyZVuvCsuHpQh4arSUpEmeVVRvSfv3uiEycSr:example.com%3A5000",
]
for valid_tdw_did in valid_tdw_dids:
DID_TDW_VALIDATE(valid_tdw_did)

non_valid_tdw_dids = [
"did:web:QmUchSB5f5DJQks9CeyLJjhAy4iKJcYzRyiuYq3sjV13px",
# Did urls are not allowed
"did:tdw:QmP9VWaTCHcyztDpRj9XSHvZbmYe3m9HZ61KoDtZgWaXVU:example.com%3A5000#z6MkkzY9skorPaoEbCJFKUo7thD8Yb8MBs28aJRopf1TUo9V",
"did:tdw:QmZiKXwQVfyZVuvCsuHpQh4arSUpEmeVVRvSfv3uiEycSr:example.com%3A5000/whois",
]
for non_valid_tdw_did in non_valid_tdw_dids:
with self.assertRaises(ValidationError):
DID_TDW_VALIDATE(non_valid_tdw_did)

def test_indy_raw_public_key(self):
non_indy_raw_public_keys = [
"Q4zqM7aXqm7gDQkUVLng9JQ4zqM7aXqm7gDQkUVLng9I", # 'I' not a base58 char
Expand Down
17 changes: 0 additions & 17 deletions acapy_agent/messaging/valid.py
Original file line number Diff line number Diff line change
Expand Up @@ -319,20 +319,6 @@ def __init__(self):
)


class DIDTdw(Regexp):
"""Validate value against did:tdw specification."""

EXAMPLE = "did:tdw:QmP9VWaTCHcyztDpRj9XSHvZbmYe3m9HZ61KoDtZgWaXVU:example.com%3A5000"
PATTERN = re.compile(r"^(did:tdw:)([a-zA-Z0-9%._-]*:)*[a-zA-Z0-9%._-]+$")

def __init__(self):
"""Initialize the instance."""

super().__init__(
DIDTdw.PATTERN, error="Value {input} is not in W3C did:tdw format"
)


class DIDPosture(OneOf):
"""Validate value against defined DID postures."""

Expand Down Expand Up @@ -1010,9 +996,6 @@ def __init__(
DID_WEB_VALIDATE = DIDWeb()
DID_WEB_EXAMPLE = DIDWeb.EXAMPLE

DID_TDW_VALIDATE = DIDTdw()
DID_TDW_EXAMPLE = DIDTdw.EXAMPLE

ROUTING_KEY_VALIDATE = RoutingKey()
ROUTING_KEY_EXAMPLE = RoutingKey.EXAMPLE

Expand Down
6 changes: 0 additions & 6 deletions acapy_agent/resolver/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,12 +49,6 @@ async def setup(context: InjectionContext):
await web_resolver.setup(context)
registry.register_resolver(web_resolver)

tdw_resolver = ClassProvider(
"acapy_agent.resolver.default.tdw.TdwDIDResolver"
).provide(context.settings, context.injector)
await tdw_resolver.setup(context)
registry.register_resolver(tdw_resolver)

if context.settings.get("resolver.universal"):
universal_resolver = ClassProvider(
"acapy_agent.resolver.default.universal.UniversalResolver"
Expand Down
40 changes: 0 additions & 40 deletions acapy_agent/resolver/default/tdw.py

This file was deleted.

36 changes: 0 additions & 36 deletions acapy_agent/resolver/default/tests/test_tdw.py

This file was deleted.

8 changes: 0 additions & 8 deletions acapy_agent/wallet/did_method.py
Original file line number Diff line number Diff line change
Expand Up @@ -90,13 +90,6 @@ def holder_defined_did(self) -> HolderDefinedDid:
holder_defined_did=HolderDefinedDid.NO,
)

TDW = DIDMethod(
name="tdw",
key_types=[ED25519, X25519],
rotation=False,
holder_defined_did=HolderDefinedDid.NO,
)


class DIDMethods:
"""DID Method class specifying DID methods with supported key types."""
Expand All @@ -109,7 +102,6 @@ def __init__(self) -> None:
WEB.method_name: WEB,
PEER2.method_name: PEER2,
PEER4.method_name: PEER4,
TDW.method_name: TDW,
}

def registered(self, method: str) -> bool:
Expand Down
Loading

0 comments on commit 9a144a6

Please sign in to comment.