Skip to content

Commit 0de396c

Browse files
authored
Merge branch 'master' into feature/add_get_total_count_for_search
2 parents bdf6d3b + 24a8b49 commit 0de396c

File tree

17 files changed

+176
-130
lines changed

17 files changed

+176
-130
lines changed

doc/getting-started/getting-started.dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ RUN pip3 install -U \
2020
pip \
2121
setuptools \
2222
jupyter \
23-
python3-indy==1.3.1-dev-476
23+
python3-indy==1.4.0-dev-540
2424

2525
RUN apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 68DB5E88 \
2626
&& add-apt-repository "deb https://repo.sovrin.org/sdk/deb xenial master" \

doc/getting-started/getting-started.ipynb

Lines changed: 45 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -29,14 +29,14 @@
2929
"\n",
3030
" print(\"\\\"Sovrin Steward\\\" -> Create wallet\")\n",
3131
" steward_wallet_name = 'sovrin_steward_wallet'\n",
32+
" steward_wallet_credentials = json.dumps({\"key\": \"steward_wallet_key\"})\n",
3233
" try:\n",
33-
" await wallet.create_wallet(pool_name, steward_wallet_name, None, None,\n",
34-
" None)\n",
34+
" await wallet.create_wallet(pool_name, steward_wallet_name, None, None, steward_wallet_credentials)\n",
3535
" except IndyError as ex:\n",
3636
" if ex.error_code == ErrorCode.WalletAlreadyExistsError:\n",
3737
" pass\n",
3838
"\n",
39-
" steward_wallet = await wallet.open_wallet(steward_wallet_name, None, None)\n",
39+
" steward_wallet = await wallet.open_wallet(steward_wallet_name, None, steward_wallet_credentials)\n",
4040
"\n",
4141
" print(\"\\\"Sovrin Steward\\\" -> Create and store in Wallet DID from seed\")\n",
4242
" steward_did_info = {'seed': '000000000000000000000000Steward1'}\n",
@@ -46,9 +46,11 @@
4646
" print(\"== Getting Trust Anchor credentials - Government Onboarding ==\")\n",
4747
" print(\"------------------------------\")\n",
4848
"\n",
49-
" government_wallet, government_wallet_name, steward_government_key, government_steward_did, government_steward_key, _ \\\n",
49+
" government_wallet_name = 'government_wallet'\n",
50+
" government_wallet_credentials = json.dumps({\"key\": \"government_wallet_key\"})\n",
51+
" government_wallet, steward_government_key, government_steward_did, government_steward_key, _ \\\n",
5052
" = await onboarding(pool_handle, pool_name, \"Sovrin Steward\", steward_wallet,\n",
51-
" steward_did, \"Government\", None, 'government_wallet')\n",
53+
" steward_did, \"Government\", None, government_wallet_name, government_wallet_credentials)\n",
5254
"\n",
5355
" print(\"==============================\")\n",
5456
" print(\"== Getting Trust Anchor credentials - Government getting Verinym ==\")\n",
@@ -61,9 +63,12 @@
6163
" print(\"==============================\")\n",
6264
" print(\"== Getting Trust Anchor credentials - Faber Onboarding ==\")\n",
6365
" print(\"------------------------------\")\n",
64-
" faber_wallet, faber_wallet_name, steward_faber_key, faber_steward_did, faber_steward_key, _ = \\\n",
66+
"\n",
67+
" faber_wallet_name = 'faber_wallet'\n",
68+
" faber_wallet_credentials = json.dumps({\"key\": \"faber_wallet_key\"})\n",
69+
" faber_wallet, steward_faber_key, faber_steward_did, faber_steward_key, _ = \\\n",
6570
" await onboarding(pool_handle, pool_name, \"Sovrin Steward\", steward_wallet, steward_did,\n",
66-
" \"Faber\", None, 'faber_wallet')\n",
71+
" \"Faber\", None, faber_wallet_name, faber_wallet_credentials)\n",
6772
"\n",
6873
" print(\"==============================\")\n",
6974
" print(\"== Getting Trust Anchor credentials - Faber getting Verinym ==\")\n",
@@ -76,9 +81,11 @@
7681
" print(\"== Getting Trust Anchor credentials - Acme Onboarding ==\")\n",
7782
" print(\"------------------------------\")\n",
7883
"\n",
79-
" acme_wallet, acme_wallet_name, steward_acme_key, acme_steward_did, acme_steward_key, _ = \\\n",
84+
" acme_wallet_name = 'acme_wallet'\n",
85+
" acme_wallet_credentials = json.dumps({\"key\": \"acme_wallet_key\"})\n",
86+
" acme_wallet, steward_acme_key, acme_steward_did, acme_steward_key, _ = \\\n",
8087
" await onboarding(pool_handle, pool_name, \"Sovrin Steward\", steward_wallet, steward_did,\n",
81-
" \"Acme\", None, 'acme_wallet')\n",
88+
" \"Acme\", None, acme_wallet_name, acme_wallet_credentials)\n",
8289
"\n",
8390
" print(\"==============================\")\n",
8491
" print(\"== Getting Trust Anchor credentials - Acme getting Verinym ==\")\n",
@@ -91,9 +98,11 @@
9198
" print(\"== Getting Trust Anchor credentials - Thrift Onboarding ==\")\n",
9299
" print(\"------------------------------\")\n",
93100
"\n",
94-
" thrift_wallet, thrift_wallet_name, steward_thrift_key, thrift_steward_did, thrift_steward_key, _ = \\\n",
101+
" thrift_wallet_name = 'thrift_wallet'\n",
102+
" thrift_wallet_credentials = json.dumps({\"key\": \"thrift_wallet_key\"})\n",
103+
" thrift_wallet, steward_thrift_key, thrift_steward_did, thrift_steward_key, _ = \\\n",
95104
" await onboarding(pool_handle, pool_name, \"Sovrin Steward\", steward_wallet, steward_did,\n",
96-
" \"Thrift\", None, ' thrift_wallet')\n",
105+
" \"Thrift\", None, thrift_wallet_name, thrift_wallet_credentials)\n",
97106
"\n",
98107
" print(\"==============================\")\n",
99108
" print(\"== Getting Trust Anchor credentials - Thrift getting Verinym ==\")\n",
@@ -159,8 +168,11 @@
159168
" print(\"== Getting Transcript with Faber - Onboarding ==\")\n",
160169
" print(\"------------------------------\")\n",
161170
"\n",
162-
" alice_wallet, alice_wallet_name, faber_alice_key, alice_faber_did, alice_faber_key, faber_alice_connection_response \\\n",
163-
" = await onboarding(pool_handle, pool_name, \"Faber\", faber_wallet, faber_did, \"Alice\", None, ' alice_wallet')\n",
171+
" alice_wallet_name = 'alice_wallet'\n",
172+
" alice_wallet_credentials = json.dumps({\"key\": \"alice_wallet_key\"})\n",
173+
" alice_wallet, faber_alice_key, alice_faber_did, alice_faber_key, faber_alice_connection_response \\\n",
174+
" = await onboarding(pool_handle, pool_name, \"Faber\", faber_wallet, faber_did, \"Alice\", None,\n",
175+
" alice_wallet_name, alice_wallet_credentials)\n",
164176
"\n",
165177
" print(\"==============================\")\n",
166178
" print(\"== Getting Transcript with Faber - Getting Transcript Credential ==\")\n",
@@ -233,18 +245,18 @@
233245
" await auth_decrypt(alice_wallet, alice_faber_key, authcrypted_transcript_cred_json)\n",
234246
"\n",
235247
" print(\"\\\"Alice\\\" -> Store \\\"Transcript\\\" Credential from Faber\")\n",
236-
" await anoncreds.prover_store_credential(alice_wallet, None,\n",
237-
" transcript_cred_request_metadata_json, authdecrypted_transcript_cred_json,\n",
238-
" faber_transcript_cred_def, None)\n",
248+
" await anoncreds.prover_store_credential(alice_wallet, None, transcript_cred_request_metadata_json,\n",
249+
" authdecrypted_transcript_cred_json, faber_transcript_cred_def, None)\n",
239250
"\n",
240251
" print(\"==============================\")\n",
241252
" print(\"=== Apply for the job with Acme ==\")\n",
242253
" print(\"==============================\")\n",
243254
" print(\"== Apply for the job with Acme - Onboarding ==\")\n",
244255
" print(\"------------------------------\")\n",
245256
"\n",
246-
" alice_wallet, alice_wallet_name, acme_alice_key, alice_acme_did, alice_acme_key, acme_alice_connection_response = \\\n",
247-
" await onboarding(pool_handle, pool_name, \"Acme\", acme_wallet, acme_did, \"Alice\", alice_wallet, ' alice_wallet')\n",
257+
" alice_wallet, acme_alice_key, alice_acme_did, alice_acme_key, acme_alice_connection_response = \\\n",
258+
" await onboarding(pool_handle, pool_name, \"Acme\", acme_wallet, acme_did, \"Alice\", alice_wallet,\n",
259+
" alice_wallet_name, alice_wallet_credentials)\n",
248260
"\n",
249261
" print(\"==============================\")\n",
250262
" print(\"== Apply for the job with Acme - Transcript proving ==\")\n",
@@ -400,7 +412,7 @@
400412
" (_, acme_job_certificate_cred_def) = \\\n",
401413
" await get_cred_def(pool_handle, alice_acme_did, authdecrypted_job_certificate_cred_offer['cred_def_id'])\n",
402414
"\n",
403-
" print(\"\\\"Alice\\\" -> Create \\\"Job-Certificate\\\" Credential Request for Acme\")\n",
415+
" print(\"\\\"Alice\\\" -> Create and store in Wallet \\\"Job-Certificate\\\" Credential Request for Acme\")\n",
404416
" (job_certificate_cred_request_json, job_certificate_cred_request_metadata_json) = \\\n",
405417
" await anoncreds.prover_create_credential_req(alice_wallet, alice_acme_did,\n",
406418
" authdecrypted_job_certificate_cred_offer_json,\n",
@@ -443,8 +455,7 @@
443455
" await auth_decrypt(alice_wallet, alice_acme_key, authcrypted_job_certificate_cred_json)\n",
444456
"\n",
445457
" print(\"\\\"Alice\\\" -> Store \\\"Job-Certificate\\\" Credential\")\n",
446-
" await anoncreds.prover_store_credential(alice_wallet, None,\n",
447-
" job_certificate_cred_request_metadata_json,\n",
458+
" await anoncreds.prover_store_credential(alice_wallet, None, job_certificate_cred_request_metadata_json,\n",
448459
" authdecrypted_job_certificate_cred_json,\n",
449460
" acme_job_certificate_cred_def_json, None)\n",
450461
"\n",
@@ -454,9 +465,10 @@
454465
" print(\"== Apply for the loan with Thrift - Onboarding ==\")\n",
455466
" print(\"------------------------------\")\n",
456467
"\n",
457-
" alice_wallet, alice_wallet_name, thrift_alice_key, alice_thrift_did, alice_thrift_key, \\\n",
468+
" _, thrift_alice_key, alice_thrift_did, alice_thrift_key, \\\n",
458469
" thrift_alice_connection_response = await onboarding(pool_handle, pool_name, \"Thrift\", thrift_wallet, thrift_did,\n",
459-
" \"Alice\", alice_wallet, ' alice_wallet')\n",
470+
" \"Alice\", alice_wallet, alice_wallet_name,\n",
471+
" alice_wallet_credentials)\n",
460472
"\n",
461473
" print(\"==============================\")\n",
462474
" print(\"== Apply for the loan with Thrift - Job-Certificate proving ==\")\n",
@@ -662,27 +674,27 @@
662674
"\n",
663675
" print(\" \\\"Sovrin Steward\\\" -> Close and Delete wallet\")\n",
664676
" await wallet.close_wallet(steward_wallet)\n",
665-
" await wallet.delete_wallet(steward_wallet_name, None)\n",
677+
" await wallet.delete_wallet(steward_wallet_name, steward_wallet_credentials)\n",
666678
"\n",
667679
" print(\"\\\"Government\\\" -> Close and Delete wallet\")\n",
668680
" await wallet.close_wallet(government_wallet)\n",
669-
" await wallet.delete_wallet(government_wallet_name, None)\n",
681+
" await wallet.delete_wallet(government_wallet_name, government_wallet_credentials)\n",
670682
"\n",
671683
" print(\"\\\"Faber\\\" -> Close and Delete wallet\")\n",
672684
" await wallet.close_wallet(faber_wallet)\n",
673-
" await wallet.delete_wallet(faber_wallet_name, None)\n",
685+
" await wallet.delete_wallet(faber_wallet_name, faber_wallet_credentials)\n",
674686
"\n",
675687
" print(\"\\\"Acme\\\" -> Close and Delete wallet\")\n",
676688
" await wallet.close_wallet(acme_wallet)\n",
677-
" await wallet.delete_wallet(acme_wallet_name, None)\n",
689+
" await wallet.delete_wallet(acme_wallet_name, acme_wallet_credentials)\n",
678690
"\n",
679691
" print(\"\\\"Thrift\\\" -> Close and Delete wallet\")\n",
680692
" await wallet.close_wallet(thrift_wallet)\n",
681-
" await wallet.delete_wallet(thrift_wallet_name, None)\n",
693+
" await wallet.delete_wallet(thrift_wallet_name, thrift_wallet_credentials)\n",
682694
"\n",
683695
" print(\"\\\"Alice\\\" -> Close and Delete wallet\")\n",
684696
" await wallet.close_wallet(alice_wallet)\n",
685-
" await wallet.delete_wallet(alice_wallet_name, None)\n",
697+
" await wallet.delete_wallet(alice_wallet_name, alice_wallet_credentials)\n",
686698
"\n",
687699
" print(\"Close and Delete pool\")\n",
688700
" await pool.close_pool_ledger(pool_handle)\n",
@@ -692,8 +704,7 @@
692704
"\n",
693705
"\n",
694706
"async def onboarding(pool_handle, pool_name, _from, from_wallet, from_did, to,\n",
695-
" to_wallet: Optional[str],\n",
696-
" to_wallet_name: Optional[str]):\n",
707+
" to_wallet: Optional[str], to_wallet_name: str, to_wallet_credentials: str):\n",
697708
" print(\"\\\"{}\\\" -> Create and store in Wallet \\\"{} {}\\\" DID\".format(_from, _from, to))\n",
698709
" (from_to_did, from_to_key) = await did.create_and_store_my_did(from_wallet, \"{}\")\n",
699710
"\n",
@@ -709,12 +720,11 @@
709720
" if not to_wallet:\n",
710721
" print(\"\\\"{}\\\" -> Create wallet\".format(to))\n",
711722
" try:\n",
712-
" await wallet.create_wallet(pool_name, to_wallet_name, None, None,\n",
713-
" None)\n",
723+
" await wallet.create_wallet(pool_name, to_wallet_name, None, None, to_wallet_credentials)\n",
714724
" except IndyError as ex:\n",
715725
" if ex.error_code == ErrorCode.PoolLedgerConfigAlreadyExistsError:\n",
716726
" pass\n",
717-
" to_wallet = await wallet.open_wallet(to_wallet_name, None, None)\n",
727+
" to_wallet = await wallet.open_wallet(to_wallet_name, None, to_wallet_credentials)\n",
718728
"\n",
719729
" print(\"\\\"{}\\\" -> Create and store in Wallet \\\"{} {}\\\" DID\".format(to, to, _from))\n",
720730
" (to_from_did, to_from_key) = await did.create_and_store_my_did(to_wallet, \"{}\")\n",
@@ -744,7 +754,7 @@
744754
" print(\"\\\"{}\\\" -> Send Nym to Ledger for \\\"{} {}\\\" DID\".format(_from, to, _from))\n",
745755
" await send_nym(pool_handle, from_wallet, from_did, to_from_did, to_from_key, None)\n",
746756
"\n",
747-
" return to_wallet, to_wallet_name, from_to_key, to_from_did, to_from_key, decrypted_connection_response\n",
757+
" return to_wallet, from_to_key, to_from_did, to_from_key, decrypted_connection_response\n",
748758
"\n",
749759
"\n",
750760
"async def get_verinym(pool_handle, _from, from_wallet, from_did, from_to_key,\n",

