diff --git a/.github/ISSUE_TEMPLATE/config.yml b/.github/ISSUE_TEMPLATE/config.yml deleted file mode 100644 index 2aa3282aa4..0000000000 --- a/.github/ISSUE_TEMPLATE/config.yml +++ /dev/null @@ -1,5 +0,0 @@ -blank_issues_enabled: true -contact_links: - - name: Gitter channel (actix) - url: https://gitter.im/actix/actix - about: Please ask and answer questions about the actix project here. diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 0000000000..23f6c3ea82 --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,10 @@ +version: 2 +updates: + - package-ecosystem: cargo + directory: / + schedule: + interval: weekly + - package-ecosystem: github-actions + directory: / + schedule: + interval: daily diff --git a/.github/workflows/ci-post-merge.yml b/.github/workflows/ci-post-merge.yml index e979739765..4a4e3dd71f 100644 --- a/.github/workflows/ci-post-merge.yml +++ b/.github/workflows/ci-post-merge.yml @@ -16,10 +16,8 @@ jobs: matrix: target: - { name: Linux, os: ubuntu-latest, triple: x86_64-unknown-linux-gnu } - version: - - nightly - name: ${{ matrix.target.name }} / ${{ matrix.version }} + name: ${{ matrix.target.name }} / nightly runs-on: ${{ matrix.target.os }} services: @@ -30,15 +28,16 @@ jobs: options: --entrypoint redis-server steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - - name: Install Rust (${{ matrix.version }}) - uses: actions-rust-lang/setup-rust-toolchain@v1 + - name: Install Rust (nightly) + uses: actions-rust-lang/setup-rust-toolchain@v1.5.0 with: - toolchain: ${{ matrix.version }} + toolchain: nightly - - uses: taiki-e/cache-cargo-install-action@v1 - with: { tool: cargo-hack } + - uses: taiki-e/install-action@v2.18.11 + with: + tool: cargo-hack - name: check minimal run: cargo ci-min @@ -61,30 +60,26 @@ jobs: build_and_test_other_nightly: strategy: fail-fast: false + # prettier-ignore matrix: target: - { name: macOS, os: macos-latest, triple: x86_64-apple-darwin } - - { - name: Windows, - os: windows-latest, - triple: x86_64-pc-windows-msvc, - } - version: - - nightly - - name: ${{ matrix.target.name }} / ${{ matrix.version }} + - { name: Windows, os: windows-latest, triple: x86_64-pc-windows-msvc } + + name: ${{ matrix.target.name }} / nightly runs-on: ${{ matrix.target.os }} steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - - name: Install Rust (${{ matrix.version }}) - uses: actions-rust-lang/setup-rust-toolchain@v1 + - name: Install Rust (nightly) + uses: actions-rust-lang/setup-rust-toolchain@v1.5.0 with: - toolchain: ${{ matrix.version }} + toolchain: nightly - - uses: taiki-e/cache-cargo-install-action@v1 - with: { tool: cargo-hack } + - uses: taiki-e/install-action@v2.18.11 + with: + tool: cargo-hack - name: check minimal run: cargo ci-min diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 84e502340c..ae6fc94eb8 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,8 +1,12 @@ name: CI on: - pull_request: {} - push: { branches: [master] } + pull_request: + types: [opened, synchronize, reopened] + merge_group: + types: [checks_requested] + push: + branches: [master] permissions: { contents: read } @@ -18,10 +22,10 @@ jobs: target: - { name: Linux, os: ubuntu-latest, triple: x86_64-unknown-linux-gnu } version: - - '1.60' # MSRV - - stable + - { name: msrv, version: 1.68.0 } + - { name: stable, version: stable } - name: ${{ matrix.target.name }} / ${{ matrix.version }} + name: ${{ matrix.target.name }} / ${{ matrix.version.name }} runs-on: ${{ matrix.target.os }} services: @@ -37,21 +41,22 @@ jobs: --entrypoint redis-server steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - - name: Install Rust (${{ matrix.version }}) - uses: actions-rust-lang/setup-rust-toolchain@v1 + - name: Install Rust (${{ matrix.version.name }}) + uses: actions-rust-lang/setup-rust-toolchain@v1.5.0 with: - toolchain: ${{ matrix.version }} + toolchain: ${{ matrix.version.version }} - name: Install cargo-hack - uses: taiki-e/cache-cargo-install-action@v1 - with: { tool: cargo-hack } + uses: taiki-e/install-action@v2.18.11 + with: + tool: cargo-hack - - name: workaround MSRV issues - if: matrix.version != 'stable' - run: | - cargo update -p=time:0.3.20 --precise=0.3.16 + # - name: workaround MSRV issues + # if: matrix.version.name == 'msrv' + # run: | + # cargo update -p=time:0.3.20 --precise=0.3.16 - name: check minimal run: cargo ci-min @@ -75,36 +80,34 @@ jobs: strategy: fail-fast: false matrix: + # prettier-ignore target: - { name: macOS, os: macos-latest, triple: x86_64-apple-darwin } - - { - name: Windows, - os: windows-latest, - triple: x86_64-pc-windows-msvc, - } + - { name: Windows, os: windows-latest, triple: x86_64-pc-windows-msvc } version: - - '1.60' # MSRV - - stable + - { name: msrv, version: 1.68.0 } + - { name: stable, version: stable } - name: ${{ matrix.target.name }} / ${{ matrix.version }} + name: ${{ matrix.target.name }} / ${{ matrix.version.name }} runs-on: ${{ matrix.target.os }} steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - - name: Install Rust (${{ matrix.version }}) - uses: actions-rust-lang/setup-rust-toolchain@v1 + - name: Install Rust (${{ matrix.version.name }}) + uses: actions-rust-lang/setup-rust-toolchain@v1.5.0 with: - toolchain: ${{ matrix.version }} + toolchain: ${{ matrix.version.version }} - name: Install cargo-hack - uses: taiki-e/cache-cargo-install-action@v1 - with: { tool: cargo-hack } + uses: taiki-e/install-action@v2.18.11 + with: + tool: cargo-hack - - name: workaround MSRV issues - if: matrix.version != 'stable' - run: | - cargo update -p=time:0.3.20 --precise=0.3.16 + # - name: workaround MSRV issues + # if: matrix.version.name == 'msrv' + # run: | + # cargo update -p=time:0.3.20 --precise=0.3.16 - name: check minimal run: cargo ci-min @@ -128,11 +131,12 @@ jobs: name: doc tests runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Install Rust (nightly) - uses: actions-rust-lang/setup-rust-toolchain@v1 - with: { toolchain: nightly } + uses: actions-rust-lang/setup-rust-toolchain@v1.5.0 + with: + toolchain: nightly - name: doc tests timeout-minutes: 40 diff --git a/.github/workflows/coverage.yml b/.github/workflows/coverage.yml index 0001494363..a320d83597 100644 --- a/.github/workflows/coverage.yml +++ b/.github/workflows/coverage.yml @@ -1,7 +1,8 @@ name: Coverage on: - push: { branches: [master] } + push: + branches: [master] permissions: { contents: read } @@ -21,11 +22,12 @@ jobs: options: --entrypoint redis-server steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Install Rust (nightly) - uses: actions-rust-lang/setup-rust-toolchain@v1 - with: { toolchain: nightly } + uses: actions-rust-lang/setup-rust-toolchain@v1.5.0 + with: + toolchain: nightly - name: Generate coverage file run: | @@ -34,4 +36,5 @@ jobs: - name: Upload to Codecov uses: codecov/codecov-action@v3 - with: { file: cobertura.xml } + with: + file: cobertura.xml diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 97ad9cec4f..f13030f75b 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -12,10 +12,10 @@ jobs: fmt: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Install Rust (nightly) - uses: actions-rust-lang/setup-rust-toolchain@v1 + uses: actions-rust-lang/setup-rust-toolchain@v1.5.0 with: toolchain: nightly components: rustfmt @@ -26,33 +26,36 @@ jobs: clippy: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Install Rust - uses: actions-rust-lang/setup-rust-toolchain@v1 - with: { components: clippy } + uses: actions-rust-lang/setup-rust-toolchain@v1.5.0 + with: + components: clippy - name: Check with Clippy - run: cargo clippy --workspace --tests --all-features + run: cargo clippy --workspace --tests --all-features -- -A unknown_lints public-api-diff: runs-on: ubuntu-latest steps: - name: checkout ${{ github.base_ref }} - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: ref: ${{ github.base_ref }} - name: checkout ${{ github.head_ref }} - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Install Rust (nightly) - uses: actions-rust-lang/setup-rust-toolchain@v1 - with: { toolchain: nightly } + uses: actions-rust-lang/setup-rust-toolchain@v1.5.0 + with: + toolchain: nightly - name: Install cargo-public-api - uses: taiki-e/cache-cargo-install-action@v1 - with: { tool: cargo-public-api } + uses: taiki-e/cache-cargo-install-action@v1.2.1 + with: + tool: cargo-public-api - name: generate API diff run: | diff --git a/.github/workflows/upload-doc.yml b/.github/workflows/upload-doc.yml index a59f7f22fa..3abf6d1c84 100644 --- a/.github/workflows/upload-doc.yml +++ b/.github/workflows/upload-doc.yml @@ -14,10 +14,10 @@ jobs: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Install Rust (nightly) - uses: actions-rust-lang/setup-rust-toolchain@v1 + uses: actions-rust-lang/setup-rust-toolchain@v1.5.0 with: { toolchain: nightly } - name: Build Docs @@ -27,7 +27,7 @@ jobs: run: echo '' > target/doc/index.html - name: Deploy to GitHub Pages - uses: JamesIves/github-pages-deploy-action@3.7.1 + uses: JamesIves/github-pages-deploy-action@v4.4.3 with: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} BRANCH: gh-pages diff --git a/Cargo.toml b/Cargo.toml index a1993e2441..645d4f39dc 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -11,10 +11,10 @@ members = [ "actix-web-httpauth", ] -# TODO(MSRV 1.64) -# [workspace.package] -# edition = "2018" -# rust-version = "1.60" +[workspace.package] +license = "MIT OR Apache-2.0" +edition = "2021" +rust-version = "1.68" [patch.crates-io] actix-cors = { path = "./actix-cors" } diff --git a/actix-cors/CHANGES.md b/actix-cors/CHANGES.md index 31a23cb71c..9b315db1f5 100644 --- a/actix-cors/CHANGES.md +++ b/actix-cors/CHANGES.md @@ -1,79 +1,79 @@ # Changes -## Unreleased - 2022-xx-xx +## Unreleased -- Minimum supported Rust version (MSRV) is now 1.60. +- Minimum supported Rust version (MSRV) is now 1.68. -## 0.6.4 - 2022-10-28 +## 0.6.4 - Add `Cors::allow_private_network_access()` behind an unstable flag (`draft-private-network-access`). [#297] [#297]: https://github.com/actix/actix-extras/pull/297 -## 0.6.3 - 2022-09-21 +## 0.6.3 - Add `Cors::block_on_origin_mismatch()` option for controlling if requests are pre-emptively rejected. [#287] - Minimum supported Rust version (MSRV) is now 1.59 due to transitive `time` dependency. [#287]: https://github.com/actix/actix-extras/pull/287 -## 0.6.2 - 2022-08-07 +## 0.6.2 - Fix `expose_any_header` to return list of response headers. [#273] - Minimum supported Rust version (MSRV) is now 1.57 due to transitive `time` dependency. [#273]: https://github.com/actix/actix-extras/pull/273 -## 0.6.1 - 2022-03-07 +## 0.6.1 - Do not consider requests without a `Access-Control-Request-Method` as preflight. [#226] [#226]: https://github.com/actix/actix-extras/pull/226 -## 0.6.0 - 2022-02-25 +## 0.6.0 - Update `actix-web` dependency to 4.0. -## 0.6.0-beta.10 - 2022-02-07 +## 0.6.0-beta.10 - Ensure that preflight responses contain a `Vary` header. [#224] [#224]: https://github.com/actix/actix-extras/pull/224 -## 0.6.0-beta.9 - 2022-02-07 +## 0.6.0-beta.9 - Relax body type bounds on middleware impl. [#223] - Update `actix-web` dependency to `4.0.0-rc.1`. [#223]: https://github.com/actix/actix-extras/pull/223 -## 0.6.0-beta.8 - 2021-12-29 +## 0.6.0-beta.8 - Minimum supported Rust version (MSRV) is now 1.54. -## 0.6.0-beta.7 - 2021-12-18 +## 0.6.0-beta.7 - Update `actix-web` dependency to `4.0.0-beta.15`. [#216] [#216]: https://github.com/actix/actix-extras/pull/216 -## 0.6.0-beta.6 - 2021-12-13 +## 0.6.0-beta.6 - Fix panic when wrapping routes with dynamic segments in their paths. [#213] [#213]: https://github.com/actix/actix-extras/pull/213 -## 0.6.0-beta.5 - 2021-12-12 _(YANKED)_ +## 0.6.0-beta.5 _(YANKED)_ - Update `actix-web` dependency to `4.0.0.beta-14`. [#209] [#209]: https://github.com/actix/actix-extras/pull/209 -## 0.6.0-beta.4 - 2021-11-22 +## 0.6.0-beta.4 - No significant changes since `0.6.0-beta.3`. -## 0.6.0-beta.3 - 2021-10-21 +## 0.6.0-beta.3 - Make `Cors` middleware generic over body type [#195] - Fix `expose_any_header` behavior. [#204] @@ -84,37 +84,37 @@ [#203]: https://github.com/actix/actix-extras/pull/203 [#204]: https://github.com/actix/actix-extras/pull/204 -## 0.6.0-beta.2 - 2021-06-27 +## 0.6.0-beta.2 - No notable changes. -## 0.6.0-beta.1 - 2021-04-02 +## 0.6.0-beta.1 - Update `actix-web` dependency to 4.0.0 beta. - Minimum supported Rust version (MSRV) is now 1.46.0. -## 0.5.4 - 2020-12-31 +## 0.5.4 - Fix `expose_any_header` method, now set the correct field. [#143] [#143]: https://github.com/actix/actix-extras/pull/143 -## 0.5.3 - 2020-11-19 +## 0.5.3 - Fix version spec for `derive_more` dependency. -## 0.5.2 - 2020-11-15 +## 0.5.2 - Ensure `tinyvec` is using the correct features. - Bump `futures-util` minimum version to `0.3.7` to avoid `RUSTSEC-2020-0059`. -## 0.5.1 - 2020-11-05 +## 0.5.1 - Fix `allow_any_header` method, now set the correct field. [#121] [#121]: https://github.com/actix/actix-extras/pull/121 -## 0.5.0 - 2020-10-19 +## 0.5.0 - Disallow `*` in `Cors::allowed_origin`. [#114]. - Hide `CorsMiddleware` from docs. [#118]. @@ -134,13 +134,13 @@ [#119]: https://github.com/actix/actix-extras/pull/119 [#120]: https://github.com/actix/actix-extras/pull/120 -## 0.4.1 - 2020-10-07 +## 0.4.1 - Allow closures to be used with `allowed_origin_fn`. [#110] [#110]: https://github.com/actix/actix-extras/pull/110 -## 0.4.0 - 2020-09-27 +## 0.4.0 - Implement `allowed_origin_fn` builder method. [#93] - Use `TryInto` instead of `TryFrom` where applicable. [#106] @@ -148,13 +148,13 @@ [#93]: https://github.com/actix/actix-extras/pull/93 [#106]: https://github.com/actix/actix-extras/pull/106 -## 0.3.0 - 2020-09-11 +## 0.3.0 - Update `actix-web` dependency to 3.0.0. - Minimum supported Rust version (MSRV) is now 1.42.0. - Implement the Debug trait on all public types. -## 0.3.0-alpha.1 - 2020-03-11 +## 0.3.0-alpha.1 - Minimize `futures-*` dependencies - Update `actix-web` dependency to 3.0.0-alpha.1 diff --git a/actix-cors/Cargo.toml b/actix-cors/Cargo.toml index a347f97875..e446c377ad 100644 --- a/actix-cors/Cargo.toml +++ b/actix-cors/Cargo.toml @@ -9,9 +9,9 @@ description = "Cross-Origin Resource Sharing (CORS) controls for Actix Web" keywords = ["actix", "cors", "web", "security", "crossorigin"] homepage = "https://actix.rs" repository = "https://github.com/actix/actix-extras.git" -license = "MIT OR Apache-2.0" -edition = "2018" -rust-version = "1.60" +license.workspace = true +edition.workspace = true +rust-version.workspace = true [package.metadata.docs.rs] rustdoc-args = ["--cfg", "docsrs"] diff --git a/actix-identity/CHANGES.md b/actix-identity/CHANGES.md index de5f2d15f8..655f2e1b18 100644 --- a/actix-identity/CHANGES.md +++ b/actix-identity/CHANGES.md @@ -1,25 +1,25 @@ # Changes -## Unreleased - 2022-xx-xx +## Unreleased - Replace use of `anyhow::Error` with specific error types. [#296] -- Minimum supported Rust version (MSRV) is now 1.60. +- Minimum supported Rust version (MSRV) is now 1.68. [#296]: https://github.com/actix/actix-extras/pull/296 -## 0.5.2 - 2022-07-19 +## 0.5.2 - Fix visit deadline. [#263] [#263]: https://github.com/actix/actix-extras/pull/263 -## 0.5.1 - 2022-07-11 +## 0.5.1 - Remove unnecessary dependencies. [#259] [#259]: https://github.com/actix/actix-extras/pull/259 -## 0.5.0 - 2022-07-11 +## 0.5.0 `actix-identity` v0.5 is a complete rewrite. The goal is to streamline user experience and reduce maintenance overhead. @@ -55,56 +55,56 @@ Changes: [#246]: https://github.com/actix/actix-extras/pull/246 -## 0.4.0 - 2022-03-01 +## 0.4.0 - Update `actix-web` dependency to `4`. -## 0.4.0-beta.9 - 2022-02-07 +## 0.4.0-beta.9 - Relax body type bounds on middleware impl. [#223] - Update `actix-web` dependency to `4.0.0-rc.1`. [#223]: https://github.com/actix/actix-extras/pull/223 -## 0.4.0-beta.8 - 2022-01-21 +## 0.4.0-beta.8 - No significant changes since `0.4.0-beta.7`. -## 0.4.0-beta.7 - 2021-12-29 +## 0.4.0-beta.7 - Update `actix-web` dependency to `4.0.0.beta-18`. [#218] - Minimum supported Rust version (MSRV) is now 1.54. [#218]: https://github.com/actix/actix-extras/pull/218 -## 0.4.0-beta.6 - 2021-12-18 +## 0.4.0-beta.6 - Update `actix-web` dependency to `4.0.0.beta-15`. [#216] [#216]: https://github.com/actix/actix-extras/pull/216 -## 0.4.0-beta.5 - 2021-12-12 +## 0.4.0-beta.5 - Update `actix-web` dependency to `4.0.0.beta-14`. [#209] [#209]: https://github.com/actix/actix-extras/pull/209 -## 0.4.0-beta.4 - 2021-11-22 +## 0.4.0-beta.4 - No significant changes since `0.4.0-beta.3`. -## 0.4.0-beta.3 - 2021-10-21 +## 0.4.0-beta.3 - Update `actix-web` dependency to v4.0.0-beta.10. [#203] - Minimum supported Rust version (MSRV) is now 1.52. [#203]: https://github.com/actix/actix-extras/pull/203 -## 0.4.0-beta.2 - 2021-06-27 +## 0.4.0-beta.2 - No notable changes. -## 0.4.0-beta.1 - 2021-04-02 +## 0.4.0-beta.1 - Rename `CookieIdentityPolicy::{max_age => max_age_secs}`. [#168] - Rename `CookieIdentityPolicy::{max_age_time => max_age}`. [#168] @@ -113,24 +113,24 @@ Changes: [#168]: https://github.com/actix/actix-extras/pull/168 -## 0.3.1 - 2020-09-20 +## 0.3.1 - Add method to set `HttpOnly` flag on cookie identity. [#102] [#102]: https://github.com/actix/actix-extras/pull/102 -## 0.3.0 - 2020-09-11 +## 0.3.0 - Update `actix-web` dependency to 3.0.0. - Minimum supported Rust version (MSRV) is now 1.42.0. -## 0.3.0-alpha.1 - 2020-03-14 +## 0.3.0-alpha.1 - Update the `time` dependency to 0.2.7 - Update the `actix-web` dependency to 3.0.0-alpha.1 - Minimize `futures` dependency -## 0.2.1 - 2020-01-10 +## 0.2.1 - Fix panic with already borrowed: BorrowMutError #1263 diff --git a/actix-identity/Cargo.toml b/actix-identity/Cargo.toml index 3733951914..3adfbdd0fe 100644 --- a/actix-identity/Cargo.toml +++ b/actix-identity/Cargo.toml @@ -9,9 +9,9 @@ description = "Identity management for Actix Web" keywords = ["actix", "auth", "identity", "web", "security"] homepage = "https://actix.rs" repository = "https://github.com/actix/actix-extras.git" -license = "MIT OR Apache-2.0" -edition = "2018" -rust-version = "1.60" +license.workspace = true +edition.workspace = true +rust-version.workspace = true [package.metadata.docs.rs] rustdoc-args = ["--cfg", "docsrs"] diff --git a/actix-limitation/CHANGES.md b/actix-limitation/CHANGES.md index 2a88897444..3c57ac2c29 100644 --- a/actix-limitation/CHANGES.md +++ b/actix-limitation/CHANGES.md @@ -1,10 +1,10 @@ # Changes -## Unreleased - 2022-xx-xx +## Unreleased -- Update `redis` dependency to `0.22`. +- Update `redis` dependency to `0.23`. -## 0.4.0 - 2022-09-10 +## 0.4.0 - Add `Builder::key_by` for setting a custom rate limit key function. - Implement `Default` for `RateLimiter`. @@ -12,13 +12,13 @@ - In the middleware errors from the count function are matched and respond with `INTERNAL_SERVER_ERROR` if it's an unexpected error, instead of the default `TOO_MANY_REQUESTS`. - Minimum supported Rust version (MSRV) is now 1.59 due to transitive `time` dependency. -## 0.3.0 - 2022-07-11 +## 0.3.0 - `Limiter::builder` now takes an `impl Into`. - Removed lifetime from `Builder`. - Updated `actix-session` dependency to `0.7`. -## 0.2.0 - 2022-03-22 +## 0.2.0 - Update Actix Web dependency to v4 ecosystem. - Update Tokio dependencies to v1 ecosystem. @@ -26,6 +26,6 @@ - Rename `Builder::{finish => build}()`. - Exceeding the rate limit now returns a 429 Too Many Requests response. -## 0.1.4 - 2022-03-18 +## 0.1.4 - Adopted into @actix org from . diff --git a/actix-limitation/Cargo.toml b/actix-limitation/Cargo.toml index 8287c5e25e..1ebb9ad692 100644 --- a/actix-limitation/Cargo.toml +++ b/actix-limitation/Cargo.toml @@ -9,9 +9,9 @@ description = "Rate limiter using a fixed window counter for arbitrary keys, bac keywords = ["actix-web", "rate-api", "rate-limit", "limitation"] categories = ["asynchronous", "web-programming"] repository = "https://github.com/actix/actix-extras.git" -license = "MIT OR Apache-2.0" -edition = "2018" -rust-version = "1.60" +license.workspace = true +edition.workspace = true +rust-version.workspace = true [package.metadata.docs.rs] rustdoc-args = ["--cfg", "docsrs"] @@ -28,7 +28,7 @@ actix-web = { version = "4", features = ["cookies"] } chrono = "0.4" derive_more = "0.99.7" log = "0.4" -redis = { version = "0.22", default-features = false, features = ["tokio-comp"] } +redis = { version = "0.23", default-features = false, features = ["tokio-comp"] } time = "0.3" # session diff --git a/actix-protobuf/CHANGES.md b/actix-protobuf/CHANGES.md index 66b7326fae..453bdd3f42 100644 --- a/actix-protobuf/CHANGES.md +++ b/actix-protobuf/CHANGES.md @@ -1,39 +1,40 @@ # Changes -## Unreleased - 2022-xx-xx +## Unreleased -- Minimum supported Rust version (MSRV) is now 1.60. +- Updated `prost` dependency to `0.12`. +- Minimum supported Rust version (MSRV) is now 1.68. -## 0.9.0 - 2022-08-24 +## 0.9.0 - Added `application/x-protobuf` as an acceptable header. - Updated `prost` dependency to `0.11`. -## 0.8.0 - 2022-06-25 +## 0.8.0 - Update `prost` dependency to `0.10`. - Minimum supported Rust version (MSRV) is now 1.57 due to transitive `time` dependency. -## 0.7.0 - 2022-03-01 +## 0.7.0 - Update `actix-web` dependency to `4`. -## 0.7.0-beta.5 - 2022-02-03 +## 0.7.0-beta.5 - Update `prost` dependency to `0.9`. - Update `actix-web` dependency to `4.0.0-rc.1`. -## 0.7.0-beta.4 - 2021-12-29 +## 0.7.0-beta.4 - Minimum supported Rust version (MSRV) is now 1.54. -## 0.7.0-beta.3 - 2021-12-12 +## 0.7.0-beta.3 - Update `actix-web` dependency to `4.0.0.beta-14`. [#209] [#209]: https://github.com/actix/actix-extras/pull/209 -## 0.7.0-beta.2 - 2021-10-21 +## 0.7.0-beta.2 - Bump `prost` version to 0.8. [#197] - Update `actix-web` dependency to v4.0.0-beta.10. [#203] @@ -42,7 +43,7 @@ [#197]: https://github.com/actix/actix-extras/pull/197 [#203]: https://github.com/actix/actix-extras/pull/203 -## 0.7.0-beta.1 - 2021-06-27 +## 0.7.0-beta.1 - Bump `prost` version to 0.7. [#144] - Update `actix-web` dependency to 4.0.0 beta. @@ -50,12 +51,12 @@ [#144]: https://github.com/actix/actix-extras/pull/144 -## 0.6.0 - 2020-09-11 +## 0.6.0 - Update `actix-web` dependency to 3.0.0. - Minimum supported Rust version (MSRV) is now 1.42.0 to use `matches!` macro. -## 0.6.0-alpha.1 - 2020-07-06 +## 0.6.0-alpha.1 - Update `actix-web` to 3.0.0-alpha.3 - Minimum supported Rust version(MSRV) is now 1.40.0. diff --git a/actix-protobuf/Cargo.toml b/actix-protobuf/Cargo.toml index 633697f2c8..51cf3a1bd4 100644 --- a/actix-protobuf/Cargo.toml +++ b/actix-protobuf/Cargo.toml @@ -9,9 +9,9 @@ description = "Protobuf payload extractor for Actix Web" keywords = ["actix", "web", "protobuf", "protocol", "rpc"] homepage = "https://actix.rs" repository = "https://github.com/actix/actix-extras.git" -license = "MIT OR Apache-2.0" -edition = "2018" -rust-version = "1.60" +license.workspace = true +edition.workspace = true +rust-version.workspace = true [package.metadata.docs.rs] rustdoc-args = ["--cfg", "docsrs"] @@ -21,8 +21,8 @@ all-features = true actix-web = { version = "4", default-features = false } derive_more = "0.99.7" futures-util = { version = "0.3.7", default-features = false } -prost = { version = "0.11", default-features = false } +prost = { version = "0.12", default-features = false } [dev-dependencies] actix-web = { version = "4", default-features = false, features = ["macros"] } -prost = { version = "0.11", default-features = false, features = ["prost-derive"] } +prost = { version = "0.12", default-features = false, features = ["prost-derive"] } diff --git a/actix-redis/CHANGES.md b/actix-redis/CHANGES.md index 6cda7ae748..4ddcc40873 100644 --- a/actix-redis/CHANGES.md +++ b/actix-redis/CHANGES.md @@ -1,18 +1,18 @@ # Changes -## Unreleased - 2022-xx-xx +## Unreleased - Update `redis-async` dependency to `0.14`. -- Minimum supported Rust version (MSRV) is now 1.60. +- Minimum supported Rust version (MSRV) is now 1.68. -## 0.12.0 - 2022-07-09 +## 0.12.0 - Update `actix` dependency to `0.13`. - Update `redis-async` dependency to `0.13`. - Update `tokio-util` dependency to `0.7`. - Minimum supported Rust version (MSRV) is now 1.57 due to transitive `time` dependency. -## 0.11.0 - 2022-03-15 +## 0.11.0 ### Removed @@ -24,22 +24,22 @@ [#212]: https://github.com/actix/actix-extras/pull/212 -## 0.10.0 - 2022-03-01 +## 0.10.0 - Update `actix-web` dependency to `4`. -## 0.10.0-beta.6 - 2022-02-07 +## 0.10.0-beta.6 - Update `actix-web` dependency to `4.0.0-rc.1`. -## 0.10.0-beta.5 - 2021-12-29 +## 0.10.0-beta.5 - Update `actix-web` dependency to `4.0.0.beta-18`. [#218] - Minimum supported Rust version (MSRV) is now 1.54. [#218]: https://github.com/actix/actix-extras/pull/218 -## 0.10.0-beta.4 - 2021-12-12 +## 0.10.0-beta.4 - A session will be created in Redis if and only if there is some data inside the session state. This reduces the performance impact of `RedisSession` on routes that do not leverage sessions. [#207] - Update `actix-web` dependency to `4.0.0.beta-14`. [#209] @@ -47,23 +47,23 @@ [#207]: https://github.com/actix/actix-extras/pull/207 [#209]: https://github.com/actix/actix-extras/pull/209 -## 0.10.0-beta.3 - 2021-10-21 +## 0.10.0-beta.3 - Update `actix-web` dependency to v4.0.0-beta.10. [#203] - Minimum supported Rust version (MSRV) is now 1.52. [#203]: https://github.com/actix/actix-extras/pull/203 -## 0.10.0-beta.2 - 2021-06-27 +## 0.10.0-beta.2 - No notable changes. -## 0.10.0-beta.1 - 2021-04-02 +## 0.10.0-beta.1 - Update `actix-web` dependency to 4.0.0 beta. - Minimum supported Rust version (MSRV) is now 1.46.0. -## 0.9.2 - 2021-03-21 +## 0.9.2 - Implement `std::error::Error` for `Error` [#135] - Allow the removal of `Max-Age` for session-only cookies. [#161] @@ -71,16 +71,16 @@ [#135]: https://github.com/actix/actix-extras/pull/135 [#161]: https://github.com/actix/actix-extras/pull/161 -## 0.9.1 - 2020-09-12 +## 0.9.1 - Enforce minimum redis-async version of 0.6.3 to workaround breaking patch change. -## 0.9.0 - 2020-09-11 +## 0.9.0 - Update `actix-web` dependency to 3.0.0. - Minimize `futures` dependency. -## 0.9.0-alpha.2 - 2020-05-17 +## 0.9.0-alpha.2 - Add `cookie_http_only` functionality to RedisSession builder, setting this to false allows JavaScript to access cookies. Defaults to true. @@ -89,14 +89,14 @@ - Update `tokio-util` to 0.3 - Minimum supported Rust version(MSRV) is now 1.40.0. -## 0.9.0-alpha.1 - 2020-03-28 +## 0.9.0-alpha.1 - Update `actix` to 0.10.0-alpha.2 - Update `actix-session` to 0.4.0-alpha.1 - Update `actix-web` to 3.0.0-alpha.1 - Update `time` to 0.2.9 -## 0.8.1 - 2020-02-18 +## 0.8.1 - Move `env_logger` dependency to dev-dependencies and update to 0.7 - Update `actix_web` to 2.0.0 from 2.0.0-rc diff --git a/actix-redis/Cargo.toml b/actix-redis/Cargo.toml index 039c0f1653..a89970e24b 100644 --- a/actix-redis/Cargo.toml +++ b/actix-redis/Cargo.toml @@ -3,13 +3,13 @@ name = "actix-redis" version = "0.12.0" authors = ["Nikolay Kim "] description = "Actor-based Redis client" -license = "MIT OR Apache-2.0" keywords = ["actix", "redis", "async"] homepage = "https://actix.rs" repository = "https://github.com/actix/actix-extras.git" categories = ["network-programming", "asynchronous"] -edition = "2018" -rust-version = "1.60" +license.workspace = true +edition.workspace = true +rust-version.workspace = true [package.metadata.docs.rs] rustdoc-args = ["--cfg", "docsrs"] diff --git a/actix-session/CHANGES.md b/actix-session/CHANGES.md index fff49b151a..562a35e3c9 100644 --- a/actix-session/CHANGES.md +++ b/actix-session/CHANGES.md @@ -1,25 +1,25 @@ # Changes -## Unreleased - 2021-xx-xx +## Unreleased - Set secure attribute when adding a session removal cookie. -- Update `redis` dependency to `0.22`. -- Minimum supported Rust version (MSRV) is now 1.60. +- Update `redis` dependency to `0.23`. +- Minimum supported Rust version (MSRV) is now 1.68. -## 0.7.2 - 2022-09-11 +## 0.7.2 - Set SameSite attribute when adding a session removal cookie. [#284] - Minimum supported Rust version (MSRV) is now 1.59 due to transitive `time` dependency. [#284]: https://github.com/actix/actix-extras/pull/284 -## 0.7.1 - 2022-07-24 +## 0.7.1 - Fix interaction between session state changes and renewal. [#265] [#265]: https://github.com/actix/actix-extras/pull/265 -## 0.7.0 - 2022-07-09 +## 0.7.0 - Added `TtlExtensionPolicy` enum to support different strategies for extending the TTL attached to the session state. `TtlExtensionPolicy::OnEveryRequest` now allows for long-lived sessions that do not expire if the user remains active. [#233] - `SessionLength` is now called `SessionLifecycle`. [#233] @@ -36,7 +36,7 @@ [#233]: https://github.com/actix/actix-extras/pull/233 -## 0.6.2 - 2022-03-25 +## 0.6.2 - Implement `SessionExt` for `GuardContext`. [#234] - `RedisSessionStore` will prevent connection timeouts from causing user-visible errors. [#235] @@ -46,11 +46,11 @@ [#236]: https://github.com/actix/actix-extras/pull/236 [#235]: https://github.com/actix/actix-extras/pull/235 -## 0.6.1 - 2022-03-21 +## 0.6.1 - No significant changes since `0.6.0`. -## 0.6.0 - 2022-03-15 +## 0.6.0 ### Added @@ -72,28 +72,28 @@ [#212]: https://github.com/actix/actix-extras/pull/212 -## 0.5.0 - 2022-03-01 +## 0.5.0 - Update `actix-web` dependency to `4`. -## 0.5.0-beta.8 - 2022-02-07 +## 0.5.0-beta.8 - Update `actix-web` dependency to `4.0.0-rc.1`. -## 0.5.0-beta.7 - 2021-12-29 +## 0.5.0-beta.7 - Update `actix-web` dependency to `4.0.0.beta-18`. [#218] - Minimum supported Rust version (MSRV) is now 1.54. [#218]: https://github.com/actix/actix-extras/pull/218 -## 0.5.0-beta.6 - 2021-12-18 +## 0.5.0-beta.6 - Update `actix-web` dependency to `4.0.0.beta-15`. [#216] [#216]: https://github.com/actix/actix-extras/pull/216 -## 0.5.0-beta.5 - 2021-12-12 +## 0.5.0-beta.5 - Update `actix-web` dependency to `4.0.0.beta-14`. [#209] - Remove `UserSession` implementation for `RequestHead`. [#209] @@ -102,11 +102,11 @@ [#207]: https://github.com/actix/actix-extras/pull/207 [#209]: https://github.com/actix/actix-extras/pull/209 -## 0.5.0-beta.4 - 2021-11-22 +## 0.5.0-beta.4 - No significant changes since `0.5.0-beta.3`. -## 0.5.0-beta.3 - 2021-10-21 +## 0.5.0-beta.3 - Impl `Clone` for `CookieSession`. [#201] - Update `actix-web` dependency to v4.0.0-beta.10. [#203] @@ -115,11 +115,11 @@ [#201]: https://github.com/actix/actix-extras/pull/201 [#203]: https://github.com/actix/actix-extras/pull/203 -## 0.5.0-beta.2 - 2021-06-27 +## 0.5.0-beta.2 - No notable changes. -## 0.5.0-beta.1 - 2021-04-02 +## 0.5.0-beta.1 - Add `Session::entries`. [#170] - Rename `Session::{set => insert}` to match standard hash map naming. [#170] @@ -132,7 +132,7 @@ [#170]: https://github.com/actix/actix-extras/pull/170 -## 0.4.1 - 2021-03-21 +## 0.4.1 - `Session::set_session` takes a `IntoIterator` instead of `Iterator`. [#105] - Fix calls to `session.purge()` from paths other than the one specified in the cookie. [#129] @@ -140,12 +140,12 @@ [#105]: https://github.com/actix/actix-extras/pull/105 [#129]: https://github.com/actix/actix-extras/pull/129 -## 0.4.0 - 2020-09-11 +## 0.4.0 - Update `actix-web` dependency to 3.0.0. - Minimum supported Rust version (MSRV) is now 1.42.0. -## 0.4.0-alpha.1 - 2020-03-14 +## 0.4.0-alpha.1 - Update the `time` dependency to 0.2.7 - Update the `actix-web` dependency to 3.0.0-alpha.1 diff --git a/actix-session/Cargo.toml b/actix-session/Cargo.toml index 48bd9ab020..4ca9e5d16b 100644 --- a/actix-session/Cargo.toml +++ b/actix-session/Cargo.toml @@ -9,9 +9,9 @@ description = "Session management for Actix We" keywords = ["http", "web", "framework", "async", "session"] homepage = "https://actix.rs" repository = "https://github.com/actix/actix-extras.git" -license = "MIT OR Apache-2.0" -edition = "2018" -rust-version = "1.60" +license.workspace = true +edition.workspace = true +rust-version.workspace = true [package.metadata.docs.rs] rustdoc-args = ["--cfg", "docsrs"] @@ -43,7 +43,7 @@ actix-redis = { version = "0.12", optional = true } futures-core = { version = "0.3.7", default-features = false, optional = true } # redis-rs-session -redis = { version = "0.22", default-features = false, features = ["tokio-comp", "connection-manager"], optional = true } +redis = { version = "0.23", default-features = false, features = ["tokio-comp", "connection-manager"], optional = true } [dev-dependencies] actix-session = { path = ".", features = ["cookie-session", "redis-actor-session", "redis-rs-session"] } diff --git a/actix-session/src/session.rs b/actix-session/src/session.rs index 3a056e1ba5..1cd20cd42d 100644 --- a/actix-session/src/session.rs +++ b/actix-session/src/session.rs @@ -46,7 +46,7 @@ use serde::{de::DeserializeOwned, Serialize}; pub struct Session(Rc>); /// Status of a [`Session`]. -#[derive(Debug, Clone, PartialEq, Eq)] +#[derive(Debug, Clone, Default, PartialEq, Eq)] pub enum SessionStatus { /// Session state has been updated - the changes will have to be persisted to the backend. Changed, @@ -64,15 +64,10 @@ pub enum SessionStatus { Renewed, /// The session state has not been modified since its creation/retrieval. + #[default] Unchanged, } -impl Default for SessionStatus { - fn default() -> SessionStatus { - SessionStatus::Unchanged - } -} - #[derive(Default)] struct SessionInner { state: HashMap, @@ -218,6 +213,7 @@ impl Session { /// /// Values that match keys already existing on the session will be overwritten. Values should /// already be JSON serialized. + #[allow(clippy::needless_pass_by_ref_mut)] pub(crate) fn set_session( req: &mut ServiceRequest, data: impl IntoIterator, @@ -232,6 +228,7 @@ impl Session { /// This is a destructive operation - the session state is removed from the request extensions /// typemap, leaving behind a new empty map. It should only be used when the session is being /// finalised (i.e. in `SessionMiddleware`). + #[allow(clippy::needless_pass_by_ref_mut)] pub(crate) fn get_changes( res: &mut ServiceResponse, ) -> (SessionStatus, HashMap) { diff --git a/actix-session/src/storage/redis_rs.rs b/actix-session/src/storage/redis_rs.rs index 86db45a3e7..44332f8b48 100644 --- a/actix-session/src/storage/redis_rs.rs +++ b/actix-session/src/storage/redis_rs.rs @@ -261,6 +261,7 @@ impl RedisSessionStore { /// This helper method catches this case (`.is_connection_dropped`) to execute a retry. The /// retry will be executed on a fresh connection, therefore it is likely to succeed (or fail for /// a different more meaningful reason). + #[allow(clippy::needless_pass_by_ref_mut)] async fn execute_command(&self, cmd: &mut Cmd) -> RedisResult { let mut can_retry = true; diff --git a/actix-session/tests/opaque_errors.rs b/actix-session/tests/opaque_errors.rs index d0af675c54..e896d93cdd 100644 --- a/actix-session/tests/opaque_errors.rs +++ b/actix-session/tests/opaque_errors.rs @@ -69,15 +69,18 @@ impl SessionStore for MockStore { _session_state: HashMap, _ttl: &Duration, ) -> Result { - todo!() + #![allow(clippy::diverging_sub_expression)] + unimplemented!() } async fn update_ttl(&self, _session_key: &SessionKey, _ttl: &Duration) -> Result<(), Error> { - todo!() + #![allow(clippy::diverging_sub_expression)] + unimplemented!() } async fn delete(&self, _session_key: &SessionKey) -> Result<(), Error> { - todo!() + #![allow(clippy::diverging_sub_expression)] + unimplemented!() } } diff --git a/actix-settings/CHANGES.md b/actix-settings/CHANGES.md index 670390cbbd..02e8a4fd27 100644 --- a/actix-settings/CHANGES.md +++ b/actix-settings/CHANGES.md @@ -1,18 +1,23 @@ # Changes -## Unreleased - 2022-xx-xx +## Unreleased +- `ActixSettings` can be applied to `HttpServer`. - Rename `AtError => Error`. - Remove `AtResult` type alias. -- Minimum supported Rust version (MSRV) is now 1.60. -- `ActixSettings` can be applied to `HttpServer` +- Update `toml` dependency to `0.8`. +- Remove `ioe` dependency; `std::io::Error` is now used directly. +- Remove `Clone` implementation for `Error`. +- Implement `Display` for `Error`. +- Implement std's `Error` for `Error`. +- Minimum supported Rust version (MSRV) is now 1.68. -## 0.6.0 - 2022-07-31 +## 0.6.0 - Update Actix Web dependencies to v4 ecosystem. - Rename `actix.ssl` settings object to `actix.tls`. - `NoSettings` is now marked `#[non_exhaustive]`. -## 0.5.2 - 2022-07-31 +## 0.5.2 - Adopted into @actix org from . diff --git a/actix-settings/Cargo.toml b/actix-settings/Cargo.toml index 337e578754..1c39ec9819 100644 --- a/actix-settings/Cargo.toml +++ b/actix-settings/Cargo.toml @@ -6,9 +6,9 @@ authors = [ "Rob Ede ", ] description = "Easily manage Actix Web's settings from a TOML file and environment variables" -license = "MIT OR Apache-2.0" -edition = "2018" -rust-version = "1.60" +license.workspace = true +edition.workspace = true +rust-version.workspace = true [package.metadata.docs.rs] rustdoc-args = ["--cfg", "docsrs"] @@ -18,12 +18,11 @@ all-features = true actix-http = "3" actix-service = "2" actix-web = "4" - -ioe = "0.5" +derive_more = "0.99.7" once_cell = "1.13" regex = "1.5.5" serde = { version = "1", features = ["derive"] } -toml = "0.5" +toml = "0.8" [dev-dependencies] env_logger = "0.10" diff --git a/actix-settings/src/error.rs b/actix-settings/src/error.rs index f59e355f07..7803dca434 100644 --- a/actix-settings/src/error.rs +++ b/actix-settings/src/error.rs @@ -1,18 +1,22 @@ use std::{env::VarError, io, num::ParseIntError, path::PathBuf, str::ParseBoolError}; +use derive_more::{Display, Error}; use toml::de::Error as TomlError; /// Errors that can be returned from methods in this crate. -#[derive(Debug, Clone)] +#[derive(Debug, Display, Error)] pub enum Error { /// Environment variable does not exists or is invalid. + #[display(fmt = "Env var error: {_0}")] EnvVarError(VarError), /// File already exists on disk. - FileExists(PathBuf), + #[display(fmt = "File exists: {}", "_0.display()")] + FileExists(#[error(not(source))] PathBuf), /// Invalid value. #[allow(missing_docs)] + #[display(fmt = "Expected {expected}, got {got} (@ {file}:{line}:{column})")] InvalidValue { expected: &'static str, got: String, @@ -22,18 +26,23 @@ pub enum Error { }, /// I/O error. - IoError(ioe::IoError), + #[display(fmt = "")] + IoError(io::Error), /// Value is not a boolean. + #[display(fmt = "Failed to parse boolean: {_0}")] ParseBoolError(ParseBoolError), /// Value is not an integer. + #[display(fmt = "Failed to parse integer: {_0}")] ParseIntError(ParseIntError), /// Value is not an address. - ParseAddressError(String), + #[display(fmt = "Failed to parse address: {_0}")] + ParseAddressError(#[error(not(source))] String), /// Error deserializing as TOML. + #[display(fmt = "TOML error: {_0}")] TomlError(TomlError), } @@ -51,12 +60,6 @@ macro_rules! InvalidValue { impl From for Error { fn from(err: io::Error) -> Self { - Self::IoError(ioe::IoError::from(err)) - } -} - -impl From for Error { - fn from(err: ioe::IoError) -> Self { Self::IoError(err) } } @@ -88,48 +91,27 @@ impl From for Error { impl From for io::Error { fn from(err: Error) -> Self { match err { - Error::EnvVarError(var_error) => { - let msg = format!("Env var error: {var_error}"); - io::Error::new(io::ErrorKind::InvalidInput, msg) - } + Error::EnvVarError(_) => io::Error::new(io::ErrorKind::InvalidInput, err.to_string()), - Error::FileExists(path_buf) => { - let msg = format!("File exists: {}", path_buf.display()); - io::Error::new(io::ErrorKind::AlreadyExists, msg) - } + Error::FileExists(_) => io::Error::new(io::ErrorKind::AlreadyExists, err.to_string()), - Error::InvalidValue { - expected, - ref got, - file, - line, - column, - } => { - let msg = format!("Expected {expected}, got {got} (@ {file}:{line}:{column})"); - io::Error::new(io::ErrorKind::InvalidInput, msg) + Error::InvalidValue { .. } => { + io::Error::new(io::ErrorKind::InvalidInput, err.to_string()) } - Error::IoError(io_error) => io_error.into(), + Error::IoError(io_error) => io_error, - Error::ParseBoolError(parse_bool_error) => { - let msg = format!("Failed to parse boolean: {parse_bool_error}"); - io::Error::new(io::ErrorKind::InvalidInput, msg) + Error::ParseBoolError(_) => { + io::Error::new(io::ErrorKind::InvalidInput, err.to_string()) } - Error::ParseIntError(parse_int_error) => { - let msg = format!("Failed to parse integer: {parse_int_error}"); - io::Error::new(io::ErrorKind::InvalidInput, msg) - } + Error::ParseIntError(_) => io::Error::new(io::ErrorKind::InvalidInput, err.to_string()), - Error::ParseAddressError(string) => { - let msg = format!("Failed to parse address: {string}"); - io::Error::new(io::ErrorKind::InvalidInput, msg) + Error::ParseAddressError(_) => { + io::Error::new(io::ErrorKind::InvalidInput, err.to_string()) } - Error::TomlError(toml_error) => { - let msg = format!("TOML error: {toml_error}"); - io::Error::new(io::ErrorKind::InvalidInput, msg) - } + Error::TomlError(_) => io::Error::new(io::ErrorKind::InvalidInput, err.to_string()), } } } diff --git a/actix-settings/src/lib.rs b/actix-settings/src/lib.rs index df999e46b9..818df35338 100644 --- a/actix-settings/src/lib.rs +++ b/actix-settings/src/lib.rs @@ -169,7 +169,8 @@ where /// Writes the default TOML template to a new file, located at `filepath`. /// /// # Errors - /// Returns a [`FileExists`](crate::AtError::FileExists) error if a file already exists at that + /// + /// Returns a [`FileExists`](crate::Error::FileExists) error if a file already exists at that /// location. pub fn write_toml_file

