diff --git a/actix_cors/enum.CorsError.html b/actix_cors/enum.CorsError.html index 8c0cc968c..ac9784250 100644 --- a/actix_cors/enum.CorsError.html +++ b/actix_cors/enum.CorsError.html @@ -43,7 +43,7 @@

impl<T> ToString for T where
    T: Display + ?Sized
[src]

impl<T> ToString for T where
    T: Display + ?Sized
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

diff --git a/actix_identity/cookie/struct.CookieIdentityPolicy.html b/actix_identity/cookie/struct.CookieIdentityPolicy.html new file mode 100644 index 000000000..df8335c67 --- /dev/null +++ b/actix_identity/cookie/struct.CookieIdentityPolicy.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to ../../actix_identity/struct.CookieIdentityPolicy.html...

+ + + \ No newline at end of file diff --git a/actix_identity/identity/struct.Identity.html b/actix_identity/identity/struct.Identity.html new file mode 100644 index 000000000..e1023e2db --- /dev/null +++ b/actix_identity/identity/struct.Identity.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to ../../actix_identity/struct.Identity.html...

+ + + \ No newline at end of file diff --git a/actix_identity/index.html b/actix_identity/index.html index 2a462ce7c..938c7c343 100644 --- a/actix_identity/index.html +++ b/actix_identity/index.html @@ -1,20 +1,17 @@ -actix_identity - Rust +actix_identity - Rust

Crate actix_identity[][src]

Request identity service for Actix applications.

-

IdentityService middleware can be -used with different policies types to store identity information.

-

By default, only cookie identity policy is implemented. Other backend -implementations can be added separately.

-

CookieIdentityPolicy -uses cookies as identity storage.

-

To access current request identity -Identity extractor should be used.

+ Change settings

Crate actix_identity[][src]

Opinionated request identity service for Actix Web apps.

+

IdentityService middleware can be used with different policies types to store +identity information.

+

A cookie based policy is provided. CookieIdentityPolicy uses cookies as identity storage.

+

To access current request identity, use the Identity extractor.

 use actix_web::*;
 use actix_identity::{Identity, CookieIdentityPolicy, IdentityService};
 
+#[get("/")]
 async fn index(id: Identity) -> String {
     // access request identity
     if let Some(id) = id.identity() {
@@ -24,32 +21,33 @@ uses cookies as identity storage.

} } +#[post("/login")] async fn login(id: Identity) -> HttpResponse { id.remember("User1".to_owned()); // <- remember identity HttpResponse::Ok().finish() } +#[post("/logout")] async fn logout(id: Identity) -> HttpResponse { id.forget(); // <- remove identity HttpResponse::Ok().finish() } -fn main() { - let app = App::new().wrap(IdentityService::new( - // <- create identity middleware - CookieIdentityPolicy::new(&[0; 32]) // <- create cookie identity policy - .name("auth-cookie") - .secure(false))) - .service(web::resource("/index.html").to(index)) - .service(web::resource("/login.html").to(login)) - .service(web::resource("/logout.html").to(logout)); -}
+// create cookie identity backend +let policy = CookieIdentityPolicy::new(&[0; 32]) + .name("auth-cookie") + .secure(false); + +let app = App::new() + // wrap policy into middleware identity middleware + .wrap(IdentityService::new(policy)) + .service(services![index, login, logout]);

Structs

CookieIdentityPolicy

Use cookies for request identity storage.

Identity

The extractor type to obtain your identity from a request.

IdentityService

Request identity middleware

Traits

-
IdentityPolicy

Identity policy definition.

+
IdentityPolicy

Identity policy.

RequestIdentity

Helper trait that allows to get Identity.

\ No newline at end of file diff --git a/actix_identity/middleware/struct.IdentityService.html b/actix_identity/middleware/struct.IdentityService.html new file mode 100644 index 000000000..6c856cc63 --- /dev/null +++ b/actix_identity/middleware/struct.IdentityService.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to ../../actix_identity/struct.IdentityService.html...

+ + + \ No newline at end of file diff --git a/actix_identity/sidebar-items.js b/actix_identity/sidebar-items.js index 422cb1564..2c1058dbd 100644 --- a/actix_identity/sidebar-items.js +++ b/actix_identity/sidebar-items.js @@ -1 +1 @@ -initSidebarItems({"struct":[["CookieIdentityPolicy","Use cookies for request identity storage."],["Identity","The extractor type to obtain your identity from a request."],["IdentityService","Request identity middleware"]],"trait":[["IdentityPolicy","Identity policy definition."],["RequestIdentity","Helper trait that allows to get Identity."]]}); \ No newline at end of file +initSidebarItems({"struct":[["CookieIdentityPolicy","Use cookies for request identity storage."],["Identity","The extractor type to obtain your identity from a request."],["IdentityService","Request identity middleware"]],"trait":[["IdentityPolicy","Identity policy."],["RequestIdentity","Helper trait that allows to get Identity."]]}); \ No newline at end of file diff --git a/actix_identity/struct.CookieIdentityPolicy.html b/actix_identity/struct.CookieIdentityPolicy.html index 1717e0983..647652be6 100644 --- a/actix_identity/struct.CookieIdentityPolicy.html +++ b/actix_identity/struct.CookieIdentityPolicy.html @@ -1,44 +1,53 @@ actix_identity::CookieIdentityPolicy - Rust -

Struct actix_identity::CookieIdentityPolicy[][src]

pub struct CookieIdentityPolicy(_);

Use cookies for request identity storage.

-

The constructors take a key as an argument. -This is the private key for cookie - when this value is changed, -all identities are lost. The constructors will panic if the key is less -than 32 bytes in length.

-

Example

+

Struct actix_identity::CookieIdentityPolicy[][src]

pub struct CookieIdentityPolicy(_);

Use cookies for request identity storage.

+

See this page on MDN for details on cookie attributes.

+

Examples

 use actix_web::App;
 use actix_identity::{CookieIdentityPolicy, IdentityService};
 
-let app = App::new().wrap(IdentityService::new(
-    // <- create identity middleware
-    CookieIdentityPolicy::new(&[0; 32])  // <- construct cookie policy
+// create cookie identity backend
+let policy = CookieIdentityPolicy::new(&[0; 32])
            .domain("www.rust-lang.org")
            .name("actix_auth")
            .path("/")
-           .secure(true),
-));
-

Implementations

impl CookieIdentityPolicy[src]

pub fn new(key: &[u8]) -> CookieIdentityPolicy[src]

Construct new CookieIdentityPolicy instance.

-

Panics if key length is less than 32 bytes.

-

pub fn path<S: Into<String>>(self, value: S) -> CookieIdentityPolicy[src]

Sets the path field in the session cookie being built.

-

pub fn name<S: Into<String>>(self, value: S) -> CookieIdentityPolicy[src]

Sets the name field in the session cookie being built.

-

pub fn domain<S: Into<String>>(self, value: S) -> CookieIdentityPolicy[src]

Sets the domain field in the session cookie being built.

-

pub fn secure(self, value: bool) -> CookieIdentityPolicy[src]

Sets the secure field in the session cookie being built.

-

If the secure field is set, a cookie will only be transmitted when the -connection is secure - i.e. https

-

pub fn max_age(self, seconds: i64) -> CookieIdentityPolicy[src]

Sets the max-age field in the session cookie being built with given number of seconds.

-

pub fn max_age_time(self, value: Duration) -> CookieIdentityPolicy[src]

Sets the max-age field in the session cookie being built with time::Duration.

-

pub fn http_only(self, http_only: bool) -> Self[src]

Sets the http_only field in the session cookie being built.

-

pub fn same_site(self, same_site: SameSite) -> Self[src]

Sets the same_site field in the session cookie being built.

-

pub fn visit_deadline(self, value: Duration) -> CookieIdentityPolicy[src]

Accepts only users whose cookie has been seen before the given deadline

-

By default visit deadline is disabled.

-

pub fn login_deadline(self, value: Duration) -> CookieIdentityPolicy[src]

Accepts only users which has been authenticated before the given deadline

-

By default login deadline is disabled.

-

Trait Implementations

impl IdentityPolicy for CookieIdentityPolicy[src]

type Future = Ready<Result<Option<String>, Error>>

The return type of the middleware

+ .secure(true); + +let app = App::new() + // wrap policy into identity middleware + .wrap(IdentityService::new(policy));
+

Implementations

impl CookieIdentityPolicy[src]

pub fn new(key: &[u8]) -> CookieIdentityPolicy[src]

Create new CookieIdentityPolicy instance.

+

Key argument is the private key for issued cookies. If this value is changed, all issued +cookie identities are invalidated.

+

Panics

+

Panics if key is less than 32 bytes in length..

+

pub fn name(self, value: impl Into<String>) -> CookieIdentityPolicy[src]

Sets the name of issued cookies.

+

pub fn path(self, value: impl Into<String>) -> CookieIdentityPolicy[src]

Sets the Path attribute of issued cookies.

+

pub fn domain(self, value: impl Into<String>) -> CookieIdentityPolicy[src]

Sets the Domain attribute of issued cookies.

+

pub fn secure(self, value: bool) -> CookieIdentityPolicy[src]

Sets the Secure attribute of issued cookies.

+

pub fn max_age(self, value: Duration) -> CookieIdentityPolicy[src]

Sets the Max-Age attribute of issued cookies.

+

pub fn max_age_secs(self, seconds: i64) -> CookieIdentityPolicy[src]

Sets the Max-Age attribute of issued cookies with given number of seconds.

+

pub fn http_only(self, http_only: bool) -> Self[src]

Sets the HttpOnly attribute of issued cookies.

+

By default, the HttpOnly attribute is omitted from issued cookies.

+

pub fn same_site(self, same_site: SameSite) -> Self[src]

Sets the SameSite attribute of issued cookies.

+

By default, the SameSite attribute is omitted from issued cookies.

+

pub fn visit_deadline(self, deadline: Duration) -> CookieIdentityPolicy[src]

Accepts only users who have visited within given deadline.

+

In other words, invalidate a login after some amount of inactivity. Using this feature +causes updated cookies to be issued on each response in order to record the user’s last +visitation timestamp.

+

By default, visit deadline is disabled.

+

pub fn login_deadline(self, deadline: Duration) -> CookieIdentityPolicy[src]

Accepts only users who authenticated within the given deadline.

+

In other words, invalidate a login after some amount of time, regardless of activity. +While Max-Age is useful in constraining the cookie +lifetime, it could be extended manually; using this feature encodes the deadline directly +into the issued cookies, making it immutable to users.

+

By default, login deadline is disabled.

+

Trait Implementations

impl IdentityPolicy for CookieIdentityPolicy[src]

type Future = Ready<Result<Option<String>, Error>>

The return type of the middleware

type ResponseFuture = Ready<Result<(), Error>>

The return type of the middleware

-

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Same<T> for T

type Output = T

Should always be Self

-

impl<T> ToString for T where
    T: Display + ?Sized
[src]

impl<T> ToString for T where
    T: Display + ?Sized
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

diff --git a/actix_protobuf/struct.ProtoBuf.html b/actix_protobuf/struct.ProtoBuf.html index b792913c2..4d595365a 100644 --- a/actix_protobuf/struct.ProtoBuf.html +++ b/actix_protobuf/struct.ProtoBuf.html @@ -25,7 +25,7 @@ Instrumented wrapper. Read more

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Same<T> for T

type Output = T

Should always be Self

-

impl<T> ToString for T where
    T: Display + ?Sized
[src]

impl<T> ToString for T where
    T: Display + ?Sized
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

diff --git a/actix_redis/enum.Error.html b/actix_redis/enum.Error.html index 4619ecea2..55ea2c879 100644 --- a/actix_redis/enum.Error.html +++ b/actix_redis/enum.Error.html @@ -29,7 +29,7 @@ Instrumented wrapper. Read more

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Same<T> for T

type Output = T

Should always be Self

-

impl<T> ToString for T where
    T: Display + ?Sized
[src]

impl<T> ToString for T where
    T: Display + ?Sized
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

diff --git a/actix_redis/enum.RespError.html b/actix_redis/enum.RespError.html index d436bcb62..c6fad0b12 100644 --- a/actix_redis/enum.RespError.html +++ b/actix_redis/enum.RespError.html @@ -21,8 +21,8 @@ chains of futures; but it occurring at runtime should be considered a catastroph failure.

If any error is propagated this way that needs to be handled, then it should be made into a proper option.

-

Trait Implementations

impl Debug for Error

impl Display for Error

Trait Implementations

impl Debug for Error

impl Display for Error

impl Error for Error

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Same<T> for T

type Output = T

Should always be Self

-

impl<T> ToString for T where
    T: Display + ?Sized
[src]

impl<T> ToString for T where
    T: Display + ?Sized
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

diff --git a/actix_redis/enum.RespValue.html b/actix_redis/enum.RespValue.html index b1f3e9167..9c9e3c6d3 100644 --- a/actix_redis/enum.RespValue.html +++ b/actix_redis/enum.RespValue.html @@ -28,12 +28,12 @@ arguments, e.g. RPUSH

impl Debug for RespValue

impl Eq for RespValue

impl<'a> From<&'a [u8]> for RespValue

impl<'a> From<&'a String> for RespValue

impl<'a> From<&'a String> for RespValue

impl<'a> From<&'a str> for RespValue

impl<'a> From<Arc<str>> for RespValue

impl<'a> From<String> for RespValue

impl<'a> From<Vec<u8, Global>> for RespValue

impl<'a> From<usize> for RespValue

impl<'a> From<String> for RespValue

impl<'a> From<Vec<u8, Global>> for RespValue

impl<'a> From<usize> for RespValue

impl FromResp for RespValue

impl PartialEq<RespValue> for RespValue

Trait Implementations

impl Clone for SameSite[src]

impl Copy for SameSite[src]

impl Debug for SameSite[src]

impl Display for SameSite[src]

impl Copy for SameSite[src]

impl Debug for SameSite[src]

impl Display for SameSite[src]

impl Eq for SameSite[src]

impl Hash for SameSite[src]

impl PartialEq<SameSite> for SameSite[src]

impl<T> ToString for T where
    T: Display + ?Sized
[src]

impl<T> ToString for T where
    T: Display + ?Sized
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

diff --git a/actix_session/struct.Session.html b/actix_session/struct.Session.html index 9154b9718..5def28dbe 100644 --- a/actix_session/struct.Session.html +++ b/actix_session/struct.Session.html @@ -19,8 +19,8 @@ implemented for HttpRequest, ServiceRequest, and Ok("Welcome!") }
-

Implementations

impl Session[src]

pub fn get<T: DeserializeOwned>(&self, key: &str) -> Result<Option<T>, Error>[src]

Get a value from the session.

-

pub fn set<T: Serialize>(&self, key: &str, value: T) -> Result<(), Error>[src]

Set a value from the session.

+

Implementations

impl Session[src]

pub fn get<T: DeserializeOwned>(&self, key: &str) -> Result<Option<T>, Error>[src]

Get a value from the session.

+

pub fn set<T: Serialize>(&self, key: &str, value: T) -> Result<(), Error>[src]

Set a value from the session.

pub fn remove(&self, key: &str)[src]

Remove value from the session.

pub fn clear(&self)[src]

Clear the session.

pub fn purge(&self)[src]

Removes session, both client and server side.

diff --git a/actix_web_httpauth/extractors/bearer/enum.Error.html b/actix_web_httpauth/extractors/bearer/enum.Error.html index 06282b0b9..25159a135 100644 --- a/actix_web_httpauth/extractors/bearer/enum.Error.html +++ b/actix_web_httpauth/extractors/bearer/enum.Error.html @@ -52,7 +52,7 @@ operator. to_owned(&self) -> T[src]

impl<T> ToString for T where
    T: Display + ?Sized
[src]

impl<T> ToString for T where
    T: Display + ?Sized
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

diff --git a/actix_web_httpauth/extractors/struct.AuthenticationError.html b/actix_web_httpauth/extractors/struct.AuthenticationError.html index 56864793a..52bca53eb 100644 --- a/actix_web_httpauth/extractors/struct.AuthenticationError.html +++ b/actix_web_httpauth/extractors/struct.AuthenticationError.html @@ -36,7 +36,7 @@ this lib tries to stick to the RFC, so it might be unreasonable.

Instrumented wrapper. Read more

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Same<T> for T

type Output = T

Should always be Self

-

impl<T> ToString for T where
    T: Display + ?Sized
[src]

impl<T> ToString for T where
    T: Display + ?Sized
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

diff --git a/actix_web_httpauth/headers/authorization/enum.ParseError.html b/actix_web_httpauth/headers/authorization/enum.ParseError.html index 97e1b72c0..2e2a196e0 100644 --- a/actix_web_httpauth/headers/authorization/enum.ParseError.html +++ b/actix_web_httpauth/headers/authorization/enum.ParseError.html @@ -38,7 +38,7 @@ your own authentication scheme.

Instrumented wrapper. Read more

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Same<T> for T

type Output = T

Should always be Self

-

impl<T> ToString for T where
    T: Display + ?Sized
[src]

impl<T> ToString for T where
    T: Display + ?Sized
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

diff --git a/actix_web_httpauth/headers/authorization/struct.Authorization.html b/actix_web_httpauth/headers/authorization/struct.Authorization.html index 99881b176..99f71064e 100644 --- a/actix_web_httpauth/headers/authorization/struct.Authorization.html +++ b/actix_web_httpauth/headers/authorization/struct.Authorization.html @@ -62,7 +62,7 @@ operator. to_owned(&self) -> T[src]

impl<T> ToString for T where
    T: Display + ?Sized
[src]

impl<T> ToString for T where
    T: Display + ?Sized
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

diff --git a/actix_web_httpauth/headers/authorization/struct.Basic.html b/actix_web_httpauth/headers/authorization/struct.Basic.html index 4e4676fdd..d5f8f5615 100644 --- a/actix_web_httpauth/headers/authorization/struct.Basic.html +++ b/actix_web_httpauth/headers/authorization/struct.Basic.html @@ -45,7 +45,7 @@ operator. to_owned(&self) -> T[src]

impl<T> ToString for T where
    T: Display + ?Sized
[src]

impl<T> ToString for T where
    T: Display + ?Sized
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

diff --git a/actix_web_httpauth/headers/authorization/struct.Bearer.html b/actix_web_httpauth/headers/authorization/struct.Bearer.html index 1276ac124..0bad31fc6 100644 --- a/actix_web_httpauth/headers/authorization/struct.Bearer.html +++ b/actix_web_httpauth/headers/authorization/struct.Bearer.html @@ -45,7 +45,7 @@ operator. to_owned(&self) -> T[src]

impl<T> ToString for T where
    T: Display + ?Sized
[src]

impl<T> ToString for T where
    T: Display + ?Sized
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

diff --git a/actix_web_httpauth/headers/www_authenticate/basic/struct.Basic.html b/actix_web_httpauth/headers/www_authenticate/basic/struct.Basic.html index 1f70f989e..73dbb7a5f 100644 --- a/actix_web_httpauth/headers/www_authenticate/basic/struct.Basic.html +++ b/actix_web_httpauth/headers/www_authenticate/basic/struct.Basic.html @@ -66,7 +66,7 @@ operator. to_owned(&self) -> T[src]

impl<T> ToString for T where
    T: Display + ?Sized
[src]

impl<T> ToString for T where
    T: Display + ?Sized
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

diff --git a/actix_web_httpauth/headers/www_authenticate/bearer/enum.Error.html b/actix_web_httpauth/headers/www_authenticate/bearer/enum.Error.html index 20a857a7f..653fecdb8 100644 --- a/actix_web_httpauth/headers/www_authenticate/bearer/enum.Error.html +++ b/actix_web_httpauth/headers/www_authenticate/bearer/enum.Error.html @@ -52,7 +52,7 @@ operator. to_owned(&self) -> T[src]

impl<T> ToString for T where
    T: Display + ?Sized
[src]

impl<T> ToString for T where
    T: Display + ?Sized
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

diff --git a/actix_web_httpauth/headers/www_authenticate/bearer/struct.Bearer.html b/actix_web_httpauth/headers/www_authenticate/bearer/struct.Bearer.html index ccaa131e3..3704b65cf 100644 --- a/actix_web_httpauth/headers/www_authenticate/bearer/struct.Bearer.html +++ b/actix_web_httpauth/headers/www_authenticate/bearer/struct.Bearer.html @@ -69,7 +69,7 @@ operator. to_owned(&self) -> T[src]

impl<T> ToString for T where
    T: Display + ?Sized
[src]

impl<T> ToString for T where
    T: Display + ?Sized
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

