Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

update actix dependencies to the latest betas #147

Closed
wants to merge 7 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
25 changes: 8 additions & 17 deletions .github/workflows/msrv.yml
Expand Up @@ -13,7 +13,7 @@ jobs:
fail-fast: false
matrix:
version:
- 1.42.0
- 1.46.0

name: ${{ matrix.version }} - x86_64-unknown-linux-gnu
runs-on: ubuntu-latest
Expand All @@ -35,24 +35,15 @@ jobs:
profile: minimal
override: true

- name: tests (1.40.0)
if: matrix.version == '1.40.0'
- name: tests (1.46.0)
uses: actions-rs/cargo@v1
timeout-minutes: 40
with:
command: test
args: --package=actix-cors
--package=actix-identity
--package=actix-redis
--package=actix-session
--package=actix-web-httpauth
--all-features --no-fail-fast -- --nocapture

- name: tests (1.42.0)
if: matrix.version == '1.42.0'
uses: actions-rs/cargo@v1
timeout-minutes: 40
with:
command: test
args: --package=actix-protobuf
--all-features --no-fail-fast -- --nocapture
--package=actix-identity
--package=actix-protobuf
--package=actix-redis
--package=actix-session
--package=actix-web-httpauth
--all-features --no-fail-fast -- --nocapture
6 changes: 4 additions & 2 deletions README.md
Expand Up @@ -24,9 +24,10 @@ These crates are provided by the community.

