From b67732bf9cc49caad0c78db73ab4309bb51fe8cc Mon Sep 17 00:00:00 2001 From: William Woodruff Date: Sat, 9 Dec 2023 19:01:30 -0500 Subject: [PATCH 01/31] release: remove old gh-action-sigstore-python setting No longer present on newer versions. --- .github/workflows/release.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 7b3c4c1..a4df5a7 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -104,4 +104,3 @@ jobs: with: inputs: ./dist/*.tar.gz ./dist/*.whl release-signing-artifacts: true - bundle-only: true From f6133348670b8e63d9b0fcb245a43775b1cf5796 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 11 Dec 2023 10:00:00 -0500 Subject: [PATCH 02/31] build(deps): bump actions/setup-python from 4 to 5 (#49) Bumps [actions/setup-python](https://github.com/actions/setup-python) from 4 to 5. - [Release notes](https://github.com/actions/setup-python/releases) - [Commits](https://github.com/actions/setup-python/compare/v4...v5) --- updated-dependencies: - dependency-name: actions/setup-python dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .github/workflows/ci.yml | 2 +- .github/workflows/release-stubs.yml | 2 +- .github/workflows/release.yml | 6 +++--- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 3313c16..3a34497 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -35,7 +35,7 @@ jobs: steps: - uses: actions/checkout@v4 - - uses: actions/setup-python@v4 + - uses: actions/setup-python@v5 with: python-version: ${{ matrix.python }} diff --git a/.github/workflows/release-stubs.yml b/.github/workflows/release-stubs.yml index 605f7cd..4d4ed05 100644 --- a/.github/workflows/release-stubs.yml +++ b/.github/workflows/release-stubs.yml @@ -15,7 +15,7 @@ jobs: steps: - uses: actions/checkout@v4 - - uses: actions/setup-python@v4 + - uses: actions/setup-python@v5 with: python-version-file: pyproject.toml diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index a4df5a7..f01dbfd 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -12,7 +12,7 @@ jobs: steps: - uses: actions/checkout@v4 - - uses: actions/setup-python@v4 + - uses: actions/setup-python@v5 with: python-version-file: pyproject.toml @@ -31,7 +31,7 @@ jobs: steps: - uses: actions/checkout@v4 - - uses: actions/setup-python@v4 + - uses: actions/setup-python@v5 with: python-version-file: pyproject.toml @@ -55,7 +55,7 @@ jobs: steps: - uses: actions/checkout@v4 - - uses: actions/setup-python@v4 + - uses: actions/setup-python@v5 with: python-version-file: pyproject.toml From 5af7506ed629823a9b22f78407387ba08f66acd7 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 18 Dec 2023 12:10:35 -0500 Subject: [PATCH 03/31] build(deps): bump sigstore/gh-action-sigstore-python from 2.1.0 to 2.1.1 (#51) Bumps [sigstore/gh-action-sigstore-python](https://github.com/sigstore/gh-action-sigstore-python) from 2.1.0 to 2.1.1. - [Release notes](https://github.com/sigstore/gh-action-sigstore-python/releases) - [Commits](https://github.com/sigstore/gh-action-sigstore-python/compare/v2.1.0...v2.1.1) --- updated-dependencies: - dependency-name: sigstore/gh-action-sigstore-python dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .github/workflows/release.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index f01dbfd..8521234 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -100,7 +100,7 @@ jobs: uses: pypa/gh-action-pypi-publish@v1.8.11 - name: sign - uses: sigstore/gh-action-sigstore-python@v2.1.0 + uses: sigstore/gh-action-sigstore-python@v2.1.1 with: inputs: ./dist/*.tar.gz ./dist/*.whl release-signing-artifacts: true From d522f9779933f3b121088278d0c3973a8bbdebed Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 17 Jan 2024 22:32:05 -0500 Subject: [PATCH 04/31] build(deps): bump actions/upload-artifact from 3 to 4 (#52) Bumps [actions/upload-artifact](https://github.com/actions/upload-artifact) from 3 to 4. - [Release notes](https://github.com/actions/upload-artifact/releases) - [Commits](https://github.com/actions/upload-artifact/compare/v3...v4) --- updated-dependencies: - dependency-name: actions/upload-artifact dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .github/workflows/release-stubs.yml | 2 +- .github/workflows/release.yml | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/release-stubs.yml b/.github/workflows/release-stubs.yml index 4d4ed05..1f1646f 100644 --- a/.github/workflows/release-stubs.yml +++ b/.github/workflows/release-stubs.yml @@ -24,7 +24,7 @@ jobs: make dist-pyrage-stubs - name: upload dists - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: name: dist path: dist/ diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 8521234..2c32798 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -20,7 +20,7 @@ jobs: run: make dist-pyrage - name: upload linux dists - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: name: pyrage-dists path: dist/ @@ -44,7 +44,7 @@ jobs: mv target/wheels/ dist/ - name: upload macos dists - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: name: pyrage-dists path: dist/ @@ -68,7 +68,7 @@ jobs: mv target/wheels/ dist/ - name: upload windows dists - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: name: pyrage-dists path: dist/ From 2ed80eb4bba8e50c42d9b8a64ed6330b0585466e Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 17 Jan 2024 22:32:12 -0500 Subject: [PATCH 05/31] build(deps): bump actions/download-artifact from 3 to 4 (#50) Bumps [actions/download-artifact](https://github.com/actions/download-artifact) from 3 to 4. - [Release notes](https://github.com/actions/download-artifact/releases) - [Commits](https://github.com/actions/download-artifact/compare/v3...v4) --- updated-dependencies: - dependency-name: actions/download-artifact dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .github/workflows/release-stubs.yml | 2 +- .github/workflows/release.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/release-stubs.yml b/.github/workflows/release-stubs.yml index 1f1646f..b476ece 100644 --- a/.github/workflows/release-stubs.yml +++ b/.github/workflows/release-stubs.yml @@ -41,7 +41,7 @@ jobs: steps: - name: fetch dists - uses: actions/download-artifact@v3 + uses: actions/download-artifact@v4 with: name: dist path: dist/ diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 2c32798..3733e6b 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -91,7 +91,7 @@ jobs: steps: - name: fetch dists - uses: actions/download-artifact@v3 + uses: actions/download-artifact@v4 with: name: pyrage-dists path: dist/ From 3a5abcb2486d2e3d836e341cc0ae7baed71482f8 Mon Sep 17 00:00:00 2001 From: William Woodruff Date: Wed, 17 Jan 2024 22:33:23 -0500 Subject: [PATCH 06/31] dependabot: groups --- .github/dependabot.yml | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/.github/dependabot.yml b/.github/dependabot.yml index 9416735..34f43f3 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -5,8 +5,16 @@ updates: directory: / schedule: interval: weekly + groups: + actions: + patterns: + - "*" - package-ecosystem: cargo directory: "/" schedule: interval: weekly + groups: + cargo: + patterns: + - "*" From 8d303f5c4fa975192ff80721720753995627a999 Mon Sep 17 00:00:00 2001 From: William Woodruff Date: Wed, 17 Jan 2024 22:43:26 -0500 Subject: [PATCH 07/31] workflows/release: fix @v4 artifact action usage (#53) --- .github/workflows/release.yml | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 3733e6b..5a1e5bf 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -22,7 +22,7 @@ jobs: - name: upload linux dists uses: actions/upload-artifact@v4 with: - name: pyrage-dists + name: pyrage-dists-linux path: dist/ release-macos: @@ -46,7 +46,7 @@ jobs: - name: upload macos dists uses: actions/upload-artifact@v4 with: - name: pyrage-dists + name: pyrage-dists-macos path: dist/ release-windows: @@ -70,7 +70,7 @@ jobs: - name: upload windows dists uses: actions/upload-artifact@v4 with: - name: pyrage-dists + name: pyrage-dists-windows path: dist/ pypi-publish: @@ -93,8 +93,9 @@ jobs: - name: fetch dists uses: actions/download-artifact@v4 with: - name: pyrage-dists + pattern: pyrage-dists-* path: dist/ + merge-multiple: true - name: publish uses: pypa/gh-action-pypi-publish@v1.8.11 From ea3f9db5db41b1b6fce170f531c8e9eda9779d46 Mon Sep 17 00:00:00 2001 From: William Woodruff Date: Wed, 17 Jan 2024 22:43:44 -0500 Subject: [PATCH 08/31] chore: Release pyrage version 1.1.3-rc.1 --- Cargo.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Cargo.toml b/Cargo.toml index e699b26..bb14548 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "pyrage" -version = "1.1.2" +version = "1.1.3-rc.1" authors = ["William Woodruff "] edition = "2021" description = "Python bindings for rage (age in Rust)" From 55e91453a6bbd519ef7ec3d0f6ae58d04ddafdec Mon Sep 17 00:00:00 2001 From: William Woodruff Date: Sun, 28 Jan 2024 17:21:37 -0500 Subject: [PATCH 09/31] check in Cargo.lock (#57) Closes #54. --- .gitignore | 1 - Cargo.lock | 1522 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 1522 insertions(+), 1 deletion(-) create mode 100644 Cargo.lock diff --git a/.gitignore b/.gitignore index 4bc4de8..143c41e 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,4 @@ /target -Cargo.lock /env __pycache__ *.pyc diff --git a/Cargo.lock b/Cargo.lock new file mode 100644 index 0000000..c2f6568 --- /dev/null +++ b/Cargo.lock @@ -0,0 +1,1522 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +version = 3 + +[[package]] +name = "aead" +version = "0.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d122413f284cf2d62fb1b7db97e02edb8cda96d769b16e443a4f6195e35662b0" +dependencies = [ + "crypto-common", + "generic-array", +] + +[[package]] +name = "aes" +version = "0.8.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ac1f845298e95f983ff1944b728ae08b8cebab80d684f0a832ed0fc74dfa27e2" +dependencies = [ + "cfg-if", + "cipher", + "cpufeatures", +] + +[[package]] +name = "aes-gcm" +version = "0.10.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "831010a0f742e1209b3bcea8fab6a8e149051ba6099432c8cb2cc117dec3ead1" +dependencies = [ + "aead", + "aes", + "cipher", + "ctr", + "ghash", + "subtle", +] + +[[package]] +name = "age" +version = "0.9.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6d55a4d912c80a92762ffd1c884065f3f9646467d22c95390e824a0ff7def472" +dependencies = [ + "aes", + "aes-gcm", + "age-core", + "base64", + "bcrypt-pbkdf", + "bech32", + "cbc", + "chacha20poly1305", + "cipher", + "cookie-factory", + "ctr", + "curve25519-dalek", + "hkdf", + "hmac", + "i18n-embed", + "i18n-embed-fl", + "lazy_static", + "nom", + "num-traits", + "pin-project", + "rand 0.7.3", + "rand 0.8.5", + "rsa", + "rust-embed", + "scrypt", + "sha2", + "subtle", + "x25519-dalek", + "zeroize", +] + +[[package]] +name = "age-core" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e3d2e815ac879dc23c1139e720d21c6cd4d1276345c772587285d965a69b8f32" +dependencies = [ + "base64", + "chacha20poly1305", + "cookie-factory", + "hkdf", + "io_tee", + "nom", + "rand 0.8.5", + "secrecy", + "sha2", +] + +[[package]] +name = "arc-swap" +version = "1.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bddcadddf5e9015d310179a59bb28c4d4b9920ad0f11e8e14dbadf654890c9a6" + +[[package]] +name = "autocfg" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa" + +[[package]] +name = "base64" +version = "0.13.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9e1b586273c5702936fe7b7d6896644d8be71e6314cfe09d3167c95f712589e8" + +[[package]] +name = "base64ct" +version = "1.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8c3c1a368f70d6cf7302d78f8f7093da241fb8e8807c05cc9e51a125895a6d5b" + +[[package]] +name = "bcrypt-pbkdf" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3806a8db60cf56efee531616a34a6aaa9a114d6da2add861b0fa4a188881b2c7" +dependencies = [ + "blowfish", + "pbkdf2", + "sha2", +] + +[[package]] +name = "bech32" +version = "0.9.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d86b93f97252c47b41663388e6d155714a9d0c398b99f1005cbc5f978b29f445" + +[[package]] +name = "bitflags" +version = "1.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" + +[[package]] +name = "block-buffer" +version = "0.10.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3078c7629b62d3f0439517fa394996acacc5cbc91c5a20d8c658e77abd503a71" +dependencies = [ + "generic-array", +] + +[[package]] +name = "block-padding" +version = "0.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a8894febbff9f758034a5b8e12d87918f56dfc64a8e1fe757d65e29041538d93" +dependencies = [ + "generic-array", +] + +[[package]] +name = "blowfish" +version = "0.9.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e412e2cd0f2b2d93e02543ceae7917b3c70331573df19ee046bcbc35e45e87d7" +dependencies = [ + "byteorder", + "cipher", +] + +[[package]] +name = "byteorder" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b" + +[[package]] +name = "cbc" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "26b52a9543ae338f279b96b0b9fed9c8093744685043739079ce85cd58f289a6" +dependencies = [ + "cipher", +] + +[[package]] +name = "cfg-if" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" + +[[package]] +name = "chacha20" +version = "0.9.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c3613f74bd2eac03dad61bd53dbe620703d4371614fe0bc3b9f04dd36fe4e818" +dependencies = [ + "cfg-if", + "cipher", + "cpufeatures", +] + +[[package]] +name = "chacha20poly1305" +version = "0.10.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "10cd79432192d1c0f4e1a0fef9527696cc039165d729fb41b3f4f4f354c2dc35" +dependencies = [ + "aead", + "chacha20", + "cipher", + "poly1305", + "zeroize", +] + +[[package]] +name = "cipher" +version = "0.4.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "773f3b9af64447d2ce9850330c473515014aa235e6a783b02db81ff39e4a3dad" +dependencies = [ + "crypto-common", + "inout", + "zeroize", +] + +[[package]] +name = "const-oid" +version = "0.9.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "28c122c3980598d243d63d9a704629a2d748d101f278052ff068be5a4423ab6f" + +[[package]] +name = "cookie-factory" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "396de984970346b0d9e93d1415082923c679e5ae5c3ee3dcbd104f5610af126b" + +[[package]] +name = "cpufeatures" +version = "0.2.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ce420fe07aecd3e67c5f910618fe65e94158f6dcc0adf44e00d69ce2bdfe0fd0" +dependencies = [ + "libc", +] + +[[package]] +name = "crypto-common" +version = "0.1.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1bfb12502f3fc46cca1bb51ac28df9d618d813cdc3d2f25b9fe775a34af26bb3" +dependencies = [ + "generic-array", + "rand_core 0.6.4", + "typenum", +] + +[[package]] +name = "ctr" +version = "0.9.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0369ee1ad671834580515889b80f2ea915f23b8be8d0daa4bbaf2ac5c7590835" +dependencies = [ + "cipher", +] + +[[package]] +name = "curve25519-dalek" +version = "3.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0b9fdf9972b2bd6af2d913799d9ebc165ea4d2e65878e329d9c6b372c4491b61" +dependencies = [ + "byteorder", + "digest 0.9.0", + "rand_core 0.5.1", + "subtle", + "zeroize", +] + +[[package]] +name = "dashmap" +version = "5.5.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "978747c1d849a7d2ee5e8adc0159961c48fb7e5db2f06af6723b80123bb53856" +dependencies = [ + "cfg-if", + "hashbrown", + "lock_api", + "once_cell", + "parking_lot_core", +] + +[[package]] +name = "der" +version = "0.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f1a467a65c5e759bce6e65eaf91cc29f466cdc57cb65777bd646872a8a1fd4de" +dependencies = [ + "const-oid", + "zeroize", +] + +[[package]] +name = "digest" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d3dd60d1080a57a05ab032377049e0591415d2b31afd7028356dbf3cc6dcb066" +dependencies = [ + "generic-array", +] + +[[package]] +name = "digest" +version = "0.10.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9ed9a281f7bc9b7576e61468ba615a66a5c8cfdff42420a70aa82701a3b1e292" +dependencies = [ + "block-buffer", + "const-oid", + "crypto-common", + "subtle", +] + +[[package]] +name = "displaydoc" +version = "0.2.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "487585f4d0c6655fe74905e2504d8ad6908e4db67f744eb140876906c2f3175d" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.39", +] + +[[package]] +name = "equivalent" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5" + +[[package]] +name = "find-crate" +version = "0.6.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "59a98bbaacea1c0eb6a0876280051b892eb73594fd90cf3b20e9c817029c57d2" +dependencies = [ + "toml 0.5.11", +] + +[[package]] +name = "fluent" +version = "0.16.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "61f69378194459db76abd2ce3952b790db103ceb003008d3d50d97c41ff847a7" +dependencies = [ + "fluent-bundle", + "unic-langid", +] + +[[package]] +name = "fluent-bundle" +version = "0.15.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e242c601dec9711505f6d5bbff5bedd4b61b2469f2e8bb8e57ee7c9747a87ffd" +dependencies = [ + "fluent-langneg", + "fluent-syntax", + "intl-memoizer", + "intl_pluralrules", + "rustc-hash", + "self_cell 0.10.3", + "smallvec", + "unic-langid", +] + +[[package]] +name = "fluent-langneg" +version = "0.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2c4ad0989667548f06ccd0e306ed56b61bd4d35458d54df5ec7587c0e8ed5e94" +dependencies = [ + "unic-langid", +] + +[[package]] +name = "fluent-syntax" +version = "0.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c0abed97648395c902868fee9026de96483933faa54ea3b40d652f7dfe61ca78" +dependencies = [ + "thiserror", +] + +[[package]] +name = "generic-array" +version = "0.14.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "85649ca51fd72272d7821adaf274ad91c288277713d9c18820d8499a7ff69e9a" +dependencies = [ + "typenum", + "version_check", +] + +[[package]] +name = "getrandom" +version = "0.1.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8fc3cb4d91f53b50155bdcfd23f6a4c39ae1969c2ae85982b135750cccaf5fce" +dependencies = [ + "cfg-if", + "libc", + "wasi 0.9.0+wasi-snapshot-preview1", +] + +[[package]] +name = "getrandom" +version = "0.2.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fe9006bed769170c11f845cf00c7c1e9092aeb3f268e007c3e760ac68008070f" +dependencies = [ + "cfg-if", + "libc", + "wasi 0.11.0+wasi-snapshot-preview1", +] + +[[package]] +name = "ghash" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d930750de5717d2dd0b8c0d42c076c0e884c81a73e6cab859bbd2339c71e3e40" +dependencies = [ + "opaque-debug", + "polyval", +] + +[[package]] +name = "hashbrown" +version = "0.14.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "290f1a1d9242c78d09ce40a5e87e7554ee637af1351968159f4952f028f75604" + +[[package]] +name = "heck" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "95505c38b4572b2d910cecb0281560f54b440a19336cbbcb27bf6ce6adc6f5a8" + +[[package]] +name = "hkdf" +version = "0.12.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "791a029f6b9fc27657f6f188ec6e5e43f6911f6f878e0dc5501396e09809d437" +dependencies = [ + "hmac", +] + +[[package]] +name = "hmac" +version = "0.12.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6c49c37c09c17a53d937dfbb742eb3a961d65a994e6bcdcf37e7399d0cc8ab5e" +dependencies = [ + "digest 0.10.7", +] + +[[package]] +name = "i18n-config" +version = "0.4.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0c9ce3c48cbc21fd5b22b9331f32b5b51f6ad85d969b99e793427332e76e7640" +dependencies = [ + "log", + "serde", + "serde_derive", + "thiserror", + "toml 0.8.8", + "unic-langid", +] + +[[package]] +name = "i18n-embed" +version = "0.13.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "92a86226a7a16632de6723449ee5fe70bac5af718bc642ee9ca2f0f6e14fa1fa" +dependencies = [ + "arc-swap", + "fluent", + "fluent-langneg", + "fluent-syntax", + "i18n-embed-impl", + "intl-memoizer", + "lazy_static", + "log", + "parking_lot", + "rust-embed", + "thiserror", + "unic-langid", + "walkdir", +] + +[[package]] +name = "i18n-embed-fl" +version = "0.6.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d26a3d3569737dfaac7fc1c4078e6af07471c3060b8e570bcd83cdd5f4685395" +dependencies = [ + "dashmap", + "find-crate", + "fluent", + "fluent-syntax", + "i18n-config", + "i18n-embed", + "lazy_static", + "proc-macro-error", + "proc-macro2", + "quote", + "strsim", + "syn 2.0.39", + "unic-langid", +] + +[[package]] +name = "i18n-embed-impl" +version = "0.8.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "81093c4701672f59416582fe3145676126fd23ba5db910acad0793c1108aaa58" +dependencies = [ + "find-crate", + "i18n-config", + "proc-macro2", + "quote", + "syn 2.0.39", +] + +[[package]] +name = "indexmap" +version = "2.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d530e1a18b1cb4c484e6e34556a0d948706958449fca0cab753d649f2bce3d1f" +dependencies = [ + "equivalent", + "hashbrown", +] + +[[package]] +name = "indoc" +version = "2.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e186cfbae8084e513daff4240b4797e342f988cecda4fb6c939150f96315fd8" + +[[package]] +name = "inout" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a0c10553d664a4d0bcff9f4215d0aac67a639cc68ef660840afe309b807bc9f5" +dependencies = [ + "block-padding", + "generic-array", +] + +[[package]] +name = "intl-memoizer" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c310433e4a310918d6ed9243542a6b83ec1183df95dff8f23f87bb88a264a66f" +dependencies = [ + "type-map", + "unic-langid", +] + +[[package]] +name = "intl_pluralrules" +version = "7.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "078ea7b7c29a2b4df841a7f6ac8775ff6074020c6776d48491ce2268e068f972" +dependencies = [ + "unic-langid", +] + +[[package]] +name = "io_tee" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4b3f7cef34251886990511df1c61443aa928499d598a9473929ab5a90a527304" + +[[package]] +name = "lazy_static" +version = "1.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" +dependencies = [ + "spin", +] + +[[package]] +name = "libc" +version = "0.2.150" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "89d92a4743f9a61002fae18374ed11e7973f530cb3a3255fb354818118b2203c" + +[[package]] +name = "libm" +version = "0.2.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4ec2a862134d2a7d32d7983ddcdd1c4923530833c9f2ea1a44fc5fa473989058" + +[[package]] +name = "lock_api" +version = "0.4.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3c168f8615b12bc01f9c17e2eb0cc07dcae1940121185446edc3744920e8ef45" +dependencies = [ + "autocfg", + "scopeguard", +] + +[[package]] +name = "log" +version = "0.4.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b5e6163cb8c49088c2c36f57875e58ccd8c87c7427f7fbd50ea6710b2f3f2e8f" + +[[package]] +name = "memchr" +version = "2.6.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f665ee40bc4a3c5590afb1e9677db74a508659dfd71e126420da8274909a0167" + +[[package]] +name = "memoffset" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5a634b1c61a95585bd15607c6ab0c4e5b226e695ff2800ba0cdccddf208c406c" +dependencies = [ + "autocfg", +] + +[[package]] +name = "minimal-lexical" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "68354c5c6bd36d73ff3feceb05efa59b6acb7626617f4962be322a825e61f79a" + +[[package]] +name = "nom" +version = "7.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d273983c5a657a70a3e8f2a01329822f3b8c8172b73826411a55751e404a0a4a" +dependencies = [ + "memchr", + "minimal-lexical", +] + +[[package]] +name = "num-bigint-dig" +version = "0.8.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dc84195820f291c7697304f3cbdadd1cb7199c0efc917ff5eafd71225c136151" +dependencies = [ + "byteorder", + "lazy_static", + "libm", + "num-integer", + "num-iter", + "num-traits", + "rand 0.8.5", + "smallvec", + "zeroize", +] + +[[package]] +name = "num-integer" +version = "0.1.45" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "225d3389fb3509a24c93f5c29eb6bde2586b98d9f016636dff58d7c6f7569cd9" +dependencies = [ + "autocfg", + "num-traits", +] + +[[package]] +name = "num-iter" +version = "0.1.43" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7d03e6c028c5dc5cac6e2dec0efda81fc887605bb3d884578bb6d6bf7514e252" +dependencies = [ + "autocfg", + "num-integer", + "num-traits", +] + +[[package]] +name = "num-traits" +version = "0.2.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "39e3200413f237f41ab11ad6d161bc7239c84dcb631773ccd7de3dfe4b5c267c" +dependencies = [ + "autocfg", + "libm", +] + +[[package]] +name = "once_cell" +version = "1.19.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3fdb12b2476b595f9358c5161aa467c2438859caa136dec86c26fdd2efe17b92" + +[[package]] +name = "opaque-debug" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "624a8340c38c1b80fd549087862da4ba43e08858af025b236e509b6649fc13d5" + +[[package]] +name = "parking_lot" +version = "0.12.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3742b2c103b9f06bc9fff0a37ff4912935851bee6d36f3c02bcc755bcfec228f" +dependencies = [ + "lock_api", + "parking_lot_core", +] + +[[package]] +name = "parking_lot_core" +version = "0.9.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4c42a9226546d68acdd9c0a280d17ce19bfe27a46bf68784e4066115788d008e" +dependencies = [ + "cfg-if", + "libc", + "redox_syscall", + "smallvec", + "windows-targets", +] + +[[package]] +name = "pbkdf2" +version = "0.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "83a0692ec44e4cf1ef28ca317f14f8f07da2d95ec3fa01f86e4467b725e60917" +dependencies = [ + "digest 0.10.7", +] + +[[package]] +name = "pin-project" +version = "1.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fda4ed1c6c173e3fc7a83629421152e01d7b1f9b7f65fb301e490e8cfc656422" +dependencies = [ + "pin-project-internal", +] + +[[package]] +name = "pin-project-internal" +version = "1.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4359fd9c9171ec6e8c62926d6faaf553a8dc3f64e1507e76da7911b4f6a04405" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.39", +] + +[[package]] +name = "pkcs1" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "eff33bdbdfc54cc98a2eca766ebdec3e1b8fb7387523d5c9c9a2891da856f719" +dependencies = [ + "der", + "pkcs8", + "spki", + "zeroize", +] + +[[package]] +name = "pkcs8" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9eca2c590a5f85da82668fa685c09ce2888b9430e83299debf1f34b65fd4a4ba" +dependencies = [ + "der", + "spki", +] + +[[package]] +name = "poly1305" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8159bd90725d2df49889a078b54f4f79e87f1f8a8444194cdca81d38f5393abf" +dependencies = [ + "cpufeatures", + "opaque-debug", + "universal-hash", +] + +[[package]] +name = "polyval" +version = "0.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d52cff9d1d4dee5fe6d03729099f4a310a41179e0a10dbf542039873f2e826fb" +dependencies = [ + "cfg-if", + "cpufeatures", + "opaque-debug", + "universal-hash", +] + +[[package]] +name = "ppv-lite86" +version = "0.2.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5b40af805b3121feab8a3c29f04d8ad262fa8e0561883e7653e024ae4479e6de" + +[[package]] +name = "proc-macro-error" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "da25490ff9892aab3fcf7c36f08cfb902dd3e71ca0f9f9517bea02a73a5ce38c" +dependencies = [ + "proc-macro-error-attr", + "proc-macro2", + "quote", + "syn 1.0.109", + "version_check", +] + +[[package]] +name = "proc-macro-error-attr" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a1be40180e52ecc98ad80b184934baf3d0d29f979574e439af5a55274b35f869" +dependencies = [ + "proc-macro2", + "quote", + "version_check", +] + +[[package]] +name = "proc-macro2" +version = "1.0.70" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "39278fbbf5fb4f646ce651690877f89d1c5811a3d4acb27700c1cb3cdb78fd3b" +dependencies = [ + "unicode-ident", +] + +[[package]] +name = "pyo3" +version = "0.20.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "04e8453b658fe480c3e70c8ed4e3d3ec33eb74988bd186561b0cc66b85c3bc4b" +dependencies = [ + "cfg-if", + "indoc", + "libc", + "memoffset", + "parking_lot", + "pyo3-build-config", + "pyo3-ffi", + "pyo3-macros", + "unindent", +] + +[[package]] +name = "pyo3-build-config" +version = "0.20.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a96fe70b176a89cff78f2fa7b3c930081e163d5379b4dcdf993e3ae29ca662e5" +dependencies = [ + "once_cell", + "target-lexicon", +] + +[[package]] +name = "pyo3-ffi" +version = "0.20.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "214929900fd25e6604661ed9cf349727c8920d47deff196c4e28165a6ef2a96b" +dependencies = [ + "libc", + "pyo3-build-config", +] + +[[package]] +name = "pyo3-macros" +version = "0.20.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dac53072f717aa1bfa4db832b39de8c875b7c7af4f4a6fe93cdbf9264cf8383b" +dependencies = [ + "proc-macro2", + "pyo3-macros-backend", + "quote", + "syn 2.0.39", +] + +[[package]] +name = "pyo3-macros-backend" +version = "0.20.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7774b5a8282bd4f25f803b1f0d945120be959a36c72e08e7cd031c792fdfd424" +dependencies = [ + "heck", + "proc-macro2", + "quote", + "syn 2.0.39", +] + +[[package]] +name = "pyrage" +version = "1.1.3-rc.1" +dependencies = [ + "age", + "age-core", + "pyo3", +] + +[[package]] +name = "quote" +version = "1.0.33" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5267fca4496028628a95160fc423a33e8b2e6af8a5302579e322e4b520293cae" +dependencies = [ + "proc-macro2", +] + +[[package]] +name = "rand" +version = "0.7.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6a6b1679d49b24bbfe0c803429aa1874472f50d9b363131f0e89fc356b544d03" +dependencies = [ + "getrandom 0.1.16", + "libc", + "rand_chacha 0.2.2", + "rand_core 0.5.1", + "rand_hc", +] + +[[package]] +name = "rand" +version = "0.8.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "34af8d1a0e25924bc5b7c43c079c942339d8f0a8b57c39049bef581b46327404" +dependencies = [ + "libc", + "rand_chacha 0.3.1", + "rand_core 0.6.4", +] + +[[package]] +name = "rand_chacha" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f4c8ed856279c9737206bf725bf36935d8666ead7aa69b52be55af369d193402" +dependencies = [ + "ppv-lite86", + "rand_core 0.5.1", +] + +[[package]] +name = "rand_chacha" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e6c10a63a0fa32252be49d21e7709d4d4baf8d231c2dbce1eaa8141b9b127d88" +dependencies = [ + "ppv-lite86", + "rand_core 0.6.4", +] + +[[package]] +name = "rand_core" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "90bde5296fc891b0cef12a6d03ddccc162ce7b2aff54160af9338f8d40df6d19" +dependencies = [ + "getrandom 0.1.16", +] + +[[package]] +name = "rand_core" +version = "0.6.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c" +dependencies = [ + "getrandom 0.2.11", +] + +[[package]] +name = "rand_hc" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ca3129af7b92a17112d59ad498c6f81eaf463253766b90396d39ea7a39d6613c" +dependencies = [ + "rand_core 0.5.1", +] + +[[package]] +name = "redox_syscall" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4722d768eff46b75989dd134e5c353f0d6296e5aaa3132e776cbdb56be7731aa" +dependencies = [ + "bitflags", +] + +[[package]] +name = "rsa" +version = "0.7.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "094052d5470cbcef561cb848a7209968c9f12dfa6d668f4bca048ac5de51099c" +dependencies = [ + "byteorder", + "digest 0.10.7", + "num-bigint-dig", + "num-integer", + "num-iter", + "num-traits", + "pkcs1", + "pkcs8", + "rand_core 0.6.4", + "signature", + "smallvec", + "subtle", + "zeroize", +] + +[[package]] +name = "rust-embed" +version = "6.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a36224c3276f8c4ebc8c20f158eca7ca4359c8db89991c4925132aaaf6702661" +dependencies = [ + "rust-embed-impl", + "rust-embed-utils", + "walkdir", +] + +[[package]] +name = "rust-embed-impl" +version = "6.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "49b94b81e5b2c284684141a2fb9e2a31be90638caf040bf9afbc5a0416afe1ac" +dependencies = [ + "proc-macro2", + "quote", + "rust-embed-utils", + "syn 2.0.39", + "walkdir", +] + +[[package]] +name = "rust-embed-utils" +version = "7.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9d38ff6bf570dc3bb7100fce9f7b60c33fa71d80e88da3f2580df4ff2bdded74" +dependencies = [ + "sha2", + "walkdir", +] + +[[package]] +name = "rustc-hash" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "08d43f7aa6b08d49f382cde6a7982047c3426db949b1424bc4b7ec9ae12c6ce2" + +[[package]] +name = "salsa20" +version = "0.10.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "97a22f5af31f73a954c10289c93e8a50cc23d971e80ee446f1f6f7137a088213" +dependencies = [ + "cipher", +] + +[[package]] +name = "same-file" +version = "1.0.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "93fc1dc3aaa9bfed95e02e6eadabb4baf7e3078b0bd1b4d7b6b0b68378900502" +dependencies = [ + "winapi-util", +] + +[[package]] +name = "scopeguard" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49" + +[[package]] +name = "scrypt" +version = "0.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9f9e24d2b632954ded8ab2ef9fea0a0c769ea56ea98bddbafbad22caeeadf45d" +dependencies = [ + "hmac", + "pbkdf2", + "salsa20", + "sha2", +] + +[[package]] +name = "secrecy" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9bd1c54ea06cfd2f6b63219704de0b9b4f72dcc2b8fdef820be6cd799780e91e" +dependencies = [ + "zeroize", +] + +[[package]] +name = "self_cell" +version = "0.10.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e14e4d63b804dc0c7ec4a1e52bcb63f02c7ac94476755aa579edac21e01f915d" +dependencies = [ + "self_cell 1.0.2", +] + +[[package]] +name = "self_cell" +version = "1.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e388332cd64eb80cd595a00941baf513caffae8dce9cfd0467fc9c66397dade6" + +[[package]] +name = "serde" +version = "1.0.193" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "25dd9975e68d0cb5aa1120c288333fc98731bd1dd12f561e468ea4728c042b89" +dependencies = [ + "serde_derive", +] + +[[package]] +name = "serde_derive" +version = "1.0.193" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "43576ca501357b9b071ac53cdc7da8ef0cbd9493d8df094cd821777ea6e894d3" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.39", +] + +[[package]] +name = "serde_spanned" +version = "0.6.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "12022b835073e5b11e90a14f86838ceb1c8fb0325b72416845c487ac0fa95e80" +dependencies = [ + "serde", +] + +[[package]] +name = "sha2" +version = "0.10.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "793db75ad2bcafc3ffa7c68b215fee268f537982cd901d132f89c6343f3a3dc8" +dependencies = [ + "cfg-if", + "cpufeatures", + "digest 0.10.7", +] + +[[package]] +name = "signature" +version = "1.6.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "74233d3b3b2f6d4b006dc19dee745e73e2a6bfb6f93607cd3b02bd5b00797d7c" +dependencies = [ + "digest 0.10.7", + "rand_core 0.6.4", +] + +[[package]] +name = "smallvec" +version = "1.11.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4dccd0940a2dcdf68d092b8cbab7dc0ad8fa938bf95787e1b916b0e3d0e8e970" + +[[package]] +name = "spin" +version = "0.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6e63cff320ae2c57904679ba7cb63280a3dc4613885beafb148ee7bf9aa9042d" + +[[package]] +name = "spki" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "67cf02bbac7a337dc36e4f5a693db6c21e7863f45070f7064577eb4367a3212b" +dependencies = [ + "base64ct", + "der", +] + +[[package]] +name = "strsim" +version = "0.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "73473c0e59e6d5812c5dfe2a064a6444949f089e20eec9a2e5506596494e4623" + +[[package]] +name = "subtle" +version = "2.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "81cdd64d312baedb58e21336b31bc043b77e01cc99033ce76ef539f78e965ebc" + +[[package]] +name = "syn" +version = "1.0.109" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "72b64191b275b66ffe2469e8af2c1cfe3bafa67b529ead792a6d0160888b4237" +dependencies = [ + "proc-macro2", + "unicode-ident", +] + +[[package]] +name = "syn" +version = "2.0.39" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "23e78b90f2fcf45d3e842032ce32e3f2d1545ba6636271dcbf24fa306d87be7a" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] + +[[package]] +name = "target-lexicon" +version = "0.12.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "14c39fd04924ca3a864207c66fc2cd7d22d7c016007f9ce846cbb9326331930a" + +[[package]] +name = "thiserror" +version = "1.0.50" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f9a7210f5c9a7156bb50aa36aed4c95afb51df0df00713949448cf9e97d382d2" +dependencies = [ + "thiserror-impl", +] + +[[package]] +name = "thiserror-impl" +version = "1.0.50" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "266b2e40bc00e5a6c09c3584011e08b06f123c00362c92b975ba9843aaaa14b8" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.39", +] + +[[package]] +name = "tinystr" +version = "0.7.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "83c02bf3c538ab32ba913408224323915f4ef9a6d61c0e85d493f355921c0ece" +dependencies = [ + "displaydoc", +] + +[[package]] +name = "toml" +version = "0.5.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f4f7f0dd8d50a853a531c426359045b1998f04219d88799810762cd4ad314234" +dependencies = [ + "serde", +] + +[[package]] +name = "toml" +version = "0.8.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a1a195ec8c9da26928f773888e0742ca3ca1040c6cd859c919c9f59c1954ab35" +dependencies = [ + "serde", + "serde_spanned", + "toml_datetime", + "toml_edit", +] + +[[package]] +name = "toml_datetime" +version = "0.6.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3550f4e9685620ac18a50ed434eb3aec30db8ba93b0287467bca5826ea25baf1" +dependencies = [ + "serde", +] + +[[package]] +name = "toml_edit" +version = "0.21.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d34d383cd00a163b4a5b85053df514d45bc330f6de7737edfe0a93311d1eaa03" +dependencies = [ + "indexmap", + "serde", + "serde_spanned", + "toml_datetime", + "winnow", +] + +[[package]] +name = "type-map" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b6d3364c5e96cb2ad1603037ab253ddd34d7fb72a58bdddf4b7350760fc69a46" +dependencies = [ + "rustc-hash", +] + +[[package]] +name = "typenum" +version = "1.17.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "42ff0bf0c66b8238c6f3b578df37d0b7848e55df8577b3f74f92a69acceeb825" + +[[package]] +name = "unic-langid" +version = "0.9.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "887622f8e7b723780c5e64b04dcc0c9b8f426ada7cca6790cd3ea3bf0f08037a" +dependencies = [ + "unic-langid-impl", +] + +[[package]] +name = "unic-langid-impl" +version = "0.9.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5adeb847e35eed4efbffd9fb2e4d078b91ece56e4d6a3c0d2df55b3a1dac07d5" +dependencies = [ + "serde", + "tinystr", +] + +[[package]] +name = "unicode-ident" +version = "1.0.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3354b9ac3fae1ff6755cb6db53683adb661634f67557942dea4facebec0fee4b" + +[[package]] +name = "unindent" +version = "0.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c7de7d73e1754487cb58364ee906a499937a0dfabd86bcb980fa99ec8c8fa2ce" + +[[package]] +name = "universal-hash" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fc1de2c688dc15305988b563c3854064043356019f97a4b46276fe734c4f07ea" +dependencies = [ + "crypto-common", + "subtle", +] + +[[package]] +name = "version_check" +version = "0.9.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" + +[[package]] +name = "walkdir" +version = "2.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d71d857dc86794ca4c280d616f7da00d2dbfd8cd788846559a6813e6aa4b54ee" +dependencies = [ + "same-file", + "winapi-util", +] + +[[package]] +name = "wasi" +version = "0.9.0+wasi-snapshot-preview1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cccddf32554fecc6acb585f82a32a72e28b48f8c4c1883ddfeeeaa96f7d8e519" + +[[package]] +name = "wasi" +version = "0.11.0+wasi-snapshot-preview1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" + +[[package]] +name = "winapi" +version = "0.3.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5c839a674fcd7a98952e593242ea400abe93992746761e38641405d28b00f419" +dependencies = [ + "winapi-i686-pc-windows-gnu", + "winapi-x86_64-pc-windows-gnu", +] + +[[package]] +name = "winapi-i686-pc-windows-gnu" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" + +[[package]] +name = "winapi-util" +version = "0.1.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f29e6f9198ba0d26b4c9f07dbe6f9ed633e1f3d5b8b414090084349e46a52596" +dependencies = [ + "winapi", +] + +[[package]] +name = "winapi-x86_64-pc-windows-gnu" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" + +[[package]] +name = "windows-targets" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9a2fa6e2155d7247be68c096456083145c183cbbbc2764150dda45a87197940c" +dependencies = [ + "windows_aarch64_gnullvm", + "windows_aarch64_msvc", + "windows_i686_gnu", + "windows_i686_msvc", + "windows_x86_64_gnu", + "windows_x86_64_gnullvm", + "windows_x86_64_msvc", +] + +[[package]] +name = "windows_aarch64_gnullvm" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2b38e32f0abccf9987a4e3079dfb67dcd799fb61361e53e2882c3cbaf0d905d8" + +[[package]] +name = "windows_aarch64_msvc" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dc35310971f3b2dbbf3f0690a219f40e2d9afcf64f9ab7cc1be722937c26b4bc" + +[[package]] +name = "windows_i686_gnu" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a75915e7def60c94dcef72200b9a8e58e5091744960da64ec734a6c6e9b3743e" + +[[package]] +name = "windows_i686_msvc" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8f55c233f70c4b27f66c523580f78f1004e8b5a8b659e05a4eb49d4166cca406" + +[[package]] +name = "windows_x86_64_gnu" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "53d40abd2583d23e4718fddf1ebec84dbff8381c07cae67ff7768bbf19c6718e" + +[[package]] +name = "windows_x86_64_gnullvm" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0b7b52767868a23d5bab768e390dc5f5c55825b6d30b86c844ff2dc7414044cc" + +[[package]] +name = "windows_x86_64_msvc" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ed94fce61571a4006852b7389a063ab983c02eb1bb37b47f8272ce92d06d9538" + +[[package]] +name = "winnow" +version = "0.5.26" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b67b5f0a4e7a27a64c651977932b9dc5667ca7fc31ac44b03ed37a0cf42fdfff" +dependencies = [ + "memchr", +] + +[[package]] +name = "x25519-dalek" +version = "1.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5a0c105152107e3b96f6a00a65e86ce82d9b125230e1c4302940eca58ff71f4f" +dependencies = [ + "curve25519-dalek", + "rand_core 0.5.1", + "zeroize", +] + +[[package]] +name = "zeroize" +version = "1.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "525b4ec142c6b68a2d10f01f7bbf6755599ca3f81ea53b8431b7dd348f5fdb2d" +dependencies = [ + "zeroize_derive", +] + +[[package]] +name = "zeroize_derive" +version = "1.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ce36e65b0d2999d2aafac989fb249189a141aee1f53c612c1f37d72631959f69" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.39", +] From 82cd185585a1973b9a6df19b216fda754588eda6 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 29 Jan 2024 11:12:23 -0500 Subject: [PATCH 10/31] build(deps): bump the cargo group with 1 update (#58) Bumps the cargo group with 1 update: [pyo3](https://github.com/pyo3/pyo3). Updates `pyo3` from 0.20.0 to 0.20.2 - [Release notes](https://github.com/pyo3/pyo3/releases) - [Changelog](https://github.com/PyO3/pyo3/blob/main/CHANGELOG.md) - [Commits](https://github.com/pyo3/pyo3/compare/v0.20.0...v0.20.2) --- updated-dependencies: - dependency-name: pyo3 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: cargo ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- Cargo.lock | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index c2f6568..5aba551 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -848,9 +848,9 @@ dependencies = [ [[package]] name = "pyo3" -version = "0.20.0" +version = "0.20.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "04e8453b658fe480c3e70c8ed4e3d3ec33eb74988bd186561b0cc66b85c3bc4b" +checksum = "9a89dc7a5850d0e983be1ec2a463a171d20990487c3cfcd68b5363f1ee3d6fe0" dependencies = [ "cfg-if", "indoc", @@ -865,9 +865,9 @@ dependencies = [ [[package]] name = "pyo3-build-config" -version = "0.20.0" +version = "0.20.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a96fe70b176a89cff78f2fa7b3c930081e163d5379b4dcdf993e3ae29ca662e5" +checksum = "07426f0d8fe5a601f26293f300afd1a7b1ed5e78b2a705870c5f30893c5163be" dependencies = [ "once_cell", "target-lexicon", @@ -875,9 +875,9 @@ dependencies = [ [[package]] name = "pyo3-ffi" -version = "0.20.0" +version = "0.20.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "214929900fd25e6604661ed9cf349727c8920d47deff196c4e28165a6ef2a96b" +checksum = "dbb7dec17e17766b46bca4f1a4215a85006b4c2ecde122076c562dd058da6cf1" dependencies = [ "libc", "pyo3-build-config", @@ -885,9 +885,9 @@ dependencies = [ [[package]] name = "pyo3-macros" -version = "0.20.0" +version = "0.20.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dac53072f717aa1bfa4db832b39de8c875b7c7af4f4a6fe93cdbf9264cf8383b" +checksum = "05f738b4e40d50b5711957f142878cfa0f28e054aa0ebdfc3fd137a843f74ed3" dependencies = [ "proc-macro2", "pyo3-macros-backend", @@ -897,9 +897,9 @@ dependencies = [ [[package]] name = "pyo3-macros-backend" -version = "0.20.0" +version = "0.20.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7774b5a8282bd4f25f803b1f0d945120be959a36c72e08e7cd031c792fdfd424" +checksum = "0fc910d4851847827daf9d6cdd4a823fbdaab5b8818325c5e97a86da79e8881f" dependencies = [ "heck", "proc-macro2", From 1330361487217cbe041a297a906bac2c5ecf24e4 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 5 Feb 2024 09:07:15 +0100 Subject: [PATCH 11/31] build(deps): bump the cargo group with 2 updates (#59) Bumps the cargo group with 2 updates: [age-core](https://github.com/str4d/rage) and [age](https://github.com/str4d/rage). Updates `age-core` from 0.9.0 to 0.10.0 - [Release notes](https://github.com/str4d/rage/releases) - [Commits](https://github.com/str4d/rage/compare/v0.9.0...v0.10.0) Updates `age` from 0.9.2 to 0.10.0 - [Release notes](https://github.com/str4d/rage/releases) - [Commits](https://github.com/str4d/rage/compare/v0.9.2...v0.10.0) --- updated-dependencies: - dependency-name: age-core dependency-type: direct:production update-type: version-update:semver-minor dependency-group: cargo - dependency-name: age dependency-type: direct:production update-type: version-update:semver-minor dependency-group: cargo ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- Cargo.lock | 235 +++++++++++++++++++++++------------------------------ Cargo.toml | 4 +- 2 files changed, 105 insertions(+), 134 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 5aba551..e187d86 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -39,9 +39,9 @@ dependencies = [ [[package]] name = "age" -version = "0.9.2" +version = "0.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6d55a4d912c80a92762ffd1c884065f3f9646467d22c95390e824a0ff7def472" +checksum = "edeef7d7b199195a2d7d7a8155d2d04aee736e60c5c7bdd7097d115369a8817d" dependencies = [ "aes", "aes-gcm", @@ -55,7 +55,6 @@ dependencies = [ "cookie-factory", "ctr", "curve25519-dalek", - "hkdf", "hmac", "i18n-embed", "i18n-embed-fl", @@ -63,8 +62,7 @@ dependencies = [ "nom", "num-traits", "pin-project", - "rand 0.7.3", - "rand 0.8.5", + "rand", "rsa", "rust-embed", "scrypt", @@ -76,9 +74,9 @@ dependencies = [ [[package]] name = "age-core" -version = "0.9.0" +version = "0.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e3d2e815ac879dc23c1139e720d21c6cd4d1276345c772587285d965a69b8f32" +checksum = "a5f11899bc2bbddd135edbc30c36b1924fa59d0746bb45beb5933fafe3fe509b" dependencies = [ "base64", "chacha20poly1305", @@ -86,7 +84,7 @@ dependencies = [ "hkdf", "io_tee", "nom", - "rand 0.8.5", + "rand", "secrecy", "sha2", ] @@ -105,9 +103,9 @@ checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa" [[package]] name = "base64" -version = "0.13.1" +version = "0.21.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9e1b586273c5702936fe7b7d6896644d8be71e6314cfe09d3167c95f712589e8" +checksum = "9d297deb1925b89f2ccc13d7635fa0714f12c87adce1c75356b39ca9b7178567" [[package]] name = "base64ct" @@ -117,9 +115,9 @@ checksum = "8c3c1a368f70d6cf7302d78f8f7093da241fb8e8807c05cc9e51a125895a6d5b" [[package]] name = "bcrypt-pbkdf" -version = "0.9.0" +version = "0.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3806a8db60cf56efee531616a34a6aaa9a114d6da2add861b0fa4a188881b2c7" +checksum = "6aeac2e1fe888769f34f05ac343bbef98b14d1ffb292ab69d4608b3abc86f2a2" dependencies = [ "blowfish", "pbkdf2", @@ -250,7 +248,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1bfb12502f3fc46cca1bb51ac28df9d618d813cdc3d2f25b9fe775a34af26bb3" dependencies = [ "generic-array", - "rand_core 0.6.4", + "rand_core", "typenum", ] @@ -265,17 +263,31 @@ dependencies = [ [[package]] name = "curve25519-dalek" -version = "3.2.0" +version = "4.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0b9fdf9972b2bd6af2d913799d9ebc165ea4d2e65878e329d9c6b372c4491b61" +checksum = "e89b8c6a2e4b1f45971ad09761aafb85514a84744b67a95e32c3cc1352d1f65c" dependencies = [ - "byteorder", - "digest 0.9.0", - "rand_core 0.5.1", + "cfg-if", + "cpufeatures", + "curve25519-dalek-derive", + "fiat-crypto", + "platforms", + "rustc_version", "subtle", "zeroize", ] +[[package]] +name = "curve25519-dalek-derive" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f46882e17999c6cc590af592290432be3bce0428cb0d5f8b6715e4dc7b383eb3" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.39", +] + [[package]] name = "dashmap" version = "5.5.3" @@ -291,23 +303,14 @@ dependencies = [ [[package]] name = "der" -version = "0.6.1" +version = "0.7.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f1a467a65c5e759bce6e65eaf91cc29f466cdc57cb65777bd646872a8a1fd4de" +checksum = "fffa369a668c8af7dbf8b5e56c9f744fbd399949ed171606040001947de40b1c" dependencies = [ "const-oid", "zeroize", ] -[[package]] -name = "digest" -version = "0.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d3dd60d1080a57a05ab032377049e0591415d2b31afd7028356dbf3cc6dcb066" -dependencies = [ - "generic-array", -] - [[package]] name = "digest" version = "0.10.7" @@ -337,6 +340,12 @@ version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5" +[[package]] +name = "fiat-crypto" +version = "0.2.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1676f435fc1dadde4d03e43f5d62b259e1ce5f40bd4ffb21db2b42ebe59c1382" + [[package]] name = "find-crate" version = "0.6.3" @@ -400,17 +409,6 @@ dependencies = [ "version_check", ] -[[package]] -name = "getrandom" -version = "0.1.16" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8fc3cb4d91f53b50155bdcfd23f6a4c39ae1969c2ae85982b135750cccaf5fce" -dependencies = [ - "cfg-if", - "libc", - "wasi 0.9.0+wasi-snapshot-preview1", -] - [[package]] name = "getrandom" version = "0.2.11" @@ -419,7 +417,7 @@ checksum = "fe9006bed769170c11f845cf00c7c1e9092aeb3f268e007c3e760ac68008070f" dependencies = [ "cfg-if", "libc", - "wasi 0.11.0+wasi-snapshot-preview1", + "wasi", ] [[package]] @@ -459,7 +457,7 @@ version = "0.12.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6c49c37c09c17a53d937dfbb742eb3a961d65a994e6bcdcf37e7399d0cc8ab5e" dependencies = [ - "digest 0.10.7", + "digest", ] [[package]] @@ -478,9 +476,9 @@ dependencies = [ [[package]] name = "i18n-embed" -version = "0.13.9" +version = "0.14.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "92a86226a7a16632de6723449ee5fe70bac5af718bc642ee9ca2f0f6e14fa1fa" +checksum = "94205d95764f5bb9db9ea98fa77f89653365ca748e27161f5bbea2ffd50e459c" dependencies = [ "arc-swap", "fluent", @@ -499,9 +497,9 @@ dependencies = [ [[package]] name = "i18n-embed-fl" -version = "0.6.7" +version = "0.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d26a3d3569737dfaac7fc1c4078e6af07471c3060b8e570bcd83cdd5f4685395" +checksum = "9fc1f8715195dffc4caddcf1cf3128da15fe5d8a137606ea8856c9300047d5a2" dependencies = [ "dashmap", "find-crate", @@ -662,7 +660,7 @@ dependencies = [ "num-integer", "num-iter", "num-traits", - "rand 0.8.5", + "rand", "smallvec", "zeroize", ] @@ -735,11 +733,12 @@ dependencies = [ [[package]] name = "pbkdf2" -version = "0.11.0" +version = "0.12.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "83a0692ec44e4cf1ef28ca317f14f8f07da2d95ec3fa01f86e4467b725e60917" +checksum = "f8ed6a7761f76e3b9f92dfb0a60a6a6477c61024b775147ff0973a02653abaf2" dependencies = [ - "digest 0.10.7", + "digest", + "hmac", ] [[package]] @@ -764,26 +763,31 @@ dependencies = [ [[package]] name = "pkcs1" -version = "0.4.1" +version = "0.7.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eff33bdbdfc54cc98a2eca766ebdec3e1b8fb7387523d5c9c9a2891da856f719" +checksum = "c8ffb9f10fa047879315e6625af03c164b16962a5368d724ed16323b68ace47f" dependencies = [ "der", "pkcs8", "spki", - "zeroize", ] [[package]] name = "pkcs8" -version = "0.9.0" +version = "0.10.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9eca2c590a5f85da82668fa685c09ce2888b9430e83299debf1f34b65fd4a4ba" +checksum = "f950b2377845cebe5cf8b5165cb3cc1a5e0fa5cfa3e1f7f55707d8fd82e0a7b7" dependencies = [ "der", "spki", ] +[[package]] +name = "platforms" +version = "3.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "626dec3cac7cc0e1577a2ec3fc496277ec2baa084bebad95bb6fdbfae235f84c" + [[package]] name = "poly1305" version = "0.8.0" @@ -925,19 +929,6 @@ dependencies = [ "proc-macro2", ] -[[package]] -name = "rand" -version = "0.7.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6a6b1679d49b24bbfe0c803429aa1874472f50d9b363131f0e89fc356b544d03" -dependencies = [ - "getrandom 0.1.16", - "libc", - "rand_chacha 0.2.2", - "rand_core 0.5.1", - "rand_hc", -] - [[package]] name = "rand" version = "0.8.5" @@ -945,18 +936,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "34af8d1a0e25924bc5b7c43c079c942339d8f0a8b57c39049bef581b46327404" dependencies = [ "libc", - "rand_chacha 0.3.1", - "rand_core 0.6.4", -] - -[[package]] -name = "rand_chacha" -version = "0.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f4c8ed856279c9737206bf725bf36935d8666ead7aa69b52be55af369d193402" -dependencies = [ - "ppv-lite86", - "rand_core 0.5.1", + "rand_chacha", + "rand_core", ] [[package]] @@ -966,16 +947,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e6c10a63a0fa32252be49d21e7709d4d4baf8d231c2dbce1eaa8141b9b127d88" dependencies = [ "ppv-lite86", - "rand_core 0.6.4", -] - -[[package]] -name = "rand_core" -version = "0.5.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "90bde5296fc891b0cef12a6d03ddccc162ce7b2aff54160af9338f8d40df6d19" -dependencies = [ - "getrandom 0.1.16", + "rand_core", ] [[package]] @@ -984,16 +956,7 @@ version = "0.6.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c" dependencies = [ - "getrandom 0.2.11", -] - -[[package]] -name = "rand_hc" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ca3129af7b92a17112d59ad498c6f81eaf463253766b90396d39ea7a39d6613c" -dependencies = [ - "rand_core 0.5.1", + "getrandom", ] [[package]] @@ -1007,30 +970,29 @@ dependencies = [ [[package]] name = "rsa" -version = "0.7.2" +version = "0.9.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "094052d5470cbcef561cb848a7209968c9f12dfa6d668f4bca048ac5de51099c" +checksum = "5d0e5124fcb30e76a7e79bfee683a2746db83784b86289f6251b54b7950a0dfc" dependencies = [ - "byteorder", - "digest 0.10.7", + "const-oid", + "digest", "num-bigint-dig", "num-integer", - "num-iter", "num-traits", "pkcs1", "pkcs8", - "rand_core 0.6.4", + "rand_core", "signature", - "smallvec", + "spki", "subtle", "zeroize", ] [[package]] name = "rust-embed" -version = "6.8.1" +version = "8.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a36224c3276f8c4ebc8c20f158eca7ca4359c8db89991c4925132aaaf6702661" +checksum = "a82c0bbc10308ed323529fd3c1dce8badda635aa319a5ff0e6466f33b8101e3f" dependencies = [ "rust-embed-impl", "rust-embed-utils", @@ -1039,9 +1001,9 @@ dependencies = [ [[package]] name = "rust-embed-impl" -version = "6.8.1" +version = "8.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "49b94b81e5b2c284684141a2fb9e2a31be90638caf040bf9afbc5a0416afe1ac" +checksum = "6227c01b1783cdfee1bcf844eb44594cd16ec71c35305bf1c9fb5aade2735e16" dependencies = [ "proc-macro2", "quote", @@ -1052,9 +1014,9 @@ dependencies = [ [[package]] name = "rust-embed-utils" -version = "7.8.1" +version = "8.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9d38ff6bf570dc3bb7100fce9f7b60c33fa71d80e88da3f2580df4ff2bdded74" +checksum = "8cb0a25bfbb2d4b4402179c2cf030387d9990857ce08a32592c6238db9fa8665" dependencies = [ "sha2", "walkdir", @@ -1066,6 +1028,15 @@ version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "08d43f7aa6b08d49f382cde6a7982047c3426db949b1424bc4b7ec9ae12c6ce2" +[[package]] +name = "rustc_version" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bfa0f585226d2e68097d4f95d113b15b83a82e819ab25717ec0590d9584ef366" +dependencies = [ + "semver", +] + [[package]] name = "salsa20" version = "0.10.2" @@ -1092,11 +1063,10 @@ checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49" [[package]] name = "scrypt" -version = "0.10.0" +version = "0.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9f9e24d2b632954ded8ab2ef9fea0a0c769ea56ea98bddbafbad22caeeadf45d" +checksum = "0516a385866c09368f0b5bcd1caff3366aace790fcd46e2bb032697bb172fd1f" dependencies = [ - "hmac", "pbkdf2", "salsa20", "sha2", @@ -1126,6 +1096,12 @@ version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e388332cd64eb80cd595a00941baf513caffae8dce9cfd0467fc9c66397dade6" +[[package]] +name = "semver" +version = "1.0.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b97ed7a9823b74f99c7742f5336af7be5ecd3eeafcb1507d1fa93347b1d589b0" + [[package]] name = "serde" version = "1.0.193" @@ -1163,17 +1139,17 @@ checksum = "793db75ad2bcafc3ffa7c68b215fee268f537982cd901d132f89c6343f3a3dc8" dependencies = [ "cfg-if", "cpufeatures", - "digest 0.10.7", + "digest", ] [[package]] name = "signature" -version = "1.6.4" +version = "2.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "74233d3b3b2f6d4b006dc19dee745e73e2a6bfb6f93607cd3b02bd5b00797d7c" +checksum = "77549399552de45a898a580c1b41d445bf730df867cc44e6c0233bbc4b8329de" dependencies = [ - "digest 0.10.7", - "rand_core 0.6.4", + "digest", + "rand_core", ] [[package]] @@ -1190,9 +1166,9 @@ checksum = "6e63cff320ae2c57904679ba7cb63280a3dc4613885beafb148ee7bf9aa9042d" [[package]] name = "spki" -version = "0.6.0" +version = "0.7.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "67cf02bbac7a337dc36e4f5a693db6c21e7863f45070f7064577eb4367a3212b" +checksum = "d91ed6c858b01f942cd56b37a94b3e0a1798290327d1236e4d9cf4eaca44d29d" dependencies = [ "base64ct", "der", @@ -1381,12 +1357,6 @@ dependencies = [ "winapi-util", ] -[[package]] -name = "wasi" -version = "0.9.0+wasi-snapshot-preview1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cccddf32554fecc6acb585f82a32a72e28b48f8c4c1883ddfeeeaa96f7d8e519" - [[package]] name = "wasi" version = "0.11.0+wasi-snapshot-preview1" @@ -1492,12 +1462,13 @@ dependencies = [ [[package]] name = "x25519-dalek" -version = "1.1.1" +version = "2.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5a0c105152107e3b96f6a00a65e86ce82d9b125230e1c4302940eca58ff71f4f" +checksum = "fb66477291e7e8d2b0ff1bcb900bf29489a9692816d79874bea351e7a8b6de96" dependencies = [ "curve25519-dalek", - "rand_core 0.5.1", + "rand_core", + "serde", "zeroize", ] diff --git a/Cargo.toml b/Cargo.toml index bb14548..25413c7 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -17,8 +17,8 @@ push = true crate-type = ["cdylib"] [dependencies] -age-core = "0.9" -age = { version = "0.9", features = ["ssh"] } +age-core = "0.10" +age = { version = "0.10", features = ["ssh"] } pyo3 = { version = "0.20", features = [ "extension-module", "abi3", From 606668551df2e8e63ad0135c95b24352582b69f2 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 26 Feb 2024 10:10:11 -0500 Subject: [PATCH 12/31] build(deps): bump the cargo group with 1 update (#60) Bumps the cargo group with 1 update: [pyo3](https://github.com/pyo3/pyo3). Updates `pyo3` from 0.20.2 to 0.20.3 - [Release notes](https://github.com/pyo3/pyo3/releases) - [Changelog](https://github.com/PyO3/pyo3/blob/main/CHANGELOG.md) - [Commits](https://github.com/pyo3/pyo3/compare/v0.20.2...v0.20.3) --- updated-dependencies: - dependency-name: pyo3 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: cargo ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- Cargo.lock | 28 ++++++++++++++++++---------- 1 file changed, 18 insertions(+), 10 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index e187d86..79dafe8 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -811,6 +811,12 @@ dependencies = [ "universal-hash", ] +[[package]] +name = "portable-atomic" +version = "1.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7170ef9988bc169ba16dd36a7fa041e5c4cbeb6a35b76d4c03daded371eae7c0" + [[package]] name = "ppv-lite86" version = "0.2.17" @@ -852,15 +858,16 @@ dependencies = [ [[package]] name = "pyo3" -version = "0.20.2" +version = "0.20.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9a89dc7a5850d0e983be1ec2a463a171d20990487c3cfcd68b5363f1ee3d6fe0" +checksum = "53bdbb96d49157e65d45cc287af5f32ffadd5f4761438b527b055fb0d4bb8233" dependencies = [ "cfg-if", "indoc", "libc", "memoffset", "parking_lot", + "portable-atomic", "pyo3-build-config", "pyo3-ffi", "pyo3-macros", @@ -869,9 +876,9 @@ dependencies = [ [[package]] name = "pyo3-build-config" -version = "0.20.2" +version = "0.20.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "07426f0d8fe5a601f26293f300afd1a7b1ed5e78b2a705870c5f30893c5163be" +checksum = "deaa5745de3f5231ce10517a1f5dd97d53e5a2fd77aa6b5842292085831d48d7" dependencies = [ "once_cell", "target-lexicon", @@ -879,9 +886,9 @@ dependencies = [ [[package]] name = "pyo3-ffi" -version = "0.20.2" +version = "0.20.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dbb7dec17e17766b46bca4f1a4215a85006b4c2ecde122076c562dd058da6cf1" +checksum = "62b42531d03e08d4ef1f6e85a2ed422eb678b8cd62b762e53891c05faf0d4afa" dependencies = [ "libc", "pyo3-build-config", @@ -889,9 +896,9 @@ dependencies = [ [[package]] name = "pyo3-macros" -version = "0.20.2" +version = "0.20.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "05f738b4e40d50b5711957f142878cfa0f28e054aa0ebdfc3fd137a843f74ed3" +checksum = "7305c720fa01b8055ec95e484a6eca7a83c841267f0dd5280f0c8b8551d2c158" dependencies = [ "proc-macro2", "pyo3-macros-backend", @@ -901,12 +908,13 @@ dependencies = [ [[package]] name = "pyo3-macros-backend" -version = "0.20.2" +version = "0.20.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0fc910d4851847827daf9d6cdd4a823fbdaab5b8818325c5e97a86da79e8881f" +checksum = "7c7e9b68bb9c3149c5b0cade5d07f953d6d125eb4337723c4ccdb665f1f96185" dependencies = [ "heck", "proc-macro2", + "pyo3-build-config", "quote", "syn 2.0.39", ] From 7e6cb91a23265164ad1ec5b8279eb1606f927a04 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 4 Mar 2024 11:50:05 -0500 Subject: [PATCH 13/31] build(deps): bump the actions group with 1 update (#61) Bumps the actions group with 1 update: [pypa/gh-action-pypi-publish](https://github.com/pypa/gh-action-pypi-publish). Updates `pypa/gh-action-pypi-publish` from 1.8.11 to 1.8.12 - [Release notes](https://github.com/pypa/gh-action-pypi-publish/releases) - [Commits](https://github.com/pypa/gh-action-pypi-publish/compare/v1.8.11...v1.8.12) --- updated-dependencies: - dependency-name: pypa/gh-action-pypi-publish dependency-type: direct:production update-type: version-update:semver-patch dependency-group: actions ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .github/workflows/release-stubs.yml | 2 +- .github/workflows/release.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/release-stubs.yml b/.github/workflows/release-stubs.yml index b476ece..d69e035 100644 --- a/.github/workflows/release-stubs.yml +++ b/.github/workflows/release-stubs.yml @@ -48,4 +48,4 @@ jobs: - name: publish if: ${{ !inputs.dry-run }} - uses: pypa/gh-action-pypi-publish@v1.8.11 + uses: pypa/gh-action-pypi-publish@v1.8.12 diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 5a1e5bf..56df079 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -98,7 +98,7 @@ jobs: merge-multiple: true - name: publish - uses: pypa/gh-action-pypi-publish@v1.8.11 + uses: pypa/gh-action-pypi-publish@v1.8.12 - name: sign uses: sigstore/gh-action-sigstore-python@v2.1.1 From 622555c42f85f7285d2cd318cbff1859f174fd1d Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 11 Mar 2024 10:09:32 -0400 Subject: [PATCH 14/31] build(deps): bump the actions group with 1 update (#62) Bumps the actions group with 1 update: [pypa/gh-action-pypi-publish](https://github.com/pypa/gh-action-pypi-publish). Updates `pypa/gh-action-pypi-publish` from 1.8.12 to 1.8.14 - [Release notes](https://github.com/pypa/gh-action-pypi-publish/releases) - [Commits](https://github.com/pypa/gh-action-pypi-publish/compare/v1.8.12...v1.8.14) --- updated-dependencies: - dependency-name: pypa/gh-action-pypi-publish dependency-type: direct:production update-type: version-update:semver-patch dependency-group: actions ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .github/workflows/release-stubs.yml | 2 +- .github/workflows/release.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/release-stubs.yml b/.github/workflows/release-stubs.yml index d69e035..44dec1e 100644 --- a/.github/workflows/release-stubs.yml +++ b/.github/workflows/release-stubs.yml @@ -48,4 +48,4 @@ jobs: - name: publish if: ${{ !inputs.dry-run }} - uses: pypa/gh-action-pypi-publish@v1.8.12 + uses: pypa/gh-action-pypi-publish@v1.8.14 diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 56df079..3695a7c 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -98,7 +98,7 @@ jobs: merge-multiple: true - name: publish - uses: pypa/gh-action-pypi-publish@v1.8.12 + uses: pypa/gh-action-pypi-publish@v1.8.14 - name: sign uses: sigstore/gh-action-sigstore-python@v2.1.1 From 77162b6e996c300fea890885fd76bbf59e9c6d33 Mon Sep 17 00:00:00 2001 From: Vika Date: Fri, 29 Mar 2024 18:29:18 +0300 Subject: [PATCH 15/31] Fixes for type stubs (#63) --- pyrage-stubs/pyproject.toml | 3 +++ pyrage-stubs/pyrage-stubs/__init__.pyi | 19 +++++++++++++++++++ pyrage-stubs/pyrage-stubs/pyrage.pyi | 11 ----------- pyrage-stubs/pyrage-stubs/x25519.py | 2 +- 4 files changed, 23 insertions(+), 12 deletions(-) delete mode 100644 pyrage-stubs/pyrage-stubs/pyrage.pyi diff --git a/pyrage-stubs/pyproject.toml b/pyrage-stubs/pyproject.toml index e6c13c5..b019b9f 100644 --- a/pyrage-stubs/pyproject.toml +++ b/pyrage-stubs/pyproject.toml @@ -22,3 +22,6 @@ requires-python = ">= 3.8" Homepage = "https://pypi.org/project/pyrage/" Issues = "https://github.com/woodruffw/pyrage/issues" Source = "https://github.com/woodruffw/pyrage/tree/main/pyrage-stubs" + +[tool.setuptools.package-data] +"*" = ["*.pyi"] \ No newline at end of file diff --git a/pyrage-stubs/pyrage-stubs/__init__.pyi b/pyrage-stubs/pyrage-stubs/__init__.pyi index e69de29..d44dd2d 100644 --- a/pyrage-stubs/pyrage-stubs/__init__.pyi +++ b/pyrage-stubs/pyrage-stubs/__init__.pyi @@ -0,0 +1,19 @@ +from typing import Sequence, Union + +from pyrage import ssh, x25519, passphrase + +Identity = Union[ssh.Identity, x25519.Identity] +Recipient = Union[ssh.Recipient, x25519.Recipient] + + +class RecipientError(Exception): + ... + +class IdentityError(Exception): + ... + + +def encrypt(plaintext: bytes, recipients: Sequence[Recipient]) -> bytes: ... +def encrypt_file(infile: str, outfile: str, recipients: Sequence[Recipient]) -> None: ... +def decrypt(ciphertext: bytes, identities: Sequence[Identity]) -> bytes: ... +def decrypt_file(infile: str, outfile: str, identities: Sequence[Identity]) -> None: ... diff --git a/pyrage-stubs/pyrage-stubs/pyrage.pyi b/pyrage-stubs/pyrage-stubs/pyrage.pyi deleted file mode 100644 index 49bc320..0000000 --- a/pyrage-stubs/pyrage-stubs/pyrage.pyi +++ /dev/null @@ -1,11 +0,0 @@ -from typing import Sequence, Union - -from . import ssh, x25519 - -Identity = Union[ssh.Identity, x25519.Identity] -Recipient = Union[ssh.Recipient, x25519.Recipient] - -def encrypt(plaintext: bytes, recipients: Sequence[Recipient]) -> bytes: ... -def encrypt_file(infile: str, outfile: str, recipients: Sequence[Recipient]) -> None: ... -def decrypt(ciphertext: bytes, identities: Sequence[Identity]) -> bytes: ... -def decrypt_file(infile: str, outfile: str, identities: Sequence[Identity]) -> None: ... diff --git a/pyrage-stubs/pyrage-stubs/x25519.py b/pyrage-stubs/pyrage-stubs/x25519.py index e5348ac..6f167b8 100644 --- a/pyrage-stubs/pyrage-stubs/x25519.py +++ b/pyrage-stubs/pyrage-stubs/x25519.py @@ -16,5 +16,5 @@ def to_public(self) -> Recipient: class Recipient: @classmethod - def from_str(cls) -> Recipient: + def from_str(cls, v: str) -> Recipient: ... From b0951f3b9f3da59136e91c3abda00154512fe893 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 1 Apr 2024 13:26:17 -0400 Subject: [PATCH 16/31] build(deps): bump the cargo group with 1 update (#64) * build(deps): bump the cargo group with 1 update Bumps the cargo group with 1 update: [pyo3](https://github.com/pyo3/pyo3). Updates `pyo3` from 0.20.3 to 0.21.0 - [Release notes](https://github.com/pyo3/pyo3/releases) - [Changelog](https://github.com/PyO3/pyo3/blob/main/CHANGELOG.md) - [Commits](https://github.com/pyo3/pyo3/compare/v0.20.3...v0.21.0) --- updated-dependencies: - dependency-name: pyo3 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: cargo ... Signed-off-by: dependabot[bot] * pyo3 fixes Signed-off-by: William Woodruff --------- Signed-off-by: dependabot[bot] Signed-off-by: William Woodruff Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: William Woodruff --- Cargo.lock | 20 ++++++++++---------- Cargo.toml | 2 +- pyproject.toml | 2 +- src/lib.rs | 42 +++++++++++++++++++++--------------------- src/passphrase.rs | 16 ++++++++++------ src/ssh.rs | 8 ++++---- src/x25519.rs | 10 +++++----- 7 files changed, 52 insertions(+), 48 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 79dafe8..9ff7704 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -858,9 +858,9 @@ dependencies = [ [[package]] name = "pyo3" -version = "0.20.3" +version = "0.21.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "53bdbb96d49157e65d45cc287af5f32ffadd5f4761438b527b055fb0d4bb8233" +checksum = "a02a88a17e74cadbc8ce77855e1d6c8ad0ab82901a4a9b5046bd01c1c0bd95cd" dependencies = [ "cfg-if", "indoc", @@ -876,9 +876,9 @@ dependencies = [ [[package]] name = "pyo3-build-config" -version = "0.20.3" +version = "0.21.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "deaa5745de3f5231ce10517a1f5dd97d53e5a2fd77aa6b5842292085831d48d7" +checksum = "a5eb0b6ecba38961f6f4bd6cd5906dfab3cd426ff37b2eed5771006aa31656f1" dependencies = [ "once_cell", "target-lexicon", @@ -886,9 +886,9 @@ dependencies = [ [[package]] name = "pyo3-ffi" -version = "0.20.3" +version = "0.21.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "62b42531d03e08d4ef1f6e85a2ed422eb678b8cd62b762e53891c05faf0d4afa" +checksum = "ba8a6e48a29b5d22e4fdaf132d8ba8d3203ee9f06362d48f244346902a594ec3" dependencies = [ "libc", "pyo3-build-config", @@ -896,9 +896,9 @@ dependencies = [ [[package]] name = "pyo3-macros" -version = "0.20.3" +version = "0.21.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7305c720fa01b8055ec95e484a6eca7a83c841267f0dd5280f0c8b8551d2c158" +checksum = "4e80493c5965f94a747d0782a607b2328a4eea5391327b152b00e2f3b001cede" dependencies = [ "proc-macro2", "pyo3-macros-backend", @@ -908,9 +908,9 @@ dependencies = [ [[package]] name = "pyo3-macros-backend" -version = "0.20.3" +version = "0.21.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7c7e9b68bb9c3149c5b0cade5d07f953d6d125eb4337723c4ccdb665f1f96185" +checksum = "fcd7d86f42004025200e12a6a8119bd878329e6fddef8178eaafa4e4b5906c5b" dependencies = [ "heck", "proc-macro2", diff --git a/Cargo.toml b/Cargo.toml index 25413c7..52c6c53 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -19,7 +19,7 @@ crate-type = ["cdylib"] [dependencies] age-core = "0.10" age = { version = "0.10", features = ["ssh"] } -pyo3 = { version = "0.20", features = [ +pyo3 = { version = "0.21", features = [ "extension-module", "abi3", "abi3-py38", diff --git a/pyproject.toml b/pyproject.toml index d8f713d..dcaa1d4 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,5 +1,5 @@ [build-system] -requires = ["maturin>=0.14,<0.15"] +requires = ["maturin>=1.0,<2.0"] build-backend = "maturin" [project] diff --git a/src/lib.rs b/src/lib.rs index 35860bc..216bca8 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -15,7 +15,7 @@ use pyo3::{ exceptions::{PyException, PyTypeError}, prelude::*, py_run, - types::{PyBytes, PyString}, + types::PyBytes, }; mod passphrase; @@ -135,7 +135,7 @@ fn encrypt<'p>( py: Python<'p>, plaintext: &[u8], recipients: Vec>, -) -> PyResult<&'p PyBytes> { +) -> PyResult> { // This turns each `dyn PyrageRecipient` into a `dyn Recipient`, which // is what the underlying `age` API expects. let recipients = recipients.into_iter().map(|pr| pr.as_recipient()).collect(); @@ -154,21 +154,21 @@ fn encrypt<'p>( .map_err(|e| EncryptError::new_err(e.to_string()))?; // TODO: Avoid this copy. Maybe PyBytes::new_with? - Ok(PyBytes::new(py, &encrypted)) + Ok(PyBytes::new_bound(py, &encrypted)) } #[pyfunction] fn encrypt_file( - infile: &PyString, - outfile: &PyString, + infile: String, + outfile: String, recipients: Vec>, ) -> PyResult<()> { // This turns each `dyn PyrageRecipient` into a `dyn Recipient`, which // is what the underlying `age` API expects. let recipients = recipients.into_iter().map(|pr| pr.as_recipient()).collect(); - let reader = File::open(infile.to_str()?)?; - let writer = File::create(outfile.to_str()?)?; + let reader = File::open(infile)?; + let writer = File::create(outfile)?; let mut reader = std::io::BufReader::new(reader); let mut writer = std::io::BufWriter::new(writer); @@ -195,7 +195,7 @@ fn decrypt<'p>( py: Python<'p>, ciphertext: &[u8], identities: Vec>, -) -> PyResult<&'p PyBytes> { +) -> PyResult> { let identities = identities.iter().map(|pi| pi.as_ref().as_identity()); let decryptor = @@ -217,19 +217,19 @@ fn decrypt<'p>( .map_err(|e| DecryptError::new_err(e.to_string()))?; // TODO: Avoid this copy. Maybe PyBytes::new_with? - Ok(PyBytes::new(py, &decrypted)) + Ok(PyBytes::new_bound(py, &decrypted)) } #[pyfunction] fn decrypt_file( - infile: &PyString, - outfile: &PyString, + infile: String, + outfile: String, identities: Vec>, ) -> PyResult<()> { let identities = identities.iter().map(|pi| pi.as_ref().as_identity()); - let reader = File::open(infile.to_str()?)?; - let writer = File::create(outfile.to_str()?)?; + let reader = File::open(infile)?; + let writer = File::create(outfile)?; let reader = std::io::BufReader::new(reader); let mut writer = std::io::BufWriter::new(writer); @@ -255,7 +255,7 @@ fn decrypt_file( } #[pymodule] -fn pyrage(py: Python, m: &PyModule) -> PyResult<()> { +fn pyrage(py: Python, m: &Bound<'_, PyModule>) -> PyResult<()> { // HACK(ww): pyO3 modules are not packages, so we need this nasty // `py_run!` hack to support `from pyrage import ...` and similar // import patterns. @@ -265,11 +265,11 @@ fn pyrage(py: Python, m: &PyModule) -> PyResult<()> { x25519, "import sys; sys.modules['pyrage.x25519'] = x25519" ); - m.add_submodule(x25519)?; + m.add_submodule(&x25519)?; let ssh = ssh::module(py)?; py_run!(py, ssh, "import sys; sys.modules['pyrage.ssh'] = ssh"); - m.add_submodule(ssh)?; + m.add_submodule(&ssh)?; let passphrase = passphrase::module(py)?; py_run!( @@ -277,15 +277,15 @@ fn pyrage(py: Python, m: &PyModule) -> PyResult<()> { passphrase, "import sys; sys.modules['pyrage.passphrase'] = passphrase" ); - m.add_submodule(passphrase)?; + m.add_submodule(&passphrase)?; - m.add("IdentityError", py.get_type::())?; - m.add("RecipientError", py.get_type::())?; + m.add("IdentityError", py.get_type_bound::())?; + m.add("RecipientError", py.get_type_bound::())?; - m.add("EncryptError", py.get_type::())?; + m.add("EncryptError", py.get_type_bound::())?; m.add_wrapped(wrap_pyfunction!(encrypt))?; m.add_wrapped(wrap_pyfunction!(encrypt_file))?; - m.add("DecryptError", py.get_type::())?; + m.add("DecryptError", py.get_type_bound::())?; m.add_wrapped(wrap_pyfunction!(decrypt))?; m.add_wrapped(wrap_pyfunction!(decrypt_file))?; diff --git a/src/passphrase.rs b/src/passphrase.rs index 49bfd71..367a21a 100644 --- a/src/passphrase.rs +++ b/src/passphrase.rs @@ -6,7 +6,7 @@ use pyo3::{prelude::*, types::PyBytes}; use crate::{DecryptError, EncryptError}; #[pyfunction] -fn encrypt<'p>(py: Python<'p>, plaintext: &[u8], passphrase: &str) -> PyResult<&'p PyBytes> { +fn encrypt<'p>(py: Python<'p>, plaintext: &[u8], passphrase: &str) -> PyResult> { let encryptor = Encryptor::with_user_passphrase(Secret::new(passphrase.into())); let mut encrypted = vec![]; let mut writer = encryptor @@ -19,11 +19,15 @@ fn encrypt<'p>(py: Python<'p>, plaintext: &[u8], passphrase: &str) -> PyResult<& .finish() .map_err(|e| EncryptError::new_err(e.to_string()))?; - Ok(PyBytes::new(py, &encrypted)) + Ok(PyBytes::new_bound(py, &encrypted)) } #[pyfunction] -fn decrypt<'p>(py: Python<'p>, ciphertext: &[u8], passphrase: &str) -> PyResult<&'p PyBytes> { +fn decrypt<'p>( + py: Python<'p>, + ciphertext: &[u8], + passphrase: &str, +) -> PyResult> { let decryptor = match Decryptor::new(ciphertext).map_err(|e| DecryptError::new_err(e.to_string()))? { Decryptor::Passphrase(d) => d, @@ -41,11 +45,11 @@ fn decrypt<'p>(py: Python<'p>, ciphertext: &[u8], passphrase: &str) -> PyResult< .read_to_end(&mut decrypted) .map_err(|e| DecryptError::new_err(e.to_string()))?; - Ok(PyBytes::new(py, &decrypted)) + Ok(PyBytes::new_bound(py, &decrypted)) } -pub(crate) fn module(py: Python) -> PyResult<&PyModule> { - let module = PyModule::new(py, "passphrase")?; +pub(crate) fn module(py: Python) -> PyResult> { + let module = PyModule::new_bound(py, "passphrase")?; module.add_wrapped(wrap_pyfunction!(encrypt))?; module.add_wrapped(wrap_pyfunction!(decrypt))?; diff --git a/src/ssh.rs b/src/ssh.rs index 18acbf8..fc1284f 100644 --- a/src/ssh.rs +++ b/src/ssh.rs @@ -11,7 +11,7 @@ pub(crate) struct Recipient(pub(crate) age::ssh::Recipient); #[pymethods] impl Recipient { #[classmethod] - fn from_str(_cls: &PyType, v: &str) -> PyResult { + fn from_str(_cls: &Bound<'_, PyType>, v: &str) -> PyResult { let recipient = age::ssh::Recipient::from_str(v) .map_err(|e| RecipientError::new_err(format!("invalid public key: {:?}", e)))?; @@ -26,7 +26,7 @@ pub(crate) struct Identity(pub(crate) age::ssh::Identity); #[pymethods] impl Identity { #[classmethod] - fn from_buffer(_cls: &PyType, buf: &[u8]) -> PyResult { + fn from_buffer(_cls: &Bound<'_, PyType>, buf: &[u8]) -> PyResult { let identity = age::ssh::Identity::from_buffer(buf, None) .map_err(|e| IdentityError::new_err(e.to_string()))?; @@ -43,8 +43,8 @@ impl Identity { } } -pub(crate) fn module(py: Python) -> PyResult<&PyModule> { - let module = PyModule::new(py, "ssh")?; +pub(crate) fn module(py: Python) -> PyResult> { + let module = PyModule::new_bound(py, "ssh")?; module.add_class::()?; module.add_class::()?; diff --git a/src/x25519.rs b/src/x25519.rs index 7c7025d..530577f 100644 --- a/src/x25519.rs +++ b/src/x25519.rs @@ -12,7 +12,7 @@ pub(crate) struct Recipient(pub(crate) age::x25519::Recipient); #[pymethods] impl Recipient { #[classmethod] - fn from_str(_cls: &PyType, v: &str) -> PyResult { + fn from_str(_cls: &Bound<'_, PyType>, v: &str) -> PyResult { age::x25519::Recipient::from_str(v) .map(Self) .map_err(RecipientError::new_err) @@ -30,12 +30,12 @@ pub(crate) struct Identity(pub(crate) age::x25519::Identity); #[pymethods] impl Identity { #[classmethod] - fn generate(_cls: &PyType) -> Self { + fn generate(_cls: &Bound<'_, PyType>) -> Self { Self(age::x25519::Identity::generate()) } #[classmethod] - fn from_str(_cls: &PyType, v: &str) -> PyResult { + fn from_str(_cls: &Bound<'_, PyType>, v: &str) -> PyResult { let identity = age::x25519::Identity::from_str(v) .map_err(|e| IdentityError::new_err(e.to_string()))?; @@ -51,8 +51,8 @@ impl Identity { } } -pub(crate) fn module(py: Python) -> PyResult<&PyModule> { - let module = PyModule::new(py, "x25519")?; +pub(crate) fn module(py: Python) -> PyResult> { + let module = PyModule::new_bound(py, "x25519")?; module.add_class::()?; module.add_class::()?; From e92ecde651bc48ce3e9bfaee4b92563b4569fab9 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 8 Apr 2024 09:58:37 -0400 Subject: [PATCH 17/31] build(deps): bump pyo3 from 0.21.0 to 0.21.1 in the cargo group (#65) Bumps the cargo group with 1 update: [pyo3](https://github.com/pyo3/pyo3). Updates `pyo3` from 0.21.0 to 0.21.1 - [Release notes](https://github.com/pyo3/pyo3/releases) - [Changelog](https://github.com/PyO3/pyo3/blob/main/CHANGELOG.md) - [Commits](https://github.com/pyo3/pyo3/compare/v0.21.0...v0.21.1) --- updated-dependencies: - dependency-name: pyo3 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: cargo ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- Cargo.lock | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 9ff7704..e4a3e17 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -858,9 +858,9 @@ dependencies = [ [[package]] name = "pyo3" -version = "0.21.0" +version = "0.21.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a02a88a17e74cadbc8ce77855e1d6c8ad0ab82901a4a9b5046bd01c1c0bd95cd" +checksum = "a7a8b1990bd018761768d5e608a13df8bd1ac5f678456e0f301bb93e5f3ea16b" dependencies = [ "cfg-if", "indoc", @@ -876,9 +876,9 @@ dependencies = [ [[package]] name = "pyo3-build-config" -version = "0.21.0" +version = "0.21.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a5eb0b6ecba38961f6f4bd6cd5906dfab3cd426ff37b2eed5771006aa31656f1" +checksum = "650dca34d463b6cdbdb02b1d71bfd6eb6b6816afc708faebb3bac1380ff4aef7" dependencies = [ "once_cell", "target-lexicon", @@ -886,9 +886,9 @@ dependencies = [ [[package]] name = "pyo3-ffi" -version = "0.21.0" +version = "0.21.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ba8a6e48a29b5d22e4fdaf132d8ba8d3203ee9f06362d48f244346902a594ec3" +checksum = "09a7da8fc04a8a2084909b59f29e1b8474decac98b951d77b80b26dc45f046ad" dependencies = [ "libc", "pyo3-build-config", @@ -896,9 +896,9 @@ dependencies = [ [[package]] name = "pyo3-macros" -version = "0.21.0" +version = "0.21.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4e80493c5965f94a747d0782a607b2328a4eea5391327b152b00e2f3b001cede" +checksum = "4b8a199fce11ebb28e3569387228836ea98110e43a804a530a9fd83ade36d513" dependencies = [ "proc-macro2", "pyo3-macros-backend", @@ -908,9 +908,9 @@ dependencies = [ [[package]] name = "pyo3-macros-backend" -version = "0.21.0" +version = "0.21.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fcd7d86f42004025200e12a6a8119bd878329e6fddef8178eaafa4e4b5906c5b" +checksum = "93fbbfd7eb553d10036513cb122b888dcd362a945a00b06c165f2ab480d4cc3b" dependencies = [ "heck", "proc-macro2", From eac37b34037ca397e00b550571390e02d535de03 Mon Sep 17 00:00:00 2001 From: Vika Date: Sat, 13 Apr 2024 03:15:45 +0300 Subject: [PATCH 18/31] feat: plugin support (#56) API surface exposed is equivalent to the Rust API, including plugin callbacks (duck-typed at runtime, exposed in type stubs as a `pyrage.plugin.Callbacks` protocol, all of which's methods are required to be implemented at runtime, otherwise `AttributeError` is thrown). Non-`Clone`ability of plugin instances is resolved by putting them behind an `Arc`. Perhaps a more elegant solution could be produced later, by someone with more knowledge of PyO3 internals. This was tested with rage's example `age-unencrypted-plugin` which happens to exercise the `display_message` callback, and additionally with `age-plugin-tpm` to exercise actual encryption functionality. Typing stubs are amended to cover the new API surface. Conformance to type-stubs was checked by writing a short Python program exercising the functionality and type-checking it using `mypy` with the type stubs installed. --- Cargo.lock | 174 ++++++++++++++++++++-- Cargo.toml | 2 +- pyrage-stubs/pyrage-stubs/__init__.pyi | 6 +- pyrage-stubs/pyrage-stubs/plugin.pyi | 48 ++++++ src/lib.rs | 17 ++- src/plugin.rs | 198 +++++++++++++++++++++++++ 6 files changed, 430 insertions(+), 15 deletions(-) create mode 100644 pyrage-stubs/pyrage-stubs/plugin.pyi create mode 100644 src/plugin.rs diff --git a/Cargo.lock b/Cargo.lock index e4a3e17..4b857bf 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -68,6 +68,8 @@ dependencies = [ "scrypt", "sha2", "subtle", + "which", + "wsl", "x25519-dalek", "zeroize", ] @@ -87,6 +89,7 @@ dependencies = [ "rand", "secrecy", "sha2", + "tempfile", ] [[package]] @@ -136,6 +139,12 @@ version = "1.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" +[[package]] +name = "bitflags" +version = "2.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cf4b9d6a944f767f8e5e0db018570623c85f3d925ac718db4e06d0187adb21c1" + [[package]] name = "block-buffer" version = "0.10.4" @@ -334,12 +343,34 @@ dependencies = [ "syn 2.0.39", ] +[[package]] +name = "either" +version = "1.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "11157ac094ffbdde99aa67b23417ebdd801842852b500e395a45a9c0aac03e4a" + [[package]] name = "equivalent" version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5" +[[package]] +name = "errno" +version = "0.3.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a258e46cdc063eb8519c00b9fc845fc47bcfca4130e2f08e88665ceda8474245" +dependencies = [ + "libc", + "windows-sys", +] + +[[package]] +name = "fastrand" +version = "2.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "658bd65b1cf4c852a3cc96f18a8ce7b5640f6b703f905c7d74532294c2a63984" + [[package]] name = "fiat-crypto" version = "0.2.6" @@ -460,6 +491,15 @@ dependencies = [ "digest", ] +[[package]] +name = "home" +version = "0.5.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e3d1354bf6b7235cb4a0576c2619fd4ed18183f689b12b006a0ee7329eeff9a5" +dependencies = [ + "windows-sys", +] + [[package]] name = "i18n-config" version = "0.4.6" @@ -601,6 +641,12 @@ version = "0.2.8" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4ec2a862134d2a7d32d7983ddcdd1c4923530833c9f2ea1a44fc5fa473989058" +[[package]] +name = "linux-raw-sys" +version = "0.4.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "01cda141df6706de531b6c46c3a33ecca755538219bd484262fa09410c13539c" + [[package]] name = "lock_api" version = "0.4.11" @@ -728,7 +774,7 @@ dependencies = [ "libc", "redox_syscall", "smallvec", - "windows-targets", + "windows-targets 0.48.5", ] [[package]] @@ -973,7 +1019,7 @@ version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4722d768eff46b75989dd134e5c353f0d6296e5aaa3132e776cbdb56be7731aa" dependencies = [ - "bitflags", + "bitflags 1.3.2", ] [[package]] @@ -1045,6 +1091,19 @@ dependencies = [ "semver", ] +[[package]] +name = "rustix" +version = "0.38.28" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "72e572a5e8ca657d7366229cdde4bd14c4eb5499a9573d4d366fe1b599daa316" +dependencies = [ + "bitflags 2.5.0", + "errno", + "libc", + "linux-raw-sys", + "windows-sys", +] + [[package]] name = "salsa20" version = "0.10.2" @@ -1221,6 +1280,19 @@ version = "0.12.12" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "14c39fd04924ca3a864207c66fc2cd7d22d7c016007f9ce846cbb9326331930a" +[[package]] +name = "tempfile" +version = "3.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "01ce4141aa927a6d1bd34a041795abd0db1cccba5d5f24b009f694bdf3a1f3fa" +dependencies = [ + "cfg-if", + "fastrand", + "redox_syscall", + "rustix", + "windows-sys", +] + [[package]] name = "thiserror" version = "1.0.50" @@ -1371,6 +1443,18 @@ version = "0.11.0+wasi-snapshot-preview1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" +[[package]] +name = "which" +version = "4.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "87ba24419a2078cd2b0f2ede2691b6c66d8e47836da3b6db8265ebad47afbfc7" +dependencies = [ + "either", + "home", + "once_cell", + "rustix", +] + [[package]] name = "winapi" version = "0.3.9" @@ -1402,19 +1486,43 @@ version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" +[[package]] +name = "windows-sys" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "282be5f36a8ce781fad8c8ae18fa3f9beff57ec1b52cb3de0789201425d9a33d" +dependencies = [ + "windows-targets 0.52.4", +] + [[package]] name = "windows-targets" version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9a2fa6e2155d7247be68c096456083145c183cbbbc2764150dda45a87197940c" dependencies = [ - "windows_aarch64_gnullvm", - "windows_aarch64_msvc", - "windows_i686_gnu", - "windows_i686_msvc", - "windows_x86_64_gnu", - "windows_x86_64_gnullvm", - "windows_x86_64_msvc", + "windows_aarch64_gnullvm 0.48.5", + "windows_aarch64_msvc 0.48.5", + "windows_i686_gnu 0.48.5", + "windows_i686_msvc 0.48.5", + "windows_x86_64_gnu 0.48.5", + "windows_x86_64_gnullvm 0.48.5", + "windows_x86_64_msvc 0.48.5", +] + +[[package]] +name = "windows-targets" +version = "0.52.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7dd37b7e5ab9018759f893a1952c9420d060016fc19a472b4bb20d1bdd694d1b" +dependencies = [ + "windows_aarch64_gnullvm 0.52.4", + "windows_aarch64_msvc 0.52.4", + "windows_i686_gnu 0.52.4", + "windows_i686_msvc 0.52.4", + "windows_x86_64_gnu 0.52.4", + "windows_x86_64_gnullvm 0.52.4", + "windows_x86_64_msvc 0.52.4", ] [[package]] @@ -1423,42 +1531,84 @@ version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2b38e32f0abccf9987a4e3079dfb67dcd799fb61361e53e2882c3cbaf0d905d8" +[[package]] +name = "windows_aarch64_gnullvm" +version = "0.52.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bcf46cf4c365c6f2d1cc93ce535f2c8b244591df96ceee75d8e83deb70a9cac9" + [[package]] name = "windows_aarch64_msvc" version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "dc35310971f3b2dbbf3f0690a219f40e2d9afcf64f9ab7cc1be722937c26b4bc" +[[package]] +name = "windows_aarch64_msvc" +version = "0.52.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "da9f259dd3bcf6990b55bffd094c4f7235817ba4ceebde8e6d11cd0c5633b675" + [[package]] name = "windows_i686_gnu" version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a75915e7def60c94dcef72200b9a8e58e5091744960da64ec734a6c6e9b3743e" +[[package]] +name = "windows_i686_gnu" +version = "0.52.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b474d8268f99e0995f25b9f095bc7434632601028cf86590aea5c8a5cb7801d3" + [[package]] name = "windows_i686_msvc" version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8f55c233f70c4b27f66c523580f78f1004e8b5a8b659e05a4eb49d4166cca406" +[[package]] +name = "windows_i686_msvc" +version = "0.52.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1515e9a29e5bed743cb4415a9ecf5dfca648ce85ee42e15873c3cd8610ff8e02" + [[package]] name = "windows_x86_64_gnu" version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "53d40abd2583d23e4718fddf1ebec84dbff8381c07cae67ff7768bbf19c6718e" +[[package]] +name = "windows_x86_64_gnu" +version = "0.52.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5eee091590e89cc02ad514ffe3ead9eb6b660aedca2183455434b93546371a03" + [[package]] name = "windows_x86_64_gnullvm" version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0b7b52767868a23d5bab768e390dc5f5c55825b6d30b86c844ff2dc7414044cc" +[[package]] +name = "windows_x86_64_gnullvm" +version = "0.52.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "77ca79f2451b49fa9e2af39f0747fe999fcda4f5e241b2898624dca97a1f2177" + [[package]] name = "windows_x86_64_msvc" version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ed94fce61571a4006852b7389a063ab983c02eb1bb37b47f8272ce92d06d9538" +[[package]] +name = "windows_x86_64_msvc" +version = "0.52.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "32b752e52a2da0ddfbdbcc6fceadfeede4c939ed16d13e648833a61dfb611ed8" + [[package]] name = "winnow" version = "0.5.26" @@ -1468,6 +1618,12 @@ dependencies = [ "memchr", ] +[[package]] +name = "wsl" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f8dab7ac864710bdea6594becbea5b5050333cf34fefb0dc319567eb347950d4" + [[package]] name = "x25519-dalek" version = "2.0.0" diff --git a/Cargo.toml b/Cargo.toml index 52c6c53..66ad89b 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -18,7 +18,7 @@ crate-type = ["cdylib"] [dependencies] age-core = "0.10" -age = { version = "0.10", features = ["ssh"] } +age = { version = "0.10", features = ["ssh", "plugin"] } pyo3 = { version = "0.21", features = [ "extension-module", "abi3", diff --git a/pyrage-stubs/pyrage-stubs/__init__.pyi b/pyrage-stubs/pyrage-stubs/__init__.pyi index d44dd2d..8119866 100644 --- a/pyrage-stubs/pyrage-stubs/__init__.pyi +++ b/pyrage-stubs/pyrage-stubs/__init__.pyi @@ -1,9 +1,9 @@ from typing import Sequence, Union -from pyrage import ssh, x25519, passphrase +from pyrage import ssh, x25519, passphrase, plugin -Identity = Union[ssh.Identity, x25519.Identity] -Recipient = Union[ssh.Recipient, x25519.Recipient] +Identity = Union[ssh.Identity, x25519.Identity, plugin.IdentityPluginV1] +Recipient = Union[ssh.Recipient, x25519.Recipient, plugin.RecipientPluginV1] class RecipientError(Exception): diff --git a/pyrage-stubs/pyrage-stubs/plugin.pyi b/pyrage-stubs/pyrage-stubs/plugin.pyi new file mode 100644 index 0000000..d927bc0 --- /dev/null +++ b/pyrage-stubs/pyrage-stubs/plugin.pyi @@ -0,0 +1,48 @@ +from __future__ import annotations +from typing import Sequence, Self, Optional, Protocol + + +class Callbacks(Protocol): + def display_message(self, message: str) -> None: + ... + + def confirm(self, message: str, yes_string: str, no_string: Optional[str]) -> Optional[bool]: + ... + + def request_public_string(self, description: str) -> Optional[str]: + ... + + def request_passphrase(self, description: str) -> Optional[str]: + ... + + +class Recipient: + @classmethod + def from_str(cls, v: str) -> Recipient: + ... + + def plugin(self) -> str: + ... + + +class RecipientPluginV1: + def __new__(cls, plugin_name: str, recipients: Sequence[Recipient], identities: Sequence[Identity], callbacks: Callbacks) -> Self: + ... + + +class Identity: + @classmethod + def from_str(cls, v: str) -> Identity: + ... + + @classmethod + def default_for_plugin(cls, plugin: str) -> Identity: + ... + + def plugin(self) -> str: + ... + + +class IdentityPluginV1: + def __new__(cls, plugin_name: str, identities: Sequence[Identity], callbacks: Callbacks) -> Self: + ... diff --git a/src/lib.rs b/src/lib.rs index 216bca8..b313883 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -19,6 +19,7 @@ use pyo3::{ }; mod passphrase; +mod plugin; mod ssh; mod x25519; @@ -65,7 +66,7 @@ macro_rules! recipient_traits { } } -recipient_traits!(ssh::Recipient, x25519::Recipient); +recipient_traits!(ssh::Recipient, x25519::Recipient, plugin::RecipientPluginV1); // This macro generates two trait impls for each passed in type: // @@ -89,7 +90,7 @@ macro_rules! identity_traits { } } -identity_traits!(ssh::Identity, x25519::Identity); +identity_traits!(ssh::Identity, x25519::Identity, plugin::IdentityPluginV1); // This is where the magic happens, and why we need to do the trait dance // above: `FromPyObject` is a third-party trait, so we need to implement it @@ -104,6 +105,8 @@ impl<'source> FromPyObject<'source> for Box { Ok(Box::new(recipient) as Box) } else if let Ok(recipient) = ob.extract::() { Ok(Box::new(recipient) as Box) + } else if let Ok(recipient) = ob.extract::() { + Ok(Box::new(recipient) as Box) } else { Err(PyTypeError::new_err( "invalid type (expected a recipient type)", @@ -120,6 +123,8 @@ impl<'source> FromPyObject<'source> for Box { Ok(Box::new(identity) as Box) } else if let Ok(identity) = ob.extract::() { Ok(Box::new(identity) as Box) + } else if let Ok(identity) = ob.extract::() { + Ok(Box::new(identity) as Box) } else { Err(PyTypeError::new_err( "invalid type (expected an identity type)", @@ -279,6 +284,14 @@ fn pyrage(py: Python, m: &Bound<'_, PyModule>) -> PyResult<()> { ); m.add_submodule(&passphrase)?; + let plugin = plugin::module(py)?; + py_run!( + py, + plugin, + "import sys; sys.modules['pyrage.plugin'] = plugin" + ); + m.add_submodule(&plugin)?; + m.add("IdentityError", py.get_type_bound::())?; m.add("RecipientError", py.get_type_bound::())?; diff --git a/src/plugin.rs b/src/plugin.rs new file mode 100644 index 0000000..cb81e8c --- /dev/null +++ b/src/plugin.rs @@ -0,0 +1,198 @@ +use std::str::FromStr; +use std::sync::Arc; + +use pyo3::{prelude::*, types::PyType}; + +use crate::{DecryptError, EncryptError, IdentityError, RecipientError}; + +/// Hack, because the orphan rule would prevent us from deriving a +/// foreign trait on a foreign object. Instead, define a newtype. +/// +/// Inner type is PyAny, because we do duck-typing at runtime, and +/// declaring a protocol in the type stubs. +#[derive(Clone)] +pub(crate) struct PyCallbacks(Py); + +impl PyCallbacks { + fn new(inner: Bound<'_, PyAny>) -> PyResult { + Ok(Self(inner.unbind())) + } +} + +// Since we have no way to pass errors from these callbacks, we might +// as well panic. +// +// These callbacks don't look like they're supposed to fail anyway. +impl age::Callbacks for PyCallbacks { + fn display_message(&self, message: &str) { + Python::with_gil(|py| { + self.0 + .call_method1(py, pyo3::intern!(py, "display_message"), (message,)) + .expect("`display_message` callback error") + }); + } + fn confirm(&self, message: &str, yes_string: &str, no_string: Option<&str>) -> Option { + Python::with_gil(|py| { + self.0 + .call_method1( + py, + pyo3::intern!(py, "confirm"), + (message, yes_string, no_string), + ) + .expect("`confirm` callback error") + .extract::>(py) + }) + .expect("type error in `confirm` callback") + } + fn request_public_string(&self, description: &str) -> Option { + Python::with_gil(|py| { + self.0 + .call_method1( + py, + pyo3::intern!(py, "request_public_string"), + (description,), + ) + .expect("`request_public_string` callback error") + .extract::>(py) + }) + .expect("type error in `request_public_string` callback") + } + fn request_passphrase(&self, description: &str) -> Option { + Python::with_gil(|py| { + self.0 + .call_method1(py, pyo3::intern!(py, "request_passphrase"), (description,)) + .expect("`request_passphrase` callback error") + .extract::>(py) + }) + .expect("type error in `request_passphrase` callback") + .map(age::secrecy::SecretString::new) + } +} + +#[pyclass(module = "pyrage.plugin")] +#[derive(Clone)] +pub(crate) struct Recipient(pub(crate) age::plugin::Recipient); + +#[pymethods] +impl Recipient { + #[classmethod] + fn from_str(_cls: &Bound<'_, PyType>, v: &str) -> PyResult { + age::plugin::Recipient::from_str(v) + .map(Self) + .map_err(RecipientError::new_err) + } + + fn plugin(&self) -> String { + self.0.plugin().to_owned() + } + + fn __str__(&self) -> String { + self.0.to_string() + } +} + +#[pyclass(module = "pyrage.plugin")] +#[derive(Clone)] +pub(crate) struct Identity(pub(crate) age::plugin::Identity); + +#[pymethods] +impl Identity { + #[classmethod] + fn from_str(_cls: &Bound<'_, PyType>, v: &str) -> PyResult { + age::plugin::Identity::from_str(v) + .map(Self) + .map_err(|e| IdentityError::new_err(e.to_string())) + } + + #[classmethod] + fn default_for_plugin(_cls: &Bound<'_, PyType>, plugin: &str) -> Self { + Self(age::plugin::Identity::default_for_plugin(plugin)) + } + + fn plugin(&self) -> String { + self.0.plugin().to_owned() + } + + fn __str__(&self) -> String { + self.0.to_string() + } +} + +#[pyclass(module = "pyrage.plugin")] +#[derive(Clone)] +pub(crate) struct RecipientPluginV1(pub(crate) Arc>); + +#[pymethods] +impl RecipientPluginV1 { + #[new] + #[pyo3( + text_signature = "(plugin_name: str, recipients: typing.Sequence[Recipient], identities: typing.Sequence[Identity], callbacks: Callbacks)" + )] + fn new( + _py: Python<'_>, + plugin_name: &str, + recipients: Vec, + identities: Vec, + callbacks: Bound<'_, PyAny>, + ) -> PyResult { + age::plugin::RecipientPluginV1::new( + plugin_name, + recipients + .into_iter() + .map(|i| i.0) + .collect::>() + .as_slice(), + identities + .into_iter() + .map(|i| i.0) + .collect::>() + .as_slice(), + PyCallbacks::new(callbacks)?, + ) + .map(Arc::new) + .map(Self) + .map_err(|err| EncryptError::new_err(err.to_string())) + } +} + +#[pyclass(module = "pyrage.plugin")] +#[derive(Clone)] +pub(crate) struct IdentityPluginV1(pub(crate) Arc>); + +#[pymethods] +impl IdentityPluginV1 { + #[new] + #[pyo3( + text_signature = "(plugin_name: str, identities: typing.Sequence[Identity], callbacks: Callbacks)" + )] + fn new( + _py: Python<'_>, + plugin_name: &str, + identities: Vec, + callbacks: Bound<'_, PyAny>, + ) -> PyResult { + age::plugin::IdentityPluginV1::new( + plugin_name, + identities + .into_iter() + .map(|i| i.0) + .collect::>() + .as_slice(), + PyCallbacks::new(callbacks)?, + ) + .map(Arc::new) + .map(Self) + .map_err(|err| DecryptError::new_err(err.to_string())) + } +} + +pub(crate) fn module(py: Python<'_>) -> PyResult> { + let module = PyModule::new_bound(py, "plugin")?; + + module.add_class::()?; + module.add_class::()?; + module.add_class::()?; + module.add_class::()?; + + Ok(module) +} From 0e27bf96b56d3a2d59d905659a99e287a855c923 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 22 Apr 2024 09:19:26 -0400 Subject: [PATCH 19/31] build(deps): bump pyo3 from 0.21.1 to 0.21.2 in the cargo group (#66) Bumps the cargo group with 1 update: [pyo3](https://github.com/pyo3/pyo3). Updates `pyo3` from 0.21.1 to 0.21.2 - [Release notes](https://github.com/pyo3/pyo3/releases) - [Changelog](https://github.com/PyO3/pyo3/blob/main/CHANGELOG.md) - [Commits](https://github.com/pyo3/pyo3/compare/v0.21.1...v0.21.2) --- updated-dependencies: - dependency-name: pyo3 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: cargo ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- Cargo.lock | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 4b857bf..b32dbc4 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -904,9 +904,9 @@ dependencies = [ [[package]] name = "pyo3" -version = "0.21.1" +version = "0.21.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a7a8b1990bd018761768d5e608a13df8bd1ac5f678456e0f301bb93e5f3ea16b" +checksum = "a5e00b96a521718e08e03b1a622f01c8a8deb50719335de3f60b3b3950f069d8" dependencies = [ "cfg-if", "indoc", @@ -922,9 +922,9 @@ dependencies = [ [[package]] name = "pyo3-build-config" -version = "0.21.1" +version = "0.21.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "650dca34d463b6cdbdb02b1d71bfd6eb6b6816afc708faebb3bac1380ff4aef7" +checksum = "7883df5835fafdad87c0d888b266c8ec0f4c9ca48a5bed6bbb592e8dedee1b50" dependencies = [ "once_cell", "target-lexicon", @@ -932,9 +932,9 @@ dependencies = [ [[package]] name = "pyo3-ffi" -version = "0.21.1" +version = "0.21.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "09a7da8fc04a8a2084909b59f29e1b8474decac98b951d77b80b26dc45f046ad" +checksum = "01be5843dc60b916ab4dad1dca6d20b9b4e6ddc8e15f50c47fe6d85f1fb97403" dependencies = [ "libc", "pyo3-build-config", @@ -942,9 +942,9 @@ dependencies = [ [[package]] name = "pyo3-macros" -version = "0.21.1" +version = "0.21.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4b8a199fce11ebb28e3569387228836ea98110e43a804a530a9fd83ade36d513" +checksum = "77b34069fc0682e11b31dbd10321cbf94808394c56fd996796ce45217dfac53c" dependencies = [ "proc-macro2", "pyo3-macros-backend", @@ -954,9 +954,9 @@ dependencies = [ [[package]] name = "pyo3-macros-backend" -version = "0.21.1" +version = "0.21.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "93fbbfd7eb553d10036513cb122b888dcd362a945a00b06c165f2ab480d4cc3b" +checksum = "08260721f32db5e1a5beae69a55553f56b99bd0e1c3e6e0a5e8851a9d0f5a85c" dependencies = [ "heck", "proc-macro2", From 1eb5c0b76f73277097755818a64fef16efbeb594 Mon Sep 17 00:00:00 2001 From: William Woodruff Date: Thu, 16 May 2024 16:16:57 -0400 Subject: [PATCH 20/31] pyrage-stubs: 1.1.1 Closes #67. Signed-off-by: William Woodruff --- pyrage-stubs/pyproject.toml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pyrage-stubs/pyproject.toml b/pyrage-stubs/pyproject.toml index b019b9f..45d3aca 100644 --- a/pyrage-stubs/pyproject.toml +++ b/pyrage-stubs/pyproject.toml @@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta" [project] name = "pyrage-stubs" -version = "1.1.0" +version = "1.1.1" description = "A PEP 561 stub package for pyrage's types" readme = "README.md" license = { file = "LICENSE" } @@ -24,4 +24,4 @@ Issues = "https://github.com/woodruffw/pyrage/issues" Source = "https://github.com/woodruffw/pyrage/tree/main/pyrage-stubs" [tool.setuptools.package-data] -"*" = ["*.pyi"] \ No newline at end of file +"*" = ["*.pyi"] From c2ab458f1c65e93ac0ae80ce91b80fce5e2c18c1 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 17 Jun 2024 09:56:49 -0400 Subject: [PATCH 21/31] build(deps): bump pypa/gh-action-pypi-publish in the actions group (#68) Bumps the actions group with 1 update: [pypa/gh-action-pypi-publish](https://github.com/pypa/gh-action-pypi-publish). Updates `pypa/gh-action-pypi-publish` from 1.8.14 to 1.9.0 - [Release notes](https://github.com/pypa/gh-action-pypi-publish/releases) - [Commits](https://github.com/pypa/gh-action-pypi-publish/compare/v1.8.14...v1.9.0) --- updated-dependencies: - dependency-name: pypa/gh-action-pypi-publish dependency-type: direct:production update-type: version-update:semver-minor dependency-group: actions ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .github/workflows/release-stubs.yml | 2 +- .github/workflows/release.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/release-stubs.yml b/.github/workflows/release-stubs.yml index 44dec1e..7a40661 100644 --- a/.github/workflows/release-stubs.yml +++ b/.github/workflows/release-stubs.yml @@ -48,4 +48,4 @@ jobs: - name: publish if: ${{ !inputs.dry-run }} - uses: pypa/gh-action-pypi-publish@v1.8.14 + uses: pypa/gh-action-pypi-publish@v1.9.0 diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 3695a7c..0ebf299 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -98,7 +98,7 @@ jobs: merge-multiple: true - name: publish - uses: pypa/gh-action-pypi-publish@v1.8.14 + uses: pypa/gh-action-pypi-publish@v1.9.0 - name: sign uses: sigstore/gh-action-sigstore-python@v2.1.1 From 78c10ca4533c833f204d802427147a6f52b8fe5f Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 1 Jul 2024 10:53:57 -0400 Subject: [PATCH 22/31] build(deps): bump pyo3 from 0.21.2 to 0.22.0 in the cargo group (#69) * build(deps): bump pyo3 from 0.21.2 to 0.22.0 in the cargo group Bumps the cargo group with 1 update: [pyo3](https://github.com/pyo3/pyo3). Updates `pyo3` from 0.21.2 to 0.22.0 - [Release notes](https://github.com/pyo3/pyo3/releases) - [Changelog](https://github.com/PyO3/pyo3/blob/main/CHANGELOG.md) - [Commits](https://github.com/pyo3/pyo3/compare/v0.21.2...v0.22.0) --- updated-dependencies: - dependency-name: pyo3 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: cargo ... Signed-off-by: dependabot[bot] * pyo3 API changes Signed-off-by: William Woodruff --------- Signed-off-by: dependabot[bot] Signed-off-by: William Woodruff Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: William Woodruff --- Cargo.lock | 64 +++++++++++++++++++++++++++--------------------------- Cargo.toml | 3 ++- src/lib.rs | 4 ++-- 3 files changed, 36 insertions(+), 35 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index b32dbc4..ac6566e 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -294,7 +294,7 @@ checksum = "f46882e17999c6cc590af592290432be3bce0428cb0d5f8b6715e4dc7b383eb3" dependencies = [ "proc-macro2", "quote", - "syn 2.0.39", + "syn 2.0.68", ] [[package]] @@ -340,7 +340,7 @@ checksum = "487585f4d0c6655fe74905e2504d8ad6908e4db67f744eb140876906c2f3175d" dependencies = [ "proc-macro2", "quote", - "syn 2.0.39", + "syn 2.0.68", ] [[package]] @@ -469,9 +469,9 @@ checksum = "290f1a1d9242c78d09ce40a5e87e7554ee637af1351968159f4952f028f75604" [[package]] name = "heck" -version = "0.4.1" +version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "95505c38b4572b2d910cecb0281560f54b440a19336cbbcb27bf6ce6adc6f5a8" +checksum = "2304e00983f87ffb38b55b444b5e3b60a884b5d30c0fca7d82fe33449bbe55ea" [[package]] name = "hkdf" @@ -552,7 +552,7 @@ dependencies = [ "proc-macro2", "quote", "strsim", - "syn 2.0.39", + "syn 2.0.68", "unic-langid", ] @@ -566,7 +566,7 @@ dependencies = [ "i18n-config", "proc-macro2", "quote", - "syn 2.0.39", + "syn 2.0.68", ] [[package]] @@ -804,7 +804,7 @@ checksum = "4359fd9c9171ec6e8c62926d6faaf553a8dc3f64e1507e76da7911b4f6a04405" dependencies = [ "proc-macro2", "quote", - "syn 2.0.39", + "syn 2.0.68", ] [[package]] @@ -895,24 +895,24 @@ dependencies = [ [[package]] name = "proc-macro2" -version = "1.0.70" +version = "1.0.86" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "39278fbbf5fb4f646ce651690877f89d1c5811a3d4acb27700c1cb3cdb78fd3b" +checksum = "5e719e8df665df0d1c8fbfd238015744736151d4445ec0836b8e628aae103b77" dependencies = [ "unicode-ident", ] [[package]] name = "pyo3" -version = "0.21.2" +version = "0.22.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a5e00b96a521718e08e03b1a622f01c8a8deb50719335de3f60b3b3950f069d8" +checksum = "1962a33ed2a201c637fc14a4e0fd4e06e6edfdeee6a5fede0dab55507ad74cf7" dependencies = [ "cfg-if", "indoc", "libc", "memoffset", - "parking_lot", + "once_cell", "portable-atomic", "pyo3-build-config", "pyo3-ffi", @@ -922,9 +922,9 @@ dependencies = [ [[package]] name = "pyo3-build-config" -version = "0.21.2" +version = "0.22.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7883df5835fafdad87c0d888b266c8ec0f4c9ca48a5bed6bbb592e8dedee1b50" +checksum = "ab7164b2202753bd33afc7f90a10355a719aa973d1f94502c50d06f3488bc420" dependencies = [ "once_cell", "target-lexicon", @@ -932,9 +932,9 @@ dependencies = [ [[package]] name = "pyo3-ffi" -version = "0.21.2" +version = "0.22.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "01be5843dc60b916ab4dad1dca6d20b9b4e6ddc8e15f50c47fe6d85f1fb97403" +checksum = "c6424906ca49013c0829c5c1ed405e20e2da2dc78b82d198564880a704e6a7b7" dependencies = [ "libc", "pyo3-build-config", @@ -942,27 +942,27 @@ dependencies = [ [[package]] name = "pyo3-macros" -version = "0.21.2" +version = "0.22.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "77b34069fc0682e11b31dbd10321cbf94808394c56fd996796ce45217dfac53c" +checksum = "82b2f19e153122d64afd8ce7aaa72f06a00f52e34e1d1e74b6d71baea396460a" dependencies = [ "proc-macro2", "pyo3-macros-backend", "quote", - "syn 2.0.39", + "syn 2.0.68", ] [[package]] name = "pyo3-macros-backend" -version = "0.21.2" +version = "0.22.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "08260721f32db5e1a5beae69a55553f56b99bd0e1c3e6e0a5e8851a9d0f5a85c" +checksum = "dd698c04cac17cf0fe63d47790ab311b8b25542f5cb976b65c374035c50f1eef" dependencies = [ "heck", "proc-macro2", "pyo3-build-config", "quote", - "syn 2.0.39", + "syn 2.0.68", ] [[package]] @@ -976,9 +976,9 @@ dependencies = [ [[package]] name = "quote" -version = "1.0.33" +version = "1.0.36" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5267fca4496028628a95160fc423a33e8b2e6af8a5302579e322e4b520293cae" +checksum = "0fa76aaf39101c457836aec0ce2316dbdc3ab723cdda1c6bd4e6ad4208acaca7" dependencies = [ "proc-macro2", ] @@ -1062,7 +1062,7 @@ dependencies = [ "proc-macro2", "quote", "rust-embed-utils", - "syn 2.0.39", + "syn 2.0.68", "walkdir", ] @@ -1186,7 +1186,7 @@ checksum = "43576ca501357b9b071ac53cdc7da8ef0cbd9493d8df094cd821777ea6e894d3" dependencies = [ "proc-macro2", "quote", - "syn 2.0.39", + "syn 2.0.68", ] [[package]] @@ -1265,9 +1265,9 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.39" +version = "2.0.68" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "23e78b90f2fcf45d3e842032ce32e3f2d1545ba6636271dcbf24fa306d87be7a" +checksum = "901fa70d88b9d6c98022e23b4136f9f3e54e4662c3bc1bd1d84a42a9a0f0c1e9" dependencies = [ "proc-macro2", "quote", @@ -1276,9 +1276,9 @@ dependencies = [ [[package]] name = "target-lexicon" -version = "0.12.12" +version = "0.12.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "14c39fd04924ca3a864207c66fc2cd7d22d7c016007f9ce846cbb9326331930a" +checksum = "e1fc403891a21bcfb7c37834ba66a547a8f402146eba7265b5a6d88059c9ff2f" [[package]] name = "tempfile" @@ -1310,7 +1310,7 @@ checksum = "266b2e40bc00e5a6c09c3584011e08b06f123c00362c92b975ba9843aaaa14b8" dependencies = [ "proc-macro2", "quote", - "syn 2.0.39", + "syn 2.0.68", ] [[package]] @@ -1653,5 +1653,5 @@ checksum = "ce36e65b0d2999d2aafac989fb249189a141aee1f53c612c1f37d72631959f69" dependencies = [ "proc-macro2", "quote", - "syn 2.0.39", + "syn 2.0.68", ] diff --git a/Cargo.toml b/Cargo.toml index 66ad89b..10ed610 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -19,8 +19,9 @@ crate-type = ["cdylib"] [dependencies] age-core = "0.10" age = { version = "0.10", features = ["ssh", "plugin"] } -pyo3 = { version = "0.21", features = [ +pyo3 = { version = "0.22", features = [ "extension-module", "abi3", "abi3-py38", + "py-clone", ] } diff --git a/src/lib.rs b/src/lib.rs index b313883..3f104bd 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -100,7 +100,7 @@ identity_traits!(ssh::Identity, x25519::Identity, plugin::IdentityPluginV1); // `PyAny` into each concrete recipient type, which we then perform the trait // cast on. impl<'source> FromPyObject<'source> for Box { - fn extract(ob: &'source PyAny) -> PyResult { + fn extract_bound(ob: &Bound<'source, PyAny>) -> PyResult { if let Ok(recipient) = ob.extract::() { Ok(Box::new(recipient) as Box) } else if let Ok(recipient) = ob.extract::() { @@ -118,7 +118,7 @@ impl<'source> FromPyObject<'source> for Box { // Similar to the above: we try to turn the `PyAny` into a concrete identity type, // which we then perform the trait cast on. impl<'source> FromPyObject<'source> for Box { - fn extract(ob: &'source PyAny) -> PyResult { + fn extract_bound(ob: &Bound<'source, PyAny>) -> PyResult { if let Ok(identity) = ob.extract::() { Ok(Box::new(identity) as Box) } else if let Ok(identity) = ob.extract::() { From 6025409179dcabb1e7ba25a8a63486cc36c3c68c Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 8 Jul 2024 10:32:34 -0400 Subject: [PATCH 23/31] build(deps): bump pyo3 from 0.22.0 to 0.22.1 in the cargo group (#70) Bumps the cargo group with 1 update: [pyo3](https://github.com/pyo3/pyo3). Updates `pyo3` from 0.22.0 to 0.22.1 - [Release notes](https://github.com/pyo3/pyo3/releases) - [Changelog](https://github.com/PyO3/pyo3/blob/main/CHANGELOG.md) - [Commits](https://github.com/pyo3/pyo3/compare/v0.22.0...v0.22.1) --- updated-dependencies: - dependency-name: pyo3 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: cargo ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- Cargo.lock | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index ac6566e..0d5d5f9 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -904,9 +904,9 @@ dependencies = [ [[package]] name = "pyo3" -version = "0.22.0" +version = "0.22.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1962a33ed2a201c637fc14a4e0fd4e06e6edfdeee6a5fede0dab55507ad74cf7" +checksum = "4e99090d12f6182924499253aaa1e73bf15c69cea8d2774c3c781e35badc3548" dependencies = [ "cfg-if", "indoc", @@ -922,9 +922,9 @@ dependencies = [ [[package]] name = "pyo3-build-config" -version = "0.22.0" +version = "0.22.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ab7164b2202753bd33afc7f90a10355a719aa973d1f94502c50d06f3488bc420" +checksum = "7879eb018ac754bba32cb0eec7526391c02c14a093121857ed09fbf1d1057d41" dependencies = [ "once_cell", "target-lexicon", @@ -932,9 +932,9 @@ dependencies = [ [[package]] name = "pyo3-ffi" -version = "0.22.0" +version = "0.22.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c6424906ca49013c0829c5c1ed405e20e2da2dc78b82d198564880a704e6a7b7" +checksum = "ce2baa5559a411fc1cf519295f24c34b53d5d725818bc96b5abf94762da09041" dependencies = [ "libc", "pyo3-build-config", @@ -942,9 +942,9 @@ dependencies = [ [[package]] name = "pyo3-macros" -version = "0.22.0" +version = "0.22.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "82b2f19e153122d64afd8ce7aaa72f06a00f52e34e1d1e74b6d71baea396460a" +checksum = "049621c20a23f2def20f4fe67978d1da8d8a883d64b9c21362f3b776e254edc7" dependencies = [ "proc-macro2", "pyo3-macros-backend", @@ -954,9 +954,9 @@ dependencies = [ [[package]] name = "pyo3-macros-backend" -version = "0.22.0" +version = "0.22.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dd698c04cac17cf0fe63d47790ab311b8b25542f5cb976b65c374035c50f1eef" +checksum = "0e969ee2e025435f1819d31a275ba4bb9cbbdf3ac535227fdbd85b9322ffe144" dependencies = [ "heck", "proc-macro2", From 46222b9cb6371fbf351a232d4c67169dfbb9ffb9 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 22 Jul 2024 10:55:40 -0400 Subject: [PATCH 24/31] build(deps): bump pyo3 from 0.22.1 to 0.22.2 in the cargo group (#72) Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- Cargo.lock | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 0d5d5f9..383f3a5 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -904,9 +904,9 @@ dependencies = [ [[package]] name = "pyo3" -version = "0.22.1" +version = "0.22.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4e99090d12f6182924499253aaa1e73bf15c69cea8d2774c3c781e35badc3548" +checksum = "831e8e819a138c36e212f3af3fd9eeffed6bf1510a805af35b0edee5ffa59433" dependencies = [ "cfg-if", "indoc", @@ -922,9 +922,9 @@ dependencies = [ [[package]] name = "pyo3-build-config" -version = "0.22.1" +version = "0.22.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7879eb018ac754bba32cb0eec7526391c02c14a093121857ed09fbf1d1057d41" +checksum = "1e8730e591b14492a8945cdff32f089250b05f5accecf74aeddf9e8272ce1fa8" dependencies = [ "once_cell", "target-lexicon", @@ -932,9 +932,9 @@ dependencies = [ [[package]] name = "pyo3-ffi" -version = "0.22.1" +version = "0.22.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ce2baa5559a411fc1cf519295f24c34b53d5d725818bc96b5abf94762da09041" +checksum = "5e97e919d2df92eb88ca80a037969f44e5e70356559654962cbb3316d00300c6" dependencies = [ "libc", "pyo3-build-config", @@ -942,9 +942,9 @@ dependencies = [ [[package]] name = "pyo3-macros" -version = "0.22.1" +version = "0.22.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "049621c20a23f2def20f4fe67978d1da8d8a883d64b9c21362f3b776e254edc7" +checksum = "eb57983022ad41f9e683a599f2fd13c3664d7063a3ac5714cae4b7bee7d3f206" dependencies = [ "proc-macro2", "pyo3-macros-backend", @@ -954,9 +954,9 @@ dependencies = [ [[package]] name = "pyo3-macros-backend" -version = "0.22.1" +version = "0.22.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0e969ee2e025435f1819d31a275ba4bb9cbbdf3ac535227fdbd85b9322ffe144" +checksum = "ec480c0c51ddec81019531705acac51bcdbeae563557c982aa8263bb96880372" dependencies = [ "heck", "proc-macro2", From 97aa733caf3bb5de71b41a9c5063f9423081c0bc Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 22 Jul 2024 10:55:53 -0400 Subject: [PATCH 25/31] build(deps): bump sigstore/gh-action-sigstore-python from 2.1.1 to 3.0.0 in the actions group (#71) Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .github/workflows/release.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 0ebf299..14512c3 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -101,7 +101,7 @@ jobs: uses: pypa/gh-action-pypi-publish@v1.9.0 - name: sign - uses: sigstore/gh-action-sigstore-python@v2.1.1 + uses: sigstore/gh-action-sigstore-python@v3.0.0 with: inputs: ./dist/*.tar.gz ./dist/*.whl release-signing-artifacts: true From 07a804ed1543430f5e96a8951f07ee536db02e2d Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 2 Sep 2024 09:11:29 -0400 Subject: [PATCH 26/31] build(deps): bump pypa/gh-action-pypi-publish in the actions group (#73) --- .github/workflows/release-stubs.yml | 2 +- .github/workflows/release.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/release-stubs.yml b/.github/workflows/release-stubs.yml index 7a40661..eeb72ff 100644 --- a/.github/workflows/release-stubs.yml +++ b/.github/workflows/release-stubs.yml @@ -48,4 +48,4 @@ jobs: - name: publish if: ${{ !inputs.dry-run }} - uses: pypa/gh-action-pypi-publish@v1.9.0 + uses: pypa/gh-action-pypi-publish@v1.10.0 diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 14512c3..69df3ca 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -98,7 +98,7 @@ jobs: merge-multiple: true - name: publish - uses: pypa/gh-action-pypi-publish@v1.9.0 + uses: pypa/gh-action-pypi-publish@v1.10.0 - name: sign uses: sigstore/gh-action-sigstore-python@v3.0.0 From a7aae474e1ee867ae664bd38ca344cbac55b7473 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 9 Sep 2024 09:55:39 -0400 Subject: [PATCH 27/31] build(deps): bump pypa/gh-action-pypi-publish from 1.10.0 to 1.10.1 in the actions group (#75) Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .github/workflows/release-stubs.yml | 2 +- .github/workflows/release.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/release-stubs.yml b/.github/workflows/release-stubs.yml index eeb72ff..0f8e9a4 100644 --- a/.github/workflows/release-stubs.yml +++ b/.github/workflows/release-stubs.yml @@ -48,4 +48,4 @@ jobs: - name: publish if: ${{ !inputs.dry-run }} - uses: pypa/gh-action-pypi-publish@v1.10.0 + uses: pypa/gh-action-pypi-publish@v1.10.1 diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 69df3ca..f1611b5 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -98,7 +98,7 @@ jobs: merge-multiple: true - name: publish - uses: pypa/gh-action-pypi-publish@v1.10.0 + uses: pypa/gh-action-pypi-publish@v1.10.1 - name: sign uses: sigstore/gh-action-sigstore-python@v3.0.0 From 68d66179f542c5ac21fae744311645663d877aae Mon Sep 17 00:00:00 2001 From: William Woodruff Date: Mon, 16 Sep 2024 14:17:24 +0200 Subject: [PATCH 28/31] lib: weaken forbid to deny See https://github.com/PyO3/pyo3/pull/4396 -- pyo3 now emits some `#[allow(unsafe_code)]` markers, which our previous `forbid(unsafe_code)` was rejecting. Ideally `rustc` would understand that these are not in "our" code (since they're in macro/proc-macro expansions), but that doesn't currently appear to be the case. Signed-off-by: William Woodruff --- Cargo.lock | 20 ++++++++++---------- Cargo.toml | 2 +- src/lib.rs | 2 +- 3 files changed, 12 insertions(+), 12 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 383f3a5..0167c63 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -904,9 +904,9 @@ dependencies = [ [[package]] name = "pyo3" -version = "0.22.2" +version = "0.22.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "831e8e819a138c36e212f3af3fd9eeffed6bf1510a805af35b0edee5ffa59433" +checksum = "15ee168e30649f7f234c3d49ef5a7a6cbf5134289bc46c29ff3155fa3221c225" dependencies = [ "cfg-if", "indoc", @@ -922,9 +922,9 @@ dependencies = [ [[package]] name = "pyo3-build-config" -version = "0.22.2" +version = "0.22.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e8730e591b14492a8945cdff32f089250b05f5accecf74aeddf9e8272ce1fa8" +checksum = "e61cef80755fe9e46bb8a0b8f20752ca7676dcc07a5277d8b7768c6172e529b3" dependencies = [ "once_cell", "target-lexicon", @@ -932,9 +932,9 @@ dependencies = [ [[package]] name = "pyo3-ffi" -version = "0.22.2" +version = "0.22.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5e97e919d2df92eb88ca80a037969f44e5e70356559654962cbb3316d00300c6" +checksum = "67ce096073ec5405f5ee2b8b31f03a68e02aa10d5d4f565eca04acc41931fa1c" dependencies = [ "libc", "pyo3-build-config", @@ -942,9 +942,9 @@ dependencies = [ [[package]] name = "pyo3-macros" -version = "0.22.2" +version = "0.22.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eb57983022ad41f9e683a599f2fd13c3664d7063a3ac5714cae4b7bee7d3f206" +checksum = "2440c6d12bc8f3ae39f1e775266fa5122fd0c8891ce7520fa6048e683ad3de28" dependencies = [ "proc-macro2", "pyo3-macros-backend", @@ -954,9 +954,9 @@ dependencies = [ [[package]] name = "pyo3-macros-backend" -version = "0.22.2" +version = "0.22.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ec480c0c51ddec81019531705acac51bcdbeae563557c982aa8263bb96880372" +checksum = "1be962f0e06da8f8465729ea2cb71a416d2257dff56cbe40a70d3e62a93ae5d1" dependencies = [ "heck", "proc-macro2", diff --git a/Cargo.toml b/Cargo.toml index 10ed610..15a8106 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -19,7 +19,7 @@ crate-type = ["cdylib"] [dependencies] age-core = "0.10" age = { version = "0.10", features = ["ssh", "plugin"] } -pyo3 = { version = "0.22", features = [ +pyo3 = { version = "0.22.3", features = [ "extension-module", "abi3", "abi3-py38", diff --git a/src/lib.rs b/src/lib.rs index 3f104bd..179316b 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -1,4 +1,4 @@ -#![forbid(unsafe_code)] +#![deny(unsafe_code)] use std::{ fs::File, From ced975fd25067e5409b9d8770963a10072f0a4c5 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 23 Sep 2024 10:29:24 -0400 Subject: [PATCH 29/31] build(deps): bump pypa/gh-action-pypi-publish from 1.10.1 to 1.10.2 in the actions group (#78) Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .github/workflows/release-stubs.yml | 2 +- .github/workflows/release.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/release-stubs.yml b/.github/workflows/release-stubs.yml index 0f8e9a4..7940f67 100644 --- a/.github/workflows/release-stubs.yml +++ b/.github/workflows/release-stubs.yml @@ -48,4 +48,4 @@ jobs: - name: publish if: ${{ !inputs.dry-run }} - uses: pypa/gh-action-pypi-publish@v1.10.1 + uses: pypa/gh-action-pypi-publish@v1.10.2 diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index f1611b5..fe1ab2d 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -98,7 +98,7 @@ jobs: merge-multiple: true - name: publish - uses: pypa/gh-action-pypi-publish@v1.10.1 + uses: pypa/gh-action-pypi-publish@v1.10.2 - name: sign uses: sigstore/gh-action-sigstore-python@v3.0.0 From dc191c2ef12e4d63c93883d555e3fee400ff91a6 Mon Sep 17 00:00:00 2001 From: Julian Hille Date: Fri, 27 Sep 2024 00:02:23 +0200 Subject: [PATCH 30/31] Re-add fh streaming possibility (#77) Co-authored-by: William Woodruff --- Cargo.lock | 10 +++++ Cargo.toml | 1 + pyrage-stubs/pyrage-stubs/__init__.pyi | 3 ++ src/lib.rs | 61 ++++++++++++++++++++++++++ test/test_pyrage.py | 54 +++++++++++++++++++++++ 5 files changed, 129 insertions(+) diff --git a/Cargo.lock b/Cargo.lock index 0167c63..9ce2c31 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -940,6 +940,15 @@ dependencies = [ "pyo3-build-config", ] +[[package]] +name = "pyo3-file" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "488563e2317157edd6e12c3ef23e10363bd079bf8630e3de719e368b4eb02a21" +dependencies = [ + "pyo3", +] + [[package]] name = "pyo3-macros" version = "0.22.3" @@ -972,6 +981,7 @@ dependencies = [ "age", "age-core", "pyo3", + "pyo3-file", ] [[package]] diff --git a/Cargo.toml b/Cargo.toml index 15a8106..09296d5 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -25,3 +25,4 @@ pyo3 = { version = "0.22.3", features = [ "abi3-py38", "py-clone", ] } +pyo3-file = "0.9.0" diff --git a/pyrage-stubs/pyrage-stubs/__init__.pyi b/pyrage-stubs/pyrage-stubs/__init__.pyi index 8119866..1282a58 100644 --- a/pyrage-stubs/pyrage-stubs/__init__.pyi +++ b/pyrage-stubs/pyrage-stubs/__init__.pyi @@ -1,3 +1,4 @@ +from io import BufferedIOBase from typing import Sequence, Union from pyrage import ssh, x25519, passphrase, plugin @@ -15,5 +16,7 @@ class IdentityError(Exception): def encrypt(plaintext: bytes, recipients: Sequence[Recipient]) -> bytes: ... def encrypt_file(infile: str, outfile: str, recipients: Sequence[Recipient]) -> None: ... +def encrypt_io(in_io: BufferedIOBase, recipients: Sequence[Recipient]) -> bytes: ... def decrypt(ciphertext: bytes, identities: Sequence[Identity]) -> bytes: ... def decrypt_file(infile: str, outfile: str, identities: Sequence[Identity]) -> None: ... +def decrypt_io(in_io: BufferedIOBase, out_io: BufferedIOBase, recipient: Sequence[Recipient]) -> None: ... diff --git a/src/lib.rs b/src/lib.rs index 179316b..7c1198f 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -17,6 +17,7 @@ use pyo3::{ py_run, types::PyBytes, }; +use pyo3_file::PyFileLikeObject; mod passphrase; mod plugin; @@ -259,6 +260,64 @@ fn decrypt_file( Ok(()) } +fn from_pyobject(file: PyObject, read_only: bool) -> PyResult { + // is a file-like + PyFileLikeObject::with_requirements(file, read_only, !read_only, false, false) +} + +#[pyfunction] +fn encrypt_io( + reader: PyObject, + writer: PyObject, + recipients: Vec>, +) -> PyResult<()> { + // This turns each `dyn PyrageRecipient` into a `dyn Recipient`, which + // is what the underlying `age` API expects. + let recipients = recipients.into_iter().map(|pr| pr.as_recipient()).collect(); + let reader = from_pyobject(reader, true)?; + let writer = from_pyobject(writer, false)?; + let mut reader = std::io::BufReader::new(reader); + let mut writer = std::io::BufWriter::new(writer); + let encryptor = Encryptor::with_recipients(recipients) + .ok_or_else(|| EncryptError::new_err("expected at least one recipient"))?; + let mut writer = encryptor + .wrap_output(&mut writer) + .map_err(|e| EncryptError::new_err(e.to_string()))?; + std::io::copy(&mut reader, &mut writer).map_err(|e| EncryptError::new_err(e.to_string()))?; + writer + .finish() + .map_err(|e| EncryptError::new_err(e.to_string()))?; + Ok(()) +} + +#[pyfunction] +fn decrypt_io( + reader: PyObject, + writer: PyObject, + identities: Vec>, +) -> PyResult<()> { + let identities = identities.iter().map(|pi| pi.as_ref().as_identity()); + let reader = from_pyobject(reader, true)?; + let writer = from_pyobject(writer, false)?; + let reader = std::io::BufReader::new(reader); + let mut writer = std::io::BufWriter::new(writer); + let decryptor = match age::Decryptor::new_buffered(reader) + .map_err(|e| DecryptError::new_err(e.to_string()))? + { + age::Decryptor::Recipients(d) => d, + age::Decryptor::Passphrase(_) => { + return Err(DecryptError::new_err( + "invalid ciphertext (encrypted with passphrase, not identities)", + )) + } + }; + let mut reader = decryptor + .decrypt(identities) + .map_err(|e| DecryptError::new_err(e.to_string()))?; + std::io::copy(&mut reader, &mut writer)?; + Ok(()) +} + #[pymodule] fn pyrage(py: Python, m: &Bound<'_, PyModule>) -> PyResult<()> { // HACK(ww): pyO3 modules are not packages, so we need this nasty @@ -298,9 +357,11 @@ fn pyrage(py: Python, m: &Bound<'_, PyModule>) -> PyResult<()> { m.add("EncryptError", py.get_type_bound::())?; m.add_wrapped(wrap_pyfunction!(encrypt))?; m.add_wrapped(wrap_pyfunction!(encrypt_file))?; + m.add_wrapped(wrap_pyfunction!(encrypt_io))?; m.add("DecryptError", py.get_type_bound::())?; m.add_wrapped(wrap_pyfunction!(decrypt))?; m.add_wrapped(wrap_pyfunction!(decrypt_file))?; + m.add_wrapped(wrap_pyfunction!(decrypt_io))?; Ok(()) } diff --git a/test/test_pyrage.py b/test/test_pyrage.py index df4ddcf..4d1211e 100644 --- a/test/test_pyrage.py +++ b/test/test_pyrage.py @@ -1,6 +1,7 @@ import os import tempfile import unittest +from io import BytesIO import pyrage @@ -23,6 +24,59 @@ def test_roundtrip(self): self.assertEqual(b"test", decrypted) + def test_roundtrip_io_fh(self): + identity = pyrage.x25519.Identity.generate() + recipient = identity.to_public() + with tempfile.TemporaryFile() as unencrypted: + unencrypted.write(b"test") + unencrypted.seek(0) + with tempfile.TemporaryFile() as encrypted: + pyrage.encrypt_io(unencrypted, encrypted, [recipient]) + encrypted.seek(0) + with tempfile.TemporaryFile() as decrypted: + pyrage.decrypt_io(encrypted, decrypted, [identity]) + decrypted.seek(0) + unencrypted.seek(0) + self.assertEqual(unencrypted.read(), decrypted.read()) + + def test_roundtrip_io_bytesio(self): + identity = pyrage.x25519.Identity.generate() + recipient = identity.to_public() + unencrypted = BytesIO(b'test') + encrypted = BytesIO() + decrypted = BytesIO() + pyrage.encrypt_io(unencrypted, encrypted, [recipient]) + encrypted.seek(0) + pyrage.decrypt_io(encrypted, decrypted, [identity]) + decrypted.seek(0) + unencrypted.seek(0) + self.assertEqual(unencrypted.read(), decrypted.read()) + + def test_roundtrip_io_fail(self): + identity = pyrage.x25519.Identity.generate() + recipient = identity.to_public() + + with self.assertRaises(TypeError): + input = 'test' + output = BytesIO() + pyrage.encrypt_io(input, output, [recipient]) + + with self.assertRaises(TypeError): + input = BytesIO() + output = 'test' + pyrage.encrypt_io(input, output, [recipient]) + + with self.assertRaises(TypeError): + input = 'test' + output = BytesIO() + pyrage.decrypt_io(input, output, [recipient]) + + with self.assertRaises(TypeError): + input = BytesIO() + output = 'test' + pyrage.decrypt_io(input, output, [recipient]) + + def test_roundtrip_file(self): identity = pyrage.x25519.Identity.generate() recipient = identity.to_public() From ec398c4a38a1d2e184458c96153df89e606b0ba5 Mon Sep 17 00:00:00 2001 From: William Woodruff Date: Thu, 26 Sep 2024 19:32:36 -0400 Subject: [PATCH 31/31] chore: Release pyrage version 1.2.0 --- Cargo.lock | 2 +- Cargo.toml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 9ce2c31..3b89e52 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -976,7 +976,7 @@ dependencies = [ [[package]] name = "pyrage" -version = "1.1.3-rc.1" +version = "1.2.0" dependencies = [ "age", "age-core", diff --git a/Cargo.toml b/Cargo.toml index 09296d5..ac7372a 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "pyrage" -version = "1.1.3-rc.1" +version = "1.2.0" authors = ["William Woodruff "] edition = "2021" description = "Python bindings for rage (age in Rust)"