doc/how-tos/write-did-and-query-verkey/python/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ Indy-SDK Developer Walkthrough #1, Python Edition
99

1010
Setup your workstation with an indy development virtual machine (VM). See [prerequisites](../../prerequisites.md).
1111

12+
Ensure you have the 64-bit version of Python installed, as the 32-bit version may have problems loading the Indy .dll files.
1213

1314
## Steps
1415

libindy/tests/wallet.rs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -356,6 +356,16 @@ mod medium_cases {
356356
TestUtils::cleanup_storage();
357357
}
358358

359+
#[test]
360+
fn indy_create_wallet_works_for_missed_key() {
361+
TestUtils::cleanup_storage();
362+
363+
let res = WalletUtils::create_wallet(POOL, WALLET, None, None, Some(r#"{}"#));
364+
assert_eq!(res.unwrap_err(), ErrorCode::WalletInputError);
365+
366+
TestUtils::cleanup_storage();
367+
}
368+
359369
#[test]
360370
fn indy_create_wallet_works_for_empty_name() {
361371
TestUtils::cleanup_storage();

samples/java/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@
109109
<dependency>
110110
<groupId>org.hyperledger</groupId>
111111
<artifactId>indy</artifactId>
112-
<version>1.4.0-rc-20</version>
112+
<version>1.4.0-dev-540</version>
113113
</dependency>
114114
</dependencies>
115115
</project>

samples/java/src/main/java/Anoncreds.java

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -24,12 +24,14 @@ static void demo() throws Exception {
2424
Pool pool = Pool.openPoolLedger(poolName, "{}").get();
2525

2626
//2. Issuer Create and Open Wallet
27-
Wallet.createWallet(poolName, issuerWalletName, "default", null, null).get();
28-
Wallet issuerWallet = Wallet.openWallet(issuerWalletName, null, null).get();
27+
String issuerWalletCredentials = "{\"key\":\"issuer_wallet_key\"}";
28+
Wallet.createWallet(poolName, issuerWalletName, "default", null, issuerWalletCredentials).get();
29+
Wallet issuerWallet = Wallet.openWallet(issuerWalletName, null, issuerWalletCredentials).get();
2930

3031
//3. Prover Create and Open Wallet
31-
Wallet.createWallet(poolName, proverWalletName, "default", null, null).get();
32-
Wallet proverWallet = Wallet.openWallet(proverWalletName, null, null).get();
32+
String proverWalletCredentials = "{\"key\":\"prover_wallet_key\"}";
33+
Wallet.createWallet(poolName, proverWalletName, "default", null, proverWalletCredentials).get();
34+
Wallet proverWallet = Wallet.openWallet(proverWalletName, null, proverWalletCredentials).get();
3335

3436
//4. Issuer Creates Credential Schema
3537
String schemaName = "gvt";
@@ -138,11 +140,11 @@ static void demo() throws Exception {
138140

139141
//14. Close and Delete issuer wallet
140142
issuerWallet.closeWallet().get();
141-
Wallet.deleteWallet(issuerWalletName, null).get();
143+
Wallet.deleteWallet(issuerWalletName, issuerWalletCredentials).get();
142144

143145
//15. Close and Delete prover wallet
144146
proverWallet.closeWallet().get();
145-
Wallet.deleteWallet(proverWalletName, null).get();
147+
Wallet.deleteWallet(proverWalletName, proverWalletCredentials).get();
146148

147149
//16. Close pool
148150
pool.closePoolLedger().get();

samples/java/src/main/java/AnoncredsRevocation.java

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -28,12 +28,14 @@ static void demo() throws Exception {
2828
Pool pool = Pool.openPoolLedger(poolName, "{}").get();
2929

3030
//2. Issuer Create and Open Wallet
31-
Wallet.createWallet(poolName, issuerWalletName, "default", null, null).get();
32-
Wallet issuerWallet = Wallet.openWallet(issuerWalletName, null, null).get();
31+
String issuerWalletCredentials = "{\"key\":\"issuer_wallet_key\"}";
32+
Wallet.createWallet(poolName, issuerWalletName, "default", null, issuerWalletCredentials).get();
33+
Wallet issuerWallet = Wallet.openWallet(issuerWalletName, null, issuerWalletCredentials).get();
3334

3435
//3. Prover Create and Open Wallet
35-
Wallet.createWallet(poolName, proverWalletName, "default", null, null).get();
36-
Wallet proverWallet = Wallet.openWallet(proverWalletName, null, null).get();
36+
String proverWalletCredentials = "{\"key\":\"prover_wallet_key\"}";
37+
Wallet.createWallet(poolName, proverWalletName, "default", null, proverWalletCredentials).get();
38+
Wallet proverWallet = Wallet.openWallet(proverWalletName, null, proverWalletCredentials).get();
3739

3840
//4. Issuer Creates Credential Schema
3941
String schemaName = "gvt";
@@ -149,11 +151,11 @@ static void demo() throws Exception {
149151

150152
//17. Close and Delete issuer wallet
151153
issuerWallet.closeWallet().get();
152-
Wallet.deleteWallet(issuerWalletName, null).get();
154+
Wallet.deleteWallet(issuerWalletName, issuerWalletCredentials).get();
153155

154156
//18. Close and Delete prover wallet
155157
proverWallet.closeWallet().get();
156-
Wallet.deleteWallet(proverWalletName, null).get();
158+
Wallet.deleteWallet(proverWalletName, proverWalletCredentials).get();
157159

158160
//19. Close pool
159161
pool.closePoolLedger().get();

samples/java/src/main/java/Crypto.java

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -24,12 +24,14 @@ static void demo() throws Exception {
2424
Pool pool = Pool.openPoolLedger(poolName, "{}").get();
2525

2626
// 2. Create and Open My Wallet
27-
Wallet.createWallet(poolName, myWalletName, "default", null, null).get();
28-
Wallet myWallet = Wallet.openWallet(myWalletName, null, null).get();
27+
String myWalletCredentials = "{\"key\":\"my_wallet_key\"}";
28+
Wallet.createWallet(poolName, myWalletName, "default", null, myWalletCredentials).get();
29+
Wallet myWallet = Wallet.openWallet(myWalletName, null, myWalletCredentials).get();
2930

3031
// 3. Create and Open Their Wallet
31-
Wallet.createWallet(poolName, theirWalletName, "default", null, null).get();
32-
Wallet theirWallet = Wallet.openWallet(theirWalletName, null, null).get();
32+
String theirWalletCredentials = "{\"key\":\"their_wallet_key\"}";
33+
Wallet.createWallet(poolName, theirWalletName, "default", null, theirWalletCredentials).get();
34+
Wallet theirWallet = Wallet.openWallet(theirWalletName, null, theirWalletCredentials).get();
3335

3436
// 4. Create My Did
3537
CreateAndStoreMyDidResult myDid = createAndStoreMyDid(myWallet, "{}").get();
@@ -59,11 +61,11 @@ static void demo() throws Exception {
5961

6062
// 8. Close and delete My Wallet
6163
myWallet.closeWallet().get();
62-
Wallet.deleteWallet(myWalletName, null).get();
64+
Wallet.deleteWallet(myWalletName, myWalletCredentials).get();
6365

6466
// 9. Close and delete Their Wallet
6567
theirWallet.closeWallet().get();
66-
Wallet.deleteWallet(theirWalletName, null).get();
68+
Wallet.deleteWallet(theirWalletName, theirWalletCredentials).get();
6769

6870
// 10. Close Pool
6971
pool.closePoolLedger().get();

0 commit comments

Comments
 (0)