| Crate | | |
| ------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------- |
| [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)](https://docs.rs/actix-limitation) [![dependency status](https://deps.rs/crate/actix-limitation/0.1.4/status.svg)](https://deps.rs/crate/actix-limitation/0.1.4) | 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) [![Documentation](https://docs.rs/actix-limitation/badge.svg)](https://docs.rs/actix-limitation) [![dependency status](https://deps.rs/crate/actix-limitation/0.1.4/status.svg)](https://deps.rs/crate/actix-limitation/0.1.4) | Rate limiting using a fixed window counter for arbitrary keys, backed by Redis. |
| [actix-casbin] | [![crates.io](https://img.shields.io/crates/v/actix-casbin?label=latest)](https://crates.io/crates/actix-casbin) [![Documentation](https://docs.rs/actix-casbin/badge.svg)](https://docs.rs/actix-casbin) [![dependency status](https://deps.rs/crate/actix-casbin/0.4.2/status.svg)](https://deps.rs/crate/actix-casbin/0.4.2) | An authorization library that supports access control models like ACL, RBAC & ABAC. |
| [actix-web-static-files] | [![crates.io](https://img.shields.io/crates/v/actix-web-static-files?label=latest)](https://crates.io/crates/actix-web-static-files) [![Documentation](https://docs.rs/actix-web-static-files/badge.svg)](https://docs.rs/actix-web-static-files) [![dependency status](https://deps.rs/crate/actix-web-static-files/3.0.1/status.svg)](https://deps.rs/crate/actix-web-static-files/3.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)](https://crates.io/crates/actix-web-static-files) [![Documentation](https://docs.rs/actix-web-static-files/badge.svg)](https://docs.rs/actix-web-static-files) [![dependency status](https://deps.rs/crate/actix-web-static-files/3.0.1/status.svg)](https://deps.rs/crate/actix-web-static-files/3.0.1) | Static files as embedded resources. |
| [actix-web-grants] | [![crates.io](https://img.shields.io/crates/v/actix-web-grants?label=latest)](https://crates.io/crates/actix-web-grants) [![Documentation](https://docs.rs/actix-web-grants/badge.svg)](https://docs.rs/actix-web-grants) [![dependency status](https://deps.rs/repo/github/DDtKey/actix-web-grants/status.svg)](https://deps.rs/repo/github/DDtKey/actix-web-grants) | Extension for validating user authorities |

To add a crate to this list, submit a pull request.

Expand All @@ -44,3 +45,4 @@ To add a crate to this list, submit a pull request.
[actix-limitation]: https://crates.io/crates/actix-limitation
[actix-casbin]: https://github.com/casbin-rs/actix-casbin
[actix-web-static-files]: https://github.com/kilork/actix-web-static-files
[actix-web-grants]: https://github.com/DDtKey/actix-web-grants
70 changes: 37 additions & 33 deletions actix-cors/CHANGES.md
Expand Up @@ -2,82 +2,86 @@

## Unreleased - 2021-xx-xx


- Update the `actix-web` dependency to 4.0.0-beta.1
- Update the `actix-service` dev dependency to 2.0.0-beta.2
- Update the `actix-rt` dev dependency to 2.0.0-beta.1
- Update the `derive_more` dependency to 0.99.11

## 0.5.4 - 2020-12-31
* Fix `expose_any_header` method, now set the correct field. [#143]

[#143]: https://github.com/actix/actix-extras/pull/143
- Fix `expose_any_header` method, now set the correct field. [#143]

[#143]: https://github.com/actix/actix-extras/pull/143

## 0.5.3 - 2020-11-19
* Fix version spec for `derive_more` dependency.

- Fix version spec for `derive_more` dependency.

## 0.5.2 - 2020-11-15
* Ensure `tinyvec` is using the correct features.
* Bump `futures-util` minimum version to `0.3.7` to avoid `RUSTSEC-2020-0059`.

- Ensure `tinyvec` is using the correct features.
- Bump `futures-util` minimum version to `0.3.7` to avoid `RUSTSEC-2020-0059`.

## 0.5.1 - 2020-11-05
* Fix `allow_any_header` method, now set the correct field. [#121]

[#121]: https://github.com/actix/actix-extras/pull/121
- Fix `allow_any_header` method, now set the correct field. [#121]

[#121]: https://github.com/actix/actix-extras/pull/121

## 0.5.0 - 2020-10-19
* Disallow `*` in `Cors::allowed_origin`. [#114].
* Hide `CorsMiddleware` from docs. [#118].
* `CorsFactory` is removed. [#119]
* The `impl Default` constructor is now overly-restrictive. [#119]
* Added `Cors::permissive()` constructor that allows anything. [#119]
* Adds methods for each property to reset to a permissive state. (`allow_any_origin`,

- Disallow `*` in `Cors::allowed_origin`. [#114].
- Hide `CorsMiddleware` from docs. [#118].
- `CorsFactory` is removed. [#119]
- The `impl Default` constructor is now overly-restrictive. [#119]
- Added `Cors::permissive()` constructor that allows anything. [#119]
- Adds methods for each property to reset to a permissive state. (`allow_any_origin`,
`expose_any_header`, etc.) [#119]
* Errors are now propagated with `Transform::InitError` instead of panicking. [#119]
* Fixes bug where allowed origin functions are not called if `allowed_origins` is All. [#119]
* `AllOrSome` is no longer public. [#119]
* Functions used for `allowed_origin_fn` now receive the Origin HeaderValue as the
- Errors are now propagated with `Transform::InitError` instead of panicking. [#119]
- Fixes bug where allowed origin functions are not called if `allowed_origins` is All. [#119]
- `AllOrSome` is no longer public. [#119]
- Functions used for `allowed_origin_fn` now receive the Origin HeaderValue as the
first parameter. [#120]

[#114]: https://github.com/actix/actix-extras/pull/114
[#118]: https://github.com/actix/actix-extras/pull/118
[#119]: https://github.com/actix/actix-extras/pull/119
[#120]: https://github.com/actix/actix-extras/pull/120


## 0.4.1 - 2020-10-07
* Allow closures to be used with `allowed_origin_fn`. [#110]

[#110]: https://github.com/actix/actix-extras/pull/110
- Allow closures to be used with `allowed_origin_fn`. [#110]

[#110]: https://github.com/actix/actix-extras/pull/110

## 0.4.0 - 2020-09-27
* Implement `allowed_origin_fn` builder method. [#93]
* Use `TryInto` instead of `TryFrom` where applicable. [#106]

- Implement `allowed_origin_fn` builder method. [#93]
- Use `TryInto` instead of `TryFrom` where applicable. [#106]

[#93]: https://github.com/actix/actix-extras/pull/93
[#106]: https://github.com/actix/actix-extras/pull/106


## 0.3.0 - 2020-09-11
* Update `actix-web` dependency to 3.0.0.
* Minimum supported Rust version (MSRV) is now 1.42.0.
* Implement the Debug trait on all public types.

- Update `actix-web` dependency to 3.0.0.
- Minimum supported Rust version (MSRV) is now 1.42.0.
- Implement the Debug trait on all public types.

## 0.3.0-alpha.1 - 2020-03-11
* Minimize `futures-*` dependencies
* Update `actix-web` dependency to 3.0.0-alpha.1

- Minimize `futures-*` dependencies
- Update `actix-web` dependency to 3.0.0-alpha.1

## 0.2.0 - 2019-12-20
* Release

- Release

## 0.2.0-alpha.3 - 2019-12-07
* Migrate to actix-web 2.0.0
* Bump `derive_more` crate version to 0.99.0

- Migrate to actix-web 2.0.0
- Bump `derive_more` crate version to 0.99.0

## 0.1.0 - 2019-06-15
* Move cors middleware to separate crate

- Move cors middleware to separate crate
10 changes: 5 additions & 5 deletions actix-cors/Cargo.toml
Expand Up @@ -19,15 +19,15 @@ name = "actix_cors"
path = "src/lib.rs"

[dependencies]
actix-web = { version = "3.0.0", default-features = false }
derive_more = "0.99.5"
futures-util = { version = "0.3.7", default-features = false }
actix-web = { version = "4.0.0-beta.1", default-features = false }
derive_more = "0.99.11"
futures-util = { version = "0.3.9", default-features = false }
log = "0.4"
once_cell = "1"
tinyvec = { version = "1", features = ["alloc"] }

[dev-dependencies]
actix-service = "1"
actix-rt = "1"
actix-service = "2.0.0-beta.2"
actix-rt = "2.0.0-beta.1"
pretty_env_logger = "0.4"
regex = "1.4"
5 changes: 2 additions & 3 deletions actix-cors/src/builder.rs
Expand Up @@ -483,13 +483,12 @@ impl Default for Cors {
}
}

impl<S, B> Transform<S> for Cors
impl<S, B> Transform<S, ServiceRequest> for Cors
where
S: Service<Request = ServiceRequest, Response = ServiceResponse<B>, Error = Error>,
S: Service<ServiceRequest, Response = ServiceResponse<B>, Error = Error>,
S::Future: 'static,
B: 'static,
{
type Request = ServiceRequest;
type Response = ServiceResponse<B>;
type Error = Error;
type InitError = ();
Expand Down
5 changes: 2 additions & 3 deletions actix-cors/src/middleware.rs
Expand Up @@ -121,13 +121,12 @@ type CorsMiddlewareServiceFuture<B> = Either<
LocalBoxFuture<'static, Result<ServiceResponse<B>, Error>>,
>;

impl<S, B> Service for CorsMiddleware<S>
impl<S, B> Service<ServiceRequest> for CorsMiddleware<S>
where
S: Service<Request = ServiceRequest, Response = ServiceResponse<B>, Error = Error>,
S: Service<ServiceRequest, Response = ServiceResponse<B>, Error = Error>,
S::Future: 'static,
B: 'static,
{
type Request = ServiceRequest;
type Response = ServiceResponse<B>;
type Error = Error;
type Future = CorsMiddlewareServiceFuture<B>;
Expand Down
26 changes: 16 additions & 10 deletions actix-identity/CHANGES.md
@@ -1,34 +1,40 @@
# Changes

## Unreleased - 2020-xx-xx
## Unreleased - 2021-xx-xx

- Update the `actix-web` dependency to 4.0.0-beta.1
- Update the `actix-service` dependency to 2.0.0-beta.2
- Update the `time` dependency to 0.2.23
- Update the `futures-util` dependency to 0.3.9
- Update the `actix-rt` dev dependency to 2.0.0-beta.1
- Update the `actix-http` dev dependency to 3.0.0-beta.1

## 0.3.1 - 2020-09-20
* Add method to set HttpOnly flag on cookie identity. [#102]

- Add method to set HttpOnly flag on cookie identity. [#102]

## 0.3.0 - 2020-09-11
* Update `actix-web` dependency to 3.0.0.
* Minimum supported Rust version (MSRV) is now 1.42.0.

- Update `actix-web` dependency to 3.0.0.
- Minimum supported Rust version (MSRV) is now 1.42.0.

## 0.3.0-alpha.1 - 2020-03-14
* Update the `time` dependency to 0.2.7
* Update the `actix-web` dependency to 3.0.0-alpha.1
* Minimize `futures` dependency

- Update the `time` dependency to 0.2.7
- Update the `actix-web` dependency to 3.0.0-alpha.1
- Minimize `futures` dependency

## 0.2.1 - 2020-01-10
* Fix panic with already borrowed: BorrowMutError #1263

- Fix panic with already borrowed: BorrowMutError #1263

## 0.2.0 - 2019-12-20
* Use actix-web 2.0

- Use actix-web 2.0

## 0.1.0 - 2019-06-xx
* Move identity middleware to separate crate

- Move identity middleware to separate crate

<!-- PR Links -->

Expand Down
12 changes: 6 additions & 6 deletions actix-identity/Cargo.toml
Expand Up @@ -16,13 +16,13 @@ name = "actix_identity"
path = "src/lib.rs"

[dependencies]
actix-web = { version = "3.0.0", default-features = false, features = ["secure-cookies"] }
actix-service = "1.0.6"
futures-util = { version = "0.3.4", default-features = false }
actix-web = { version = "4.0.0-beta.1", default-features = false, features = ["secure-cookies"] }
actix-service = "2.0.0-beta.2"
futures-util = { version = "0.3.9", default-features = false }
serde = "1.0"
serde_json = "1.0"
time = { version = "0.2.7", default-features = false, features = ["std"] }
time = { version = "0.2.23", default-features = false, features = ["std"] }

[dev-dependencies]
actix-rt = "1.1.1"
actix-http = "2.0.0"
actix-rt = "2.0.0-beta.1"
actix-http = "3.0.0-beta.1"
18 changes: 7 additions & 11 deletions actix-identity/src/lib.rs
Expand Up @@ -223,15 +223,13 @@ impl<T> IdentityService<T> {
}
}

impl<S, T, B> Transform<S> for IdentityService<T>
impl<S, T, B> Transform<S, ServiceRequest> for IdentityService<T>
where
S: Service<Request = ServiceRequest, Response = ServiceResponse<B>, Error = Error>
+ 'static,
S: Service<ServiceRequest, Response = ServiceResponse<B>, Error = Error> + 'static,
S::Future: 'static,
T: IdentityPolicy,
B: 'static,
{
type Request = ServiceRequest;
type Response = ServiceResponse<B>;
type Error = Error;
type InitError = ();
Expand Down Expand Up @@ -261,15 +259,13 @@ impl<S, T> Clone for IdentityServiceMiddleware<S, T> {
}
}

impl<S, T, B> Service for IdentityServiceMiddleware<S, T>
impl<S, T, B> Service<ServiceRequest> for IdentityServiceMiddleware<S, T>
where
B: 'static,
S: Service<Request = ServiceRequest, Response = ServiceResponse<B>, Error = Error>
+ 'static,
S: Service<ServiceRequest, Response = ServiceResponse<B>, Error = Error> + 'static,
S::Future: 'static,
T: IdentityPolicy,
{
type Request = ServiceRequest;
type Response = ServiceResponse<B>;
type Error = Error;
type Future = LocalBoxFuture<'static, Result<Self::Response, Self::Error>>;
Expand Down Expand Up @@ -790,7 +786,7 @@ mod tests {
>(
f: F,
) -> impl actix_service::Service<
Request = actix_http::Request,
actix_http::Request,
Response = ServiceResponse<actix_web::body::Body>,
Error = Error,
> {
Expand Down Expand Up @@ -1150,7 +1146,7 @@ mod tests {
backend: Rc::new(Ident),
service: Rc::new(RefCell::new(into_service(
|_: ServiceRequest| async move {
actix_rt::time::delay_for(std::time::Duration::from_secs(100)).await;
actix_rt::time::sleep(std::time::Duration::from_secs(100)).await;
Err::<ServiceResponse, _>(error::ErrorBadRequest("error"))
},
))),
Expand All @@ -1161,7 +1157,7 @@ mod tests {
actix_rt::spawn(async move {
let _ = srv2.call(req).await;
});
actix_rt::time::delay_for(std::time::Duration::from_millis(50)).await;
actix_rt::time::sleep(std::time::Duration::from_millis(50)).await;

let _ = lazy(|cx| srv.poll_ready(cx)).await;
}
Expand Down