diff --git a/.github/workflows/clippy.yml b/.github/workflows/clippy.yml new file mode 100644 index 000000000..dbdddaad6 --- /dev/null +++ b/.github/workflows/clippy.yml @@ -0,0 +1,18 @@ +on: pull_request + +name: Clippy Check +jobs: + clippy_check: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - uses: actions-rs/toolchain@v1 + with: + toolchain: nightly + profile: minimal + components: clippy + override: true + - uses: actions-rs/clippy-check@v1 + with: + token: ${{ secrets.GITHUB_TOKEN }} + args: --all-features --all --tests diff --git a/.github/workflows/linux.yml b/.github/workflows/linux.yml new file mode 100644 index 000000000..280e2a8cf --- /dev/null +++ b/.github/workflows/linux.yml @@ -0,0 +1,83 @@ +name: CI (Linux) + +on: [push, pull_request] + +jobs: + build_and_test: + strategy: + fail-fast: false + matrix: + version: + - stable + - nightly + + name: ${{ matrix.version }} - x86_64-unknown-linux-gnu + runs-on: ubuntu-latest + + services: + redis: + image: redis:5.0.7 + ports: + - 6379:6379 + options: --entrypoint redis-server + + steps: + - uses: actions/checkout@master + + - name: Install ${{ matrix.version }} + uses: actions-rs/toolchain@v1 + with: + toolchain: ${{ matrix.version }}-x86_64-unknown-linux-gnu + profile: minimal + override: true + + - name: Generate Cargo.lock + uses: actions-rs/cargo@v1 + with: + command: generate-lockfile + - name: Cache cargo registry + uses: actions/cache@v1 + with: + path: ~/.cargo/registry + key: ${{ matrix.version }}-x86_64-unknown-linux-gnu-cargo-registry-trimmed-${{ hashFiles('**/Cargo.lock') }} + - name: Cache cargo index + uses: actions/cache@v1 + with: + path: ~/.cargo/git + key: ${{ matrix.version }}-x86_64-unknown-linux-gnu-cargo-index-trimmed-${{ hashFiles('**/Cargo.lock') }} + - name: Cache cargo build + uses: actions/cache@v1 + with: + path: target + key: ${{ matrix.version }}-x86_64-unknown-linux-gnu-cargo-build-trimmed-${{ hashFiles('**/Cargo.lock') }} + + - name: check build + uses: actions-rs/cargo@v1 + with: + command: check + args: --all --bins --examples --tests + + - name: tests + uses: actions-rs/cargo@v1 + timeout-minutes: 40 + with: + command: test + args: --all --all-features --no-fail-fast -- --nocapture + + - name: Generate coverage file + if: matrix.version == 'stable' && (github.ref == 'master' || github.event_name == 'pull_request') + run: | + cargo install cargo-tarpaulin + cargo tarpaulin --out Xml --workspace --all-features + + - name: Upload to Codecov + if: matrix.version == 'stable' && (github.ref == 'master' || github.event_name == 'pull_request') + uses: codecov/codecov-action@v1 + with: + token: ${{ secrets.CODECOV_TOKEN }} + file: cobertura.xml + + - name: Clear the cargo caches + run: | + cargo install cargo-cache --no-default-features --features ci-autoclean + cargo-cache diff --git a/.github/workflows/macos.yml b/.github/workflows/macos.yml new file mode 100644 index 000000000..b729708bc --- /dev/null +++ b/.github/workflows/macos.yml @@ -0,0 +1,66 @@ +name: CI (macOS) + +on: [push, pull_request] + +jobs: + build_and_test: + strategy: + fail-fast: false + matrix: + version: + - stable + - nightly + + name: ${{ matrix.version }} - x86_64-apple-darwin + runs-on: macos-latest + + steps: + - uses: actions/checkout@master + + - name: Install ${{ matrix.version }} + uses: actions-rs/toolchain@v1 + with: + toolchain: ${{ matrix.version }}-x86_64-apple-darwin + profile: minimal + override: true + + - name: Generate Cargo.lock + uses: actions-rs/cargo@v1 + with: + command: generate-lockfile + - name: Cache cargo registry + uses: actions/cache@v1 + with: + path: ~/.cargo/registry + key: ${{ matrix.version }}-x86_64-apple-darwin-cargo-registry-trimmed-${{ hashFiles('**/Cargo.lock') }} + - name: Cache cargo index + uses: actions/cache@v1 + with: + path: ~/.cargo/git + key: ${{ matrix.version }}-x86_64-apple-darwin-cargo-index-trimmed-${{ hashFiles('**/Cargo.lock') }} + - name: Cache cargo build + uses: actions/cache@v1 + with: + path: target + key: ${{ matrix.version }}-x86_64-apple-darwin-cargo-build-trimmed-${{ hashFiles('**/Cargo.lock') }} + + - name: check build + uses: actions-rs/cargo@v1 + with: + command: check + args: --all --bins --examples --tests + + - name: tests + uses: actions-rs/cargo@v1 + timeout-minutes: 40 + with: + command: test + args: --package=actix-cors + --package=actix-protobuf + --package=actix-web-httpauth + --all-features --no-fail-fast -- --nocapture + + - name: Clear the cargo caches + run: | + cargo install cargo-cache --no-default-features --features ci-autoclean + cargo-cache diff --git a/.github/workflows/msrv.yml b/.github/workflows/msrv.yml new file mode 100644 index 000000000..4ac968a4b --- /dev/null +++ b/.github/workflows/msrv.yml @@ -0,0 +1,43 @@ +name: CI (Linux, MSRV) + +on: [push, pull_request] + +jobs: + build_and_test: + strategy: + fail-fast: false + matrix: + version: + - 1.39.0 + + name: ${{ matrix.version }} - x86_64-unknown-linux-gnu + runs-on: ubuntu-latest + + services: + redis: + image: redis:5.0.7 + ports: + - 6379:6379 + options: --entrypoint redis-server + + steps: + - uses: actions/checkout@master + + - name: Install ${{ matrix.version }} + uses: actions-rs/toolchain@v1 + with: + toolchain: ${{ matrix.version }}-x86_64-unknown-linux-gnu + profile: minimal + override: true + + - name: tests (1.39.0) + if: matrix.version == '1.39.0' + uses: actions-rs/cargo@v1 + timeout-minutes: 40 + with: + command: test + args: --package=actix-cors + --package=actix-protobuf + --package=actix-redis + --package=actix-web-httpauth + --all-features --no-fail-fast -- --nocapture diff --git a/.github/workflows/upload-doc.yml b/.github/workflows/upload-doc.yml new file mode 100644 index 000000000..4e0b7114a --- /dev/null +++ b/.github/workflows/upload-doc.yml @@ -0,0 +1,35 @@ +name: Upload documentation (actix-redis) + +on: + push: + branches: + - master + +jobs: + build: + runs-on: ubuntu-latest + if: github.repository == 'actix/actix-extras' + + steps: + - uses: actions/checkout@master + + - name: Install Rust + uses: actions-rs/toolchain@v1 + with: + toolchain: stable-x86_64-unknown-linux-gnu + profile: minimal + override: true + + - name: check build + uses: actions-rs/cargo@v1 + with: + command: doc + args: --no-deps --package=actix-redis + + - name: Tweak HTML + run: echo "" > target/doc/index.html + + - name: Upload documentation + run: | + git clone https://github.com/davisp/ghp-import.git + ./ghp-import/ghp_import.py -n -p -f -m "Documentation upload" -r https://${{ secrets.GITHUB_TOKEN }}@github.com/"${{ github.repository }}.git" target/doc diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml new file mode 100644 index 000000000..0fb4065c0 --- /dev/null +++ b/.github/workflows/windows.yml @@ -0,0 +1,70 @@ +name: CI (Windows) + +on: [push, pull_request] + +jobs: + build_and_test: + strategy: + fail-fast: false + matrix: + version: + - stable + - nightly + target: + - x86_64-pc-windows-msvc + - x86_64-pc-windows-gnu + - i686-pc-windows-msvc + + name: ${{ matrix.version }} - ${{ matrix.target }} + runs-on: windows-latest + + steps: + - uses: actions/checkout@master + + - name: Install ${{ matrix.version }} + uses: actions-rs/toolchain@v1 + with: + toolchain: ${{ matrix.version }}-${{ matrix.target }} + profile: minimal + override: true + + - name: Generate Cargo.lock + uses: actions-rs/cargo@v1 + with: + command: generate-lockfile + - name: Cache cargo registry + uses: actions/cache@v1 + with: + path: ~/.cargo/registry + key: ${{ matrix.version }}-${{ matrix.target }}-cargo-registry-trimmed-${{ hashFiles('**/Cargo.lock') }} + - name: Cache cargo index + uses: actions/cache@v1 + with: + path: ~/.cargo/git + key: ${{ matrix.version }}-${{ matrix.target }}-cargo-index-trimmed-${{ hashFiles('**/Cargo.lock') }} + - name: Cache cargo build + uses: actions/cache@v1 + with: + path: target + key: ${{ matrix.version }}-${{ matrix.target }}-cargo-build-trimmed-${{ hashFiles('**/Cargo.lock') }} + + - name: check build + uses: actions-rs/cargo@v1 + with: + command: check + args: --all --bins --examples --tests + + - name: tests + uses: actions-rs/cargo@v1 + timeout-minutes: 40 + with: + command: test + args: --package=actix-cors + --package=actix-protobuf + --package=actix-web-httpauth + --all-features --no-fail-fast -- --nocapture + + - name: Clear the cargo caches + run: | + cargo install cargo-cache --no-default-features --features ci-autoclean + cargo-cache diff --git a/README.md b/README.md index 7896acbb9..5f9520ab7 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # actix-extras -[![Join the chat at https://gitter.im/actix/actix](https://badges.gitter.im/actix/actix.svg)](https://gitter.im/actix/actix?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge) +[![Join the chat at https://gitter.im/actix/actix](https://badges.gitter.im/actix/actix.svg)](https://gitter.im/actix/actix?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)[![build status](https://github.com/actix/actix-extras/workflows/CI%20%28Linux%29/badge.svg?branch=master&event=push)](https://github.com/actix/actix-extras/actions) > A collection of additional crates supporting the [actix] and [actix-web] frameworks. diff --git a/actix-cors/Cargo.toml b/actix-cors/Cargo.toml index 4e1a87043..c92422ddf 100644 --- a/actix-cors/Cargo.toml +++ b/actix-cors/Cargo.toml @@ -6,7 +6,7 @@ description = "Cross-origin resource sharing (CORS) for actix-web applications." readme = "README.md" keywords = ["cors", "web", "framework"] homepage = "https://actix.rs" -repository = "https://github.com/actix/actix-web.git" +repository = "https://github.com/actix/actix-extras.git" documentation = "https://docs.rs/actix-cors/" license = "MIT/Apache-2.0" edition = "2018" diff --git a/actix-cors/README.md b/actix-cors/README.md index 483529032..6cb3666e9 100644 --- a/actix-cors/README.md +++ b/actix-cors/README.md @@ -3,8 +3,6 @@ [![crates.io](https://img.shields.io/crates/v/actix-cors)](https://crates.io/crates/actix-cors) [![Documentation](https://docs.rs/actix-cors/badge.svg)](https://docs.rs/actix-cors) [![Dependency Status](https://deps.rs/crate/actix-cors/0.2.0/status.svg)](https://deps.rs/crate/actix-cors/0.2.0) -[![Build Status](https://travis-ci.org/actix/actix-cors.svg?branch=master)](https://travis-ci.org/actix/actix-cors) -[![codecov](https://codecov.io/gh/actix/actix-cors/branch/master/graph/badge.svg)](https://codecov.io/gh/actix/actix-cors) ![Apache 2.0 or MIT licensed](https://img.shields.io/crates/l/actix-cors) [![Join the chat at https://gitter.im/actix/actix](https://badges.gitter.im/actix/actix.svg)](https://gitter.im/actix/actix?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge) @@ -16,4 +14,4 @@ * [API Documentation](https://docs.rs/actix-cors/) * [Chat on gitter](https://gitter.im/actix/actix) * Cargo package: [actix-cors](https://crates.io/crates/actix-cors) -* Minimum supported Rust version: 1.34 or later +* Minimum supported Rust version: 1.39.0 or later diff --git a/actix-cors/src/lib.rs b/actix-cors/src/lib.rs index 429fe9eab..579a067b3 100644 --- a/actix-cors/src/lib.rs +++ b/actix-cors/src/lib.rs @@ -160,14 +160,12 @@ impl AllOrSome { /// use actix_cors::Cors; /// use actix_web::http::header; /// -/// # fn main() { /// let cors = Cors::new() /// .allowed_origin("https://www.rust-lang.org/") /// .allowed_methods(vec!["GET", "POST"]) /// .allowed_headers(vec![header::AUTHORIZATION, header::ACCEPT]) /// .allowed_header(header::CONTENT_TYPE) /// .max_age(3600); -/// # } /// ``` #[derive(Default)] pub struct Cors { @@ -585,7 +583,7 @@ impl Inner { AllOrSome::All => Ok(()), AllOrSome::Some(ref allowed_origins) => allowed_origins .get(origin) - .and_then(|_| Some(())) + .map(|_| ()) .ok_or_else(|| CorsError::OriginNotAllowed), }; } @@ -633,7 +631,7 @@ impl Inner { return self .methods .get(&method) - .and_then(|_| Some(())) + .map(|_| ()) .ok_or_else(|| CorsError::MethodNotAllowed); } } @@ -651,6 +649,7 @@ impl Inner { req.headers().get(&header::ACCESS_CONTROL_REQUEST_HEADERS) { if let Ok(headers) = hdr.to_str() { + #[allow(clippy::mutable_key_type)] // FIXME: revisit here let mut hdrs = HashSet::new(); for hdr in headers.split(',') { match HeaderName::try_from(hdr.trim()) { @@ -779,7 +778,7 @@ where { res.headers_mut().insert( header::ACCESS_CONTROL_ALLOW_ORIGIN, - origin.clone(), + origin, ); }; diff --git a/actix-protobuf/.travis.yml b/actix-protobuf/.travis.yml deleted file mode 100644 index 848e4421d..000000000 --- a/actix-protobuf/.travis.yml +++ /dev/null @@ -1,53 +0,0 @@ -language: rust -rust: - - stable - - beta - - nightly - -os: linux -dist: xenial - -env: - global: - - RUSTFLAGS="-C link-dead-code" - -addons: - apt: - packages: - - libcurl4-openssl-dev - - libelf-dev - - libdw-dev - - cmake - - gcc - - binutils-dev - - libiberty-dev - -# Add clippy -before_script: - - | - if [[ "$TRAVIS_RUST_VERSION" == "nightly" ]]; then - ( ( rustup component add clippy && export CLIPPY=true ) || export CLIPPY=false ); - fi - - export PATH=$PATH:~/.cargo/bin - -script: - - | - if [[ "$TRAVIS_RUST_VERSION" == "nightly" ]]; then - USE_SKEPTIC=1 cargo test - else - cargo test && cargo check --examples - fi - - | - if [[ "$TRAVIS_RUST_VERSION" == "nightly" && $CLIPPY ]]; then - cargo clippy - fi - -# Upload docs -after_success: - - | - if [[ "$TRAVIS_OS_NAME" == "linux" && "$TRAVIS_RUST_VERSION" == "nightly" ]]; then - bash <(curl https://raw.githubusercontent.com/xd009642/tarpaulin/master/travis-install.sh) - USE_SKEPTIC=1 cargo tarpaulin --out Xml - bash <(curl -s https://codecov.io/bash) - echo "Uploaded code coverage" - fi diff --git a/actix-protobuf/Cargo.toml b/actix-protobuf/Cargo.toml index 20011321d..fed4da57d 100644 --- a/actix-protobuf/Cargo.toml +++ b/actix-protobuf/Cargo.toml @@ -6,13 +6,10 @@ authors = ["kingxsp , Yuki Okushi description = "Protobuf support for actix-web framework." readme = "README.md" keywords = ["actix"] -homepage = "https://github.com/actix/actix-protobuf" +homepage = "https://github.com/actix/actix-extras" +repository = "https://github.com/actix/actix-extras.git" license = "MIT/Apache-2.0" -exclude = [".travis.yml", ".cargo/config", "/examples/**"] - -[badges] -travis-ci = { repository = "actix/actix-protobuf", branch = "master" } -codecov = { repository = "actix/actix-protobuf", branch = "master", service = "github" } +exclude = [".cargo/config", "/examples/**"] [lib] name = "actix_protobuf" diff --git a/actix-protobuf/README.md b/actix-protobuf/README.md index db0ff648c..f64480277 100644 --- a/actix-protobuf/README.md +++ b/actix-protobuf/README.md @@ -3,13 +3,13 @@ [![crates.io](https://img.shields.io/crates/v/actix-protobuf)](https://crates.io/crates/actix-protobuf) [![Documentation](https://docs.rs/actix-protobuf/badge.svg)](https://docs.rs/actix-protobuf) [![Dependency Status](https://deps.rs/crate/actix-protobuf/0.5.0/status.svg)](https://deps.rs/crate/actix-protobuf/0.5.0) -[![Build Status](https://travis-ci.org/actix/actix-protobuf.svg?branch=master)](https://travis-ci.org/actix/actix-protobuf) -[![codecov](https://codecov.io/gh/actix/actix-protobuf/branch/master/graph/badge.svg)](https://codecov.io/gh/actix/actix-protobuf) ![Apache 2.0 or MIT licensed](https://img.shields.io/crates/l/actix-protobuf) [![Join the chat at https://gitter.im/actix/actix](https://badges.gitter.im/actix/actix.svg)](https://gitter.im/actix/actix?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge) > Protobuf support for actix-web framework. +* Minimum supported Rust version: 1.39.0 or later + ## Example ```rust,ignore diff --git a/actix-redis/.travis.yml b/actix-redis/.travis.yml deleted file mode 100644 index cb3e21855..000000000 --- a/actix-redis/.travis.yml +++ /dev/null @@ -1,65 +0,0 @@ -language: rust -rust: - - stable - - beta - - nightly - -sudo: required -dist: trusty - -services: - - redis-server - -env: - global: - - RUSTFLAGS="-C link-dead-code" - -addons: - apt: - packages: - - libcurl4-openssl-dev - - libelf-dev - - libdw-dev - - cmake - - gcc - - binutils-dev - - libiberty-dev - -# Add clippy -before_script: - - | - if [[ "$TRAVIS_RUST_VERSION" == "nightly" ]]; then - ( ( cargo install clippy && export CLIPPY=true ) || export CLIPPY=false ); - fi - - export PATH=$PATH:~/.cargo/bin - -script: - - | - if [[ "$TRAVIS_RUST_VERSION" == "nightly" ]]; then - USE_SKEPTIC=1 cargo test - else - cargo test - fi - - | - if [[ "$TRAVIS_RUST_VERSION" == "nightly" && $CLIPPY ]]; then - cargo clippy - fi - -# Upload docs -after_success: - - | - if [[ "$TRAVIS_OS_NAME" == "linux" && "$TRAVIS_PULL_REQUEST" = "false" && "$TRAVIS_BRANCH" == "master" && "$TRAVIS_RUST_VERSION" == "stable" ]]; then - cargo doc --no-deps && - echo "" > target/doc/index.html && - git clone https://github.com/davisp/ghp-import.git && - ./ghp-import/ghp_import.py -n -p -f -m "Documentation upload" -r https://"$GH_TOKEN"@github.com/"$TRAVIS_REPO_SLUG.git" target/doc && - echo "Uploaded documentation" - fi - - - | - if [[ "$TRAVIS_OS_NAME" == "linux" && "$TRAVIS_RUST_VERSION" == "nightly" ]]; then - bash <(curl https://raw.githubusercontent.com/xd009642/tarpaulin/master/travis-install.sh) - USE_SKEPTIC=1 cargo tarpaulin --out Xml - bash <(curl -s https://codecov.io/bash) - echo "Uploaded code coverage" - fi diff --git a/actix-redis/Cargo.toml b/actix-redis/Cargo.toml index b944f1692..0c851394e 100644 --- a/actix-redis/Cargo.toml +++ b/actix-redis/Cargo.toml @@ -6,8 +6,8 @@ description = "Redis integration for actix framework" license = "MIT/Apache-2.0" readme = "README.md" keywords = ["web", "redis", "async", "actix", "tokio"] -homepage = "https://github.com/actix/actix-redis" -repository = "https://github.com/actix/actix-redis.git" +homepage = "https://github.com/actix/actix-extras" +repository = "https://github.com/actix/actix-extras.git" documentation = "https://docs.rs/actix-redis/" categories = ["network-programming", "asynchronous"] exclude = [".travis.yml", ".cargo/config"] @@ -17,10 +17,6 @@ edition = "2018" name = "actix_redis" path = "src/lib.rs" -[badges] -travis-ci = { repository = "actix/actix-redis", branch = "master" } -codecov = { repository = "actix/actix-redis", branch = "master", service = "github" } - [features] default = ["web"] diff --git a/actix-redis/README.md b/actix-redis/README.md index 86f465d06..b6e54fe98 100644 --- a/actix-redis/README.md +++ b/actix-redis/README.md @@ -3,8 +3,6 @@ [![crates.io](https://img.shields.io/crates/v/actix-redis)](https://crates.io/crates/actix-redis) [![Documentation](https://docs.rs/actix-redis/badge.svg)](https://docs.rs/actix-redis) [![Dependency Status](https://deps.rs/crate/actix-redis/0.8.0/status.svg)](https://deps.rs/crate/actix-redis/0.8.0) -[![Build Status](https://travis-ci.org/actix/actix-redis.svg?branch=master)](https://travis-ci.org/actix/actix-redis) -[![codecov](https://codecov.io/gh/actix/actix-redis/branch/master/graph/badge.svg)](https://codecov.io/gh/actix/actix-redis) ![Apache 2.0 or MIT licensed](https://img.shields.io/crates/l/actix-redis) [![Join the chat at https://gitter.im/actix/actix](https://badges.gitter.im/actix/actix.svg)](https://gitter.im/actix/actix?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge) @@ -12,7 +10,7 @@ ## Documentation -* [API Documentation](http://actix.github.io/actix-redis/actix_redis/) +* [API Documentation](http://actix.rs/actix-extras/actix_redis/) * [Chat on gitter](https://gitter.im/actix/actix) * Cargo package: [actix-redis](https://crates.io/crates/actix-redis) * Minimum supported Rust version: 1.39 or later diff --git a/actix-redis/src/session.rs b/actix-redis/src/session.rs index ced1822ad..474d1136d 100644 --- a/actix-redis/src/session.rs +++ b/actix-redis/src/session.rs @@ -134,6 +134,7 @@ where type Request = ServiceRequest; type Response = ServiceResponse; type Error = Error; + #[allow(clippy::type_complexity)] type Future = Pin>>>; fn poll_ready(&mut self, cx: &mut Context<'_>) -> Poll> { @@ -266,7 +267,7 @@ impl Inner { value: Option, ) -> Result, Error> { let (value, jar) = if let Some(value) = value { - (value.clone(), None) + (value, None) } else { let value: String = iter::repeat(()) .map(|()| OsRng.sample(Alphanumeric)) @@ -559,7 +560,7 @@ mod test { .unwrap(); assert_eq!( true, - cookie_1.value().to_string() != cookie_2.value().to_string() + cookie_1.value() != cookie_2.value() ); let result_5 = resp_5.json::().await.unwrap(); @@ -618,7 +619,7 @@ mod test { counter: 0 } ); - assert!(cookie_3.value().to_string() != cookie_2.value().to_string()); + assert!(cookie_3.value() != cookie_2.value()); // Step 9: POST to logout, including session cookie #2 // - set-cookie actix-session will be in response with session cookie #2 @@ -632,7 +633,7 @@ mod test { .into_iter() .find(|c| c.name() == "test-session") .unwrap(); - assert!(&time::now().tm_year != &cookie_4.expires().map(|t| t.tm_year).unwrap()); + assert_ne!(time::now().tm_year, cookie_4.expires().map(|t| t.tm_year).unwrap()); // Step 10: GET index, including session cookie #2 in request // - set-cookie actix-session will be in response (session cookie #3) @@ -655,6 +656,6 @@ mod test { .into_iter() .find(|c| c.name() == "test-session") .unwrap(); - assert!(cookie_5.value().to_string() != cookie_2.value().to_string()); + assert!(cookie_5.value() != cookie_2.value()); } } diff --git a/actix-web-httpauth/.github/workflows/clippy-and-fmt.yml b/actix-web-httpauth/.github/workflows/clippy-and-fmt.yml deleted file mode 100644 index 3ff6c230c..000000000 --- a/actix-web-httpauth/.github/workflows/clippy-and-fmt.yml +++ /dev/null @@ -1,28 +0,0 @@ -name: Clippy and rustfmt check - -on: - push: - branches: - - master - pull_request: - -jobs: - clippy_check: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@master - - uses: actions-rs/toolchain@v1 - with: - toolchain: nightly - components: clippy, rustfmt - override: true - - name: Clippy - uses: actions-rs/cargo@v1 - with: - command: clippy - args: --all-features - - name: rustfmt - uses: actions-rs/cargo@v1 - with: - command: fmt - args: --all -- --check diff --git a/actix-web-httpauth/.github/workflows/main.yml b/actix-web-httpauth/.github/workflows/main.yml deleted file mode 100644 index 071b73855..000000000 --- a/actix-web-httpauth/.github/workflows/main.yml +++ /dev/null @@ -1,83 +0,0 @@ -name: CI - -on: - push: - branches: - - master - pull_request: - -jobs: - build_and_test: - strategy: - fail-fast: false - matrix: - toolchain: - - x86_64-pc-windows-msvc - - x86_64-pc-windows-gnu - - x86_64-unknown-linux-gnu - - x86_64-apple-darwin - version: - - stable - - nightly - include: - - toolchain: x86_64-pc-windows-msvc - os: windows-latest - - toolchain: x86_64-pc-windows-gnu - os: windows-latest - - toolchain: x86_64-unknown-linux-gnu - os: ubuntu-latest - - toolchain: x86_64-apple-darwin - os: macOS-latest - - name: ${{ matrix.version }} - ${{ matrix.toolchain }} - runs-on: ${{ matrix.os }} - - steps: - - uses: actions/checkout@master - - - name: Install ${{ matrix.version }} - uses: actions-rs/toolchain@v1 - with: - toolchain: ${{ matrix.version }}-${{ matrix.toolchain }} - profile: minimal - override: true - - - name: Generate Cargo.lock - uses: actions-rs/cargo@v1 - with: - command: update - - name: Cache cargo registry - uses: actions/cache@v1 - with: - path: ~/.cargo/registry - key: ${{ matrix.version }}-${{ matrix.toolchain }}-cargo-registry-${{ hashFiles('**/Cargo.lock') }} - - name: Cache cargo index - uses: actions/cache@v1 - with: - path: ~/.cargo/git - key: ${{ matrix.version }}-${{ matrix.toolchain }}-cargo-index-${{ hashFiles('**/Cargo.lock') }} - - name: Cache cargo build - uses: actions/cache@v1 - with: - path: target - key: ${{ matrix.version }}-${{ matrix.toolchain }}-cargo-build-${{ hashFiles('**/Cargo.lock') }} - - - name: checks - uses: actions-rs/cargo@v1 - with: - command: check - args: --all --bins --examples --tests - - - name: tests (stable) - if: matrix.version == 'stable' - uses: actions-rs/cargo@v1 - with: - command: test - args: --all --no-fail-fast -- --nocapture - - - name: tests (nightly) - if: matrix.version == 'nightly' - uses: actions-rs/cargo@v1 - with: - command: test - args: --all --all-features --no-fail-fast -- --nocapture diff --git a/actix-web-httpauth/.github/workflows/msrv.yml b/actix-web-httpauth/.github/workflows/msrv.yml deleted file mode 100644 index 68f1fcecc..000000000 --- a/actix-web-httpauth/.github/workflows/msrv.yml +++ /dev/null @@ -1,55 +0,0 @@ -name: Check MSRV - -on: - push: - branches: - - master - pull_request: - -jobs: - build_and_test: - strategy: - fail-fast: false - - runs-on: ubuntu-latest - - steps: - - uses: actions/checkout@master - - - name: Install Rust - uses: actions-rs/toolchain@v1 - with: - toolchain: 1.39.0-x86_64-unknown-linux-gnu - profile: minimal - override: true - - name: Generate Cargo.lock - uses: actions-rs/cargo@v1 - with: - command: update - - name: Cache cargo registry - uses: actions/cache@v1 - with: - path: ~/.cargo/registry - key: msrv-cargo-registry-${{ hashFiles('**/Cargo.lock') }} - - name: Cache cargo index - uses: actions/cache@v1 - with: - path: ~/.cargo/git - key: msrv-cargo-index-${{ hashFiles('**/Cargo.lock') }} - - name: Cache cargo build - uses: actions/cache@v1 - with: - path: target - key: msrv-cargo-build-${{ hashFiles('**/Cargo.lock') }} - - - name: checks - uses: actions-rs/cargo@v1 - with: - command: check - args: --all --bins --examples --tests - - - name: tests - uses: actions-rs/cargo@v1 - with: - command: test - args: --all --no-fail-fast -- --nocapture diff --git a/actix-web-httpauth/Cargo.toml b/actix-web-httpauth/Cargo.toml index e6fc0fd2d..abac9f912 100644 --- a/actix-web-httpauth/Cargo.toml +++ b/actix-web-httpauth/Cargo.toml @@ -5,12 +5,11 @@ authors = ["svartalf ", "Yuki Okushi description = "HTTP authentication schemes for actix-web" readme = "README.md" keywords = ["http", "web", "framework"] -homepage = "https://github.com/actix/actix-web-httpauth" -repository = "https://github.com/actix/actix-web-httpauth.git" +homepage = "https://github.com/actix/actix-extras" +repository = "https://github.com/actix/actix-extras.git" documentation = "https://docs.rs/actix-web-httpauth/" categories = ["web-programming::http-server"] license = "MIT/Apache-2.0" -exclude = [".github/*"] edition = "2018" [lib] @@ -29,7 +28,7 @@ actix-rt = "1.0" [features] default = [] -nightly = [] +nightly = [] # leave it for compatibility [badges] maintenance = { status = "passively-maintained" } diff --git a/actix-web-httpauth/README.md b/actix-web-httpauth/README.md index 27167ec3b..946103d86 100644 --- a/actix-web-httpauth/README.md +++ b/actix-web-httpauth/README.md @@ -3,8 +3,6 @@ [![crates.io](https://img.shields.io/crates/v/actix-web-httpauth)](https://crates.io/crates/actix-web-httpauth) [![Documentation](https://docs.rs/actix-web-httpauth/badge.svg)](https://docs.rs/actix-web-httpauth) [![Dependency Status](https://deps.rs/crate/actix-web-httpauth/0.4.0/status.svg)](https://deps.rs/crate/actix-web-httpauth/0.4.0) -![Build Status](https://github.com/actix/actix-web-httpauth/workflows/CI/badge.svg?branch=master&event=push) -[![codecov](https://codecov.io/gh/actix/actix-web-httpauth/branch/master/graph/badge.svg)](https://codecov.io/gh/actix/actix-web-httpauth) ![Apache 2.0 or MIT licensed](https://img.shields.io/crates/l/actix-web-httpauth) [![Join the chat at https://gitter.im/actix/actix](https://badges.gitter.im/actix/actix.svg)](https://gitter.im/actix/actix?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge) @@ -15,7 +13,7 @@ Provides: * [extractors] for an [Authorization] header * [middleware] for easier authorization checking -All supported schemas are actix [Extractors](https://docs.rs/actix-web/1.0.0/actix_web/trait.FromRequest.html), +All supported schemas are actix [Extractors](https://docs.rs/actix-web/2.0.0/actix_web/trait.FromRequest.html), and can be used both in the middlewares and request handlers. ## Supported schemes diff --git a/actix-web-httpauth/src/lib.rs b/actix-web-httpauth/src/lib.rs index 2807fa07d..143cebdef 100644 --- a/actix-web-httpauth/src/lib.rs +++ b/actix-web-httpauth/src/lib.rs @@ -21,7 +21,6 @@ #![deny(rust_2018_idioms)] #![deny(unused)] #![deny(clippy::all)] -#![cfg_attr(feature = "nightly", feature(test))] pub mod extractors; pub mod headers;