diff --git a/implementors/actix_service/transform/trait.Transform.js b/implementors/actix_service/transform/trait.Transform.js index 6e0be361a..59a567e00 100644 --- a/implementors/actix_service/transform/trait.Transform.js +++ b/implementors/actix_service/transform/trait.Transform.js @@ -1,6 +1,6 @@ (function() {var implementors = {}; implementors["actix_cors"] = [{"text":"impl<S, B> Transform<S, ServiceRequest> for Cors where
    S: Service<ServiceRequest, Response = ServiceResponse<B>, Error = Error>,
    S::Future: 'static,
    B: 'static, 
","synthetic":false,"types":["actix_cors::builder::Cors"]}]; -implementors["actix_identity"] = [{"text":"impl<S, T, B> Transform<S, ServiceRequest> for IdentityService<T> where
    S: Service<ServiceRequest, Response = ServiceResponse<B>, Error = Error> + 'static,
    S::Future: 'static,
    T: IdentityPolicy,
    B: 'static, 
","synthetic":false,"types":["actix_identity::IdentityService"]}]; +implementors["actix_identity"] = [{"text":"impl<S, T, B> Transform<S, ServiceRequest> for IdentityService<T> where
    S: Service<ServiceRequest, Response = ServiceResponse<B>, Error = Error> + 'static,
    S::Future: 'static,
    T: IdentityPolicy,
    B: 'static, 
","synthetic":false,"types":["actix_identity::middleware::IdentityService"]}]; implementors["actix_redis"] = [{"text":"impl<S, B> Transform<S, ServiceRequest> for RedisSession where
    S: Service<ServiceRequest, Response = ServiceResponse<B>, Error = Error> + 'static,
    S::Future: 'static,
    B: 'static, 
","synthetic":false,"types":["actix_redis::session::RedisSession"]}]; implementors["actix_session"] = [{"text":"impl<S, B: 'static> Transform<S, ServiceRequest> for CookieSession where
    S: Service<ServiceRequest, Response = ServiceResponse<B>>,
    S::Future: 'static,
    S::Error: 'static, 
","synthetic":false,"types":["actix_session::cookie::CookieSession"]}]; implementors["actix_web_httpauth"] = [{"text":"impl<S, B, T, F, O> Transform<S, ServiceRequest> for HttpAuthentication<T, F> where
    S: Service<ServiceRequest, Response = ServiceResponse<B>, Error = Error> + 'static,
    S::Future: 'static,
    F: Fn(ServiceRequest, T) -> O + 'static,
    O: Future<Output = Result<ServiceRequest, Error>> + 'static,
    T: AuthExtractor + 'static, 
","synthetic":false,"types":["actix_web_httpauth::middleware::HttpAuthentication"]}]; diff --git a/implementors/actix_web/extract/trait.FromRequest.js b/implementors/actix_web/extract/trait.FromRequest.js index 23c8e9fb5..b0c788395 100644 --- a/implementors/actix_web/extract/trait.FromRequest.js +++ b/implementors/actix_web/extract/trait.FromRequest.js @@ -1,5 +1,5 @@ (function() {var implementors = {}; -implementors["actix_identity"] = [{"text":"impl FromRequest for Identity","synthetic":false,"types":["actix_identity::Identity"]}]; +implementors["actix_identity"] = [{"text":"impl FromRequest for Identity","synthetic":false,"types":["actix_identity::identity::Identity"]}]; implementors["actix_protobuf"] = [{"text":"impl<T> FromRequest for ProtoBuf<T> where
    T: Message + Default + 'static, 
","synthetic":false,"types":["actix_protobuf::ProtoBuf"]}]; implementors["actix_session"] = [{"text":"impl FromRequest for Session","synthetic":false,"types":["actix_session::Session"]}]; implementors["actix_web_httpauth"] = [{"text":"impl FromRequest for BasicAuth","synthetic":false,"types":["actix_web_httpauth::extractors::basic::BasicAuth"]},{"text":"impl FromRequest for BearerAuth","synthetic":false,"types":["actix_web_httpauth::extractors::bearer::BearerAuth"]}]; diff --git a/implementors/core/clone/trait.Clone.js b/implementors/core/clone/trait.Clone.js index 22cd79f42..0b165475d 100644 --- a/implementors/core/clone/trait.Clone.js +++ b/implementors/core/clone/trait.Clone.js @@ -1,6 +1,6 @@ (function() {var implementors = {}; implementors["actix_cors"] = [{"text":"impl Clone for CorsError","synthetic":false,"types":["actix_cors::error::CorsError"]}]; -implementors["actix_identity"] = [{"text":"impl Clone for Identity","synthetic":false,"types":["actix_identity::Identity"]}]; +implementors["actix_identity"] = [{"text":"impl Clone for Identity","synthetic":false,"types":["actix_identity::identity::Identity"]}]; implementors["actix_session"] = [{"text":"impl Clone for SessionStatus","synthetic":false,"types":["actix_session::SessionStatus"]}]; implementors["actix_web_httpauth"] = [{"text":"impl Clone for Config","synthetic":false,"types":["actix_web_httpauth::extractors::basic::Config"]},{"text":"impl Clone for BasicAuth","synthetic":false,"types":["actix_web_httpauth::extractors::basic::BasicAuth"]},{"text":"impl Clone for Config","synthetic":false,"types":["actix_web_httpauth::extractors::bearer::Config"]},{"text":"impl Clone for BearerAuth","synthetic":false,"types":["actix_web_httpauth::extractors::bearer::BearerAuth"]},{"text":"impl<S: Clone + Scheme> Clone for Authorization<S>","synthetic":false,"types":["actix_web_httpauth::headers::authorization::header::Authorization"]},{"text":"impl Clone for Basic","synthetic":false,"types":["actix_web_httpauth::headers::authorization::scheme::basic::Basic"]},{"text":"impl Clone for Bearer","synthetic":false,"types":["actix_web_httpauth::headers::authorization::scheme::bearer::Bearer"]},{"text":"impl Clone for Basic","synthetic":false,"types":["actix_web_httpauth::headers::www_authenticate::challenge::basic::Basic"]},{"text":"impl Clone for Bearer","synthetic":false,"types":["actix_web_httpauth::headers::www_authenticate::challenge::bearer::challenge::Bearer"]},{"text":"impl Clone for Error","synthetic":false,"types":["actix_web_httpauth::headers::www_authenticate::challenge::bearer::errors::Error"]},{"text":"impl<C: Clone + Challenge> Clone for WwwAuthenticate<C>","synthetic":false,"types":["actix_web_httpauth::headers::www_authenticate::header::WwwAuthenticate"]},{"text":"impl<T: Clone, F: Clone> Clone for HttpAuthentication<T, F> where
    T: AuthExtractor
","synthetic":false,"types":["actix_web_httpauth::middleware::HttpAuthentication"]}]; implementors["prost_example"] = [{"text":"impl Clone for MyObj","synthetic":false,"types":["prost_example::MyObj"]}]; diff --git a/implementors/core/marker/trait.Freeze.js b/implementors/core/marker/trait.Freeze.js index d6fcb4af1..dad323739 100644 --- a/implementors/core/marker/trait.Freeze.js +++ b/implementors/core/marker/trait.Freeze.js @@ -1,6 +1,6 @@ (function() {var implementors = {}; implementors["actix_cors"] = [{"text":"impl Freeze for Cors","synthetic":true,"types":["actix_cors::builder::Cors"]},{"text":"impl Freeze for CorsError","synthetic":true,"types":["actix_cors::error::CorsError"]}]; -implementors["actix_identity"] = [{"text":"impl Freeze for Identity","synthetic":true,"types":["actix_identity::Identity"]},{"text":"impl<T> Freeze for IdentityService<T>","synthetic":true,"types":["actix_identity::IdentityService"]},{"text":"impl Freeze for CookieIdentityPolicy","synthetic":true,"types":["actix_identity::CookieIdentityPolicy"]}]; +implementors["actix_identity"] = [{"text":"impl Freeze for CookieIdentityPolicy","synthetic":true,"types":["actix_identity::cookie::CookieIdentityPolicy"]},{"text":"impl Freeze for Identity","synthetic":true,"types":["actix_identity::identity::Identity"]},{"text":"impl<T> Freeze for IdentityService<T>","synthetic":true,"types":["actix_identity::middleware::IdentityService"]}]; implementors["actix_protobuf"] = [{"text":"impl Freeze for ProtoBufPayloadError","synthetic":true,"types":["actix_protobuf::ProtoBufPayloadError"]},{"text":"impl<T> Freeze for ProtoBuf<T> where
    T: Freeze, 
","synthetic":true,"types":["actix_protobuf::ProtoBuf"]},{"text":"impl Freeze for ProtoBufConfig","synthetic":true,"types":["actix_protobuf::ProtoBufConfig"]},{"text":"impl<T> Freeze for ProtoBufMessage<T>","synthetic":true,"types":["actix_protobuf::ProtoBufMessage"]}]; implementors["actix_redis"] = [{"text":"impl Freeze for Command","synthetic":true,"types":["actix_redis::redis::Command"]},{"text":"impl Freeze for RedisActor","synthetic":true,"types":["actix_redis::redis::RedisActor"]},{"text":"impl Freeze for RedisSession","synthetic":true,"types":["actix_redis::session::RedisSession"]},{"text":"impl Freeze for Error","synthetic":true,"types":["actix_redis::Error"]}]; implementors["actix_session"] = [{"text":"impl Freeze for CookieSession","synthetic":true,"types":["actix_session::cookie::CookieSession"]},{"text":"impl Freeze for Session","synthetic":true,"types":["actix_session::Session"]},{"text":"impl Freeze for SessionStatus","synthetic":true,"types":["actix_session::SessionStatus"]}]; diff --git a/implementors/core/marker/trait.Send.js b/implementors/core/marker/trait.Send.js index 3e973c8e7..16e58e02e 100644 --- a/implementors/core/marker/trait.Send.js +++ b/implementors/core/marker/trait.Send.js @@ -1,6 +1,6 @@ (function() {var implementors = {}; implementors["actix_cors"] = [{"text":"impl !Send for Cors","synthetic":true,"types":["actix_cors::builder::Cors"]},{"text":"impl Send for CorsError","synthetic":true,"types":["actix_cors::error::CorsError"]}]; -implementors["actix_identity"] = [{"text":"impl !Send for Identity","synthetic":true,"types":["actix_identity::Identity"]},{"text":"impl<T> !Send for IdentityService<T>","synthetic":true,"types":["actix_identity::IdentityService"]},{"text":"impl !Send for CookieIdentityPolicy","synthetic":true,"types":["actix_identity::CookieIdentityPolicy"]}]; +implementors["actix_identity"] = [{"text":"impl !Send for CookieIdentityPolicy","synthetic":true,"types":["actix_identity::cookie::CookieIdentityPolicy"]},{"text":"impl !Send for Identity","synthetic":true,"types":["actix_identity::identity::Identity"]},{"text":"impl<T> !Send for IdentityService<T>","synthetic":true,"types":["actix_identity::middleware::IdentityService"]}]; implementors["actix_protobuf"] = [{"text":"impl Send for ProtoBufPayloadError","synthetic":true,"types":["actix_protobuf::ProtoBufPayloadError"]},{"text":"impl<T> Send for ProtoBuf<T>","synthetic":true,"types":["actix_protobuf::ProtoBuf"]},{"text":"impl Send for ProtoBufConfig","synthetic":true,"types":["actix_protobuf::ProtoBufConfig"]},{"text":"impl<T> !Send for ProtoBufMessage<T>","synthetic":true,"types":["actix_protobuf::ProtoBufMessage"]}]; implementors["actix_redis"] = [{"text":"impl Send for Command","synthetic":true,"types":["actix_redis::redis::Command"]},{"text":"impl !Send for RedisActor","synthetic":true,"types":["actix_redis::redis::RedisActor"]},{"text":"impl !Send for RedisSession","synthetic":true,"types":["actix_redis::session::RedisSession"]},{"text":"impl Send for Error","synthetic":true,"types":["actix_redis::Error"]}]; implementors["actix_session"] = [{"text":"impl !Send for CookieSession","synthetic":true,"types":["actix_session::cookie::CookieSession"]},{"text":"impl !Send for Session","synthetic":true,"types":["actix_session::Session"]},{"text":"impl Send for SessionStatus","synthetic":true,"types":["actix_session::SessionStatus"]}]; diff --git a/implementors/core/marker/trait.Sync.js b/implementors/core/marker/trait.Sync.js index 04ddf5612..a8b75270d 100644 --- a/implementors/core/marker/trait.Sync.js +++ b/implementors/core/marker/trait.Sync.js @@ -1,6 +1,6 @@ (function() {var implementors = {}; implementors["actix_cors"] = [{"text":"impl !Sync for Cors","synthetic":true,"types":["actix_cors::builder::Cors"]},{"text":"impl Sync for CorsError","synthetic":true,"types":["actix_cors::error::CorsError"]}]; -implementors["actix_identity"] = [{"text":"impl !Sync for Identity","synthetic":true,"types":["actix_identity::Identity"]},{"text":"impl<T> !Sync for IdentityService<T>","synthetic":true,"types":["actix_identity::IdentityService"]},{"text":"impl !Sync for CookieIdentityPolicy","synthetic":true,"types":["actix_identity::CookieIdentityPolicy"]}]; +implementors["actix_identity"] = [{"text":"impl !Sync for CookieIdentityPolicy","synthetic":true,"types":["actix_identity::cookie::CookieIdentityPolicy"]},{"text":"impl !Sync for Identity","synthetic":true,"types":["actix_identity::identity::Identity"]},{"text":"impl<T> !Sync for IdentityService<T>","synthetic":true,"types":["actix_identity::middleware::IdentityService"]}]; implementors["actix_protobuf"] = [{"text":"impl Sync for ProtoBufPayloadError","synthetic":true,"types":["actix_protobuf::ProtoBufPayloadError"]},{"text":"impl<T> Sync for ProtoBuf<T>","synthetic":true,"types":["actix_protobuf::ProtoBuf"]},{"text":"impl Sync for ProtoBufConfig","synthetic":true,"types":["actix_protobuf::ProtoBufConfig"]},{"text":"impl<T> !Sync for ProtoBufMessage<T>","synthetic":true,"types":["actix_protobuf::ProtoBufMessage"]}]; implementors["actix_redis"] = [{"text":"impl Sync for Command","synthetic":true,"types":["actix_redis::redis::Command"]},{"text":"impl !Sync for RedisActor","synthetic":true,"types":["actix_redis::redis::RedisActor"]},{"text":"impl !Sync for RedisSession","synthetic":true,"types":["actix_redis::session::RedisSession"]},{"text":"impl Sync for Error","synthetic":true,"types":["actix_redis::Error"]}]; implementors["actix_session"] = [{"text":"impl !Sync for CookieSession","synthetic":true,"types":["actix_session::cookie::CookieSession"]},{"text":"impl !Sync for Session","synthetic":true,"types":["actix_session::Session"]},{"text":"impl Sync for SessionStatus","synthetic":true,"types":["actix_session::SessionStatus"]}]; diff --git a/implementors/core/marker/trait.Unpin.js b/implementors/core/marker/trait.Unpin.js index 548159339..1296419f3 100644 --- a/implementors/core/marker/trait.Unpin.js +++ b/implementors/core/marker/trait.Unpin.js @@ -1,6 +1,6 @@ (function() {var implementors = {}; implementors["actix_cors"] = [{"text":"impl Unpin for Cors","synthetic":true,"types":["actix_cors::builder::Cors"]},{"text":"impl Unpin for CorsError","synthetic":true,"types":["actix_cors::error::CorsError"]}]; -implementors["actix_identity"] = [{"text":"impl Unpin for Identity","synthetic":true,"types":["actix_identity::Identity"]},{"text":"impl<T> Unpin for IdentityService<T>","synthetic":true,"types":["actix_identity::IdentityService"]},{"text":"impl Unpin for CookieIdentityPolicy","synthetic":true,"types":["actix_identity::CookieIdentityPolicy"]}]; +implementors["actix_identity"] = [{"text":"impl Unpin for CookieIdentityPolicy","synthetic":true,"types":["actix_identity::cookie::CookieIdentityPolicy"]},{"text":"impl Unpin for Identity","synthetic":true,"types":["actix_identity::identity::Identity"]},{"text":"impl<T> Unpin for IdentityService<T>","synthetic":true,"types":["actix_identity::middleware::IdentityService"]}]; implementors["actix_protobuf"] = [{"text":"impl Unpin for ProtoBufPayloadError","synthetic":true,"types":["actix_protobuf::ProtoBufPayloadError"]},{"text":"impl<T> Unpin for ProtoBuf<T> where
    T: Unpin
","synthetic":true,"types":["actix_protobuf::ProtoBuf"]},{"text":"impl Unpin for ProtoBufConfig","synthetic":true,"types":["actix_protobuf::ProtoBufConfig"]},{"text":"impl<T> Unpin for ProtoBufMessage<T>","synthetic":true,"types":["actix_protobuf::ProtoBufMessage"]}]; implementors["actix_redis"] = [{"text":"impl Unpin for Command","synthetic":true,"types":["actix_redis::redis::Command"]},{"text":"impl Unpin for RedisActor","synthetic":true,"types":["actix_redis::redis::RedisActor"]},{"text":"impl Unpin for RedisSession","synthetic":true,"types":["actix_redis::session::RedisSession"]},{"text":"impl Unpin for Error","synthetic":true,"types":["actix_redis::Error"]}]; implementors["actix_session"] = [{"text":"impl Unpin for CookieSession","synthetic":true,"types":["actix_session::cookie::CookieSession"]},{"text":"impl Unpin for Session","synthetic":true,"types":["actix_session::Session"]},{"text":"impl Unpin for SessionStatus","synthetic":true,"types":["actix_session::SessionStatus"]}]; diff --git a/implementors/std/panic/trait.RefUnwindSafe.js b/implementors/std/panic/trait.RefUnwindSafe.js index 03a82ab02..dca140481 100644 --- a/implementors/std/panic/trait.RefUnwindSafe.js +++ b/implementors/std/panic/trait.RefUnwindSafe.js @@ -1,6 +1,6 @@ (function() {var implementors = {}; implementors["actix_cors"] = [{"text":"impl !RefUnwindSafe for Cors","synthetic":true,"types":["actix_cors::builder::Cors"]},{"text":"impl RefUnwindSafe for CorsError","synthetic":true,"types":["actix_cors::error::CorsError"]}]; -implementors["actix_identity"] = [{"text":"impl !RefUnwindSafe for Identity","synthetic":true,"types":["actix_identity::Identity"]},{"text":"impl<T> !RefUnwindSafe for IdentityService<T>","synthetic":true,"types":["actix_identity::IdentityService"]},{"text":"impl !RefUnwindSafe for CookieIdentityPolicy","synthetic":true,"types":["actix_identity::CookieIdentityPolicy"]}]; +implementors["actix_identity"] = [{"text":"impl !RefUnwindSafe for CookieIdentityPolicy","synthetic":true,"types":["actix_identity::cookie::CookieIdentityPolicy"]},{"text":"impl !RefUnwindSafe for Identity","synthetic":true,"types":["actix_identity::identity::Identity"]},{"text":"impl<T> !RefUnwindSafe for IdentityService<T>","synthetic":true,"types":["actix_identity::middleware::IdentityService"]}]; implementors["actix_protobuf"] = [{"text":"impl !RefUnwindSafe for ProtoBufPayloadError","synthetic":true,"types":["actix_protobuf::ProtoBufPayloadError"]},{"text":"impl<T> RefUnwindSafe for ProtoBuf<T> where
    T: RefUnwindSafe
","synthetic":true,"types":["actix_protobuf::ProtoBuf"]},{"text":"impl RefUnwindSafe for ProtoBufConfig","synthetic":true,"types":["actix_protobuf::ProtoBufConfig"]},{"text":"impl<T> !RefUnwindSafe for ProtoBufMessage<T>","synthetic":true,"types":["actix_protobuf::ProtoBufMessage"]}]; implementors["actix_redis"] = [{"text":"impl RefUnwindSafe for Command","synthetic":true,"types":["actix_redis::redis::Command"]},{"text":"impl !RefUnwindSafe for RedisActor","synthetic":true,"types":["actix_redis::redis::RedisActor"]},{"text":"impl !RefUnwindSafe for RedisSession","synthetic":true,"types":["actix_redis::session::RedisSession"]},{"text":"impl !RefUnwindSafe for Error","synthetic":true,"types":["actix_redis::Error"]}]; implementors["actix_session"] = [{"text":"impl !RefUnwindSafe for CookieSession","synthetic":true,"types":["actix_session::cookie::CookieSession"]},{"text":"impl !RefUnwindSafe for Session","synthetic":true,"types":["actix_session::Session"]},{"text":"impl RefUnwindSafe for SessionStatus","synthetic":true,"types":["actix_session::SessionStatus"]}]; diff --git a/implementors/std/panic/trait.UnwindSafe.js b/implementors/std/panic/trait.UnwindSafe.js index 2edf38f13..f6bc7ea41 100644 --- a/implementors/std/panic/trait.UnwindSafe.js +++ b/implementors/std/panic/trait.UnwindSafe.js @@ -1,6 +1,6 @@ (function() {var implementors = {}; implementors["actix_cors"] = [{"text":"impl !UnwindSafe for Cors","synthetic":true,"types":["actix_cors::builder::Cors"]},{"text":"impl UnwindSafe for CorsError","synthetic":true,"types":["actix_cors::error::CorsError"]}]; -implementors["actix_identity"] = [{"text":"impl !UnwindSafe for Identity","synthetic":true,"types":["actix_identity::Identity"]},{"text":"impl<T> UnwindSafe for IdentityService<T> where
    T: RefUnwindSafe
","synthetic":true,"types":["actix_identity::IdentityService"]},{"text":"impl UnwindSafe for CookieIdentityPolicy","synthetic":true,"types":["actix_identity::CookieIdentityPolicy"]}]; +implementors["actix_identity"] = [{"text":"impl UnwindSafe for CookieIdentityPolicy","synthetic":true,"types":["actix_identity::cookie::CookieIdentityPolicy"]},{"text":"impl !UnwindSafe for Identity","synthetic":true,"types":["actix_identity::identity::Identity"]},{"text":"impl<T> UnwindSafe for IdentityService<T> where
    T: RefUnwindSafe
","synthetic":true,"types":["actix_identity::middleware::IdentityService"]}]; implementors["actix_protobuf"] = [{"text":"impl !UnwindSafe for ProtoBufPayloadError","synthetic":true,"types":["actix_protobuf::ProtoBufPayloadError"]},{"text":"impl<T> UnwindSafe for ProtoBuf<T> where
    T: UnwindSafe
","synthetic":true,"types":["actix_protobuf::ProtoBuf"]},{"text":"impl UnwindSafe for ProtoBufConfig","synthetic":true,"types":["actix_protobuf::ProtoBufConfig"]},{"text":"impl<T> !UnwindSafe for ProtoBufMessage<T>","synthetic":true,"types":["actix_protobuf::ProtoBufMessage"]}]; implementors["actix_redis"] = [{"text":"impl UnwindSafe for Command","synthetic":true,"types":["actix_redis::redis::Command"]},{"text":"impl !UnwindSafe for RedisActor","synthetic":true,"types":["actix_redis::redis::RedisActor"]},{"text":"impl !UnwindSafe for RedisSession","synthetic":true,"types":["actix_redis::session::RedisSession"]},{"text":"impl !UnwindSafe for Error","synthetic":true,"types":["actix_redis::Error"]}]; implementors["actix_session"] = [{"text":"impl UnwindSafe for CookieSession","synthetic":true,"types":["actix_session::cookie::CookieSession"]},{"text":"impl !UnwindSafe for Session","synthetic":true,"types":["actix_session::Session"]},{"text":"impl UnwindSafe for SessionStatus","synthetic":true,"types":["actix_session::SessionStatus"]}]; diff --git a/search-index.js b/search-index.js index a5961e892..0d3541d80 100644 --- a/search-index.js +++ b/search-index.js @@ -1,10 +1,10 @@ var searchIndex = JSON.parse('{\ "actix_cors":{"doc":"Cross-Origin Resource Sharing (CORS) controls for Actix …","t":[3,4,13,13,13,13,13,13,13,13,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11],"n":["Cors","CorsError","WildcardOrigin","MissingOrigin","MissingRequestMethod","BadRequestMethod","BadRequestHeaders","OriginNotAllowed","MethodNotAllowed","HeadersNotAllowed","from","into","borrow","borrow_mut","try_from","try_into","type_id","vzip","from","into","to_owned","clone_into","to_string","borrow","borrow_mut","try_from","try_into","type_id","vzip","clone","default","fmt","fmt","fmt","new_transform","status_code","error_response","permissive","allow_any_origin","allowed_origin","allowed_origin_fn","allow_any_method","allowed_methods","allow_any_header","allowed_header","allowed_headers","expose_any_header","expose_headers","max_age","send_wildcard","supports_credentials","disable_vary_header","disable_preflight"],"q":["actix_cors","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","",""],"d":["Builder for CORS middleware.","Errors that can occur when processing CORS guarded …","Allowed origin argument must not be wildcard (*).","Request header Origin is required but was not provided.","Request header Access-Control-Request-Method is required …","Request header Access-Control-Request-Method has an …","Request header Access-Control-Request-Headers has an …","Origin is not allowed to make this request.","Request method is not allowed.","One or more request headers are not allowed.","","","","","","","","","","","","","","","","","","","","","A restrictive (security paranoid) set of defaults.","","","","","","","A very permissive set of default for quick development. …","Resets allowed origin list to a state where any origin is …","Add an origin that is allowed to make requests.","Determinate allowed origins by processing requests which …","Resets allowed methods list to all methods.","Set a list of methods which allowed origins can perform.","Resets allowed request header list to a state where any …","Add an allowed request header.","Set a list of request header field names which can be …","Resets exposed response header list to a state where any …","Set a list of headers which are safe to expose to the API …","Set a maximum time (in seconds) for which this CORS …","Set to use wildcard origins.","Allows users to make authenticated requests","Disable Vary header support.","Disable support for preflight requests."],"i":[0,0,1,1,1,1,1,1,1,1,2,2,2,2,2,2,2,2,1,1,1,1,1,1,1,1,1,1,1,1,2,2,1,1,2,1,1,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2],"f":[null,null,null,null,null,null,null,null,null,null,[[]],[[]],[[]],[[]],[[],["result",4]],[[],["result",4]],[[],["typeid",3]],[[]],[[]],[[]],[[]],[[]],[[],["string",3]],[[]],[[]],[[],["result",4]],[[],["result",4]],[[],["typeid",3]],[[]],[[],["corserror",4]],[[],["cors",3]],[[["formatter",3]],["result",6]],[[["formatter",3]],["result",6]],[[["formatter",3]],["result",6]],[[]],[[],["statuscode",3]],[[],["httpresponse",3]],[[]],[[],["cors",3]],[[["str",15]],["cors",3]],[[],["cors",3]],[[],["cors",3]],[[],["cors",3]],[[],["cors",3]],[[],["cors",3]],[[],["cors",3]],[[],["cors",3]],[[],["cors",3]],[[],["cors",3]],[[],["cors",3]],[[],["cors",3]],[[],["cors",3]],[[],["cors",3]]],"p":[[4,"CorsError"],[3,"Cors"]]},\ -"actix_identity":{"doc":"Request identity service for Actix applications.","t":[3,11,11,11,8,10,8,16,16,10,10,3,11,3,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11],"n":["Identity","identity","remember","forget","RequestIdentity","get_identity","IdentityPolicy","Future","ResponseFuture","from_request","to_response","IdentityService","new","CookieIdentityPolicy","new","path","name","domain","secure","max_age","max_age_time","http_only","same_site","visit_deadline","login_deadline","from","into","to_owned","clone_into","borrow","borrow_mut","try_from","try_into","type_id","vzip","from","into","borrow","borrow_mut","try_from","try_into","type_id","vzip","from","into","borrow","borrow_mut","try_from","try_into","type_id","vzip","from_request","to_response","clone","new_transform","from_request"],"q":["actix_identity","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","",""],"d":["The extractor type to obtain your identity from a request.","Return the claimed identity of the user associated …","Remember identity.","This method is used to ‘forget’ the current identity …","Helper trait that allows to get Identity.","","Identity policy definition.","The return type of the middleware","The return type of the middleware","Parse the session from request and load data from a …","Write changes to response","Request identity middleware","Create new identity service with specified backend.","Use cookies for request identity storage.","Construct new CookieIdentityPolicy instance.","Sets the path field in the session cookie being built.","Sets the name field in the session cookie being built.","Sets the domain field in the session cookie being built.","Sets the secure field in the session cookie being built.","Sets the max-age field in the session cookie being built …","Sets the max-age field in the session cookie being built …","Sets the http_only field in the session cookie being …","Sets the same_site field in the session cookie being …","Accepts only users whose cookie has been seen before the …","Accepts only users which has been authenticated before …","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","",""],"i":[0,1,1,1,0,2,0,3,3,3,3,0,4,0,5,5,5,5,5,5,5,5,5,5,5,1,1,1,1,1,1,1,1,1,1,4,4,4,4,4,4,4,4,5,5,5,5,5,5,5,5,5,5,1,4,1],"f":[null,[[],[["string",3],["option",4]]],[[["string",3]]],[[]],null,[[],[["string",3],["option",4]]],null,null,null,[[["servicerequest",3]]],[[["string",3],["option",4],["bool",15],["serviceresponse",3]]],null,[[]],null,[[],["cookieidentitypolicy",3]],[[["into",8],["string",3]],["cookieidentitypolicy",3]],[[["into",8],["string",3]],["cookieidentitypolicy",3]],[[["into",8],["string",3]],["cookieidentitypolicy",3]],[[["bool",15]],["cookieidentitypolicy",3]],[[["i64",15]],["cookieidentitypolicy",3]],[[["duration",3]],["cookieidentitypolicy",3]],[[["bool",15]]],[[["samesite",4]]],[[["duration",3]],["cookieidentitypolicy",3]],[[["duration",3]],["cookieidentitypolicy",3]],[[]],[[]],[[]],[[]],[[]],[[]],[[],["result",4]],[[],["result",4]],[[],["typeid",3]],[[]],[[]],[[]],[[]],[[]],[[],["result",4]],[[],["result",4]],[[],["typeid",3]],[[]],[[]],[[]],[[]],[[]],[[],["result",4]],[[],["result",4]],[[],["typeid",3]],[[]],[[["servicerequest",3]]],[[["string",3],["option",4],["bool",15],["serviceresponse",3]]],[[],["identity",3]],[[]],[[["httprequest",3],["payload",4]]]],"p":[[3,"Identity"],[8,"RequestIdentity"],[8,"IdentityPolicy"],[3,"IdentityService"],[3,"CookieIdentityPolicy"]]},\ -"actix_protobuf":{"doc":"","t":[4,13,13,13,13,13,3,12,3,11,3,11,11,8,10,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11],"n":["ProtoBufPayloadError","Overflow","ContentType","Serialize","Deserialize","Payload","ProtoBuf","0","ProtoBufConfig","limit","ProtoBufMessage","new","limit","ProtoBufResponseBuilder","protobuf","from","into","to_string","borrow","borrow_mut","try_from","try_into","type_id","vzip","from","into","to_string","borrow","borrow_mut","try_from","try_into","type_id","vzip","from","into","borrow","borrow_mut","try_from","try_into","type_id","vzip","from","into","borrow","borrow_mut","try_from","try_into","type_id","into_future","try_poll","vzip","from","from","default","deref","deref_mut","fmt","fmt","fmt","fmt","poll","from_request","error_response","respond_to"],"q":["actix_protobuf","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","",""],"d":["","Payload size is bigger than 256k","Content type error","Serialize error","Deserialize error","Payload error","","","","Change max size of payload. By default max size is 256Kb","","Create ProtoBufMessage for request.","Change max size of payload. By default max size is 256Kb","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","",""],"i":[0,1,1,1,1,1,0,2,0,3,0,4,4,0,5,1,1,1,1,1,1,1,1,1,2,2,2,2,2,2,2,2,2,3,3,3,3,3,3,3,3,4,4,4,4,4,4,4,4,4,4,1,1,3,2,2,1,2,1,2,4,2,1,2],"f":[null,null,null,null,null,null,null,null,null,[[["usize",15]]],null,[[["httprequest",3],["payload",4]]],[[["usize",15]]],null,[[["message",8]],[["httpresponse",3],["error",3],["result",4]]],[[]],[[]],[[],["string",3]],[[]],[[]],[[],["result",4]],[[],["result",4]],[[],["typeid",3]],[[]],[[]],[[]],[[],["string",3]],[[]],[[]],[[],["result",4]],[[],["result",4]],[[],["typeid",3]],[[]],[[]],[[]],[[]],[[]],[[],["result",4]],[[],["result",4]],[[],["typeid",3]],[[]],[[]],[[]],[[]],[[]],[[],["result",4]],[[],["result",4]],[[],["typeid",3]],[[]],[[["pin",3],["context",3]],["poll",4]],[[]],[[["payloaderror",4]],["protobufpayloaderror",4]],[[["protobufdecodeerror",3]],["protobufpayloaderror",4]],[[]],[[]],[[]],[[["formatter",3]],["result",6]],[[["formatter",3]],["result",6]],[[["formatter",3]],["result",6]],[[["formatter",3]],["result",6]],[[["context",3],["pin",3]],["poll",4]],[[["httprequest",3],["payload",4]]],[[],["httpresponse",3]],[[["httprequest",3]],["httpresponse",3]]],"p":[[4,"ProtoBufPayloadError"],[3,"ProtoBuf"],[3,"ProtoBufConfig"],[3,"ProtoBufMessage"],[8,"ProtoBufResponseBuilder"]]},\ -"actix_redis":{"doc":"Redis integration for Actix and session store for Actix …","t":[3,12,3,4,13,13,13,3,4,13,13,13,4,13,13,13,13,13,13,4,13,13,13,13,13,13,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11],"n":["Command","0","RedisActor","SameSite","Strict","Lax","None","RedisSession","Error","Redis","NotConnected","Disconnected","RespError","Internal","IO","RESP","Remote","Connection","Unexpected","RespValue","Nil","Array","BulkString","Error","Integer","SimpleString","from","into","borrow","borrow_mut","try_from","try_into","type_id","vzip","from","into","borrow","borrow_mut","try_from","try_into","type_id","vzip","from","into","borrow","borrow_mut","try_from","try_into","type_id","vzip","from","into","to_owned","clone_into","to_string","borrow","borrow_mut","try_from","try_into","type_id","vzip","equivalent","get_hash","from","into","to_string","borrow","borrow_mut","try_from","try_into","type_id","vzip","from","into","to_string","borrow","borrow_mut","try_from","try_into","type_id","vzip","from","into","to_owned","clone_into","borrow","borrow_mut","try_from","try_into","type_id","vzip","equivalent","from_resp_int","fmt","clone","fmt","fmt","source","from","from","from","from","from","from","from","from","from","eq","ne","fmt","clone","fmt","hash","eq","from","fmt","fmt","fmt","source","started","restarting","handle","handle","error","new_transform","start","new","ttl","cookie_name","cookie_path","cookie_domain","cookie_secure","cookie_max_age","cookie_same_site","cookie_http_only","cache_keygen","is_strict","is_lax","is_none","append","push"],"q":["actix_redis","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","",""],"d":["Command for send data to Redis","","Redis communication actor","The SameSite cookie attribute.","The “Strict” SameSite attribute.","The “Lax” SameSite attribute.","The “None” SameSite attribute.","Use redis as session storage.","General purpose actix redis error","","Receiving message during reconnecting","Cancel all waters when connection get dropped","","A non-specific internal error that prevented an operation …","An IO error occurred","A RESP parsing/serialising error occurred","A remote error","Error creating a connection, or an error with a …","An unexpected error. In this context “unexpected” …","A single RESP value, this owns the data that is …","","Zero, one or more other RespValues.","A bulk string. In Redis terminology a string is a …","An error from the Redis server","Redis documentation defines an integer as being a signed …","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","Start new Supervisor with RedisActor.","Create new redis session backend","Set time to live in seconds for session value.","Set custom cookie name for session ID.","Set custom cookie path.","Set custom cookie domain.","Set custom cookie secure.","Set custom cookie max-age.","Set custom cookie SameSite attribute.","Set custom cookie HttpOnly policy.","Set a custom cache key generation strategy, expecting …","Returns true if self is SameSite::Strict and false …","Returns true if self is SameSite::Lax and false otherwise.","Returns true if self is SameSite::None and false …","Convenience function for building dynamic Redis commands …","Push item to Resp array"],"i":[0,1,0,0,2,2,2,0,0,3,3,3,0,4,4,4,4,4,4,0,5,5,5,5,5,5,1,1,1,1,1,1,1,1,6,6,6,6,6,6,6,6,7,7,7,7,7,7,7,7,2,2,2,2,2,2,2,2,2,2,2,2,2,3,3,3,3,3,3,3,3,3,4,4,4,4,4,4,4,4,4,5,5,5,5,5,5,5,5,5,5,5,5,4,5,5,4,4,5,5,4,5,5,5,5,4,5,5,5,2,2,2,2,2,3,1,3,3,3,6,6,6,6,6,7,6,7,7,7,7,7,7,7,7,7,7,2,2,2,5,5],"f":[null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,[[]],[[]],[[]],[[]],[[],["result",4]],[[],["result",4]],[[],["typeid",3]],[[]],[[]],[[]],[[]],[[]],[[],["result",4]],[[],["result",4]],[[],["typeid",3]],[[]],[[]],[[]],[[]],[[]],[[],["result",4]],[[],["result",4]],[[],["typeid",3]],[[]],[[]],[[]],[[]],[[]],[[],["string",3]],[[]],[[]],[[],["result",4]],[[],["result",4]],[[],["typeid",3]],[[]],[[],["bool",15]],[[],["u64",15]],[[]],[[]],[[],["string",3]],[[]],[[]],[[],["result",4]],[[],["result",4]],[[],["typeid",3]],[[]],[[]],[[]],[[],["string",3]],[[]],[[]],[[],["result",4]],[[],["result",4]],[[],["typeid",3]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[],["result",4]],[[],["result",4]],[[],["typeid",3]],[[]],[[],["bool",15]],[[["respvalue",4]],[["error",4],["respvalue",4],["result",4]]],[[["formatter",3]],[["result",4],["error",3]]],[[],["respvalue",4]],[[["formatter",3]],[["result",4],["error",3]]],[[["formatter",3]],[["result",4],["error",3]]],[[],[["option",4],["error",8]]],[[["vec",3],["u8",15],["global",3]],["respvalue",4]],[[["usize",15]],["respvalue",4]],[[["trysenderror",3]],["error",4]],[[["string",3]],["respvalue",4]],[[["str",15]],["respvalue",4]],[[["arc",3],["str",15]],["respvalue",4]],[[],["respvalue",4]],[[["error",3]],["error",4]],[[["string",3]],["respvalue",4]],[[["respvalue",4]],["bool",15]],[[["respvalue",4]],["bool",15]],[[["formatter",3]],[["result",4],["error",3]]],[[],["samesite",4]],[[["formatter",3]],[["result",4],["error",3]]],[[]],[[["samesite",4]],["bool",15]],[[["error",4]],["error",4]],[[["formatter",3]],["result",6]],[[["formatter",3]],["result",6]],[[["formatter",3]],["result",6]],[[],[["option",4],["error",8]]],[[["context",3]]],[[]],[[["command",3]]],[[["respvalue",4],["result",4],["resperror",4]]],[[["error",3]],["running",4]],[[]],[[["string",3],["into",8]],[["addr",3],["redisactor",3]]],[[["string",3],["into",8]],["redissession",3]],[[["u32",15]]],[[["str",15]]],[[["str",15]]],[[["str",15]]],[[["bool",15]]],[[]],[[["samesite",4]]],[[["bool",15]]],[[["box",3],["fn",8]]],[[],["bool",15]],[[],["bool",15]],[[],["bool",15]],[[],["respvalue",4]],[[]]],"p":[[3,"Command"],[4,"SameSite"],[4,"Error"],[4,"RespError"],[4,"RespValue"],[3,"RedisActor"],[3,"RedisSession"]]},\ -"actix_session":{"doc":"Sessions for Actix Web.","t":[3,3,8,10,4,13,13,13,13,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11],"n":["CookieSession","Session","UserSession","get_session","SessionStatus","Changed","Purged","Renewed","Unchanged","get","set","remove","clear","purge","renew","set_session","get_changes","from","into","borrow","borrow_mut","try_from","try_into","type_id","vzip","from","into","borrow","borrow_mut","try_from","try_into","type_id","vzip","from","into","to_owned","clone_into","borrow","borrow_mut","try_from","try_into","type_id","vzip","clone","default","eq","fmt","new_transform","from_request","signed","private","path","name","domain","lazy","secure","http_only","same_site","max_age","max_age_time","expires_in","expires_in_time"],"q":["actix_session","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","",""],"d":["Use cookies for session storage.","The high-level interface you use to modify session data.","Extraction of a [Session] object.","","","","","","","Get a value from the session.","Set a value from the session.","Remove value from the session.","Clear the session.","Removes session, both client and server side.","Renews the session key, assigning existing session state …","Adds the given key-value pairs to the session on the …","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","Construct new signed CookieSession instance.","Construct new private CookieSession instance.","Sets the path field in the session cookie being built.","Sets the name field in the session cookie being built.","Sets the domain field in the session cookie being built.","When true, prevents adding session cookies to responses …","Sets the secure field in the session cookie being built.","Sets the http_only field in the session cookie being …","Sets the same_site field in the session cookie being …","Sets the max-age field in the session cookie being built.","Sets the max-age field in the session cookie being built.","Sets the expires field in the session cookie being built.","Sets the expires field in the session cookie being built."],"i":[0,0,0,1,0,2,2,2,2,3,3,3,3,3,3,3,3,4,4,4,4,4,4,4,4,3,3,3,3,3,3,3,3,2,2,2,2,2,2,2,2,2,2,2,2,2,2,4,3,4,4,4,4,4,4,4,4,4,4,4,4,4],"f":[null,null,null,[[],["session",3]],null,null,null,null,null,[[["str",15]],[["option",4],["error",3],["result",4]]],[[["serialize",8],["str",15]],[["error",3],["result",4]]],[[["str",15]]],[[]],[[]],[[]],[[["servicerequest",3]]],[[["serviceresponse",3]]],[[]],[[]],[[]],[[]],[[],["result",4]],[[],["result",4]],[[],["typeid",3]],[[]],[[]],[[]],[[]],[[]],[[],["result",4]],[[],["result",4]],[[],["typeid",3]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[],["result",4]],[[],["result",4]],[[],["typeid",3]],[[]],[[],["sessionstatus",4]],[[],["sessionstatus",4]],[[["sessionstatus",4]],["bool",15]],[[["formatter",3]],["result",6]],[[]],[[["httprequest",3],["payload",4]]],[[],["cookiesession",3]],[[],["cookiesession",3]],[[["into",8],["string",3]],["cookiesession",3]],[[["into",8],["string",3]],["cookiesession",3]],[[["into",8],["string",3]],["cookiesession",3]],[[["bool",15]],["cookiesession",3]],[[["bool",15]],["cookiesession",3]],[[["bool",15]],["cookiesession",3]],[[["samesite",4]],["cookiesession",3]],[[["i64",15]],["cookiesession",3]],[[["duration",3]],["cookiesession",3]],[[["i64",15]],["cookiesession",3]],[[["duration",3]],["cookiesession",3]]],"p":[[8,"UserSession"],[4,"SessionStatus"],[3,"Session"],[3,"CookieSession"]]},\ -"actix_web_httpauth":{"doc":"HTTP authentication schemes for actix-web.","t":[0,0,3,11,3,11,11,0,4,13,13,13,3,11,11,3,11,8,16,10,3,8,16,16,10,0,0,4,13,13,13,13,13,13,3,3,3,8,10,0,11,0,3,0,3,3,4,13,13,13,8,10,3,12,0,3,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11],"n":["extractors","basic","Config","realm","BasicAuth","user_id","password","bearer","Error","InvalidRequest","InvalidToken","InsufficientScope","Config","scope","realm","BearerAuth","token","AuthExtractorConfig","Inner","into_inner","AuthenticationError","AuthExtractor","Error","Future","from_service_request","headers","authorization","ParseError","Invalid","MissingScheme","MissingField","ToStrError","Base64DecodeError","Utf8Error","Authorization","Basic","Bearer","Scheme","parse","www_authenticate","status_code","basic","Basic","bearer","BearerBuilder","Bearer","Error","InvalidRequest","InvalidToken","InsufficientScope","Challenge","to_bytes","WwwAuthenticate","0","middleware","HttpAuthentication","with_fn","basic","bearer","from","into","to_owned","clone_into","borrow","borrow_mut","try_from","try_into","type_id","vzip","from","into","to_owned","clone_into","borrow","borrow_mut","try_from","try_into","type_id","vzip","from","into","to_owned","clone_into","to_string","borrow","borrow_mut","try_from","try_into","type_id","equivalent","get_hash","vzip","from","into","to_owned","clone_into","borrow","borrow_mut","try_from","try_into","type_id","vzip","from","into","to_owned","clone_into","borrow","borrow_mut","try_from","try_into","type_id","vzip","from","into","to_string","borrow","borrow_mut","try_from","try_into","type_id","vzip","from","into","to_string","borrow","borrow_mut","try_from","try_into","type_id","vzip","from","from","into","to_owned","clone_into","to_string","borrow","borrow_mut","try_from","try_into","type_id","try_into_header_pair","equivalent","get_hash","vzip","from","into","to_owned","clone_into","to_string","borrow","borrow_mut","try_from","try_into","type_id","equivalent","vzip","from","into","to_owned","clone_into","to_string","borrow","borrow_mut","try_from","try_into","type_id","equivalent","vzip","from","into","to_owned","clone_into","to_string","borrow","borrow_mut","try_from","try_into","type_id","equivalent","get_hash","vzip","from","into","borrow","borrow_mut","try_from","try_into","type_id","vzip","from","into","to_owned","clone_into","to_string","borrow","borrow_mut","try_from","try_into","type_id","equivalent","get_hash","vzip","from","into","to_owned","clone_into","borrow","borrow_mut","try_from","try_into","type_id","try_into_header_pair","equivalent","get_hash","vzip","from","into","to_owned","clone_into","borrow","borrow_mut","try_from","try_into","type_id","vzip","into_inner","into_inner","from_service_request","from_service_request","parse","parse","as_mut","as_ref","as_ref","as_ref","from","from","from","from","from","clone","clone","clone","clone","clone","clone","clone","clone","clone","clone","clone","clone","default","default","default","default","default","default","default","cmp","cmp","cmp","cmp","cmp","cmp","cmp","eq","ne","eq","ne","eq","ne","eq","ne","eq","ne","eq","eq","ne","partial_cmp","partial_cmp","partial_cmp","partial_cmp","partial_cmp","partial_cmp","partial_cmp","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","hash","hash","hash","hash","hash","source","new_transform","from_request","from_request","error_response","status_code","try_into_value","try_into_value","try_into_value","try_into_value","try_into_value","try_into_value","name","parse","name","parse","with_error","with_error_description","with_error_uri","new","challenge_mut","status_code_mut","into_scheme","new","user_id","password","new","token","new","with_realm","scope","realm","error","error_description","error_uri","finish","build"],"q":["actix_web_httpauth","actix_web_httpauth::extractors","actix_web_httpauth::extractors::basic","","","","","actix_web_httpauth::extractors","actix_web_httpauth::extractors::bearer","","","","","","","","","actix_web_httpauth::extractors","","","","","","","","actix_web_httpauth","actix_web_httpauth::headers","actix_web_httpauth::headers::authorization","","","","","","","","","","","","actix_web_httpauth::headers","actix_web_httpauth::extractors::bearer","actix_web_httpauth::headers::www_authenticate","actix_web_httpauth::headers::www_authenticate::basic","actix_web_httpauth::headers::www_authenticate","actix_web_httpauth::headers::www_authenticate::bearer","","","","","","actix_web_httpauth::headers::www_authenticate","","","","actix_web_httpauth","actix_web_httpauth::middleware","","","","actix_web_httpauth::extractors::basic","","","","","","","","","","","","","","","","","","","","actix_web_httpauth::extractors::bearer","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","actix_web_httpauth::extractors","","","","","","","","","actix_web_httpauth::headers::authorization","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","actix_web_httpauth::headers::www_authenticate::basic","","","","","","","","","","","","","actix_web_httpauth::headers::www_authenticate::bearer","","","","","","","","","","","","","","","","","","","","","actix_web_httpauth::headers::www_authenticate","","","","","","","","","","","","","actix_web_httpauth::middleware","","","","","","","","","","actix_web_httpauth::extractors::basic","actix_web_httpauth::extractors::bearer","actix_web_httpauth::extractors::basic","actix_web_httpauth::extractors::bearer","actix_web_httpauth::headers::authorization","","","actix_web_httpauth::extractors::basic","actix_web_httpauth::extractors::bearer","actix_web_httpauth::headers::authorization","actix_web_httpauth::extractors","actix_web_httpauth::headers::authorization","","","","actix_web_httpauth::extractors::basic","","actix_web_httpauth::extractors::bearer","","actix_web_httpauth::headers::authorization","","","actix_web_httpauth::headers::www_authenticate::basic","actix_web_httpauth::headers::www_authenticate::bearer","actix_web_httpauth::extractors::bearer","actix_web_httpauth::headers::www_authenticate","actix_web_httpauth::middleware","actix_web_httpauth::extractors::basic","actix_web_httpauth::extractors::bearer","actix_web_httpauth::headers::authorization","actix_web_httpauth::headers::www_authenticate::basic","actix_web_httpauth::headers::www_authenticate::bearer","","actix_web_httpauth::headers::www_authenticate","actix_web_httpauth::headers::authorization","","","actix_web_httpauth::headers::www_authenticate::basic","actix_web_httpauth::headers::www_authenticate::bearer","actix_web_httpauth::extractors::bearer","actix_web_httpauth::headers::www_authenticate","actix_web_httpauth::headers::authorization","","","","","","actix_web_httpauth::headers::www_authenticate::basic","","actix_web_httpauth::headers::www_authenticate::bearer","","actix_web_httpauth::extractors::bearer","actix_web_httpauth::headers::www_authenticate","","actix_web_httpauth::headers::authorization","","","actix_web_httpauth::headers::www_authenticate::basic","actix_web_httpauth::headers::www_authenticate::bearer","actix_web_httpauth::extractors::bearer","actix_web_httpauth::headers::www_authenticate","actix_web_httpauth::extractors::basic","","actix_web_httpauth::extractors::bearer","","actix_web_httpauth::extractors","actix_web_httpauth::headers::authorization","","","","actix_web_httpauth::headers::www_authenticate::basic","actix_web_httpauth::headers::www_authenticate::bearer","","actix_web_httpauth::extractors::bearer","actix_web_httpauth::headers::www_authenticate","actix_web_httpauth::middleware","actix_web_httpauth::extractors","actix_web_httpauth::headers::authorization","","","","actix_web_httpauth::headers::www_authenticate::basic","actix_web_httpauth::headers::www_authenticate::bearer","actix_web_httpauth::extractors::bearer","actix_web_httpauth::headers::authorization","actix_web_httpauth::headers::www_authenticate::basic","actix_web_httpauth::headers::www_authenticate::bearer","actix_web_httpauth::extractors::bearer","actix_web_httpauth::headers::www_authenticate","actix_web_httpauth::headers::authorization","actix_web_httpauth::middleware","actix_web_httpauth::extractors::basic","actix_web_httpauth::extractors::bearer","actix_web_httpauth::extractors","","actix_web_httpauth::headers::authorization","","","actix_web_httpauth::headers::www_authenticate::basic","actix_web_httpauth::headers::www_authenticate::bearer","actix_web_httpauth::headers::www_authenticate","actix_web_httpauth::headers::authorization","","actix_web_httpauth::headers::www_authenticate","","actix_web_httpauth::extractors","","","","","","actix_web_httpauth::headers::authorization","","","","","","actix_web_httpauth::headers::www_authenticate::basic","","actix_web_httpauth::headers::www_authenticate::bearer","","","","","",""],"d":["Type-safe authentication information extractors","Extractor for the “Basic” HTTP Authentication Scheme","BasicAuth extractor configuration, used for …","Set challenge realm attribute.","Extractor for HTTP Basic auth.","Returns client’s user-ID.","Returns client’s password.","Extractor for the “Bearer” HTTP Authentication Scheme","Bearer authorization error types, described in RFC 6750","The request is missing a required parameter, includes an …","The access token provided is expired, revoked, malformed, …","The request requires higher privileges than provided by …","BearerAuth extractor configuration.","Set challenge scope attribute.","Set challenge realm attribute.","Extractor for HTTP Bearer auth","Returns bearer token provided by client.","Trait implemented for types that provides configuration …","Associated challenge type.","Convert the config instance into a HTTP challenge.","Authentication error returned by authentication …","Trait implemented by types that can extract HTTP …","The associated error which can be returned.","Future that resolves into extracted credentials type.","Parse the authentication credentials from the actix’ …","Typed HTTP headers","Authorization header and various auth schemes","Possible errors while parsing Authorization header.","Header value is malformed","Authentication scheme is missing","Required authentication field is missing","Unable to convert header into the str","Malformed base64 string","Malformed UTF-8 string","Authorization header, defined in RFC 7235","Credentials for Basic authentication scheme, defined in …","Credentials for Bearer authentication scheme, defined in …","Authentication scheme for Authorization header.","Try to parse the authentication scheme from the …","WWW-Authenticate header and various auth challenges","Returns HTTP status code suitable for current error type.","Challenge for the “Basic” HTTP Authentication Scheme","Challenge for WWW-Authenticate header with HTTP Basic …","Challenge for the “Bearer” HTTP Authentication Scheme","Builder for the Bearer challenge.","Challenge for WWW-Authenticate header with HTTP Bearer …","Bearer authorization error types, described in RFC 6750","The request is missing a required parameter, includes an …","The access token provided is expired, revoked, malformed, …","The request requires higher privileges than provided by …","Authentication challenge for WWW-Authenticate header.","Converts the challenge into a bytes suitable for HTTP …","WWW-Authenticate header, described in RFC 7235","","HTTP Authentication middleware.","Middleware for checking HTTP authentication.","Construct HttpAuthentication middleware with the provided …","Construct HttpAuthentication middleware for the HTTP “…","Construct HttpAuthentication middleware for the HTTP “…","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","Attach Error to the current Authentication error.","Attach error description to the current Authentication …","Attach error URI to the current Authentication error.","Creates new authentication error from the provided …","Returns mutable reference to the inner challenge instance.","Returns mutable reference to the inner status code.","Consumes Authorization header and returns inner Scheme …","Creates Basic credentials with provided user_id and …","Returns client’s user-ID.","Returns client’s password if provided.","Creates new Bearer credentials with the token provided.","Gets reference to the credentials token.","Creates new Basic challenge with an empty realm field.","Creates new Basic challenge from the provided realm field …","Provides the scope attribute, as defined in RFC6749, …","Provides the realm attribute, as defined in RFC2617","Provides the error attribute, as defined in RFC6750, …","Provides the error_description attribute, as defined in …","Provides the error_uri attribute, as defined in RFC6750, …","Consumes the builder and returns built Bearer instance.","Creates the builder for Bearer challenge."],"i":[0,0,0,1,0,2,2,0,0,3,3,3,0,4,4,0,5,0,6,6,0,0,7,7,7,0,0,0,8,8,8,8,8,8,0,0,0,0,9,0,3,0,0,0,0,0,0,3,3,3,0,10,0,11,0,0,12,12,12,1,1,1,1,1,1,1,1,1,1,2,2,2,2,2,2,2,2,2,2,3,3,3,3,3,3,3,3,3,3,3,3,3,4,4,4,4,4,4,4,4,4,4,5,5,5,5,5,5,5,5,5,5,13,13,13,13,13,13,13,13,13,8,8,8,8,8,8,8,8,8,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,15,15,15,15,15,15,15,15,15,15,15,15,16,16,16,16,16,16,16,16,16,16,16,16,17,17,17,17,17,17,17,17,17,17,17,17,17,18,18,18,18,18,18,18,18,19,19,19,19,19,19,19,19,19,19,19,19,19,11,11,11,11,11,11,11,11,11,11,11,11,11,12,12,12,12,12,12,12,12,12,12,1,4,2,5,15,16,14,1,4,14,13,8,8,8,14,1,2,4,5,14,15,16,17,19,3,11,12,1,4,14,17,18,19,11,14,15,16,17,19,3,11,14,14,15,15,16,16,17,17,19,19,3,11,11,14,15,16,17,19,3,11,1,2,4,5,13,8,14,15,16,17,18,19,3,11,12,13,8,14,15,16,17,19,3,14,17,19,3,11,8,12,2,5,13,13,14,15,16,17,19,11,14,14,11,11,13,13,13,13,13,13,14,15,15,15,16,16,17,17,18,18,18,18,18,18,19],"f":[null,null,null,[[],["config",3]],null,[[],["cow",4]],[[],[["option",4],["cow",4]]],null,null,null,null,null,null,[[["cow",4],["into",8]],["config",3]],[[["cow",4],["into",8]],["config",3]],null,[[],["str",15]],null,null,[[]],null,null,null,null,[[["servicerequest",3]]],null,null,null,null,null,null,null,null,null,null,null,null,null,[[["headervalue",3]],[["result",4],["parseerror",4]]],null,[[],["statuscode",3]],null,null,null,null,null,null,null,null,null,null,[[],["bytes",3]],null,null,null,null,[[],["httpauthentication",3]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[],["result",4]],[[],["result",4]],[[],["typeid",3]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[],["result",4]],[[],["result",4]],[[],["typeid",3]],[[]],[[]],[[]],[[]],[[]],[[],["string",3]],[[]],[[]],[[],["result",4]],[[],["result",4]],[[],["typeid",3]],[[],["bool",15]],[[],["u64",15]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[],["result",4]],[[],["result",4]],[[],["typeid",3]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[],["result",4]],[[],["result",4]],[[],["typeid",3]],[[]],[[]],[[]],[[],["string",3]],[[]],[[]],[[],["result",4]],[[],["result",4]],[[],["typeid",3]],[[]],[[]],[[]],[[],["string",3]],[[]],[[]],[[],["result",4]],[[],["result",4]],[[],["typeid",3]],[[]],[[]],[[]],[[]],[[]],[[]],[[],["string",3]],[[]],[[]],[[],["result",4]],[[],["result",4]],[[],["typeid",3]],[[],["result",4]],[[],["bool",15]],[[],["u64",15]],[[]],[[]],[[]],[[]],[[]],[[],["string",3]],[[]],[[]],[[],["result",4]],[[],["result",4]],[[],["typeid",3]],[[],["bool",15]],[[]],[[]],[[]],[[]],[[]],[[],["string",3]],[[]],[[]],[[],["result",4]],[[],["result",4]],[[],["typeid",3]],[[],["bool",15]],[[]],[[]],[[]],[[]],[[]],[[],["string",3]],[[]],[[]],[[],["result",4]],[[],["result",4]],[[],["typeid",3]],[[],["bool",15]],[[],["u64",15]],[[]],[[]],[[]],[[]],[[]],[[],["result",4]],[[],["result",4]],[[],["typeid",3]],[[]],[[]],[[]],[[]],[[]],[[],["string",3]],[[]],[[]],[[],["result",4]],[[],["result",4]],[[],["typeid",3]],[[],["bool",15]],[[],["u64",15]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[],["result",4]],[[],["result",4]],[[],["typeid",3]],[[],["result",4]],[[],["bool",15]],[[],["u64",15]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[],["result",4]],[[],["result",4]],[[],["typeid",3]],[[]],[[]],[[]],[[["servicerequest",3]]],[[["servicerequest",3]]],[[["headervalue",3]],[["result",4],["parseerror",4]]],[[["headervalue",3]],[["result",4],["parseerror",4]]],[[]],[[],["challenge",3]],[[],["bearer",3]],[[]],[[]],[[["tostrerror",3]]],[[["decodeerror",4]]],[[["utf8error",3]]],[[],["authorization",3]],[[],["config",3]],[[],["basicauth",3]],[[],["config",3]],[[],["bearerauth",3]],[[],["authorization",3]],[[],["basic",3]],[[],["bearer",3]],[[],["basic",3]],[[],["bearer",3]],[[],["error",4]],[[],["wwwauthenticate",3]],[[],["httpauthentication",3]],[[],["config",3]],[[],["config",3]],[[],["authorization",3]],[[],["basic",3]],[[],["bearerbuilder",3]],[[],["bearer",3]],[[],["wwwauthenticate",3]],[[["authorization",3]],["ordering",4]],[[["basic",3]],["ordering",4]],[[["bearer",3]],["ordering",4]],[[["basic",3]],["ordering",4]],[[["bearer",3]],["ordering",4]],[[["error",4]],["ordering",4]],[[["wwwauthenticate",3]],["ordering",4]],[[["authorization",3]],["bool",15]],[[["authorization",3]],["bool",15]],[[["basic",3]],["bool",15]],[[["basic",3]],["bool",15]],[[["bearer",3]],["bool",15]],[[["bearer",3]],["bool",15]],[[["basic",3]],["bool",15]],[[["basic",3]],["bool",15]],[[["bearer",3]],["bool",15]],[[["bearer",3]],["bool",15]],[[["error",4]],["bool",15]],[[["wwwauthenticate",3]],["bool",15]],[[["wwwauthenticate",3]],["bool",15]],[[["authorization",3]],[["ordering",4],["option",4]]],[[["basic",3]],[["ordering",4],["option",4]]],[[["bearer",3]],[["ordering",4],["option",4]]],[[["basic",3]],[["ordering",4],["option",4]]],[[["bearer",3]],[["ordering",4],["option",4]]],[[["error",4]],[["ordering",4],["option",4]]],[[["wwwauthenticate",3]],[["ordering",4],["option",4]]],[[["formatter",3]],["result",6]],[[["formatter",3]],["result",6]],[[["formatter",3]],["result",6]],[[["formatter",3]],["result",6]],[[["formatter",3]],["result",6]],[[["formatter",3]],["result",6]],[[["formatter",3]],["result",6]],[[["formatter",3]],["result",6]],[[["formatter",3]],["result",6]],[[["formatter",3]],["result",6]],[[["formatter",3]],["result",6]],[[["formatter",3]],["result",6]],[[["formatter",3]],["result",6]],[[["formatter",3]],["result",6]],[[["formatter",3]],["result",6]],[[["formatter",3]],["result",6]],[[["formatter",3]],["result",6]],[[["formatter",3]],["result",6]],[[["formatter",3]],["result",6]],[[["formatter",3]],["result",6]],[[["formatter",3]],[["result",4],["error",3]]],[[["formatter",3]],[["result",4],["error",3]]],[[["formatter",3]],["result",6]],[[]],[[]],[[]],[[]],[[]],[[],[["option",4],["error",8]]],[[]],[[["httprequest",3],["payload",4]]],[[["httprequest",3],["payload",4]]],[[],["httpresponse",3]],[[],["statuscode",3]],[[],[["result",4],["headervalue",3]]],[[],[["result",4],["headervalue",3]]],[[],[["result",4],["headervalue",3]]],[[],[["result",4],["headervalue",3]]],[[],[["result",4],["headervalue",3]]],[[],[["result",4],["headervalue",3]]],[[],["headername",3]],[[],[["parseerror",4],["result",4]]],[[],["headername",3]],[[],[["parseerror",4],["result",4]]],[[["error",4]]],[[]],[[]],[[],["authenticationerror",3]],[[]],[[],["statuscode",3]],[[]],[[["option",4]],["basic",3]],[[],["cow",4]],[[],[["option",4],["cow",4]]],[[],["bearer",3]],[[],["cow",4]],[[],["basic",3]],[[],["basic",3]],[[]],[[]],[[["error",4]]],[[]],[[]],[[],["bearer",3]],[[],["bearerbuilder",3]]],"p":[[3,"Config"],[3,"BasicAuth"],[4,"Error"],[3,"Config"],[3,"BearerAuth"],[8,"AuthExtractorConfig"],[8,"AuthExtractor"],[4,"ParseError"],[8,"Scheme"],[8,"Challenge"],[3,"WwwAuthenticate"],[3,"HttpAuthentication"],[3,"AuthenticationError"],[3,"Authorization"],[3,"Basic"],[3,"Bearer"],[3,"Basic"],[3,"BearerBuilder"],[3,"Bearer"]]},\ +"actix_identity":{"doc":"Opinionated request identity service for Actix Web apps.","t":[3,3,3,8,16,16,10,10,8,10,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11],"n":["CookieIdentityPolicy","Identity","IdentityService","IdentityPolicy","Future","ResponseFuture","from_request","to_response","RequestIdentity","get_identity","from","into","borrow","borrow_mut","try_from","try_into","type_id","vzip","from","into","to_owned","clone_into","borrow","borrow_mut","try_from","try_into","type_id","vzip","from","into","borrow","borrow_mut","try_from","try_into","type_id","vzip","from_request","to_response","clone","new_transform","from_request","new","name","path","domain","secure","max_age","max_age_secs","http_only","same_site","visit_deadline","login_deadline","identity","remember","forget","new"],"q":["actix_identity","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","",""],"d":["Use cookies for request identity storage.","The extractor type to obtain your identity from a request.","Request identity middleware","Identity policy.","The return type of the middleware","The return type of the middleware","Parse the session from request and load data from a …","Write changes to response","Helper trait that allows to get Identity.","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","Create new CookieIdentityPolicy instance.","Sets the name of issued cookies.","Sets the Path attribute of issued cookies.","Sets the Domain attribute of issued cookies.","Sets the Secure attribute of issued cookies.","Sets the Max-Age attribute of issued cookies.","Sets the Max-Age attribute of issued cookies with given …","Sets the HttpOnly attribute of issued cookies.","Sets the SameSite attribute of issued cookies.","Accepts only users who have visited within given deadline.","Accepts only users who authenticated within the given …","Return the claimed identity of the user associated …","Remember identity.","This method is used to ‘forget’ the current identity …","Create new identity service with specified backend."],"i":[0,0,0,0,1,1,1,1,0,2,3,3,3,3,3,3,3,3,4,4,4,4,4,4,4,4,4,4,5,5,5,5,5,5,5,5,3,3,4,5,4,3,3,3,3,3,3,3,3,3,3,3,4,4,4,5],"f":[null,null,null,null,null,null,[[["servicerequest",3]]],[[["serviceresponse",3],["bool",15],["option",4],["string",3]]],null,[[],[["option",4],["string",3]]],[[]],[[]],[[]],[[]],[[],["result",4]],[[],["result",4]],[[],["typeid",3]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[],["result",4]],[[],["result",4]],[[],["typeid",3]],[[]],[[]],[[]],[[]],[[]],[[],["result",4]],[[],["result",4]],[[],["typeid",3]],[[]],[[["servicerequest",3]]],[[["serviceresponse",3],["bool",15],["option",4],["string",3]]],[[],["identity",3]],[[]],[[["httprequest",3],["payload",4]]],[[],["cookieidentitypolicy",3]],[[],["cookieidentitypolicy",3]],[[],["cookieidentitypolicy",3]],[[],["cookieidentitypolicy",3]],[[["bool",15]],["cookieidentitypolicy",3]],[[["duration",3]],["cookieidentitypolicy",3]],[[["i64",15]],["cookieidentitypolicy",3]],[[["bool",15]]],[[["samesite",4]]],[[["duration",3]],["cookieidentitypolicy",3]],[[["duration",3]],["cookieidentitypolicy",3]],[[],[["option",4],["string",3]]],[[["string",3]]],[[]],[[]]],"p":[[8,"IdentityPolicy"],[8,"RequestIdentity"],[3,"CookieIdentityPolicy"],[3,"Identity"],[3,"IdentityService"]]},\ +"actix_protobuf":{"doc":"","t":[4,13,13,13,13,13,3,12,3,11,3,11,11,8,10,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11],"n":["ProtoBufPayloadError","Overflow","ContentType","Serialize","Deserialize","Payload","ProtoBuf","0","ProtoBufConfig","limit","ProtoBufMessage","new","limit","ProtoBufResponseBuilder","protobuf","from","into","to_string","borrow","borrow_mut","try_from","try_into","type_id","vzip","from","into","to_string","borrow","borrow_mut","try_from","try_into","type_id","vzip","from","into","borrow","borrow_mut","try_from","try_into","type_id","vzip","from","into","borrow","borrow_mut","try_from","try_into","type_id","into_future","try_poll","vzip","from","from","default","deref","deref_mut","fmt","fmt","fmt","fmt","poll","from_request","error_response","respond_to"],"q":["actix_protobuf","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","",""],"d":["","Payload size is bigger than 256k","Content type error","Serialize error","Deserialize error","Payload error","","","","Change max size of payload. By default max size is 256Kb","","Create ProtoBufMessage for request.","Change max size of payload. By default max size is 256Kb","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","",""],"i":[0,1,1,1,1,1,0,2,0,3,0,4,4,0,5,1,1,1,1,1,1,1,1,1,2,2,2,2,2,2,2,2,2,3,3,3,3,3,3,3,3,4,4,4,4,4,4,4,4,4,4,1,1,3,2,2,1,2,1,2,4,2,1,2],"f":[null,null,null,null,null,null,null,null,null,[[["usize",15]]],null,[[["httprequest",3],["payload",4]]],[[["usize",15]]],null,[[["message",8]],[["result",4],["httpresponse",3],["error",3]]],[[]],[[]],[[],["string",3]],[[]],[[]],[[],["result",4]],[[],["result",4]],[[],["typeid",3]],[[]],[[]],[[]],[[],["string",3]],[[]],[[]],[[],["result",4]],[[],["result",4]],[[],["typeid",3]],[[]],[[]],[[]],[[]],[[]],[[],["result",4]],[[],["result",4]],[[],["typeid",3]],[[]],[[]],[[]],[[]],[[]],[[],["result",4]],[[],["result",4]],[[],["typeid",3]],[[]],[[["context",3],["pin",3]],["poll",4]],[[]],[[["payloaderror",4]],["protobufpayloaderror",4]],[[["protobufdecodeerror",3]],["protobufpayloaderror",4]],[[]],[[]],[[]],[[["formatter",3]],["result",6]],[[["formatter",3]],["result",6]],[[["formatter",3]],["result",6]],[[["formatter",3]],["result",6]],[[["pin",3],["context",3]],["poll",4]],[[["httprequest",3],["payload",4]]],[[],["httpresponse",3]],[[["httprequest",3]],["httpresponse",3]]],"p":[[4,"ProtoBufPayloadError"],[3,"ProtoBuf"],[3,"ProtoBufConfig"],[3,"ProtoBufMessage"],[8,"ProtoBufResponseBuilder"]]},\ +"actix_redis":{"doc":"Redis integration for Actix and session store for Actix …","t":[3,12,3,4,13,13,13,3,4,13,13,13,4,13,13,13,13,13,13,4,13,13,13,13,13,13,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11],"n":["Command","0","RedisActor","SameSite","Strict","Lax","None","RedisSession","Error","Redis","NotConnected","Disconnected","RespError","Internal","IO","RESP","Remote","Connection","Unexpected","RespValue","Nil","Array","BulkString","Error","Integer","SimpleString","from","into","borrow","borrow_mut","try_from","try_into","type_id","vzip","from","into","borrow","borrow_mut","try_from","try_into","type_id","vzip","from","into","borrow","borrow_mut","try_from","try_into","type_id","vzip","from","into","to_owned","clone_into","to_string","borrow","borrow_mut","try_from","try_into","type_id","vzip","equivalent","get_hash","from","into","to_string","borrow","borrow_mut","try_from","try_into","type_id","vzip","from","into","to_string","borrow","borrow_mut","try_from","try_into","type_id","vzip","from","into","to_owned","clone_into","borrow","borrow_mut","try_from","try_into","type_id","vzip","equivalent","from_resp_int","clone","fmt","fmt","from","from","from","from","from","from","from","from","from","source","eq","ne","fmt","clone","hash","fmt","eq","fmt","from","fmt","fmt","fmt","source","started","restarting","handle","handle","error","new_transform","start","new","ttl","cookie_name","cookie_path","cookie_domain","cookie_secure","cookie_max_age","cookie_same_site","cookie_http_only","cache_keygen","is_strict","is_lax","is_none","append","push"],"q":["actix_redis","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","",""],"d":["Command for send data to Redis","","Redis communication actor","The SameSite cookie attribute.","The “Strict” SameSite attribute.","The “Lax” SameSite attribute.","The “None” SameSite attribute.","Use redis as session storage.","General purpose actix redis error","","Receiving message during reconnecting","Cancel all waters when connection get dropped","","A non-specific internal error that prevented an operation …","An IO error occurred","A RESP parsing/serialising error occurred","A remote error","Error creating a connection, or an error with a …","An unexpected error. In this context “unexpected” …","A single RESP value, this owns the data that is …","","Zero, one or more other RespValues.","A bulk string. In Redis terminology a string is a …","An error from the Redis server","Redis documentation defines an integer as being a signed …","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","Start new Supervisor with RedisActor.","Create new redis session backend","Set time to live in seconds for session value.","Set custom cookie name for session ID.","Set custom cookie path.","Set custom cookie domain.","Set custom cookie secure.","Set custom cookie max-age.","Set custom cookie SameSite attribute.","Set custom cookie HttpOnly policy.","Set a custom cache key generation strategy, expecting …","Returns true if self is SameSite::Strict and false …","Returns true if self is SameSite::Lax and false otherwise.","Returns true if self is SameSite::None and false …","Convenience function for building dynamic Redis commands …","Push item to Resp array"],"i":[0,1,0,0,2,2,2,0,0,3,3,3,0,4,4,4,4,4,4,0,5,5,5,5,5,5,1,1,1,1,1,1,1,1,6,6,6,6,6,6,6,6,7,7,7,7,7,7,7,7,2,2,2,2,2,2,2,2,2,2,2,2,2,3,3,3,3,3,3,3,3,3,4,4,4,4,4,4,4,4,4,5,5,5,5,5,5,5,5,5,5,5,5,5,5,4,5,5,4,5,5,4,5,5,5,4,5,5,4,2,2,2,2,2,3,1,3,3,3,6,6,6,6,6,7,6,7,7,7,7,7,7,7,7,7,7,2,2,2,5,5],"f":[null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,[[]],[[]],[[]],[[]],[[],["result",4]],[[],["result",4]],[[],["typeid",3]],[[]],[[]],[[]],[[]],[[]],[[],["result",4]],[[],["result",4]],[[],["typeid",3]],[[]],[[]],[[]],[[]],[[]],[[],["result",4]],[[],["result",4]],[[],["typeid",3]],[[]],[[]],[[]],[[]],[[]],[[],["string",3]],[[]],[[]],[[],["result",4]],[[],["result",4]],[[],["typeid",3]],[[]],[[],["bool",15]],[[],["u64",15]],[[]],[[]],[[],["string",3]],[[]],[[]],[[],["result",4]],[[],["result",4]],[[],["typeid",3]],[[]],[[]],[[]],[[],["string",3]],[[]],[[]],[[],["result",4]],[[],["result",4]],[[],["typeid",3]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[],["result",4]],[[],["result",4]],[[],["typeid",3]],[[]],[[],["bool",15]],[[["respvalue",4]],[["error",4],["respvalue",4],["result",4]]],[[],["respvalue",4]],[[["formatter",3]],[["result",4],["error",3]]],[[["formatter",3]],[["result",4],["error",3]]],[[["string",3]],["respvalue",4]],[[["string",3]],["respvalue",4]],[[["trysenderror",3]],["error",4]],[[["vec",3],["u8",15],["global",3]],["respvalue",4]],[[["str",15]],["respvalue",4]],[[["error",3]],["error",4]],[[["arc",3],["str",15]],["respvalue",4]],[[],["respvalue",4]],[[["usize",15]],["respvalue",4]],[[],[["option",4],["error",8]]],[[["respvalue",4]],["bool",15]],[[["respvalue",4]],["bool",15]],[[["formatter",3]],[["result",4],["error",3]]],[[],["samesite",4]],[[]],[[["formatter",3]],[["result",4],["error",3]]],[[["samesite",4]],["bool",15]],[[["formatter",3]],[["result",4],["error",3]]],[[["error",4]],["error",4]],[[["formatter",3]],["result",6]],[[["formatter",3]],["result",6]],[[["formatter",3]],["result",6]],[[],[["option",4],["error",8]]],[[["context",3]]],[[]],[[["command",3]]],[[["respvalue",4],["result",4],["resperror",4]]],[[["error",3]],["running",4]],[[]],[[["into",8],["string",3]],[["addr",3],["redisactor",3]]],[[["into",8],["string",3]],["redissession",3]],[[["u32",15]]],[[["str",15]]],[[["str",15]]],[[["str",15]]],[[["bool",15]]],[[]],[[["samesite",4]]],[[["bool",15]]],[[["box",3],["fn",8]]],[[],["bool",15]],[[],["bool",15]],[[],["bool",15]],[[],["respvalue",4]],[[]]],"p":[[3,"Command"],[4,"SameSite"],[4,"Error"],[4,"RespError"],[4,"RespValue"],[3,"RedisActor"],[3,"RedisSession"]]},\ +"actix_session":{"doc":"Sessions for Actix Web.","t":[3,3,8,10,4,13,13,13,13,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11],"n":["CookieSession","Session","UserSession","get_session","SessionStatus","Changed","Purged","Renewed","Unchanged","get","set","remove","clear","purge","renew","set_session","get_changes","from","into","borrow","borrow_mut","try_from","try_into","type_id","vzip","from","into","borrow","borrow_mut","try_from","try_into","type_id","vzip","from","into","to_owned","clone_into","borrow","borrow_mut","try_from","try_into","type_id","vzip","clone","default","eq","fmt","new_transform","from_request","signed","private","path","name","domain","lazy","secure","http_only","same_site","max_age","max_age_time","expires_in","expires_in_time"],"q":["actix_session","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","",""],"d":["Use cookies for session storage.","The high-level interface you use to modify session data.","Extraction of a [Session] object.","","","","","","","Get a value from the session.","Set a value from the session.","Remove value from the session.","Clear the session.","Removes session, both client and server side.","Renews the session key, assigning existing session state …","Adds the given key-value pairs to the session on the …","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","Construct new signed CookieSession instance.","Construct new private CookieSession instance.","Sets the path field in the session cookie being built.","Sets the name field in the session cookie being built.","Sets the domain field in the session cookie being built.","When true, prevents adding session cookies to responses …","Sets the secure field in the session cookie being built.","Sets the http_only field in the session cookie being …","Sets the same_site field in the session cookie being …","Sets the max-age field in the session cookie being built.","Sets the max-age field in the session cookie being built.","Sets the expires field in the session cookie being built.","Sets the expires field in the session cookie being built."],"i":[0,0,0,1,0,2,2,2,2,3,3,3,3,3,3,3,3,4,4,4,4,4,4,4,4,3,3,3,3,3,3,3,3,2,2,2,2,2,2,2,2,2,2,2,2,2,2,4,3,4,4,4,4,4,4,4,4,4,4,4,4,4],"f":[null,null,null,[[],["session",3]],null,null,null,null,null,[[["str",15]],[["result",4],["option",4],["error",3]]],[[["serialize",8],["str",15]],[["error",3],["result",4]]],[[["str",15]]],[[]],[[]],[[]],[[["servicerequest",3]]],[[["serviceresponse",3]]],[[]],[[]],[[]],[[]],[[],["result",4]],[[],["result",4]],[[],["typeid",3]],[[]],[[]],[[]],[[]],[[]],[[],["result",4]],[[],["result",4]],[[],["typeid",3]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[],["result",4]],[[],["result",4]],[[],["typeid",3]],[[]],[[],["sessionstatus",4]],[[],["sessionstatus",4]],[[["sessionstatus",4]],["bool",15]],[[["formatter",3]],["result",6]],[[]],[[["httprequest",3],["payload",4]]],[[],["cookiesession",3]],[[],["cookiesession",3]],[[["into",8],["string",3]],["cookiesession",3]],[[["into",8],["string",3]],["cookiesession",3]],[[["into",8],["string",3]],["cookiesession",3]],[[["bool",15]],["cookiesession",3]],[[["bool",15]],["cookiesession",3]],[[["bool",15]],["cookiesession",3]],[[["samesite",4]],["cookiesession",3]],[[["i64",15]],["cookiesession",3]],[[["duration",3]],["cookiesession",3]],[[["i64",15]],["cookiesession",3]],[[["duration",3]],["cookiesession",3]]],"p":[[8,"UserSession"],[4,"SessionStatus"],[3,"Session"],[3,"CookieSession"]]},\ +"actix_web_httpauth":{"doc":"HTTP authentication schemes for actix-web.","t":[0,0,3,11,3,11,11,0,4,13,13,13,3,11,11,3,11,8,16,10,3,8,16,16,10,0,0,4,13,13,13,13,13,13,3,3,3,8,10,0,11,0,3,0,3,3,4,13,13,13,8,10,3,12,0,3,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11],"n":["extractors","basic","Config","realm","BasicAuth","user_id","password","bearer","Error","InvalidRequest","InvalidToken","InsufficientScope","Config","scope","realm","BearerAuth","token","AuthExtractorConfig","Inner","into_inner","AuthenticationError","AuthExtractor","Error","Future","from_service_request","headers","authorization","ParseError","Invalid","MissingScheme","MissingField","ToStrError","Base64DecodeError","Utf8Error","Authorization","Basic","Bearer","Scheme","parse","www_authenticate","status_code","basic","Basic","bearer","BearerBuilder","Bearer","Error","InvalidRequest","InvalidToken","InsufficientScope","Challenge","to_bytes","WwwAuthenticate","0","middleware","HttpAuthentication","with_fn","basic","bearer","from","into","to_owned","clone_into","borrow","borrow_mut","try_from","try_into","type_id","vzip","from","into","to_owned","clone_into","borrow","borrow_mut","try_from","try_into","type_id","vzip","from","into","to_owned","clone_into","to_string","borrow","borrow_mut","try_from","try_into","type_id","equivalent","get_hash","vzip","from","into","to_owned","clone_into","borrow","borrow_mut","try_from","try_into","type_id","vzip","from","into","to_owned","clone_into","borrow","borrow_mut","try_from","try_into","type_id","vzip","from","into","to_string","borrow","borrow_mut","try_from","try_into","type_id","vzip","from","into","to_string","borrow","borrow_mut","try_from","try_into","type_id","vzip","from","from","into","to_owned","clone_into","to_string","borrow","borrow_mut","try_from","try_into","type_id","try_into_header_pair","equivalent","get_hash","vzip","from","into","to_owned","clone_into","to_string","borrow","borrow_mut","try_from","try_into","type_id","equivalent","vzip","from","into","to_owned","clone_into","to_string","borrow","borrow_mut","try_from","try_into","type_id","equivalent","vzip","from","into","to_owned","clone_into","to_string","borrow","borrow_mut","try_from","try_into","type_id","equivalent","get_hash","vzip","from","into","borrow","borrow_mut","try_from","try_into","type_id","vzip","from","into","to_owned","clone_into","to_string","borrow","borrow_mut","try_from","try_into","type_id","equivalent","get_hash","vzip","from","into","to_owned","clone_into","borrow","borrow_mut","try_from","try_into","type_id","try_into_header_pair","equivalent","get_hash","vzip","from","into","to_owned","clone_into","borrow","borrow_mut","try_from","try_into","type_id","vzip","into_inner","into_inner","from_service_request","from_service_request","parse","parse","as_mut","as_ref","as_ref","as_ref","from","from","from","from","from","clone","clone","clone","clone","clone","clone","clone","clone","clone","clone","clone","clone","default","default","default","default","default","default","default","cmp","cmp","cmp","cmp","cmp","cmp","cmp","eq","ne","eq","ne","eq","ne","eq","ne","eq","ne","eq","eq","ne","partial_cmp","partial_cmp","partial_cmp","partial_cmp","partial_cmp","partial_cmp","partial_cmp","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","hash","hash","hash","hash","hash","source","new_transform","from_request","from_request","error_response","status_code","try_into_value","try_into_value","try_into_value","try_into_value","try_into_value","try_into_value","name","parse","name","parse","with_error","with_error_description","with_error_uri","new","challenge_mut","status_code_mut","into_scheme","new","user_id","password","new","token","new","with_realm","scope","realm","error","error_description","error_uri","finish","build"],"q":["actix_web_httpauth","actix_web_httpauth::extractors","actix_web_httpauth::extractors::basic","","","","","actix_web_httpauth::extractors","actix_web_httpauth::extractors::bearer","","","","","","","","","actix_web_httpauth::extractors","","","","","","","","actix_web_httpauth","actix_web_httpauth::headers","actix_web_httpauth::headers::authorization","","","","","","","","","","","","actix_web_httpauth::headers","actix_web_httpauth::extractors::bearer","actix_web_httpauth::headers::www_authenticate","actix_web_httpauth::headers::www_authenticate::basic","actix_web_httpauth::headers::www_authenticate","actix_web_httpauth::headers::www_authenticate::bearer","","","","","","actix_web_httpauth::headers::www_authenticate","","","","actix_web_httpauth","actix_web_httpauth::middleware","","","","actix_web_httpauth::extractors::basic","","","","","","","","","","","","","","","","","","","","actix_web_httpauth::extractors::bearer","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","actix_web_httpauth::extractors","","","","","","","","","actix_web_httpauth::headers::authorization","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","actix_web_httpauth::headers::www_authenticate::basic","","","","","","","","","","","","","actix_web_httpauth::headers::www_authenticate::bearer","","","","","","","","","","","","","","","","","","","","","actix_web_httpauth::headers::www_authenticate","","","","","","","","","","","","","actix_web_httpauth::middleware","","","","","","","","","","actix_web_httpauth::extractors::basic","actix_web_httpauth::extractors::bearer","actix_web_httpauth::extractors::basic","actix_web_httpauth::extractors::bearer","actix_web_httpauth::headers::authorization","","","actix_web_httpauth::extractors::basic","actix_web_httpauth::extractors::bearer","actix_web_httpauth::headers::authorization","actix_web_httpauth::extractors","actix_web_httpauth::headers::authorization","","","","actix_web_httpauth::extractors::basic","","actix_web_httpauth::extractors::bearer","","actix_web_httpauth::headers::authorization","","","actix_web_httpauth::headers::www_authenticate::basic","actix_web_httpauth::headers::www_authenticate::bearer","actix_web_httpauth::extractors::bearer","actix_web_httpauth::headers::www_authenticate","actix_web_httpauth::middleware","actix_web_httpauth::extractors::basic","actix_web_httpauth::extractors::bearer","actix_web_httpauth::headers::authorization","actix_web_httpauth::headers::www_authenticate::basic","actix_web_httpauth::headers::www_authenticate::bearer","","actix_web_httpauth::headers::www_authenticate","actix_web_httpauth::headers::authorization","","","actix_web_httpauth::headers::www_authenticate::basic","actix_web_httpauth::headers::www_authenticate::bearer","actix_web_httpauth::extractors::bearer","actix_web_httpauth::headers::www_authenticate","actix_web_httpauth::headers::authorization","","","","","","actix_web_httpauth::headers::www_authenticate::basic","","actix_web_httpauth::headers::www_authenticate::bearer","","actix_web_httpauth::extractors::bearer","actix_web_httpauth::headers::www_authenticate","","actix_web_httpauth::headers::authorization","","","actix_web_httpauth::headers::www_authenticate::basic","actix_web_httpauth::headers::www_authenticate::bearer","actix_web_httpauth::extractors::bearer","actix_web_httpauth::headers::www_authenticate","actix_web_httpauth::extractors::basic","","actix_web_httpauth::extractors::bearer","","actix_web_httpauth::extractors","actix_web_httpauth::headers::authorization","","","","actix_web_httpauth::headers::www_authenticate::basic","actix_web_httpauth::headers::www_authenticate::bearer","","actix_web_httpauth::extractors::bearer","actix_web_httpauth::headers::www_authenticate","actix_web_httpauth::middleware","actix_web_httpauth::extractors","actix_web_httpauth::headers::authorization","","","","actix_web_httpauth::headers::www_authenticate::basic","actix_web_httpauth::headers::www_authenticate::bearer","actix_web_httpauth::extractors::bearer","actix_web_httpauth::headers::authorization","actix_web_httpauth::headers::www_authenticate::basic","actix_web_httpauth::headers::www_authenticate::bearer","actix_web_httpauth::extractors::bearer","actix_web_httpauth::headers::www_authenticate","actix_web_httpauth::headers::authorization","actix_web_httpauth::middleware","actix_web_httpauth::extractors::basic","actix_web_httpauth::extractors::bearer","actix_web_httpauth::extractors","","actix_web_httpauth::headers::authorization","","","actix_web_httpauth::headers::www_authenticate::basic","actix_web_httpauth::headers::www_authenticate::bearer","actix_web_httpauth::headers::www_authenticate","actix_web_httpauth::headers::authorization","","actix_web_httpauth::headers::www_authenticate","","actix_web_httpauth::extractors","","","","","","actix_web_httpauth::headers::authorization","","","","","","actix_web_httpauth::headers::www_authenticate::basic","","actix_web_httpauth::headers::www_authenticate::bearer","","","","","",""],"d":["Type-safe authentication information extractors","Extractor for the “Basic” HTTP Authentication Scheme","BasicAuth extractor configuration, used for …","Set challenge realm attribute.","Extractor for HTTP Basic auth.","Returns client’s user-ID.","Returns client’s password.","Extractor for the “Bearer” HTTP Authentication Scheme","Bearer authorization error types, described in RFC 6750","The request is missing a required parameter, includes an …","The access token provided is expired, revoked, malformed, …","The request requires higher privileges than provided by …","BearerAuth extractor configuration.","Set challenge scope attribute.","Set challenge realm attribute.","Extractor for HTTP Bearer auth","Returns bearer token provided by client.","Trait implemented for types that provides configuration …","Associated challenge type.","Convert the config instance into a HTTP challenge.","Authentication error returned by authentication …","Trait implemented by types that can extract HTTP …","The associated error which can be returned.","Future that resolves into extracted credentials type.","Parse the authentication credentials from the actix’ …","Typed HTTP headers","Authorization header and various auth schemes","Possible errors while parsing Authorization header.","Header value is malformed","Authentication scheme is missing","Required authentication field is missing","Unable to convert header into the str","Malformed base64 string","Malformed UTF-8 string","Authorization header, defined in RFC 7235","Credentials for Basic authentication scheme, defined in …","Credentials for Bearer authentication scheme, defined in …","Authentication scheme for Authorization header.","Try to parse the authentication scheme from the …","WWW-Authenticate header and various auth challenges","Returns HTTP status code suitable for current error type.","Challenge for the “Basic” HTTP Authentication Scheme","Challenge for WWW-Authenticate header with HTTP Basic …","Challenge for the “Bearer” HTTP Authentication Scheme","Builder for the Bearer challenge.","Challenge for WWW-Authenticate header with HTTP Bearer …","Bearer authorization error types, described in RFC 6750","The request is missing a required parameter, includes an …","The access token provided is expired, revoked, malformed, …","The request requires higher privileges than provided by …","Authentication challenge for WWW-Authenticate header.","Converts the challenge into a bytes suitable for HTTP …","WWW-Authenticate header, described in RFC 7235","","HTTP Authentication middleware.","Middleware for checking HTTP authentication.","Construct HttpAuthentication middleware with the provided …","Construct HttpAuthentication middleware for the HTTP “…","Construct HttpAuthentication middleware for the HTTP “…","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","Attach Error to the current Authentication error.","Attach error description to the current Authentication …","Attach error URI to the current Authentication error.","Creates new authentication error from the provided …","Returns mutable reference to the inner challenge instance.","Returns mutable reference to the inner status code.","Consumes Authorization header and returns inner Scheme …","Creates Basic credentials with provided user_id and …","Returns client’s user-ID.","Returns client’s password if provided.","Creates new Bearer credentials with the token provided.","Gets reference to the credentials token.","Creates new Basic challenge with an empty realm field.","Creates new Basic challenge from the provided realm field …","Provides the scope attribute, as defined in RFC6749, …","Provides the realm attribute, as defined in RFC2617","Provides the error attribute, as defined in RFC6750, …","Provides the error_description attribute, as defined in …","Provides the error_uri attribute, as defined in RFC6750, …","Consumes the builder and returns built Bearer instance.","Creates the builder for Bearer challenge."],"i":[0,0,0,1,0,2,2,0,0,3,3,3,0,4,4,0,5,0,6,6,0,0,7,7,7,0,0,0,8,8,8,8,8,8,0,0,0,0,9,0,3,0,0,0,0,0,0,3,3,3,0,10,0,11,0,0,12,12,12,1,1,1,1,1,1,1,1,1,1,2,2,2,2,2,2,2,2,2,2,3,3,3,3,3,3,3,3,3,3,3,3,3,4,4,4,4,4,4,4,4,4,4,5,5,5,5,5,5,5,5,5,5,13,13,13,13,13,13,13,13,13,8,8,8,8,8,8,8,8,8,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,15,15,15,15,15,15,15,15,15,15,15,15,16,16,16,16,16,16,16,16,16,16,16,16,17,17,17,17,17,17,17,17,17,17,17,17,17,18,18,18,18,18,18,18,18,19,19,19,19,19,19,19,19,19,19,19,19,19,11,11,11,11,11,11,11,11,11,11,11,11,11,12,12,12,12,12,12,12,12,12,12,1,4,2,5,15,16,14,1,4,14,13,8,8,8,14,1,2,4,5,14,15,16,17,19,3,11,12,1,4,14,17,18,19,11,14,15,16,17,19,3,11,14,14,15,15,16,16,17,17,19,19,3,11,11,14,15,16,17,19,3,11,1,2,4,5,13,8,14,15,16,17,18,19,3,11,12,13,8,14,15,16,17,19,3,14,17,19,3,11,8,12,2,5,13,13,14,15,16,17,19,11,14,14,11,11,13,13,13,13,13,13,14,15,15,15,16,16,17,17,18,18,18,18,18,18,19],"f":[null,null,null,[[],["config",3]],null,[[],["cow",4]],[[],[["option",4],["cow",4]]],null,null,null,null,null,null,[[["cow",4],["into",8]],["config",3]],[[["cow",4],["into",8]],["config",3]],null,[[],["str",15]],null,null,[[]],null,null,null,null,[[["servicerequest",3]]],null,null,null,null,null,null,null,null,null,null,null,null,null,[[["headervalue",3]],[["result",4],["parseerror",4]]],null,[[],["statuscode",3]],null,null,null,null,null,null,null,null,null,null,[[],["bytes",3]],null,null,null,null,[[],["httpauthentication",3]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[],["result",4]],[[],["result",4]],[[],["typeid",3]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[],["result",4]],[[],["result",4]],[[],["typeid",3]],[[]],[[]],[[]],[[]],[[]],[[],["string",3]],[[]],[[]],[[],["result",4]],[[],["result",4]],[[],["typeid",3]],[[],["bool",15]],[[],["u64",15]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[],["result",4]],[[],["result",4]],[[],["typeid",3]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[],["result",4]],[[],["result",4]],[[],["typeid",3]],[[]],[[]],[[]],[[],["string",3]],[[]],[[]],[[],["result",4]],[[],["result",4]],[[],["typeid",3]],[[]],[[]],[[]],[[],["string",3]],[[]],[[]],[[],["result",4]],[[],["result",4]],[[],["typeid",3]],[[]],[[]],[[]],[[]],[[]],[[]],[[],["string",3]],[[]],[[]],[[],["result",4]],[[],["result",4]],[[],["typeid",3]],[[],["result",4]],[[],["bool",15]],[[],["u64",15]],[[]],[[]],[[]],[[]],[[]],[[],["string",3]],[[]],[[]],[[],["result",4]],[[],["result",4]],[[],["typeid",3]],[[],["bool",15]],[[]],[[]],[[]],[[]],[[]],[[],["string",3]],[[]],[[]],[[],["result",4]],[[],["result",4]],[[],["typeid",3]],[[],["bool",15]],[[]],[[]],[[]],[[]],[[]],[[],["string",3]],[[]],[[]],[[],["result",4]],[[],["result",4]],[[],["typeid",3]],[[],["bool",15]],[[],["u64",15]],[[]],[[]],[[]],[[]],[[]],[[],["result",4]],[[],["result",4]],[[],["typeid",3]],[[]],[[]],[[]],[[]],[[]],[[],["string",3]],[[]],[[]],[[],["result",4]],[[],["result",4]],[[],["typeid",3]],[[],["bool",15]],[[],["u64",15]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[],["result",4]],[[],["result",4]],[[],["typeid",3]],[[],["result",4]],[[],["bool",15]],[[],["u64",15]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[],["result",4]],[[],["result",4]],[[],["typeid",3]],[[]],[[]],[[]],[[["servicerequest",3]]],[[["servicerequest",3]]],[[["headervalue",3]],[["result",4],["parseerror",4]]],[[["headervalue",3]],[["result",4],["parseerror",4]]],[[]],[[],["challenge",3]],[[],["bearer",3]],[[]],[[]],[[["tostrerror",3]]],[[["decodeerror",4]]],[[["utf8error",3]]],[[],["authorization",3]],[[],["config",3]],[[],["basicauth",3]],[[],["config",3]],[[],["bearerauth",3]],[[],["authorization",3]],[[],["basic",3]],[[],["bearer",3]],[[],["basic",3]],[[],["bearer",3]],[[],["error",4]],[[],["wwwauthenticate",3]],[[],["httpauthentication",3]],[[],["config",3]],[[],["config",3]],[[],["authorization",3]],[[],["basic",3]],[[],["bearerbuilder",3]],[[],["bearer",3]],[[],["wwwauthenticate",3]],[[["authorization",3]],["ordering",4]],[[["basic",3]],["ordering",4]],[[["bearer",3]],["ordering",4]],[[["basic",3]],["ordering",4]],[[["bearer",3]],["ordering",4]],[[["error",4]],["ordering",4]],[[["wwwauthenticate",3]],["ordering",4]],[[["authorization",3]],["bool",15]],[[["authorization",3]],["bool",15]],[[["basic",3]],["bool",15]],[[["basic",3]],["bool",15]],[[["bearer",3]],["bool",15]],[[["bearer",3]],["bool",15]],[[["basic",3]],["bool",15]],[[["basic",3]],["bool",15]],[[["bearer",3]],["bool",15]],[[["bearer",3]],["bool",15]],[[["error",4]],["bool",15]],[[["wwwauthenticate",3]],["bool",15]],[[["wwwauthenticate",3]],["bool",15]],[[["authorization",3]],[["option",4],["ordering",4]]],[[["basic",3]],[["option",4],["ordering",4]]],[[["bearer",3]],[["option",4],["ordering",4]]],[[["basic",3]],[["option",4],["ordering",4]]],[[["bearer",3]],[["option",4],["ordering",4]]],[[["error",4]],[["option",4],["ordering",4]]],[[["wwwauthenticate",3]],[["option",4],["ordering",4]]],[[["formatter",3]],["result",6]],[[["formatter",3]],["result",6]],[[["formatter",3]],["result",6]],[[["formatter",3]],["result",6]],[[["formatter",3]],["result",6]],[[["formatter",3]],["result",6]],[[["formatter",3]],["result",6]],[[["formatter",3]],["result",6]],[[["formatter",3]],["result",6]],[[["formatter",3]],["result",6]],[[["formatter",3]],["result",6]],[[["formatter",3]],["result",6]],[[["formatter",3]],["result",6]],[[["formatter",3]],["result",6]],[[["formatter",3]],["result",6]],[[["formatter",3]],["result",6]],[[["formatter",3]],["result",6]],[[["formatter",3]],["result",6]],[[["formatter",3]],["result",6]],[[["formatter",3]],["result",6]],[[["formatter",3]],[["error",3],["result",4]]],[[["formatter",3]],[["error",3],["result",4]]],[[["formatter",3]],["result",6]],[[]],[[]],[[]],[[]],[[]],[[],[["option",4],["error",8]]],[[]],[[["httprequest",3],["payload",4]]],[[["httprequest",3],["payload",4]]],[[],["httpresponse",3]],[[],["statuscode",3]],[[],[["result",4],["headervalue",3]]],[[],[["result",4],["headervalue",3]]],[[],[["result",4],["headervalue",3]]],[[],[["result",4],["headervalue",3]]],[[],[["result",4],["headervalue",3]]],[[],[["result",4],["headervalue",3]]],[[],["headername",3]],[[],[["parseerror",4],["result",4]]],[[],["headername",3]],[[],[["parseerror",4],["result",4]]],[[["error",4]]],[[]],[[]],[[],["authenticationerror",3]],[[]],[[],["statuscode",3]],[[]],[[["option",4]],["basic",3]],[[],["cow",4]],[[],[["option",4],["cow",4]]],[[],["bearer",3]],[[],["cow",4]],[[],["basic",3]],[[],["basic",3]],[[]],[[]],[[["error",4]]],[[]],[[]],[[],["bearer",3]],[[],["bearerbuilder",3]]],"p":[[3,"Config"],[3,"BasicAuth"],[4,"Error"],[3,"Config"],[3,"BearerAuth"],[8,"AuthExtractorConfig"],[8,"AuthExtractor"],[4,"ParseError"],[8,"Scheme"],[8,"Challenge"],[3,"WwwAuthenticate"],[3,"HttpAuthentication"],[3,"AuthenticationError"],[3,"Authorization"],[3,"Basic"],[3,"Bearer"],[3,"Basic"],[3,"BearerBuilder"],[3,"Bearer"]]},\ "prost_example":{"doc":"","t":[3,12,12,5,5,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11],"n":["MyObj","number","name","index","main","from","into","to_owned","clone_into","borrow","borrow_mut","try_from","try_into","type_id","vzip","clone","default","eq","ne","fmt","encode_raw","merge_field","encoded_len","clear"],"q":["prost_example","","","","","","","","","","","","","","","","","","","","","","",""],"d":["","","","","","","","","","","","","","","","","","","","","","","",""],"i":[0,1,1,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1],"f":[null,null,null,[[["protobuf",3],["myobj",3]]],[[],["result",6]],[[]],[[]],[[]],[[]],[[]],[[]],[[],["result",4]],[[],["result",4]],[[],["typeid",3]],[[]],[[],["myobj",3]],[[]],[[["myobj",3]],["bool",15]],[[["myobj",3]],["bool",15]],[[["formatter",3]],["result",6]],[[]],[[["u32",15],["wiretype",4],["decodecontext",3]],[["decodeerror",3],["result",4]]],[[],["usize",15]],[[]]],"p":[[3,"MyObj"]]}\ }'); initSearch(searchIndex); \ No newline at end of file diff --git a/source-files.js b/source-files.js index 7a8f9e36a..0fdefc875 100644 --- a/source-files.js +++ b/source-files.js @@ -1,6 +1,6 @@ var N = null;var sourcesIndex = {}; sourcesIndex["actix_cors"] = {"name":"","files":["all_or_some.rs","builder.rs","error.rs","inner.rs","lib.rs","middleware.rs"]}; -sourcesIndex["actix_identity"] = {"name":"","files":["lib.rs"]}; +sourcesIndex["actix_identity"] = {"name":"","files":["cookie.rs","identity.rs","lib.rs","middleware.rs"]}; sourcesIndex["actix_protobuf"] = {"name":"","files":["lib.rs"]}; sourcesIndex["actix_redis"] = {"name":"","files":["lib.rs","redis.rs","session.rs"]}; sourcesIndex["actix_session"] = {"name":"","files":["cookie.rs","lib.rs"]}; diff --git a/src/actix_identity/cookie.rs.html b/src/actix_identity/cookie.rs.html new file mode 100644 index 000000000..eb6d693d6 --- /dev/null +++ b/src/actix_identity/cookie.rs.html @@ -0,0 +1,1661 @@ +cookie.rs - source + +
  1
+  2
+  3
+  4
+  5
+  6
+  7
+  8
+  9
+ 10
+ 11
+ 12
+ 13
+ 14
+ 15
+ 16
+ 17
+ 18
+ 19
+ 20
+ 21
+ 22
+ 23
+ 24
+ 25
+ 26
+ 27
+ 28
+ 29
+ 30
+ 31
+ 32
+ 33
+ 34
+ 35
+ 36
+ 37
+ 38
+ 39
+ 40
+ 41
+ 42
+ 43
+ 44
+ 45
+ 46
+ 47
+ 48
+ 49
+ 50
+ 51
+ 52
+ 53
+ 54
+ 55
+ 56
+ 57
+ 58
+ 59
+ 60
+ 61
+ 62
+ 63
+ 64
+ 65
+ 66
+ 67
+ 68
+ 69
+ 70
+ 71
+ 72
+ 73
+ 74
+ 75
+ 76
+ 77
+ 78
+ 79
+ 80
+ 81
+ 82
+ 83
+ 84
+ 85
+ 86
+ 87
+ 88
+ 89
+ 90
+ 91
+ 92
+ 93
+ 94
+ 95
+ 96
+ 97
+ 98
+ 99
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109
+110
+111
+112
+113
+114
+115
+116
+117
+118
+119
+120
+121
+122
+123
+124
+125
+126
+127
+128
+129
+130
+131
+132
+133
+134
+135
+136
+137
+138
+139
+140
+141
+142
+143
+144
+145
+146
+147
+148
+149
+150
+151
+152
+153
+154
+155
+156
+157
+158
+159
+160
+161
+162
+163
+164
+165
+166
+167
+168
+169
+170
+171
+172
+173
+174
+175
+176
+177
+178
+179
+180
+181
+182
+183
+184
+185
+186
+187
+188
+189
+190
+191
+192
+193
+194
+195
+196
+197
+198
+199
+200
+201
+202
+203
+204
+205
+206
+207
+208
+209
+210
+211
+212
+213
+214
+215
+216
+217
+218
+219
+220
+221
+222
+223
+224
+225
+226
+227
+228
+229
+230
+231
+232
+233
+234
+235
+236
+237
+238
+239
+240
+241
+242
+243
+244
+245
+246
+247
+248
+249
+250
+251
+252
+253
+254
+255
+256
+257
+258
+259
+260
+261
+262
+263
+264
+265
+266
+267
+268
+269
+270
+271
+272
+273
+274
+275
+276
+277
+278
+279
+280
+281
+282
+283
+284
+285
+286
+287
+288
+289
+290
+291
+292
+293
+294
+295
+296
+297
+298
+299
+300
+301
+302
+303
+304
+305
+306
+307
+308
+309
+310
+311
+312
+313
+314
+315
+316
+317
+318
+319
+320
+321
+322
+323
+324
+325
+326
+327
+328
+329
+330
+331
+332
+333
+334
+335
+336
+337
+338
+339
+340
+341
+342
+343
+344
+345
+346
+347
+348
+349
+350
+351
+352
+353
+354
+355
+356
+357
+358
+359
+360
+361
+362
+363
+364
+365
+366
+367
+368
+369
+370
+371
+372
+373
+374
+375
+376
+377
+378
+379
+380
+381
+382
+383
+384
+385
+386
+387
+388
+389
+390
+391
+392
+393
+394
+395
+396
+397
+398
+399
+400
+401
+402
+403
+404
+405
+406
+407
+408
+409
+410
+411
+412
+413
+414
+415
+416
+417
+418
+419
+420
+421
+422
+423
+424
+425
+426
+427
+428
+429
+430
+431
+432
+433
+434
+435
+436
+437
+438
+439
+440
+441
+442
+443
+444
+445
+446
+447
+448
+449
+450
+451
+452
+453
+454
+455
+456
+457
+458
+459
+460
+461
+462
+463
+464
+465
+466
+467
+468
+469
+470
+471
+472
+473
+474
+475
+476
+477
+478
+479
+480
+481
+482
+483
+484
+485
+486
+487
+488
+489
+490
+491
+492
+493
+494
+495
+496
+497
+498
+499
+500
+501
+502
+503
+504
+505
+506
+507
+508
+509
+510
+511
+512
+513
+514
+515
+516
+517
+518
+519
+520
+521
+522
+523
+524
+525
+526
+527
+528
+529
+530
+531
+532
+533
+534
+535
+536
+537
+538
+539
+540
+541
+542
+543
+544
+545
+546
+547
+548
+549
+550
+551
+552
+553
+554
+555
+556
+557
+558
+559
+560
+561
+562
+563
+564
+565
+566
+567
+568
+569
+570
+571
+572
+573
+574
+575
+576
+577
+578
+579
+580
+581
+582
+583
+584
+585
+586
+587
+588
+589
+590
+591
+592
+593
+594
+595
+596
+597
+598
+599
+600
+601
+602
+603
+604
+605
+606
+607
+608
+609
+610
+611
+612
+613
+614
+615
+616
+617
+618
+619
+620
+621
+622
+623
+624
+625
+626
+627
+628
+629
+630
+631
+632
+633
+634
+635
+636
+637
+638
+639
+640
+641
+642
+643
+644
+645
+646
+647
+648
+649
+650
+651
+652
+653
+654
+655
+656
+657
+658
+659
+660
+661
+662
+663
+664
+665
+666
+667
+668
+669
+670
+671
+672
+673
+674
+675
+676
+677
+678
+679
+680
+681
+682
+683
+684
+685
+686
+687
+688
+689
+690
+691
+692
+693
+694
+695
+696
+697
+698
+699
+700
+701
+702
+703
+704
+705
+706
+707
+708
+709
+710
+711
+712
+713
+714
+715
+716
+717
+718
+719
+720
+721
+722
+723
+724
+725
+726
+727
+728
+729
+730
+731
+732
+733
+734
+735
+736
+737
+738
+739
+740
+741
+742
+743
+744
+745
+746
+747
+748
+749
+750
+751
+752
+753
+754
+755
+756
+757
+758
+759
+760
+761
+762
+763
+764
+765
+766
+767
+768
+769
+770
+771
+772
+773
+774
+775
+776
+777
+778
+779
+780
+781
+782
+783
+784
+785
+786
+787
+788
+789
+790
+791
+792
+793
+794
+795
+796
+797
+798
+799
+800
+801
+802
+803
+804
+805
+806
+807
+808
+809
+810
+811
+812
+813
+814
+815
+816
+817
+818
+819
+820
+821
+822
+823
+824
+825
+826
+827
+
+use std::{rc::Rc, time::SystemTime};
+
+use futures_util::future::{ready, Ready};
+use serde::{Deserialize, Serialize};
+use time::Duration;
+
+use actix_web::{
+    cookie::{Cookie, CookieJar, Key, SameSite},
+    dev::{ServiceRequest, ServiceResponse},
+    error::{Error, Result},
+    http::header::{self, HeaderValue},
+    HttpMessage,
+};
+
+use crate::IdentityPolicy;
+
+struct CookieIdentityInner {
+    key: Key,
+    key_v2: Key,
+    name: String,
+    path: String,
+    domain: Option<String>,
+    secure: bool,
+    max_age: Option<Duration>,
+    http_only: Option<bool>,
+    same_site: Option<SameSite>,
+    visit_deadline: Option<Duration>,
+    login_deadline: Option<Duration>,
+}
+
+#[derive(Debug, Deserialize, Serialize)]
+struct CookieValue {
+    identity: String,
+
+    #[serde(skip_serializing_if = "Option::is_none")]
+    login_timestamp: Option<SystemTime>,
+
+    #[serde(skip_serializing_if = "Option::is_none")]
+    visit_timestamp: Option<SystemTime>,
+}
+
+#[derive(Debug)]
+struct CookieIdentityExtension {
+    login_timestamp: Option<SystemTime>,
+}
+
+impl CookieIdentityInner {
+    fn new(key: &[u8]) -> CookieIdentityInner {
+        let key_v2: Vec<u8> = [key, &[1, 0, 0, 0]].concat();
+
+        CookieIdentityInner {
+            key: Key::derive_from(key),
+            key_v2: Key::derive_from(&key_v2),
+            name: "actix-identity".to_owned(),
+            path: "/".to_owned(),
+            domain: None,
+            secure: true,
+            max_age: None,
+            http_only: None,
+            same_site: None,
+            visit_deadline: None,
+            login_deadline: None,
+        }
+    }
+
+    fn set_cookie<B>(
+        &self,
+        resp: &mut ServiceResponse<B>,
+        value: Option<CookieValue>,
+    ) -> Result<()> {
+        let add_cookie = value.is_some();
+        let val = value.map(|val| {
+            if !self.legacy_supported() {
+                serde_json::to_string(&val)
+            } else {
+                Ok(val.identity)
+            }
+        });
+
+        let mut cookie =
+            Cookie::new(self.name.clone(), val.unwrap_or_else(|| Ok(String::new()))?);
+        cookie.set_path(self.path.clone());
+        cookie.set_secure(self.secure);
+        cookie.set_http_only(true);
+
+        if let Some(ref domain) = self.domain {
+            cookie.set_domain(domain.clone());
+        }
+
+        if let Some(max_age) = self.max_age {
+            cookie.set_max_age(max_age);
+        }
+
+        if let Some(http_only) = self.http_only {
+            cookie.set_http_only(http_only);
+        }
+
+        if let Some(same_site) = self.same_site {
+            cookie.set_same_site(same_site);
+        }
+
+        let mut jar = CookieJar::new();
+
+        let key = if self.legacy_supported() {
+            &self.key
+        } else {
+            &self.key_v2
+        };
+
+        if add_cookie {
+            jar.private(&key).add(cookie);
+        } else {
+            jar.add_original(cookie.clone());
+            jar.private(&key).remove(cookie);
+        }
+
+        for cookie in jar.delta() {
+            let val = HeaderValue::from_str(&cookie.to_string())?;
+            resp.headers_mut().append(header::SET_COOKIE, val);
+        }
+
+        Ok(())
+    }
+
+    fn load(&self, req: &ServiceRequest) -> Option<CookieValue> {
+        let cookie = req.cookie(&self.name)?;
+        let mut jar = CookieJar::new();
+        jar.add_original(cookie.clone());
+
+        let res = if self.legacy_supported() {
+            jar.private(&self.key).get(&self.name).map(|n| CookieValue {
+                identity: n.value().to_string(),
+                login_timestamp: None,
+                visit_timestamp: None,
+            })
+        } else {
+            None
+        };
+
+        res.or_else(|| {
+            jar.private(&self.key_v2)
+                .get(&self.name)
+                .and_then(|c| self.parse(c))
+        })
+    }
+
+    fn parse(&self, cookie: Cookie<'_>) -> Option<CookieValue> {
+        let value: CookieValue = serde_json::from_str(cookie.value()).ok()?;
+        let now = SystemTime::now();
+
+        if let Some(visit_deadline) = self.visit_deadline {
+            let inactivity = now.duration_since(value.visit_timestamp?).ok()?;
+
+            if inactivity > visit_deadline {
+                return None;
+            }
+        }
+
+        if let Some(login_deadline) = self.login_deadline {
+            let logged_in_dur = now.duration_since(value.login_timestamp?).ok()?;
+
+            if logged_in_dur > login_deadline {
+                return None;
+            }
+        }
+
+        Some(value)
+    }
+
+    fn legacy_supported(&self) -> bool {
+        self.visit_deadline.is_none() && self.login_deadline.is_none()
+    }
+
+    fn always_update_cookie(&self) -> bool {
+        self.visit_deadline.is_some()
+    }
+
+    fn requires_oob_data(&self) -> bool {
+        self.login_deadline.is_some()
+    }
+}
+
+/// Use cookies for request identity storage.
+///
+/// [See this page on MDN](mdn-cookies) for details on cookie attributes.
+///
+/// # Examples
+/// ```
+/// use actix_web::App;
+/// use actix_identity::{CookieIdentityPolicy, IdentityService};
+///
+/// // create cookie identity backend
+/// let policy = CookieIdentityPolicy::new(&[0; 32])
+///            .domain("www.rust-lang.org")
+///            .name("actix_auth")
+///            .path("/")
+///            .secure(true);
+///
+/// let app = App::new()
+///     // wrap policy into identity middleware
+///     .wrap(IdentityService::new(policy));
+/// ```
+///
+/// [mdn-cookies]: https://developer.mozilla.org/en-US/docs/Web/HTTP/Cookies
+pub struct CookieIdentityPolicy(Rc<CookieIdentityInner>);
+
+impl CookieIdentityPolicy {
+    /// Create new `CookieIdentityPolicy` instance.
+    ///
+    /// Key argument is the private key for issued cookies. If this value is changed, all issued
+    /// cookie identities are invalidated.
+    ///
+    /// # Panics
+    /// Panics if `key` is less than 32 bytes in length..
+    pub fn new(key: &[u8]) -> CookieIdentityPolicy {
+        CookieIdentityPolicy(Rc::new(CookieIdentityInner::new(key)))
+    }
+
+    /// Sets the name of issued cookies.
+    pub fn name(mut self, value: impl Into<String>) -> CookieIdentityPolicy {
+        self.inner_mut().name = value.into();
+        self
+    }
+
+    /// Sets the `Path` attribute of issued cookies.
+    pub fn path(mut self, value: impl Into<String>) -> CookieIdentityPolicy {
+        self.inner_mut().path = value.into();
+        self
+    }
+
+    /// Sets the `Domain` attribute of issued cookies.
+    pub fn domain(mut self, value: impl Into<String>) -> CookieIdentityPolicy {
+        self.inner_mut().domain = Some(value.into());
+        self
+    }
+
+    /// Sets the `Secure` attribute of issued cookies.
+    pub fn secure(mut self, value: bool) -> CookieIdentityPolicy {
+        self.inner_mut().secure = value;
+        self
+    }
+
+    /// Sets the `Max-Age` attribute of issued cookies.
+    pub fn max_age(mut self, value: Duration) -> CookieIdentityPolicy {
+        self.inner_mut().max_age = Some(value);
+        self
+    }
+
+    /// Sets the `Max-Age` attribute of issued cookies with given number of seconds.
+    pub fn max_age_secs(self, seconds: i64) -> CookieIdentityPolicy {
+        self.max_age(Duration::seconds(seconds))
+    }
+
+    /// Sets the `HttpOnly` attribute of issued cookies.
+    ///
+    /// By default, the `HttpOnly` attribute is omitted from issued cookies.
+    pub fn http_only(mut self, http_only: bool) -> Self {
+        self.inner_mut().http_only = Some(http_only);
+        self
+    }
+
+    /// Sets the `SameSite` attribute of issued cookies.
+    ///
+    /// By default, the `SameSite` attribute is omitted from issued cookies.
+    pub fn same_site(mut self, same_site: SameSite) -> Self {
+        self.inner_mut().same_site = Some(same_site);
+        self
+    }
+
+    /// Accepts only users who have visited within given deadline.
+    ///
+    /// In other words, invalidate a login after some amount of inactivity. Using this feature
+    /// causes updated cookies to be issued on each response in order to record the user's last
+    /// visitation timestamp.
+    ///
+    /// By default, visit deadline is disabled.
+    pub fn visit_deadline(mut self, deadline: Duration) -> CookieIdentityPolicy {
+        self.inner_mut().visit_deadline = Some(deadline);
+        self
+    }
+
+    /// Accepts only users who authenticated within the given deadline.
+    ///
+    /// In other words, invalidate a login after some amount of time, regardless of activity.
+    /// While [`Max-Age`](CookieIdentityPolicy::max_age) is useful in constraining the cookie
+    /// lifetime, it could be extended manually; using this feature encodes the deadline directly
+    /// into the issued cookies, making it immutable to users.
+    ///
+    /// By default, login deadline is disabled.
+    pub fn login_deadline(mut self, deadline: Duration) -> CookieIdentityPolicy {
+        self.inner_mut().login_deadline = Some(deadline);
+        self
+    }
+
+    fn inner_mut(&mut self) -> &mut CookieIdentityInner {
+        Rc::get_mut(&mut self.0).unwrap()
+    }
+}
+
+impl IdentityPolicy for CookieIdentityPolicy {
+    type Future = Ready<Result<Option<String>, Error>>;
+    type ResponseFuture = Ready<Result<(), Error>>;
+
+    fn from_request(&self, req: &mut ServiceRequest) -> Self::Future {
+        ready(Ok(self.0.load(req).map(|value| {
+            let CookieValue {
+                identity,
+                login_timestamp,
+                ..
+            } = value;
+
+            if self.0.requires_oob_data() {
+                req.extensions_mut()
+                    .insert(CookieIdentityExtension { login_timestamp });
+            }
+
+            identity
+        })))
+    }
+
+    fn to_response<B>(
+        &self,
+        id: Option<String>,
+        changed: bool,
+        res: &mut ServiceResponse<B>,
+    ) -> Self::ResponseFuture {
+        let _ = if changed {
+            let login_timestamp = SystemTime::now();
+
+            self.0.set_cookie(
+                res,
+                id.map(|identity| CookieValue {
+                    identity,
+                    login_timestamp: self.0.login_deadline.map(|_| login_timestamp),
+                    visit_timestamp: self.0.visit_deadline.map(|_| login_timestamp),
+                }),
+            )
+        } else if self.0.always_update_cookie() && id.is_some() {
+            let visit_timestamp = SystemTime::now();
+
+            let login_timestamp = if self.0.requires_oob_data() {
+                let CookieIdentityExtension { login_timestamp } =
+                    res.request().extensions_mut().remove().unwrap();
+
+                login_timestamp
+            } else {
+                None
+            };
+
+            self.0.set_cookie(
+                res,
+                Some(CookieValue {
+                    identity: id.unwrap(),
+                    login_timestamp,
+                    visit_timestamp: self.0.visit_deadline.map(|_| visit_timestamp),
+                }),
+            )
+        } else {
+            Ok(())
+        };
+
+        ready(Ok(()))
+    }
+}
+
+#[cfg(test)]
+mod tests {
+    use std::{borrow::Borrow, time::SystemTime};
+
+    use actix_web::{
+        cookie::{Cookie, CookieJar, Key, SameSite},
+        dev::ServiceResponse,
+        http::{header, StatusCode},
+        test::{self, TestRequest},
+        web, App, HttpResponse,
+    };
+    use time::Duration;
+
+    use super::*;
+    use crate::{tests::*, Identity, IdentityService};
+
+    fn login_cookie(
+        identity: &'static str,
+        login_timestamp: Option<SystemTime>,
+        visit_timestamp: Option<SystemTime>,
+    ) -> Cookie<'static> {
+        let mut jar = CookieJar::new();
+        let key: Vec<u8> = COOKIE_KEY_MASTER
+            .iter()
+            .chain([1, 0, 0, 0].iter())
+            .copied()
+            .collect();
+
+        jar.private(&Key::derive_from(&key)).add(Cookie::new(
+            COOKIE_NAME,
+            serde_json::to_string(&CookieValue {
+                identity: identity.to_string(),
+                login_timestamp,
+                visit_timestamp,
+            })
+            .unwrap(),
+        ));
+
+        jar.get(COOKIE_NAME).unwrap().clone()
+    }
+
+    fn assert_login_cookie(
+        response: &mut ServiceResponse,
+        identity: &str,
+        login_timestamp: LoginTimestampCheck,
+        visit_timestamp: VisitTimeStampCheck,
+    ) {
+        let mut cookies = CookieJar::new();
+
+        for cookie in response.headers().get_all(header::SET_COOKIE) {
+            cookies.add(Cookie::parse(cookie.to_str().unwrap().to_string()).unwrap());
+        }
+
+        let key: Vec<u8> = COOKIE_KEY_MASTER
+            .iter()
+            .chain([1, 0, 0, 0].iter())
+            .copied()
+            .collect();
+
+        let cookie = cookies
+            .private(&Key::derive_from(&key))
+            .get(COOKIE_NAME)
+            .unwrap();
+
+        let cv: CookieValue = serde_json::from_str(cookie.value()).unwrap();
+        assert_eq!(cv.identity, identity);
+
+        let now = SystemTime::now();
+        let t30sec_ago = now - Duration::seconds(30);
+
+        match login_timestamp {
+            LoginTimestampCheck::NoTimestamp => assert_eq!(cv.login_timestamp, None),
+            LoginTimestampCheck::NewTimestamp => assert!(
+                t30sec_ago <= cv.login_timestamp.unwrap()
+                    && cv.login_timestamp.unwrap() <= now
+            ),
+            LoginTimestampCheck::OldTimestamp(old_timestamp) => {
+                assert_eq!(cv.login_timestamp, Some(old_timestamp))
+            }
+        }
+
+        match visit_timestamp {
+            VisitTimeStampCheck::NoTimestamp => assert_eq!(cv.visit_timestamp, None),
+            VisitTimeStampCheck::NewTimestamp => assert!(
+                t30sec_ago <= cv.visit_timestamp.unwrap()
+                    && cv.visit_timestamp.unwrap() <= now
+            ),
+        }
+    }
+
+    #[actix_rt::test]
+    async fn test_identity_flow() {
+        let srv = test::init_service(
+            App::new()
+                .wrap(IdentityService::new(
+                    CookieIdentityPolicy::new(&COOKIE_KEY_MASTER)
+                        .domain("www.rust-lang.org")
+                        .name(COOKIE_NAME)
+                        .path("/")
+                        .secure(true),
+                ))
+                .service(web::resource("/index").to(|id: Identity| {
+                    if id.identity().is_some() {
+                        HttpResponse::Created()
+                    } else {
+                        HttpResponse::Ok()
+                    }
+                }))
+                .service(web::resource("/login").to(|id: Identity| {
+                    id.remember(COOKIE_LOGIN.to_string());
+                    HttpResponse::Ok()
+                }))
+                .service(web::resource("/logout").to(|id: Identity| {
+                    if id.identity().is_some() {
+                        id.forget();
+                        HttpResponse::Ok()
+                    } else {
+                        HttpResponse::BadRequest()
+                    }
+                })),
+        )
+        .await;
+        let resp =
+            test::call_service(&srv, TestRequest::with_uri("/index").to_request()).await;
+        assert_eq!(resp.status(), StatusCode::OK);
+
+        let resp =
+            test::call_service(&srv, TestRequest::with_uri("/login").to_request()).await;
+        assert_eq!(resp.status(), StatusCode::OK);
+        let c = resp.response().cookies().next().unwrap().to_owned();
+
+        let resp = test::call_service(
+            &srv,
+            TestRequest::with_uri("/index")
+                .cookie(c.clone())
+                .to_request(),
+        )
+        .await;
+        assert_eq!(resp.status(), StatusCode::CREATED);
+
+        let resp = test::call_service(
+            &srv,
+            TestRequest::with_uri("/logout")
+                .cookie(c.clone())
+                .to_request(),
+        )
+        .await;
+        assert_eq!(resp.status(), StatusCode::OK);
+        assert!(resp.headers().contains_key(header::SET_COOKIE))
+    }
+
+    #[actix_rt::test]
+    async fn test_identity_max_age_time() {
+        let duration = Duration::days(1);
+
+        let srv = test::init_service(
+            App::new()
+                .wrap(IdentityService::new(
+                    CookieIdentityPolicy::new(&COOKIE_KEY_MASTER)
+                        .domain("www.rust-lang.org")
+                        .name(COOKIE_NAME)
+                        .path("/")
+                        .max_age(duration)
+                        .secure(true),
+                ))
+                .service(web::resource("/login").to(|id: Identity| {
+                    id.remember("test".to_string());
+                    HttpResponse::Ok()
+                })),
+        )
+        .await;
+
+        let resp =
+            test::call_service(&srv, TestRequest::with_uri("/login").to_request()).await;
+        assert_eq!(resp.status(), StatusCode::OK);
+        assert!(resp.headers().contains_key(header::SET_COOKIE));
+        let c = resp.response().cookies().next().unwrap().to_owned();
+        assert_eq!(duration, c.max_age().unwrap());
+    }
+
+    #[actix_rt::test]
+    async fn test_http_only_same_site() {
+        let srv = test::init_service(
+            App::new()
+                .wrap(IdentityService::new(
+                    CookieIdentityPolicy::new(&COOKIE_KEY_MASTER)
+                        .domain("www.rust-lang.org")
+                        .name(COOKIE_NAME)
+                        .path("/")
+                        .http_only(true)
+                        .same_site(SameSite::None),
+                ))
+                .service(web::resource("/login").to(|id: Identity| {
+                    id.remember("test".to_string());
+                    HttpResponse::Ok()
+                })),
+        )
+        .await;
+
+        let resp =
+            test::call_service(&srv, TestRequest::with_uri("/login").to_request()).await;
+
+        assert_eq!(resp.status(), StatusCode::OK);
+        assert!(resp.headers().contains_key(header::SET_COOKIE));
+
+        let c = resp.response().cookies().next().unwrap().to_owned();
+        assert!(c.http_only().unwrap());
+        assert_eq!(SameSite::None, c.same_site().unwrap());
+    }
+
+    fn legacy_login_cookie(identity: &'static str) -> Cookie<'static> {
+        let mut jar = CookieJar::new();
+        jar.private(&Key::derive_from(&COOKIE_KEY_MASTER))
+            .add(Cookie::new(COOKIE_NAME, identity));
+        jar.get(COOKIE_NAME).unwrap().clone()
+    }
+
+    async fn assert_logged_in(response: ServiceResponse, identity: Option<&str>) {
+        let bytes = test::read_body(response).await;
+        let resp: Option<String> = serde_json::from_slice(&bytes[..]).unwrap();
+        assert_eq!(resp.as_ref().map(|s| s.borrow()), identity);
+    }
+
+    fn assert_legacy_login_cookie(response: &mut ServiceResponse, identity: &str) {
+        let mut cookies = CookieJar::new();
+        for cookie in response.headers().get_all(header::SET_COOKIE) {
+            cookies.add(Cookie::parse(cookie.to_str().unwrap().to_string()).unwrap());
+        }
+        let cookie = cookies
+            .private(&Key::derive_from(&COOKIE_KEY_MASTER))
+            .get(COOKIE_NAME)
+            .unwrap();
+        assert_eq!(cookie.value(), identity);
+    }
+
+    fn assert_no_login_cookie(response: &mut ServiceResponse) {
+        let mut cookies = CookieJar::new();
+        for cookie in response.headers().get_all(header::SET_COOKIE) {
+            cookies.add(Cookie::parse(cookie.to_str().unwrap().to_string()).unwrap());
+        }
+        assert!(cookies.get(COOKIE_NAME).is_none());
+    }
+
+    #[actix_rt::test]
+    async fn test_identity_max_age() {
+        let seconds = 60;
+        let srv = test::init_service(
+            App::new()
+                .wrap(IdentityService::new(
+                    CookieIdentityPolicy::new(&COOKIE_KEY_MASTER)
+                        .domain("www.rust-lang.org")
+                        .name(COOKIE_NAME)
+                        .path("/")
+                        .max_age_secs(seconds)
+                        .secure(true),
+                ))
+                .service(web::resource("/login").to(|id: Identity| {
+                    id.remember("test".to_string());
+                    HttpResponse::Ok()
+                })),
+        )
+        .await;
+        let resp =
+            test::call_service(&srv, TestRequest::with_uri("/login").to_request()).await;
+        assert_eq!(resp.status(), StatusCode::OK);
+        assert!(resp.headers().contains_key(header::SET_COOKIE));
+        let c = resp.response().cookies().next().unwrap().to_owned();
+        assert_eq!(Duration::seconds(seconds as i64), c.max_age().unwrap());
+    }
+
+    #[actix_rt::test]
+    async fn test_identity_legacy_cookie_is_set() {
+        let srv = create_identity_server(|c| c).await;
+        let mut resp =
+            test::call_service(&srv, TestRequest::with_uri("/").to_request()).await;
+        assert_legacy_login_cookie(&mut resp, COOKIE_LOGIN);
+        assert_logged_in(resp, None).await;
+    }
+
+    #[actix_rt::test]
+    async fn test_identity_legacy_cookie_works() {
+        let srv = create_identity_server(|c| c).await;
+        let cookie = legacy_login_cookie(COOKIE_LOGIN);
+        let mut resp = test::call_service(
+            &srv,
+            TestRequest::with_uri("/")
+                .cookie(cookie.clone())
+                .to_request(),
+        )
+        .await;
+        assert_no_login_cookie(&mut resp);
+        assert_logged_in(resp, Some(COOKIE_LOGIN)).await;
+    }
+
+    #[actix_rt::test]
+    async fn test_identity_legacy_cookie_rejected_if_visit_timestamp_needed() {
+        let srv = create_identity_server(|c| c.visit_deadline(Duration::days(90))).await;
+        let cookie = legacy_login_cookie(COOKIE_LOGIN);
+        let mut resp = test::call_service(
+            &srv,
+            TestRequest::with_uri("/")
+                .cookie(cookie.clone())
+                .to_request(),
+        )
+        .await;
+        assert_login_cookie(
+            &mut resp,
+            COOKIE_LOGIN,
+            LoginTimestampCheck::NoTimestamp,
+            VisitTimeStampCheck::NewTimestamp,
+        );
+        assert_logged_in(resp, None).await;
+    }
+
+    #[actix_rt::test]
+    async fn test_identity_legacy_cookie_rejected_if_login_timestamp_needed() {
+        let srv = create_identity_server(|c| c.login_deadline(Duration::days(90))).await;
+        let cookie = legacy_login_cookie(COOKIE_LOGIN);
+        let mut resp = test::call_service(
+            &srv,
+            TestRequest::with_uri("/")
+                .cookie(cookie.clone())
+                .to_request(),
+        )
+        .await;
+        assert_login_cookie(
+            &mut resp,
+            COOKIE_LOGIN,
+            LoginTimestampCheck::NewTimestamp,
+            VisitTimeStampCheck::NoTimestamp,
+        );
+        assert_logged_in(resp, None).await;
+    }
+
+    #[actix_rt::test]
+    async fn test_identity_cookie_rejected_if_login_timestamp_needed() {
+        let srv = create_identity_server(|c| c.login_deadline(Duration::days(90))).await;
+        let cookie = login_cookie(COOKIE_LOGIN, None, Some(SystemTime::now()));
+        let mut resp = test::call_service(
+            &srv,
+            TestRequest::with_uri("/")
+                .cookie(cookie.clone())
+                .to_request(),
+        )
+        .await;
+        assert_login_cookie(
+            &mut resp,
+            COOKIE_LOGIN,
+            LoginTimestampCheck::NewTimestamp,
+            VisitTimeStampCheck::NoTimestamp,
+        );
+        assert_logged_in(resp, None).await;
+    }
+
+    #[actix_rt::test]
+    async fn test_identity_cookie_rejected_if_visit_timestamp_needed() {
+        let srv = create_identity_server(|c| c.visit_deadline(Duration::days(90))).await;
+        let cookie = login_cookie(COOKIE_LOGIN, Some(SystemTime::now()), None);
+        let mut resp = test::call_service(
+            &srv,
+            TestRequest::with_uri("/")
+                .cookie(cookie.clone())
+                .to_request(),
+        )
+        .await;
+        assert_login_cookie(
+            &mut resp,
+            COOKIE_LOGIN,
+            LoginTimestampCheck::NoTimestamp,
+            VisitTimeStampCheck::NewTimestamp,
+        );
+        assert_logged_in(resp, None).await;
+    }
+
+    #[actix_rt::test]
+    async fn test_identity_cookie_rejected_if_login_timestamp_too_old() {
+        let srv = create_identity_server(|c| c.login_deadline(Duration::days(90))).await;
+        let cookie = login_cookie(
+            COOKIE_LOGIN,
+            Some(SystemTime::now() - Duration::days(180)),
+            None,
+        );
+        let mut resp = test::call_service(
+            &srv,
+            TestRequest::with_uri("/")
+                .cookie(cookie.clone())
+                .to_request(),
+        )
+        .await;
+        assert_login_cookie(
+            &mut resp,
+            COOKIE_LOGIN,
+            LoginTimestampCheck::NewTimestamp,
+            VisitTimeStampCheck::NoTimestamp,
+        );
+        assert_logged_in(resp, None).await;
+    }
+
+    #[actix_rt::test]
+    async fn test_identity_cookie_rejected_if_visit_timestamp_too_old() {
+        let srv = create_identity_server(|c| c.visit_deadline(Duration::days(90))).await;
+        let cookie = login_cookie(
+            COOKIE_LOGIN,
+            None,
+            Some(SystemTime::now() - Duration::days(180)),
+        );
+        let mut resp = test::call_service(
+            &srv,
+            TestRequest::with_uri("/")
+                .cookie(cookie.clone())
+                .to_request(),
+        )
+        .await;
+        assert_login_cookie(
+            &mut resp,
+            COOKIE_LOGIN,
+            LoginTimestampCheck::NoTimestamp,
+            VisitTimeStampCheck::NewTimestamp,
+        );
+        assert_logged_in(resp, None).await;
+    }
+
+    #[actix_rt::test]
+    async fn test_identity_cookie_not_updated_on_login_deadline() {
+        let srv = create_identity_server(|c| c.login_deadline(Duration::days(90))).await;
+        let cookie = login_cookie(COOKIE_LOGIN, Some(SystemTime::now()), None);
+        let mut resp = test::call_service(
+            &srv,
+            TestRequest::with_uri("/")
+                .cookie(cookie.clone())
+                .to_request(),
+        )
+        .await;
+        assert_no_login_cookie(&mut resp);
+        assert_logged_in(resp, Some(COOKIE_LOGIN)).await;
+    }
+
+    #[actix_rt::test]
+    async fn test_identity_cookie_updated_on_visit_deadline() {
+        let srv = create_identity_server(|c| {
+            c.visit_deadline(Duration::days(90))
+                .login_deadline(Duration::days(90))
+        })
+        .await;
+        let timestamp = SystemTime::now() - Duration::days(1);
+        let cookie = login_cookie(COOKIE_LOGIN, Some(timestamp), Some(timestamp));
+        let mut resp = test::call_service(
+            &srv,
+            TestRequest::with_uri("/")
+                .cookie(cookie.clone())
+                .to_request(),
+        )
+        .await;
+        assert_login_cookie(
+            &mut resp,
+            COOKIE_LOGIN,
+            LoginTimestampCheck::OldTimestamp(timestamp),
+            VisitTimeStampCheck::NewTimestamp,
+        );
+        assert_logged_in(resp, Some(COOKIE_LOGIN)).await;
+    }
+}
+
+
+ \ No newline at end of file diff --git a/src/actix_identity/identity.rs.html b/src/actix_identity/identity.rs.html new file mode 100644 index 000000000..7b303228f --- /dev/null +++ b/src/actix_identity/identity.rs.html @@ -0,0 +1,209 @@ +identity.rs - source + +
  1
+  2
+  3
+  4
+  5
+  6
+  7
+  8
+  9
+ 10
+ 11
+ 12
+ 13
+ 14
+ 15
+ 16
+ 17
+ 18
+ 19
+ 20
+ 21
+ 22
+ 23
+ 24
+ 25
+ 26
+ 27
+ 28
+ 29
+ 30
+ 31
+ 32
+ 33
+ 34
+ 35
+ 36
+ 37
+ 38
+ 39
+ 40
+ 41
+ 42
+ 43
+ 44
+ 45
+ 46
+ 47
+ 48
+ 49
+ 50
+ 51
+ 52
+ 53
+ 54
+ 55
+ 56
+ 57
+ 58
+ 59
+ 60
+ 61
+ 62
+ 63
+ 64
+ 65
+ 66
+ 67
+ 68
+ 69
+ 70
+ 71
+ 72
+ 73
+ 74
+ 75
+ 76
+ 77
+ 78
+ 79
+ 80
+ 81
+ 82
+ 83
+ 84
+ 85
+ 86
+ 87
+ 88
+ 89
+ 90
+ 91
+ 92
+ 93
+ 94
+ 95
+ 96
+ 97
+ 98
+ 99
+100
+101
+
+use actix_web::{
+    dev::{Extensions, Payload},
+    Error, FromRequest, HttpRequest,
+};
+use futures_util::future::{ready, Ready};
+
+pub(crate) struct IdentityItem {
+    pub(crate) id: Option<String>,
+    pub(crate) changed: bool,
+}
+
+/// The extractor type to obtain your identity from a request.
+///
+/// ```
+/// use actix_web::*;
+/// use actix_identity::Identity;
+///
+/// #[get("/")]
+/// async fn index(id: Identity) -> impl Responder {
+///     // access request identity
+///     if let Some(id) = id.identity() {
+///         format!("Welcome! {}", id)
+///     } else {
+///         "Welcome Anonymous!".to_owned()
+///     }
+/// }
+///
+/// #[post("/login")]
+/// async fn login(id: Identity) -> impl Responder {
+///     // remember identity
+///     id.remember("User1".to_owned());
+///
+///     HttpResponse::Ok()
+/// }
+///
+/// #[post("/logout")]
+/// async fn logout(id: Identity) -> impl Responder {
+///     // remove identity
+///     id.forget();
+///
+///     HttpResponse::Ok()
+/// }
+/// ```
+#[derive(Clone)]
+pub struct Identity(HttpRequest);
+
+impl Identity {
+    /// Return the claimed identity of the user associated request or `None` if no identity can be
+    /// found associated with the request.
+    pub fn identity(&self) -> Option<String> {
+        Identity::get_identity(&self.0.extensions())
+    }
+
+    /// Remember identity.
+    pub fn remember(&self, identity: String) {
+        if let Some(id) = self.0.extensions_mut().get_mut::<IdentityItem>() {
+            id.id = Some(identity);
+            id.changed = true;
+        }
+    }
+
+    /// This method is used to 'forget' the current identity on subsequent requests.
+    pub fn forget(&self) {
+        if let Some(id) = self.0.extensions_mut().get_mut::<IdentityItem>() {
+            id.id = None;
+            id.changed = true;
+        }
+    }
+
+    pub(crate) fn get_identity(extensions: &Extensions) -> Option<String> {
+        let id = extensions.get::<IdentityItem>()?;
+        id.id.clone()
+    }
+}
+
+/// Extractor implementation for Identity type.
+///
+/// ```
+/// # use actix_web::*;
+/// use actix_identity::Identity;
+///
+/// #[get("/")]
+/// async fn index(id: Identity) -> impl Responder {
+///     // access request identity
+///     if let Some(id) = id.identity() {
+///         format!("Welcome! {}", id)
+///     } else {
+///         "Welcome Anonymous!".to_owned()
+///     }
+/// }
+/// ```
+impl FromRequest for Identity {
+    type Config = ();
+    type Error = Error;
+    type Future = Ready<Result<Identity, Error>>;
+
+    #[inline]
+    fn from_request(req: &HttpRequest, _: &mut Payload) -> Self::Future {
+        ready(Ok(Identity(req.clone())))
+    }
+}
+
+
+ \ No newline at end of file diff --git a/src/actix_identity/lib.rs.html b/src/actix_identity/lib.rs.html index 8d59c549e..deba3ace7 100644 --- a/src/actix_identity/lib.rs.html +++ b/src/actix_identity/lib.rs.html @@ -1,1167 +1,173 @@ lib.rs - source
   1
-   2
-   3
-   4
-   5
-   6
-   7
-   8
-   9
-  10
-  11
-  12
-  13
-  14
-  15
-  16
-  17
-  18
-  19
-  20
-  21
-  22
-  23
-  24
-  25
-  26
-  27
-  28
-  29
-  30
-  31
-  32
-  33
-  34
-  35
-  36
-  37
-  38
-  39
-  40
-  41
-  42
-  43
-  44
-  45
-  46
-  47
-  48
-  49
-  50
-  51
-  52
-  53
-  54
-  55
-  56
-  57
-  58
-  59
-  60
-  61
-  62
-  63
-  64
-  65
-  66
-  67
-  68
-  69
-  70
-  71
-  72
-  73
-  74
-  75
-  76
-  77
-  78
-  79
-  80
-  81
-  82
-  83
-  84
-  85
-  86
-  87
-  88
-  89
-  90
-  91
-  92
-  93
-  94
-  95
-  96
-  97
-  98
-  99
- 100
- 101
- 102
- 103
- 104
- 105
- 106
- 107
- 108
- 109
- 110
- 111
- 112
- 113
- 114
- 115
- 116
- 117
- 118
- 119
- 120
- 121
- 122
- 123
- 124
- 125
- 126
- 127
- 128
- 129
- 130
- 131
- 132
- 133
- 134
- 135
- 136
- 137
- 138
- 139
- 140
- 141
- 142
- 143
- 144
- 145
- 146
- 147
- 148
- 149
- 150
- 151
- 152
- 153
- 154
- 155
- 156
- 157
- 158
- 159
- 160
- 161
- 162
- 163
- 164
- 165
- 166
- 167
- 168
- 169
- 170
- 171
- 172
- 173
- 174
- 175
- 176
- 177
- 178
- 179
- 180
- 181
- 182
- 183
- 184
- 185
- 186
- 187
- 188
- 189
- 190
- 191
- 192
- 193
- 194
- 195
- 196
- 197
- 198
- 199
- 200
- 201
- 202
- 203
- 204
- 205
- 206
- 207
- 208
- 209
- 210
- 211
- 212
- 213
- 214
- 215
- 216
- 217
- 218
- 219
- 220
- 221
- 222
- 223
- 224
- 225
- 226
- 227
- 228
- 229
- 230
- 231
- 232
- 233
- 234
- 235
- 236
- 237
- 238
- 239
- 240
- 241
- 242
- 243
- 244
- 245
- 246
- 247
- 248
- 249
- 250
- 251
- 252
- 253
- 254
- 255
- 256
- 257
- 258
- 259
- 260
- 261
- 262
- 263
- 264
- 265
- 266
- 267
- 268
- 269
- 270
- 271
- 272
- 273
- 274
- 275
- 276
- 277
- 278
- 279
- 280
- 281
- 282
- 283
- 284
- 285
- 286
- 287
- 288
- 289
- 290
- 291
- 292
- 293
- 294
- 295
- 296
- 297
- 298
- 299
- 300
- 301
- 302
- 303
- 304
- 305
- 306
- 307
- 308
- 309
- 310
- 311
- 312
- 313
- 314
- 315
- 316
- 317
- 318
- 319
- 320
- 321
- 322
- 323
- 324
- 325
- 326
- 327
- 328
- 329
- 330
- 331
- 332
- 333
- 334
- 335
- 336
- 337
- 338
- 339
- 340
- 341
- 342
- 343
- 344
- 345
- 346
- 347
- 348
- 349
- 350
- 351
- 352
- 353
- 354
- 355
- 356
- 357
- 358
- 359
- 360
- 361
- 362
- 363
- 364
- 365
- 366
- 367
- 368
- 369
- 370
- 371
- 372
- 373
- 374
- 375
- 376
- 377
- 378
- 379
- 380
- 381
- 382
- 383
- 384
- 385
- 386
- 387
- 388
- 389
- 390
- 391
- 392
- 393
- 394
- 395
- 396
- 397
- 398
- 399
- 400
- 401
- 402
- 403
- 404
- 405
- 406
- 407
- 408
- 409
- 410
- 411
- 412
- 413
- 414
- 415
- 416
- 417
- 418
- 419
- 420
- 421
- 422
- 423
- 424
- 425
- 426
- 427
- 428
- 429
- 430
- 431
- 432
- 433
- 434
- 435
- 436
- 437
- 438
- 439
- 440
- 441
- 442
- 443
- 444
- 445
- 446
- 447
- 448
- 449
- 450
- 451
- 452
- 453
- 454
- 455
- 456
- 457
- 458
- 459
- 460
- 461
- 462
- 463
- 464
- 465
- 466
- 467
- 468
- 469
- 470
- 471
- 472
- 473
- 474
- 475
- 476
- 477
- 478
- 479
- 480
- 481
- 482
- 483
- 484
- 485
- 486
- 487
- 488
- 489
- 490
- 491
- 492
- 493
- 494
- 495
- 496
- 497
- 498
- 499
- 500
- 501
- 502
- 503
- 504
- 505
- 506
- 507
- 508
- 509
- 510
- 511
- 512
- 513
- 514
- 515
- 516
- 517
- 518
- 519
- 520
- 521
- 522
- 523
- 524
- 525
- 526
- 527
- 528
- 529
- 530
- 531
- 532
- 533
- 534
- 535
- 536
- 537
- 538
- 539
- 540
- 541
- 542
- 543
- 544
- 545
- 546
- 547
- 548
- 549
- 550
- 551
- 552
- 553
- 554
- 555
- 556
- 557
- 558
- 559
- 560
- 561
- 562
- 563
- 564
- 565
- 566
- 567
- 568
- 569
- 570
- 571
- 572
- 573
- 574
- 575
- 576
- 577
- 578
- 579
- 580
- 581
- 582
- 583
- 584
- 585
- 586
- 587
- 588
- 589
- 590
- 591
- 592
- 593
- 594
- 595
- 596
- 597
- 598
- 599
- 600
- 601
- 602
- 603
- 604
- 605
- 606
- 607
- 608
- 609
- 610
- 611
- 612
- 613
- 614
- 615
- 616
- 617
- 618
- 619
- 620
- 621
- 622
- 623
- 624
- 625
- 626
- 627
- 628
- 629
- 630
- 631
- 632
- 633
- 634
- 635
- 636
- 637
- 638
- 639
- 640
- 641
- 642
- 643
- 644
- 645
- 646
- 647
- 648
- 649
- 650
- 651
- 652
- 653
- 654
- 655
- 656
- 657
- 658
- 659
- 660
- 661
- 662
- 663
- 664
- 665
- 666
- 667
- 668
- 669
- 670
- 671
- 672
- 673
- 674
- 675
- 676
- 677
- 678
- 679
- 680
- 681
- 682
- 683
- 684
- 685
- 686
- 687
- 688
- 689
- 690
- 691
- 692
- 693
- 694
- 695
- 696
- 697
- 698
- 699
- 700
- 701
- 702
- 703
- 704
- 705
- 706
- 707
- 708
- 709
- 710
- 711
- 712
- 713
- 714
- 715
- 716
- 717
- 718
- 719
- 720
- 721
- 722
- 723
- 724
- 725
- 726
- 727
- 728
- 729
- 730
- 731
- 732
- 733
- 734
- 735
- 736
- 737
- 738
- 739
- 740
- 741
- 742
- 743
- 744
- 745
- 746
- 747
- 748
- 749
- 750
- 751
- 752
- 753
- 754
- 755
- 756
- 757
- 758
- 759
- 760
- 761
- 762
- 763
- 764
- 765
- 766
- 767
- 768
- 769
- 770
- 771
- 772
- 773
- 774
- 775
- 776
- 777
- 778
- 779
- 780
- 781
- 782
- 783
- 784
- 785
- 786
- 787
- 788
- 789
- 790
- 791
- 792
- 793
- 794
- 795
- 796
- 797
- 798
- 799
- 800
- 801
- 802
- 803
- 804
- 805
- 806
- 807
- 808
- 809
- 810
- 811
- 812
- 813
- 814
- 815
- 816
- 817
- 818
- 819
- 820
- 821
- 822
- 823
- 824
- 825
- 826
- 827
- 828
- 829
- 830
- 831
- 832
- 833
- 834
- 835
- 836
- 837
- 838
- 839
- 840
- 841
- 842
- 843
- 844
- 845
- 846
- 847
- 848
- 849
- 850
- 851
- 852
- 853
- 854
- 855
- 856
- 857
- 858
- 859
- 860
- 861
- 862
- 863
- 864
- 865
- 866
- 867
- 868
- 869
- 870
- 871
- 872
- 873
- 874
- 875
- 876
- 877
- 878
- 879
- 880
- 881
- 882
- 883
- 884
- 885
- 886
- 887
- 888
- 889
- 890
- 891
- 892
- 893
- 894
- 895
- 896
- 897
- 898
- 899
- 900
- 901
- 902
- 903
- 904
- 905
- 906
- 907
- 908
- 909
- 910
- 911
- 912
- 913
- 914
- 915
- 916
- 917
- 918
- 919
- 920
- 921
- 922
- 923
- 924
- 925
- 926
- 927
- 928
- 929
- 930
- 931
- 932
- 933
- 934
- 935
- 936
- 937
- 938
- 939
- 940
- 941
- 942
- 943
- 944
- 945
- 946
- 947
- 948
- 949
- 950
- 951
- 952
- 953
- 954
- 955
- 956
- 957
- 958
- 959
- 960
- 961
- 962
- 963
- 964
- 965
- 966
- 967
- 968
- 969
- 970
- 971
- 972
- 973
- 974
- 975
- 976
- 977
- 978
- 979
- 980
- 981
- 982
- 983
- 984
- 985
- 986
- 987
- 988
- 989
- 990
- 991
- 992
- 993
- 994
- 995
- 996
- 997
- 998
- 999
-1000
-1001
-1002
-1003
-1004
-1005
-1006
-1007
-1008
-1009
-1010
-1011
-1012
-1013
-1014
-1015
-1016
-1017
-1018
-1019
-1020
-1021
-1022
-1023
-1024
-1025
-1026
-1027
-1028
-1029
-1030
-1031
-1032
-1033
-1034
-1035
-1036
-1037
-1038
-1039
-1040
-1041
-1042
-1043
-1044
-1045
-1046
-1047
-1048
-1049
-1050
-1051
-1052
-1053
-1054
-1055
-1056
-1057
-1058
-1059
-1060
-1061
-1062
-1063
-1064
-1065
-1066
-1067
-1068
-1069
-1070
-1071
-1072
-1073
-1074
-1075
-1076
-1077
-1078
-1079
-1080
-1081
-1082
-1083
-1084
-1085
-1086
-1087
-1088
-1089
-1090
-1091
-1092
-1093
-1094
-1095
-1096
-1097
-1098
-1099
-1100
-1101
-1102
-1103
-1104
-1105
-1106
-1107
-1108
-1109
-1110
-1111
-1112
-1113
-1114
-1115
-1116
-1117
-1118
-1119
-1120
-1121
-1122
-1123
-1124
-1125
-1126
-1127
-1128
-1129
-1130
-1131
-1132
-1133
-1134
-1135
-1136
-1137
-1138
-1139
-1140
-1141
-1142
+                Change settings
  1
+  2
+  3
+  4
+  5
+  6
+  7
+  8
+  9
+ 10
+ 11
+ 12
+ 13
+ 14
+ 15
+ 16
+ 17
+ 18
+ 19
+ 20
+ 21
+ 22
+ 23
+ 24
+ 25
+ 26
+ 27
+ 28
+ 29
+ 30
+ 31
+ 32
+ 33
+ 34
+ 35
+ 36
+ 37
+ 38
+ 39
+ 40
+ 41
+ 42
+ 43
+ 44
+ 45
+ 46
+ 47
+ 48
+ 49
+ 50
+ 51
+ 52
+ 53
+ 54
+ 55
+ 56
+ 57
+ 58
+ 59
+ 60
+ 61
+ 62
+ 63
+ 64
+ 65
+ 66
+ 67
+ 68
+ 69
+ 70
+ 71
+ 72
+ 73
+ 74
+ 75
+ 76
+ 77
+ 78
+ 79
+ 80
+ 81
+ 82
+ 83
+ 84
+ 85
+ 86
+ 87
+ 88
+ 89
+ 90
+ 91
+ 92
+ 93
+ 94
+ 95
+ 96
+ 97
+ 98
+ 99
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109
+110
+111
+112
+113
+114
+115
+116
+117
+118
+119
+120
+121
+122
+123
+124
+125
+126
+127
+128
+129
+130
+131
+132
+133
+134
+135
+136
+137
+138
+139
+140
+141
+142
+143
+144
+145
+146
+147
+148
+149
+150
+151
+152
 
-//! Request identity service for Actix applications.
+//! Opinionated request identity service for Actix Web apps.
 //!
-//! [**IdentityService**](struct.IdentityService.html) middleware can be
-//! used with different policies types to store identity information.
+//! [`IdentityService`] middleware can be used with different policies types to store
+//! identity information.
 //!
-//! By default, only cookie identity policy is implemented. Other backend
-//! implementations can be added separately.
+//! A cookie based policy is provided. [`CookieIdentityPolicy`] uses cookies as identity storage.
 //!
-//! [**CookieIdentityPolicy**](struct.CookieIdentityPolicy.html)
-//! uses cookies as identity storage.
-//!
-//! To access current request identity
-//! [**Identity**](struct.Identity.html) extractor should be used.
+//! To access current request identity, use the [`Identity`] extractor.
 //!
 //! ```
 //! use actix_web::*;
 //! use actix_identity::{Identity, CookieIdentityPolicy, IdentityService};
 //!
+//! #[get("/")]
 //! async fn index(id: Identity) -> String {
 //!     // access request identity
 //!     if let Some(id) = id.identity() {
@@ -1171,114 +177,70 @@
 //!     }
 //! }
 //!
+//! #[post("/login")]
 //! async fn login(id: Identity) -> HttpResponse {
 //!     id.remember("User1".to_owned()); // <- remember identity
 //!     HttpResponse::Ok().finish()
 //! }
 //!
+//! #[post("/logout")]
 //! async fn logout(id: Identity) -> HttpResponse {
 //!     id.forget();                      // <- remove identity
 //!     HttpResponse::Ok().finish()
 //! }
 //!
-//! fn main() {
-//!     let app = App::new().wrap(IdentityService::new(
-//!         // <- create identity middleware
-//!         CookieIdentityPolicy::new(&[0; 32])    // <- create cookie identity policy
-//!               .name("auth-cookie")
-//!               .secure(false)))
-//!         .service(web::resource("/index.html").to(index))
-//!         .service(web::resource("/login.html").to(login))
-//!         .service(web::resource("/logout.html").to(logout));
-//! }
+//! // create cookie identity backend
+//! let policy = CookieIdentityPolicy::new(&[0; 32])
+//!     .name("auth-cookie")
+//!     .secure(false);
+//!
+//! let app = App::new()
+//!     // wrap policy into middleware identity middleware
+//!     .wrap(IdentityService::new(policy))
+//!     .service(services![index, login, logout]);
 //! ```
 
-#![deny(rust_2018_idioms)]
+#![deny(rust_2018_idioms, nonstandard_style)]
 
-use std::{future::Future, rc::Rc, time::SystemTime};
+use std::future::Future;
 
-use actix_service::{Service, Transform};
-use futures_util::future::{ok, FutureExt, LocalBoxFuture, Ready};
-use serde::{Deserialize, Serialize};
-use time::Duration;
+use actix_web::{
+    dev::{ServiceRequest, ServiceResponse},
+    Error, HttpMessage, Result,
+};
 
-use actix_web::cookie::{Cookie, CookieJar, Key, SameSite};
-use actix_web::dev::{Extensions, Payload, ServiceRequest, ServiceResponse};
-use actix_web::error::{Error, Result};
-use actix_web::http::header::{self, HeaderValue};
-use actix_web::{FromRequest, HttpMessage, HttpRequest};
+mod cookie;
+mod identity;
+mod middleware;
 
-/// The extractor type to obtain your identity from a request.
-///
-/// ```rust
-/// use actix_web::*;
-/// use actix_identity::Identity;
-///
-/// fn index(id: Identity) -> Result<String> {
-///     // access request identity
-///     if let Some(id) = id.identity() {
-///         Ok(format!("Welcome! {}", id))
-///     } else {
-///         Ok("Welcome Anonymous!".to_owned())
-///     }
-/// }
-///
-/// fn login(id: Identity) -> HttpResponse {
-///     id.remember("User1".to_owned()); // <- remember identity
-///     HttpResponse::Ok().finish()
-/// }
-///
-/// fn logout(id: Identity) -> HttpResponse {
-///     id.forget(); // <- remove identity
-///     HttpResponse::Ok().finish()
-/// }
-/// # fn main() {}
-/// ```
-#[derive(Clone)]
-pub struct Identity(HttpRequest);
+pub use self::cookie::CookieIdentityPolicy;
+pub use self::identity::Identity;
+pub use self::middleware::IdentityService;
 
-impl Identity {
-    /// Return the claimed identity of the user associated request or
-    /// ``None`` if no identity can be found associated with the request.
-    pub fn identity(&self) -> Option<String> {
-        Identity::get_identity(&self.0.extensions())
-    }
+/// Identity policy.
+pub trait IdentityPolicy: Sized + 'static {
+    /// The return type of the middleware
+    type Future: Future<Output = Result<Option<String>, Error>>;
 
-    /// Remember identity.
-    pub fn remember(&self, identity: String) {
-        if let Some(id) = self.0.extensions_mut().get_mut::<IdentityItem>() {
-            id.id = Some(identity);
-            id.changed = true;
-        }
-    }
+    /// The return type of the middleware
+    type ResponseFuture: Future<Output = Result<(), Error>>;
 
-    /// This method is used to 'forget' the current identity on subsequent
-    /// requests.
-    pub fn forget(&self) {
-        if let Some(id) = self.0.extensions_mut().get_mut::<IdentityItem>() {
-            id.id = None;
-            id.changed = true;
-        }
-    }
+    /// Parse the session from request and load data from a service identity.
+    fn from_request(&self, req: &mut ServiceRequest) -> Self::Future;
 
-    fn get_identity(extensions: &Extensions) -> Option<String> {
-        if let Some(id) = extensions.get::<IdentityItem>() {
-            id.id.clone()
-        } else {
-            None
-        }
-    }
-}
-
-struct IdentityItem {
-    id: Option<String>,
-    changed: bool,
+    /// Write changes to response
+    fn to_response<B>(
+        &self,
+        identity: Option<String>,
+        changed: bool,
+        response: &mut ServiceResponse<B>,
+    ) -> Self::ResponseFuture;
 }
 
 /// Helper trait that allows to get Identity.
 ///
-/// It could be used in middleware but identity policy must be set before any other middleware that needs identity
-/// RequestIdentity is implemented both for `ServiceRequest` and `HttpRequest`.
+/// It could be used in middleware but identity policy must be set before any other middleware that
+/// needs identity. RequestIdentity is implemented both for `ServiceRequest` and `HttpRequest`.
 pub trait RequestIdentity {
     fn get_identity(&self) -> Option<String>;
 }
@@ -1292,629 +254,32 @@
     }
 }
 
-/// Extractor implementation for Identity type.
-///
-/// ```rust
-/// # use actix_web::*;
-/// use actix_identity::Identity;
-///
-/// fn index(id: Identity) -> String {
-///     // access request identity
-///     if let Some(id) = id.identity() {
-///         format!("Welcome! {}", id)
-///     } else {
-///         "Welcome Anonymous!".to_owned()
-///     }
-/// }
-/// # fn main() {}
-/// ```
-impl FromRequest for Identity {
-    type Config = ();
-    type Error = Error;
-    type Future = Ready<Result<Identity, Error>>;
-
-    #[inline]
-    fn from_request(req: &HttpRequest, _: &mut Payload) -> Self::Future {
-        ok(Identity(req.clone()))
-    }
-}
-
-/// Identity policy definition.
-pub trait IdentityPolicy: Sized + 'static {
-    /// The return type of the middleware
-    type Future: Future<Output = Result<Option<String>, Error>>;
-
-    /// The return type of the middleware
-    type ResponseFuture: Future<Output = Result<(), Error>>;
-
-    /// Parse the session from request and load data from a service identity.
-    fn from_request(&self, request: &mut ServiceRequest) -> Self::Future;
-
-    /// Write changes to response
-    fn to_response<B>(
-        &self,
-        identity: Option<String>,
-        changed: bool,
-        response: &mut ServiceResponse<B>,
-    ) -> Self::ResponseFuture;
-}
-
-/// Request identity middleware
-///
-/// ```rust
-/// use actix_web::App;
-/// use actix_identity::{CookieIdentityPolicy, IdentityService};
-///
-/// let app = App::new().wrap(IdentityService::new(
-///     // <- create identity middleware
-///     CookieIdentityPolicy::new(&[0; 32])    // <- create cookie session backend
-///           .name("auth-cookie")
-///           .secure(false),
-/// ));
-/// ```
-pub struct IdentityService<T> {
-    backend: Rc<T>,
-}
-
-impl<T> IdentityService<T> {
-    /// Create new identity service with specified backend.
-    pub fn new(backend: T) -> Self {
-        IdentityService {
-            backend: Rc::new(backend),
-        }
-    }
-}
-
-impl<S, T, B> Transform<S, ServiceRequest> for IdentityService<T>
-where
-    S: Service<ServiceRequest, Response = ServiceResponse<B>, Error = Error> + 'static,
-    S::Future: 'static,
-    T: IdentityPolicy,
-    B: 'static,
-{
-    type Response = ServiceResponse<B>;
-    type Error = Error;
-    type InitError = ();
-    type Transform = IdentityServiceMiddleware<S, T>;
-    type Future = Ready<Result<Self::Transform, Self::InitError>>;
-
-    fn new_transform(&self, service: S) -> Self::Future {
-        ok(IdentityServiceMiddleware {
-            backend: self.backend.clone(),
-            service: Rc::new(service),
-        })
-    }
-}
-
-#[doc(hidden)]
-pub struct IdentityServiceMiddleware<S, T> {
-    service: Rc<S>,
-    backend: Rc<T>,
-}
-
-impl<S, T> Clone for IdentityServiceMiddleware<S, T> {
-    fn clone(&self) -> Self {
-        Self {
-            backend: Rc::clone(&self.backend),
-            service: Rc::clone(&self.service),
-        }
-    }
-}
-
-impl<S, T, B> Service<ServiceRequest> for IdentityServiceMiddleware<S, T>
-where
-    B: 'static,
-    S: Service<ServiceRequest, Response = ServiceResponse<B>, Error = Error> + 'static,
-    S::Future: 'static,
-    T: IdentityPolicy,
-{
-    type Response = ServiceResponse<B>;
-    type Error = Error;
-    type Future = LocalBoxFuture<'static, Result<Self::Response, Self::Error>>;
-
-    actix_service::forward_ready!(service);
-
-    fn call(&self, mut req: ServiceRequest) -> Self::Future {
-        let srv = Rc::clone(&self.service);
-        let backend = Rc::clone(&self.backend);
-        let fut = self.backend.from_request(&mut req);
-
-        async move {
-            match fut.await {
-                Ok(id) => {
-                    req.extensions_mut()
-                        .insert(IdentityItem { id, changed: false });
-
-                    let mut res = srv.call(req).await?;
-                    let id = res.request().extensions_mut().remove::<IdentityItem>();
-
-                    if let Some(id) = id {
-                        match backend.to_response(id.id, id.changed, &mut res).await {
-                            Ok(_) => Ok(res),
-                            Err(e) => Ok(res.error_response(e)),
-                        }
-                    } else {
-                        Ok(res)
-                    }
-                }
-                Err(err) => Ok(req.error_response(err)),
-            }
-        }
-        .boxed_local()
-    }
-}
-
-struct CookieIdentityInner {
-    key: Key,
-    key_v2: Key,
-    name: String,
-    path: String,
-    domain: Option<String>,
-    secure: bool,
-    max_age: Option<Duration>,
-    http_only: Option<bool>,
-    same_site: Option<SameSite>,
-    visit_deadline: Option<Duration>,
-    login_deadline: Option<Duration>,
-}
-
-#[derive(Deserialize, Serialize, Debug)]
-struct CookieValue {
-    identity: String,
-
-    #[serde(skip_serializing_if = "Option::is_none")]
-    login_timestamp: Option<SystemTime>,
-
-    #[serde(skip_serializing_if = "Option::is_none")]
-    visit_timestamp: Option<SystemTime>,
-}
-
-#[derive(Debug)]
-struct CookieIdentityExtension {
-    login_timestamp: Option<SystemTime>,
-}
-
-impl CookieIdentityInner {
-    fn new(key: &[u8]) -> CookieIdentityInner {
-        let key_v2: Vec<u8> = key.iter().chain([1, 0, 0, 0].iter()).cloned().collect();
-        CookieIdentityInner {
-            key: Key::derive_from(key),
-            key_v2: Key::derive_from(&key_v2),
-            name: "actix-identity".to_owned(),
-            path: "/".to_owned(),
-            domain: None,
-            secure: true,
-            max_age: None,
-            http_only: None,
-            same_site: None,
-            visit_deadline: None,
-            login_deadline: None,
-        }
-    }
-
-    fn set_cookie<B>(
-        &self,
-        resp: &mut ServiceResponse<B>,
-        value: Option<CookieValue>,
-    ) -> Result<()> {
-        let add_cookie = value.is_some();
-        let val = value.map(|val| {
-            if !self.legacy_supported() {
-                serde_json::to_string(&val)
-            } else {
-                Ok(val.identity)
-            }
-        });
-        let mut cookie =
-            Cookie::new(self.name.clone(), val.unwrap_or_else(|| Ok(String::new()))?);
-        cookie.set_path(self.path.clone());
-        cookie.set_secure(self.secure);
-        cookie.set_http_only(true);
-
-        if let Some(ref domain) = self.domain {
-            cookie.set_domain(domain.clone());
-        }
-
-        if let Some(max_age) = self.max_age {
-            cookie.set_max_age(max_age);
-        }
-
-        if let Some(http_only) = self.http_only {
-            cookie.set_http_only(http_only);
-        }
-
-        if let Some(same_site) = self.same_site {
-            cookie.set_same_site(same_site);
-        }
-
-        let mut jar = CookieJar::new();
-        let key = if self.legacy_supported() {
-            &self.key
-        } else {
-            &self.key_v2
-        };
-        if add_cookie {
-            jar.private(&key).add(cookie);
-        } else {
-            jar.add_original(cookie.clone());
-            jar.private(&key).remove(cookie);
-        }
-        for cookie in jar.delta() {
-            let val = HeaderValue::from_str(&cookie.to_string())?;
-            resp.headers_mut().append(header::SET_COOKIE, val);
-        }
-        Ok(())
-    }
-
-    fn load(&self, req: &ServiceRequest) -> Option<CookieValue> {
-        let cookie = req.cookie(&self.name)?;
-        let mut jar = CookieJar::new();
-        jar.add_original(cookie.clone());
-        let res = if self.legacy_supported() {
-            jar.private(&self.key).get(&self.name).map(|n| CookieValue {
-                identity: n.value().to_string(),
-                login_timestamp: None,
-                visit_timestamp: None,
-            })
-        } else {
-            None
-        };
-        res.or_else(|| {
-            jar.private(&self.key_v2)
-                .get(&self.name)
-                .and_then(|c| self.parse(c))
-        })
-    }
-
-    fn parse(&self, cookie: Cookie<'_>) -> Option<CookieValue> {
-        let value: CookieValue = serde_json::from_str(cookie.value()).ok()?;
-        let now = SystemTime::now();
-        if let Some(visit_deadline) = self.visit_deadline {
-            if now.duration_since(value.visit_timestamp?).ok()? > visit_deadline {
-                return None;
-            }
-        }
-        if let Some(login_deadline) = self.login_deadline {
-            if now.duration_since(value.login_timestamp?).ok()? > login_deadline {
-                return None;
-            }
-        }
-        Some(value)
-    }
-
-    fn legacy_supported(&self) -> bool {
-        self.visit_deadline.is_none() && self.login_deadline.is_none()
-    }
-
-    fn always_update_cookie(&self) -> bool {
-        self.visit_deadline.is_some()
-    }
-
-    fn requires_oob_data(&self) -> bool {
-        self.login_deadline.is_some()
-    }
-}
-
-/// Use cookies for request identity storage.
-///
-/// The constructors take a key as an argument.
-/// This is the private key for cookie - when this value is changed,
-/// all identities are lost. The constructors will panic if the key is less
-/// than 32 bytes in length.
-///
-/// # Example
-///
-/// ```rust
-/// use actix_web::App;
-/// use actix_identity::{CookieIdentityPolicy, IdentityService};
-///
-/// let app = App::new().wrap(IdentityService::new(
-///     // <- create identity middleware
-///     CookieIdentityPolicy::new(&[0; 32])  // <- construct cookie policy
-///            .domain("www.rust-lang.org")
-///            .name("actix_auth")
-///            .path("/")
-///            .secure(true),
-/// ));
-/// ```
-pub struct CookieIdentityPolicy(Rc<CookieIdentityInner>);
-
-impl CookieIdentityPolicy {
-    /// Construct new `CookieIdentityPolicy` instance.
-    ///
-    /// Panics if key length is less than 32 bytes.
-    pub fn new(key: &[u8]) -> CookieIdentityPolicy {
-        CookieIdentityPolicy(Rc::new(CookieIdentityInner::new(key)))
-    }
-
-    /// Sets the `path` field in the session cookie being built.
-    pub fn path<S: Into<String>>(mut self, value: S) -> CookieIdentityPolicy {
-        Rc::get_mut(&mut self.0).unwrap().path = value.into();
-        self
-    }
-
-    /// Sets the `name` field in the session cookie being built.
-    pub fn name<S: Into<String>>(mut self, value: S) -> CookieIdentityPolicy {
-        Rc::get_mut(&mut self.0).unwrap().name = value.into();
-        self
-    }
-
-    /// Sets the `domain` field in the session cookie being built.
-    pub fn domain<S: Into<String>>(mut self, value: S) -> CookieIdentityPolicy {
-        Rc::get_mut(&mut self.0).unwrap().domain = Some(value.into());
-        self
-    }
-
-    /// Sets the `secure` field in the session cookie being built.
-    ///
-    /// If the `secure` field is set, a cookie will only be transmitted when the
-    /// connection is secure - i.e. `https`
-    pub fn secure(mut self, value: bool) -> CookieIdentityPolicy {
-        Rc::get_mut(&mut self.0).unwrap().secure = value;
-        self
-    }
-
-    /// Sets the `max-age` field in the session cookie being built with given number of seconds.
-    pub fn max_age(self, seconds: i64) -> CookieIdentityPolicy {
-        self.max_age_time(Duration::seconds(seconds))
-    }
-
-    /// Sets the `max-age` field in the session cookie being built with `time::Duration`.
-    pub fn max_age_time(mut self, value: Duration) -> CookieIdentityPolicy {
-        Rc::get_mut(&mut self.0).unwrap().max_age = Some(value);
-        self
-    }
-
-    /// Sets the `http_only` field in the session cookie being built.
-    pub fn http_only(mut self, http_only: bool) -> Self {
-        Rc::get_mut(&mut self.0).unwrap().http_only = Some(http_only);
-        self
-    }
-
-    /// Sets the `same_site` field in the session cookie being built.
-    pub fn same_site(mut self, same_site: SameSite) -> Self {
-        Rc::get_mut(&mut self.0).unwrap().same_site = Some(same_site);
-        self
-    }
-
-    /// Accepts only users whose cookie has been seen before the given deadline
-    ///
-    /// By default visit deadline is disabled.
-    pub fn visit_deadline(mut self, value: Duration) -> CookieIdentityPolicy {
-        Rc::get_mut(&mut self.0).unwrap().visit_deadline = Some(value);
-        self
-    }
-
-    /// Accepts only users which has been authenticated before the given deadline
-    ///
-    /// By default login deadline is disabled.
-    pub fn login_deadline(mut self, value: Duration) -> CookieIdentityPolicy {
-        Rc::get_mut(&mut self.0).unwrap().login_deadline = Some(value);
-        self
-    }
-}
-
-impl IdentityPolicy for CookieIdentityPolicy {
-    type Future = Ready<Result<Option<String>, Error>>;
-    type ResponseFuture = Ready<Result<(), Error>>;
-
-    fn from_request(&self, req: &mut ServiceRequest) -> Self::Future {
-        ok(self.0.load(req).map(
-            |CookieValue {
-                 identity,
-                 login_timestamp,
-                 ..
-             }| {
-                if self.0.requires_oob_data() {
-                    req.extensions_mut()
-                        .insert(CookieIdentityExtension { login_timestamp });
-                }
-                identity
-            },
-        ))
-    }
-
-    fn to_response<B>(
-        &self,
-        id: Option<String>,
-        changed: bool,
-        res: &mut ServiceResponse<B>,
-    ) -> Self::ResponseFuture {
-        let _ = if changed {
-            let login_timestamp = SystemTime::now();
-            self.0.set_cookie(
-                res,
-                id.map(|identity| CookieValue {
-                    identity,
-                    login_timestamp: self.0.login_deadline.map(|_| login_timestamp),
-                    visit_timestamp: self.0.visit_deadline.map(|_| login_timestamp),
-                }),
-            )
-        } else if self.0.always_update_cookie() && id.is_some() {
-            let visit_timestamp = SystemTime::now();
-            let login_timestamp = if self.0.requires_oob_data() {
-                let CookieIdentityExtension {
-                    login_timestamp: lt,
-                } = res.request().extensions_mut().remove().unwrap();
-                lt
-            } else {
-                None
-            };
-            self.0.set_cookie(
-                res,
-                Some(CookieValue {
-                    identity: id.unwrap(),
-                    login_timestamp,
-                    visit_timestamp: self.0.visit_deadline.map(|_| visit_timestamp),
-                }),
-            )
-        } else {
-            Ok(())
-        };
-        ok(())
-    }
-}
-
 #[cfg(test)]
 mod tests {
-    use std::borrow::Borrow;
+    use std::time::SystemTime;
+
+    use actix_web::{dev::ServiceResponse, test, web, App, Error};
 
     use super::*;
-    use actix_service::into_service;
-    use actix_web::http::StatusCode;
-    use actix_web::test::{self, TestRequest};
-    use actix_web::{error, web, App, Error, HttpResponse};
 
-    const COOKIE_KEY_MASTER: [u8; 32] = [0; 32];
-    const COOKIE_NAME: &str = "actix_auth";
-    const COOKIE_LOGIN: &str = "test";
+    pub(crate) const COOKIE_KEY_MASTER: [u8; 32] = [0; 32];
+    pub(crate) const COOKIE_NAME: &str = "actix_auth";
+    pub(crate) const COOKIE_LOGIN: &str = "test";
 
-    #[actix_rt::test]
-    async fn test_identity() {
-        let srv = test::init_service(
-            App::new()
-                .wrap(IdentityService::new(
-                    CookieIdentityPolicy::new(&COOKIE_KEY_MASTER)
-                        .domain("www.rust-lang.org")
-                        .name(COOKIE_NAME)
-                        .path("/")
-                        .secure(true),
-                ))
-                .service(web::resource("/index").to(|id: Identity| {
-                    if id.identity().is_some() {
-                        HttpResponse::Created()
-                    } else {
-                        HttpResponse::Ok()
-                    }
-                }))
-                .service(web::resource("/login").to(|id: Identity| {
-                    id.remember(COOKIE_LOGIN.to_string());
-                    HttpResponse::Ok()
-                }))
-                .service(web::resource("/logout").to(|id: Identity| {
-                    if id.identity().is_some() {
-                        id.forget();
-                        HttpResponse::Ok()
-                    } else {
-                        HttpResponse::BadRequest()
-                    }
-                })),
-        )
-        .await;
-        let resp =
-            test::call_service(&srv, TestRequest::with_uri("/index").to_request()).await;
-        assert_eq!(resp.status(), StatusCode::OK);
-
-        let resp =
-            test::call_service(&srv, TestRequest::with_uri("/login").to_request()).await;
-        assert_eq!(resp.status(), StatusCode::OK);
-        let c = resp.response().cookies().next().unwrap().to_owned();
-
-        let resp = test::call_service(
-            &srv,
-            TestRequest::with_uri("/index")
-                .cookie(c.clone())
-                .to_request(),
-        )
-        .await;
-        assert_eq!(resp.status(), StatusCode::CREATED);
-
-        let resp = test::call_service(
-            &srv,
-            TestRequest::with_uri("/logout")
-                .cookie(c.clone())
-                .to_request(),
-        )
-        .await;
-        assert_eq!(resp.status(), StatusCode::OK);
-        assert!(resp.headers().contains_key(header::SET_COOKIE))
+    #[allow(clippy::enum_variant_names)]
+    pub(crate) enum LoginTimestampCheck {
+        NoTimestamp,
+        NewTimestamp,
+        OldTimestamp(SystemTime),
     }
 
-    #[actix_rt::test]
-    async fn test_identity_max_age_time() {
-        let duration = Duration::days(1);
-        let srv = test::init_service(
-            App::new()
-                .wrap(IdentityService::new(
-                    CookieIdentityPolicy::new(&COOKIE_KEY_MASTER)
-                        .domain("www.rust-lang.org")
-                        .name(COOKIE_NAME)
-                        .path("/")
-                        .max_age_time(duration)
-                        .secure(true),
-                ))
-                .service(web::resource("/login").to(|id: Identity| {
-                    id.remember("test".to_string());
-                    HttpResponse::Ok()
-                })),
-        )
-        .await;
-        let resp =
-            test::call_service(&srv, TestRequest::with_uri("/login").to_request()).await;
-        assert_eq!(resp.status(), StatusCode::OK);
-        assert!(resp.headers().contains_key(header::SET_COOKIE));
-        let c = resp.response().cookies().next().unwrap().to_owned();
-        assert_eq!(duration, c.max_age().unwrap());
+    #[allow(clippy::enum_variant_names)]
+    pub(crate) enum VisitTimeStampCheck {
+        NoTimestamp,
+        NewTimestamp,
     }
 
-    #[actix_rt::test]
-    async fn test_http_only_same_site() {
-        let srv = test::init_service(
-            App::new()
-                .wrap(IdentityService::new(
-                    CookieIdentityPolicy::new(&COOKIE_KEY_MASTER)
-                        .domain("www.rust-lang.org")
-                        .name(COOKIE_NAME)
-                        .path("/")
-                        .http_only(true)
-                        .same_site(SameSite::None),
-                ))
-                .service(web::resource("/login").to(|id: Identity| {
-                    id.remember("test".to_string());
-                    HttpResponse::Ok()
-                })),
-        )
-        .await;
-
-        let resp =
-            test::call_service(&srv, TestRequest::with_uri("/login").to_request()).await;
-
-        assert_eq!(resp.status(), StatusCode::OK);
-        assert!(resp.headers().contains_key(header::SET_COOKIE));
-
-        let c = resp.response().cookies().next().unwrap().to_owned();
-        assert!(c.http_only().unwrap());
-        assert_eq!(SameSite::None, c.same_site().unwrap());
-    }
-
-    #[actix_rt::test]
-    async fn test_identity_max_age() {
-        let seconds = 60;
-        let srv = test::init_service(
-            App::new()
-                .wrap(IdentityService::new(
-                    CookieIdentityPolicy::new(&COOKIE_KEY_MASTER)
-                        .domain("www.rust-lang.org")
-                        .name(COOKIE_NAME)
-                        .path("/")
-                        .max_age(seconds)
-                        .secure(true),
-                ))
-                .service(web::resource("/login").to(|id: Identity| {
-                    id.remember("test".to_string());
-                    HttpResponse::Ok()
-                })),
-        )
-        .await;
-        let resp =
-            test::call_service(&srv, TestRequest::with_uri("/login").to_request()).await;
-        assert_eq!(resp.status(), StatusCode::OK);
-        assert!(resp.headers().contains_key(header::SET_COOKIE));
-        let c = resp.response().cookies().next().unwrap().to_owned();
-        assert_eq!(Duration::seconds(seconds as i64), c.max_age().unwrap());
-    }
-
-    async fn create_identity_server<
+    pub(crate) async fn create_identity_server<
         F: Fn(CookieIdentityPolicy) -> CookieIdentityPolicy + Sync + Send + Clone + 'static,
     >(
         f: F,
@@ -1940,351 +305,6 @@
         )
         .await
     }
-
-    fn legacy_login_cookie(identity: &'static str) -> Cookie<'static> {
-        let mut jar = CookieJar::new();
-        jar.private(&Key::derive_from(&COOKIE_KEY_MASTER))
-            .add(Cookie::new(COOKIE_NAME, identity));
-        jar.get(COOKIE_NAME).unwrap().clone()
-    }
-
-    fn login_cookie(
-        identity: &'static str,
-        login_timestamp: Option<SystemTime>,
-        visit_timestamp: Option<SystemTime>,
-    ) -> Cookie<'static> {
-        let mut jar = CookieJar::new();
-        let key: Vec<u8> = COOKIE_KEY_MASTER
-            .iter()
-            .chain([1, 0, 0, 0].iter())
-            .copied()
-            .collect();
-        jar.private(&Key::derive_from(&key)).add(Cookie::new(
-            COOKIE_NAME,
-            serde_json::to_string(&CookieValue {
-                identity: identity.to_string(),
-                login_timestamp,
-                visit_timestamp,
-            })
-            .unwrap(),
-        ));
-        jar.get(COOKIE_NAME).unwrap().clone()
-    }
-
-    async fn assert_logged_in(response: ServiceResponse, identity: Option<&str>) {
-        let bytes = test::read_body(response).await;
-        let resp: Option<String> = serde_json::from_slice(&bytes[..]).unwrap();
-        assert_eq!(resp.as_ref().map(|s| s.borrow()), identity);
-    }
-
-    fn assert_legacy_login_cookie(response: &mut ServiceResponse, identity: &str) {
-        let mut cookies = CookieJar::new();
-        for cookie in response.headers().get_all(header::SET_COOKIE) {
-            cookies.add(Cookie::parse(cookie.to_str().unwrap().to_string()).unwrap());
-        }
-        let cookie = cookies
-            .private(&Key::derive_from(&COOKIE_KEY_MASTER))
-            .get(COOKIE_NAME)
-            .unwrap();
-        assert_eq!(cookie.value(), identity);
-    }
-
-    #[allow(clippy::enum_variant_names)]
-    enum LoginTimestampCheck {
-        NoTimestamp,
-        NewTimestamp,
-        OldTimestamp(SystemTime),
-    }
-
-    #[allow(clippy::enum_variant_names)]
-    enum VisitTimeStampCheck {
-        NoTimestamp,
-        NewTimestamp,
-    }
-
-    fn assert_login_cookie(
-        response: &mut ServiceResponse,
-        identity: &str,
-        login_timestamp: LoginTimestampCheck,
-        visit_timestamp: VisitTimeStampCheck,
-    ) {
-        let mut cookies = CookieJar::new();
-        for cookie in response.headers().get_all(header::SET_COOKIE) {
-            cookies.add(Cookie::parse(cookie.to_str().unwrap().to_string()).unwrap());
-        }
-        let key: Vec<u8> = COOKIE_KEY_MASTER
-            .iter()
-            .chain([1, 0, 0, 0].iter())
-            .copied()
-            .collect();
-        let cookie = cookies
-            .private(&Key::derive_from(&key))
-            .get(COOKIE_NAME)
-            .unwrap();
-        let cv: CookieValue = serde_json::from_str(cookie.value()).unwrap();
-        assert_eq!(cv.identity, identity);
-        let now = SystemTime::now();
-        let t30sec_ago = now - Duration::seconds(30);
-        match login_timestamp {
-            LoginTimestampCheck::NoTimestamp => assert_eq!(cv.login_timestamp, None),
-            LoginTimestampCheck::NewTimestamp => assert!(
-                t30sec_ago <= cv.login_timestamp.unwrap()
-                    && cv.login_timestamp.unwrap() <= now
-            ),
-            LoginTimestampCheck::OldTimestamp(old_timestamp) => {
-                assert_eq!(cv.login_timestamp, Some(old_timestamp))
-            }
-        }
-        match visit_timestamp {
-            VisitTimeStampCheck::NoTimestamp => assert_eq!(cv.visit_timestamp, None),
-            VisitTimeStampCheck::NewTimestamp => assert!(
-                t30sec_ago <= cv.visit_timestamp.unwrap()
-                    && cv.visit_timestamp.unwrap() <= now
-            ),
-        }
-    }
-
-    fn assert_no_login_cookie(response: &mut ServiceResponse) {
-        let mut cookies = CookieJar::new();
-        for cookie in response.headers().get_all(header::SET_COOKIE) {
-            cookies.add(Cookie::parse(cookie.to_str().unwrap().to_string()).unwrap());
-        }
-        assert!(cookies.get(COOKIE_NAME).is_none());
-    }
-
-    #[actix_rt::test]
-    async fn test_identity_legacy_cookie_is_set() {
-        let srv = create_identity_server(|c| c).await;
-        let mut resp =
-            test::call_service(&srv, TestRequest::with_uri("/").to_request()).await;
-        assert_legacy_login_cookie(&mut resp, COOKIE_LOGIN);
-        assert_logged_in(resp, None).await;
-    }
-
-    #[actix_rt::test]
-    async fn test_identity_legacy_cookie_works() {
-        let srv = create_identity_server(|c| c).await;
-        let cookie = legacy_login_cookie(COOKIE_LOGIN);
-        let mut resp = test::call_service(
-            &srv,
-            TestRequest::with_uri("/")
-                .cookie(cookie.clone())
-                .to_request(),
-        )
-        .await;
-        assert_no_login_cookie(&mut resp);
-        assert_logged_in(resp, Some(COOKIE_LOGIN)).await;
-    }
-
-    #[actix_rt::test]
-    async fn test_identity_legacy_cookie_rejected_if_visit_timestamp_needed() {
-        let srv = create_identity_server(|c| c.visit_deadline(Duration::days(90))).await;
-        let cookie = legacy_login_cookie(COOKIE_LOGIN);
-        let mut resp = test::call_service(
-            &srv,
-            TestRequest::with_uri("/")
-                .cookie(cookie.clone())
-                .to_request(),
-        )
-        .await;
-        assert_login_cookie(
-            &mut resp,
-            COOKIE_LOGIN,
-            LoginTimestampCheck::NoTimestamp,
-            VisitTimeStampCheck::NewTimestamp,
-        );
-        assert_logged_in(resp, None).await;
-    }
-
-    #[actix_rt::test]
-    async fn test_identity_legacy_cookie_rejected_if_login_timestamp_needed() {
-        let srv = create_identity_server(|c| c.login_deadline(Duration::days(90))).await;
-        let cookie = legacy_login_cookie(COOKIE_LOGIN);
-        let mut resp = test::call_service(
-            &srv,
-            TestRequest::with_uri("/")
-                .cookie(cookie.clone())
-                .to_request(),
-        )
-        .await;
-        assert_login_cookie(
-            &mut resp,
-            COOKIE_LOGIN,
-            LoginTimestampCheck::NewTimestamp,
-            VisitTimeStampCheck::NoTimestamp,
-        );
-        assert_logged_in(resp, None).await;
-    }
-
-    #[actix_rt::test]
-    async fn test_identity_cookie_rejected_if_login_timestamp_needed() {
-        let srv = create_identity_server(|c| c.login_deadline(Duration::days(90))).await;
-        let cookie = login_cookie(COOKIE_LOGIN, None, Some(SystemTime::now()));
-        let mut resp = test::call_service(
-            &srv,
-            TestRequest::with_uri("/")
-                .cookie(cookie.clone())
-                .to_request(),
-        )
-        .await;
-        assert_login_cookie(
-            &mut resp,
-            COOKIE_LOGIN,
-            LoginTimestampCheck::NewTimestamp,
-            VisitTimeStampCheck::NoTimestamp,
-        );
-        assert_logged_in(resp, None).await;
-    }
-
-    #[actix_rt::test]
-    async fn test_identity_cookie_rejected_if_visit_timestamp_needed() {
-        let srv = create_identity_server(|c| c.visit_deadline(Duration::days(90))).await;
-        let cookie = login_cookie(COOKIE_LOGIN, Some(SystemTime::now()), None);
-        let mut resp = test::call_service(
-            &srv,
-            TestRequest::with_uri("/")
-                .cookie(cookie.clone())
-                .to_request(),
-        )
-        .await;
-        assert_login_cookie(
-            &mut resp,
-            COOKIE_LOGIN,
-            LoginTimestampCheck::NoTimestamp,
-            VisitTimeStampCheck::NewTimestamp,
-        );
-        assert_logged_in(resp, None).await;
-    }
-
-    #[actix_rt::test]
-    async fn test_identity_cookie_rejected_if_login_timestamp_too_old() {
-        let srv = create_identity_server(|c| c.login_deadline(Duration::days(90))).await;
-        let cookie = login_cookie(
-            COOKIE_LOGIN,
-            Some(SystemTime::now() - Duration::days(180)),
-            None,
-        );
-        let mut resp = test::call_service(
-            &srv,
-            TestRequest::with_uri("/")
-                .cookie(cookie.clone())
-                .to_request(),
-        )
-        .await;
-        assert_login_cookie(
-            &mut resp,
-            COOKIE_LOGIN,
-            LoginTimestampCheck::NewTimestamp,
-            VisitTimeStampCheck::NoTimestamp,
-        );
-        assert_logged_in(resp, None).await;
-    }
-
-    #[actix_rt::test]
-    async fn test_identity_cookie_rejected_if_visit_timestamp_too_old() {
-        let srv = create_identity_server(|c| c.visit_deadline(Duration::days(90))).await;
-        let cookie = login_cookie(
-            COOKIE_LOGIN,
-            None,
-            Some(SystemTime::now() - Duration::days(180)),
-        );
-        let mut resp = test::call_service(
-            &srv,
-            TestRequest::with_uri("/")
-                .cookie(cookie.clone())
-                .to_request(),
-        )
-        .await;
-        assert_login_cookie(
-            &mut resp,
-            COOKIE_LOGIN,
-            LoginTimestampCheck::NoTimestamp,
-            VisitTimeStampCheck::NewTimestamp,
-        );
-        assert_logged_in(resp, None).await;
-    }
-
-    #[actix_rt::test]
-    async fn test_identity_cookie_not_updated_on_login_deadline() {
-        let srv = create_identity_server(|c| c.login_deadline(Duration::days(90))).await;
-        let cookie = login_cookie(COOKIE_LOGIN, Some(SystemTime::now()), None);
-        let mut resp = test::call_service(
-            &srv,
-            TestRequest::with_uri("/")
-                .cookie(cookie.clone())
-                .to_request(),
-        )
-        .await;
-        assert_no_login_cookie(&mut resp);
-        assert_logged_in(resp, Some(COOKIE_LOGIN)).await;
-    }
-
-    // https://github.com/actix/actix-web/issues/1263
-    #[actix_rt::test]
-    async fn test_identity_cookie_updated_on_visit_deadline() {
-        let srv = create_identity_server(|c| {
-            c.visit_deadline(Duration::days(90))
-                .login_deadline(Duration::days(90))
-        })
-        .await;
-        let timestamp = SystemTime::now() - Duration::days(1);
-        let cookie = login_cookie(COOKIE_LOGIN, Some(timestamp), Some(timestamp));
-        let mut resp = test::call_service(
-            &srv,
-            TestRequest::with_uri("/")
-                .cookie(cookie.clone())
-                .to_request(),
-        )
-        .await;
-        assert_login_cookie(
-            &mut resp,
-            COOKIE_LOGIN,
-            LoginTimestampCheck::OldTimestamp(timestamp),
-            VisitTimeStampCheck::NewTimestamp,
-        );
-        assert_logged_in(resp, Some(COOKIE_LOGIN)).await;
-    }
-
-    #[actix_rt::test]
-    async fn test_borrowed_mut_error() {
-        use futures_util::future::{lazy, ok, Ready};
-
-        struct Ident;
-        impl IdentityPolicy for Ident {
-            type Future = Ready<Result<Option<String>, Error>>;
-            type ResponseFuture = Ready<Result<(), Error>>;
-
-            fn from_request(&self, _: &mut ServiceRequest) -> Self::Future {
-                ok(Some("test".to_string()))
-            }
-
-            fn to_response<B>(
-                &self,
-                _: Option<String>,
-                _: bool,
-                _: &mut ServiceResponse<B>,
-            ) -> Self::ResponseFuture {
-                ok(())
-            }
-        }
-
-        let srv = IdentityServiceMiddleware {
-            backend: Rc::new(Ident),
-            service: Rc::new(into_service(|_: ServiceRequest| async move {
-                actix_rt::time::sleep(std::time::Duration::from_secs(100)).await;
-                Err::<ServiceResponse, _>(error::ErrorBadRequest("error"))
-            })),
-        };
-
-        let srv2 = srv.clone();
-        let req = TestRequest::default().to_srv_request();
-        actix_rt::spawn(async move {
-            let _ = srv2.call(req).await;
-        });
-        actix_rt::time::sleep(std::time::Duration::from_millis(50)).await;
-
-        let _ = lazy(|cx| srv.poll_ready(cx)).await;
-    }
 }
 
diff --git a/src/actix_identity/middleware.rs.html b/src/actix_identity/middleware.rs.html new file mode 100644 index 000000000..60ced7fdb --- /dev/null +++ b/src/actix_identity/middleware.rs.html @@ -0,0 +1,343 @@ +middleware.rs - source + +
  1
+  2
+  3
+  4
+  5
+  6
+  7
+  8
+  9
+ 10
+ 11
+ 12
+ 13
+ 14
+ 15
+ 16
+ 17
+ 18
+ 19
+ 20
+ 21
+ 22
+ 23
+ 24
+ 25
+ 26
+ 27
+ 28
+ 29
+ 30
+ 31
+ 32
+ 33
+ 34
+ 35
+ 36
+ 37
+ 38
+ 39
+ 40
+ 41
+ 42
+ 43
+ 44
+ 45
+ 46
+ 47
+ 48
+ 49
+ 50
+ 51
+ 52
+ 53
+ 54
+ 55
+ 56
+ 57
+ 58
+ 59
+ 60
+ 61
+ 62
+ 63
+ 64
+ 65
+ 66
+ 67
+ 68
+ 69
+ 70
+ 71
+ 72
+ 73
+ 74
+ 75
+ 76
+ 77
+ 78
+ 79
+ 80
+ 81
+ 82
+ 83
+ 84
+ 85
+ 86
+ 87
+ 88
+ 89
+ 90
+ 91
+ 92
+ 93
+ 94
+ 95
+ 96
+ 97
+ 98
+ 99
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109
+110
+111
+112
+113
+114
+115
+116
+117
+118
+119
+120
+121
+122
+123
+124
+125
+126
+127
+128
+129
+130
+131
+132
+133
+134
+135
+136
+137
+138
+139
+140
+141
+142
+143
+144
+145
+146
+147
+148
+149
+150
+151
+152
+153
+154
+155
+156
+157
+158
+159
+160
+161
+162
+163
+164
+165
+166
+167
+168
+
+use std::rc::Rc;
+
+use actix_web::{
+    dev::{Service, ServiceRequest, ServiceResponse, Transform},
+    Error, HttpMessage, Result,
+};
+use futures_util::future::{ready, FutureExt, LocalBoxFuture, Ready};
+
+use crate::{identity::IdentityItem, IdentityPolicy};
+
+/// Request identity middleware
+///
+/// ```
+/// use actix_web::App;
+/// use actix_identity::{CookieIdentityPolicy, IdentityService};
+///
+/// // create cookie identity backend
+/// let policy = CookieIdentityPolicy::new(&[0; 32])
+///            .name("auth-cookie")
+///            .secure(false);
+///
+/// let app = App::new()
+///     // wrap policy into identity middleware
+///     .wrap(IdentityService::new(policy));
+/// ```
+pub struct IdentityService<T> {
+    backend: Rc<T>,
+}
+
+impl<T> IdentityService<T> {
+    /// Create new identity service with specified backend.
+    pub fn new(backend: T) -> Self {
+        IdentityService {
+            backend: Rc::new(backend),
+        }
+    }
+}
+
+impl<S, T, B> Transform<S, ServiceRequest> for IdentityService<T>
+where
+    S: Service<ServiceRequest, Response = ServiceResponse<B>, Error = Error> + 'static,
+    S::Future: 'static,
+    T: IdentityPolicy,
+    B: 'static,
+{
+    type Response = ServiceResponse<B>;
+    type Error = Error;
+    type InitError = ();
+    type Transform = IdentityServiceMiddleware<S, T>;
+    type Future = Ready<Result<Self::Transform, Self::InitError>>;
+
+    fn new_transform(&self, service: S) -> Self::Future {
+        ready(Ok(IdentityServiceMiddleware {
+            backend: self.backend.clone(),
+            service: Rc::new(service),
+        }))
+    }
+}
+
+pub struct IdentityServiceMiddleware<S, T> {
+    pub(crate) service: Rc<S>,
+    pub(crate) backend: Rc<T>,
+}
+
+impl<S, T> Clone for IdentityServiceMiddleware<S, T> {
+    fn clone(&self) -> Self {
+        Self {
+            backend: Rc::clone(&self.backend),
+            service: Rc::clone(&self.service),
+        }
+    }
+}
+
+impl<S, T, B> Service<ServiceRequest> for IdentityServiceMiddleware<S, T>
+where
+    B: 'static,
+    S: Service<ServiceRequest, Response = ServiceResponse<B>, Error = Error> + 'static,
+    S::Future: 'static,
+    T: IdentityPolicy,
+{
+    type Response = ServiceResponse<B>;
+    type Error = Error;
+    type Future = LocalBoxFuture<'static, Result<Self::Response, Self::Error>>;
+
+    actix_service::forward_ready!(service);
+
+    fn call(&self, mut req: ServiceRequest) -> Self::Future {
+        let srv = Rc::clone(&self.service);
+        let backend = Rc::clone(&self.backend);
+        let fut = self.backend.from_request(&mut req);
+
+        async move {
+            match fut.await {
+                Ok(id) => {
+                    req.extensions_mut()
+                        .insert(IdentityItem { id, changed: false });
+
+                    let mut res = srv.call(req).await?;
+                    let id = res.request().extensions_mut().remove::<IdentityItem>();
+
+                    if let Some(id) = id {
+                        match backend.to_response(id.id, id.changed, &mut res).await {
+                            Ok(_) => Ok(res),
+                            Err(e) => Ok(res.error_response(e)),
+                        }
+                    } else {
+                        Ok(res)
+                    }
+                }
+                Err(err) => Ok(req.error_response(err)),
+            }
+        }
+        .boxed_local()
+    }
+}
+
+#[cfg(test)]
+mod tests {
+    use std::{rc::Rc, time::Duration};
+
+    use actix_service::into_service;
+    use actix_web::{dev, error, test, Error, Result};
+
+    use super::*;
+
+    #[actix_rt::test]
+    async fn test_borrowed_mut_error() {
+        use futures_util::future::{lazy, ok, Ready};
+
+        struct Ident;
+        impl IdentityPolicy for Ident {
+            type Future = Ready<Result<Option<String>, Error>>;
+            type ResponseFuture = Ready<Result<(), Error>>;
+
+            fn from_request(&self, _: &mut dev::ServiceRequest) -> Self::Future {
+                ok(Some("test".to_string()))
+            }
+
+            fn to_response<B>(
+                &self,
+                _: Option<String>,
+                _: bool,
+                _: &mut dev::ServiceResponse<B>,
+            ) -> Self::ResponseFuture {
+                ok(())
+            }
+        }
+
+        let srv = crate::middleware::IdentityServiceMiddleware {
+            backend: Rc::new(Ident),
+            service: Rc::new(into_service(|_: dev::ServiceRequest| async move {
+                actix_rt::time::sleep(Duration::from_secs(100)).await;
+                Err::<dev::ServiceResponse, _>(error::ErrorBadRequest("error"))
+            })),
+        };
+
+        let srv2 = srv.clone();
+        let req = test::TestRequest::default().to_srv_request();
+
+        actix_rt::spawn(async move {
+            let _ = srv2.call(req).await;
+        });
+
+        actix_rt::time::sleep(Duration::from_millis(50)).await;
+
+        let _ = lazy(|cx| srv.poll_ready(cx)).await;
+    }
+}
+
+
+ \ No newline at end of file