Skip to content

Commit 3e38dce

Browse files
authored
Merge branch 'master' into master
2 parents 3388044 + 312eb82 commit 3e38dce

Some content is hidden

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

51 files changed

+5986
-1084
lines changed

doc/contributor-resources.md

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
# Contributing to Indy SDK
2+
3+
4+
Before contributing to Indy SDK, there are a couple steps that will help your process go much more smoothly.
5+
6+
First, please take a look at our contributing guidelines: [how to contribute to Hyperledger Indy](http://bit.ly/2ugd0bq).
7+
8+
If you are looking for how to sign current or previous commits, go here: [signing your commits](signing-commits.md)
9+
10+
## Connect with the Community
11+
12+
Hyperledger Indy has a vibrant and active community of developers willing to help you answer questions, learn more about self-sovereign identity, and get involved.
13+
14+
You will find the best and most update resources on chat board here: [Hyperledger Rocket Chat](https://chat.hyperledger.org/home)
15+
16+
\#indy-sdk, \#indy-node, and \#indy are the some of the best channels to get started. Please introduce yourself and let us know what you want to accomplish!
17+
18+
## How to Start Working with the Code
19+
20+
1. Fork the indy-sdk repository on Github to your personal account.
21+
22+
1. Add the hyperledger/indy-sdk as the remote upstream:
23+
`git remote add upstream https://github.com/hyperledger/indy-sdk.git`
24+
25+
1. Set up Developer Certificate of Origin and learn how to [sign your commits](signing-commits.md)
26+
27+
1. Take a look at our [release workflow](release-workflow.md)
28+
29+
## How to send a PR
30+
31+
- Do not create big PRs; send a PR for one feature or bug fix only.
32+
If a feature is too big, consider splitting a big PR to a number of small ones.
33+
- Consider sending a design doc into `design` folder (as markdown or PlantUML diagram) for a new feature before implementing it
34+
- Make sure that a new feature or fix is covered by tests (try following TDD)
35+
- Make sure that documentation is updated according to your changes
36+
- Provide a full description of changes in the PR including Jira ticket number if any
37+
- Make sure that all your commits have a DCO sign-off from the author. (add the `-s` flag to all commits)
38+
- Put the link to the PR into `#indy-pr-review` channel in Rocket.Chat
39+
- A reviewer needs to start your tests first (add `test this please` comment to the PR)
40+
- You need to make sure that all the tests pass
41+
- A reviewer needs to review the code and approve the PR. If there are review comments, they will be put into the PR itself.
42+
- You must process them (feel free to reply in the PR threads, or have a discussion in Rocket.Chat if needed)
43+
- A reviewer or maintainer will merge the PR

doc/design/002-anoncreds/README.md

Lines changed: 255 additions & 19 deletions
Large diffs are not rendered by default.
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
## Wallet Query Language
2+
3+
This language will be used to define queries in Non-secrets, Anoncreds search APIs.
4+
5+
```Rust
6+
query = {subquery}
7+
subquery = {subquery, ..., subquery} - WHERE subquery AND ... AND subquery
8+
subquery = $or: [{subquery},..., {subquery}] - WHERE subquery OR ... OR subquery
9+
subquery = $not: {subquery} - Where NOT (subquery)
10+
subquery = "tagName": tagValue - WHERE tagName == tagValue
11+
subquery = "tagName": {$neq: tagValue} - WHERE tagName != tagValue
12+
subquery = "tagName": {$gt: tagValue} - WHERE tagName > tagValue
13+
subquery = "tagName": {$gte: tagValue} - WHERE tagName >= tagValue
14+
subquery = "tagName": {$lt: tagValue} - WHERE tagName < tagValue
15+
subquery = "tagName": {$lte: tagValue} - WHERE tagName <= tagValue
16+
subquery = "tagName": {$like: tagValue} - WHERE tagName LIKE tagValue
17+
subquery = "tagName": {$in: [tagValue, ..., tagValue]} - WHERE tagName IN (tagValue, ..., tagValue)
18+
```

doc/getting-started/getting-started.dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,4 +30,4 @@ RUN apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 68DB5E88 \
3030

3131
USER indy
3232

33-
EXPOSE 8888
33+
EXPOSE 8888

doc/signing-commits.md

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
# Signing commits
2+
3+
If you are here because you forgot to sign your commits, fear not. Check out [how to sign previous commits](#how-to-sign-previous-commits)
4+
5+
We use developer certificate of origin (DCO) in all hyperledger repositories, so to get your pull requests accepted, you must certify your commits by signing off on each commit.
6+
7+
## Signing your current commit
8+
- `$ git commit -s -m "your commit message"`
9+
- To see if your commits have been signed off, run `$ git log --show-signature`
10+
- If you need to re-sign the most current commit, use `$ git commit --amend --no-edit -s`.
11+
12+
The `-s` flag signs the commit message with your name and email.
13+
14+
## How to Sign Previous Commits
15+
1. Use `git log --show-signature` to see which commits need to be signed.
16+
1. Go into interactive rebase mode using `$ git rebase -i HEAD~X` where X is the number of commits up to the most current commit you would like to see.
17+
1. You will see a list of the commits in a text file. **On the line after each commit you need to sign**, add `exec git commit --amend --no-edit -s` with the lowercase `-s` adding a text signature in the commit body. Example that signs both commits:
18+
```
19+
pick 12345 commit message
20+
exec git commit --amend --no-edit -s
21+
pick 67890 commit message
22+
exec git commit --amend --no-edit -s
23+
```
24+
1. If you need to re-sign a bunch of previous commits at once, find the earliest unsigned commit using `git log --show-signature` and use that the HASH of the commit before it in this command: `git rebase --exec 'git commit --amend --no-edit -n -s' -i HASH`. This will sign every commit from most recent to right before the HASH.
25+
1. You will probably need to do a force push `git push -f` if you had previously pushed unsigned commits to remote.

doc/windows-build.md

Lines changed: 30 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -4,21 +4,21 @@
44

55
1. Setup a windows virtual machine. Free images are available at [here](https://developer.microsoft.com/en-us/microsoft-edge/tools/vms/)
66
1. Launch the virtual machine
7-
1. Download Visual Studio Community Edition 2017
7+
1. Download Visual Studio Community Edition 2017 (these instructions also work with Visual Studio Professional 2017)
88
1. Check the boxes for the _Desktop development with C++_ and _Linux Development with C++_
99
1. In the summary portion on the right hand side also check _C++/CLI support_
1010
1. Click install
1111
1. Download git-scm for windows [here](https://git-scm.com/downloads/win)
1212
1. Install git for windows using:
13-
1. _Use Git from Git Bash Only_ so it doesn't change any path settings of the command prompt
14-
1. _Checkout as is, commit Unix-style line endings_. You shouldn't be commiting anything anyway but just in case
15-
1. _Use MinTTY_
16-
1. Check all the boxes for:
17-
1. Enable file system caching
18-
1. Enable Git Credential Manager
19-
1. Enable symbolic links
13+
1. _Use Git from Git Bash Only_ so it doesn't change any path settings of the command prompt
14+
1. _Checkout as is, commit Unix-style line endings_. You shouldn't be commiting anything anyway but just in case
15+
1. _Use MinTTY_
16+
1. Check all the boxes for:
17+
1. Enable file system caching
18+
1. Enable Git Credential Manager
19+
1. Enable symbolic links
2020
1. Download rust for windows [here](https://www.rust-lang.org/en-US/install.html)
21-
1. Choose installation option *1*
21+
1. Choose installation option *1*
2222

2323
## Get/build dependencies
2424

@@ -56,19 +56,19 @@ git clone https://github.com/hyperledger/indy-sdk.git
5656

5757
Download http://www.sqlite.org/2017/sqlite-amalgamation-3180000.zip
5858

59-
Create empty static library project and add sqlite.c file and 2 headers from extracted
59+
Create an empty static library project in Visual Studio and add `sqlite.c` file and 2 headers from extracted
6060
archive. Then just build it.
6161

6262
### Build libzmq
6363

64-
Follow to https://http://zeromq.org/intro.
64+
Follow to http://zeromq.org/intro.
6565
- Download sources from last stable release for Windows.
66-
- launch zeromq-x.x.x/builds/msvc/vs2015/libzmq.sln.
67-
- if necessary change solution platforms on x64(if you are working on x64 arch).
68-
- on main menu bar choose build->build libzmq.
69-
- if build project was succeed, in path zeromq-x.x.x/bin/x64/Debug/vXXX/dynamic has appeared
70-
two files libzmq.dll and libzmq.lib.
71-
- rename libzmq.lib to zmq.lib.
66+
- Open `zeromq-x.x.x/builds/msvc/vs2015/libzmq.sln` with Visual Studio
67+
- If necessary change solution platforms on x64(if you are working on x64 arch).
68+
- On main menu bar choose build->build libzmq.
69+
- If build project was successful, two files `libzmq.dll` and `libzmq.lib` should appear
70+
in path `zeromq-x.x.x/bin/x64/Debug/vXXX/dynamic`.
71+
- rename `libzmq.lib` to `zmq.lib`.
7272

7373
## Build
7474

@@ -82,18 +82,19 @@ Follow to https://http://zeromq.org/intro.
8282
```
8383

8484
Note that depending on the version of Visual Studio placement of vcvars64.bat can be different. For example, it can be
85-
`C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\bin\amd64\vcvars64.bat`
86-
- execute "C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Auxiliary\Build\vcvars64.bat"
85+
`"C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\bin\amd64\vcvars64.bat"`
86+
- Execute `"C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Auxiliary\Build\vcvars64.bat"`
8787
- Point path to this directory using environment variables:
88-
- set INDY_PREBUILT_DEPS_DIR=C:\BIN\x64
89-
- set INDY_CRYPTO_PREBUILT_DEPS_DIR=C:\BIN\x64
90-
- set MILAGRO_DIR=C:\BIN\x64
91-
- set LIBZMQ_PREFIX=C:\BIN\x64
92-
- set SODIUM_LIB_DIR=C:\BIN\x64
93-
- set OPENSSL_DIR=C:\BIN\x64
94-
- set PATH to find .dlls:
95-
- set PATH=C:\BIN\x64\lib;%PATH%
96-
- change dir to indy-sdk/libindy and run cargo (you may want to add --release --target x86_64-pc-windows-msvc keys to cargo)
88+
- `set INDY_PREBUILT_DEPS_DIR=C:\BIN\x64`
89+
- `set INDY_CRYPTO_PREBUILT_DEPS_DIR=C:\BIN\x64`
90+
- `set MILAGRO_DIR=C:\BIN\x64`
91+
- `set LIBZMQ_PREFIX=C:\BIN\x64`
92+
- `set SODIUM_LIB_DIR=C:\BIN\x64`
93+
- `set OPENSSL_DIR=C:\BIN\x64`
94+
- Set PATH to find .dlls:
95+
- `set PATH=C:\BIN\x64\lib;%PATH%`
96+
- change dir to `indy-sdk/libindy` and run `cargo build` (you may want to add `--release --target x86_64-pc-windows-msvc`
97+
keys to cargo)
9798

9899
## openssl-sys workaround
99100

@@ -109,7 +110,7 @@ and add
109110
println!("cargo:rustc-link-lib=dylib=gdi32");
110111
```
111112

112-
to the end of main() function.
113+
to the end of `main()` function.
113114

114115
Then try to rebuild whole project.
115116

libindy/include/indy_anoncreds.h

Lines changed: 64 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -147,8 +147,42 @@ extern "C" {
147147
indy_error_t err,
148148
const char* credentials_json)
149149
);
150-
151-
150+
151+
extern indy_error_t indy_prover_get_credential(indy_handle_t command_handle,
152+
indy_handle_t wallet_handle,
153+
const char * cred_id,
154+
155+
void (*cb)(indy_handle_t xcommand_handle,
156+
indy_error_t err,
157+
const char* credential_json)
158+
);
159+
160+
extern indy_error_t indy_prover_search_credentials(indy_handle_t command_handle,
161+
indy_handle_t wallet_handle,
162+
const char * query_json,
163+
164+
void (*cb)(indy_handle_t xcommand_handle,
165+
indy_error_t err,
166+
indy_handle_t search_handle,
167+
indy_u32_t total_count)
168+
);
169+
170+
extern indy_error_t indy_prover_fetch_credentials(indy_handle_t command_handle,
171+
indy_handle_t search_handle,
172+
indy_u32_t count,
173+
174+
void (*cb)(indy_handle_t xcommand_handle,
175+
indy_error_t err,
176+
const char* credentials_json)
177+
);
178+
179+
extern indy_error_t indy_prover_close_credentials_search(indy_handle_t command_handle,
180+
indy_handle_t search_handle,
181+
182+
void (*cb)(indy_handle_t xcommand_handle,
183+
indy_error_t err)
184+
);
185+
152186
extern indy_error_t indy_prover_get_credentials_for_proof_req(indy_handle_t command_handle,
153187
indy_handle_t wallet_handle,
154188
const char * proof_request_json,
@@ -158,7 +192,34 @@ extern "C" {
158192
const char* credentials_json)
159193
);
160194

161-
195+
196+
extern indy_error_t indy_prover_search_credentials_for_proof_req(indy_handle_t command_handle,
197+
indy_handle_t wallet_handle,
198+
const char * proof_request_json,
199+
const char * extra_query_json,
200+
201+
void (*cb)(indy_handle_t xcommand_handle,
202+
indy_error_t err,
203+
indy_handle_t search_handle)
204+
);
205+
206+
extern indy_error_t indy_prover_fetch_credentials_for_proof_req(indy_handle_t command_handle,
207+
indy_handle_t search_handle,
208+
const char* item_referent,
209+
indy_u32_t count,
210+
211+
void (*cb)(indy_handle_t xcommand_handle,
212+
indy_error_t err,
213+
const char* credentials_json)
214+
);
215+
216+
extern indy_error_t indy_prover_close_credentials_search_for_proof_req(indy_handle_t command_handle,
217+
indy_handle_t search_handle,
218+
219+
void (*cb)(indy_handle_t xcommand_handle,
220+
indy_error_t err)
221+
);
222+
162223
extern indy_error_t indy_prover_create_proof(indy_handle_t command_handle,
163224
indy_handle_t wallet_handle,
164225
const char * proof_req_json,

0 commit comments

Comments
 (0)