1
0
mirror of https://github.com/actix/actix-extras.git synced 2025-02-22 18:33:18 +01:00

Merge remote-tracking branch 'upstream/master'

This commit is contained in:
Raphael C 2023-10-19 11:45:20 +02:00
commit 0cde6caff8
42 changed files with 375 additions and 350 deletions

View File

@ -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.

10
.github/dependabot.yml vendored Normal file
View File

@ -0,0 +1,10 @@
version: 2
updates:
- package-ecosystem: cargo
directory: /
schedule:
interval: weekly
- package-ecosystem: github-actions
directory: /
schedule:
interval: weekly

View File

@ -16,10 +16,8 @@ jobs:
matrix: matrix:
target: target:
- { name: Linux, os: ubuntu-latest, triple: x86_64-unknown-linux-gnu } - { 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 }} runs-on: ${{ matrix.target.os }}
services: services:
@ -30,15 +28,16 @@ jobs:
options: --entrypoint redis-server options: --entrypoint redis-server
steps: steps:
- uses: actions/checkout@v3 - uses: actions/checkout@v4
- name: Install Rust (${{ matrix.version }}) - name: Install Rust (nightly)
uses: actions-rust-lang/setup-rust-toolchain@v1 uses: actions-rust-lang/setup-rust-toolchain@v1.5.0
with: with:
toolchain: ${{ matrix.version }} toolchain: nightly
- uses: taiki-e/cache-cargo-install-action@v1 - uses: taiki-e/install-action@v2.20.3
with: { tool: cargo-hack } with:
tool: cargo-hack
- name: check minimal - name: check minimal
run: cargo ci-min run: cargo ci-min
@ -61,30 +60,26 @@ jobs:
build_and_test_other_nightly: build_and_test_other_nightly:
strategy: strategy:
fail-fast: false fail-fast: false
# prettier-ignore
matrix: matrix:
target: target:
- { name: macOS, os: macos-latest, triple: x86_64-apple-darwin } - { 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:
- nightly
name: ${{ matrix.target.name }} / ${{ matrix.version }} name: ${{ matrix.target.name }} / nightly
runs-on: ${{ matrix.target.os }} runs-on: ${{ matrix.target.os }}
steps: steps:
- uses: actions/checkout@v3 - uses: actions/checkout@v4
- name: Install Rust (${{ matrix.version }}) - name: Install Rust (nightly)
uses: actions-rust-lang/setup-rust-toolchain@v1 uses: actions-rust-lang/setup-rust-toolchain@v1.5.0
with: with:
toolchain: ${{ matrix.version }} toolchain: nightly
- uses: taiki-e/cache-cargo-install-action@v1 - uses: taiki-e/install-action@v2.20.3
with: { tool: cargo-hack } with:
tool: cargo-hack
- name: check minimal - name: check minimal
run: cargo ci-min run: cargo ci-min

View File

@ -1,8 +1,12 @@
name: CI name: CI
on: on:
pull_request: {} pull_request:
push: { branches: [master] } types: [opened, synchronize, reopened]
merge_group:
types: [checks_requested]
push:
branches: [master]
permissions: { contents: read } permissions: { contents: read }
@ -18,10 +22,10 @@ jobs:
target: target:
- { name: Linux, os: ubuntu-latest, triple: x86_64-unknown-linux-gnu } - { name: Linux, os: ubuntu-latest, triple: x86_64-unknown-linux-gnu }
version: version:
- '1.60' # MSRV - { name: msrv, version: 1.68.0 }
- stable - { name: stable, version: stable }
name: ${{ matrix.target.name }} / ${{ matrix.version }} name: ${{ matrix.target.name }} / ${{ matrix.version.name }}
runs-on: ${{ matrix.target.os }} runs-on: ${{ matrix.target.os }}
services: services:
@ -37,21 +41,22 @@ jobs:
--entrypoint redis-server --entrypoint redis-server
steps: steps:
- uses: actions/checkout@v3 - uses: actions/checkout@v4
- name: Install Rust (${{ matrix.version }}) - name: Install Rust (${{ matrix.version.name }})
uses: actions-rust-lang/setup-rust-toolchain@v1 uses: actions-rust-lang/setup-rust-toolchain@v1.5.0
with: with:
toolchain: ${{ matrix.version }} toolchain: ${{ matrix.version.version }}
- name: Install cargo-hack - name: Install cargo-hack
uses: taiki-e/cache-cargo-install-action@v1 uses: taiki-e/install-action@v2.20.3
with: { tool: cargo-hack } with:
tool: cargo-hack
- name: workaround MSRV issues # - name: workaround MSRV issues
if: matrix.version != 'stable' # if: matrix.version.name == 'msrv'
run: | # run: |
cargo update -p=time:0.3.20 --precise=0.3.16 # cargo update -p=time:0.3.20 --precise=0.3.16
- name: check minimal - name: check minimal
run: cargo ci-min run: cargo ci-min
@ -75,36 +80,34 @@ jobs:
strategy: strategy:
fail-fast: false fail-fast: false
matrix: matrix:
# prettier-ignore
target: target:
- { name: macOS, os: macos-latest, triple: x86_64-apple-darwin } - { 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: version:
- '1.60' # MSRV - { name: msrv, version: 1.68.0 }
- stable - { name: stable, version: stable }
name: ${{ matrix.target.name }} / ${{ matrix.version }} name: ${{ matrix.target.name }} / ${{ matrix.version.name }}
runs-on: ${{ matrix.target.os }} runs-on: ${{ matrix.target.os }}
steps: steps:
- uses: actions/checkout@v3 - uses: actions/checkout@v4
- name: Install Rust (${{ matrix.version }}) - name: Install Rust (${{ matrix.version.name }})
uses: actions-rust-lang/setup-rust-toolchain@v1 uses: actions-rust-lang/setup-rust-toolchain@v1.5.0
with: with:
toolchain: ${{ matrix.version }} toolchain: ${{ matrix.version.version }}
- name: Install cargo-hack - name: Install cargo-hack
uses: taiki-e/cache-cargo-install-action@v1 uses: taiki-e/install-action@v2.20.3
with: { tool: cargo-hack } with:
tool: cargo-hack
- name: workaround MSRV issues # - name: workaround MSRV issues
if: matrix.version != 'stable' # if: matrix.version.name == 'msrv'
run: | # run: |
cargo update -p=time:0.3.20 --precise=0.3.16 # cargo update -p=time:0.3.20 --precise=0.3.16
- name: check minimal - name: check minimal
run: cargo ci-min run: cargo ci-min
@ -128,11 +131,12 @@ jobs:
name: doc tests name: doc tests
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- uses: actions/checkout@v3 - uses: actions/checkout@v4
- name: Install Rust (nightly) - 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 } with:
toolchain: nightly
- name: doc tests - name: doc tests
timeout-minutes: 40 timeout-minutes: 40

View File

@ -1,7 +1,8 @@
name: Coverage name: Coverage
on: on:
push: { branches: [master] } push:
branches: [master]
permissions: { contents: read } permissions: { contents: read }
@ -21,11 +22,12 @@ jobs:
options: --entrypoint redis-server options: --entrypoint redis-server
steps: steps:
- uses: actions/checkout@v3 - uses: actions/checkout@v4
- name: Install Rust (nightly) - 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 } with:
toolchain: nightly
- name: Generate coverage file - name: Generate coverage file
run: | run: |
@ -34,4 +36,5 @@ jobs:
- name: Upload to Codecov - name: Upload to Codecov
uses: codecov/codecov-action@v3 uses: codecov/codecov-action@v3
with: { file: cobertura.xml } with:
file: cobertura.xml

View File

@ -12,10 +12,10 @@ jobs:
fmt: fmt:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- uses: actions/checkout@v3 - uses: actions/checkout@v4
- name: Install Rust (nightly) - name: Install Rust (nightly)
uses: actions-rust-lang/setup-rust-toolchain@v1 uses: actions-rust-lang/setup-rust-toolchain@v1.5.0
with: with:
toolchain: nightly toolchain: nightly
components: rustfmt components: rustfmt
@ -26,33 +26,36 @@ jobs:
clippy: clippy:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- uses: actions/checkout@v3 - uses: actions/checkout@v4
- name: Install Rust - name: Install Rust
uses: actions-rust-lang/setup-rust-toolchain@v1 uses: actions-rust-lang/setup-rust-toolchain@v1.5.0
with: { components: clippy } with:
components: clippy
- name: Check with 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: public-api-diff:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- name: checkout ${{ github.base_ref }} - name: checkout ${{ github.base_ref }}
uses: actions/checkout@v3 uses: actions/checkout@v4
with: with:
ref: ${{ github.base_ref }} ref: ${{ github.base_ref }}
- name: checkout ${{ github.head_ref }} - name: checkout ${{ github.head_ref }}
uses: actions/checkout@v3 uses: actions/checkout@v4
- name: Install Rust (nightly) - 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 } with:
toolchain: nightly
- name: Install cargo-public-api - name: Install cargo-public-api
uses: taiki-e/cache-cargo-install-action@v1 uses: taiki-e/cache-cargo-install-action@v1.3.0
with: { tool: cargo-public-api } with:
tool: cargo-public-api
- name: generate API diff - name: generate API diff
run: | run: |

View File

@ -14,10 +14,10 @@ jobs:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- uses: actions/checkout@v3 - uses: actions/checkout@v4
- name: Install Rust (nightly) - 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 } with: { toolchain: nightly }
- name: Build Docs - name: Build Docs
@ -27,7 +27,7 @@ jobs:
run: echo '<meta http-equiv="refresh" content="0;url=actix_cors/index.html">' > target/doc/index.html run: echo '<meta http-equiv="refresh" content="0;url=actix_cors/index.html">' > target/doc/index.html
- name: Deploy to GitHub Pages - name: Deploy to GitHub Pages
uses: JamesIves/github-pages-deploy-action@3.7.1 uses: JamesIves/github-pages-deploy-action@v4.4.3
with: with:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
BRANCH: gh-pages BRANCH: gh-pages

View File

@ -11,10 +11,10 @@ members = [
"actix-web-httpauth", "actix-web-httpauth",
] ]
# TODO(MSRV 1.64) [workspace.package]
# [workspace.package] license = "MIT OR Apache-2.0"
# edition = "2018" edition = "2021"
# rust-version = "1.60" rust-version = "1.68"
[patch.crates-io] [patch.crates-io]
actix-cors = { path = "./actix-cors" } actix-cors = { path = "./actix-cors" }

