Skip to content

Commit cd4e4b0

Browse files
authored
Merge pull request openwallet-foundation#1061 from animo/cwu-bbs-main
CWU - W3C Issue Credential
2 parents 0b3de3f + afaf1ac commit cd4e4b0

File tree

241 files changed

+21280
-2885
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

241 files changed

+21280
-2885
lines changed

.circleci/config.yml

+4-3
Original file line numberDiff line numberDiff line change
@@ -7,20 +7,21 @@ jobs:
77
- checkout
88
- restore_cache:
99
keys:
10-
- v5-pip-dependencies-{{ .Branch }}-{{ checksum "requirements.txt" }}-{{ checksum "requirements.dev.txt" }}
10+
- v5-pip-dependencies-{{ .Branch }}-{{ checksum "requirements.txt" }}-{{ checksum "requirements.dev.txt" }}-{{ checksum "requirements.bbs.txt" }}
1111
- v5-pip-dependencies-{{ .Branch }}-
1212
- run:
1313
name: Install Python Dependencies
1414
command: |
1515
pip install \
1616
--user \
1717
-r requirements.txt \
18-
-r requirements.dev.txt
18+
-r requirements.dev.txt \
19+
-r requirements.bbs.txt
1920
2021
- save_cache:
2122
paths:
2223
- /home/indy/.local/lib/python3.6/site-packages
23-
key: v5-pip-dependencies-{{ .Branch }}-{{ checksum "requirements.txt" }}-{{ checksum "requirements.dev.txt" }}
24+
key: v5-pip-dependencies-{{ .Branch }}-{{ checksum "requirements.txt" }}-{{ checksum "requirements.dev.txt" }}-{{ checksum "requirements.bbs.txt" }}
2425

2526
- run:
2627
name: Run Agent Tests

aries_cloudagent/config/wallet.py

+18-5
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,15 @@
11
"""Wallet configuration."""
22

33
import logging
4+
from typing import Tuple
45

56
from ..core.error import ProfileNotFoundError
67
from ..core.profile import Profile, ProfileManager
78
from ..wallet.base import BaseWallet
89
from ..wallet.did_info import DIDInfo
910
from ..wallet.crypto import seed_to_did
11+
from ..wallet.key_type import KeyType
12+
from ..wallet.did_method import DIDMethod
1013

1114
from .base import ConfigError
1215
from .injection_context import InjectionContext
@@ -18,7 +21,7 @@
1821

1922
async def wallet_config(
2023
context: InjectionContext, provision: bool = False
21-
) -> (Profile, DIDInfo):
24+
) -> Tuple[Profile, DIDInfo]:
2225
"""Initialize the root profile."""
2326