(filepath: P) -> AsResult<()> where diff --git a/actix-settings/src/parse.rs b/actix-settings/src/parse.rs index e88a64a3c0..b4433dd93d 100644 --- a/actix-settings/src/parse.rs +++ b/actix-settings/src/parse.rs @@ -2,7 +2,7 @@ use std::{path::PathBuf, str::FromStr}; use crate::Error; -/// A specialized `FromStr` trait that returns [`AtError`] errors +/// A specialized `FromStr` trait that returns [`Error`] errors pub trait Parse: Sized { /// Parse `Self` from `string`. fn parse(string: &str) -> Result; diff --git a/actix-web-httpauth/CHANGES.md b/actix-web-httpauth/CHANGES.md index 712b74cf4b..d307ad7d6b 100644 --- a/actix-web-httpauth/CHANGES.md +++ b/actix-web-httpauth/CHANGES.md @@ -1,10 +1,11 @@ # Changes -## Unreleased - 2022-xx-xx +## Unreleased -- Minimum supported Rust version (MSRV) is now 1.60. +- Implement `From` for `BasicAuth`. +- Minimum supported Rust version (MSRV) is now 1.68. -## 0.8.0 - 2022-07-21 +## 0.8.0 - Removed `AuthExtractor` trait; implement `FromRequest` for your custom auth types. [#264] - `BasicAuth::user_id()` now returns `&str`. [#249] @@ -16,74 +17,74 @@ [#249]: https://github.com/actix/actix-extras/pull/249 [#264]: https://github.com/actix/actix-extras/pull/264 -## 0.7.0 - 2022-07-19 +## 0.7.0 - Auth validator functions now need to return `(Error, ServiceRequest)` in error cases. [#260] - Minimum supported Rust version (MSRV) is now 1.57 due to transitive `time` dependency. [#260]: https://github.com/actix/actix-extras/pull/260 -## 0.6.0 - 2022-03-01 +## 0.6.0 - Update `actix-web` dependency to `4`. -## 0.6.0-beta.8 - 2022-02-07 +## 0.6.0-beta.8 - Relax body type bounds on middleware impl. [#223] - Update `actix-web` dependency to `4.0.0-rc.1`. [#223]: https://github.com/actix/actix-extras/pull/223 -## 0.6.0-beta.7 - 2021-12-29 +## 0.6.0-beta.7 - Minimum supported Rust version (MSRV) is now 1.54. -## 0.6.0-beta.6 - 2021-12-18 +## 0.6.0-beta.6 - Update `actix-web` dependency to `4.0.0.beta-15`. [#216] [#216]: https://github.com/actix/actix-extras/pull/216 -## 0.6.0-beta.5 - 2021-12-12 +## 0.6.0-beta.5 - Update `actix-web` dependency to `4.0.0.beta-14`. [#209] [#209]: https://github.com/actix/actix-extras/pull/209 -## 0.6.0-beta.4 - 2021-11-22 +## 0.6.0-beta.4 - impl `AuthExtractor` trait for `Option` and `Result`. [#205] [#205]: https://github.com/actix/actix-extras/pull/205 -## 0.6.0-beta.3 - 2021-10-21 +## 0.6.0-beta.3 - Update `actix-web` dependency to v4.0.0-beta.10. [#203] - Minimum supported Rust version (MSRV) is now 1.52. [#203]: https://github.com/actix/actix-extras/pull/203 -## 0.6.0-beta.2 - 2021-06-27 +## 0.6.0-beta.2 - No notable changes. -## 0.6.0-beta.1 - 2021-04-02 +## 0.6.0-beta.1 - Update `actix-web` dependency to 4.0.0 beta. - Minimum supported Rust version (MSRV) is now 1.46.0. -## 0.5.1 - 2021-03-21 +## 0.5.1 - Correct error handling when extracting auth details from request. [#128] [#128]: https://github.com/actix/actix-extras/pull/128 -## 0.5.0 - 2020-09-11 +## 0.5.0 - Update `actix-web` dependency to 3.0.0. - Minimum supported Rust version (MSRV) is now 1.42.0. -## 0.4.2 - 2020-07-08 +## 0.4.2 - Update the `base64` dependency to 0.12 - AuthenticationError's status code is preserved when converting to a ResponseError @@ -92,11 +93,11 @@ [#69]: https://github.com/actix/actix-web-httpauth/pull/69 -## 0.4.1 - 2020-02-19 +## 0.4.1 - Move repository to actix-extras -## 0.4.0 - 2020-01-14 +## 0.4.0 - Depends on `actix-web = "^2.0"`, `actix-service = "^1.0"`, and `futures = "^0.3"` version now ([#14]) - Depends on `bytes = "^0.5"` and `base64 = "^0.11"` now diff --git a/actix-web-httpauth/Cargo.toml b/actix-web-httpauth/Cargo.toml index 59dca5d50b..00977f3f9c 100644 --- a/actix-web-httpauth/Cargo.toml +++ b/actix-web-httpauth/Cargo.toml @@ -10,9 +10,9 @@ keywords = ["http", "web", "framework", "authentication", "security"] homepage = "https://actix.rs" repository = "https://github.com/actix/actix-extras.git" categories = ["web-programming::http-server"] -license = "MIT OR Apache-2.0" -edition = "2018" -rust-version = "1.60" +license.workspace = true +edition.workspace = true +rust-version.workspace = true [package.metadata.docs.rs] rustdoc-args = ["--cfg", "docsrs"] diff --git a/actix-web-httpauth/src/extractors/basic.rs b/actix-web-httpauth/src/extractors/basic.rs index 97890dda28..8b0f39ee8c 100644 --- a/actix-web-httpauth/src/extractors/basic.rs +++ b/actix-web-httpauth/src/extractors/basic.rs @@ -89,6 +89,12 @@ impl BasicAuth { } } +impl From for BasicAuth { + fn from(basic: Basic) -> Self { + Self(basic) + } +} + impl FromRequest for BasicAuth { type Future = Ready>; type Error = AuthenticationError; diff --git a/actix-web-httpauth/src/extractors/bearer.rs b/actix-web-httpauth/src/extractors/bearer.rs index e5610ff1e2..78ed3b6160 100644 --- a/actix-web-httpauth/src/extractors/bearer.rs +++ b/actix-web-httpauth/src/extractors/bearer.rs @@ -102,7 +102,7 @@ impl FromRequest for BearerAuth { let bearer = req .app_data::() .map(|config| config.0.clone()) - .unwrap_or_else(Default::default); + .unwrap_or_default(); AuthenticationError::new(bearer) }), diff --git a/actix-web-httpauth/src/headers/authorization/scheme/basic.rs b/actix-web-httpauth/src/headers/authorization/scheme/basic.rs index 4e5cbc6768..38e511adb1 100644 --- a/actix-web-httpauth/src/headers/authorization/scheme/basic.rs +++ b/actix-web-httpauth/src/headers/authorization/scheme/basic.rs @@ -55,7 +55,7 @@ impl Scheme for Basic { let mut parts = header.to_str()?.splitn(2, ' '); match parts.next() { - Some(scheme) if scheme == "Basic" => (), + Some("Basic") => (), _ => return Err(ParseError::MissingScheme), } diff --git a/actix-web-httpauth/src/headers/authorization/scheme/bearer.rs b/actix-web-httpauth/src/headers/authorization/scheme/bearer.rs index 4fac1888cf..13068b67f0 100644 --- a/actix-web-httpauth/src/headers/authorization/scheme/bearer.rs +++ b/actix-web-httpauth/src/headers/authorization/scheme/bearer.rs @@ -50,7 +50,7 @@ impl Scheme for Bearer { let mut parts = header.to_str()?.splitn(2, ' '); match parts.next() { - Some(scheme) if scheme == "Bearer" => {} + Some("Bearer") => {} _ => return Err(ParseError::MissingScheme), } diff --git a/clippy.toml b/clippy.toml deleted file mode 100644 index 13f202e9e5..0000000000 --- a/clippy.toml +++ /dev/null @@ -1 +0,0 @@ -msrv = "1.60"