Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CWU - W3C Issue Credential #1061

Merged
merged 151 commits into from
Apr 29, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
151 commits
Select commit Hold shift + click to select a range
9b1e98d
add indy cred format class
TimoGlastra Feb 25, 2021
de123d9
abstract credential format handler, move indy
TimoGlastra Mar 3, 2021
5477f29
add ld_proofs code to aries_cloudagent/vc/ld_proofs
karimStekelenburg Feb 23, 2021
9386fbc
Add linked data proofs functionality
karimStekelenburg Mar 3, 2021
4cb007a
Add linked data verifiable credential functionality
karimStekelenburg Mar 3, 2021
5e3e250
add Ed25519Signature2018 signature suite
karimStekelenburg Mar 3, 2021
23a6977
add ld_proof record
TimoGlastra Mar 5, 2021
8aa0c34
fixed various syntax issues
karimStekelenburg Mar 9, 2021
f20f240
black formatting
TimoGlastra Mar 9, 2021
45b92b3
initial issuance flow working
TimoGlastra Mar 10, 2021
d3dbc2c
ld_proofs / vc improvments and refinements
TimoGlastra Mar 12, 2021
ee8fed3
linked data proof overhaul
TimoGlastra Mar 15, 2021
b294962
proof purpose overhaul
TimoGlastra Mar 15, 2021
9bd2358
issue / verify credential with basic test
TimoGlastra Mar 17, 2021
001ffd2
credential verification and storage working
TimoGlastra Mar 18, 2021
09326e0
Merge remote-tracking branch 'upstream/main' into cwu-bbs-main
TimoGlastra Mar 18, 2021
c057fc7
fix merge, restructure
TimoGlastra Mar 18, 2021
311dfb1
issue ld proof vc api
TimoGlastra Mar 19, 2021
27bb434
add did key parser class
TimoGlastra Mar 20, 2021
cf6aec4
add did:key support to API
TimoGlastra Mar 20, 2021
77bab4b
fix indy or key did pattern
TimoGlastra Mar 20, 2021
3bf693f
major cleanup and consistency overhaul
TimoGlastra Mar 21, 2021
f02eac1
issue and verify credential overhaul
TimoGlastra Mar 21, 2021
407c5b2
create, sign and verify presentation
TimoGlastra Mar 21, 2021
0f605e3
small improvements test_vc_ld
TimoGlastra Mar 21, 2021
45996d4
abstract base did key resolver
TimoGlastra Mar 22, 2021
64b6bc3
fix rfc3339 date time regex
TimoGlastra Mar 22, 2021
2f488cd
verify credential structure before issue/verify
TimoGlastra Mar 22, 2021
8a36c46
validate credentials in create presentation
TimoGlastra Mar 22, 2021
d7763e0
fix query dids route
TimoGlastra Mar 22, 2021
afa1bee
fix incorrect did context url
TimoGlastra Mar 22, 2021
808112e
fix incorrect import
TimoGlastra Mar 22, 2021
3b5cf34
sequence should be string
TimoGlastra Mar 22, 2021
9877d92
check dict vs class instances
TimoGlastra Mar 22, 2021
8b3dde6
await result with details
TimoGlastra Mar 22, 2021
8a0f511
fix: unhashable type: 'list' for subject ids
TimoGlastra Mar 22, 2021
6b417fb
store credential id
TimoGlastra Mar 22, 2021
2d7cb98
schema ids requird property
TimoGlastra Mar 22, 2021
bfb118e
DIF PresExch Impl
shaangill025 Mar 23, 2021
cd13c04
Requested Changes
shaangill025 Mar 23, 2021
4fcde0d
Fixed tmp_
shaangill025 Mar 23, 2021
8a20561
Fixes
shaangill025 Mar 23, 2021
1bbb39e
Merge remote-tracking branch 'upstream/main' into cwu-bbs-main
TimoGlastra Mar 24, 2021
a351c55
add test
TimoGlastra Mar 24, 2021
34070c6
fix for vc record api changes
TimoGlastra Mar 24, 2021
9f19cff
add bls1231 g1, g2 and g1g2 did key support
TimoGlastra Mar 24, 2021
5ef30c2
use security context constant without version
TimoGlastra Mar 25, 2021
8177939
add initial bbs+ signature suites
TimoGlastra Mar 25, 2021
ce55d04
update context url constants
TimoGlastra Mar 25, 2021
0f5c010
update wallet routes allowed key types
TimoGlastra Mar 25, 2021
657da46
formatting, docs, flake, black
TimoGlastra Mar 27, 2021
46a8e8b
more formatting, docs, flake, black
TimoGlastra Mar 27, 2021
088da2a
Use the document's context for proof before security context
TimoGlastra Mar 27, 2021
37c7100
error checks, docs, formatting, ...
TimoGlastra Mar 27, 2021
b3f3ef1
add bls signature sutie to issue cred handler
TimoGlastra Mar 27, 2021
44648dc
more flake worshipping
TimoGlastra Mar 27, 2021
ece1588
flake, intitial attempt to fix some tests
TimoGlastra Mar 28, 2021
4f5bc68
fix some more tests
TimoGlastra Mar 28, 2021
5b1f757
first pass at adding bls key support
TimoGlastra Mar 28, 2021
58f426b
initial bbs signatures working in in memory wallet
TimoGlastra Mar 28, 2021
a41301c
bls key support for indy wallet
TimoGlastra Mar 29, 2021
2a8b590
bbs credential exchange working
TimoGlastra Mar 29, 2021
c452fc0
add ursa_bbs_signatures with libbbs
TimoGlastra Mar 29, 2021
36c199e
correct egg for multicodec
TimoGlastra Mar 29, 2021
cada5ab
fix incorrect egg for multicodec
TimoGlastra Mar 29, 2021
1764855
fix cred proposal property assingment
TimoGlastra Mar 29, 2021
bf90c3e
create store cred return data before removing record
TimoGlastra Mar 29, 2021
d5c2e86
bbs derive and verify derived credential
TimoGlastra Mar 30, 2021
1040700
add bbs test documents
TimoGlastra Mar 30, 2021
7d63940
allow for multiple variants of bls key type
TimoGlastra Mar 30, 2021
5e82f39
bbs mattr interop tests
TimoGlastra Mar 30, 2021
92f1592
flake formatting
TimoGlastra Mar 30, 2021
0725a2f
query did by key type
TimoGlastra Mar 31, 2021
b77fe3d
use hardcoded multicodec prefixes, outdated lib
TimoGlastra Mar 31, 2021
00b7960
Merge remote-tracking branch 'upstream/main' into cwu-bbs-main
TimoGlastra Mar 31, 2021
3c9a5ee
optimize handler loading
TimoGlastra Mar 31, 2021
931a700
typo
TimoGlastra Mar 31, 2021
e137780
extract key pair storage
TimoGlastra Mar 31, 2021
0dec13e
Merge remote-tracking branch 'upstream/main' into cwu-bbs-main
TimoGlastra Apr 4, 2021
8857b9a
add uniqueness check
TimoGlastra Apr 4, 2021
c760bc0
filter w3c credentials by proof type
TimoGlastra Apr 4, 2021
3c683ca
check for properties missing in context
TimoGlastra Apr 4, 2021
c727430
handler improvements
TimoGlastra Apr 7, 2021
9568996
check for format consistency
TimoGlastra Apr 7, 2021
41e7041
update to changed ursa_bbs_signatures api
TimoGlastra Apr 7, 2021
66b6f1e
update local contexts
TimoGlastra Apr 9, 2021
2c2e42a
fix incorrect handling of context property check
TimoGlastra Apr 9, 2021
eb72511
remove unneeded code
TimoGlastra Apr 9, 2021
606476a
Merge remote-tracking branch 'upstream/main' into cwu-bbs-main
TimoGlastra Apr 9, 2021
766f97e
add did key resolver
TimoGlastra Apr 9, 2021
f64fef6
remove direct dependency on bbs+
TimoGlastra Apr 9, 2021
08f246a
integrate jsonld document loader with did resolver
TimoGlastra Apr 9, 2021
735f4ca
fix: use key-1 as did:sov key identifier
TimoGlastra Apr 9, 2021
23d982b
fix incorrect method signatures
TimoGlastra Apr 9, 2021
8b943d4
fix: await cache
TimoGlastra Apr 9, 2021
964ecf0
fix: correclty handle async document loader
TimoGlastra Apr 10, 2021
2bc01d5
fix: correclty parse did url
TimoGlastra Apr 10, 2021
197ab55
fix: format identifiers may differ for messages
TimoGlastra Apr 10, 2021
88aceb7
fix: add assertionMethod to did:sov diddocs
TimoGlastra Apr 10, 2021
da14f7b
remove duplicate did context url
TimoGlastra Apr 10, 2021
87b95ad
small fixmes
TimoGlastra Apr 10, 2021
b7e1ee7
test: fix broken unit tests
TimoGlastra Apr 10, 2021
ef90a05
fix ursa test stub
TimoGlastra Apr 10, 2021
add16f9
remove custom context resolver from context check
TimoGlastra Apr 10, 2021
0db404f
update pyld to 2.0.3
TimoGlastra Apr 10, 2021
3d2c99f
test: fix broken wallet unit tests
TimoGlastra Apr 10, 2021
729be68
Merge remote-tracking branch 'upstream/main' into cwu-bbs-main
TimoGlastra Apr 10, 2021
781079d
fix: proof may be none
TimoGlastra Apr 10, 2021
97f05d7
test: fix connections protocol unit tests
TimoGlastra Apr 12, 2021
fddb76c
fix: register did:key resolver if no ledger
TimoGlastra Apr 12, 2021
080f8fb
chore: update to released bbs library
TimoGlastra Apr 12, 2021
8df7ebb
chore: update ursa_bbs_signatures to 1.0.1
TimoGlastra Apr 12, 2021
d7ab015
feat: injectable json-ld document loader
TimoGlastra Apr 12, 2021
aa4f853
test: fix and extend broken issue credential tests
TimoGlastra Apr 12, 2021
25e366f
test: fix broken conductor unit tests
TimoGlastra Apr 12, 2021
b88766a
Merge remote-tracking branch 'upstream/main' into cwu-bbs-main
TimoGlastra Apr 12, 2021
8bbb2a8
fix: set context after proof to overwrite default
TimoGlastra Apr 13, 2021
ad7ac4e
remove unused ed25519 and bbsbls wallet key pairs
TimoGlastra Apr 13, 2021
8588dac
test: fix issue cred messages and handler tests
TimoGlastra Apr 13, 2021
877bfc0
fix: remove absolute aries_cloudagent imports
TimoGlastra Apr 13, 2021
c2aaec6
rework schemas and model classes
TimoGlastra Apr 14, 2021
65fd34f
test: flake formatting errors
TimoGlastra Apr 14, 2021
3c48e31
refactor: extract did and key type from crypto
TimoGlastra Apr 14, 2021
d977c65
test: add missing wallet unit tests
TimoGlastra Apr 15, 2021
35b0cd8
feat: use local context instead of security v3
TimoGlastra Apr 15, 2021
34ad3b1
feat: add validation to derive_credential
TimoGlastra Apr 15, 2021
c05f65c
restructure bbs crypto
TimoGlastra Apr 15, 2021
615c09f
Merge remote-tracking branch 'upstream/main' into cwu-bbs-main
TimoGlastra Apr 15, 2021
f508894
test: fix broken test from merge
TimoGlastra Apr 15, 2021
4659c5e
test: add missing issue credential unit tests
TimoGlastra Apr 15, 2021
07c301e
Merge remote-tracking branch 'upstream/main' into cwu-bbs-main
TimoGlastra Apr 16, 2021
223e27b
test: fix broken tests from merge
TimoGlastra Apr 16, 2021
f6c0c47
Merge remote-tracking branch 'upstream/main' into cwu-bbs-main
TimoGlastra Apr 22, 2021
915f442
fix after merge
TimoGlastra Apr 22, 2021
ffec4a6
test: add unit tests for ld signature suites
TimoGlastra Apr 26, 2021
769014a
Merge remote-tracking branch 'upstream/main' into cwu-bbs-main
TimoGlastra Apr 27, 2021
7389cc4
fix after merge
TimoGlastra Apr 27, 2021
e9ebeb7
remove presentation exchange for now
TimoGlastra Apr 27, 2021
fc22fb2
Merge remote-tracking branch 'upstream/main' into cwu-bbs-main
TimoGlastra Apr 27, 2021
683f7b2
chore: update circle ci with bbs requirements
TimoGlastra Apr 27, 2021
9194d5c
style: black formatting
TimoGlastra Apr 27, 2021
3f724c8
test: add unit tests for ld proof purposes
TimoGlastra Apr 28, 2021
0474b0d
test: update integration test
TimoGlastra Apr 28, 2021
db78bef
better ld proof example in swagger ui
TimoGlastra Apr 28, 2021
da66ca0
style: black formatting
TimoGlastra Apr 28, 2021
2a60430
test: more test coverage
TimoGlastra Apr 28, 2021
7cf00bc
style: black formatting
TimoGlastra Apr 28, 2021
c6a1626
Merge remote-tracking branch 'upstream/main' into cwu-bbs-main
TimoGlastra Apr 28, 2021
565a9d2
add bbs to setup.py
TimoGlastra Apr 28, 2021
00ab69b
test: fix usage of incorrect reveal document
TimoGlastra Apr 28, 2021
afaf1ac
fix: incorrect check of proof.created
TimoGlastra Apr 29, 2021
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,20 +7,21 @@ jobs:
- checkout
- restore_cache:
keys:
- v5-pip-dependencies-{{ .Branch }}-{{ checksum "requirements.txt" }}-{{ checksum "requirements.dev.txt" }}
- v5-pip-dependencies-{{ .Branch }}-{{ checksum "requirements.txt" }}-{{ checksum "requirements.dev.txt" }}-{{ checksum "requirements.bbs.txt" }}
- v5-pip-dependencies-{{ .Branch }}-
- run:
name: Install Python Dependencies
command: |
pip install \
--user \
-r requirements.txt \
-r requirements.dev.txt
-r requirements.dev.txt \
-r requirements.bbs.txt

