From f0c061f8caf8e75ef2e7c4c980f3681df7244b94 Mon Sep 17 00:00:00 2001 From: Nick Santana Date: Thu, 20 Apr 2023 14:12:44 -0700 Subject: [PATCH] Update repo with cookiecutter template --- .cruft.json | 37 ++++ .github/CODEOWNERS | 21 +- .github/auto_assign.yml | 12 +- .github/dependabot.yaml | 4 + .github/labeler.yml | 16 +- .github/pull_request_template.md | 7 - .github/settings.yml | 115 +++++++++++ ...triage-labeler.yml => triage-labeler.yaml} | 1 + .github/workflows/cargo-audit.yaml | 3 +- .github/workflows/ci.yaml | 191 ++++++++++++++---- .github/workflows/copyright.yaml | 16 +- .github/workflows/issues.yaml | 19 +- .github/workflows/pr-assign.yaml | 9 +- .github/workflows/pr.yaml | 30 +-- .gitignore | 4 +- CHANGELOG.md | 4 +- CLA.md | 29 +++ CODE_OF_CONDUCT.md | 2 +- Cargo.toml | 15 +- LICENSE | 2 + README.md | 10 +- alloc/Cargo.toml | 26 ++- alloc/README.md | 8 +- deny.toml | 5 +- io/Cargo.toml | 16 +- io/README.md | 6 +- io/untrusted/Cargo.toml | 16 +- io/untrusted/README.md | 6 +- panic/Cargo.toml | 16 +- panic/README.md | 6 +- panic/sys/Cargo.toml | 16 +- panic/sys/README.md | 6 +- sync/Cargo.toml | 16 +- sync/README.md | 6 +- 34 files changed, 516 insertions(+), 180 deletions(-) create mode 100644 .cruft.json create mode 100644 .github/settings.yml rename .github/{triage-labeler.yml => triage-labeler.yaml} (85%) create mode 100644 CLA.md diff --git a/.cruft.json b/.cruft.json new file mode 100644 index 0000000..3b7290d --- /dev/null +++ b/.cruft.json @@ -0,0 +1,37 @@ +{ + "template": "https://github.com/mobilecoinfoundation/cookiecutters", + "commit": "6fc71b377387fc5353883a9bb6ca21a4cb79b820", + "checkout": null, + "context": { + "cookiecutter": { + "_copy_without_render": [ + ".github/workflows/ci.yaml", + ".github/workflows/issues.yaml", + ".github/workflows/pr-assign.yaml", + ".github/workflows/pr.yaml" + ], + "repo_name": "sgx-std", + "repo_homepage": "https://mobilecoin.foundation/", + "github_org": "mobilecoinfoundation", + "github_teams": "coredev", + "github_username": "@nick-mobilecoin", + "default_branch": "main", + "owners": "@nick-mobilecoin @jcape @samdealy", + "type": "workspace", + "license": "Apache-2.0", + "arch": "sgx", + "workspace_description": "Rust libstd functionality for SGX enclaves", + "workspace_readme_title": "MobileCoin: Rust libstd functionality for SGX enclaves", + "crate_name": "mc-sgx-alloc", + "crate_namespace_prefix": "mc-sgx-", + "crate_description": "Allocator for SGX enclave", + "crate_readme_title": "MobileCoin: Allocator for SGX enclave", + "crate_sub_dir": "alloc", + "version": "0.1.0", + "crate_keywords": "sgx no-std alloc", + "crate_categories": "hardware-support no-std", + "_template": "https://github.com/mobilecoinfoundation/cookiecutters" + } + }, + "directory": "rust/repo" +} diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index 3001cf8..f7a7e78 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -1,7 +1,22 @@ +# These lines impact repository security +/.github/CODEOWNERS @nick-mobilecoin @jcape @samdealy +/.github/settings.yml @nick-mobilecoin @jcape @samdealy + +# These lines prevent reviews of trivial changes blocking on particular users +/.gitattributes +/.gitconfig +/.gitignore +/.markdownlint-cli2.jsonrc +/CHANGELOG.md +/Cargo.toml +/Cargo.lock +/LICENSE +/README.md +/deny.toml +/rust-toolchain.toml +/rustfmt.toml + /alloc/ @nick-mobilecoin @jcape @samdealy -/.github/ @jcape @nick-mobilecoin @samdealy /io/ @nick-mobilecoin @jcape @samdealy /panic/ @nick-mobilecoin @jcape @samdealy /sync/ @nick-mobilecoin @jcape @samdealy -/test_enclave/ @nick-mobilecoin @jcape @samdealy -/LICENSE @jcape @nick-mobilecoin @samdealy diff --git a/.github/auto_assign.yml b/.github/auto_assign.yml index 1c4ed37..1f988e6 100644 --- a/.github/auto_assign.yml +++ b/.github/auto_assign.yml @@ -1,11 +1,3 @@ -addReviewers: true +--- addAssignees: author -reviewers: - - jcape - - nick-mobilecoin - - awygle - - NotGyro - - samdealy - - varsha888 - -numberOfReviewers: 2 +runOnDraft: true diff --git a/.github/dependabot.yaml b/.github/dependabot.yaml index 9e95a1a..1d4c274 100644 --- a/.github/dependabot.yaml +++ b/.github/dependabot.yaml @@ -7,6 +7,8 @@ updates: interval: daily commit-message: prefix: "chore(deps)" + reviewers: + - "mobilecoinfoundation/coredev" - package-ecosystem: github-actions directory: "/" @@ -14,6 +16,8 @@ updates: interval: daily commit-message: prefix: "chore(deps)" + reviewers: + - "mobilecoinfoundation/coredev" ignore: # See https://github.com/dtolnay/rust-toolchain/issues/45 tags aren't used # by rust-toolchain. Using a branch name will cause dependabot to suggest diff --git a/.github/labeler.yml b/.github/labeler.yml index ecdd687..e0f9c24 100644 --- a/.github/labeler.yml +++ b/.github/labeler.yml @@ -1,12 +1,20 @@ +--- rust: - '**.rs' - '**/Cargo.lock' - '**/Cargo.toml' -dependencies: - - '**/Cargo.lock' - github_actions: - '.github/workflows/**' - '.github/labeler.yml' - - '.github/triage-labeler.yml' + - '.github/triage-labeler.yaml' + - '.github/auto_assign.yml' + +python: + - '**.py' + - '**/poetry.lock' + - '**/pyproject.toml' + - '**/requirements.txt' + +javascript: + - '**.js' diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md index e2d81e1..8685d92 100644 --- a/.github/pull_request_template.md +++ b/.github/pull_request_template.md @@ -3,10 +3,3 @@ ### Motivation - -### Future Work - - diff --git a/.github/settings.yml b/.github/settings.yml new file mode 100644 index 0000000..4dbe4c0 --- /dev/null +++ b/.github/settings.yml @@ -0,0 +1,115 @@ +--- +repository: + name: "sgx-std" + description: "Rust libstd functionality for SGX enclaves" + homepage: https://mobilecoin.foundation/ + topics: "hardware-support, no-std" + private: false + has_issues: true + has_projects: false + has_wiki: true + has_downloads: false + default_branch: main + allow_squash_merge: true + allow_merge_commit: false + allow_rebase_merge: false + allow_auto_merge: true + delete_branch_on_merge: true + use_squash_pr_title_as_default: true + enable_automated_security_fixes: true + enable_vulnerability_alerts: true + +labels: + - name: dependencies + color: '#0366d6' + description: Pull requests that update a dependency file + + - name: github_actions + color: '#000000' + description: Pull requests that update github actions + - name: go + color: '#29beb0' + description: Pull requests that update golang code + - name: javascript + color: '#f0db4f' + description: Pull requests that update javascript code + - name: python + color: '#4584b6' + description: Pull requests that update python code + - name: rust + color: '#f74c00' + description: Pull requests that update rust code + + - name: size/XS + color: '#00ed01' + description: Extra-Small PRs + - name: size/S + color: '#3af901' + description: Small PRs + - name: size/M + color: '#cefb02' + description: Medium-sized PRs + - name: size/L + color: '#ffde40' + description: Large PRs + - name: size/XL + color: '#ff9100' + description: Extra-Large PRs + - name: size/XXL + color: '#f24d11' + description: Double-wide PRs + - name: size/OHLAWDHECOMIN + color: '#ed1717' + description: PRs that should get broken down + +collaborators: + - username: meowblecoinbot + permission: triage + - username: nick-mobilecoin + permission: admin + - username: jcape + permission: admin + +teams: + - name: coredev + permission: push + +branches: + - name: main + # https://docs.github.com/en/rest/branches/branch-protection?apiVersion=2022-11-28 + protection: + required_pull_request_reviews: + require_code_owner_reviews: true + required_approving_review_count: 1 + required_conversation_resolution: true + required_status_checks: + strict: false + # These names need to match the matrix job name. + # For example if one had a job like: + # + # build: + # runs-on: ubuntu-22.04 + # needs: + # - lint + # strategy: + # matrix: + # rust: + # - stable + # - beta + # - nightly-2023-01-04 + # + # Then the matrix names would be: + # - "build (stable)" + # - "build (beta)" + # - "build (nightly-2023-01-04)" + contexts: + - lint + - "deny (bans licenses sources)" + - sort + - "clippy (stable)" + - "build (nightly-2023-01-04)" + - "test (nightly-2023-01-04)" + - "coverage (nightly-2023-01-04)" + enforce_admins: true + required_linear_history: true + restrictions: null diff --git a/.github/triage-labeler.yml b/.github/triage-labeler.yaml similarity index 85% rename from .github/triage-labeler.yml rename to .github/triage-labeler.yaml index 1aade66..79d7188 100644 --- a/.github/triage-labeler.yml +++ b/.github/triage-labeler.yaml @@ -1,2 +1,3 @@ +--- needs-triage: - '.*' diff --git a/.github/workflows/cargo-audit.yaml b/.github/workflows/cargo-audit.yaml index fdb6dbe..ee38bdc 100644 --- a/.github/workflows/cargo-audit.yaml +++ b/.github/workflows/cargo-audit.yaml @@ -1,5 +1,6 @@ +--- name: cargo-audit -on: +"on": pull_request: paths: Cargo.lock push: diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 61c7e53..b8a4def 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -1,6 +1,7 @@ +--- name: ci -on: +"on": push: branches: - 'main' @@ -9,83 +10,183 @@ on: env: CARGO_INCREMENTAL: 0 RUSTFLAGS: "-Dwarnings" - CARGO_UNSTABLE_SPARSE_REGISTRY: true jobs: - rustfmt: + # TODO: Fix automatically + lint: runs-on: ubuntu-22.04 steps: - uses: actions/checkout@v3 + with: + submodules: recursive - uses: dtolnay/rust-toolchain@stable with: components: rustfmt - uses: r7kamura/rust-problem-matchers@v1 - run: cargo fmt --all -- --check + - uses: xt0rted/markdownlint-problem-matcher@v2 + - uses: DavidAnson/markdownlint-cli2-action@v9 + with: + globs: "**/*.md" + # FIXME: Add yamllint problem matcher + - run: yamllint -s . - markdown-lint: + crev: runs-on: ubuntu-22.04 + needs: + - lint + # TODO: once we have enough reviews, make this a required check + continue-on-error: true + permissions: + contents: read + pull-requests: write steps: - uses: actions/checkout@v3 - - uses: xt0rted/markdownlint-problem-matcher@v2 - - uses: DavidAnson/markdownlint-cli2-action@v9 + with: + submodules: recursive + - uses: dtolnay/rust-toolchain@stable + - uses: actions/cache@v3 + continue-on-error: false + with: + path: | + Cargo.lock + ~/.cargo/bin/ + ~/.cargo/registry/index/ + ~/.cargo/registry/cache/ + ~/.cargo/git/db/ + key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.toml') }} + restore-keys: ${{ runner.os }}-cargo- + - uses: taiki-e/install-action@v2 + with: + # Pinning to 0.23 due to + # https://github.com/crev-dev/cargo-crev/issues/598 + tool: cargo-crev@0.23 + - name: Configure Crev + run: | + cargo crev trust \ + --level high \ + --no-commit https://github.com/mobilecoinfoundation/crev-proofs + - name: Run Cargo Crev + id: cargo-crev + run: | + set +e + export MARKER=$RANDOM + echo "UNREVIEWED_DEPENDENCIES<> $GITHUB_OUTPUT + # GH does not like colors in crev output + export TERM=xterm-mono + # - Get a TSV-formatted table of dependencies without reviews + # - Skip any "local" dependencies + # - Convert the table to GHF markdown + # - Sort descending by the "LoC" value (first column preceeds first + # pipe) + + cargo generate-lockfile --offline + cargo crev crate verify \ + --for-id vMr-9g5KzKQLsCpkp1tc8o7AR6a0OptjOICjf7NMyHE \ + --show-all \ + --skip-indirect \ + --skip-verified \ + --skip-known-owners \ + --trust medium \ + --thoroughness medium \ + --understanding medium \ + --redundancy 2 | \ + grep -v '^local ' | \ + awk '{ + printf("| %s | %s | %s | %s | %s | %s | %s |\n", + $14, $15, $2, $10, $11, $12, $13) + }' | \ + sort -t\| -n -k5 | \ + tee /dev/stderr >> $GITHUB_OUTPUT + STATUS=$? + echo "EOF${MARKER}" >> $GITHUB_OUTPUT + + set -e + + # TODO: When we're ready to make this required + # exit $STATUS + exit 0 + shell: bash + - uses: mshick/add-pr-comment@v2 + with: + # yamllint disable rule:line-length + message: | + #### :x: Unreviewed dependencies found + + | Crate | Version | Reviews (N/2) | LoC | Left-Pad Index | Geiger | Flags | + | ----- | ------- | ------------- | --- | -------------- | ------ | ----- | + ${{ steps.cargo-crev.outputs.UNREVIEWED_DEPENDENCIES }} + # yamllint enable rule:line-length deny: runs-on: ubuntu-22.04 needs: - - "rustfmt" - - "markdown-lint" + - lint strategy: matrix: checks: - advisories - bans licenses sources - # Prevent sudden announcement of a new advisory from failing ci: - continue-on-error: ${{ matrix.checks == 'advisories' }} + fail-fast: false steps: - - uses: actions/checkout@v3 - - uses: EmbarkStudios/cargo-deny-action@v1 - with: - command: check ${{ matrix.checks }} + - uses: actions/checkout@v3 + with: + submodules: recursive + - uses: dtolnay/rust-toolchain@stable + - uses: EmbarkStudios/cargo-deny-action@v1 + with: + command: check ${{ matrix.checks }} sort: runs-on: ubuntu-22.04 needs: - - "rustfmt" - - "markdown-lint" + - lint steps: - uses: actions/checkout@v3 - - run: cargo install cargo-sort - - run: cargo sort --workspace --check >/dev/null + with: + submodules: recursive + - uses: dtolnay/rust-toolchain@stable + - uses: taiki-e/install-action@v2 + with: + tool: cargo-sort + - run: cargo sort --workspace --grouped --check >/dev/null + # TODO: Fix automatically clippy: runs-on: ubuntu-22.04 needs: - - "rustfmt" - - "markdown-lint" + - lint strategy: matrix: rust: - - nightly-2023-01-04 + - stable + - beta + fail-fast: false steps: - uses: actions/checkout@v3 + with: + submodules: recursive - uses: dtolnay/rust-toolchain@master with: toolchain: ${{ matrix.rust }} components: clippy - uses: r7kamura/rust-problem-matchers@v1 - - run: cargo +${{ matrix.rust }} clippy --all --all-features -- -D warnings + - run: | + cargo +${{ matrix.rust }} clippy --all --all-features -- -D warnings + # TODO: Fix automatically, or post GH-suggestions comments build: runs-on: ubuntu-22.04 needs: - - "rustfmt" - - "markdown-lint" + - lint strategy: matrix: rust: - nightly-2023-01-04 steps: - uses: actions/checkout@v3 + with: + submodules: recursive - uses: mobilecoinfoundation/actions/sgxsdk@main with: version: 2.18.100.3 @@ -98,14 +199,15 @@ jobs: test: runs-on: ubuntu-22.04 needs: - - "rustfmt" - - "markdown-lint" + - lint strategy: matrix: rust: - nightly-2023-01-04 steps: - uses: actions/checkout@v3 + with: + submodules: recursive - uses: mobilecoinfoundation/actions/sgxsdk@main with: version: 2.18.100.3 @@ -118,8 +220,7 @@ jobs: doc: runs-on: ubuntu-22.04 needs: - - "rustfmt" - - "markdown-lint" + - lint strategy: matrix: rust: @@ -135,14 +236,15 @@ jobs: coverage: runs-on: ubuntu-22.04 needs: - - "rustfmt" - - "markdown-lint" + - lint strategy: matrix: rust: - nightly-2023-01-04 steps: - uses: actions/checkout@v3 + with: + submodules: recursive - uses: mobilecoinfoundation/actions/sgxsdk@main with: version: 2.18.100.3 @@ -150,18 +252,21 @@ jobs: with: toolchain: ${{ matrix.rust }} components: llvm-tools-preview - - uses: taiki-e/install-action@cargo-llvm-cov - - run: cargo +${{ matrix.rust }} llvm-cov --features sim --workspace --lcov --output-path lcov.info + - uses: taiki-e/install-action@v2 + with: + tool: cargo-llvm-cov + - run: | + cargo +${{ matrix.rust }} llvm-cov --features sim --workspace \ + --lcov --output-path lcov.info - uses: codecov/codecov-action@v3 with: files: lcov.info notify: runs-on: ubuntu-latest - if: failure() && ${{ github.event_name }} == 'push' + if: github.event_name == 'push' && failure() needs: - - rustfmt - - markdown-lint + - lint - deny - sort - clippy @@ -173,12 +278,18 @@ jobs: - name: Notify Discord on failure uses: sarisia/actions-status-discord@v1 with: + webhook: ${{ secrets.DISCORD_WEBHOOK }} username: "Github Actions" status: Failure + color: 0xff0000 nodetail: true - title: "Workflow: ${{ github.workflow }}" - url: ${{ github.repository_url }}/actions/runs/${{ github.run_id }} - description: | - [@${{ github.pusher }}](${{ github.url }}/${{ github.pusher }}] was the last one to touch ${{ github.repository }}, is all I'm saying... + # yamllint disable rule:line-length + title: "${{ github.repository }} ${{ github.workflow }} has failed on ${{ github.event_name }} to ${{ github.ref_name }}" + url: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }} + description: > + [`@${{ github.actor }}`](${{ github.server_url }}/${{ github.actor }}) + was the last one to touch + [that repository](${{ github.server_url }}/${{ github.repository }}), + is all I'm saying. avatar_url: "https://media0.giphy.com/media/oe33xf3B50fsc/200.gif" - webhook: ${{ secrets.DISCORD_WEBHOOK }} + # yamllint enable rule:line-length diff --git a/.github/workflows/copyright.yaml b/.github/workflows/copyright.yaml index 969c340..4f1b756 100644 --- a/.github/workflows/copyright.yaml +++ b/.github/workflows/copyright.yaml @@ -1,22 +1,28 @@ +--- name: copyright -on: +"on": schedule: - - cron: '0 3 1 1 *' # 03:00 AM on January 1 + - cron: '0 3 1 1 *' # 03:00 AM on January 1 jobs: update-license-year: runs-on: ubuntu-latest permissions: + contents: write pull-requests: write steps: - uses: actions/checkout@v3 + with: + submodules: recursive - uses: FantasticFiasco/action-update-license-year@v3 with: - token: ${{ secrets.GITHUB_TOKEN }} + token: ${{ secrets.MEOWBLECOIN_PAT }} path: | - '*.rs' - '*.proto' + **/*.rs + **/*.proto + # yamllint disable rule:line-length assignees: '@mobilecoinfoundation/coredev' + # yamllint enable rule:line-length labels: "copyright" transform: (?<=^\/\/ Copyright \(c\) )(?\d{4})?-?(\d{4})? diff --git a/.github/workflows/issues.yaml b/.github/workflows/issues.yaml index ec92aee..1989654 100644 --- a/.github/workflows/issues.yaml +++ b/.github/workflows/issues.yaml @@ -1,6 +1,7 @@ +--- name: issues -on: +"on": issues: types: - opened @@ -10,16 +11,12 @@ jobs: triage: runs-on: ubuntu-latest steps: - - uses: github/issue-labeler@v3.1 - with: - repo-token: "${{ secrets.GITHUB_TOKEN }}" - configuration-path: .github/triage-labeler.yml - enable-versioned-regex: 0 - - add-to-project: - runs-on: ubuntu-latest - steps: + - uses: github/issue-labeler@v3 + with: + repo-token: "${{ secrets.GITHUB_TOKEN }}" + configuration-path: .github/triage-labeler.yaml + enable-versioned-regex: 0 - uses: actions/add-to-project@v0.5.0 with: - github-token: "${{ secrets.ADD_TO_PROJECT_PAT }}" + github-token: "${{ secrets.MEOWBLECOIN_PAT }}" project-url: https://github.com/orgs/mobilecoinfoundation/projects/5 diff --git a/.github/workflows/pr-assign.yaml b/.github/workflows/pr-assign.yaml index bf72f7a..099d488 100644 --- a/.github/workflows/pr-assign.yaml +++ b/.github/workflows/pr-assign.yaml @@ -1,6 +1,7 @@ +--- name: pr-assign -on: +"on": pull_request: types: [opened, ready_for_review] @@ -8,6 +9,12 @@ jobs: auto-assign: runs-on: ubuntu-latest permissions: + contents: read pull-requests: write steps: - uses: kentaro-m/auto-assign-action@v1.2.5 + - uses: rowi1de/auto-assign-review-teams@v1.1.3 + with: + repo-token: ${{ secrets.MEOWBLECOIN_PAT }} + org: "mobilecoinfoundation" + teams: "coredev" diff --git a/.github/workflows/pr.yaml b/.github/workflows/pr.yaml index 84c7526..c6956a6 100644 --- a/.github/workflows/pr.yaml +++ b/.github/workflows/pr.yaml @@ -1,23 +1,20 @@ +--- name: pr -on: +"on": pull_request: jobs: - add-to-project: - runs-on: ubuntu-latest - steps: - - uses: actions/add-to-project@v0.5.0 - with: - github-token: "${{ secrets.ADD_TO_PROJECT_PAT }}" - project-url: https://github.com/orgs/mobilecoinfoundation/projects/5 - - size-label: + update-metadata: runs-on: ubuntu-latest permissions: contents: read pull-requests: write steps: + - uses: actions/add-to-project@v0.5.0 + with: + github-token: "${{ secrets.MEOWBLECOIN_PAT }}" + project-url: https://github.com/orgs/mobilecoinfoundation/projects/7 - uses: pascalgn/size-label-action@v0.4.3 env: GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}" @@ -32,13 +29,6 @@ jobs: "1000": "XXL", "1500": "OHLAWDHECOMIN" } - - label: - runs-on: ubuntu-latest - permissions: - contents: read - pull-requests: write - steps: - - uses: actions/labeler@v4 - with: - repo-token: "${{ secrets.GITHUB_TOKEN }}" + - uses: actions/labeler@v4 + with: + repo-token: "${{ secrets.GITHUB_TOKEN }}" diff --git a/.gitignore b/.gitignore index 767dae2..e7cc362 100644 --- a/.gitignore +++ b/.gitignore @@ -1,10 +1,10 @@ # Generated by Cargo # will have compiled files and executables -target/ +**/target/ # Remove Cargo.lock from gitignore if creating an executable, leave it for libraries # More information here https://doc.rust-lang.org/cargo/guide/cargo-toml-vs-cargo-lock.html -Cargo.lock +**/Cargo.lock # These are backup files generated by rustfmt **/*.rs.bk diff --git a/CHANGELOG.md b/CHANGELOG.md index 77322ce..27d201d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,5 +6,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). - ## [Unreleased] - ReleaseDate + + +[Unreleased]: https://github.com/mobilecoinfoundation/sgx-std/compare/v0.0.0...HEAD diff --git a/CLA.md b/CLA.md new file mode 100644 index 0000000..3e2d34d --- /dev/null +++ b/CLA.md @@ -0,0 +1,29 @@ +# Contributor License Agreement + +Thank you for your contribution to the MobileCoin project from MoblieCoin Inc. and the MobileCoin Foundation (“MobileCoin”). + +This contributor license agreement documents the rights granted by contributors to MobileCoin. This license is for your protection as a Contributor as well as the protection of MobileCoin, its users, and its licensees; you may still license your own Contributions under other terms. + +In exchange for the ability to participate in the MobileCoin community and for other good consideration, the receipt of which is hereby acknowledged, you accept and agree to the following terms and conditions for Your present and future Contributions submitted to MobileCoin. Except for the license granted herein to MobileCoin and recipients of software distributed by MobileCoin, You reserve all right, title, and interest in and to Your Contributions. + +1. Definitions. + + “You” (or “Your”) shall mean the copyright owner or legal entity authorized by the copyright owner that is making this Agreement with MobileCoin. For legal entities, the entity making a Contribution and all other entities that control, are controlled by, or are under common control with that entity are considered to be a single Contributor. For the purposes of this definition, “control” means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity. + + “Contribution” shall mean any original work of authorship or invention, including any modifications or additions to an existing work, that is intentionally submitted by You to MobileCoin for inclusion in, or documentation of, any of the products owned or managed by MobileCoin (the “Work”). For the purposes of this definition, “submitted” means any form of electronic, verbal, or written communication sent to MobileCoin or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, MobileCoin for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by You as “Not a Contribution.” + +1. Grant of Copyright License. Subject to the terms and conditions of this Agreement, You hereby grant to MobileCoin and to recipients of software distributed by MobileCoin a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare derivative works of, publicly display, publicly perform, and distribute Your Contributions and such derivative works, as well as the right to sublicense and have sublicensed all of the foregoing rights, through multiple tiers of sublicensees, provided that in all cases, MobileCoin will make Your Contributions available under an open source license. + + a. Moral Rights. If moral rights apply to the Contribution, to the maximum extent permitted by law, You waive and agree not to assert such moral rights against MobileCoin or its successors in interest, or any of MobileCoin’s licensees, either direct or indirect. + +1. Grant of Patent License. Subject to the terms and conditions of this Agreement, You hereby grant to MobileCoin and to recipients of software distributed by MobileCoin a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by You that are necessarily infringed by Your Contribution(s) alone or by combination of Your Contribution(s) with the Work to which such Contribution(s) was submitted. If any entity institutes patent litigation against You or any other entity (including a cross-claim or counterclaim in a lawsuit) alleging that your Contribution, or the Work to which you have contributed, constitutes direct or contributory patent infringement, then any patent licenses granted to that entity under this Agreement for that Contribution or Work shall terminate as of the date such litigation is filed. + +1. You represent that you are legally entitled to grant the above license. If your employer(s) has rights to intellectual property that you create that includes your Contributions, you represent that you have received permission to make Contributions on behalf of that employer, that your employer has waived such rights for your contributions to MobileCoin, or that your employer has executed with MobileCoin a separate contributor license agreement substantially similar to this Agreement. + +1. You represent that each of Your Contributions is Your original creation (see section 7 for submissions on behalf of others). You represent that Your Contribution submissions include complete details of any third-party license or other restriction (including, but not limited to, related patents and trademarks) of which you are personally aware and which are associated with any part of Your Contributions. + +1. You are not expected to provide support for Your Contributions, except to the extent You desire to provide support. You may provide support for free, for a fee, or not at all. Unless required by applicable law or agreed to in writing, You provide Your Contributions on an “AS IS” BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of title, non-infringement, merchantability, or fitness for a particular purpose. + +1. Should You wish to submit work that is not Your original creation, You may submit it to MobileCoin separately from any Contribution, identifying the complete details of its source and of any license or other restriction (including, but not limited to, related patents, trademarks, and license agreements) of which you are personally aware, and conspicuously marking the work as “Not a Contribution”. Third-party materials licensed pursuant to: [license name(s) here]” (substituting the bracketed text with the appropriate license name(s)). + +1. You agree to notify MobileCoin of any facts or circumstances of which you become aware that would make these representations inaccurate in any respect. diff --git a/CODE_OF_CONDUCT.md b/CODE_OF_CONDUCT.md index dc9b2fc..ef3ca57 100644 --- a/CODE_OF_CONDUCT.md +++ b/CODE_OF_CONDUCT.md @@ -59,7 +59,7 @@ representative at an online or offline event. ## Enforcement Instances of abusive, harassing, or otherwise unacceptable behavior may be -reported to the community leaders responsible for enforcement on [our Discord](https://mobilecoin.chat). +reported to the community leaders responsible for enforcement on [our Discord](https://discord.gg/mobilecoin). All complaints will be reviewed and investigated promptly and fairly. All community leaders are obligated to respect the privacy and security of the diff --git a/Cargo.toml b/Cargo.toml index 413307a..711d0aa 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -15,6 +15,13 @@ exclude = [ # We shouldn't have to per https://doc.rust-lang.org/edition-guide/rust-2021/default-cargo-resolver.html, but that does not appear to be the case resolver = "2" +[workspace.package] +authors = ["MobileCoin"] +edition = "2021" +license = "Apache-2.0" +repository = "https://github.com/mobilecoinfoundation/sgx-std" +rust-version = "1.68" + [profile.release] lto = "thin" @@ -24,11 +31,7 @@ dev-version-ext = "beta.0" consolidate-commits = true consolidate-pushes = true tag-name = "v{{version}}" - -# The file names in this key are relative to the each crate that gets released. -# So we only need one `README.md` entry if all the README's follow a -# common format and are always next to the Cargo.toml for their respective -# package. pre-release-replacements = [ - {file="README.md", search="mc-[a-z-]+/[0-9.]+", replace="{{crate_name}}/{{version}}"}, + # Files listed here must exist in all crates in this workspace + { file = "README.md", search = "mc-sgx-[a-z-]+/[0-9.]+", replace = "{{crate_name}}/{{version}}" }, ] diff --git a/LICENSE b/LICENSE index 261eeb9..6b0b127 100644 --- a/LICENSE +++ b/LICENSE @@ -1,3 +1,4 @@ + Apache License Version 2.0, January 2004 http://www.apache.org/licenses/ @@ -199,3 +200,4 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. + diff --git a/README.md b/README.md index 1b88443..7322374 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# MobileCoin SGX: libstd functionality +# MobileCoin: Rust libstd functionality for SGX enclaves [![Project Chat][chat-image]][chat-link]![License][license-image]", replace="\n## [Unreleased] - ReleaseDate\n", exactly = 1 }, + { file = "../../CHANGELOG.md", search = "", replace="\n[Unreleased]: https://github.com/mobilecoinfoundation/sgx-std/compare/{{tag_name}}...HEAD", exactly = 1 }, +] [dependencies] mc-sgx-tservice-sys = "0.6.0" diff --git a/alloc/README.md b/alloc/README.md index 809903d..399a678 100644 --- a/alloc/README.md +++ b/alloc/README.md @@ -1,8 +1,8 @@ -# MobileCoin SGX: Allocator +# MobileCoin: Allocator for SGX enclave [![Project Chat][chat-image]][chat-link]![License][license-image]![Target][target-image]![Architecture: sgx][arch-image][![Crates.io][crate-image]][crate-link][![Docs Status][docs-image]][docs-link][![Dependency Status][deps-image]][deps-link] @@ -10,9 +10,9 @@ Provide allocator for use in an SGX enclave [chat-image]: https://img.shields.io/discord/844353360348971068?style=flat-square -[chat-link]: https://mobilecoin.chat +[chat-link]: https://discord.gg/mobilecoin [license-image]: https://img.shields.io/crates/l/mc-sgx-alloc?style=flat-square -[target-image]: https://img.shields.io/badge/target-sgx-red?style=flat-square +[arch-image]: https://img.shields.io/badge/arch-sgx-red?style=flat-square [crate-image]: https://img.shields.io/crates/v/mc-sgx-alloc.svg?style=flat-square [crate-link]: https://crates.io/crates/mc-sgx-alloc [docs-image]: https://img.shields.io/docsrs/mc-sgx-alloc?style=flat-square diff --git a/deny.toml b/deny.toml index f32646f..e835b51 100644 --- a/deny.toml +++ b/deny.toml @@ -4,8 +4,9 @@ targets = [] db-path = "~/.cargo/advisory-db" db-urls = ["https://github.com/rustsec/advisory-db"] vulnerability = "deny" -unmaintained = "warn" -yanked = "warn" +unmaintained = "deny" +unsound = "deny" +yanked = "deny" notice = "warn" ignore = [] diff --git a/io/Cargo.toml b/io/Cargo.toml index aee9836..f5faf0a 100644 --- a/io/Cargo.toml +++ b/io/Cargo.toml @@ -1,15 +1,17 @@ [package] name = "mc-sgx-io" version = "0.1.1-beta.0" -edition = "2021" -authors = ["MobileCoin"] -rust-version = "1.62.1" -license = "Apache-2.0" -readme = "README.md" -repository = "https://github.com/mobilecoinfoundation/sgx-std" -description = "IO implementation for use inside of SGX enclaves" +authors = { workspace = true } +# See https://crates.io/category_slugs for valid categories categories = ["hardware-support", "no-std"] +description = "IO implementation for use inside of SGX enclaves" +edition = { workspace = true } +# See https://crates.io/keywords for the common keywords keywords = ["sgx", "no-std"] +license = { workspace = true } +readme = "README.md" +repository = { workspace = true } +rust-version = { workspace = true } [dependencies] mc-sgx-core-sys-types = "0.5.0" diff --git a/io/README.md b/io/README.md index fa78a4f..effe08f 100644 --- a/io/README.md +++ b/io/README.md @@ -2,7 +2,7 @@ [![Project Chat][chat-image]][chat-link]![License][license-image]![Target][target-image]![Architecture: sgx][arch-image][![Crates.io][crate-image]][crate-link][![Docs Status][docs-image]][docs-link][![Dependency Status][deps-image]][deps-link] @@ -10,9 +10,9 @@ Provide IO streams for use in an SGX enclave [chat-image]: https://img.shields.io/discord/844353360348971068?style=flat-square -[chat-link]: https://mobilecoin.chat +[chat-link]: https://discord.gg/mobilecoin [license-image]: https://img.shields.io/crates/l/mc-sgx-io?style=flat-square -[target-image]: https://img.shields.io/badge/target-sgx-red?style=flat-square +[arch-image]: https://img.shields.io/badge/arch-sgx-red?style=flat-square [crate-image]: https://img.shields.io/crates/v/mc-sgx-io.svg?style=flat-square [crate-link]: https://crates.io/crates/mc-sgx-io [docs-image]: https://img.shields.io/docsrs/mc-sgx-io?style=flat-square diff --git a/io/untrusted/Cargo.toml b/io/untrusted/Cargo.toml index 982b0cb..da7f3ec 100644 --- a/io/untrusted/Cargo.toml +++ b/io/untrusted/Cargo.toml @@ -1,15 +1,17 @@ [package] name = "mc-sgx-io-untrusted" version = "0.1.1-beta.0" -edition = "2021" -authors = ["MobileCoin"] -rust-version = "1.62.1" -license = "Apache-2.0" -readme = "README.md" -repository = "https://github.com/mobilecoinfoundation/sgx-std" -description = "Untrusted or host IO implementation for SGX enclaves" +authors = { workspace = true } +# See https://crates.io/category_slugs for valid categories categories = ["hardware-support"] +description = "Untrusted or host IO implementation for SGX enclaves" +edition = { workspace = true } +# See https://crates.io/keywords for the common keywords keywords = ["sgx"] +license = { workspace = true } +readme = "README.md" +repository = { workspace = true } +rust-version = { workspace = true } [features] sim = ["mc-sgx-urts/sim"] diff --git a/io/untrusted/README.md b/io/untrusted/README.md index 7e9f884..d349974 100644 --- a/io/untrusted/README.md +++ b/io/untrusted/README.md @@ -2,7 +2,7 @@ [![Project Chat][chat-image]][chat-link]![License][license-image]![Target][target-image]![Architecture: x86_64][arch-image][![Crates.io][crate-image]][crate-link][![Docs Status][docs-image]][docs-link][![Dependency Status][deps-image]][deps-link] @@ -10,9 +10,9 @@ Provide IO streams for the untrusted (host) side of an SGX enclave [chat-image]: https://img.shields.io/discord/844353360348971068?style=flat-square -[chat-link]: https://mobilecoin.chat +[chat-link]: https://discord.gg/mobilecoin [license-image]: https://img.shields.io/crates/l/mc-sgx-io-untrusted?style=flat-square -[target-image]: https://img.shields.io/badge/target-x86__64-blue?style=flat-square +[arch-image]: https://img.shields.io/badge/arch-x86__64-blue?style=flat-square [crate-image]: https://img.shields.io/crates/v/mc-sgx-io-untrusted.svg?style=flat-square [crate-link]: https://crates.io/crates/mc-sgx-io-untrusted [docs-image]: https://img.shields.io/docsrs/mc-sgx-io-untrusted?style=flat-square diff --git a/panic/Cargo.toml b/panic/Cargo.toml index b169a86..986e27d 100644 --- a/panic/Cargo.toml +++ b/panic/Cargo.toml @@ -1,15 +1,17 @@ [package] name = "mc-sgx-panic" version = "0.1.1-beta.0" -edition = "2021" -authors = ["MobileCoin"] -rust-version = "1.62.1" -license = "Apache-2.0" -readme = "README.md" -repository = "https://github.com/mobilecoinfoundation/sgx-std" -description = "Panic handler for SGX enclaves" +authors = { workspace = true } +# See https://crates.io/category_slugs for valid categories categories = ["hardware-support", "no-std"] +description = "Panic handler for SGX enclaves" +edition = { workspace = true } +# See https://crates.io/keywords for the common keywords keywords = ["sgx", "no-std", "panic"] +license = { workspace = true } +readme = "README.md" +repository = { workspace = true } +rust-version = { workspace = true } [features] log = ["dep:mc-sgx-io", "dep:mc-sgx-sync"] diff --git a/panic/README.md b/panic/README.md index 992d27a..e7cf2b7 100644 --- a/panic/README.md +++ b/panic/README.md @@ -2,7 +2,7 @@ [![Project Chat][chat-image]][chat-link]![License][license-image]![Target][target-image]![Architecture: sgx][arch-image][![Crates.io][crate-image]][crate-link][![Docs Status][docs-image]][docs-link][![Dependency Status][deps-image]][deps-link] @@ -19,9 +19,9 @@ directed to the host via [mc-sgx-io::stderr_write_all](https://docs.rs/mc-sgx-io/latest/mc_sgx_io/fn.stderr_write_all.html). [chat-image]: https://img.shields.io/discord/844353360348971068?style=flat-square -[chat-link]: https://mobilecoin.chat +[chat-link]: https://discord.gg/mobilecoin [license-image]: https://img.shields.io/crates/l/mc-sgx-panic?style=flat-square -[target-image]: https://img.shields.io/badge/target-sgx-red?style=flat-square +[arch-image]: https://img.shields.io/badge/arch-sgx-red?style=flat-square [crate-image]: https://img.shields.io/crates/v/mc-sgx-panic.svg?style=flat-square [crate-link]: https://crates.io/crates/mc-sgx-panic [docs-image]: https://img.shields.io/docsrs/mc-sgx-panic?style=flat-square diff --git a/panic/sys/Cargo.toml b/panic/sys/Cargo.toml index 08483f9..735539c 100644 --- a/panic/sys/Cargo.toml +++ b/panic/sys/Cargo.toml @@ -1,14 +1,16 @@ [package] name = "mc-sgx-panic-sys" version = "0.1.1-beta.0" -edition = "2021" -authors = ["MobileCoin"] -rust-version = "1.65" -license = "Apache-2.0" -readme = "README.md" -repository = "https://github.com/mobilecoinfoundation/sgx-std" -description = "Common panic handling behavior for SGX enclaves" +authors = { workspace = true } +# See https://crates.io/category_slugs for valid categories categories = ["hardware-support", "no-std"] +description = "Common panic handling behavior for SGX enclaves" +edition = { workspace = true } +# See https://crates.io/keywords for the common keywords keywords = ["sgx", "no-std", "panic"] +license = { workspace = true } +readme = "README.md" +repository = { workspace = true } +rust-version = { workspace = true } [dependencies] diff --git a/panic/sys/README.md b/panic/sys/README.md index 1e56ec7..e7a738e 100644 --- a/panic/sys/README.md +++ b/panic/sys/README.md @@ -2,7 +2,7 @@ [![Project Chat][chat-image]][chat-link]![License][license-image]![Target][target-image]![Architecture: X86_64][arch-image][![Crates.io][crate-image]][crate-link][![Docs Status][docs-image]][docs-link][![Dependency Status][deps-image]][deps-link] @@ -10,9 +10,9 @@ System specific logic for panic handling [chat-image]: https://img.shields.io/discord/844353360348971068?style=flat-square -[chat-link]: https://mobilecoin.chat +[chat-link]: https://discord.gg/mobilecoin [license-image]: https://img.shields.io/crates/l/mc-sgx-panic-sys?style=flat-square -[target-image]: https://img.shields.io/badge/target-x86__64-blue?style=flat-square +[arch-image]: https://img.shields.io/badge/arch-x86__64-blue?style=flat-square [crate-image]: https://img.shields.io/crates/v/mc-sgx-panic-sys.svg?style=flat-square [crate-link]: https://crates.io/crates/mc-sgx-panic-sys [docs-image]: https://img.shields.io/docsrs/mc-sgx-panic-sys?style=flat-square diff --git a/sync/Cargo.toml b/sync/Cargo.toml index 21f1933..69caf21 100644 --- a/sync/Cargo.toml +++ b/sync/Cargo.toml @@ -1,15 +1,17 @@ [package] name = "mc-sgx-sync" version = "0.1.1-beta.0" -edition = "2021" -authors = ["MobileCoin"] -rust-version = "1.62.1" -license = "Apache-2.0" -readme = "README.md" -repository = "https://github.com/mobilecoinfoundation/sgx-std" -description = "Synchronization primitives for SGX enclaves" +authors = { workspace = true } +# See https://crates.io/category_slugs for valid categories categories = ["hardware-support", "no-std"] +description = "Synchronization primitives for SGX enclaves" +edition = { workspace = true } +# See https://crates.io/keywords for the common keywords keywords = ["sgx", "no-std"] +license = { workspace = true } +readme = "README.md" +repository = { workspace = true } +rust-version = { workspace = true } [lib] # test false due to needing an enclave to fully link diff --git a/sync/README.md b/sync/README.md index e46a0fe..f43658a 100644 --- a/sync/README.md +++ b/sync/README.md @@ -2,7 +2,7 @@ [![Project Chat][chat-image]][chat-link]![License][license-image]![Target][target-image]![Architecture: sgx][arch-image][![Crates.io][crate-image]][crate-link][![Docs Status][docs-image]][docs-link][![Dependency Status][deps-image]][deps-link] @@ -98,9 +98,9 @@ and are usually the only crates that directly depend on the `mc-sgx--sys` crates. [chat-image]: https://img.shields.io/discord/844353360348971068?style=flat-square -[chat-link]: https://mobilecoin.chat +[chat-link]: https://discord.gg/mobilecoin [license-image]: https://img.shields.io/crates/l/mc-sgx-sync?style=flat-square -[target-image]: https://img.shields.io/badge/target-sgx-red?style=flat-square +[arch-image]: https://img.shields.io/badge/arch-sgx-red?style=flat-square [crate-image]: https://img.shields.io/crates/v/mc-sgx-sync.svg?style=flat-square [crate-link]: https://crates.io/crates/mc-sgx-sync [docs-image]: https://img.shields.io/docsrs/mc-sgx-sync?style=flat-square