Skip to content

Commit 8ed05a9

Browse files
authored
Merge pull request hyperledger-indy#940 from Artemkaaas/feature/anoncreds-filtering
Integrate tags based search to Anoncreds workflow
2 parents 05e2313 + 125884f commit 8ed05a9

Some content is hidden

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

45 files changed

+5794
-1047
lines changed

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+
```

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)