diff --git a/Jenkinsfile.cd b/Jenkinsfile.cd index 066770b865..d3575fdb13 100644 --- a/Jenkinsfile.cd +++ b/Jenkinsfile.cd @@ -1766,7 +1766,7 @@ def shell(command) { } def setupRust() { - shell("rustup default 1.40.0") + shell("rustup default 1.46.0") } def androidPublishing() { diff --git a/Jenkinsfile.ci b/Jenkinsfile.ci index 41fa5a5a94..f0584a899e 100644 --- a/Jenkinsfile.ci +++ b/Jenkinsfile.ci @@ -866,7 +866,7 @@ def shell(command) { } def setupRust() { - shell("rustup default 1.40.0") + shell("rustup default 1.46.0") } def setupBrewPackages() { diff --git a/libindy/ci/centos.dockerfile b/libindy/ci/centos.dockerfile index cab3bbd160..5abfaf930b 100755 --- a/libindy/ci/centos.dockerfile +++ b/libindy/ci/centos.dockerfile @@ -39,7 +39,7 @@ RUN wget https://repos.fedorapeople.org/repos/dchen/apache-maven/epel-apache-mav RUN sed -i s/\$releasever/6/g /etc/yum.repos.d/epel-apache-maven.repo RUN yum install -y apache-maven -ENV RUST_ARCHIVE=rust-1.40.0-x86_64-unknown-linux-gnu.tar.gz +ENV RUST_ARCHIVE=rust-1.46.0-x86_64-unknown-linux-gnu.tar.gz ENV RUST_DOWNLOAD_URL=https://static.rust-lang.org/dist/$RUST_ARCHIVE RUN mkdir -p /rust diff --git a/libindy/ci/ubuntu.dockerfile b/libindy/ci/ubuntu.dockerfile index e3c9663409..33a7394e11 100755 --- a/libindy/ci/ubuntu.dockerfile +++ b/libindy/ci/ubuntu.dockerfile @@ -62,7 +62,7 @@ RUN apt-get update && apt-get install -y --no-install-recommends \ RUN useradd -ms /bin/bash -u $uid indy USER indy -RUN curl https://sh.rustup.rs -sSf | sh -s -- -y --default-toolchain 1.40.0 +RUN curl https://sh.rustup.rs -sSf | sh -s -- -y --default-toolchain 1.46.0 ENV PATH /home/indy/.cargo/bin:$PATH RUN cargo install cargo-deb diff --git a/libindy/ci/ubuntu18.dockerfile b/libindy/ci/ubuntu18.dockerfile index 2a45416f28..14c384dbfa 100644 --- a/libindy/ci/ubuntu18.dockerfile +++ b/libindy/ci/ubuntu18.dockerfile @@ -43,7 +43,7 @@ RUN apt-get install -y wget RUN useradd -ms /bin/bash -u $uid indy USER indy -RUN curl https://sh.rustup.rs -sSf | sh -s -- -y --default-toolchain 1.40.0 +RUN curl https://sh.rustup.rs -sSf | sh -s -- -y --default-toolchain 1.46.0 ENV PATH /home/indy/.cargo/bin:$PATH RUN cargo install cargo-deb diff --git a/libindy/include/indy_non_secrets.h b/libindy/include/indy_non_secrets.h index 30ad74ef85..f82a3a6f44 100644 --- a/libindy/include/indy_non_secrets.h +++ b/libindy/include/indy_non_secrets.h @@ -155,7 +155,7 @@ extern "C" { /// { /// retrieveType: (optional, false by default) Retrieve record type, /// retrieveValue: (optional, true by default) Retrieve record value, - /// retrieveTags: (optional, true by default) Retrieve record tags + /// retrieveTags: (optional, false by default) Retrieve record tags /// } /// #Returns /// wallet record json: @@ -199,7 +199,7 @@ extern "C" { /// retrieveTotalCount: (optional, false by default) Calculate total count, /// retrieveType: (optional, false by default) Retrieve record type, /// retrieveValue: (optional, true by default) Retrieve record value, - /// retrieveTags: (optional, true by default) Retrieve record tags, + /// retrieveTags: (optional, false by default) Retrieve record tags, /// } /// #Returns /// search_handle: Wallet search handle that can be used later @@ -226,7 +226,7 @@ extern "C" { /// { /// retrieveType: (optional, false by default) Retrieve record type, /// retrieveValue: (optional, true by default) Retrieve record value, - /// retrieveTags: (optional, true by default) Retrieve record tags + /// retrieveTags: (optional, false by default) Retrieve record tags /// } /// #Returns /// wallet record json: diff --git a/libindy/indy-api-types/src/lib.rs b/libindy/indy-api-types/src/lib.rs index 6e91e91d20..5c1f63901c 100644 --- a/libindy/indy-api-types/src/lib.rs +++ b/libindy/indy-api-types/src/lib.rs @@ -417,7 +417,7 @@ pub mod wallet { /// { /// retrieveType: (optional, false by default) Retrieve record type, /// retrieveValue: (optional, true by default) Retrieve record value, - /// retrieveTags: (optional, true by default) Retrieve record tags + /// retrieveTags: (optional, false by default) Retrieve record tags /// } /// record_handle_p: pointer to store retrieved record handle pub type WalletGetRecord = extern fn(storage_handle: StorageHandle, @@ -537,7 +537,7 @@ pub mod wallet { /// retrieveTotalCount: (optional, false by default) Calculate total count, /// retrieveType: (optional, false by default) Retrieve record type, /// retrieveValue: (optional, true by default) Retrieve record value, - /// retrieveTags: (optional, true by default) Retrieve record tags, + /// retrieveTags: (optional, false by default) Retrieve record tags, /// } /// search_handle_p: pointer to store wallet search handle pub type WalletSearchRecords = extern fn(storage_handle: StorageHandle, diff --git a/vcx/ci/ubuntu.dockerfile b/vcx/ci/ubuntu.dockerfile index c93dba410b..f222e8d036 100644 --- a/vcx/ci/ubuntu.dockerfile +++ b/vcx/ci/ubuntu.dockerfile @@ -60,7 +60,7 @@ ARG uid=1000 RUN useradd -ms /bin/bash -u $uid vcx USER vcx -ARG RUST_VER="1.40.0" +ARG RUST_VER="1.46.0" RUN curl https://sh.rustup.rs -sSf | sh -s -- -y --default-toolchain $RUST_VER ENV PATH /home/vcx/.cargo/bin:$PATH diff --git a/vcx/libvcx/build_scripts/ios/mac/mac.01.libindy.setup.sh b/vcx/libvcx/build_scripts/ios/mac/mac.01.libindy.setup.sh index a5ec16022f..fa519e144a 100755 --- a/vcx/libvcx/build_scripts/ios/mac/mac.01.libindy.setup.sh +++ b/vcx/libvcx/build_scripts/ios/mac/mac.01.libindy.setup.sh @@ -44,7 +44,7 @@ fi if [[ $RUSTUP_VERSION =~ ^'rustup ' ]]; then rustup update - rustup default 1.40.0 + rustup default 1.46.0 rustup component add rls-preview rust-analysis rust-src echo "Using rustc version $(rustc --version)" rustup target add aarch64-apple-ios armv7-apple-ios armv7s-apple-ios x86_64-apple-ios i386-apple-ios diff --git a/vcx/libvcx/src/utils/libindy/payments.rs b/vcx/libvcx/src/utils/libindy/payments.rs index 8b122b02ed..1b07992bc6 100644 --- a/vcx/libvcx/src/utils/libindy/payments.rs +++ b/vcx/libvcx/src/utils/libindy/payments.rs @@ -428,7 +428,7 @@ pub fn inputs(cost: u64) -> VcxResult<(u64, Vec, String)> { // Todo: explore 'smarter' ways of selecting utxos ie bitcoin algorithms etc 'outer: for address in wallet_info.addresses.iter() { refund_address = address.address.clone(); - 'inner: for utxo in address.utxo.iter() { + '_inner: for utxo in address.utxo.iter() { if balance < cost { inputs.push(utxo.source.clone().ok_or(VcxErrorKind::InsufficientTokenAmount)?.to_string()); balance += utxo.amount; diff --git a/vcx/libvcx/src/v3/messages/a2a/protocol_registry.rs b/vcx/libvcx/src/v3/messages/a2a/protocol_registry.rs index 4173103875..7faa7a9f7f 100644 --- a/vcx/libvcx/src/v3/messages/a2a/protocol_registry.rs +++ b/vcx/libvcx/src/v3/messages/a2a/protocol_registry.rs @@ -41,13 +41,13 @@ impl ProtocolRegistry { Some((actor_1, actor_2)) => { match (actors.contains(&actor_1), actors.contains(&actor_2)) { (true, true) => { - self.protocols.push({ ProtocolDescriptor { pid: family.id(), roles: None } }) + self.protocols.push(ProtocolDescriptor { pid: family.id(), roles: None }) } (true, false) => { - self.protocols.push({ ProtocolDescriptor { pid: family.id(), roles: Some(vec![actor_1]) } }) + self.protocols.push(ProtocolDescriptor { pid: family.id(), roles: Some(vec![actor_1]) }) } (false, true) => { - self.protocols.push({ ProtocolDescriptor { pid: family.id(), roles: Some(vec![actor_2]) } }) + self.protocols.push(ProtocolDescriptor { pid: family.id(), roles: Some(vec![actor_2]) }) } (false, false) => {} } diff --git a/vcx/wrappers/ios/vcx/ConnectMeVcx.h b/vcx/wrappers/ios/vcx/ConnectMeVcx.h index 7a3799cd44..affbf3be8b 100644 --- a/vcx/wrappers/ios/vcx/ConnectMeVcx.h +++ b/vcx/wrappers/ios/vcx/ConnectMeVcx.h @@ -81,6 +81,10 @@ extern void VcxWrapperCommonNumberStringCallback(vcx_command_handle_t xcommand_h - (void)agentProvisionAsync:(NSString *)config completion:(void (^)(NSError *error, NSString *config))completion; +- (int)updateWebhookUrl:(NSString *) notification_webhook_url; + +- (NSString *)errorCMessage:(NSInteger) errorCode; + - (void)connectionCreateWithInvite:(NSString *)invitationId inviteDetails:(NSString *)inviteDetails completion:(void (^)(NSError *error, NSInteger connectionHandle))completion; @@ -106,6 +110,12 @@ extern void VcxWrapperCommonNumberStringCallback(vcx_command_handle_t xcommand_h - (void)deleteConnection:(VcxHandle)connectionHandle withCompletion:(void (^)(NSError *error))completion; +- (void)connectionGetPwDid:(NSInteger)connectionHandle + completion:(void (^)(NSError *error, NSString *pwDid))completion; + +- (void)connectionGetTheirPwDid:(NSInteger)connectionHandle + completion:(void (^)(NSError *error, NSString *theirPwDid))completion; + - (void)connectionSendMessage:(VcxHandle)connectionHandle withMessage:(NSString *)message withSendMessageOptions:(NSString *)sendMessageOptions diff --git a/vcx/wrappers/ios/vcx/ConnectMeVcx.m b/vcx/wrappers/ios/vcx/ConnectMeVcx.m index 80f3d9bd5c..f5fddc02f0 100644 --- a/vcx/wrappers/ios/vcx/ConnectMeVcx.m +++ b/vcx/wrappers/ios/vcx/ConnectMeVcx.m @@ -347,6 +347,24 @@ - (void)agentProvisionAsync:(NSString *)config } +- (int)updateWebhookUrl:(NSString *) notification_webhook_url { + const char *notification_webhook_url_char = [notification_webhook_url cStringUsingEncoding:NSUTF8StringEncoding]; + + return vcx_update_webhook_url(notification_webhook_url_char); +} + +- (NSString *)errorCMessage:(NSInteger) errorCode { + const char * ret = vcx_error_c_message(errorCode); + + NSString *message = nil; + + if (ret) { + message = [NSString stringWithUTF8String:ret]; + } + + return message; +} + - (void)connectionCreateWithInvite:(NSString *)invitationId inviteDetails:(NSString *)inviteDetails completion:(void (^)(NSError *error, NSInteger connectionHandle)) completion @@ -470,6 +488,42 @@ - (void)deleteConnection:(VcxHandle)connectionHandle } } +- (void)connectionGetPwDid:(NSInteger)connectionHandle + completion:(void (^)(NSError *error, NSString *pwDid))completion +{ + vcx_error_t ret; + vcx_command_handle_t handle = [[VcxCallbacks sharedInstance] createCommandHandleFor:completion]; + + ret = vcx_connection_get_pw_did(handle,connectionHandle, VcxWrapperCommonStringCallback); + + if( ret != 0 ) + { + [[VcxCallbacks sharedInstance] deleteCommandHandleFor: handle]; + + dispatch_async(dispatch_get_main_queue(), ^{ + completion([NSError errorFromVcxError: ret],nil); + }); + } +} + +- (void)connectionGetTheirPwDid:(NSInteger)connectionHandle + completion:(void (^)(NSError *error, NSString *theirPwDid))completion +{ + vcx_error_t ret; + vcx_command_handle_t handle = [[VcxCallbacks sharedInstance] createCommandHandleFor:completion]; + + ret = vcx_connection_get_their_pw_did(handle,connectionHandle, VcxWrapperCommonStringCallback); + + if( ret != 0 ) + { + [[VcxCallbacks sharedInstance] deleteCommandHandleFor: handle]; + + dispatch_async(dispatch_get_main_queue(), ^{ + completion([NSError errorFromVcxError: ret],nil); + }); + } +} + - (void)connectionSendMessage:(VcxHandle)connectionHandle withMessage:(NSString *)message withSendMessageOptions:(NSString *)sendMessageOptions diff --git a/vcx/wrappers/ios/vcx/include/libvcx.h b/vcx/wrappers/ios/vcx/include/libvcx.h index aec6ec1f56..3fa53895fe 100644 --- a/vcx/wrappers/ios/vcx/include/libvcx.h +++ b/vcx/wrappers/ios/vcx/include/libvcx.h @@ -68,6 +68,8 @@ vcx_error_t vcx_init(vcx_command_handle_t handle, const char *config_path, void vcx_error_t vcx_create_agent(vcx_command_handle_t handle, const char *config, void (*cb)(vcx_command_handle_t xhandle, vcx_error_t err, const char *xconfig)); vcx_error_t vcx_update_agent_info(vcx_command_handle_t handle, const char *info, void (*cb)(vcx_command_handle_t xhandle, vcx_error_t err)); +vcx_error_t vcx_update_webhook_url(const char *notification_webhook_url); + const char *vcx_error_c_message(int); const char *vcx_version(); @@ -153,6 +155,12 @@ vcx_error_t vcx_connection_create_with_invite(vcx_command_handle_t command_handl /** Deletes a connection, send an API call to agency to stop sending messages from this connection */ vcx_error_t vcx_connection_delete_connection(vcx_command_handle_t command_handle, vcx_connection_handle_t connection_handle, void (*cb)(vcx_command_handle_t, vcx_error_t err)); +/** Retrieves pw_did from Connection object. */ +vcx_error_t vcx_connection_get_pw_did(vcx_command_handle_t command_handle, vcx_connection_handle_t connection_handle, void (*cb)(vcx_command_handle_t xcommand_handle, vcx_error_t err, const char *pw_did)); + +/** Retrieves their_pw_did from Connection object. */ +vcx_error_t vcx_connection_get_their_pw_did(vcx_command_handle_t command_handle, vcx_connection_handle_t connection_handle, void (*cb)(vcx_command_handle_t xcommand_handle, vcx_error_t err, const char *their_pw_did)); + /** Send a message to the specified connection /// /// #params diff --git a/wrappers/ios/libindy-pod/Indy/Wrapper/IndyNonSecrets.h b/wrappers/ios/libindy-pod/Indy/Wrapper/IndyNonSecrets.h index ab5c2de024..1fa61334cb 100644 --- a/wrappers/ios/libindy-pod/Indy/Wrapper/IndyNonSecrets.h +++ b/wrappers/ios/libindy-pod/Indy/Wrapper/IndyNonSecrets.h @@ -141,7 +141,7 @@ { retrieveType: (optional, false by default) Retrieve record type, retrieveValue: (optional, true by default) Retrieve record value, - retrieveTags: (optional, true by default) Retrieve record tags + retrieveTags: (optional, false by default) Retrieve record tags } @param completion Completion callback that returns error code and wallet record: @@ -181,7 +181,7 @@ retrieveTotalCount: (optional, false by default) Calculate total count, retrieveType: (optional, false by default) Retrieve record type, retrieveValue: (optional, true by default) Retrieve record value, - retrieveTags: (optional, true by default) Retrieve record tags, + retrieveTags: (optional, false by default) Retrieve record tags, } @param completion Completion callback that returns error code and searchHandle that can be used later diff --git a/wrappers/java/src/main/java/org/hyperledger/indy/sdk/anoncreds/Anoncreds.java b/wrappers/java/src/main/java/org/hyperledger/indy/sdk/anoncreds/Anoncreds.java index 7062de04eb..8ff7893c1c 100644 --- a/wrappers/java/src/main/java/org/hyperledger/indy/sdk/anoncreds/Anoncreds.java +++ b/wrappers/java/src/main/java/org/hyperledger/indy/sdk/anoncreds/Anoncreds.java @@ -321,7 +321,7 @@ public static CompletableFuture issuerC * * @throws IndyException Thrown if an error occurs when calling the underlying SDK. */ - public static CompletableFutureissuerRotateCredentialDefStart( + public static CompletableFuture issuerRotateCredentialDefStart( Wallet wallet, String credDefId, String configJson) throws IndyException { @@ -358,7 +358,7 @@ public static CompletableFuture issuerC * * @throws IndyException Thrown if an error occurs when calling the underlying SDK. */ - public static CompletableFutureissuerRotateCredentialDefApply( + public static CompletableFuture issuerRotateCredentialDefApply( Wallet wallet, String credDefId) throws IndyException { @@ -1003,7 +1003,7 @@ public static CompletableFuture proverDeleteCredential( commandHandle, walletHandle, credId, - stringCb); + voidCb); checkResult(future, result); diff --git a/wrappers/java/src/main/java/org/hyperledger/indy/sdk/non_secrets/WalletRecord.java b/wrappers/java/src/main/java/org/hyperledger/indy/sdk/non_secrets/WalletRecord.java index 7f60fb5381..42a1dd6dc9 100644 --- a/wrappers/java/src/main/java/org/hyperledger/indy/sdk/non_secrets/WalletRecord.java +++ b/wrappers/java/src/main/java/org/hyperledger/indy/sdk/non_secrets/WalletRecord.java @@ -318,7 +318,7 @@ public static CompletableFuture delete( * { * retrieveType: (optional, false by default) Retrieve record type, * retrieveValue: (optional, true by default) Retrieve record value, - * retrieveTags: (optional, true by default) Retrieve record tags + * retrieveTags: (optional, false by default) Retrieve record tags * } * @return A future that resolves to wallet records json: * { diff --git a/wrappers/java/src/main/java/org/hyperledger/indy/sdk/non_secrets/WalletSearch.java b/wrappers/java/src/main/java/org/hyperledger/indy/sdk/non_secrets/WalletSearch.java index 69649e5cd1..32114b9ae2 100644 --- a/wrappers/java/src/main/java/org/hyperledger/indy/sdk/non_secrets/WalletSearch.java +++ b/wrappers/java/src/main/java/org/hyperledger/indy/sdk/non_secrets/WalletSearch.java @@ -109,7 +109,7 @@ public void callback(int xcommand_handle, int err, int handle) { * retrieveTotalCount: (optional, false by default) Calculate total count, * retrieveType: (optional, false by default) Retrieve record type, * retrieveValue: (optional, true by default) Retrieve record value, - * retrieveTags: (optional, true by default) Retrieve record tags, + * retrieveTags: (optional, false by default) Retrieve record tags, * } * @return A future that resolves to WalletSearch instance. * @throws IndyException Thrown if an error occurs when calling the underlying SDK. diff --git a/wrappers/nodejs/test/nonsecrets.js b/wrappers/nodejs/test/nonsecrets.js new file mode 100644 index 0000000000..a35e2f7c72 --- /dev/null +++ b/wrappers/nodejs/test/nonsecrets.js @@ -0,0 +1,64 @@ +var test = require('ava') +var indy = require('../') +var cuid = require('cuid') + +test('nonsecrets', async function (t) { + var walletConfig = { 'id': 'wallet-' + cuid() } + var walletCredentials = { 'key': 'key' } + await indy.createWallet(walletConfig, walletCredentials) + var wh = await indy.openWallet(walletConfig, walletCredentials) + + await indy.addWalletRecord(wh, 'contact', '1', 'john', JSON.stringify({ + '~score': 'aaa' + })) + await indy.addWalletRecord(wh, 'contact', '2', 'jessica', JSON.stringify({ + '~score': 'ccc' + })) + await indy.addWalletRecord(wh, 'contact', '3', 'jack', JSON.stringify({ + '~score': 'eee', + '~note': 'foo' + })) + + await indy.updateWalletRecordValue(wh, 'contact', '3', 'george') + await indy.updateWalletRecordTags(wh, 'contact', '3', JSON.stringify({ + '~score': 'fff' + })) + + const record = await indy.getWalletRecord(wh, 'contact', '1', '{}') + t.is(record.id, '1') + t.is(record.value, 'john') + t.is(record.tags, null) + t.is(record.type, null) + + const record2 = await indy.getWalletRecord(wh, 'contact', '1', '{"retrieveType": true, "retrieveTags": true}') + t.is(record2.id, '1') + t.is(record2.value, 'john') + t.deepEqual(record2.tags, { + '~score': 'aaa' + }) + t.is(record2.type, 'contact') + + const query = { '~score': { '$gte': 'bbb' } } + let searchHandle = await indy.openWalletSearch(wh, 'contact', JSON.stringify(query), JSON.stringify({ + retrieveRecords: true, + retrieveTotalCount: true, + retrieveType: true, + retrieveValue: true, + retrieveTags: true + })) + let searchResult = await indy.fetchWalletSearchNextRecords(wh, searchHandle, 10) + t.is(searchResult.totalCount, 2) + let jessica = searchResult.records.find(r => r.value === 'jessica') + t.is(jessica.id, '2') + t.is(jessica.type, 'contact') + t.is(jessica.tags['~score'], 'ccc') + let jack = searchResult.records.find(r => r.value === 'george') + t.is(jack.id, '3') + t.is(jack.type, 'contact') + t.is(jack.tags['~score'], 'fff') + t.is(jack.tags['~note'], undefined) + + await indy.closeWalletSearch(searchHandle) + await indy.closeWallet(wh) + await indy.deleteWallet(walletConfig, walletCredentials) +}) diff --git a/wrappers/python/indy/non_secrets.py b/wrappers/python/indy/non_secrets.py index e8fb301b47..3e3b445afe 100644 --- a/wrappers/python/indy/non_secrets.py +++ b/wrappers/python/indy/non_secrets.py @@ -284,7 +284,7 @@ async def get_wallet_record(wallet_handle: int, { retrieveType: (optional, false by default) Retrieve record type, retrieveValue: (optional, true by default) Retrieve record value, - retrieveTags: (optional, true by default) Retrieve record tags + retrieveTags: (optional, false by default) Retrieve record tags } :return: wallet record json: { @@ -346,7 +346,7 @@ async def open_wallet_search(wallet_handle: int, retrieveTotalCount: (optional, false by default) Calculate total count, retrieveType: (optional, false by default) Retrieve record type, retrieveValue: (optional, true by default) Retrieve record value, - retrieveTags: (optional, true by default) Retrieve record tags, + retrieveTags: (optional, false by default) Retrieve record tags, } :return: search_handle: Wallet search handle that can be used later to fetch records by small batches (with fetch_wallet_search_next_records)