2427
mgr = context.inject(ProfileManager)
@@ -65,7 +68,9 @@ async def wallet_config(
6568
public_did = public_did_info.did
6669
if wallet_seed and seed_to_did(wallet_seed) != public_did:
6770
if context.settings.get("wallet.replace_public_did"):
68-
replace_did_info = await wallet.create_local_did(wallet_seed)
71+
replace_did_info = await wallet.create_local_did(
72+
method=DIDMethod.SOV, key_type=KeyType.ED25519, seed=wallet_seed
73+
)
6974
public_did = replace_did_info.did
7075
await wallet.set_public_did(public_did)
7176
print(f"Created new public DID: {public_did}")
@@ -84,14 +89,19 @@ async def wallet_config(
8489
metadata = {"endpoint": endpoint} if endpoint else None
8590

8691
local_did_info = await wallet.create_local_did(
87-
seed=wallet_seed, metadata=metadata
92+
method=DIDMethod.SOV,
93+
key_type=KeyType.ED25519,
94+
seed=wallet_seed,
95+
metadata=metadata,
8896
)
8997
local_did = local_did_info.did
9098
if provision:
9199
print(f"Created new local DID: {local_did}")
92100
print(f"Verkey: {local_did_info.verkey}")
93101
else:
94-
public_did_info = await wallet.create_public_did(seed=wallet_seed)
102+
public_did_info = await wallet.create_public_did(
103+
method=DIDMethod.SOV, key_type=KeyType.ED25519, seed=wallet_seed
104+
)
95105
public_did = public_did_info.did
96106
if provision:
97107
print(f"Created new public DID: {public_did}")
@@ -108,7 +118,10 @@ async def wallet_config(
108118
test_seed = "testseed000000000000000000000001"
109119
if test_seed:
110120
await wallet.create_local_did(
111-
seed=test_seed, metadata={"endpoint": "1.2.3.4:8021"}
121+
method=DIDMethod.SOV,
122+
key_type=KeyType.ED25519,
123+
seed=test_seed,
124+
metadata={"endpoint": "1.2.3.4:8021"},
112125
)
113126

114127
await txn.commit()

aries_cloudagent/connections/base_manager.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,8 @@
2525
from ..storage.error import StorageNotFoundError
2626
from ..storage.record import StorageRecord
2727
from ..wallet.base import BaseWallet
28+
from ..did.did_key import DIDKey
2829
from ..wallet.did_info import DIDInfo
29-
from ..wallet.util import did_key_to_naked
3030
from .models.conn_record import ConnRecord
3131
from .models.connection_target import ConnectionTarget
3232
from .models.diddoc import DIDDoc, PublicKey, PublicKeyType, Service
@@ -315,11 +315,11 @@ async def fetch_connection_targets(
315315
else:
316316
endpoint = invitation.service_blocks[0].service_endpoint
317317
recipient_keys = [
318-
did_key_to_naked(k)
318+
DIDKey.from_did(k).public_key_b58
319319
for k in invitation.service_blocks[0].recipient_keys
320320
]
321321
routing_keys = [
322-
did_key_to_naked(k)
322+
DIDKey.from_did(k).public_key_b58
323323
for k in invitation.service_blocks[0].routing_keys
324324
]
325325

aries_cloudagent/core/conductor.py

+6
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@
3131
from ..protocols.connections.v1_0.messages.connection_invitation import (
3232
ConnectionInvitation,
3333
)
34+
from ..vc.ld_proofs.document_loader import DocumentLoader
3435
from ..protocols.coordinate_mediation.v1_0.manager import MediationManager
3536
from ..protocols.out_of_band.v1_0.manager import OutOfBandManager
3637
from ..protocols.out_of_band.v1_0.messages.invitation import HSProto, InvitationMessage
@@ -128,6 +129,11 @@ async def setup(self):
128129
multitenant_mgr = MultitenantManager(self.root_profile)
129130
context.injector.bind_instance(MultitenantManager, multitenant_mgr)
130131

132+
# Bind default PyLD document loader
133+
context.injector.bind_instance(
134+
DocumentLoader, DocumentLoader(self.root_profile)
135+
)
136+
131137
self.outbound_queue = get_outbound_queue(context.settings)
132138

133139
# Admin API

aries_cloudagent/core/tests/test_conductor.py

+24-5
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
from ...protocols.coordinate_mediation.v1_0.models.mediation_record import (
2121
MediationRecord,
2222
)
23+
from ...resolver.did_resolver import DIDResolver, DIDResolverRegistry
2324
from ...multitenant.manager import MultitenantManager
2425
from ...transport.inbound.message import InboundMessage
2526
from ...transport.inbound.receipt import MessageReceipt
@@ -30,6 +31,8 @@
3031
from ...transport.pack_format import PackWireFormat
3132
from ...utils.stats import Collector
3233
from ...wallet.base import BaseWallet
34+
from ...wallet.key_type import KeyType
35+
from ...wallet.did_method import DIDMethod
3336

3437
from .. import conductor as test_module
3538

@@ -80,6 +83,7 @@ async def build_context(self) -> InjectionContext:
8083
context.injector.bind_instance(ProfileManager, InMemoryProfileManager())
8184
context.injector.bind_instance(ProtocolRegistry, ProtocolRegistry())
8285
context.injector.bind_instance(BaseWireFormat, self.wire_format)
86+
context.injector.bind_instance(DIDResolver, DIDResolver(DIDResolverRegistry()))
8387
return context
8488

8589

@@ -108,7 +112,10 @@ async def test_startup(self):
108112
session = await conductor.root_profile.session()
109113

110114
wallet = session.inject(BaseWallet)
111-
await wallet.create_public_did()
115+
await wallet.create_public_did(
116+
DIDMethod.SOV,
117+
KeyType.ED25519,
118+
)
112119

113120
mock_inbound_mgr.return_value.setup.assert_awaited_once()
114121
mock_outbound_mgr.return_value.setup.assert_awaited_once()
@@ -499,7 +506,10 @@ async def test_admin(self):
499506

500507
session = await conductor.root_profile.session()
501508
wallet = session.inject(BaseWallet)
502-
await wallet.create_public_did()
509+
await wallet.create_public_did(
510+
DIDMethod.SOV,
511+
KeyType.ED25519,
512+
)
503513

504514
with async_mock.patch.object(
505515
admin, "start", autospec=True
@@ -529,7 +539,10 @@ async def test_admin_startx(self):
529539

530540
session = await conductor.root_profile.session()
531541
wallet = session.inject(BaseWallet)
532-
await wallet.create_public_did()
542+
await wallet.create_public_did(
543+
DIDMethod.SOV,
544+
KeyType.ED25519,
545+
)
533546

534547
with async_mock.patch.object(
535548
admin, "start", autospec=True
@@ -577,7 +590,10 @@ async def test_start_static(self):
577590

578591
session = await conductor.root_profile.session()
579592
wallet = session.inject(BaseWallet)
580-
await wallet.create_public_did()
593+
await wallet.create_public_did(
594+
DIDMethod.SOV,
595+
KeyType.ED25519,
596+
)
581597

582598
mock_mgr.return_value.create_static_connection = async_mock.CoroutineMock()
583599
await conductor.start()
@@ -695,7 +711,10 @@ async def test_print_invite_connection(self):
695711

696712
session = await conductor.root_profile.session()
697713
wallet = session.inject(BaseWallet)
698-
await wallet.create_public_did()
714+
await wallet.create_public_did(
715+
DIDMethod.SOV,
716+
KeyType.ED25519,
717+
)
699718

700719
await conductor.start()
701720
await conductor.stop()

0 commit comments

Comments
 (0)