- save_cache:
paths:
- /home/indy/.local/lib/python3.6/site-packages
key: v5-pip-dependencies-{{ .Branch }}-{{ checksum "requirements.txt" }}-{{ checksum "requirements.dev.txt" }}
key: v5-pip-dependencies-{{ .Branch }}-{{ checksum "requirements.txt" }}-{{ checksum "requirements.dev.txt" }}-{{ checksum "requirements.bbs.txt" }}

- run:
name: Run Agent Tests
Expand Down
23 changes: 18 additions & 5 deletions aries_cloudagent/config/wallet.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,15 @@
"""Wallet configuration."""

import logging
from typing import Tuple

from ..core.error import ProfileNotFoundError
from ..core.profile import Profile, ProfileManager
from ..wallet.base import BaseWallet
from ..wallet.did_info import DIDInfo
from ..wallet.crypto import seed_to_did
from ..wallet.key_type import KeyType
from ..wallet.did_method import DIDMethod

from .base import ConfigError
from .injection_context import InjectionContext
Expand All @@ -18,7 +21,7 @@

async def wallet_config(
context: InjectionContext, provision: bool = False
) -> (Profile, DIDInfo):
) -> Tuple[Profile, DIDInfo]:
"""Initialize the root profile."""

mgr = context.inject(ProfileManager)
Expand Down Expand Up @@ -65,7 +68,9 @@ async def wallet_config(
public_did = public_did_info.did
if wallet_seed and seed_to_did(wallet_seed) != public_did:
if context.settings.get("wallet.replace_public_did"):
replace_did_info = await wallet.create_local_did(wallet_seed)
replace_did_info = await wallet.create_local_did(
method=DIDMethod.SOV, key_type=KeyType.ED25519, seed=wallet_seed
)
public_did = replace_did_info.did
await wallet.set_public_did(public_did)
print(f"Created new public DID: {public_did}")
Expand All @@ -84,14 +89,19 @@ async def wallet_config(
metadata = {"endpoint": endpoint} if endpoint else None

local_did_info = await wallet.create_local_did(
seed=wallet_seed, metadata=metadata
method=DIDMethod.SOV,
key_type=KeyType.ED25519,
seed=wallet_seed,
metadata=metadata,
)
local_did = local_did_info.did
if provision:
print(f"Created new local DID: {local_did}")
print(f"Verkey: {local_did_info.verkey}")
else:
public_did_info = await wallet.create_public_did(seed=wallet_seed)
public_did_info = await wallet.create_public_did(
method=DIDMethod.SOV, key_type=KeyType.ED25519, seed=wallet_seed
)
public_did = public_did_info.did
if provision:
print(f"Created new public DID: {public_did}")
Expand All @@ -108,7 +118,10 @@ async def wallet_config(
test_seed = "testseed000000000000000000000001"
if test_seed:
await wallet.create_local_did(
seed=test_seed, metadata={"endpoint": "1.2.3.4:8021"}
method=DIDMethod.SOV,
key_type=KeyType.ED25519,
seed=test_seed,
metadata={"endpoint": "1.2.3.4:8021"},
)

await txn.commit()
Expand Down
6 changes: 3 additions & 3 deletions aries_cloudagent/connections/base_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@
from ..storage.error import StorageNotFoundError
from ..storage.record import StorageRecord
from ..wallet.base import BaseWallet
from ..did.did_key import DIDKey
from ..wallet.did_info import DIDInfo
from ..wallet.util import did_key_to_naked
from .models.conn_record import ConnRecord
from .models.connection_target import ConnectionTarget
from .models.diddoc import DIDDoc, PublicKey, PublicKeyType, Service
Expand Down Expand Up @@ -315,11 +315,11 @@ async def fetch_connection_targets(
else:
endpoint = invitation.service_blocks[0].service_endpoint
recipient_keys = [
did_key_to_naked(k)
DIDKey.from_did(k).public_key_b58
for k in invitation.service_blocks[0].recipient_keys
]
routing_keys = [
did_key_to_naked(k)
DIDKey.from_did(k).public_key_b58
for k in invitation.service_blocks[0].routing_keys
]

Expand Down
6 changes: 6 additions & 0 deletions aries_cloudagent/core/conductor.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
from ..protocols.connections.v1_0.messages.connection_invitation import (
ConnectionInvitation,
)
from ..vc.ld_proofs.document_loader import DocumentLoader
from ..protocols.coordinate_mediation.v1_0.manager import MediationManager
from ..protocols.out_of_band.v1_0.manager import OutOfBandManager
from ..protocols.out_of_band.v1_0.messages.invitation import HSProto, InvitationMessage
Expand Down Expand Up @@ -128,6 +129,11 @@ async def setup(self):
multitenant_mgr = MultitenantManager(self.root_profile)
context.injector.bind_instance(MultitenantManager, multitenant_mgr)

# Bind default PyLD document loader
context.injector.bind_instance(
DocumentLoader, DocumentLoader(self.root_profile)
)

self.outbound_queue = get_outbound_queue(context.settings)

# Admin API
Expand Down
29 changes: 24 additions & 5 deletions aries_cloudagent/core/tests/test_conductor.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
from ...protocols.coordinate_mediation.v1_0.models.mediation_record import (
MediationRecord,
)
from ...resolver.did_resolver import DIDResolver, DIDResolverRegistry
from ...multitenant.manager import MultitenantManager
from ...transport.inbound.message import InboundMessage
from ...transport.inbound.receipt import MessageReceipt
Expand All @@ -30,6 +31,8 @@
from ...transport.pack_format import PackWireFormat
from ...utils.stats import Collector
from ...wallet.base import BaseWallet
from ...wallet.key_type import KeyType
from ...wallet.did_method import DIDMethod

from .. import conductor as test_module

Expand Down Expand Up @@ -80,6 +83,7 @@ async def build_context(self) -> InjectionContext:
context.injector.bind_instance(ProfileManager, InMemoryProfileManager())
context.injector.bind_instance(ProtocolRegistry, ProtocolRegistry())
context.injector.bind_instance(BaseWireFormat, self.wire_format)
context.injector.bind_instance(DIDResolver, DIDResolver(DIDResolverRegistry()))
return context


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

wallet = session.inject(BaseWallet)
await wallet.create_public_did()
await wallet.create_public_did(
DIDMethod.SOV,
KeyType.ED25519,
)

mock_inbound_mgr.return_value.setup.assert_awaited_once()
mock_outbound_mgr.return_value.setup.assert_awaited_once()
Expand Down Expand Up @@ -499,7 +506,10 @@ async def test_admin(self):

session = await conductor.root_profile.session()
wallet = session.inject(BaseWallet)
await wallet.create_public_did()
await wallet.create_public_did(
DIDMethod.SOV,
KeyType.ED25519,
)

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

session = await conductor.root_profile.session()
wallet = session.inject(BaseWallet)
await wallet.create_public_did()
await wallet.create_public_did(
DIDMethod.SOV,
KeyType.ED25519,
)

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

session = await conductor.root_profile.session()
wallet = session.inject(BaseWallet)
await wallet.create_public_did()
await wallet.create_public_did(
DIDMethod.SOV,
KeyType.ED25519,
)

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

session = await conductor.root_profile.session()
wallet = session.inject(BaseWallet)
await wallet.create_public_did()
await wallet.create_public_did(
DIDMethod.SOV,
KeyType.ED25519,
)

await conductor.start()
await conductor.stop()
Expand Down
Loading