View File

@ -12,13 +12,13 @@
| Crate | | | | Crate | | |
| -------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------- | | -------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------- |
| [actix-cors] | [![crates.io](https://img.shields.io/crates/v/actix-cors?label=latest)](https://crates.io/crates/actix-cors) [![dependency status](https://deps.rs/crate/actix-cors/0.6.4/status.svg)](https://deps.rs/crate/actix-cors/0.6.4) | Cross-Origin Resource Sharing (CORS) controls. | | [actix-cors] | [![crates.io](https://img.shields.io/crates/v/actix-cors?label=latest)](https://crates.io/crates/actix-cors) [![dependency status](https://deps.rs/crate/actix-cors/0.6.4/status.svg)](https://deps.rs/crate/actix-cors/0.6.4) | Cross-Origin Resource Sharing (CORS) controls. |
| [actix-identity] | [![crates.io](https://img.shields.io/crates/v/actix-identity?label=latest)](https://crates.io/crates/actix-identity) [![dependency status](https://deps.rs/crate/actix-identity/0.5.2/status.svg)](https://deps.rs/crate/actix-identity/0.5.2) | Identity management. | | [actix-identity] | [![crates.io](https://img.shields.io/crates/v/actix-identity?label=latest)](https://crates.io/crates/actix-identity) [![dependency status](https://deps.rs/crate/actix-identity/0.6.0/status.svg)](https://deps.rs/crate/actix-identity/0.6.0) | Identity management. |
| [actix-limitation] | [![crates.io](https://img.shields.io/crates/v/actix-limitation?label=latest)](https://crates.io/crates/actix-limitation) [![dependency status](https://deps.rs/crate/actix-limitation/0.4.0/status.svg)](https://deps.rs/crate/actix-limitation/0.4.0) | Rate-limiting using a fixed window counter for arbitrary keys, backed by Redis. | | [actix-limitation] | [![crates.io](https://img.shields.io/crates/v/actix-limitation?label=latest)](https://crates.io/crates/actix-limitation) [![dependency status](https://deps.rs/crate/actix-limitation/0.5.1/status.svg)](https://deps.rs/crate/actix-limitation/0.5.1) | Rate-limiting using a fixed window counter for arbitrary keys, backed by Redis. |
| [actix-protobuf] | [![crates.io](https://img.shields.io/crates/v/actix-protobuf?label=latest)](https://crates.io/crates/actix-protobuf) [![dependency status](https://deps.rs/crate/actix-protobuf/0.9.0/status.svg)](https://deps.rs/crate/actix-protobuf/0.9.0) | Protobuf payload extractor. | | [actix-protobuf] | [![crates.io](https://img.shields.io/crates/v/actix-protobuf?label=latest)](https://crates.io/crates/actix-protobuf) [![dependency status](https://deps.rs/crate/actix-protobuf/0.10.0/status.svg)](https://deps.rs/crate/actix-protobuf/0.10.0) | Protobuf payload extractor. |
| [actix-redis] | [![crates.io](https://img.shields.io/crates/v/actix-redis?label=latest)](https://crates.io/crates/actix-redis) [![dependency status](https://deps.rs/crate/actix-redis/0.12.0/status.svg)](https://deps.rs/crate/actix-redis/0.12.0) | Actor-based Redis client. | | [actix-redis] | [![crates.io](https://img.shields.io/crates/v/actix-redis?label=latest)](https://crates.io/crates/actix-redis) [![dependency status](https://deps.rs/crate/actix-redis/0.13.0/status.svg)](https://deps.rs/crate/actix-redis/0.13.0) | Actor-based Redis client. |
| [actix-session] | [![crates.io](https://img.shields.io/crates/v/actix-session?label=latest)](https://crates.io/crates/actix-session) [![dependency status](https://deps.rs/crate/actix-session/0.7.2/status.svg)](https://deps.rs/crate/actix-session/0.7.2) | Session management. | | [actix-session] | [![crates.io](https://img.shields.io/crates/v/actix-session?label=latest)](https://crates.io/crates/actix-session) [![dependency status](https://deps.rs/crate/actix-session/0.8.0/status.svg)](https://deps.rs/crate/actix-session/0.8.0) | Session management. |
| [actix-settings] | [![crates.io](https://img.shields.io/crates/v/actix-settings?label=latest)](https://crates.io/crates/actix-settings) [![dependency status](https://deps.rs/crate/actix-settings/0.6.0/status.svg)](https://deps.rs/crate/actix-settings/0.6.0) | Easily manage Actix Web's settings from a TOML file and environment variables. | | [actix-settings] | [![crates.io](https://img.shields.io/crates/v/actix-settings?label=latest)](https://crates.io/crates/actix-settings) [![dependency status](https://deps.rs/crate/actix-settings/0.6.0/status.svg)](https://deps.rs/crate/actix-settings/0.6.0) | Easily manage Actix Web's settings from a TOML file and environment variables. |
| [actix-web-httpauth] | [![crates.io](https://img.shields.io/crates/v/actix-web-httpauth?label=latest)](https://crates.io/crates/actix-web-httpauth) [![dependency status](https://deps.rs/crate/actix-web-httpauth/0.8.0/status.svg)](https://deps.rs/crate/actix-web-httpauth/0.8.0) | HTTP authentication schemes. | | [actix-web-httpauth] | [![crates.io](https://img.shields.io/crates/v/actix-web-httpauth?label=latest)](https://crates.io/crates/actix-web-httpauth) [![dependency status](https://deps.rs/crate/actix-web-httpauth/0.8.1/status.svg)](https://deps.rs/crate/actix-web-httpauth/0.8.1) | HTTP authentication schemes. |
--- ---
@ -30,19 +30,19 @@ These crates are provided by the community.
| -------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | | -------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- |
| [actix-web-lab] | [![crates.io](https://img.shields.io/crates/v/actix-web-lab?label=latest)][actix-web-lab] [![dependency status](https://deps.rs/crate/actix-web-lab/0.19.1/status.svg)](https://deps.rs/crate/actix-web-lab/0.19.1) | Experimental extractors, middleware, and other extras for possible inclusion in Actix Web. | | [actix-web-lab] | [![crates.io](https://img.shields.io/crates/v/actix-web-lab?label=latest)][actix-web-lab] [![dependency status](https://deps.rs/crate/actix-web-lab/0.19.1/status.svg)](https://deps.rs/crate/actix-web-lab/0.19.1) | Experimental extractors, middleware, and other extras for possible inclusion in Actix Web. |
| [actix-multipart-extract] | [![crates.io](https://img.shields.io/crates/v/actix-multipart-extract?label=latest)][actix-multipart-extract] [![dependency status](https://deps.rs/crate/actix-multipart-extract/0.1.5/status.svg)](https://deps.rs/crate/actix-multipart-extract/0.1.5) | Better multipart form support for Actix Web. | | [actix-multipart-extract] | [![crates.io](https://img.shields.io/crates/v/actix-multipart-extract?label=latest)][actix-multipart-extract] [![dependency status](https://deps.rs/crate/actix-multipart-extract/0.1.5/status.svg)](https://deps.rs/crate/actix-multipart-extract/0.1.5) | Better multipart form support for Actix Web. |
| [actix-form-data] | [![crates.io](https://img.shields.io/crates/v/actix-form-data?label=latest)][actix-form-data] [![dependency status](https://deps.rs/crate/actix-form-data/0.7.0-beta.0/status.svg)](https://deps.rs/crate/actix-form-data/0.7.0-beta.0) | Multipart form data from actix multipart streams | | [actix-form-data] | [![crates.io](https://img.shields.io/crates/v/actix-form-data?label=latest)][actix-form-data] [![dependency status](https://deps.rs/crate/actix-form-data/0.7.0-beta.4/status.svg)](https://deps.rs/crate/actix-form-data/0.7.0-beta.4) | Multipart form data from actix multipart streams |
| [actix-governor] | [![crates.io](https://img.shields.io/crates/v/actix-governor?label=latest)][actix-governor] [![dependency status](https://deps.rs/crate/actix-governor/0.4.0/status.svg)](https://deps.rs/crate/actix-governor/0.4.0) | Rate-limiting backed by governor. | | [actix-governor] | [![crates.io](https://img.shields.io/crates/v/actix-governor?label=latest)][actix-governor] [![dependency status](https://deps.rs/crate/actix-governor/0.5.1/status.svg)](https://deps.rs/crate/actix-governor/0.5.1) | Rate-limiting backed by governor. |
| [actix-casbin] | [![crates.io](https://img.shields.io/crates/v/actix-casbin?label=latest)][actix-casbin] [![dependency status](https://deps.rs/crate/actix-casbin/0.4.2/status.svg)](https://deps.rs/crate/actix-casbin/0.4.2) | Authorization library that supports access control models like ACL, RBAC & ABAC. | | [actix-casbin] | [![crates.io](https://img.shields.io/crates/v/actix-casbin?label=latest)][actix-casbin] [![dependency status](https://deps.rs/crate/actix-casbin/0.4.2/status.svg)](https://deps.rs/crate/actix-casbin/0.4.2) | Authorization library that supports access control models like ACL, RBAC & ABAC. |
| [actix-ip-filter] | [![crates.io](https://img.shields.io/crates/v/actix-ip-filter?label=latest)][actix-ip-filter] [![dependency status](https://deps.rs/crate/actix-ip-filter/0.3.1/status.svg)](https://deps.rs/crate/actix-ip-filter/0.3.1) | IP address filter. Supports glob patterns. | | [actix-ip-filter] | [![crates.io](https://img.shields.io/crates/v/actix-ip-filter?label=latest)][actix-ip-filter] [![dependency status](https://deps.rs/crate/actix-ip-filter/0.3.1/status.svg)](https://deps.rs/crate/actix-ip-filter/0.3.1) | IP address filter. Supports glob patterns. |
| [actix-web-static-files] | [![crates.io](https://img.shields.io/crates/v/actix-web-static-files?label=latest)][actix-web-static-files] [![dependency status](https://deps.rs/crate/actix-web-static-files/4.0.1/status.svg)](https://deps.rs/crate/actix-web-static-files/4.0.1) | Static files as embedded resources. | | [actix-web-static-files] | [![crates.io](https://img.shields.io/crates/v/actix-web-static-files?label=latest)][actix-web-static-files] [![dependency status](https://deps.rs/crate/actix-web-static-files/4.0.1/status.svg)](https://deps.rs/crate/actix-web-static-files/4.0.1) | Static files as embedded resources. |
| [actix-web-grants] | [![crates.io](https://img.shields.io/crates/v/actix-web-grants?label=latest)][actix-web-grants] [![dependency status](https://deps.rs/crate/actix-web-grants/3.0.1/status.svg)](https://deps.rs/crate/actix-web-grants/3.0.1) | Extension for validating user authorities. | | [actix-web-grants] | [![crates.io](https://img.shields.io/crates/v/actix-web-grants?label=latest)][actix-web-grants] [![dependency status](https://deps.rs/crate/actix-web-grants/3.0.2/status.svg)](https://deps.rs/crate/actix-web-grants/3.0.2) | Extension for validating user authorities. |
| [aliri_actix] | [![crates.io](https://img.shields.io/crates/v/aliri_actix?label=latest)][aliri_actix] [![dependency status](https://deps.rs/crate/aliri_actix/0.8.0/status.svg)](https://deps.rs/crate/aliri_actix/0.8.0) | Endpoint authorization and authentication using scoped OAuth2 JWT tokens. | | [aliri_actix] | [![crates.io](https://img.shields.io/crates/v/aliri_actix?label=latest)][aliri_actix] [![dependency status](https://deps.rs/crate/aliri_actix/0.9.0/status.svg)](https://deps.rs/crate/aliri_actix/0.9.0) | Endpoint authorization and authentication using scoped OAuth2 JWT tokens. |
| [actix-web-flash-messages] | [![crates.io](https://img.shields.io/crates/v/actix-web-flash-messages?label=latest)][actix-web-flash-messages] [![dependency status](https://deps.rs/crate/actix-web-flash-messages/0.4.2/status.svg)](https://deps.rs/crate/actix-web-flash-messages/0.4.2) | Support for flash messages/one-time notifications in `actix-web`. | | [actix-web-flash-messages] | [![crates.io](https://img.shields.io/crates/v/actix-web-flash-messages?label=latest)][actix-web-flash-messages] [![dependency status](https://deps.rs/crate/actix-web-flash-messages/0.4.2/status.svg)](https://deps.rs/crate/actix-web-flash-messages/0.4.2) | Support for flash messages/one-time notifications in `actix-web`. |
| [awmp] | [![crates.io](https://img.shields.io/crates/v/awmp?label=latest)][awmp] [![dependency status](https://deps.rs/crate/awmp/0.8.1/status.svg)](https://deps.rs/crate/awmp/0.8.1) | An easy to use wrapper around multipart fields for Actix Web. | | [awmp] | [![crates.io](https://img.shields.io/crates/v/awmp?label=latest)][awmp] [![dependency status](https://deps.rs/crate/awmp/0.8.1/status.svg)](https://deps.rs/crate/awmp/0.8.1) | An easy to use wrapper around multipart fields for Actix Web. |
| [tracing-actix-web] | [![crates.io](https://img.shields.io/crates/v/tracing-actix-web?label=latest)][tracing-actix-web] [![dependency status](https://deps.rs/crate/tracing-actix-web/0.7.3/status.svg)](https://deps.rs/crate/tracing-actix-web/0.7.3) | A middleware to collect telemetry data from applications built on top of the actix-web framework. | | [tracing-actix-web] | [![crates.io](https://img.shields.io/crates/v/tracing-actix-web?label=latest)][tracing-actix-web] [![dependency status](https://deps.rs/crate/tracing-actix-web/0.7.6/status.svg)](https://deps.rs/crate/tracing-actix-web/0.7.6) | A middleware to collect telemetry data from applications built on top of the Actix Web framework. |
| [actix-ws] | [![crates.io](https://img.shields.io/crates/v/actix-ws?label=latest)][actix-ws] [![dependency status](https://deps.rs/crate/actix-ws/0.2.5/status.svg)](https://deps.rs/crate/actix-ws/0.2.5) | Actor-less WebSockets for the Actix Runtime. | | [actix-ws] | [![crates.io](https://img.shields.io/crates/v/actix-ws?label=latest)][actix-ws] [![dependency status](https://deps.rs/crate/actix-ws/0.2.5/status.svg)](https://deps.rs/crate/actix-ws/0.2.5) | Actor-less WebSockets for the Actix Runtime. |
| [actix-hash] | [![crates.io](https://img.shields.io/crates/v/actix-hash?label=latest)][actix-hash] [![dependency status](https://deps.rs/crate/actix-hash/0.5.0/status.svg)](https://deps.rs/crate/actix-hash/0.5.0) | Hashing utilities for Actix Web. | | [actix-hash] | [![crates.io](https://img.shields.io/crates/v/actix-hash?label=latest)][actix-hash] [![dependency status](https://deps.rs/crate/actix-hash/0.5.0/status.svg)](https://deps.rs/crate/actix-hash/0.5.0) | Hashing utilities for Actix Web. |
| [actix-bincode] | ![crates.io](https://img.shields.io/crates/v/actix-bincode?label=latest) [![dependency status](https://deps.rs/crate/actix-bincode/0.2.1/status.svg)](https://deps.rs/crate/actix-bincode/0.2.1) | Bincode payload extractor for Actix Web | | [actix-bincode] | ![crates.io](https://img.shields.io/crates/v/actix-bincode?label=latest) [![dependency status](https://deps.rs/crate/actix-bincode/0.2.2/status.svg)](https://deps.rs/crate/actix-bincode/0.2.2) | Bincode payload extractor for Actix Web |
| [sentinel-actix] | ![crates.io](https://img.shields.io/crates/v/sentinel-actix?label=latest) [![dependency status](https://deps.rs/crate/sentinel-actix/0.1.0/status.svg)](https://deps.rs/crate/sentinel-actix/0.1.0) | General and flexible protection for Actix Web | | [sentinel-actix] | ![crates.io](https://img.shields.io/crates/v/sentinel-actix?label=latest) [![dependency status](https://deps.rs/crate/sentinel-actix/0.1.0/status.svg)](https://deps.rs/crate/sentinel-actix/0.1.0) | General and flexible protection for Actix Web |
To add a crate to this list, submit a pull request. To add a crate to this list, submit a pull request.

View File

@ -1,79 +1,79 @@
# Changes # 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] - Add `Cors::allow_private_network_access()` behind an unstable flag (`draft-private-network-access`). [#297]
[#297]: https://github.com/actix/actix-extras/pull/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] - 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. - Minimum supported Rust version (MSRV) is now 1.59 due to transitive `time` dependency.
[#287]: https://github.com/actix/actix-extras/pull/287 [#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] - 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. - Minimum supported Rust version (MSRV) is now 1.57 due to transitive `time` dependency.
[#273]: https://github.com/actix/actix-extras/pull/273 [#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] - Do not consider requests without a `Access-Control-Request-Method` as preflight. [#226]
[#226]: https://github.com/actix/actix-extras/pull/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. - 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] - Ensure that preflight responses contain a `Vary` header. [#224]
[#224]: https://github.com/actix/actix-extras/pull/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] - Relax body type bounds on middleware impl. [#223]
- Update `actix-web` dependency to `4.0.0-rc.1`. - Update `actix-web` dependency to `4.0.0-rc.1`.
[#223]: https://github.com/actix/actix-extras/pull/223 [#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. - 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] - Update `actix-web` dependency to `4.0.0-beta.15`. [#216]
[#216]: https://github.com/actix/actix-extras/pull/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] - Fix panic when wrapping routes with dynamic segments in their paths. [#213]
[#213]: https://github.com/actix/actix-extras/pull/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] - Update `actix-web` dependency to `4.0.0.beta-14`. [#209]
[#209]: https://github.com/actix/actix-extras/pull/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`. - 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] - Make `Cors` middleware generic over body type [#195]
- Fix `expose_any_header` behavior. [#204] - Fix `expose_any_header` behavior. [#204]
@ -84,37 +84,37 @@
[#203]: https://github.com/actix/actix-extras/pull/203 [#203]: https://github.com/actix/actix-extras/pull/203
[#204]: https://github.com/actix/actix-extras/pull/204 [#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. - 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. - Update `actix-web` dependency to 4.0.0 beta.
- Minimum supported Rust version (MSRV) is now 1.46.0. - 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] - Fix `expose_any_header` method, now set the correct field. [#143]
[#143]: https://github.com/actix/actix-extras/pull/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. - Fix version spec for `derive_more` dependency.
## 0.5.2 - 2020-11-15 ## 0.5.2
- Ensure `tinyvec` is using the correct features. - Ensure `tinyvec` is using the correct features.
- Bump `futures-util` minimum version to `0.3.7` to avoid `RUSTSEC-2020-0059`. - 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] - Fix `allow_any_header` method, now set the correct field. [#121]
[#121]: https://github.com/actix/actix-extras/pull/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]. - Disallow `*` in `Cors::allowed_origin`. [#114].
- Hide `CorsMiddleware` from docs. [#118]. - Hide `CorsMiddleware` from docs. [#118].
@ -134,13 +134,13 @@
[#119]: https://github.com/actix/actix-extras/pull/119 [#119]: https://github.com/actix/actix-extras/pull/119
[#120]: https://github.com/actix/actix-extras/pull/120 [#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] - Allow closures to be used with `allowed_origin_fn`. [#110]
[#110]: https://github.com/actix/actix-extras/pull/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] - Implement `allowed_origin_fn` builder method. [#93]
- Use `TryInto` instead of `TryFrom` where applicable. [#106] - Use `TryInto` instead of `TryFrom` where applicable. [#106]
@ -148,13 +148,13 @@
[#93]: https://github.com/actix/actix-extras/pull/93 [#93]: https://github.com/actix/actix-extras/pull/93
[#106]: https://github.com/actix/actix-extras/pull/106 [#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. - Update `actix-web` dependency to 3.0.0.
- Minimum supported Rust version (MSRV) is now 1.42.0. - Minimum supported Rust version (MSRV) is now 1.42.0.
- Implement the Debug trait on all public types. - Implement the Debug trait on all public types.
## 0.3.0-alpha.1 - 2020-03-11 ## 0.3.0-alpha.1
- Minimize `futures-*` dependencies - Minimize `futures-*` dependencies
- Update `actix-web` dependency to 3.0.0-alpha.1 - Update `actix-web` dependency to 3.0.0-alpha.1

View File

@ -9,9 +9,9 @@ description = "Cross-Origin Resource Sharing (CORS) controls for Actix Web"
keywords = ["actix", "cors", "web", "security", "crossorigin"] keywords = ["actix", "cors", "web", "security", "crossorigin"]
homepage = "https://actix.rs" homepage = "https://actix.rs"
repository = "https://github.com/actix/actix-extras.git" repository = "https://github.com/actix/actix-extras.git"
license = "MIT OR Apache-2.0" license.workspace = true
edition = "2018" edition.workspace = true
rust-version = "1.60" rust-version.workspace = true
[package.metadata.docs.rs] [package.metadata.docs.rs]
rustdoc-args = ["--cfg", "docsrs"] rustdoc-args = ["--cfg", "docsrs"]
@ -25,10 +25,10 @@ actix-utils = "3"
actix-web = { version = "4", default-features = false } actix-web = { version = "4", default-features = false }
derive_more = "0.99.7" derive_more = "0.99.7"
futures-util = { version = "0.3.7", default-features = false } futures-util = { version = "0.3.17", default-features = false, features = ["std"] }
log = "0.4" log = "0.4"
once_cell = "1" once_cell = "1"
smallvec = "1.6.1" smallvec = "1"
[dev-dependencies] [dev-dependencies]
actix-web = { version = "4", default-features = false, features = ["macros"] } actix-web = { version = "4", default-features = false, features = ["macros"] }

View File

@ -1,25 +1,27 @@
# Changes # Changes
## Unreleased - 2022-xx-xx ## Unreleased
- Replace use of `anyhow::Error` with specific error types. [#296] ## 0.6.0
- Minimum supported Rust version (MSRV) is now 1.60.
[#296]: https://github.com/actix/actix-extras/pull/296 - Add `error` module.
- Replace use of `anyhow::Error` in return types with specific error types.
- Update `actix-session` dependency to `0.8`.
- Minimum supported Rust version (MSRV) is now 1.68.
## 0.5.2 - 2022-07-19 ## 0.5.2
- Fix visit deadline. [#263] - Fix visit deadline. [#263]
[#263]: https://github.com/actix/actix-extras/pull/263 [#263]: https://github.com/actix/actix-extras/pull/263
## 0.5.1 - 2022-07-11 ## 0.5.1
- Remove unnecessary dependencies. [#259] - Remove unnecessary dependencies. [#259]
[#259]: https://github.com/actix/actix-extras/pull/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. `actix-identity` v0.5 is a complete rewrite. The goal is to streamline user experience and reduce maintenance overhead.
@ -55,56 +57,56 @@ Changes:
[#246]: https://github.com/actix/actix-extras/pull/246 [#246]: https://github.com/actix/actix-extras/pull/246
## 0.4.0 - 2022-03-01 ## 0.4.0
- Update `actix-web` dependency to `4`. - 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] - Relax body type bounds on middleware impl. [#223]
- Update `actix-web` dependency to `4.0.0-rc.1`. - Update `actix-web` dependency to `4.0.0-rc.1`.
[#223]: https://github.com/actix/actix-extras/pull/223 [#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`. - 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] - Update `actix-web` dependency to `4.0.0.beta-18`. [#218]
- Minimum supported Rust version (MSRV) is now 1.54. - Minimum supported Rust version (MSRV) is now 1.54.
[#218]: https://github.com/actix/actix-extras/pull/218 [#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] - Update `actix-web` dependency to `4.0.0.beta-15`. [#216]
[#216]: https://github.com/actix/actix-extras/pull/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] - Update `actix-web` dependency to `4.0.0.beta-14`. [#209]
[#209]: https://github.com/actix/actix-extras/pull/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`. - 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] - Update `actix-web` dependency to v4.0.0-beta.10. [#203]
- Minimum supported Rust version (MSRV) is now 1.52. - Minimum supported Rust version (MSRV) is now 1.52.
[#203]: https://github.com/actix/actix-extras/pull/203 [#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. - 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 => max_age_secs}`. [#168]
- Rename `CookieIdentityPolicy::{max_age_time => max_age}`. [#168] - Rename `CookieIdentityPolicy::{max_age_time => max_age}`. [#168]
@ -113,24 +115,24 @@ Changes:
[#168]: https://github.com/actix/actix-extras/pull/168 [#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] - Add method to set `HttpOnly` flag on cookie identity. [#102]
[#102]: https://github.com/actix/actix-extras/pull/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. - Update `actix-web` dependency to 3.0.0.
- Minimum supported Rust version (MSRV) is now 1.42.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 `time` dependency to 0.2.7
- Update the `actix-web` dependency to 3.0.0-alpha.1 - Update the `actix-web` dependency to 3.0.0-alpha.1
- Minimize `futures` dependency - Minimize `futures` dependency
## 0.2.1 - 2020-01-10 ## 0.2.1
- Fix panic with already borrowed: BorrowMutError #1263 - Fix panic with already borrowed: BorrowMutError #1263

View File

@ -1,6 +1,6 @@
[package] [package]
name = "actix-identity" name = "actix-identity"
version = "0.5.2" version = "0.6.0"
authors = [ authors = [
"Nikolay Kim <fafhrd91@gmail.com>", "Nikolay Kim <fafhrd91@gmail.com>",
"Luca Palmieri <rust@lpalmieri.com>", "Luca Palmieri <rust@lpalmieri.com>",
@ -9,9 +9,9 @@ description = "Identity management for Actix Web"
keywords = ["actix", "auth", "identity", "web", "security"] keywords = ["actix", "auth", "identity", "web", "security"]
homepage = "https://actix.rs" homepage = "https://actix.rs"
repository = "https://github.com/actix/actix-extras.git" repository = "https://github.com/actix/actix-extras.git"
license = "MIT OR Apache-2.0" license.workspace = true
edition = "2018" edition.workspace = true
rust-version = "1.60" rust-version.workspace = true
[package.metadata.docs.rs] [package.metadata.docs.rs]
rustdoc-args = ["--cfg", "docsrs"] rustdoc-args = ["--cfg", "docsrs"]
@ -19,7 +19,7 @@ all-features = true
[dependencies] [dependencies]
actix-service = "2" actix-service = "2"
actix-session = "0.7" actix-session = "0.8"
actix-utils = "3" actix-utils = "3"
actix-web = { version = "4", default-features = false, features = ["cookies", "secure-cookies"] } actix-web = { version = "4", default-features = false, features = ["cookies", "secure-cookies"] }
@ -31,7 +31,7 @@ tracing = { version = "0.1.30", default-features = false, features = ["log"] }
[dev-dependencies] [dev-dependencies]
actix-http = "3" actix-http = "3"
actix-web = { version = "4", default-features = false, features = ["macros", "cookies", "secure-cookies"] } actix-web = { version = "4", default-features = false, features = ["macros", "cookies", "secure-cookies"] }
actix-session = { version = "0.7", features = ["redis-rs-session", "cookie-session"] } actix-session = { version = "0.8", features = ["redis-rs-session", "cookie-session"] }
env_logger = "0.10" env_logger = "0.10"
reqwest = { version = "0.11", default-features = false, features = ["cookies", "json"] } reqwest = { version = "0.11", default-features = false, features = ["cookies", "json"] }

View File

@ -3,9 +3,9 @@
> Identity management for Actix Web. > Identity management for Actix Web.
[![crates.io](https://img.shields.io/crates/v/actix-identity?label=latest)](https://crates.io/crates/actix-identity) [![crates.io](https://img.shields.io/crates/v/actix-identity?label=latest)](https://crates.io/crates/actix-identity)
[![Documentation](https://docs.rs/actix-identity/badge.svg?version=0.5.2)](https://docs.rs/actix-identity/0.5.2) [![Documentation](https://docs.rs/actix-identity/badge.svg?version=0.6.0)](https://docs.rs/actix-identity/0.6.0)
![Apache 2.0 or MIT licensed](https://img.shields.io/crates/l/actix-identity) ![Apache 2.0 or MIT licensed](https://img.shields.io/crates/l/actix-identity)
[![Dependency Status](https://deps.rs/crate/actix-identity/0.5.2/status.svg)](https://deps.rs/crate/actix-identity/0.5.2) [![Dependency Status](https://deps.rs/crate/actix-identity/0.6.0/status.svg)](https://deps.rs/crate/actix-identity/0.6.0)
## Documentation & community resources ## Documentation & community resources

View File

@ -1,10 +1,19 @@
# Changes # Changes
## Unreleased - 2022-xx-xx ## Unreleased - 2023-xx-xx
- Added optional scopes to the middleware enabling use of multiple Limiters by passing an `HashMap<Limiter>` to the Http server `app_data`
- Update `redis` dependency to `0.22`.
## 0.4.0 - 2022-09-10 - Added optional scopes to the middleware enabling use of multiple Limiters by passing an `HashMap<Limiter>` to the Http server `app_data`
## 0.5.1
- No significant changes since `0.5.0`.
## 0.5.0
- Update `redis` dependency to `0.23`.
- Update `actix-session` dependency to `0.8`.
## 0.4.0
- Add `Builder::key_by` for setting a custom rate limit key function. - Add `Builder::key_by` for setting a custom rate limit key function.
- Implement `Default` for `RateLimiter`. - Implement `Default` for `RateLimiter`.
@ -12,13 +21,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`. - 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. - 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<String>`. - `Limiter::builder` now takes an `impl Into<String>`.
- Removed lifetime from `Builder`. - Removed lifetime from `Builder`.
- Updated `actix-session` dependency to `0.7`. - Updated `actix-session` dependency to `0.7`.
## 0.2.0 - 2022-03-22 ## 0.2.0
- Update Actix Web dependency to v4 ecosystem. - Update Actix Web dependency to v4 ecosystem.
- Update Tokio dependencies to v1 ecosystem. - Update Tokio dependencies to v1 ecosystem.
@ -26,6 +35,6 @@
- Rename `Builder::{finish => build}()`. - Rename `Builder::{finish => build}()`.
- Exceeding the rate limit now returns a 429 Too Many Requests response. - 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 <https://github.com/0xmad/actix-limitation>. - Adopted into @actix org from <https://github.com/0xmad/actix-limitation>.

View File

@ -1,6 +1,6 @@
[package] [package]
name = "actix-limitation" name = "actix-limitation"
version = "0.4.0" version = "0.5.1"
authors = [ authors = [
"0xmad <0xmad@users.noreply.github.com>", "0xmad <0xmad@users.noreply.github.com>",
"Rob Ede <robjtede@icloud.com>", "Rob Ede <robjtede@icloud.com>",
@ -9,9 +9,9 @@ description = "Rate limiter using a fixed window counter for arbitrary keys, bac
keywords = ["actix-web", "rate-api", "rate-limit", "limitation"] keywords = ["actix-web", "rate-api", "rate-limit", "limitation"]
categories = ["asynchronous", "web-programming"] categories = ["asynchronous", "web-programming"]
repository = "https://github.com/actix/actix-extras.git" repository = "https://github.com/actix/actix-extras.git"
license = "MIT OR Apache-2.0" license.workspace = true
edition = "2018" edition.workspace = true
rust-version = "1.60" rust-version.workspace = true
[package.metadata.docs.rs] [package.metadata.docs.rs]
rustdoc-args = ["--cfg", "docsrs"] rustdoc-args = ["--cfg", "docsrs"]
@ -23,16 +23,16 @@ session = ["actix-session"]
[dependencies] [dependencies]
actix-utils = "3" actix-utils = "3"
actix-web = { version = "4", features = ["cookies"] } actix-web = { version = "4", default-features = false, features = ["cookies"] }
chrono = "0.4" chrono = "0.4"
derive_more = "0.99.7" derive_more = "0.99.7"
log = "0.4" 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" time = "0.3"
# session # session
actix-session = { version = "0.7", optional = true } actix-session = { version = "0.8", optional = true }
[dev-dependencies] [dev-dependencies]
actix-web = "4" actix-web = "4"

View File

@ -4,16 +4,16 @@
> Originally based on <https://github.com/fnichol/limitation>. > Originally based on <https://github.com/fnichol/limitation>.
[![crates.io](https://img.shields.io/crates/v/actix-limitation?label=latest)](https://crates.io/crates/actix-limitation) [![crates.io](https://img.shields.io/crates/v/actix-limitation?label=latest)](https://crates.io/crates/actix-limitation)
[![Documentation](https://docs.rs/actix-limitation/badge.svg?version=0.4.0)](https://docs.rs/actix-limitation/0.4.0) [![Documentation](https://docs.rs/actix-limitation/badge.svg?version=0.5.1)](https://docs.rs/actix-limitation/0.5.1)
![Apache 2.0 or MIT licensed](https://img.shields.io/crates/l/actix-limitation) ![Apache 2.0 or MIT licensed](https://img.shields.io/crates/l/actix-limitation)
[![Dependency Status](https://deps.rs/crate/actix-limitation/0.4.0/status.svg)](https://deps.rs/crate/actix-limitation/0.4.0) [![Dependency Status](https://deps.rs/crate/actix-limitation/0.5.1/status.svg)](https://deps.rs/crate/actix-limitation/0.5.1)
## Examples ## Examples
```toml ```toml
[dependencies] [dependencies]
actix-web = "4" actix-web = "4"
actix-limitation = "0.3" actix-limitation = "0.5"
``` ```
```rust ```rust

View File

@ -1,39 +1,42 @@
# Changes # Changes
## Unreleased - 2022-xx-xx ## Unreleased
- Minimum supported Rust version (MSRV) is now 1.60. ## 0.10.0
## 0.9.0 - 2022-08-24 - Updated `prost` dependency to `0.12`.
- Minimum supported Rust version (MSRV) is now 1.68.
## 0.9.0
- Added `application/x-protobuf` as an acceptable header. - Added `application/x-protobuf` as an acceptable header.
- Updated `prost` dependency to `0.11`. - Updated `prost` dependency to `0.11`.
## 0.8.0 - 2022-06-25 ## 0.8.0
- Update `prost` dependency to `0.10`. - Update `prost` dependency to `0.10`.
- Minimum supported Rust version (MSRV) is now 1.57 due to transitive `time` dependency. - 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`. - 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 `prost` dependency to `0.9`.
- Update `actix-web` dependency to `4.0.0-rc.1`. - 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. - 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] - Update `actix-web` dependency to `4.0.0.beta-14`. [#209]
[#209]: https://github.com/actix/actix-extras/pull/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] - Bump `prost` version to 0.8. [#197]
- Update `actix-web` dependency to v4.0.0-beta.10. [#203] - Update `actix-web` dependency to v4.0.0-beta.10. [#203]
@ -42,7 +45,7 @@
[#197]: https://github.com/actix/actix-extras/pull/197 [#197]: https://github.com/actix/actix-extras/pull/197
[#203]: https://github.com/actix/actix-extras/pull/203 [#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] - Bump `prost` version to 0.7. [#144]
- Update `actix-web` dependency to 4.0.0 beta. - Update `actix-web` dependency to 4.0.0 beta.
@ -50,12 +53,12 @@
[#144]: https://github.com/actix/actix-extras/pull/144 [#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. - Update `actix-web` dependency to 3.0.0.
- Minimum supported Rust version (MSRV) is now 1.42.0 to use `matches!` macro. - 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 - Update `actix-web` to 3.0.0-alpha.3
- Minimum supported Rust version(MSRV) is now 1.40.0. - Minimum supported Rust version(MSRV) is now 1.40.0.

View File

@ -1,6 +1,6 @@
[package] [package]
name = "actix-protobuf" name = "actix-protobuf"
version = "0.9.0" version = "0.10.0"
authors = [ authors = [
"kingxsp <jin.hb.zh@outlook.com>", "kingxsp <jin.hb.zh@outlook.com>",
"Yuki Okushi <huyuumi.dev@gmail.com>", "Yuki Okushi <huyuumi.dev@gmail.com>",
@ -9,9 +9,9 @@ description = "Protobuf payload extractor for Actix Web"
keywords = ["actix", "web", "protobuf", "protocol", "rpc"] keywords = ["actix", "web", "protobuf", "protocol", "rpc"]
homepage = "https://actix.rs" homepage = "https://actix.rs"
repository = "https://github.com/actix/actix-extras.git" repository = "https://github.com/actix/actix-extras.git"
license = "MIT OR Apache-2.0" license.workspace = true
edition = "2018" edition.workspace = true
rust-version = "1.60" rust-version.workspace = true
[package.metadata.docs.rs] [package.metadata.docs.rs]
rustdoc-args = ["--cfg", "docsrs"] rustdoc-args = ["--cfg", "docsrs"]
@ -20,9 +20,9 @@ all-features = true
[dependencies] [dependencies]
actix-web = { version = "4", default-features = false } actix-web = { version = "4", default-features = false }
derive_more = "0.99.7" derive_more = "0.99.7"
futures-util = { version = "0.3.7", default-features = false } futures-util = { version = "0.3.17", default-features = false, features = ["std"] }
prost = { version = "0.11", default-features = false } prost = { version = "0.12", default-features = false }
[dev-dependencies] [dev-dependencies]
actix-web = { version = "4", default-features = false, features = ["macros"] } 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"] }

View File

@ -3,9 +3,9 @@
> Protobuf payload extractor for Actix Web. > Protobuf payload extractor for Actix Web.
[![crates.io](https://img.shields.io/crates/v/actix-protobuf?label=latest)](https://crates.io/crates/actix-protobuf) [![crates.io](https://img.shields.io/crates/v/actix-protobuf?label=latest)](https://crates.io/crates/actix-protobuf)
[![Documentation](https://docs.rs/actix-protobuf/badge.svg?version=0.9.0)](https://docs.rs/actix-protobuf/0.9.0) [![Documentation](https://docs.rs/actix-protobuf/badge.svg?version=0.10.0)](https://docs.rs/actix-protobuf/0.10.0)
![Apache 2.0 or MIT licensed](https://img.shields.io/crates/l/actix-protobuf) ![Apache 2.0 or MIT licensed](https://img.shields.io/crates/l/actix-protobuf)
[![Dependency Status](https://deps.rs/crate/actix-protobuf/0.9.0/status.svg)](https://deps.rs/crate/actix-protobuf/0.9.0) [![Dependency Status](https://deps.rs/crate/actix-protobuf/0.10.0/status.svg)](https://deps.rs/crate/actix-protobuf/0.10.0)
## Documentation & Resources ## Documentation & Resources

View File

@ -1,18 +1,20 @@
# Changes # Changes
## Unreleased - 2022-xx-xx ## Unreleased
- Update `redis-async` dependency to `0.14`. ## 0.13.0
- Minimum supported Rust version (MSRV) is now 1.60.
## 0.12.0 - 2022-07-09 - Update `redis-async` dependency to `0.16`.
- Minimum supported Rust version (MSRV) is now 1.68.
## 0.12.0
- Update `actix` dependency to `0.13`. - Update `actix` dependency to `0.13`.
- Update `redis-async` dependency to `0.13`. - Update `redis-async` dependency to `0.13`.
- Update `tokio-util` dependency to `0.7`. - Update `tokio-util` dependency to `0.7`.
- Minimum supported Rust version (MSRV) is now 1.57 due to transitive `time` dependency. - Minimum supported Rust version (MSRV) is now 1.57 due to transitive `time` dependency.
## 0.11.0 - 2022-03-15 ## 0.11.0
### Removed ### Removed
@ -24,22 +26,22 @@
[#212]: https://github.com/actix/actix-extras/pull/212 [#212]: https://github.com/actix/actix-extras/pull/212
## 0.10.0 - 2022-03-01 ## 0.10.0
- Update `actix-web` dependency to `4`. - 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`. - 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] - Update `actix-web` dependency to `4.0.0.beta-18`. [#218]
- Minimum supported Rust version (MSRV) is now 1.54. - Minimum supported Rust version (MSRV) is now 1.54.
[#218]: https://github.com/actix/actix-extras/pull/218 [#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] - 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] - Update `actix-web` dependency to `4.0.0.beta-14`. [#209]
@ -47,23 +49,23 @@
[#207]: https://github.com/actix/actix-extras/pull/207 [#207]: https://github.com/actix/actix-extras/pull/207
[#209]: https://github.com/actix/actix-extras/pull/209 [#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] - Update `actix-web` dependency to v4.0.0-beta.10. [#203]
- Minimum supported Rust version (MSRV) is now 1.52. - Minimum supported Rust version (MSRV) is now 1.52.
[#203]: https://github.com/actix/actix-extras/pull/203 [#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. - 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. - Update `actix-web` dependency to 4.0.0 beta.
- Minimum supported Rust version (MSRV) is now 1.46.0. - 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] - Implement `std::error::Error` for `Error` [#135]
- Allow the removal of `Max-Age` for session-only cookies. [#161] - Allow the removal of `Max-Age` for session-only cookies. [#161]
@ -71,16 +73,16 @@
[#135]: https://github.com/actix/actix-extras/pull/135 [#135]: https://github.com/actix/actix-extras/pull/135
[#161]: https://github.com/actix/actix-extras/pull/161 [#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. - 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. - Update `actix-web` dependency to 3.0.0.
- Minimize `futures` dependency. - 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 - Add `cookie_http_only` functionality to RedisSession builder, setting this
to false allows JavaScript to access cookies. Defaults to true. to false allows JavaScript to access cookies. Defaults to true.
@ -89,14 +91,14 @@
- Update `tokio-util` to 0.3 - Update `tokio-util` to 0.3
- Minimum supported Rust version(MSRV) is now 1.40.0. - 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` to 0.10.0-alpha.2
- Update `actix-session` to 0.4.0-alpha.1 - Update `actix-session` to 0.4.0-alpha.1
- Update `actix-web` to 3.0.0-alpha.1 - Update `actix-web` to 3.0.0-alpha.1
- Update `time` to 0.2.9 - 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 - Move `env_logger` dependency to dev-dependencies and update to 0.7
- Update `actix_web` to 2.0.0 from 2.0.0-rc - Update `actix_web` to 2.0.0 from 2.0.0-rc

View File

@ -1,15 +1,15 @@
[package] [package]
name = "actix-redis" name = "actix-redis"
version = "0.12.0" version = "0.13.0"
authors = ["Nikolay Kim <fafhrd91@gmail.com>"] authors = ["Nikolay Kim <fafhrd91@gmail.com>"]
description = "Actor-based Redis client" description = "Actor-based Redis client"
license = "MIT OR Apache-2.0"
keywords = ["actix", "redis", "async"] keywords = ["actix", "redis", "async"]
homepage = "https://actix.rs" homepage = "https://actix.rs"
repository = "https://github.com/actix/actix-extras.git" repository = "https://github.com/actix/actix-extras.git"
categories = ["network-programming", "asynchronous"] categories = ["network-programming", "asynchronous"]
edition = "2018" license.workspace = true
rust-version = "1.60" edition.workspace = true
rust-version.workspace = true
[package.metadata.docs.rs] [package.metadata.docs.rs]
rustdoc-args = ["--cfg", "docsrs"] rustdoc-args = ["--cfg", "docsrs"]
@ -35,7 +35,7 @@ log = "0.4.6"
backoff = "0.4.0" backoff = "0.4.0"
derive_more = "0.99.7" derive_more = "0.99.7"
futures-core = { version = "0.3.7", default-features = false } futures-core = { version = "0.3.7", default-features = false }
redis-async = "0.14" redis-async = "0.16"
time = "0.3" time = "0.3"
tokio = { version = "1.18.4", features = ["sync"] } tokio = { version = "1.18.4", features = ["sync"] }
tokio-util = "0.7" tokio-util = "0.7"

View File

@ -3,9 +3,9 @@
> Actor-based Redis client. > Actor-based Redis client.
[![crates.io](https://img.shields.io/crates/v/actix-redis?label=latest)](https://crates.io/crates/actix-redis) [![crates.io](https://img.shields.io/crates/v/actix-redis?label=latest)](https://crates.io/crates/actix-redis)
[![Documentation](https://docs.rs/actix-redis/badge.svg?version=0.12.0)](https://docs.rs/actix-redis/0.12.0) [![Documentation](https://docs.rs/actix-redis/badge.svg?version=0.13.0)](https://docs.rs/actix-redis/0.13.0)
![Apache 2.0 or MIT licensed](https://img.shields.io/crates/l/actix-redis) ![Apache 2.0 or MIT licensed](https://img.shields.io/crates/l/actix-redis)
[![Dependency Status](https://deps.rs/crate/actix-redis/0.12.0/status.svg)](https://deps.rs/crate/actix-redis/0.12.0) [![Dependency Status](https://deps.rs/crate/actix-redis/0.13.0/status.svg)](https://deps.rs/crate/actix-redis/0.13.0)
## Documentation & Resources ## Documentation & Resources

View File

@ -1,25 +1,27 @@
# Changes # Changes
## Unreleased - 2021-xx-xx ## Unreleased
## 0.8.0
- Set secure attribute when adding a session removal cookie. - Set secure attribute when adding a session removal cookie.
- Update `redis` dependency to `0.22`. - Update `redis` dependency to `0.23`.
- Minimum supported Rust version (MSRV) is now 1.60. - 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] - Set SameSite attribute when adding a session removal cookie. [#284]
- Minimum supported Rust version (MSRV) is now 1.59 due to transitive `time` dependency. - Minimum supported Rust version (MSRV) is now 1.59 due to transitive `time` dependency.
[#284]: https://github.com/actix/actix-extras/pull/284 [#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] - Fix interaction between session state changes and renewal. [#265]
[#265]: https://github.com/actix/actix-extras/pull/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] - 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] - `SessionLength` is now called `SessionLifecycle`. [#233]
@ -36,7 +38,7 @@
[#233]: https://github.com/actix/actix-extras/pull/233 [#233]: https://github.com/actix/actix-extras/pull/233
## 0.6.2 - 2022-03-25 ## 0.6.2
- Implement `SessionExt` for `GuardContext`. [#234] - Implement `SessionExt` for `GuardContext`. [#234]
- `RedisSessionStore` will prevent connection timeouts from causing user-visible errors. [#235] - `RedisSessionStore` will prevent connection timeouts from causing user-visible errors. [#235]
@ -46,11 +48,11 @@
[#236]: https://github.com/actix/actix-extras/pull/236 [#236]: https://github.com/actix/actix-extras/pull/236
[#235]: https://github.com/actix/actix-extras/pull/235 [#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`. - No significant changes since `0.6.0`.
## 0.6.0 - 2022-03-15 ## 0.6.0
### Added ### Added
@ -72,28 +74,28 @@
[#212]: https://github.com/actix/actix-extras/pull/212 [#212]: https://github.com/actix/actix-extras/pull/212
## 0.5.0 - 2022-03-01 ## 0.5.0
- Update `actix-web` dependency to `4`. - 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`. - 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] - Update `actix-web` dependency to `4.0.0.beta-18`. [#218]
- Minimum supported Rust version (MSRV) is now 1.54. - Minimum supported Rust version (MSRV) is now 1.54.
[#218]: https://github.com/actix/actix-extras/pull/218 [#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] - Update `actix-web` dependency to `4.0.0.beta-15`. [#216]
[#216]: https://github.com/actix/actix-extras/pull/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] - Update `actix-web` dependency to `4.0.0.beta-14`. [#209]
- Remove `UserSession` implementation for `RequestHead`. [#209] - Remove `UserSession` implementation for `RequestHead`. [#209]
@ -102,11 +104,11 @@
[#207]: https://github.com/actix/actix-extras/pull/207 [#207]: https://github.com/actix/actix-extras/pull/207
[#209]: https://github.com/actix/actix-extras/pull/209 [#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`. - 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] - Impl `Clone` for `CookieSession`. [#201]
- Update `actix-web` dependency to v4.0.0-beta.10. [#203] - Update `actix-web` dependency to v4.0.0-beta.10. [#203]
@ -115,11 +117,11 @@
[#201]: https://github.com/actix/actix-extras/pull/201 [#201]: https://github.com/actix/actix-extras/pull/201
[#203]: https://github.com/actix/actix-extras/pull/203 [#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. - No notable changes.
## 0.5.0-beta.1 - 2021-04-02 ## 0.5.0-beta.1
- Add `Session::entries`. [#170] - Add `Session::entries`. [#170]
- Rename `Session::{set => insert}` to match standard hash map naming. [#170] - Rename `Session::{set => insert}` to match standard hash map naming. [#170]
@ -132,7 +134,7 @@
[#170]: https://github.com/actix/actix-extras/pull/170 [#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] - `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] - Fix calls to `session.purge()` from paths other than the one specified in the cookie. [#129]
@ -140,12 +142,12 @@
[#105]: https://github.com/actix/actix-extras/pull/105 [#105]: https://github.com/actix/actix-extras/pull/105
[#129]: https://github.com/actix/actix-extras/pull/129 [#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. - Update `actix-web` dependency to 3.0.0.
- Minimum supported Rust version (MSRV) is now 1.42.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 `time` dependency to 0.2.7
- Update the `actix-web` dependency to 3.0.0-alpha.1 - Update the `actix-web` dependency to 3.0.0-alpha.1

View File

@ -1,6 +1,6 @@
[package] [package]
name = "actix-session" name = "actix-session"
version = "0.7.2" version = "0.8.0"
authors = [ authors = [
"Nikolay Kim <fafhrd91@gmail.com>", "Nikolay Kim <fafhrd91@gmail.com>",
"Luca Palmieri <rust@lpalmieri.com>", "Luca Palmieri <rust@lpalmieri.com>",
@ -9,9 +9,9 @@ description = "Session management for Actix We"
keywords = ["http", "web", "framework", "async", "session"] keywords = ["http", "web", "framework", "async", "session"]
homepage = "https://actix.rs" homepage = "https://actix.rs"
repository = "https://github.com/actix/actix-extras.git" repository = "https://github.com/actix/actix-extras.git"
license = "MIT OR Apache-2.0" license.workspace = true
edition = "2018" edition.workspace = true
rust-version = "1.60" rust-version.workspace = true
[package.metadata.docs.rs] [package.metadata.docs.rs]
rustdoc-args = ["--cfg", "docsrs"] 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 } futures-core = { version = "0.3.7", default-features = false, optional = true }
# redis-rs-session # 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] [dev-dependencies]
actix-session = { path = ".", features = ["cookie-session", "redis-actor-session", "redis-rs-session"] } actix-session = { path = ".", features = ["cookie-session", "redis-actor-session", "redis-rs-session"] }

View File

@ -3,9 +3,9 @@
> Session management for Actix Web. > Session management for Actix Web.
[![crates.io](https://img.shields.io/crates/v/actix-session?label=latest)](https://crates.io/crates/actix-session) [![crates.io](https://img.shields.io/crates/v/actix-session?label=latest)](https://crates.io/crates/actix-session)
[![Documentation](https://docs.rs/actix-session/badge.svg?version=0.7.2)](https://docs.rs/actix-session/0.7.2) [![Documentation](https://docs.rs/actix-session/badge.svg?version=0.8.0)](https://docs.rs/actix-session/0.8.0)
![Apache 2.0 or MIT licensed](https://img.shields.io/crates/l/actix-session) ![Apache 2.0 or MIT licensed](https://img.shields.io/crates/l/actix-session)
[![Dependency Status](https://deps.rs/crate/actix-session/0.7.2/status.svg)](https://deps.rs/crate/actix-session/0.7.2) [![Dependency Status](https://deps.rs/crate/actix-session/0.8.0/status.svg)](https://deps.rs/crate/actix-session/0.8.0)
## Documentation & Resources ## Documentation & Resources

View File

@ -46,7 +46,7 @@ use serde::{de::DeserializeOwned, Serialize};
pub struct Session(Rc<RefCell<SessionInner>>); pub struct Session(Rc<RefCell<SessionInner>>);
/// Status of a [`Session`]. /// Status of a [`Session`].
#[derive(Debug, Clone, PartialEq, Eq)] #[derive(Debug, Clone, Default, PartialEq, Eq)]
pub enum SessionStatus { pub enum SessionStatus {
/// Session state has been updated - the changes will have to be persisted to the backend. /// Session state has been updated - the changes will have to be persisted to the backend.
Changed, Changed,
@ -64,15 +64,10 @@ pub enum SessionStatus {
Renewed, Renewed,
/// The session state has not been modified since its creation/retrieval. /// The session state has not been modified since its creation/retrieval.
#[default]
Unchanged, Unchanged,
} }
impl Default for SessionStatus {
fn default() -> SessionStatus {
SessionStatus::Unchanged
}
}
#[derive(Default)] #[derive(Default)]
struct SessionInner { struct SessionInner {
state: HashMap<String, String>, state: HashMap<String, String>,
@ -218,6 +213,7 @@ impl Session {
/// ///
/// Values that match keys already existing on the session will be overwritten. Values should /// Values that match keys already existing on the session will be overwritten. Values should
/// already be JSON serialized. /// already be JSON serialized.
#[allow(clippy::needless_pass_by_ref_mut)]
pub(crate) fn set_session( pub(crate) fn set_session(
req: &mut ServiceRequest, req: &mut ServiceRequest,
data: impl IntoIterator<Item = (String, String)>, data: impl IntoIterator<Item = (String, String)>,
@ -232,6 +228,7 @@ impl Session {
/// This is a destructive operation - the session state is removed from the request extensions /// 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 /// typemap, leaving behind a new empty map. It should only be used when the session is being
/// finalised (i.e. in `SessionMiddleware`). /// finalised (i.e. in `SessionMiddleware`).
#[allow(clippy::needless_pass_by_ref_mut)]
pub(crate) fn get_changes<B>( pub(crate) fn get_changes<B>(
res: &mut ServiceResponse<B>, res: &mut ServiceResponse<B>,
) -> (SessionStatus, HashMap<String, String>) { ) -> (SessionStatus, HashMap<String, String>) {

View File

@ -261,6 +261,7 @@ impl RedisSessionStore {
/// This helper method catches this case (`.is_connection_dropped`) to execute a retry. The /// 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 /// retry will be executed on a fresh connection, therefore it is likely to succeed (or fail for
/// a different more meaningful reason). /// a different more meaningful reason).
#[allow(clippy::needless_pass_by_ref_mut)]
async fn execute_command<T: FromRedisValue>(&self, cmd: &mut Cmd) -> RedisResult<T> { async fn execute_command<T: FromRedisValue>(&self, cmd: &mut Cmd) -> RedisResult<T> {
let mut can_retry = true; let mut can_retry = true;

View File

@ -69,15 +69,18 @@ impl SessionStore for MockStore {
_session_state: HashMap<String, String>, _session_state: HashMap<String, String>,
_ttl: &Duration, _ttl: &Duration,
) -> Result<SessionKey, UpdateError> { ) -> Result<SessionKey, UpdateError> {
todo!() #![allow(clippy::diverging_sub_expression)]
unimplemented!()
} }
async fn update_ttl(&self, _session_key: &SessionKey, _ttl: &Duration) -> Result<(), Error> { 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> { async fn delete(&self, _session_key: &SessionKey) -> Result<(), Error> {
todo!() #![allow(clippy::diverging_sub_expression)]
unimplemented!()
} }
} }

View File

@ -1,17 +1,22 @@
# Changes # Changes
## Unreleased - 2022-xx-xx ## Unreleased
- Rename `AtError => Error`. - Rename `AtError => Error`.
- Remove `AtResult` type alias. - Remove `AtResult` type alias.
- Minimum supported Rust version (MSRV) is now 1.60. - 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. - Update Actix Web dependencies to v4 ecosystem.
- Rename `actix.ssl` settings object to `actix.tls`. - Rename `actix.ssl` settings object to `actix.tls`.
- `NoSettings` is now marked `#[non_exhaustive]`. - `NoSettings` is now marked `#[non_exhaustive]`.
## 0.5.2 - 2022-07-31 ## 0.5.2
- Adopted into @actix org from <https://github.com/jjpe/actix-settings>. - Adopted into @actix org from <https://github.com/jjpe/actix-settings>.

View File

@ -6,9 +6,9 @@ authors = [
"Rob Ede <robjtede@icloud.com>", "Rob Ede <robjtede@icloud.com>",
] ]
description = "Easily manage Actix Web's settings from a TOML file and environment variables" description = "Easily manage Actix Web's settings from a TOML file and environment variables"
license = "MIT OR Apache-2.0" license.workspace = true
edition = "2018" edition.workspace = true
rust-version = "1.60" rust-version.workspace = true
[package.metadata.docs.rs] [package.metadata.docs.rs]
rustdoc-args = ["--cfg", "docsrs"] rustdoc-args = ["--cfg", "docsrs"]
@ -17,13 +17,13 @@ all-features = true
[dependencies] [dependencies]
actix-http = "3" actix-http = "3"
actix-service = "2" actix-service = "2"
actix-web = "4" actix-web = { version = "4", default-features = false }
derive_more = "0.99.7"
ioe = "0.5"
once_cell = "1.13" once_cell = "1.13"
regex = "1.5.5" regex = "1.5"
serde = { version = "1", features = ["derive"] } serde = { version = "1", features = ["derive"] }
toml = "0.5" toml = "0.8"
[dev-dependencies] [dev-dependencies]
actix-web = "4"
env_logger = "0.10" env_logger = "0.10"

View File

@ -1,18 +1,22 @@
use std::{env::VarError, io, num::ParseIntError, path::PathBuf, str::ParseBoolError}; use std::{env::VarError, io, num::ParseIntError, path::PathBuf, str::ParseBoolError};
use derive_more::{Display, Error};
use toml::de::Error as TomlError; use toml::de::Error as TomlError;
/// Errors that can be returned from methods in this crate. /// Errors that can be returned from methods in this crate.
#[derive(Debug, Clone)] #[derive(Debug, Display, Error)]
pub enum Error { pub enum Error {
/// Environment variable does not exists or is invalid. /// Environment variable does not exists or is invalid.
#[display(fmt = "Env var error: {_0}")]
EnvVarError(VarError), EnvVarError(VarError),
/// File already exists on disk. /// File already exists on disk.
FileExists(PathBuf), #[display(fmt = "File exists: {}", "_0.display()")]
FileExists(#[error(not(source))] PathBuf),
/// Invalid value. /// Invalid value.
#[allow(missing_docs)] #[allow(missing_docs)]
#[display(fmt = "Expected {expected}, got {got} (@ {file}:{line}:{column})")]
InvalidValue { InvalidValue {
expected: &'static str, expected: &'static str,
got: String, got: String,
@ -22,18 +26,23 @@ pub enum Error {
}, },
/// I/O error. /// I/O error.
IoError(ioe::IoError), #[display(fmt = "")]
IoError(io::Error),
/// Value is not a boolean. /// Value is not a boolean.
#[display(fmt = "Failed to parse boolean: {_0}")]
ParseBoolError(ParseBoolError), ParseBoolError(ParseBoolError),
/// Value is not an integer. /// Value is not an integer.
#[display(fmt = "Failed to parse integer: {_0}")]
ParseIntError(ParseIntError), ParseIntError(ParseIntError),
/// Value is not an address. /// Value is not an address.
ParseAddressError(String), #[display(fmt = "Failed to parse address: {_0}")]
ParseAddressError(#[error(not(source))] String),
/// Error deserializing as TOML. /// Error deserializing as TOML.
#[display(fmt = "TOML error: {_0}")]
TomlError(TomlError), TomlError(TomlError),
} }
@ -51,12 +60,6 @@ macro_rules! InvalidValue {
impl From<io::Error> for Error { impl From<io::Error> for Error {
fn from(err: io::Error) -> Self { fn from(err: io::Error) -> Self {
Self::IoError(ioe::IoError::from(err))
}
}
impl From<ioe::IoError> for Error {
fn from(err: ioe::IoError) -> Self {
Self::IoError(err) Self::IoError(err)
} }
} }
@ -88,48 +91,27 @@ impl From<VarError> for Error {
impl From<Error> for io::Error { impl From<Error> for io::Error {
fn from(err: Error) -> Self { fn from(err: Error) -> Self {
match err { match err {
Error::EnvVarError(var_error) => { Error::EnvVarError(_) => io::Error::new(io::ErrorKind::InvalidInput, err.to_string()),
let msg = format!("Env var error: {var_error}");
io::Error::new(io::ErrorKind::InvalidInput, msg) Error::FileExists(_) => io::Error::new(io::ErrorKind::AlreadyExists, err.to_string()),
Error::InvalidValue { .. } => {
io::Error::new(io::ErrorKind::InvalidInput, err.to_string())
} }
Error::FileExists(path_buf) => { Error::IoError(io_error) => io_error,
let msg = format!("File exists: {}", path_buf.display());
io::Error::new(io::ErrorKind::AlreadyExists, msg) Error::ParseBoolError(_) => {
io::Error::new(io::ErrorKind::InvalidInput, err.to_string())
} }
Error::InvalidValue { Error::ParseIntError(_) => io::Error::new(io::ErrorKind::InvalidInput, err.to_string()),
expected,
ref got, Error::ParseAddressError(_) => {
file, io::Error::new(io::ErrorKind::InvalidInput, err.to_string())
line,
column,
} => {
let msg = format!("Expected {expected}, got {got} (@ {file}:{line}:{column})");
io::Error::new(io::ErrorKind::InvalidInput, msg)
} }
Error::IoError(io_error) => io_error.into(), Error::TomlError(_) => io::Error::new(io::ErrorKind::InvalidInput, err.to_string()),
Error::ParseBoolError(parse_bool_error) => {
let msg = format!("Failed to parse boolean: {parse_bool_error}");
io::Error::new(io::ErrorKind::InvalidInput, msg)
}
Error::ParseIntError(parse_int_error) => {
let msg = format!("Failed to parse integer: {parse_int_error}");
io::Error::new(io::ErrorKind::InvalidInput, msg)
}
Error::ParseAddressError(string) => {
let msg = format!("Failed to parse address: {string}");
io::Error::new(io::ErrorKind::InvalidInput, msg)
}
Error::TomlError(toml_error) => {
let msg = format!("TOML error: {toml_error}");
io::Error::new(io::ErrorKind::InvalidInput, msg)
}
} }
} }
} }

View File

@ -169,7 +169,8 @@ where
/// Writes the default TOML template to a new file, located at `filepath`. /// Writes the default TOML template to a new file, located at `filepath`.
/// ///
/// # Errors /// # 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. /// location.
pub fn write_toml_file<P>(filepath: P) -> AsResult<()> pub fn write_toml_file<P>(filepath: P) -> AsResult<()>
where where

View File

@ -2,7 +2,7 @@ use std::{path::PathBuf, str::FromStr};
use crate::Error; use crate::Error;
/// A specialized `FromStr` trait that returns [`AtError`] errors /// A specialized `FromStr` trait that returns [`Error`] errors
pub trait Parse: Sized { pub trait Parse: Sized {
/// Parse `Self` from `string`. /// Parse `Self` from `string`.
fn parse(string: &str) -> Result<Self, Error>; fn parse(string: &str) -> Result<Self, Error>;

View File

@ -1,10 +1,13 @@
# Changes # Changes
## Unreleased - 2022-xx-xx ## Unreleased
- Minimum supported Rust version (MSRV) is now 1.60. ## 0.8.1
## 0.8.0 - 2022-07-21 - Implement `From<Basic>` for `BasicAuth`.
- Minimum supported Rust version (MSRV) is now 1.68.
## 0.8.0
- Removed `AuthExtractor` trait; implement `FromRequest` for your custom auth types. [#264] - Removed `AuthExtractor` trait; implement `FromRequest` for your custom auth types. [#264]
- `BasicAuth::user_id()` now returns `&str`. [#249] - `BasicAuth::user_id()` now returns `&str`. [#249]
@ -16,74 +19,74 @@
[#249]: https://github.com/actix/actix-extras/pull/249 [#249]: https://github.com/actix/actix-extras/pull/249
[#264]: https://github.com/actix/actix-extras/pull/264 [#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] - 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. - Minimum supported Rust version (MSRV) is now 1.57 due to transitive `time` dependency.
[#260]: https://github.com/actix/actix-extras/pull/260 [#260]: https://github.com/actix/actix-extras/pull/260
## 0.6.0 - 2022-03-01 ## 0.6.0
- Update `actix-web` dependency to `4`. - 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] - Relax body type bounds on middleware impl. [#223]
- Update `actix-web` dependency to `4.0.0-rc.1`. - Update `actix-web` dependency to `4.0.0-rc.1`.
[#223]: https://github.com/actix/actix-extras/pull/223 [#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. - 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] - Update `actix-web` dependency to `4.0.0.beta-15`. [#216]
[#216]: https://github.com/actix/actix-extras/pull/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] - Update `actix-web` dependency to `4.0.0.beta-14`. [#209]
[#209]: https://github.com/actix/actix-extras/pull/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<T: AuthExtractor>` and `Result<T: AuthExtractor, T::Error>`. [#205] - impl `AuthExtractor` trait for `Option<T: AuthExtractor>` and `Result<T: AuthExtractor, T::Error>`. [#205]
[#205]: https://github.com/actix/actix-extras/pull/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] - Update `actix-web` dependency to v4.0.0-beta.10. [#203]
- Minimum supported Rust version (MSRV) is now 1.52. - Minimum supported Rust version (MSRV) is now 1.52.
[#203]: https://github.com/actix/actix-extras/pull/203 [#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. - 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. - Update `actix-web` dependency to 4.0.0 beta.
- Minimum supported Rust version (MSRV) is now 1.46.0. - 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] - Correct error handling when extracting auth details from request. [#128]
[#128]: https://github.com/actix/actix-extras/pull/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. - Update `actix-web` dependency to 3.0.0.
- Minimum supported Rust version (MSRV) is now 1.42.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 - Update the `base64` dependency to 0.12
- AuthenticationError's status code is preserved when converting to a ResponseError - AuthenticationError's status code is preserved when converting to a ResponseError
@ -92,11 +95,11 @@
[#69]: https://github.com/actix/actix-web-httpauth/pull/69 [#69]: https://github.com/actix/actix-web-httpauth/pull/69
## 0.4.1 - 2020-02-19 ## 0.4.1
- Move repository to actix-extras - 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 `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 - Depends on `bytes = "^0.5"` and `base64 = "^0.11"` now

View File

@ -1,6 +1,6 @@
[package] [package]
name = "actix-web-httpauth" name = "actix-web-httpauth"
version = "0.8.0" version = "0.8.1"
authors = [ authors = [
"svartalf <self@svartalf.info>", "svartalf <self@svartalf.info>",
"Yuki Okushi <huyuumi.dev@gmail.com>", "Yuki Okushi <huyuumi.dev@gmail.com>",
@ -10,9 +10,9 @@ keywords = ["http", "web", "framework", "authentication", "security"]
homepage = "https://actix.rs" homepage = "https://actix.rs"
repository = "https://github.com/actix/actix-extras.git" repository = "https://github.com/actix/actix-extras.git"
categories = ["web-programming::http-server"] categories = ["web-programming::http-server"]
license = "MIT OR Apache-2.0" license.workspace = true
edition = "2018" edition.workspace = true
rust-version = "1.60" rust-version.workspace = true
[package.metadata.docs.rs] [package.metadata.docs.rs]
rustdoc-args = ["--cfg", "docsrs"] rustdoc-args = ["--cfg", "docsrs"]
@ -24,7 +24,7 @@ actix-web = { version = "4.1", default-features = false }
base64 = "0.21" base64 = "0.21"
futures-core = "0.3.7" futures-core = "0.3.7"
futures-util = { version = "0.3.7", default-features = false, features = ["std"] } futures-util = { version = "0.3.17", default-features = false, features = ["std"] }
log = "0.4" log = "0.4"
pin-project-lite = "0.2.7" pin-project-lite = "0.2.7"

View File

@ -3,9 +3,9 @@
> HTTP authentication schemes for [Actix Web](https://actix.rs). > HTTP authentication schemes for [Actix Web](https://actix.rs).
[![crates.io](https://img.shields.io/crates/v/actix-web-httpauth?label=latest)](https://crates.io/crates/actix-web-httpauth) [![crates.io](https://img.shields.io/crates/v/actix-web-httpauth?label=latest)](https://crates.io/crates/actix-web-httpauth)
[![Documentation](https://docs.rs/actix-web-httpauth/badge.svg?version=0.8.0)](https://docs.rs/actix-web-httpauth/0.8.0) [![Documentation](https://docs.rs/actix-web-httpauth/badge.svg?version=0.8.1)](https://docs.rs/actix-web-httpauth/0.8.1)
![Apache 2.0 or MIT licensed](https://img.shields.io/crates/l/actix-web-httpauth) ![Apache 2.0 or MIT licensed](https://img.shields.io/crates/l/actix-web-httpauth)
[![Dependency Status](https://deps.rs/crate/actix-web-httpauth/0.8.0/status.svg)](https://deps.rs/crate/actix-web-httpauth/0.8.0) [![Dependency Status](https://deps.rs/crate/actix-web-httpauth/0.8.1/status.svg)](https://deps.rs/crate/actix-web-httpauth/0.8.1)
## Documentation & Resources ## Documentation & Resources

View File

@ -89,6 +89,12 @@ impl BasicAuth {
} }
} }
impl From<Basic> for BasicAuth {
fn from(basic: Basic) -> Self {
Self(basic)
}
}
impl FromRequest for BasicAuth { impl FromRequest for BasicAuth {
type Future = Ready<Result<Self, Self::Error>>; type Future = Ready<Result<Self, Self::Error>>;
type Error = AuthenticationError<Challenge>; type Error = AuthenticationError<Challenge>;

View File

@ -102,7 +102,7 @@ impl FromRequest for BearerAuth {
let bearer = req let bearer = req
.app_data::<Config>() .app_data::<Config>()
.map(|config| config.0.clone()) .map(|config| config.0.clone())
.unwrap_or_else(Default::default); .unwrap_or_default();
AuthenticationError::new(bearer) AuthenticationError::new(bearer)
}), }),

View File

@ -55,7 +55,7 @@ impl Scheme for Basic {
let mut parts = header.to_str()?.splitn(2, ' '); let mut parts = header.to_str()?.splitn(2, ' ');
match parts.next() { match parts.next() {
Some(scheme) if scheme == "Basic" => (), Some("Basic") => (),
_ => return Err(ParseError::MissingScheme), _ => return Err(ParseError::MissingScheme),
} }

View File

@ -50,7 +50,7 @@ impl Scheme for Bearer {
let mut parts = header.to_str()?.splitn(2, ' '); let mut parts = header.to_str()?.splitn(2, ' ');
match parts.next() { match parts.next() {
Some(scheme) if scheme == "Bearer" => {} Some("Bearer") => {}
_ => return Err(ParseError::MissingScheme), _ => return Err(ParseError::MissingScheme),
} }

View File

@ -1 +0,0 @@
msrv = "1.60"