diff --git a/Jenkinsfile.cd b/Jenkinsfile.cd index 6fcf994c8c..8f0ab258c9 100644 --- a/Jenkinsfile.cd +++ b/Jenkinsfile.cd @@ -481,14 +481,13 @@ def linuxVcxJavaTesting(env_name, network_name, testEnv, stashBuildResults) { def linuxVcxPythonTesting(env_name, network_name, testEnv, stashBuildResults) { unstash name: "VcxPythonLibvcxSO${env_name}" unstash name: "VcxPythonLibindyAndLibnullpaySO${env_name}" + dir('vcx/wrappers/python3') { - - testEnv.inside { echo "${env_name} Vcx Test: Test python wrapper" sh ''' - python3.5 -m pip install --user pytest==3.4.2 qrcode pytest-asyncio + python3.5 -m pip install --user pytest==3.6.4 pytest-asyncio LD_LIBRARY_PATH=./:${LD_LIBRARY_PATH} python3.5 -m pytest -s ''' } diff --git a/Jenkinsfile.ci b/Jenkinsfile.ci index 3cb3227a65..9b6af5b6e6 100644 --- a/Jenkinsfile.ci +++ b/Jenkinsfile.ci @@ -622,7 +622,7 @@ def linuxVcxPythonTesting(env_name, network_name, testEnv) { echo "${env_name} Vcx Test: Test python wrapper" sh ''' - python3.5 -m pip install --user pytest==3.4.2 qrcode pytest-asyncio + python3.5 -m pip install --user pytest==3.6.4 pytest-asyncio LD_LIBRARY_PATH=./:${LD_LIBRARY_PATH} python3.5 -m pytest -s ''' } diff --git a/README.md b/README.md index 59261077e9..620044fa87 100644 --- a/README.md +++ b/README.md @@ -32,7 +32,7 @@ rewritten but still contains some useful ideas. The major artifact of the SDK is a C-callable library that provides the basic building blocks for the creation of applications on the top of [Hyperledger Indy](https://www.hyperledger.org/projects/hyperledger-indy). -It is available for most popular desktop, mobile and server platfrorms. +It is available for most popular desktop, mobile and server platforms. ### Libindy wrappers diff --git a/cli/src/commands/ledger.rs b/cli/src/commands/ledger.rs index ee872d6f58..fded7d2004 100644 --- a/cli/src/commands/ledger.rs +++ b/cli/src/commands/ledger.rs @@ -271,7 +271,7 @@ pub mod schema_command { command!(CommandMetadata::build("schema", "Send Schema transaction to the Ledger.") .add_required_param("name", "Schema name") .add_required_param("version", "Schema version") - .add_required_param("attr_names", "Schema attributes split by comma") + .add_required_param("attr_names", "Schema attributes split by comma (the number of attributes should be less or equal than 125)") .add_optional_param("fees_inputs","The list of source inputs") .add_optional_param("fees_outputs","The list of outputs in the following format: (recipient, amount)") .add_optional_param("extra","Optional information for fees payment operation") diff --git a/doc/rhel-build.md b/doc/rhel-build.md index dd64d4aec9..1ae8bf8a34 100644 --- a/doc/rhel-build.md +++ b/doc/rhel-build.md @@ -42,7 +42,7 @@ dnf install -y \ For Amazon Linux 2017.03 or other distributions without `libsodium` available in system repositories: ``` cd /tmp -curl https://download.libsodium.org/libsodium/releases/libsodium-1.0.14.tar.gz | tar -xz +curl https://download.libsodium.org/libsodium/releases/old/libsodium-1.0.14.tar.gz | tar -xz cd /tmp/libsodium-1.0.14 ./configure make diff --git a/doc/ubuntu-build.md b/doc/ubuntu-build.md index 474eeee7a7..3ad424ff42 100644 --- a/doc/ubuntu-build.md +++ b/doc/ubuntu-build.md @@ -19,7 +19,7 @@ Because of this, it requires to build and install `libsodium` from source: ``` cd /tmp && \ - curl https://download.libsodium.org/libsodium/releases/libsodium-1.0.14.tar.gz | tar -xz && \ + curl https://download.libsodium.org/libsodium/releases/old/libsodium-1.0.14.tar.gz | tar -xz && \ cd /tmp/libsodium-1.0.14 && \ ./configure --disable-shared && \ make && \ diff --git a/doc/windows-build.md b/doc/windows-build.md index 375ba46d2d..e09b0f5265 100644 --- a/doc/windows-build.md +++ b/doc/windows-build.md @@ -43,7 +43,7 @@ git clone https://github.com/hyperledger/indy-sdk.git ### Binary deps - https://www.npcglib.org/~stathis/downloads/openssl-1.0.2k-vs2017.7z -- https://download.libsodium.org/libsodium/releases/libsodium-1.0.14-msvc.zip +- https://download.libsodium.org/libsodium/releases/old/libsodium-1.0.14-msvc.zip ### Source deps diff --git a/libindy/Cargo.lock b/libindy/Cargo.lock index 4550c9d9e5..393116fa19 100644 --- a/libindy/Cargo.lock +++ b/libindy/Cargo.lock @@ -50,7 +50,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] name = "arrayvec" -version = "0.4.9" +version = "0.4.10" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "nodrop 0.1.13 (registry+https://github.com/rust-lang/crates.io-index)", @@ -71,19 +71,19 @@ name = "backtrace" version = "0.3.11" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "backtrace-sys 0.1.26 (registry+https://github.com/rust-lang/crates.io-index)", + "backtrace-sys 0.1.28 (registry+https://github.com/rust-lang/crates.io-index)", "cfg-if 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)", "libc 0.2.41 (registry+https://github.com/rust-lang/crates.io-index)", - "rustc-demangle 0.1.11 (registry+https://github.com/rust-lang/crates.io-index)", + "rustc-demangle 0.1.13 (registry+https://github.com/rust-lang/crates.io-index)", "winapi 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "backtrace-sys" -version = "0.1.26" +version = "0.1.28" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "cc 1.0.27 (registry+https://github.com/rust-lang/crates.io-index)", + "cc 1.0.28 (registry+https://github.com/rust-lang/crates.io-index)", "libc 0.2.41 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -106,7 +106,7 @@ name = "blake2-rfc" version = "0.2.18" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "arrayvec 0.4.9 (registry+https://github.com/rust-lang/crates.io-index)", + "arrayvec 0.4.10 (registry+https://github.com/rust-lang/crates.io-index)", "constant_time_eq 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -136,7 +136,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] name = "cc" -version = "1.0.27" +version = "1.0.28" source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] @@ -151,7 +151,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "num-integer 0.1.39 (registry+https://github.com/rust-lang/crates.io-index)", "num-traits 0.2.6 (registry+https://github.com/rust-lang/crates.io-index)", - "time 0.1.41 (registry+https://github.com/rust-lang/crates.io-index)", + "time 0.1.42 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -180,29 +180,31 @@ source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "atty 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)", "clap 2.32.0 (registry+https://github.com/rust-lang/crates.io-index)", - "criterion-plot 0.2.5 (registry+https://github.com/rust-lang/crates.io-index)", + "criterion-plot 0.2.7 (registry+https://github.com/rust-lang/crates.io-index)", "criterion-stats 0.2.5 (registry+https://github.com/rust-lang/crates.io-index)", "csv 1.0.5 (registry+https://github.com/rust-lang/crates.io-index)", - "failure 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)", - "failure_derive 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)", + "failure 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", + "failure_derive 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", "handlebars 0.32.4 (registry+https://github.com/rust-lang/crates.io-index)", "itertools 0.7.11 (registry+https://github.com/rust-lang/crates.io-index)", "itertools-num 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 1.0.82 (registry+https://github.com/rust-lang/crates.io-index)", - "serde_derive 1.0.82 (registry+https://github.com/rust-lang/crates.io-index)", - "serde_json 1.0.33 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.84 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_derive 1.0.84 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_json 1.0.34 (registry+https://github.com/rust-lang/crates.io-index)", "simplelog 0.5.3 (registry+https://github.com/rust-lang/crates.io-index)", "walkdir 2.2.7 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "criterion-plot" -version = "0.2.5" +version = "0.2.7" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "byteorder 1.2.7 (registry+https://github.com/rust-lang/crates.io-index)", "cast 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", + "failure 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", + "failure_derive 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", "itertools 0.7.11 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -214,7 +216,7 @@ dependencies = [ "cast 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", "num-traits 0.2.6 (registry+https://github.com/rust-lang/crates.io-index)", "num_cpus 1.9.0 (registry+https://github.com/rust-lang/crates.io-index)", - "rand 0.4.3 (registry+https://github.com/rust-lang/crates.io-index)", + "rand 0.4.5 (registry+https://github.com/rust-lang/crates.io-index)", "thread-scoped 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -224,7 +226,7 @@ version = "1.0.5" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "csv-core 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 1.0.82 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.84 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -242,7 +244,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "proc-macro2 0.4.24 (registry+https://github.com/rust-lang/crates.io-index)", "quote 0.6.10 (registry+https://github.com/rust-lang/crates.io-index)", - "syn 0.15.23 (registry+https://github.com/rust-lang/crates.io-index)", + "syn 0.15.24 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -327,21 +329,21 @@ dependencies = [ [[package]] name = "failure" -version = "0.1.3" +version = "0.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "backtrace 0.3.11 (registry+https://github.com/rust-lang/crates.io-index)", - "failure_derive 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)", + "failure_derive 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "failure_derive" -version = "0.1.3" +version = "0.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "proc-macro2 0.4.24 (registry+https://github.com/rust-lang/crates.io-index)", "quote 0.6.10 (registry+https://github.com/rust-lang/crates.io-index)", - "syn 0.15.23 (registry+https://github.com/rust-lang/crates.io-index)", + "syn 0.15.24 (registry+https://github.com/rust-lang/crates.io-index)", "synstructure 0.10.1 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -406,8 +408,8 @@ dependencies = [ "pest_derive 1.0.8 (registry+https://github.com/rust-lang/crates.io-index)", "quick-error 1.2.2 (registry+https://github.com/rust-lang/crates.io-index)", "regex 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 1.0.82 (registry+https://github.com/rust-lang/crates.io-index)", - "serde_json 1.0.33 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.84 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_json 1.0.34 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -427,7 +429,7 @@ dependencies = [ name = "indy" version = "1.7.0" dependencies = [ - "failure 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)", + "failure 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", "futures 0.1.25 (registry+https://github.com/rust-lang/crates.io-index)", "indy-sys 1.7.0", "lazy_static 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)", @@ -450,12 +452,12 @@ dependencies = [ "log 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)", "openssl 0.10.12 (registry+https://github.com/rust-lang/crates.io-index)", "rand 0.3.22 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 1.0.82 (registry+https://github.com/rust-lang/crates.io-index)", - "serde_derive 1.0.82 (registry+https://github.com/rust-lang/crates.io-index)", - "serde_json 1.0.33 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.84 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_derive 1.0.84 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_json 1.0.34 (registry+https://github.com/rust-lang/crates.io-index)", "sha2 0.7.1 (registry+https://github.com/rust-lang/crates.io-index)", "sha3 0.7.3 (registry+https://github.com/rust-lang/crates.io-index)", - "time 0.1.41 (registry+https://github.com/rust-lang/crates.io-index)", + "time 0.1.42 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -548,14 +550,14 @@ dependencies = [ "rmp-serde 0.13.7 (registry+https://github.com/rust-lang/crates.io-index)", "rusqlite 0.13.0 (registry+https://github.com/rust-lang/crates.io-index)", "rust-base58 0.0.4 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 1.0.82 (registry+https://github.com/rust-lang/crates.io-index)", - "serde_derive 1.0.82 (registry+https://github.com/rust-lang/crates.io-index)", - "serde_json 1.0.33 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.84 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_derive 1.0.84 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_json 1.0.34 (registry+https://github.com/rust-lang/crates.io-index)", "sha2 0.7.1 (registry+https://github.com/rust-lang/crates.io-index)", "sha3 0.7.3 (registry+https://github.com/rust-lang/crates.io-index)", "sodiumoxide 0.0.16 (registry+https://github.com/rust-lang/crates.io-index)", "threadpool 1.7.1 (registry+https://github.com/rust-lang/crates.io-index)", - "time 0.1.41 (registry+https://github.com/rust-lang/crates.io-index)", + "time 0.1.42 (registry+https://github.com/rust-lang/crates.io-index)", "uuid 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)", "zmq 0.8.2 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -574,7 +576,7 @@ name = "libsqlite3-sys" version = "0.9.3" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "cc 1.0.27 (registry+https://github.com/rust-lang/crates.io-index)", + "cc 1.0.28 (registry+https://github.com/rust-lang/crates.io-index)", "pkg-config 0.3.14 (registry+https://github.com/rust-lang/crates.io-index)", "vcpkg 0.2.6 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -694,7 +696,7 @@ dependencies = [ "num-traits 0.2.6 (registry+https://github.com/rust-lang/crates.io-index)", "proc-macro2 0.4.24 (registry+https://github.com/rust-lang/crates.io-index)", "quote 0.6.10 (registry+https://github.com/rust-lang/crates.io-index)", - "syn 0.15.23 (registry+https://github.com/rust-lang/crates.io-index)", + "syn 0.15.24 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -763,7 +765,7 @@ name = "openssl-sys" version = "0.9.40" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "cc 1.0.27 (registry+https://github.com/rust-lang/crates.io-index)", + "cc 1.0.28 (registry+https://github.com/rust-lang/crates.io-index)", "libc 0.2.41 (registry+https://github.com/rust-lang/crates.io-index)", "pkg-config 0.3.14 (registry+https://github.com/rust-lang/crates.io-index)", "vcpkg 0.2.6 (registry+https://github.com/rust-lang/crates.io-index)", @@ -830,22 +832,37 @@ source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "fuchsia-zircon 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)", "libc 0.2.41 (registry+https://github.com/rust-lang/crates.io-index)", - "rand 0.4.3 (registry+https://github.com/rust-lang/crates.io-index)", + "rand 0.4.5 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "rand" -version = "0.4.3" +version = "0.4.5" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "fuchsia-zircon 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)", "libc 0.2.41 (registry+https://github.com/rust-lang/crates.io-index)", + "rand_core 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", + "rdrand 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", "winapi 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)", ] +[[package]] +name = "rand_core" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "rdrand" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "rand_core 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", +] + [[package]] name = "redox_syscall" -version = "0.1.44" +version = "0.1.50" source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] @@ -853,7 +870,7 @@ name = "redox_termios" version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "redox_syscall 0.1.44 (registry+https://github.com/rust-lang/crates.io-index)", + "redox_syscall 0.1.50 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -862,9 +879,9 @@ version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "argon2rs 0.2.5 (registry+https://github.com/rust-lang/crates.io-index)", - "failure 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)", - "rand 0.4.3 (registry+https://github.com/rust-lang/crates.io-index)", - "redox_syscall 0.1.44 (registry+https://github.com/rust-lang/crates.io-index)", + "failure 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", + "rand 0.4.5 (registry+https://github.com/rust-lang/crates.io-index)", + "redox_syscall 0.1.50 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -903,7 +920,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "byteorder 1.2.7 (registry+https://github.com/rust-lang/crates.io-index)", "rmp 0.8.7 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 1.0.82 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.84 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -914,7 +931,7 @@ dependencies = [ "bitflags 1.0.4 (registry+https://github.com/rust-lang/crates.io-index)", "libsqlite3-sys 0.9.3 (registry+https://github.com/rust-lang/crates.io-index)", "lru-cache 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", - "time 0.1.41 (registry+https://github.com/rust-lang/crates.io-index)", + "time 0.1.42 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -927,7 +944,7 @@ dependencies = [ [[package]] name = "rustc-demangle" -version = "0.1.11" +version = "0.1.13" source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] @@ -955,27 +972,27 @@ source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] name = "serde" -version = "1.0.82" +version = "1.0.84" source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] name = "serde_derive" -version = "1.0.82" +version = "1.0.84" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "proc-macro2 0.4.24 (registry+https://github.com/rust-lang/crates.io-index)", "quote 0.6.10 (registry+https://github.com/rust-lang/crates.io-index)", - "syn 0.15.23 (registry+https://github.com/rust-lang/crates.io-index)", + "syn 0.15.24 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "serde_json" -version = "1.0.33" +version = "1.0.34" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "itoa 0.4.3 (registry+https://github.com/rust-lang/crates.io-index)", "ryu 0.2.7 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 1.0.82 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.84 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -1017,7 +1034,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "libc 0.2.41 (registry+https://github.com/rust-lang/crates.io-index)", "libsodium-sys 0.0.16 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 1.0.82 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.84 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -1042,7 +1059,7 @@ dependencies = [ [[package]] name = "syn" -version = "0.15.23" +version = "0.15.24" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "proc-macro2 0.4.24 (registry+https://github.com/rust-lang/crates.io-index)", @@ -1065,7 +1082,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "proc-macro2 0.4.24 (registry+https://github.com/rust-lang/crates.io-index)", "quote 0.6.10 (registry+https://github.com/rust-lang/crates.io-index)", - "syn 0.15.23 (registry+https://github.com/rust-lang/crates.io-index)", + "syn 0.15.24 (registry+https://github.com/rust-lang/crates.io-index)", "unicode-xid 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -1092,7 +1109,7 @@ version = "1.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "libc 0.2.41 (registry+https://github.com/rust-lang/crates.io-index)", - "redox_syscall 0.1.44 (registry+https://github.com/rust-lang/crates.io-index)", + "redox_syscall 0.1.50 (registry+https://github.com/rust-lang/crates.io-index)", "redox_termios 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -1127,11 +1144,11 @@ dependencies = [ [[package]] name = "time" -version = "0.1.41" +version = "0.1.42" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "libc 0.2.41 (registry+https://github.com/rust-lang/crates.io-index)", - "redox_syscall 0.1.44 (registry+https://github.com/rust-lang/crates.io-index)", + "redox_syscall 0.1.50 (registry+https://github.com/rust-lang/crates.io-index)", "winapi 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -1266,10 +1283,10 @@ dependencies = [ "checksum ansi_term 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)" = "ee49baf6cb617b853aa8d93bf420db2383fab46d314482ca2803b40d5fde979b" "checksum argon2rs 0.2.5 (registry+https://github.com/rust-lang/crates.io-index)" = "3f67b0b6a86dae6e67ff4ca2b6201396074996379fba2b92ff649126f37cb392" "checksum arrayref 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)" = "0d382e583f07208808f6b1249e60848879ba3543f57c32277bf52d69c2f0f0ee" -"checksum arrayvec 0.4.9 (registry+https://github.com/rust-lang/crates.io-index)" = "d18513977c2d8261c448511c5c53dc66b26dfccbc3d4446672dea1e71a7d8a26" +"checksum arrayvec 0.4.10 (registry+https://github.com/rust-lang/crates.io-index)" = "92c7fb76bc8826a8b33b4ee5bb07a247a81e76764ab4d55e8f73e3a4d8808c71" "checksum atty 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)" = "9a7d5b8723950951411ee34d271d99dddcc2035a16ab25310ea2c8cfd4369652" "checksum backtrace 0.3.11 (registry+https://github.com/rust-lang/crates.io-index)" = "18b65ea1161bfb2dd6da6fade5edd4dbd08fba85012123dd333d2fd1b90b2782" -"checksum backtrace-sys 0.1.26 (registry+https://github.com/rust-lang/crates.io-index)" = "3fcce89e5ad5c8949caa9434501f7b55415b3e7ad5270cb88c75a8d35e8f1279" +"checksum backtrace-sys 0.1.28 (registry+https://github.com/rust-lang/crates.io-index)" = "797c830ac25ccc92a7f8a7b9862bde440715531514594a6154e3d4a54dd769b6" "checksum base64 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)" = "96434f987501f0ed4eb336a411e0631ecd1afa11574fe148587adc4ff96143c9" "checksum bitflags 1.0.4 (registry+https://github.com/rust-lang/crates.io-index)" = "228047a76f468627ca71776ecdebd732a3423081fcf5125585bcd7c49886ce12" "checksum blake2-rfc 0.2.18 (registry+https://github.com/rust-lang/crates.io-index)" = "5d6d530bdd2d52966a6d03b7a964add7ae1a288d25214066fd4b600f0f796400" @@ -1277,13 +1294,13 @@ dependencies = [ "checksum byte-tools 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "560c32574a12a89ecd91f5e742165893f86e3ab98d21f8ea548658eb9eef5f40" "checksum byteorder 1.2.7 (registry+https://github.com/rust-lang/crates.io-index)" = "94f88df23a25417badc922ab0f5716cc1330e87f71ddd9203b3a3ccd9cedf75d" "checksum cast 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "926013f2860c46252efceabb19f4a6b308197505082c609025aa6706c011d427" -"checksum cc 1.0.27 (registry+https://github.com/rust-lang/crates.io-index)" = "155ed195f7bd722d1dfeb30365b9d0c1f6a078fa7ca4014497e5935d90993d6f" +"checksum cc 1.0.28 (registry+https://github.com/rust-lang/crates.io-index)" = "bb4a8b715cb4597106ea87c7c84b2f1d452c7492033765df7f32651e66fcf749" "checksum cfg-if 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)" = "082bb9b28e00d3c9d39cc03e64ce4cea0f1bb9b3fde493f0cbc008472d22bdf4" "checksum chrono 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)" = "45912881121cb26fad7c38c17ba7daa18764771836b34fab7d3fbd93ed633878" "checksum clap 2.32.0 (registry+https://github.com/rust-lang/crates.io-index)" = "b957d88f4b6a63b9d70d5f454ac8011819c6efa7727858f458ab71c756ce2d3e" "checksum constant_time_eq 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)" = "8ff012e225ce166d4422e0e78419d901719760f62ae2b7969ca6b564d1b54a9e" "checksum criterion 0.2.5 (registry+https://github.com/rust-lang/crates.io-index)" = "c47d2b548c5647e1a436dc0cb78d4ebf51b6bf7ab101ed76662828bdd4d3a24a" -"checksum criterion-plot 0.2.5 (registry+https://github.com/rust-lang/crates.io-index)" = "6e649d6aacdbbdb94ec659561a309a71336fc5655ed408f3afd28df2fc0c4f4f" +"checksum criterion-plot 0.2.7 (registry+https://github.com/rust-lang/crates.io-index)" = "dd5f81689739e463ece7a6b62c6ec63bdab5c4e28fe05ff451769e87d1511411" "checksum criterion-stats 0.2.5 (registry+https://github.com/rust-lang/crates.io-index)" = "ff43cac80562f91ead0b617c1be74edf350adfaa195809d355de98dfc8f9237d" "checksum csv 1.0.5 (registry+https://github.com/rust-lang/crates.io-index)" = "9fd1c44c58078cfbeaf11fbb3eac9ae5534c23004ed770cc4bfb48e658ae4f04" "checksum csv-core 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)" = "fa5cdef62f37e6ffe7d1f07a381bc0db32b7a3ff1cac0de56cb0d81e71f53d65" @@ -1298,8 +1315,8 @@ dependencies = [ "checksum error-chain 0.10.0 (registry+https://github.com/rust-lang/crates.io-index)" = "d9435d864e017c3c6afeac1654189b06cdb491cf2ff73dbf0d73b0f292f42ff8" "checksum etcommon-hexutil 0.2.4 (registry+https://github.com/rust-lang/crates.io-index)" = "20b4d1933bf88b806ba2d9189880b1b4ef205e42df9573b65716f2a50818024c" "checksum etcommon-rlp 0.2.4 (registry+https://github.com/rust-lang/crates.io-index)" = "804a932fed78022b8ec25c06576c57f683a6646dfae22f93dcc5d23470aafe85" -"checksum failure 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)" = "6dd377bcc1b1b7ce911967e3ec24fa19c3224394ec05b54aa7b083d498341ac7" -"checksum failure_derive 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)" = "64c2d913fe8ed3b6c6518eedf4538255b989945c14c2a7d5cbff62a5e2120596" +"checksum failure 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)" = "795bd83d3abeb9220f257e597aa0080a508b27533824adf336529648f6abf7e2" +"checksum failure_derive 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)" = "ea1063915fd7ef4309e222a5a07cf9c319fb9c7836b1f89b85458672dbb127e1" "checksum fake-simd 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)" = "e88a8acf291dafb59c2d96e8f59828f3838bb1a70398823ade51a84de6a6deed" "checksum foreign-types 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)" = "f6f339eb8adc052cd2ca78910fda869aefa38d22d5cb648e6485e4d3fc06f3b1" "checksum foreign-types-shared 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "00b0228411908ca8685dba7fc2cdd70ec9990a6e753e89b6ac91a84c40fbaf4b" @@ -1353,8 +1370,10 @@ dependencies = [ "checksum quote 0.3.15 (registry+https://github.com/rust-lang/crates.io-index)" = "7a6e920b65c65f10b2ae65c831a81a073a89edd28c7cce89475bff467ab4167a" "checksum quote 0.6.10 (registry+https://github.com/rust-lang/crates.io-index)" = "53fa22a1994bd0f9372d7a816207d8a2677ad0325b073f5c5332760f0fb62b5c" "checksum rand 0.3.22 (registry+https://github.com/rust-lang/crates.io-index)" = "15a732abf9d20f0ad8eeb6f909bf6868722d9a06e1e50802b6a70351f40b4eb1" -"checksum rand 0.4.3 (registry+https://github.com/rust-lang/crates.io-index)" = "8356f47b32624fef5b3301c1be97e5944ecdd595409cc5da11d05f211db6cfbd" -"checksum redox_syscall 0.1.44 (registry+https://github.com/rust-lang/crates.io-index)" = "a84bcd297b87a545980a2d25a0beb72a1f490c31f0a9fde52fca35bfbb1ceb70" +"checksum rand 0.4.5 (registry+https://github.com/rust-lang/crates.io-index)" = "dee497e66d8d76bf08ce20c8d36e16f93749ab0bf89975b4f8ae5cee660c2da2" +"checksum rand_core 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)" = "0905b6b7079ec73b314d4c748701f6931eb79fd97c668caa3f1899b22b32c6db" +"checksum rdrand 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "678054eb77286b51581ba43620cc911abf02758c91f93f479767aed0f90458b2" +"checksum redox_syscall 0.1.50 (registry+https://github.com/rust-lang/crates.io-index)" = "52ee9a534dc1301776eff45b4fa92d2c39b1d8c3d3357e6eb593e0d795506fc2" "checksum redox_termios 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "7e891cfe48e9100a70a3b6eb652fef28920c117d366339687bd5576160db0f76" "checksum redox_users 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "214a97e49be64fd2c86f568dd0cb2c757d2cc53de95b273b6ad0a1c908482f26" "checksum regex 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "37e7cbbd370869ce2e8dff25c7018702d10b21a20ef7135316f8daecd6c25b7f" @@ -1363,14 +1382,14 @@ dependencies = [ "checksum rmp-serde 0.13.7 (registry+https://github.com/rust-lang/crates.io-index)" = "011e1d58446e9fa3af7cdc1fb91295b10621d3ac4cb3a85cc86385ee9ca50cd3" "checksum rusqlite 0.13.0 (registry+https://github.com/rust-lang/crates.io-index)" = "d9409d78a5a9646685688266e1833df8f08b71ffcae1b5db6c1bfb5970d8a80f" "checksum rust-base58 0.0.4 (registry+https://github.com/rust-lang/crates.io-index)" = "b313b91fcdc6719ad41fa2dad2b7e810b03833fae4bf911950e15529a5f04439" -"checksum rustc-demangle 0.1.11 (registry+https://github.com/rust-lang/crates.io-index)" = "01b90379b8664dd83460d59bdc5dd1fd3172b8913788db483ed1325171eab2f7" +"checksum rustc-demangle 0.1.13 (registry+https://github.com/rust-lang/crates.io-index)" = "adacaae16d02b6ec37fdc7acfcddf365978de76d1983d3ee22afc260e1ca9619" "checksum ryu 0.2.7 (registry+https://github.com/rust-lang/crates.io-index)" = "eb9e9b8cde282a9fe6a42dd4681319bfb63f121b8a8ee9439c6f4107e58a46f7" "checksum safemem 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "e27a8b19b835f7aea908818e871f5cc3a5a186550c30773be987e155e8163d8f" "checksum same-file 1.0.4 (registry+https://github.com/rust-lang/crates.io-index)" = "8f20c4be53a8a1ff4c1f1b2bd14570d2f634628709752f0702ecdd2b3f9a5267" "checksum scoped_threadpool 0.1.9 (registry+https://github.com/rust-lang/crates.io-index)" = "1d51f5df5af43ab3f1360b429fa5e0152ac5ce8c0bd6485cae490332e96846a8" -"checksum serde 1.0.82 (registry+https://github.com/rust-lang/crates.io-index)" = "6fa52f19aee12441d5ad11c9a00459122bd8f98707cadf9778c540674f1935b6" -"checksum serde_derive 1.0.82 (registry+https://github.com/rust-lang/crates.io-index)" = "96a7f9496ac65a2db5929afa087b54f8fc5008dcfbe48a8874ed20049b0d6154" -"checksum serde_json 1.0.33 (registry+https://github.com/rust-lang/crates.io-index)" = "c37ccd6be3ed1fdf419ee848f7c758eb31b054d7cd3ae3600e3bae0adf569811" +"checksum serde 1.0.84 (registry+https://github.com/rust-lang/crates.io-index)" = "0e732ed5a5592c17d961555e3b552985baf98d50ce418b7b655f31f6ba7eb1b7" +"checksum serde_derive 1.0.84 (registry+https://github.com/rust-lang/crates.io-index)" = "b4d6115a3ca25c224e409185325afc16a0d5aaaabc15c42b09587d6f1ba39a5b" +"checksum serde_json 1.0.34 (registry+https://github.com/rust-lang/crates.io-index)" = "bdf540260cfee6da923831f4776ddc495ada940c30117977c70f1313a6130545" "checksum sha2 0.7.1 (registry+https://github.com/rust-lang/crates.io-index)" = "9eb6be24e4c23a84d7184280d2722f7f2731fcdd4a9d886efbfe4413e4847ea0" "checksum sha3 0.7.3 (registry+https://github.com/rust-lang/crates.io-index)" = "b64dcef59ed4290b9fb562b53df07f564690d6539e8ecdd4728cf392477530bc" "checksum simplelog 0.5.3 (registry+https://github.com/rust-lang/crates.io-index)" = "2e95345f185d5adeb8ec93459d2dc99654e294cc6ccf5b75414d8ea262de9a13" @@ -1378,7 +1397,7 @@ dependencies = [ "checksum stable_deref_trait 1.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "dba1a27d3efae4351c8051072d619e3ade2820635c3958d826bfea39d59b54c8" "checksum strsim 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)" = "bb4f380125926a99e52bc279241539c018323fab05ad6368b56f93d9369ff550" "checksum syn 0.11.11 (registry+https://github.com/rust-lang/crates.io-index)" = "d3b891b9015c88c576343b9b3e41c2c11a51c219ef067b264bd9c8aa9b441dad" -"checksum syn 0.15.23 (registry+https://github.com/rust-lang/crates.io-index)" = "9545a6a093a3f0bd59adb472700acc08cad3776f860f16a897dfce8c88721cbc" +"checksum syn 0.15.24 (registry+https://github.com/rust-lang/crates.io-index)" = "734ecc29cd36e8123850d9bf21dfd62ef8300aaa8f879aabaa899721808be37c" "checksum synom 0.11.3 (registry+https://github.com/rust-lang/crates.io-index)" = "a393066ed9010ebaed60b9eafa373d4b1baac186dd7e008555b0f702b51945b6" "checksum synstructure 0.10.1 (registry+https://github.com/rust-lang/crates.io-index)" = "73687139bf99285483c96ac0add482c3776528beac1d97d444f6e91f203a2015" "checksum term 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)" = "5e6b677dd1e8214ea1ef4297f85dbcbed8e8cdddb561040cc998ca2551c37561" @@ -1388,7 +1407,7 @@ dependencies = [ "checksum thread-scoped 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)" = "bcbb6aa301e5d3b0b5ef639c9a9c7e2f1c944f177b460c04dc24c69b1fa2bd99" "checksum thread_local 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)" = "c6b53e329000edc2b34dbe8545fd20e55a333362d0a321909685a19bd28c3f1b" "checksum threadpool 1.7.1 (registry+https://github.com/rust-lang/crates.io-index)" = "e2f0c90a5f3459330ac8bc0d2f879c693bb7a2f59689c1083fc4ef83834da865" -"checksum time 0.1.41 (registry+https://github.com/rust-lang/crates.io-index)" = "847da467bf0db05882a9e2375934a8a55cffdc9db0d128af1518200260ba1f6c" +"checksum time 0.1.42 (registry+https://github.com/rust-lang/crates.io-index)" = "db8dcfca086c1143c9270ac42a2bbd8a7ee477b78ac8e45b19abfb0cbede4b6f" "checksum toml 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "736b60249cb25337bc196faa43ee12c705e426f3d55c214d73a4e7be06f92cb4" "checksum typenum 1.10.0 (registry+https://github.com/rust-lang/crates.io-index)" = "612d636f949607bdf9b123b4a6f6d966dedf3ff669f7f045890d3a4a73948169" "checksum ucd-util 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)" = "535c204ee4d8434478593480b8f86ab45ec9aae0e83c568ca81abf0fd0e88f86" diff --git a/libindy/ci/amazon.dockerfile b/libindy/ci/amazon.dockerfile index 87a4575e36..80329b91de 100755 --- a/libindy/ci/amazon.dockerfile +++ b/libindy/ci/amazon.dockerfile @@ -22,7 +22,7 @@ RUN curl --silent --location https://rpm.nodesource.com/setup_8.x | bash - RUN yum -y install nodejs RUN cd /tmp && \ - curl https://download.libsodium.org/libsodium/releases/libsodium-1.0.14.tar.gz | tar -xz && \ + curl https://download.libsodium.org/libsodium/releases/old/libsodium-1.0.14.tar.gz | tar -xz && \ cd /tmp/libsodium-1.0.14 && \ ./configure && \ make && \ diff --git a/libindy/ci/ubuntu.dockerfile b/libindy/ci/ubuntu.dockerfile index 7807348c48..896248128c 100755 --- a/libindy/ci/ubuntu.dockerfile +++ b/libindy/ci/ubuntu.dockerfile @@ -39,7 +39,7 @@ RUN pip3 install -U \ deb-pkg-tools RUN cd /tmp && \ - curl https://download.libsodium.org/libsodium/releases/libsodium-1.0.14.tar.gz | tar -xz && \ + curl https://download.libsodium.org/libsodium/releases/old/libsodium-1.0.14.tar.gz | tar -xz && \ cd /tmp/libsodium-1.0.14 && \ ./configure --disable-shared && \ make && \ diff --git a/libindy/include/indy_ledger.h b/libindy/include/indy_ledger.h index 383ff35ed6..d2a511ab06 100644 --- a/libindy/include/indy_ledger.h +++ b/libindy/include/indy_ledger.h @@ -313,7 +313,7 @@ extern "C" { /// data: Credential schema. /// { /// id: identifier of schema - /// attrNames: array of attribute name strings + /// attrNames: array of attribute name strings (the number of attributes should be less or equal than 125) /// name: Schema's name string /// version: Schema's version string, /// ver: Version of the Schema json diff --git a/libindy/src/api/anoncreds.rs b/libindy/src/api/anoncreds.rs index 2707f0b338..ee4ac96107 100644 --- a/libindy/src/api/anoncreds.rs +++ b/libindy/src/api/anoncreds.rs @@ -42,7 +42,7 @@ use std::collections::HashMap; /// issuer_did: DID of schema issuer /// name: a name the schema /// version: a version of the schema -/// attrs: a list of schema attributes descriptions +/// attrs: a list of schema attributes descriptions (the number of attributes should be less or equal than 125) /// cb: Callback that takes command result as parameter /// /// #Returns diff --git a/libindy/src/api/ledger.rs b/libindy/src/api/ledger.rs index b9a53f81f6..df1ef5b654 100644 --- a/libindy/src/api/ledger.rs +++ b/libindy/src/api/ledger.rs @@ -594,7 +594,7 @@ pub extern fn indy_build_get_attrib_request(command_handle: IndyHandle, /// data: Credential schema. /// { /// id: identifier of schema -/// attrNames: array of attribute name strings +/// attrNames: array of attribute name strings (the number of attributes should be less or equal than 125) /// name: Schema's name string /// version: Schema's version string, /// ver: Version of the Schema json diff --git a/libindy/src/commands/anoncreds/issuer.rs b/libindy/src/commands/anoncreds/issuer.rs index 4e91965b8f..7e9eac4d30 100644 --- a/libindy/src/commands/anoncreds/issuer.rs +++ b/libindy/src/commands/anoncreds/issuer.rs @@ -23,7 +23,7 @@ use self::indy_crypto::cl::{ }; use super::tails::{SDKTailsAccessor, store_tails_from_generator}; -use domain::anoncreds::schema::{Schema, SchemaV1, AttributeNames}; +use domain::anoncreds::schema::{Schema, SchemaV1, AttributeNames, MAX_ATTRIBUTES_COUNT}; use domain::anoncreds::credential_definition::{ CredentialDefinition, CredentialDefinitionV1, @@ -219,6 +219,12 @@ impl IssuerCommandExecutor { self.crypto_service.validate_did(issuer_did)?; + if attrs.len() > MAX_ATTRIBUTES_COUNT { + return Err(IndyError::CommonError( + CommonError::InvalidStructure( + format!("The number of Schema attributes {} cannot be greater than {}", attrs.len(), MAX_ATTRIBUTES_COUNT)))); + } + let schema_id = Schema::schema_id(issuer_did, name, version); let schema = Schema::SchemaV1(SchemaV1 { diff --git a/libindy/src/domain/anoncreds/schema.rs b/libindy/src/domain/anoncreds/schema.rs index a2588b248f..7b453338bc 100644 --- a/libindy/src/domain/anoncreds/schema.rs +++ b/libindy/src/domain/anoncreds/schema.rs @@ -3,6 +3,7 @@ use super::DELIMITER; use std::collections::{HashMap, HashSet}; pub const SCHEMA_MARKER: &'static str = "2"; +pub const MAX_ATTRIBUTES_COUNT: usize = 125; #[derive(Debug, Serialize, Deserialize, Clone)] #[serde(rename_all = "camelCase")] diff --git a/libindy/src/services/ledger/mod.rs b/libindy/src/services/ledger/mod.rs index 31ef1a728e..daaebb4fa9 100644 --- a/libindy/src/services/ledger/mod.rs +++ b/libindy/src/services/ledger/mod.rs @@ -20,7 +20,7 @@ use domain::anoncreds::DELIMITER; use domain::anoncreds::revocation_registry_definition::{RevocationRegistryDefinition, RevocationRegistryDefinitionV1}; use domain::anoncreds::revocation_registry::RevocationRegistry; use domain::anoncreds::revocation_registry_delta::{RevocationRegistryDelta, RevocationRegistryDeltaV1}; -use domain::anoncreds::schema::{Schema, SchemaV1}; +use domain::anoncreds::schema::{Schema, SchemaV1, MAX_ATTRIBUTES_COUNT}; use domain::anoncreds::credential_definition::{CredentialDefinition, CredentialDefinitionV1}; use indy_crypto::cl::RevocationRegistryDelta as CryproRevocationRegistryDelta; @@ -149,6 +149,11 @@ impl LedgerService { pub fn build_schema_request(&self, identifier: &str, schema: SchemaV1) -> Result { info!("build_schema_request >>> identifier: {:?}, schema: {:?}", identifier, schema); + if schema.attr_names.len() > MAX_ATTRIBUTES_COUNT { + return Err(CommonError::InvalidStructure( + format!("The number of Schema attributes {} cannot be greater than {}", schema.attr_names.len(), MAX_ATTRIBUTES_COUNT))); + } + let schema_data = SchemaOperationData::new(schema.name, schema.version, schema.attr_names); let operation = SchemaOperation::new(schema_data); @@ -805,6 +810,24 @@ mod tests { check_request(&request, expected_result); } + #[test] + fn build_schema_request_works_for_attrs_count_more_than_acceptable() { + let ledger_service = LedgerService::new(); + + let attr_names: AttributeNames = (0..MAX_ATTRIBUTES_COUNT + 1).map(|i| i.to_string()).collect(); + + let data = SchemaV1 { + id: Schema::schema_id(IDENTIFIER, "name", "1.0"), + name: "name".to_string(), + version: "1.0".to_string(), + attr_names, + seq_no: None, + }; + + let res = ledger_service.build_schema_request(IDENTIFIER, data); + assert_match!(Err(CommonError::InvalidStructure(_)), res); + } + #[test] fn build_get_schema_request_works_for_invalid_id() { let ledger_service = LedgerService::new(); diff --git a/libindy/tests/anoncreds.rs b/libindy/tests/anoncreds.rs index 8fdb895736..5c85191770 100644 --- a/libindy/tests/anoncreds.rs +++ b/libindy/tests/anoncreds.rs @@ -34,7 +34,7 @@ use indy::ErrorCode; use utils::inmem_wallet::InmemWallet; use utils::constants::*; -use utils::domain::anoncreds::schema::Schema; +use utils::domain::anoncreds::schema::{Schema, AttributeNames, MAX_ATTRIBUTES_COUNT}; use utils::domain::anoncreds::credential_definition::CredentialDefinition; use utils::domain::anoncreds::revocation_registry_definition::RevocationRegistryDefinition; use utils::domain::anoncreds::credential::CredentialInfo; @@ -3146,6 +3146,17 @@ mod medium_cases { GVT_SCHEMA_ATTRIBUTES); assert_eq!(res.unwrap_err(), ErrorCode::CommonInvalidStructure); } + + #[test] + fn issuer_create_schema_works_for_attrs_count_more_than_acceptable() { + let attr_names: AttributeNames = (0..MAX_ATTRIBUTES_COUNT + 1).map(|i| i.to_string()).collect(); + + let res = anoncreds::issuer_create_schema(ISSUER_DID, + GVT_SCHEMA_NAME, + SCHEMA_VERSION, + &serde_json::to_string(&attr_names).unwrap()); + assert_eq!(res.unwrap_err(), ErrorCode::CommonInvalidStructure); + } } mod issuer_create_and_store_credential_def { diff --git a/vcx/libvcx/src/api/schema.rs b/vcx/libvcx/src/api/schema.rs index aa23bcbd55..af67f83c78 100644 --- a/vcx/libvcx/src/api/schema.rs +++ b/vcx/libvcx/src/api/schema.rs @@ -22,7 +22,7 @@ use utils::threadpool::spawn; /// /// version: version of schema /// -/// schema_data: list of attributes that will make up the schema +/// schema_data: list of attributes that will make up the schema (the number of attributes should be less or equal than 125) /// /// # Example schema_data -> "["attr1", "attr2", "attr3"]" /// diff --git a/vcx/wrappers/node/src/api/schema.ts b/vcx/wrappers/node/src/api/schema.ts index 944e895923..93360c4e4c 100644 --- a/vcx/wrappers/node/src/api/schema.ts +++ b/vcx/wrappers/node/src/api/schema.ts @@ -18,7 +18,7 @@ export interface ISchemaCreateData { * @description * name: name of schema * version: - * attrNames: a list of named attribtes inteded to be added to the schema + * attrNames: a list of named attribtes inteded to be added to the schema (the number of attributes should be less or equal than 125) */ export interface ISchemaAttrs { name: string, diff --git a/vcx/wrappers/python3/vcx/api/schema.py b/vcx/wrappers/python3/vcx/api/schema.py index 56e0c1eabc..a27edb8720 100644 --- a/vcx/wrappers/python3/vcx/api/schema.py +++ b/vcx/wrappers/python3/vcx/api/schema.py @@ -13,7 +13,7 @@ class Schema(VcxBase): Attributes: source_id: user generated unique identifier schema_id: the ledger ID of the schema - attrs: attribute/value pairs + attrs: attribute/value pairs (the number of attributes should be less or equal than 125) version: version of the schema """ diff --git a/wrappers/ios/libindy-pod/Indy/Wrapper/IndyAnoncreds.h b/wrappers/ios/libindy-pod/Indy/Wrapper/IndyAnoncreds.h index 56dc1aa4d5..c1426cb1f1 100644 --- a/wrappers/ios/libindy-pod/Indy/Wrapper/IndyAnoncreds.h +++ b/wrappers/ios/libindy-pod/Indy/Wrapper/IndyAnoncreds.h @@ -23,7 +23,7 @@ @param issuerDID DID of schema issuer @param name a name the schema @param version a version of the schema - @param attrs a list of schema attributes descriptions + @param attrs a list of schema attributes descriptions (the number of attributes should be less or equal than 125) @param completion Callback that takes command result as parameter. Returns: schemaId: identifier of created schema diff --git a/wrappers/ios/libindy-pod/Indy/Wrapper/IndyLedger.h b/wrappers/ios/libindy-pod/Indy/Wrapper/IndyLedger.h index aa56d2459d..0d7d395c01 100644 --- a/wrappers/ios/libindy-pod/Indy/Wrapper/IndyLedger.h +++ b/wrappers/ios/libindy-pod/Indy/Wrapper/IndyLedger.h @@ -185,7 +185,7 @@ @param data Credential schema. { id: identifier of schema - attrNames: array of attribute name strings + attrNames: array of attribute name strings (the number of attributes should be less or equal than 125) name: Schema's name string version: Schema's version string, ver: Version of the Schema json 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 1e2e51c71e..3aff9384f5 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 @@ -164,7 +164,7 @@ public void callback(int xcommand_handle, int err, Boolean valid) { * @param issuerDid The DID of the issuer. * @param name Human-readable name of schema. * @param version Version of schema. - * @param attrs: List of schema attributes descriptions + * @param attrs: List of schema attributes descriptions (the number of attributes should be less or equal than 125) * @return A future resolving to IssuerCreateSchemaResult object containing: * schemaId: identifier of created schema * schemaJson: schema as json diff --git a/wrappers/java/src/main/java/org/hyperledger/indy/sdk/ledger/Ledger.java b/wrappers/java/src/main/java/org/hyperledger/indy/sdk/ledger/Ledger.java index 86bdd613e3..dbc2e84d2e 100644 --- a/wrappers/java/src/main/java/org/hyperledger/indy/sdk/ledger/Ledger.java +++ b/wrappers/java/src/main/java/org/hyperledger/indy/sdk/ledger/Ledger.java @@ -511,7 +511,7 @@ public static CompletableFuture buildGetNymRequest( * @param data Credential schema. * { * id: identifier of schema - * attrNames: array of attribute name strings + * attrNames: array of attribute name strings (the number of attributes should be less or equal than 125) * name: Schema's name string * version: Schema's version string, * ver: Version of the Schema json diff --git a/wrappers/nodejs/README.md b/wrappers/nodejs/README.md index 2196809f54..b2673bde55 100644 --- a/wrappers/nodejs/README.md +++ b/wrappers/nodejs/README.md @@ -110,7 +110,7 @@ After that can call issuerCreateAndStoreCredentialDef to build corresponding Cre * `issuerDid`: String - DID of schema issuer * `name`: String - a name the schema * `version`: String - a version of the schema -* `attrNames`: Json +* `attrNames`: Json - a list of schema attributes descriptions (the number of attributes should be less or equal than 125) * __->__ [ `id`: String, `schema`: Json ] - schema\_id: identifier of created schema schema\_json: schema as json @@ -1328,7 +1328,7 @@ Builds a SCHEMA request. Request to add Credential's schema. { id: identifier of schema attrNames: array of attribute name strings - name: Schema's name string + name: Schema's name string (the number of attributes should be less or equal than 125) version: Schema's version string, ver: Version of the Schema json } diff --git a/wrappers/python/indy/__init__.py b/wrappers/python/indy/__init__.py index d68cac3eca..657cb31903 100644 --- a/wrappers/python/indy/__init__.py +++ b/wrappers/python/indy/__init__.py @@ -1 +1,26 @@ from indy.error import IndyError +from indy import anoncreds +from indy import blob_storage +from indy import crypto +from indy import did +from indy import ledger +from indy import libindy +from indy import non_secrets +from indy import pairwise +from indy import payment +from indy import pool +from indy import wallet + +__all__ = [ + 'anoncreds', + 'blob_storage', + 'crypto', + 'did', + 'ledger', + 'libindy', + 'non_secrets', + 'pairwise', + 'payment', + 'pool', + 'wallet' +] diff --git a/wrappers/python/indy/anoncreds.py b/wrappers/python/indy/anoncreds.py index aa8cd7d6b4..d954a46c0f 100644 --- a/wrappers/python/indy/anoncreds.py +++ b/wrappers/python/indy/anoncreds.py @@ -24,7 +24,7 @@ async def issuer_create_schema(issuer_did: str, :param issuer_did: DID of schema issuer :param name: a name the schema :param version: a version of the schema - :param attrs: a list of schema attributes descriptions + :param attrs: a list of schema attributes descriptions (the number of attributes should be less or equal than 125) :return: schema_id: identifier of created schema schema_json: schema as json diff --git a/wrappers/python/indy/ledger.py b/wrappers/python/indy/ledger.py index 78e4e4a65a..6e09a02bf4 100644 --- a/wrappers/python/indy/ledger.py +++ b/wrappers/python/indy/ledger.py @@ -433,7 +433,7 @@ async def build_schema_request(submitter_did: str, :param data: Credential schema. { id: identifier of schema - attrNames: array of attribute name strings + attrNames: array of attribute name strings (the number of attributes should be less or equal than 125) name: Schema's name string version: Schema's version string, ver: Version of the Schema json diff --git a/wrappers/rust/src/anoncreds.rs b/wrappers/rust/src/anoncreds.rs index c29270f8ad..51d4acad4c 100644 --- a/wrappers/rust/src/anoncreds.rs +++ b/wrappers/rust/src/anoncreds.rs @@ -31,7 +31,7 @@ use ffi::{ResponseStringStringCB, /// * `issuer_did`: DID of schema issuer /// * `name`: a name the schema /// * `version`: a version of the schema -/// * `attrs`: a list of schema attributes descriptions +/// * `attrs`: a list of schema attributes descriptions (the number of attributes should be less or equal than 125) /// /// # Returns /// * `schema_id`: identifier of created schema diff --git a/wrappers/rust/src/ledger.rs b/wrappers/rust/src/ledger.rs index fba2fe45d0..09322b29d8 100644 --- a/wrappers/rust/src/ledger.rs +++ b/wrappers/rust/src/ledger.rs @@ -348,7 +348,7 @@ fn _build_get_attrib_request(command_handle: IndyHandle, submitter_did: Option<& /// * `data` - Credential schema. /// { /// id: identifier of schema -/// attrNames: array of attribute name strings +/// attrNames: array of attribute name strings (the number of attributes should be less or equal than 125) /// name: Schema's name string /// version: Schema's version string, /// ver: Version of the Schema json