diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml index 18b941e..500f4d3 100644 --- a/.github/workflows/pr.yml +++ b/.github/workflows/pr.yml @@ -1,8 +1,3 @@ -# PR workflow. -# -# Runs full suite of checks, with warnings treated as errors. -# Gather code coverage stats and publish them on coveralls.io. - name: PR on: @@ -10,10 +5,8 @@ on: branches: [ master ] env: - # Run all cargo commands with --verbose. CARGO_TERM_VERBOSE: true RUST_BACKTRACE: 1 - # Deny all compiler warnings. RUSTFLAGS: "-D warnings" jobs: @@ -23,7 +16,6 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 - # Install Rust and required components - uses: actions-rs/toolchain@v1 with: profile: minimal @@ -31,7 +23,6 @@ jobs: override: true components: rustfmt, clippy - # Cache. - name: Cargo cache registry, index and build uses: actions/cache@v2.1.4 with: @@ -41,14 +32,17 @@ jobs: target key: ${{ runner.os }}-cargo-cache-${{ hashFiles('**/Cargo.lock') }} - # Check if the code is formatted correctly. - name: Check formatting run: cargo fmt --all -- --check - # Run Clippy. - shell: bash run: ./scripts/clippy + - uses: maidsafe/verify-licensing-info@main + name: verify licensing + with: + company-name: MaidSafe + check_pr_size: if: "!startsWith(github.event.pull_request.title, 'Automated version bump')" name: Check PR size doesn't break set limit @@ -60,21 +54,19 @@ jobs: - uses: maidsafe/pr_size_checker@v2 with: max_lines_changed: 200 - + coverage: if: "!startsWith(github.event.pull_request.title, 'Automated version bump')" name: Code coverage check runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 - # Install Rust - uses: actions-rs/toolchain@v1 with: profile: minimal toolchain: stable override: true - # Cache. - name: Cargo cache registry, index and build uses: actions/cache@v2.1.4 with: @@ -84,7 +76,6 @@ jobs: target key: ${{ runner.os }}-cargo-cache-${{ hashFiles('**/Cargo.lock') }} - # Run cargo tarpaulin & push result to coveralls.io - name: rust-tarpaulin code coverage check uses: actions-rs/tarpaulin@v0.1 with: @@ -107,7 +98,6 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 - # Install Rust and required components - uses: actions-rs/toolchain@v1 with: toolchain: nightly @@ -125,7 +115,6 @@ jobs: steps: - uses: actions/checkout@v2 - # wget the shared deny.toml file from the QA repo - shell: bash run: wget https://raw.githubusercontent.com/maidsafe/QA/master/misc-scripts/deny.toml @@ -140,14 +129,12 @@ jobs: os: [ubuntu-latest, windows-latest, macOS-latest] steps: - uses: actions/checkout@v2 - # Install Rust - uses: actions-rs/toolchain@v1 with: profile: minimal toolchain: stable override: true - # Cache. - name: Cargo cache registry, index and build uses: actions/cache@v2.1.4 with: @@ -157,24 +144,20 @@ jobs: target key: ${{ runner.os }}-cargo-cache-${{ hashFiles('**/Cargo.lock') }} - # Run tests. - shell: bash run: ./scripts/tests - # Test publish using --dry-run. test-publish: if: "!startsWith(github.event.pull_request.title, 'Automated version bump')" name: Test Publish runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 - # Install Rust - uses: actions-rs/toolchain@v1 with: profile: minimal toolchain: stable override: true - # Cargo publish dry run - name: Cargo Publish Dry Run run: cargo publish --dry-run diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..e75cc48 --- /dev/null +++ b/LICENSE @@ -0,0 +1,29 @@ +BSD 3-Clause License + +Copyright (c) 2022, MaidSafe. +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + +2. Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + +3. Neither the name of the copyright holder nor the names of its + contributors may be used to endorse or promote products derived from + this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/LICENSE-BSD b/LICENSE-BSD deleted file mode 100644 index 42665e9..0000000 --- a/LICENSE-BSD +++ /dev/null @@ -1,11 +0,0 @@ -Copyright 2020 MaidSafe.net limited. - -Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: - -1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. - -2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. - -3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/LICENSE-MIT b/LICENSE-MIT deleted file mode 100644 index 31719f2..0000000 --- a/LICENSE-MIT +++ /dev/null @@ -1,7 +0,0 @@ -Copyright 2020 MaidSafe.net limited. - -Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/README.md b/README.md index 647f78d..a8c25a2 100644 --- a/README.md +++ b/README.md @@ -13,7 +13,9 @@ This algorithm is synchronous and will require participants are disqualified for ## License -This Safe Network library is dual-licensed under the Modified BSD ([LICENSE-BSD](LICENSE-BSD) https://opensource.org/licenses/BSD-3-Clause) or the MIT license ([LICENSE-MIT](LICENSE-MIT) http://opensource.org/licenses/MIT) at your option. +This Safe Network library is licensed under the BSD-3-Clause license. + +See the [LICENSE](LICENSE) file for more details. ## Contributing diff --git a/src/dev_utils/mod.rs b/src/dev_utils/mod.rs index 1d899a4..a1d70ae 100644 --- a/src/dev_utils/mod.rs +++ b/src/dev_utils/mod.rs @@ -1,11 +1,8 @@ -// Copyright 2020 MaidSafe.net limited. +// Copyright (c) 2022, MaidSafe. +// All rights reserved. // -// This SAFE Network Software is licensed to you under the MIT license or the Modified BSD license , at your option. This file may not be copied, -// modified, or distributed except according to those terms. Please review the Licences for the -// specific language governing permissions and limitations relating to use of the SAFE Network -// Software. +// This SAFE Network Software is licensed under the BSD-3-Clause license. +// Please see the LICENSE file for more details. mod peer; diff --git a/src/dev_utils/peer.rs b/src/dev_utils/peer.rs index 024d95e..e7f962f 100644 --- a/src/dev_utils/peer.rs +++ b/src/dev_utils/peer.rs @@ -1,11 +1,8 @@ -// Copyright 2020 MaidSafe.net limited. +// Copyright (c) 2022, MaidSafe. +// All rights reserved. // -// This SAFE Network Software is licensed to you under the MIT license or the Modified BSD license , at your option. This file may not be copied, -// modified, or distributed except according to those terms. Please review the Licences for the -// specific language governing permissions and limitations relating to use of the SAFE Network -// Software. +// This SAFE Network Software is licensed under the BSD-3-Clause license. +// Please see the LICENSE file for more details. use rand::Rng; use serde_derive::{Deserialize, Serialize}; diff --git a/src/key_gen/encryptor.rs b/src/key_gen/encryptor.rs index 93f908e..a746cd1 100644 --- a/src/key_gen/encryptor.rs +++ b/src/key_gen/encryptor.rs @@ -1,11 +1,8 @@ -// Copyright 2020 MaidSafe.net limited. +// Copyright (c) 2022, MaidSafe. +// All rights reserved. // -// This SAFE Network Software is licensed to you under the MIT license or the Modified BSD license , at your option. This file may not be copied, -// modified, or distributed except according to those terms. Please review the Licences for the -// specific language governing permissions and limitations relating to use of the SAFE Network -// Software. +// This SAFE Network Software is licensed under the BSD-3-Clause license. +// Please see the LICENSE file for more details. use super::Error; use aes::Aes128; diff --git a/src/key_gen/message.rs b/src/key_gen/message.rs index 6fbbf15..48753c6 100644 --- a/src/key_gen/message.rs +++ b/src/key_gen/message.rs @@ -1,11 +1,8 @@ -// Copyright 2020 MaidSafe.net limited. +// Copyright (c) 2022, MaidSafe. +// All rights reserved. // -// This SAFE Network Software is licensed to you under the MIT license or the Modified BSD license , at your option. This file may not be copied, -// modified, or distributed except according to those terms. Please review the Licences for the -// specific language governing permissions and limitations relating to use of the SAFE Network -// Software. +// This SAFE Network Software is licensed under the BSD-3-Clause license. +// Please see the LICENSE file for more details. use super::encryptor::{Iv, Key}; use super::{Acknowledgment, Part}; diff --git a/src/key_gen/mod.rs b/src/key_gen/mod.rs index 51b5677..16c365e 100644 --- a/src/key_gen/mod.rs +++ b/src/key_gen/mod.rs @@ -1,11 +1,8 @@ -// Copyright 2020 MaidSafe.net limited. +// Copyright (c) 2022, MaidSafe. +// All rights reserved. // -// This SAFE Network Software is licensed to you under the MIT license or the Modified BSD license , at your option. This file may not be copied, -// modified, or distributed except according to those terms. Please review the Licences for the -// specific language governing permissions and limitations relating to use of the SAFE Network -// Software. +// This SAFE Network Software is licensed under the BSD-3-Clause license. +// Please see the LICENSE file for more details. mod encryptor; pub mod message; diff --git a/src/key_gen/outcome.rs b/src/key_gen/outcome.rs index adb467e..a8d2b60 100644 --- a/src/key_gen/outcome.rs +++ b/src/key_gen/outcome.rs @@ -1,11 +1,8 @@ -// Copyright 2020 MaidSafe.net limited. +// Copyright (c) 2022, MaidSafe. +// All rights reserved. // -// This SAFE Network Software is licensed to you under the MIT license or the Modified BSD license , at your option. This file may not be copied, -// modified, or distributed except according to those terms. Please review the Licences for the -// specific language governing permissions and limitations relating to use of the SAFE Network -// Software. +// This SAFE Network Software is licensed under the BSD-3-Clause license. +// Please see the LICENSE file for more details. use std::fmt::{self, Debug, Formatter}; diff --git a/src/key_gen/rng_adapter.rs b/src/key_gen/rng_adapter.rs index 2fd7b63..52b2d0c 100644 --- a/src/key_gen/rng_adapter.rs +++ b/src/key_gen/rng_adapter.rs @@ -1,11 +1,8 @@ -// Copyright 2020 MaidSafe.net limited. +// Copyright (c) 2022, MaidSafe. +// All rights reserved. // -// This SAFE Network Software is licensed to you under the MIT license or the Modified BSD license , at your option. This file may not be copied, -// modified, or distributed except according to those terms. Please review the Licences for the -// specific language governing permissions and limitations relating to use of the SAFE Network -// Software. +// This SAFE Network Software is licensed under the BSD-3-Clause license. +// Please see the LICENSE file for more details. use rand::Rng; use rand_core::RngCore; diff --git a/src/key_gen/tests.rs b/src/key_gen/tests.rs index 98b1008..ac5e2c1 100644 --- a/src/key_gen/tests.rs +++ b/src/key_gen/tests.rs @@ -1,11 +1,8 @@ -// Copyright 2020 MaidSafe.net limited. +// Copyright (c) 2022, MaidSafe. +// All rights reserved. // -// This SAFE Network Software is licensed to you under the MIT license or the Modified BSD license , at your option. This file may not be copied, -// modified, or distributed except according to those terms. Please review the Licences for the -// specific language governing permissions and limitations relating to use of the SAFE Network -// Software. +// This SAFE Network Software is licensed under the BSD-3-Clause license. +// Please see the LICENSE file for more details. use crate::dev_utils::{create_ids, PeerId}; use crate::key_gen::{message::Message, Error, KeyGen, MessageAndTarget}; @@ -73,7 +70,7 @@ fn create_generators( fn messaging( mut rng: &mut R, - generators: &mut Vec, + generators: &mut [KeyGen], proposals: &mut Vec, non_responsives: BTreeSet, ) { diff --git a/src/lib.rs b/src/lib.rs index 7d6e764..1d3af72 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -1,11 +1,8 @@ -// Copyright 2020 MaidSafe.net limited. +// Copyright (c) 2022, MaidSafe. +// All rights reserved. // -// This SAFE Network Software is licensed to you under the MIT license or the Modified BSD license , at your option. This file may not be copied, -// modified, or distributed except according to those terms. Please review the Licences for the -// specific language governing permissions and limitations relating to use of the SAFE Network -// Software. +// This SAFE Network Software is licensed under the BSD-3-Clause license. +// Please see the LICENSE file for more details. #![doc( html_logo_url = "https://raw.githubusercontent.com/maidsafe/QA/master/Images/maidsafe_logo.png",