diff --git a/actix_identity/all.html b/actix_identity/all.html index ee46bf0c6..7e6d374ce 100644 --- a/actix_identity/all.html +++ b/actix_identity/all.html @@ -1 +1 @@ -List of all items in this crate

List of all items

Structs

Enums

Traits

\ No newline at end of file +List of all items in this crate

List of all items

Structs

Enums

Traits

\ No newline at end of file diff --git a/actix_identity/error/enum.GetIdentityError.html b/actix_identity/error/enum.GetIdentityError.html new file mode 100644 index 000000000..f797d4311 --- /dev/null +++ b/actix_identity/error/enum.GetIdentityError.html @@ -0,0 +1,22 @@ +GetIdentityError in actix_identity::error - Rust
#[non_exhaustive]
+pub enum GetIdentityError {
+    SessionExpiryError(SessionExpiryError),
+    MissingIdentityError(MissingIdentityError),
+    SessionGetError(SessionGetError),
+    LostIdentityError(LostIdentityError),
+}
Expand description

Errors that can occur while retrieving an identity.

+

Variants (Non-exhaustive)§

This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
§

SessionExpiryError(SessionExpiryError)

The session has expired.

+
§

MissingIdentityError(MissingIdentityError)

No identity is found in a session.

+
§

SessionGetError(SessionGetError)

Failed to accessing the session store.

+
§

LostIdentityError(LostIdentityError)

Identity info was lost after being validated.

+

Seeing this error indicates a bug in actix-identity.

+

Trait Implementations§

Formats the value using the given formatter. Read more
Formats the value using the given formatter. Read more
The lower-level source of this error, if any. Read more
👎Deprecated since 1.42.0: use the Display impl or to_string()
👎Deprecated since 1.33.0: replaced by Error::source, which can support downcasting
🔬This is a nightly-only experimental API. (error_generic_member_access)
Provides type based access to context intended for error reports. Read more
Converts to this type from the input type.
Converts to this type from the input type.
Converts to this type from the input type.
Converts to this type from the input type.
Returns appropriate status code for error. Read more
Creates full response for error. Read more

Auto Trait Implementations§

Blanket Implementations§

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

+
Instruments this type with the provided Span, returning an +Instrumented wrapper. Read more
Instruments this type with the current Span, returning an +Instrumented wrapper. Read more

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
🔬This is a nightly-only experimental API. (provide_any)
Data providers should implement this method to provide all values they are able to +provide by using demand. Read more
Should always be Self
Converts the given value to a String. Read more
The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.
Attaches the provided Subscriber to this type, returning a +WithDispatch wrapper. Read more
Attaches the current default Subscriber to this type, returning a +WithDispatch wrapper. Read more
\ No newline at end of file diff --git a/actix_identity/error/index.html b/actix_identity/error/index.html new file mode 100644 index 000000000..689b66f47 --- /dev/null +++ b/actix_identity/error/index.html @@ -0,0 +1,2 @@ +actix_identity::error - Rust

Module actix_identity::error

source ·
Expand description

Failure modes of identity operations.

+

Structs

Error that can occur during login attempts.
The identity information has been lost.
There is no identity information attached to the current session.
Error encountered when working with a session that has expired.

Enums

Errors that can occur while retrieving an identity.
\ No newline at end of file diff --git a/actix_identity/error/sidebar-items.js b/actix_identity/error/sidebar-items.js new file mode 100644 index 000000000..bfd9862e0 --- /dev/null +++ b/actix_identity/error/sidebar-items.js @@ -0,0 +1 @@ +window.SIDEBAR_ITEMS = {"enum":[["GetIdentityError","Errors that can occur while retrieving an identity."]],"struct":[["LoginError","Error that can occur during login attempts."],["LostIdentityError","The identity information has been lost."],["MissingIdentityError","There is no identity information attached to the current session."],["SessionExpiryError","Error encountered when working with a session that has expired."]]}; \ No newline at end of file diff --git a/actix_identity/error/struct.LoginError.html b/actix_identity/error/struct.LoginError.html new file mode 100644 index 000000000..2f06f319f --- /dev/null +++ b/actix_identity/error/struct.LoginError.html @@ -0,0 +1,11 @@ +LoginError in actix_identity::error - Rust
pub struct LoginError(_);
Expand description

Error that can occur during login attempts.

+

Trait Implementations§

Formats the value using the given formatter. Read more
Formats the value using the given formatter. Read more
The lower-level source of this error, if any. Read more
👎Deprecated since 1.42.0: use the Display impl or to_string()
👎Deprecated since 1.33.0: replaced by Error::source, which can support downcasting
🔬This is a nightly-only experimental API. (error_generic_member_access)
Provides type based access to context intended for error reports. Read more
Converts to this type from the input type.
Returns appropriate status code for error. Read more
Creates full response for error. Read more

Auto Trait Implementations§

Blanket Implementations§

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

+
Instruments this type with the provided Span, returning an +Instrumented wrapper. Read more
Instruments this type with the current Span, returning an +Instrumented wrapper. Read more

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
🔬This is a nightly-only experimental API. (provide_any)
Data providers should implement this method to provide all values they are able to +provide by using demand. Read more
Should always be Self
Converts the given value to a String. Read more
The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.
Attaches the provided Subscriber to this type, returning a +WithDispatch wrapper. Read more
Attaches the current default Subscriber to this type, returning a +WithDispatch wrapper. Read more
\ No newline at end of file diff --git a/actix_identity/error/struct.LostIdentityError.html b/actix_identity/error/struct.LostIdentityError.html new file mode 100644 index 000000000..487de720f --- /dev/null +++ b/actix_identity/error/struct.LostIdentityError.html @@ -0,0 +1,12 @@ +LostIdentityError in actix_identity::error - Rust
#[non_exhaustive]
pub struct LostIdentityError;
Expand description

The identity information has been lost.

+

Seeing this error in user code indicates a bug in actix-identity.

+

Trait Implementations§

Formats the value using the given formatter. Read more
Formats the value using the given formatter. Read more
The lower-level source of this error, if any. Read more
👎Deprecated since 1.42.0: use the Display impl or to_string()
👎Deprecated since 1.33.0: replaced by Error::source, which can support downcasting
🔬This is a nightly-only experimental API. (error_generic_member_access)
Provides type based access to context intended for error reports. Read more
Converts to this type from the input type.

Auto Trait Implementations§

Blanket Implementations§

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

+
Instruments this type with the provided Span, returning an +Instrumented wrapper. Read more
Instruments this type with the current Span, returning an +Instrumented wrapper. Read more

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
🔬This is a nightly-only experimental API. (provide_any)
Data providers should implement this method to provide all values they are able to +provide by using demand. Read more
Should always be Self
Converts the given value to a String. Read more
The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.
Attaches the provided Subscriber to this type, returning a +WithDispatch wrapper. Read more
Attaches the current default Subscriber to this type, returning a +WithDispatch wrapper. Read more
\ No newline at end of file diff --git a/actix_identity/error/struct.MissingIdentityError.html b/actix_identity/error/struct.MissingIdentityError.html new file mode 100644 index 000000000..2601f3f5e --- /dev/null +++ b/actix_identity/error/struct.MissingIdentityError.html @@ -0,0 +1,11 @@ +MissingIdentityError in actix_identity::error - Rust
#[non_exhaustive]
pub struct MissingIdentityError;
Expand description

There is no identity information attached to the current session.

+

Trait Implementations§

Formats the value using the given formatter. Read more
Formats the value using the given formatter. Read more
The lower-level source of this error, if any. Read more
👎Deprecated since 1.42.0: use the Display impl or to_string()
👎Deprecated since 1.33.0: replaced by Error::source, which can support downcasting
🔬This is a nightly-only experimental API. (error_generic_member_access)
Provides type based access to context intended for error reports. Read more
Converts to this type from the input type.

Auto Trait Implementations§

Blanket Implementations§

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

+
Instruments this type with the provided Span, returning an +Instrumented wrapper. Read more
Instruments this type with the current Span, returning an +Instrumented wrapper. Read more

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
🔬This is a nightly-only experimental API. (provide_any)
Data providers should implement this method to provide all values they are able to +provide by using demand. Read more
Should always be Self
Converts the given value to a String. Read more
The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.
Attaches the provided Subscriber to this type, returning a +WithDispatch wrapper. Read more
Attaches the current default Subscriber to this type, returning a +WithDispatch wrapper. Read more
\ No newline at end of file diff --git a/actix_identity/error/struct.SessionExpiryError.html b/actix_identity/error/struct.SessionExpiryError.html new file mode 100644 index 000000000..da05d62b3 --- /dev/null +++ b/actix_identity/error/struct.SessionExpiryError.html @@ -0,0 +1,11 @@ +SessionExpiryError in actix_identity::error - Rust
pub struct SessionExpiryError(_);
Expand description

Error encountered when working with a session that has expired.

+

Trait Implementations§

Formats the value using the given formatter. Read more
Formats the value using the given formatter. Read more
The lower-level source of this error, if any. Read more
👎Deprecated since 1.42.0: use the Display impl or to_string()
👎Deprecated since 1.33.0: replaced by Error::source, which can support downcasting
🔬This is a nightly-only experimental API. (error_generic_member_access)
Provides type based access to context intended for error reports. Read more

Auto Trait Implementations§

Blanket Implementations§

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

+
Instruments this type with the provided Span, returning an +Instrumented wrapper. Read more
Instruments this type with the current Span, returning an +Instrumented wrapper. Read more

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
🔬This is a nightly-only experimental API. (provide_any)
Data providers should implement this method to provide all values they are able to +provide by using demand. Read more
Should always be Self
Converts the given value to a String. Read more
The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.
Attaches the provided Subscriber to this type, returning a +WithDispatch wrapper. Read more
Attaches the current default Subscriber to this type, returning a +WithDispatch wrapper. Read more
\ No newline at end of file diff --git a/actix_identity/index.html b/actix_identity/index.html index a27385172..49bfc59a0 100644 --- a/actix_identity/index.html +++ b/actix_identity/index.html @@ -1,4 +1,4 @@ -actix_identity - Rust

Crate actix_identity

source ·
Expand description

Identity management for Actix Web.

+actix_identity - Rust

Crate actix_identity

source ·
Expand description

Identity management for Actix Web.

actix-identity can be used to track identity of a user across multiple requests. It is built on top of HTTP sessions, via actix-session.

Getting started

@@ -72,4 +72,4 @@ by customising the configuration for have been inactive for a while (see IdentityMiddlewareBuilder::visit_deadline;
  • logged in too long ago (see IdentityMiddlewareBuilder::login_deadline).
  • -

    Modules

    Configuration options to tune the behaviour of IdentityMiddleware.

    Structs

    A verified user identity. It can be used as a request extractor.
    Identity management middleware.

    Traits

    Helper trait to retrieve an Identity instance from various actix-web’s types.
    \ No newline at end of file +

    Modules

    Configuration options to tune the behaviour of IdentityMiddleware.
    Failure modes of identity operations.

    Structs

    A verified user identity. It can be used as a request extractor.
    Identity management middleware.

    Traits

    Helper trait to retrieve an Identity instance from various actix-web’s types.
    \ No newline at end of file diff --git a/actix_identity/sidebar-items.js b/actix_identity/sidebar-items.js index 5377a6e71..80f5f551a 100644 --- a/actix_identity/sidebar-items.js +++ b/actix_identity/sidebar-items.js @@ -1 +1 @@ -window.SIDEBAR_ITEMS = {"mod":[["config","Configuration options to tune the behaviour of [`IdentityMiddleware`]."]],"struct":[["Identity","A verified user identity. It can be used as a request extractor."],["IdentityMiddleware","Identity management middleware."]],"trait":[["IdentityExt","Helper trait to retrieve an [`Identity`] instance from various `actix-web`’s types."]]}; \ No newline at end of file +window.SIDEBAR_ITEMS = {"mod":[["config","Configuration options to tune the behaviour of [`IdentityMiddleware`]."],["error","Failure modes of identity operations."]],"struct":[["Identity","A verified user identity. It can be used as a request extractor."],["IdentityMiddleware","Identity management middleware."]],"trait":[["IdentityExt","Helper trait to retrieve an [`Identity`] instance from various `actix-web`’s types."]]}; \ No newline at end of file diff --git a/actix_identity/struct.Identity.html b/actix_identity/struct.Identity.html index 4f150637a..e20a7d1dc 100644 --- a/actix_identity/struct.Identity.html +++ b/actix_identity/struct.Identity.html @@ -1,4 +1,4 @@ -Identity in actix_identity - Rust
    pub struct Identity(_);
    Expand description

    A verified user identity. It can be used as a request extractor.

    +Identity in actix_identity - Rust
    pub struct Identity(_);
    Expand description

    A verified user identity. It can be used as a request extractor.

    The lifecycle of a user identity is tied to the lifecycle of the underlying session. If the session is destroyed (e.g. the session expired), the user identity will be forgotten, de-facto forcing a user log out.

    @@ -49,7 +49,7 @@ control of the error path.

    .finish() } }
    -

    Implementations§

    Return the user id associated to the current session.

    +

    Implementations§

    Return the user id associated to the current session.

    Examples
    use actix_web::{get, Responder};
     use actix_identity::Identity;
    @@ -62,7 +62,7 @@ control of the error path.

    "Welcome Anonymous!".to_owned() } }
    -

    Attach a valid user identity to the current session.

    +

    Attach a valid user identity to the current session.

    This method should be called after you have successfully authenticated the user. After login has been called, the user will be able to access all routes that require a valid Identity.

    diff --git a/actix_identity/trait.IdentityExt.html b/actix_identity/trait.IdentityExt.html index 56854f843..dd9850925 100644 --- a/actix_identity/trait.IdentityExt.html +++ b/actix_identity/trait.IdentityExt.html @@ -1,5 +1,5 @@ IdentityExt in actix_identity - Rust
    pub trait IdentityExt {
    -    fn get_identity(&self) -> Result<Identity, Error>;
    +    fn get_identity(&self) -> Result<Identity, GetIdentityError>;
     }
    Expand description

    Helper trait to retrieve an Identity instance from various actix-web’s types.

    -

    Required Methods§

    Retrieve the identity attached to the current session, if available.

    -

    Implementations on Foreign Types§

    Implementors§

    \ No newline at end of file +

    Required Methods§

    Retrieve the identity attached to the current session, if available.

    +

    Implementations on Foreign Types§

    Implementors§

    \ No newline at end of file diff --git a/help.html b/help.html index bc6abd454..bc29ddcab 100644 --- a/help.html +++ b/help.html @@ -1 +1,2 @@ -Rustdoc help

    Rustdoc help

    Back
    \ No newline at end of file +Rustdoc help

    Rustdoc help

    Back
    \ No newline at end of file diff --git a/implementors/actix_web/error/response_error/trait.ResponseError.js b/implementors/actix_web/error/response_error/trait.ResponseError.js index 1f4fab7d1..15547966c 100644 --- a/implementors/actix_web/error/response_error/trait.ResponseError.js +++ b/implementors/actix_web/error/response_error/trait.ResponseError.js @@ -1,5 +1,6 @@ (function() {var implementors = { "actix_cors":[["impl ResponseError for CorsError"]], +"actix_identity":[["impl ResponseError for LoginError"],["impl ResponseError for GetIdentityError"]], "actix_protobuf":[["impl ResponseError for ProtoBufPayloadError"]], "actix_redis":[["impl ResponseError for Error"]], "actix_session":[["impl ResponseError for SessionGetError"],["impl ResponseError for SessionInsertError"]], diff --git a/implementors/core/convert/trait.From.js b/implementors/core/convert/trait.From.js index e6fab32eb..d35ac7855 100644 --- a/implementors/core/convert/trait.From.js +++ b/implementors/core/convert/trait.From.js @@ -1,4 +1,5 @@ (function() {var implementors = { +"actix_identity":[["impl From<SessionInsertError> for LoginError"],["impl From<LostIdentityError> for GetIdentityError"],["impl From<MissingIdentityError> for GetIdentityError"],["impl From<ComponentRange> for GetIdentityError"],["impl From<SessionGetError> for GetIdentityError"]], "actix_limitation":[["impl From<ComponentRange> for Error"],["impl From<RedisError> for Error"]], "actix_protobuf":[["impl From<PayloadError> for ProtoBufPayloadError"],["impl From<DecodeError> for ProtoBufPayloadError"]], "actix_redis":[["impl From<Error> for Error"]], diff --git a/implementors/core/error/trait.Error.js b/implementors/core/error/trait.Error.js index 2b7e31c82..5d8dffca2 100644 --- a/implementors/core/error/trait.Error.js +++ b/implementors/core/error/trait.Error.js @@ -1,5 +1,6 @@ (function() {var implementors = { "actix_cors":[["impl Error for CorsError"]], +"actix_identity":[["impl Error for LoginError"],["impl Error for SessionExpiryError"],["impl Error for LostIdentityError"],["impl Error for MissingIdentityError"],["impl Error for GetIdentityError"]], "actix_limitation":[["impl Error for Error"]], "actix_redis":[["impl Error for Error"]], "actix_session":[["impl Error for SessionGetError"],["impl Error for SessionInsertError"],["impl Error for LoadError"],["impl Error for SaveError"],["impl Error for UpdateError"]], diff --git a/implementors/core/fmt/trait.Debug.js b/implementors/core/fmt/trait.Debug.js index 3d9190abe..5b248a8fe 100644 --- a/implementors/core/fmt/trait.Debug.js +++ b/implementors/core/fmt/trait.Debug.js @@ -1,6 +1,6 @@ (function() {var implementors = { "actix_cors":[["impl Debug for Cors"],["impl Debug for CorsError"]], -"actix_identity":[["impl Debug for LogoutBehaviour"],["impl Debug for IdentityMiddlewareBuilder"]], +"actix_identity":[["impl Debug for LogoutBehaviour"],["impl Debug for IdentityMiddlewareBuilder"],["impl Debug for LoginError"],["impl Debug for SessionExpiryError"],["impl Debug for LostIdentityError"],["impl Debug for MissingIdentityError"],["impl Debug for GetIdentityError"]], "actix_limitation":[["impl Debug for Builder"],["impl Debug for Error"],["impl Debug for RateLimiter"],["impl Debug for Status"],["impl Debug for Limiter"]], "actix_protobuf":[["impl Debug for ProtoBufPayloadError"],["impl<T> Debug for ProtoBuf<T>where
        T: Debug + Message,
    "]], "actix_redis":[["impl Debug for Command"],["impl Debug for Error"]], diff --git a/implementors/core/fmt/trait.Display.js b/implementors/core/fmt/trait.Display.js index ab485e6b3..e97823d3b 100644 --- a/implementors/core/fmt/trait.Display.js +++ b/implementors/core/fmt/trait.Display.js @@ -1,5 +1,6 @@ (function() {var implementors = { "actix_cors":[["impl Display for CorsError"]], +"actix_identity":[["impl Display for LoginError"],["impl Display for SessionExpiryError"],["impl Display for LostIdentityError"],["impl Display for MissingIdentityError"],["impl Display for GetIdentityError"]], "actix_limitation":[["impl Display for Error"]], "actix_protobuf":[["impl Display for ProtoBufPayloadError"],["impl<T> Display for ProtoBuf<T>where
        T: Display + Message,
    "]], "actix_redis":[["impl Display for Error"]], diff --git a/implementors/core/marker/trait.Freeze.js b/implementors/core/marker/trait.Freeze.js index edce669c7..033ff9ec1 100644 --- a/implementors/core/marker/trait.Freeze.js +++ b/implementors/core/marker/trait.Freeze.js @@ -1,6 +1,6 @@ (function() {var implementors = { "actix_cors":[["impl Freeze for Cors",1,["actix_cors::builder::Cors"]],["impl Freeze for CorsError",1,["actix_cors::error::CorsError"]]], -"actix_identity":[["impl Freeze for LogoutBehaviour",1,["actix_identity::config::LogoutBehaviour"]],["impl Freeze for IdentityMiddlewareBuilder",1,["actix_identity::config::IdentityMiddlewareBuilder"]],["impl Freeze for Identity",1,["actix_identity::identity::Identity"]],["impl Freeze for IdentityMiddleware",1,["actix_identity::middleware::IdentityMiddleware"]]], +"actix_identity":[["impl Freeze for LogoutBehaviour",1,["actix_identity::config::LogoutBehaviour"]],["impl Freeze for IdentityMiddlewareBuilder",1,["actix_identity::config::IdentityMiddlewareBuilder"]],["impl Freeze for LoginError",1,["actix_identity::error::LoginError"]],["impl Freeze for SessionExpiryError",1,["actix_identity::error::SessionExpiryError"]],["impl Freeze for LostIdentityError",1,["actix_identity::error::LostIdentityError"]],["impl Freeze for MissingIdentityError",1,["actix_identity::error::MissingIdentityError"]],["impl Freeze for GetIdentityError",1,["actix_identity::error::GetIdentityError"]],["impl Freeze for Identity",1,["actix_identity::identity::Identity"]],["impl Freeze for IdentityMiddleware",1,["actix_identity::middleware::IdentityMiddleware"]]], "actix_limitation":[["impl Freeze for Builder",1,["actix_limitation::builder::Builder"]],["impl Freeze for Error",1,["actix_limitation::errors::Error"]],["impl Freeze for RateLimiter",1,["actix_limitation::middleware::RateLimiter"]],["impl Freeze for Status",1,["actix_limitation::status::Status"]],["impl Freeze for Limiter",1,["actix_limitation::Limiter"]]], "actix_protobuf":[["impl !Freeze for ProtoBufPayloadError",1,["actix_protobuf::ProtoBufPayloadError"]],["impl<T> Freeze for ProtoBuf<T>where
        T: Freeze,
    ",1,["actix_protobuf::ProtoBuf"]],["impl Freeze for ProtoBufConfig",1,["actix_protobuf::ProtoBufConfig"]],["impl<T> !Freeze for ProtoBufMessage<T>",1,["actix_protobuf::ProtoBufMessage"]]], "actix_redis":[["impl Freeze for Command",1,["actix_redis::redis::Command"]],["impl Freeze for RedisActor",1,["actix_redis::redis::RedisActor"]],["impl Freeze for Error",1,["actix_redis::Error"]]], diff --git a/implementors/core/marker/trait.Send.js b/implementors/core/marker/trait.Send.js index f4269f1e9..dc10f8922 100644 --- a/implementors/core/marker/trait.Send.js +++ b/implementors/core/marker/trait.Send.js @@ -1,6 +1,6 @@ (function() {var implementors = { "actix_cors":[["impl !Send for Cors",1,["actix_cors::builder::Cors"]],["impl Send for CorsError",1,["actix_cors::error::CorsError"]]], -"actix_identity":[["impl Send for LogoutBehaviour",1,["actix_identity::config::LogoutBehaviour"]],["impl Send for IdentityMiddlewareBuilder",1,["actix_identity::config::IdentityMiddlewareBuilder"]],["impl !Send for Identity",1,["actix_identity::identity::Identity"]],["impl !Send for IdentityMiddleware",1,["actix_identity::middleware::IdentityMiddleware"]]], +"actix_identity":[["impl Send for LogoutBehaviour",1,["actix_identity::config::LogoutBehaviour"]],["impl Send for IdentityMiddlewareBuilder",1,["actix_identity::config::IdentityMiddlewareBuilder"]],["impl Send for LoginError",1,["actix_identity::error::LoginError"]],["impl Send for SessionExpiryError",1,["actix_identity::error::SessionExpiryError"]],["impl Send for LostIdentityError",1,["actix_identity::error::LostIdentityError"]],["impl Send for MissingIdentityError",1,["actix_identity::error::MissingIdentityError"]],["impl Send for GetIdentityError",1,["actix_identity::error::GetIdentityError"]],["impl !Send for Identity",1,["actix_identity::identity::Identity"]],["impl !Send for IdentityMiddleware",1,["actix_identity::middleware::IdentityMiddleware"]]], "actix_limitation":[["impl Send for Builder",1,["actix_limitation::builder::Builder"]],["impl Send for Error",1,["actix_limitation::errors::Error"]],["impl Send for RateLimiter",1,["actix_limitation::middleware::RateLimiter"]],["impl Send for Status",1,["actix_limitation::status::Status"]],["impl Send for Limiter",1,["actix_limitation::Limiter"]]], "actix_protobuf":[["impl Send for ProtoBufPayloadError",1,["actix_protobuf::ProtoBufPayloadError"]],["impl<T> Send for ProtoBuf<T>",1,["actix_protobuf::ProtoBuf"]],["impl Send for ProtoBufConfig",1,["actix_protobuf::ProtoBufConfig"]],["impl<T> !Send for ProtoBufMessage<T>",1,["actix_protobuf::ProtoBufMessage"]]], "actix_redis":[["impl Send for Command",1,["actix_redis::redis::Command"]],["impl !Send for RedisActor",1,["actix_redis::redis::RedisActor"]],["impl Send for Error",1,["actix_redis::Error"]]], diff --git a/implementors/core/marker/trait.Sync.js b/implementors/core/marker/trait.Sync.js index c4ba6dd88..726e9d17e 100644 --- a/implementors/core/marker/trait.Sync.js +++ b/implementors/core/marker/trait.Sync.js @@ -1,6 +1,6 @@ (function() {var implementors = { "actix_cors":[["impl !Sync for Cors",1,["actix_cors::builder::Cors"]],["impl Sync for CorsError",1,["actix_cors::error::CorsError"]]], -"actix_identity":[["impl Sync for LogoutBehaviour",1,["actix_identity::config::LogoutBehaviour"]],["impl Sync for IdentityMiddlewareBuilder",1,["actix_identity::config::IdentityMiddlewareBuilder"]],["impl !Sync for Identity",1,["actix_identity::identity::Identity"]],["impl !Sync for IdentityMiddleware",1,["actix_identity::middleware::IdentityMiddleware"]]], +"actix_identity":[["impl Sync for LogoutBehaviour",1,["actix_identity::config::LogoutBehaviour"]],["impl Sync for IdentityMiddlewareBuilder",1,["actix_identity::config::IdentityMiddlewareBuilder"]],["impl Sync for LoginError",1,["actix_identity::error::LoginError"]],["impl Sync for SessionExpiryError",1,["actix_identity::error::SessionExpiryError"]],["impl Sync for LostIdentityError",1,["actix_identity::error::LostIdentityError"]],["impl Sync for MissingIdentityError",1,["actix_identity::error::MissingIdentityError"]],["impl Sync for GetIdentityError",1,["actix_identity::error::GetIdentityError"]],["impl !Sync for Identity",1,["actix_identity::identity::Identity"]],["impl !Sync for IdentityMiddleware",1,["actix_identity::middleware::IdentityMiddleware"]]], "actix_limitation":[["impl Sync for Builder",1,["actix_limitation::builder::Builder"]],["impl Sync for Error",1,["actix_limitation::errors::Error"]],["impl Sync for RateLimiter",1,["actix_limitation::middleware::RateLimiter"]],["impl Sync for Status",1,["actix_limitation::status::Status"]],["impl Sync for Limiter",1,["actix_limitation::Limiter"]]], "actix_protobuf":[["impl Sync for ProtoBufPayloadError",1,["actix_protobuf::ProtoBufPayloadError"]],["impl<T> Sync for ProtoBuf<T>",1,["actix_protobuf::ProtoBuf"]],["impl Sync for ProtoBufConfig",1,["actix_protobuf::ProtoBufConfig"]],["impl<T> !Sync for ProtoBufMessage<T>",1,["actix_protobuf::ProtoBufMessage"]]], "actix_redis":[["impl Sync for Command",1,["actix_redis::redis::Command"]],["impl !Sync for RedisActor",1,["actix_redis::redis::RedisActor"]],["impl Sync for Error",1,["actix_redis::Error"]]], diff --git a/implementors/core/marker/trait.Unpin.js b/implementors/core/marker/trait.Unpin.js index bd584018d..7971d9762 100644 --- a/implementors/core/marker/trait.Unpin.js +++ b/implementors/core/marker/trait.Unpin.js @@ -1,6 +1,6 @@ (function() {var implementors = { "actix_cors":[["impl Unpin for Cors",1,["actix_cors::builder::Cors"]],["impl Unpin for CorsError",1,["actix_cors::error::CorsError"]]], -"actix_identity":[["impl Unpin for LogoutBehaviour",1,["actix_identity::config::LogoutBehaviour"]],["impl Unpin for IdentityMiddlewareBuilder",1,["actix_identity::config::IdentityMiddlewareBuilder"]],["impl Unpin for Identity",1,["actix_identity::identity::Identity"]],["impl Unpin for IdentityMiddleware",1,["actix_identity::middleware::IdentityMiddleware"]]], +"actix_identity":[["impl Unpin for LogoutBehaviour",1,["actix_identity::config::LogoutBehaviour"]],["impl Unpin for IdentityMiddlewareBuilder",1,["actix_identity::config::IdentityMiddlewareBuilder"]],["impl Unpin for LoginError",1,["actix_identity::error::LoginError"]],["impl Unpin for SessionExpiryError",1,["actix_identity::error::SessionExpiryError"]],["impl Unpin for LostIdentityError",1,["actix_identity::error::LostIdentityError"]],["impl Unpin for MissingIdentityError",1,["actix_identity::error::MissingIdentityError"]],["impl Unpin for GetIdentityError",1,["actix_identity::error::GetIdentityError"]],["impl Unpin for Identity",1,["actix_identity::identity::Identity"]],["impl Unpin for IdentityMiddleware",1,["actix_identity::middleware::IdentityMiddleware"]]], "actix_limitation":[["impl Unpin for Builder",1,["actix_limitation::builder::Builder"]],["impl Unpin for Error",1,["actix_limitation::errors::Error"]],["impl Unpin for RateLimiter",1,["actix_limitation::middleware::RateLimiter"]],["impl Unpin for Status",1,["actix_limitation::status::Status"]],["impl Unpin for Limiter",1,["actix_limitation::Limiter"]]], "actix_protobuf":[["impl Unpin for ProtoBufPayloadError",1,["actix_protobuf::ProtoBufPayloadError"]],["impl<T> Unpin for ProtoBuf<T>where
        T: Unpin,
    ",1,["actix_protobuf::ProtoBuf"]],["impl Unpin for ProtoBufConfig",1,["actix_protobuf::ProtoBufConfig"]],["impl<T> Unpin for ProtoBufMessage<T>",1,["actix_protobuf::ProtoBufMessage"]]], "actix_redis":[["impl Unpin for Command",1,["actix_redis::redis::Command"]],["impl Unpin for RedisActor",1,["actix_redis::redis::RedisActor"]],["impl Unpin for Error",1,["actix_redis::Error"]]], diff --git a/implementors/core/panic/unwind_safe/trait.RefUnwindSafe.js b/implementors/core/panic/unwind_safe/trait.RefUnwindSafe.js index c7453f110..2f4c19c70 100644 --- a/implementors/core/panic/unwind_safe/trait.RefUnwindSafe.js +++ b/implementors/core/panic/unwind_safe/trait.RefUnwindSafe.js @@ -1,6 +1,6 @@ (function() {var implementors = { "actix_cors":[["impl !RefUnwindSafe for Cors",1,["actix_cors::builder::Cors"]],["impl RefUnwindSafe for CorsError",1,["actix_cors::error::CorsError"]]], -"actix_identity":[["impl RefUnwindSafe for LogoutBehaviour",1,["actix_identity::config::LogoutBehaviour"]],["impl RefUnwindSafe for IdentityMiddlewareBuilder",1,["actix_identity::config::IdentityMiddlewareBuilder"]],["impl !RefUnwindSafe for Identity",1,["actix_identity::identity::Identity"]],["impl RefUnwindSafe for IdentityMiddleware",1,["actix_identity::middleware::IdentityMiddleware"]]], +"actix_identity":[["impl RefUnwindSafe for LogoutBehaviour",1,["actix_identity::config::LogoutBehaviour"]],["impl RefUnwindSafe for IdentityMiddlewareBuilder",1,["actix_identity::config::IdentityMiddlewareBuilder"]],["impl !RefUnwindSafe for LoginError",1,["actix_identity::error::LoginError"]],["impl RefUnwindSafe for SessionExpiryError",1,["actix_identity::error::SessionExpiryError"]],["impl RefUnwindSafe for LostIdentityError",1,["actix_identity::error::LostIdentityError"]],["impl RefUnwindSafe for MissingIdentityError",1,["actix_identity::error::MissingIdentityError"]],["impl !RefUnwindSafe for GetIdentityError",1,["actix_identity::error::GetIdentityError"]],["impl !RefUnwindSafe for Identity",1,["actix_identity::identity::Identity"]],["impl RefUnwindSafe for IdentityMiddleware",1,["actix_identity::middleware::IdentityMiddleware"]]], "actix_limitation":[["impl !RefUnwindSafe for Builder",1,["actix_limitation::builder::Builder"]],["impl !RefUnwindSafe for Error",1,["actix_limitation::errors::Error"]],["impl RefUnwindSafe for RateLimiter",1,["actix_limitation::middleware::RateLimiter"]],["impl RefUnwindSafe for Status",1,["actix_limitation::status::Status"]],["impl !RefUnwindSafe for Limiter",1,["actix_limitation::Limiter"]]], "actix_protobuf":[["impl !RefUnwindSafe for ProtoBufPayloadError",1,["actix_protobuf::ProtoBufPayloadError"]],["impl<T> RefUnwindSafe for ProtoBuf<T>where
        T: RefUnwindSafe,
    ",1,["actix_protobuf::ProtoBuf"]],["impl RefUnwindSafe for ProtoBufConfig",1,["actix_protobuf::ProtoBufConfig"]],["impl<T> !RefUnwindSafe for ProtoBufMessage<T>",1,["actix_protobuf::ProtoBufMessage"]]], "actix_redis":[["impl RefUnwindSafe for Command",1,["actix_redis::redis::Command"]],["impl !RefUnwindSafe for RedisActor",1,["actix_redis::redis::RedisActor"]],["impl !RefUnwindSafe for Error",1,["actix_redis::Error"]]], diff --git a/implementors/core/panic/unwind_safe/trait.UnwindSafe.js b/implementors/core/panic/unwind_safe/trait.UnwindSafe.js index 2fbf8df8a..f2cbe9f4f 100644 --- a/implementors/core/panic/unwind_safe/trait.UnwindSafe.js +++ b/implementors/core/panic/unwind_safe/trait.UnwindSafe.js @@ -1,6 +1,6 @@ (function() {var implementors = { "actix_cors":[["impl !UnwindSafe for Cors",1,["actix_cors::builder::Cors"]],["impl UnwindSafe for CorsError",1,["actix_cors::error::CorsError"]]], -"actix_identity":[["impl UnwindSafe for LogoutBehaviour",1,["actix_identity::config::LogoutBehaviour"]],["impl UnwindSafe for IdentityMiddlewareBuilder",1,["actix_identity::config::IdentityMiddlewareBuilder"]],["impl !UnwindSafe for Identity",1,["actix_identity::identity::Identity"]],["impl UnwindSafe for IdentityMiddleware",1,["actix_identity::middleware::IdentityMiddleware"]]], +"actix_identity":[["impl UnwindSafe for LogoutBehaviour",1,["actix_identity::config::LogoutBehaviour"]],["impl UnwindSafe for IdentityMiddlewareBuilder",1,["actix_identity::config::IdentityMiddlewareBuilder"]],["impl !UnwindSafe for LoginError",1,["actix_identity::error::LoginError"]],["impl UnwindSafe for SessionExpiryError",1,["actix_identity::error::SessionExpiryError"]],["impl UnwindSafe for LostIdentityError",1,["actix_identity::error::LostIdentityError"]],["impl UnwindSafe for MissingIdentityError",1,["actix_identity::error::MissingIdentityError"]],["impl !UnwindSafe for GetIdentityError",1,["actix_identity::error::GetIdentityError"]],["impl !UnwindSafe for Identity",1,["actix_identity::identity::Identity"]],["impl UnwindSafe for IdentityMiddleware",1,["actix_identity::middleware::IdentityMiddleware"]]], "actix_limitation":[["impl !UnwindSafe for Builder",1,["actix_limitation::builder::Builder"]],["impl !UnwindSafe for Error",1,["actix_limitation::errors::Error"]],["impl UnwindSafe for RateLimiter",1,["actix_limitation::middleware::RateLimiter"]],["impl UnwindSafe for Status",1,["actix_limitation::status::Status"]],["impl !UnwindSafe for Limiter",1,["actix_limitation::Limiter"]]], "actix_protobuf":[["impl !UnwindSafe for ProtoBufPayloadError",1,["actix_protobuf::ProtoBufPayloadError"]],["impl<T> UnwindSafe for ProtoBuf<T>where
        T: UnwindSafe,
    ",1,["actix_protobuf::ProtoBuf"]],["impl UnwindSafe for ProtoBufConfig",1,["actix_protobuf::ProtoBufConfig"]],["impl<T> !UnwindSafe for ProtoBufMessage<T>",1,["actix_protobuf::ProtoBufMessage"]]], "actix_redis":[["impl UnwindSafe for Command",1,["actix_redis::redis::Command"]],["impl !UnwindSafe for RedisActor",1,["actix_redis::redis::RedisActor"]],["impl !UnwindSafe for Error",1,["actix_redis::Error"]]], diff --git a/search-index.js b/search-index.js index ca9d512f0..a7dba0ca7 100644 --- a/search-index.js +++ b/search-index.js @@ -1,6 +1,6 @@ var searchIndex = JSON.parse('{\ "actix_cors":{"doc":"Cross-Origin Resource Sharing (CORS) controls for Actix …","t":[13,13,3,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],"n":["BadRequestHeaders","BadRequestMethod","Cors","CorsError","HeadersNotAllowed","MethodNotAllowed","MissingOrigin","MissingRequestMethod","OriginNotAllowed","WildcardOrigin","allow_any_header","allow_any_method","allow_any_origin","allow_private_network_access","allowed_header","allowed_headers","allowed_methods","allowed_origin","allowed_origin_fn","block_on_origin_mismatch","borrow","borrow","borrow_mut","borrow_mut","clone","clone_into","default","disable_preflight","disable_vary_header","error_response","expose_any_header","expose_headers","fmt","fmt","fmt","from","from","into","into","max_age","new_transform","permissive","provide","send_wildcard","status_code","supports_credentials","to_owned","to_string","try_from","try_from","try_into","try_into","type_id","type_id","vzip","vzip"],"q":["actix_cors","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","",""],"d":["Request header Access-Control-Request-Headers has an …","Request header Access-Control-Request-Method has an …","Builder for CORS middleware.","Errors that can occur when processing CORS guarded …","One or more request headers are not allowed.","Request method is not allowed.","Request header Origin is required but was not provided.","Request header Access-Control-Request-Method is required …","Origin is not allowed to make this request.","Allowed origin argument must not be wildcard (*).","Resets allowed request header list to a state where any …","Resets allowed methods list to all methods.","Resets allowed origin list to a state where any origin is …","Allow private network access.","Add an allowed request header.","Set a list of request header field names which can be used …","Set a list of methods which allowed origins can perform.","Add an origin that is allowed to make requests.","Determinate allowed origins by processing requests which …","Configures whether requests should be pre-emptively …","","","","","","","A restrictive (security paranoid) set of defaults.","Disable support for preflight requests.","Disable Vary header support.","","Resets exposed response header list to a state where all …","Set a list of headers which are safe to expose to the API …","","","","Returns the argument unchanged.","Returns the argument unchanged.","Calls U::from(self).","Calls U::from(self).","Set a maximum time (in seconds) for which this CORS …","","A very permissive set of default for quick development. …","","Set to use wildcard origins.","","Allows users to make authenticated requests","","","","","","","","","",""],"i":[4,4,0,0,4,4,4,4,4,4,1,1,1,1,1,1,1,1,1,1,1,4,1,4,4,4,1,1,1,4,1,1,1,4,4,1,4,1,4,1,1,1,4,1,4,1,4,4,1,4,1,4,1,4,1,4],"f":[0,0,0,0,0,0,0,0,0,0,[1,1],[1,1],[1,1],[1,1],[1,1],[1,1],[1,1],[[1,2],1],[1,1],[[1,3],1],[[]],[[]],[[]],[[]],[4,4],[[]],[[],1],[1,1],[1,1],[4,5],[1,1],[1,1],[[1,6],7],[[4,6],7],[[4,6],7],[[]],[[]],[[]],[[]],[[1,[10,[[9,[8]]]]],1],[1],[[],1],[11],[1,1],[4,12],[1,1],[[]],[[],13],[[],14],[[],14],[[],14],[[],14],[[],15],[[],15],[[]],[[]]],"p":[[3,"Cors"],[15,"str"],[15,"bool"],[4,"CorsError"],[3,"HttpResponse"],[3,"Formatter"],[6,"Result"],[15,"usize"],[4,"Option"],[8,"Into"],[3,"Demand"],[3,"StatusCode"],[3,"String"],[4,"Result"],[3,"TypeId"]]},\ -"actix_identity":{"doc":"Identity management for Actix Web.","t":[3,8,3,11,11,11,11,11,11,11,0,11,11,11,11,10,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,13,3,4,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],"n":["Identity","IdentityExt","IdentityMiddleware","borrow","borrow","borrow_mut","borrow_mut","builder","clone","clone_into","config","default","from","from","from_request","get_identity","id","into","into","login","logout","new_transform","to_owned","try_from","try_from","try_into","try_into","type_id","type_id","vzip","vzip","DeleteIdentityKeys","IdentityMiddlewareBuilder","LogoutBehaviour","PurgeSession","borrow","borrow","borrow_mut","borrow_mut","build","clone","clone","clone_into","clone_into","fmt","fmt","from","from","into","into","login_deadline","logout_behaviour","to_owned","to_owned","try_from","try_from","try_into","try_into","type_id","type_id","visit_deadline","vzip","vzip"],"q":["actix_identity","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","actix_identity::config","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","",""],"d":["A verified user identity. It can be used as a request …","Helper trait to retrieve an Identity instance from various …","Identity management middleware.","","","","","A fluent API to configure IdentityMiddleware.","","","Configuration options to tune the behaviour of …","","Returns the argument unchanged.","Returns the argument unchanged.","","Retrieve the identity attached to the current session, if …","Return the user id associated to the current session.","Calls U::from(self).","Calls U::from(self).","Attach a valid user identity to the current session.","Remove the user identity from the current session.","","","","","","","","","","","When Identity::logout is called, remove the identity …","A fluent builder to construct an IdentityMiddleware …","LogoutBehaviour controls what actions are going to be …","When Identity::logout is called, purge the current session.","","","","","Finalises the builder and returns an IdentityMiddleware …","","","","","","","Returns the argument unchanged.","Returns the argument unchanged.","Calls U::from(self).","Calls U::from(self).","Automatically logs out users after a certain amount of …","Determines how Identity::logout affects the current …","","","","","","","","","Automatically logs out users after a certain amount of …","",""],"i":[0,0,0,5,2,5,2,2,2,2,0,2,5,2,5,16,5,5,2,5,5,2,2,5,2,5,2,5,2,5,2,11,0,0,11,11,1,11,1,1,11,1,11,1,11,1,11,1,11,1,1,1,11,1,11,1,11,1,11,1,1,11,1],"f":[0,0,0,[[]],[[]],[[]],[[]],[[],1],[2,2],[[]],0,[[],2],[[]],[[]],[[3,4]],[[],[[7,[5,6]]]],[5,[[7,[8,6]]]],[[]],[[]],[[9,8],[[7,[5,6]]]],[5],[2],[[]],[[],7],[[],7],[[],7],[[],7],[[],10],[[],10],[[]],[[]],0,0,0,0,[[]],[[]],[[]],[[]],[1,2],[11,11],[1,1],[[]],[[]],[[11,12],13],[[1,12],13],[[]],[[]],[[]],[[]],[[1,[15,[14]]],1],[[1,11],1],[[]],[[]],[[],7],[[],7],[[],7],[[],7],[[],10],[[],10],[[1,[15,[14]]],1],[[]],[[]]],"p":[[3,"IdentityMiddlewareBuilder"],[3,"IdentityMiddleware"],[3,"HttpRequest"],[4,"Payload"],[3,"Identity"],[3,"Error"],[4,"Result"],[3,"String"],[3,"Extensions"],[3,"TypeId"],[4,"LogoutBehaviour"],[3,"Formatter"],[6,"Result"],[3,"Duration"],[4,"Option"],[8,"IdentityExt"]]},\ +"actix_identity":{"doc":"Identity management for Actix Web.","t":[3,8,3,11,11,11,11,11,11,11,0,11,0,11,11,11,10,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,13,3,4,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,4,3,3,13,3,13,3,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],"n":["Identity","IdentityExt","IdentityMiddleware","borrow","borrow","borrow_mut","borrow_mut","builder","clone","clone_into","config","default","error","from","from","from_request","get_identity","id","into","into","login","logout","new_transform","to_owned","try_from","try_from","try_into","try_into","type_id","type_id","vzip","vzip","DeleteIdentityKeys","IdentityMiddlewareBuilder","LogoutBehaviour","PurgeSession","borrow","borrow","borrow_mut","borrow_mut","build","clone","clone","clone_into","clone_into","fmt","fmt","from","from","into","into","login_deadline","logout_behaviour","to_owned","to_owned","try_from","try_from","try_into","try_into","type_id","type_id","visit_deadline","vzip","vzip","GetIdentityError","LoginError","LostIdentityError","LostIdentityError","MissingIdentityError","MissingIdentityError","SessionExpiryError","SessionExpiryError","SessionGetError","borrow","borrow","borrow","borrow","borrow","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","from","from","from","from","from","from","from","from","from","from","into","into","into","into","into","provide","provide","provide","provide","provide","source","source","source","source","status_code","status_code","to_string","to_string","to_string","to_string","to_string","try_from","try_from","try_from","try_from","try_from","try_into","try_into","try_into","try_into","try_into","type_id","type_id","type_id","type_id","type_id","vzip","vzip","vzip","vzip","vzip"],"q":["actix_identity","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","actix_identity::config","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","actix_identity::error","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","",""],"d":["A verified user identity. It can be used as a request …","Helper trait to retrieve an Identity instance from various …","Identity management middleware.","","","","","A fluent API to configure IdentityMiddleware.","","","Configuration options to tune the behaviour of …","","Failure modes of identity operations.","Returns the argument unchanged.","Returns the argument unchanged.","","Retrieve the identity attached to the current session, if …","Return the user id associated to the current session.","Calls U::from(self).","Calls U::from(self).","Attach a valid user identity to the current session.","Remove the user identity from the current session.","","","","","","","","","","","When Identity::logout is called, remove the identity …","A fluent builder to construct an IdentityMiddleware …","LogoutBehaviour controls what actions are going to be …","When Identity::logout is called, purge the current session.","","","","","Finalises the builder and returns an IdentityMiddleware …","","","","","","","Returns the argument unchanged.","Returns the argument unchanged.","Calls U::from(self).","Calls U::from(self).","Automatically logs out users after a certain amount of …","Determines how Identity::logout affects the current …","","","","","","","","","Automatically logs out users after a certain amount of …","","","Errors that can occur while retrieving an identity.","Error that can occur during login attempts.","The identity information has been lost.","Identity info was lost after being validated.","There is no identity information attached to the current …","No identity is found in a session.","Error encountered when working with a session that has …","The session has expired.","Failed to accessing the session store.","","","","","","","","","","","","","","","","","","","","","","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","","","Returns the argument unchanged.","","","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","",""],"i":[0,0,0,5,2,5,2,2,2,2,0,2,0,5,2,5,26,5,5,2,5,5,2,2,5,2,5,2,5,2,5,2,12,0,0,12,12,1,12,1,1,12,1,12,1,12,1,12,1,12,1,1,1,12,1,12,1,12,1,12,1,1,12,1,0,0,0,6,0,6,0,6,6,10,17,18,19,6,10,17,18,19,6,10,10,17,17,18,18,19,19,6,6,10,10,17,18,19,6,6,6,6,6,10,17,18,19,6,10,17,18,19,6,10,18,19,6,10,6,10,17,18,19,6,10,17,18,19,6,10,17,18,19,6,10,17,18,19,6,10,17,18,19,6],"f":[0,0,0,[[]],[[]],[[]],[[]],[[],1],[2,2],[[]],0,[[],2],0,[[]],[[]],[[3,4]],[[],[[7,[5,6]]]],[5,[[7,[8,6]]]],[[]],[[]],[[9,8],[[7,[5,10]]]],[5],[2],[[]],[[],7],[[],7],[[],7],[[],7],[[],11],[[],11],[[]],[[]],0,0,0,0,[[]],[[]],[[]],[[]],[1,2],[12,12],[1,1],[[]],[[]],[[12,13],14],[[1,13],14],[[]],[[]],[[]],[[]],[[1,[16,[15]]],1],[[1,12],1],[[]],[[]],[[],7],[[],7],[[],7],[[],7],[[],11],[[],11],[[1,[16,[15]]],1],[[]],[[]],0,0,0,0,0,0,0,0,0,[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[10,13],14],[[10,13],14],[[17,13],14],[[17,13],14],[[18,13],14],[[18,13],14],[[19,13],14],[[19,13],14],[[6,13],14],[[6,13],14],[20,10],[[]],[[]],[[]],[[]],[18,6],[21,6],[[]],[19,6],[22,6],[[]],[[]],[[]],[[]],[[]],[23],[23],[23],[23],[23],[10,[[16,[24]]]],[18,[[16,[24]]]],[19,[[16,[24]]]],[6,[[16,[24]]]],[10,25],[6,25],[[],8],[[],8],[[],8],[[],8],[[],8],[[],7],[[],7],[[],7],[[],7],[[],7],[[],7],[[],7],[[],7],[[],7],[[],7],[[],11],[[],11],[[],11],[[],11],[[],11],[[]],[[]],[[]],[[]],[[]]],"p":[[3,"IdentityMiddlewareBuilder"],[3,"IdentityMiddleware"],[3,"HttpRequest"],[4,"Payload"],[3,"Identity"],[4,"GetIdentityError"],[4,"Result"],[3,"String"],[3,"Extensions"],[3,"LoginError"],[3,"TypeId"],[4,"LogoutBehaviour"],[3,"Formatter"],[6,"Result"],[3,"Duration"],[4,"Option"],[3,"SessionExpiryError"],[3,"LostIdentityError"],[3,"MissingIdentityError"],[3,"SessionInsertError"],[3,"ComponentRange"],[3,"SessionGetError"],[3,"Demand"],[8,"Error"],[3,"StatusCode"],[8,"IdentityExt"]]},\ "actix_limitation":{"doc":"Rate limiter using a fixed window counter for arbitrary …","t":[3,13,17,17,17,17,4,13,3,13,3,3,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],"n":["Builder","Client","DEFAULT_COOKIE_NAME","DEFAULT_PERIOD_SECS","DEFAULT_REQUEST_LIMIT","DEFAULT_SESSION_KEY","Error","LimitExceeded","Limiter","Other","RateLimiter","Status","Time","borrow","borrow","borrow","borrow","borrow","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","build","builder","clone","clone","clone_into","clone_into","cookie_name","count","default","fmt","fmt","fmt","fmt","fmt","fmt","from","from","from","from","from","from","from","into","into","into","into","into","key_by","limit","limit","new_transform","period","provide","remaining","reset_epoch_utc","session_key","source","to_owned","to_owned","to_string","try_from","try_from","try_from","try_from","try_from","try_into","try_into","try_into","try_into","try_into","type_id","type_id","type_id","type_id","type_id","vzip","vzip","vzip","vzip","vzip"],"q":["actix_limitation","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","",""],"d":["Rate limiter builder.","Redis client failed to connect or run a query.","Default cookie name.","Default period (in seconds).","Default request limit.","Default session key.","Failure modes of the rate limiter.","Limit is exceeded for a key.","Rate limiter.","Generic error.","Rate limit middleware.","A report for a given key containing the limit status.","Time conversion failed.","","","","","","","","","","","Finalizes and returns a Limiter.","Construct rate limiter builder with defaults.","","","","","Sets name of cookie to be sent.","Consumes one rate limit unit, returning the status.","","","","","","","","Returns the argument unchanged.","","","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Sets rate limit key derivation function.","Set upper limit.","Returns the maximum number of requests allowed in the …","","Set limit window/period.","","Returns how many requests are left in the current period.","Returns a UNIX timestamp in UTC approximately when the …","Sets session key to be used in backend.","","","","","","","","","","","","","","","","","","","","","","","",""],"i":[0,3,0,0,0,0,0,3,0,3,0,0,3,1,3,10,7,2,1,3,10,7,2,1,2,7,2,7,2,1,2,10,1,3,3,10,7,2,1,3,3,3,10,7,2,1,3,10,7,2,1,1,7,10,1,3,7,7,1,3,7,2,3,1,3,10,7,2,1,3,10,7,2,1,3,10,7,2,1,3,10,7,2],"f":[0,0,0,0,0,0,0,0,0,0,0,0,0,[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[1,[[4,[2,3]]]],[[[6,[5]]],1],[7,7],[2,2],[[]],[[]],[[1,[6,[[9,[8]]]]],1],[[2,[6,[5]]],[[4,[7,3]]]],[[],10],[[1,11],12],[[3,11],12],[[3,11],12],[[10,11],12],[[7,11],12],[[2,11],12],[[]],[13,3],[14,3],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[1,1],[[1,15],1],[7,15],[10],[[1,16],1],[17],[7,15],[7,15],[[1,[6,[[9,[8]]]]],1],[3,[[19,[18]]]],[[]],[[]],[[],5],[[],4],[[],4],[[],4],[[],4],[[],4],[[],4],[[],4],[[],4],[[],4],[[],4],[[],20],[[],20],[[],20],[[],20],[[],20],[[]],[[]],[[]],[[]],[[]]],"p":[[3,"Builder"],[3,"Limiter"],[4,"Error"],[4,"Result"],[3,"String"],[8,"Into"],[3,"Status"],[15,"str"],[4,"Cow"],[3,"RateLimiter"],[3,"Formatter"],[6,"Result"],[3,"RedisError"],[3,"ComponentRange"],[15,"usize"],[3,"Duration"],[3,"Demand"],[8,"Error"],[4,"Option"],[3,"TypeId"]]},\ "actix_protobuf":{"doc":"Protobuf payload extractor for Actix Web.","t":[13,13,13,13,3,3,3,4,8,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,10,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11],"n":["ContentType","Deserialize","Overflow","Payload","ProtoBuf","ProtoBufConfig","ProtoBufMessage","ProtoBufPayloadError","ProtoBufResponseBuilder","Serialize","borrow","borrow","borrow","borrow","borrow_mut","borrow_mut","borrow_mut","borrow_mut","default","deref","deref_mut","error_response","fmt","fmt","fmt","fmt","from","from","from","from","from","from","from_request","into","into","into","into","into_future","limit","limit","new","poll","protobuf","resource_path","respond_to","to_string","to_string","try_from","try_from","try_from","try_from","try_into","try_into","try_into","try_into","try_poll","type_id","type_id","type_id","type_id","vzip","vzip","vzip","vzip"],"q":["actix_protobuf","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","",""],"d":["Content type error","Deserialize error","Payload size is bigger than 256k","Payload error","","","","","","Serialize error","","","","","","","","","","","","","","","","","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","","","Returns the argument unchanged.","","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","","Change max size of payload. By default max size is 256Kb","Change max size of payload. By default max size is 256Kb","Create ProtoBufMessage for request.","","","","","","","","","","","","","","","","","","","","","","",""],"i":[4,4,4,4,0,0,0,0,0,4,3,1,14,4,3,1,14,4,1,3,3,4,3,3,4,4,3,1,14,4,4,4,3,3,1,14,4,14,1,14,14,14,23,3,3,3,4,3,1,14,4,3,1,14,4,14,3,1,14,4,3,1,14,4],"f":[0,0,0,0,0,0,0,0,0,0,[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[],1],[[[3,[2]]]],[[[3,[2]]]],[4,5],[[3,6],7],[[3,6],7],[[4,6],7],[[4,6],7],[[]],[[]],[[]],[8,4],[9,4],[[]],[[10,11]],[[]],[[]],[[]],[[]],[[]],[[1,12],1],[[[14,[[0,[2,13]]]],12],[[14,[[0,[2,13]]]]]],[[10,11],[[14,[[0,[2,13]]]]]],[[[15,[[14,[[0,[2,13]]]]]],16],17],[2,[[19,[5,18]]]],[[],20],[[[3,[[0,[2,13]]]],10],5],[[],21],[[],21],[[],19],[[],19],[[],19],[[],19],[[],19],[[],19],[[],19],[[],19],[[15,16],17],[[],22],[[],22],[[],22],[[],22],[[]],[[]],[[]],[[]]],"p":[[3,"ProtoBufConfig"],[8,"Message"],[3,"ProtoBuf"],[4,"ProtoBufPayloadError"],[3,"HttpResponse"],[3,"Formatter"],[6,"Result"],[3,"DecodeError"],[4,"PayloadError"],[3,"HttpRequest"],[4,"Payload"],[15,"usize"],[8,"Default"],[3,"ProtoBufMessage"],[3,"Pin"],[3,"Context"],[4,"Poll"],[3,"Error"],[4,"Result"],[3,"Path"],[3,"String"],[3,"TypeId"],[8,"ProtoBufResponseBuilder"]]},\ "actix_redis":{"doc":"Redis integration for actix.","t":[13,13,3,13,13,4,13,13,13,13,13,13,13,3,13,13,4,4,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,14,11,11,11,11,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":["Array","BulkString","Command","Connection","Disconnected","Error","Error","IO","Integer","Internal","Nil","NotConnected","Redis","RedisActor","Remote","Resp","RespError","RespValue","SimpleString","Unexpected","append","borrow","borrow","borrow","borrow","borrow","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","clone","clone_into","eq","equivalent","error","fmt","fmt","fmt","fmt","fmt","fmt","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from_resp_int","handle","handle","into","into","into","into","into","provide","provide","push","resp_array","restarting","source","source","start","started","to_owned","to_string","to_string","try_from","try_from","try_from","try_from","try_from","try_into","try_into","try_into","try_into","try_into","type_id","type_id","type_id","type_id","type_id","vzip","vzip","vzip","vzip","vzip"],"q":["actix_redis","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","",""],"d":["Zero, one or more other RespValues.","A bulk string. In Redis terminology a string is a …","Command for sending data to Redis.","Error creating a connection, or an error with a connection …","Cancel all waiters when connection is dropped.","General purpose actix-redis error.","An error from the Redis server","An IO error occurred","Redis documentation defines an integer as being a signed …","A non-specific internal error that prevented an operation …","","Receiving message during reconnecting.","","Redis communication actor.","A remote error","A RESP parsing/serialising error occurred","","A single RESP value, this owns the data that is read/to-be …","","An unexpected error. In this context “unexpected” …","Convenience function for building dynamic Redis commands …","","","","","","","","","","","","","","","","","","","","","","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","","","Returns the argument unchanged.","","","","","","","","","Returns the argument unchanged.","","","","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","","","Push item to Resp array","Macro to create a RESP array, useful for preparing …","","","","Start new Supervisor with RedisActor.","","","","","","","","","","","","","","","","","","","","","","","",""],"i":[1,1,0,13,10,0,1,13,1,13,1,10,10,0,13,13,0,0,1,13,1,4,7,10,1,13,4,7,10,1,13,1,1,1,1,4,7,10,10,1,13,13,4,7,10,10,1,1,1,1,1,1,1,1,13,13,13,1,4,4,4,7,10,1,13,10,13,1,0,4,10,13,4,4,1,10,13,4,7,10,1,13,4,7,10,1,13,4,7,10,1,13,4,7,10,1,13],"f":[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,[[1,2],1],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[1,1],[[]],[[1,1],3],[[],3],[[4,5],6],[[7,8],9],[[10,8],9],[[10,8],9],[[1,8],[[12,[11]]]],[[13,8],[[12,[11]]]],[[13,8],[[12,[11]]]],[[]],[[]],[[]],[13,10],[[[16,[14,15]]],1],[[]],[[],1],[17,1],[18,1],[[[20,[19]]],1],[18,1],[19,1],[5,13],[21,13],[[]],[1,[[12,[1,13]]]],[[4,[12,[1,13]]]],[[4,7]],[[]],[[]],[[]],[[]],[[]],[22],[22],[1],0,[4],[10,[[24,[23]]]],[13,[[24,[23]]]],[[[25,[18]]],[[26,[4]]]],[[4,27]],[[]],[[],18],[[],18],[[],12],[[],12],[[],12],[[],12],[[],12],[[],12],[[],12],[[],12],[[],12],[[],12],[[],28],[[],28],[[],28],[[],28],[[],28],[[]],[[]],[[]],[[]],[[]]],"p":[[4,"RespValue"],[8,"IntoIterator"],[15,"bool"],[3,"RedisActor"],[3,"Error"],[4,"Running"],[3,"Command"],[3,"Formatter"],[6,"Result"],[4,"Error"],[3,"Error"],[4,"Result"],[4,"RespError"],[15,"u8"],[3,"Global"],[3,"Vec"],[15,"usize"],[3,"String"],[15,"str"],[3,"Arc"],[3,"TrySendError"],[3,"Demand"],[8,"Error"],[4,"Option"],[8,"Into"],[3,"Addr"],[3,"Context"],[3,"TypeId"]]},\ diff --git a/settings.html b/settings.html index 2eb99cdc7..4cd5f80a0 100644 --- a/settings.html +++ b/settings.html @@ -1 +1,2 @@ -Rustdoc settings

    Rustdoc settings

    Back
    \ No newline at end of file +Rustdoc settings

    Rustdoc settings

    Back
    \ No newline at end of file diff --git a/source-files.js b/source-files.js index 0f565eb87..422c104a4 100644 --- a/source-files.js +++ b/source-files.js @@ -1,6 +1,6 @@ var sourcesIndex = JSON.parse('{\ "actix_cors":["",[],["all_or_some.rs","builder.rs","error.rs","inner.rs","lib.rs","middleware.rs"]],\ -"actix_identity":["",[],["config.rs","identity.rs","identity_ext.rs","lib.rs","middleware.rs"]],\ +"actix_identity":["",[],["config.rs","error.rs","identity.rs","identity_ext.rs","lib.rs","middleware.rs"]],\ "actix_limitation":["",[],["builder.rs","errors.rs","lib.rs","middleware.rs","status.rs"]],\ "actix_protobuf":["",[],["lib.rs"]],\ "actix_redis":["",[],["lib.rs","redis.rs"]],\ diff --git a/src/actix_identity/error.rs.html b/src/actix_identity/error.rs.html new file mode 100644 index 000000000..f3716f9a7 --- /dev/null +++ b/src/actix_identity/error.rs.html @@ -0,0 +1,314 @@ +error.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
    +
    //! Failure modes of identity operations.
    +
    +use std::fmt;
    +
    +use actix_session::{SessionGetError, SessionInsertError};
    +use actix_web::{cookie::time::error::ComponentRange, http::StatusCode, ResponseError};
    +
    +/// Error that can occur during login attempts.
    +#[derive(Debug)]
    +pub struct LoginError(SessionInsertError);
    +
    +impl fmt::Display for LoginError {
    +    fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
    +        write!(f, "{}", self.0)
    +    }
    +}
    +
    +impl std::error::Error for LoginError {
    +    fn source(&self) -> Option<&(dyn std::error::Error + 'static)> {
    +        Some(&self.0)
    +    }
    +}
    +
    +impl ResponseError for LoginError {
    +    fn status_code(&self) -> StatusCode {
    +        StatusCode::UNAUTHORIZED
    +    }
    +}
    +
    +impl From<SessionInsertError> for LoginError {
    +    fn from(error: SessionInsertError) -> Self {
    +        Self(error)
    +    }
    +}
    +
    +/// Error encountered when working with a session that has expired.
    +#[derive(Debug)]
    +pub struct SessionExpiryError(ComponentRange);
    +
    +impl fmt::Display for SessionExpiryError {
    +    fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
    +        f.write_str("The given session has expired and is no longer valid")
    +    }
    +}
    +
    +impl std::error::Error for SessionExpiryError {}
    +
    +/// The identity information has been lost.
    +///
    +/// Seeing this error in user code indicates a bug in actix-identity.
    +#[derive(Debug)]
    +#[non_exhaustive]
    +pub struct LostIdentityError;
    +
    +impl fmt::Display for LostIdentityError {
    +    fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
    +        f.write_str(
    +            "The identity information in the current session has disappeared \
    +            after having been successfully validated. This is likely to be a bug.",
    +        )
    +    }
    +}
    +
    +impl std::error::Error for LostIdentityError {
    +    fn source(&self) -> Option<&(dyn std::error::Error + 'static)> {
    +        Some(self)
    +    }
    +}
    +
    +/// There is no identity information attached to the current session.
    +#[derive(Debug)]
    +#[non_exhaustive]
    +pub struct MissingIdentityError;
    +
    +impl fmt::Display for MissingIdentityError {
    +    fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
    +        f.write_str("There is no identity information attached to the current session.")
    +    }
    +}
    +
    +impl std::error::Error for MissingIdentityError {
    +    fn source(&self) -> Option<&(dyn std::error::Error + 'static)> {
    +        Some(self)
    +    }
    +}
    +
    +/// Errors that can occur while retrieving an identity.
    +#[derive(Debug)]
    +#[non_exhaustive]
    +pub enum GetIdentityError {
    +    /// The session has expired.
    +    SessionExpiryError(SessionExpiryError),
    +
    +    /// No identity is found in a session.
    +    MissingIdentityError(MissingIdentityError),
    +
    +    /// Failed to accessing the session store.
    +    SessionGetError(SessionGetError),
    +
    +    /// Identity info was lost after being validated.
    +    ///
    +    /// Seeing this error indicates a bug in actix-identity.
    +    LostIdentityError(LostIdentityError),
    +}
    +
    +impl fmt::Display for GetIdentityError {
    +    fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
    +        match self {
    +            Self::SessionExpiryError(err) => write!(f, "{err}"),
    +            Self::MissingIdentityError(err) => write!(f, "{err}"),
    +            Self::SessionGetError(err) => write!(f, "{err}"),
    +            Self::LostIdentityError(err) => write!(f, "{err}"),
    +        }
    +    }
    +}
    +
    +impl std::error::Error for GetIdentityError {
    +    fn source(&self) -> Option<&(dyn std::error::Error + 'static)> {
    +        match self {
    +            Self::SessionExpiryError(err) => Some(err),
    +            Self::MissingIdentityError(err) => Some(err),
    +            Self::SessionGetError(err) => Some(err),
    +            Self::LostIdentityError(err) => Some(err),
    +        }
    +    }
    +}
    +
    +impl ResponseError for GetIdentityError {
    +    fn status_code(&self) -> StatusCode {
    +        StatusCode::UNAUTHORIZED
    +    }
    +}
    +
    +impl From<LostIdentityError> for GetIdentityError {
    +    fn from(error: LostIdentityError) -> Self {
    +        Self::LostIdentityError(error)
    +    }
    +}
    +
    +impl From<MissingIdentityError> for GetIdentityError {
    +    fn from(error: MissingIdentityError) -> Self {
    +        Self::MissingIdentityError(error)
    +    }
    +}
    +
    +impl From<ComponentRange> for GetIdentityError {
    +    fn from(error: ComponentRange) -> Self {
    +        Self::SessionExpiryError(SessionExpiryError(error))
    +    }
    +}
    +
    +impl From<SessionGetError> for GetIdentityError {
    +    fn from(source: SessionGetError) -> Self {
    +        Self::SessionGetError(source)
    +    }
    +}
    +
    +
    \ No newline at end of file diff --git a/src/actix_identity/identity.rs.html b/src/actix_identity/identity.rs.html index 07ad0ee04..f894c7da3 100644 --- a/src/actix_identity/identity.rs.html +++ b/src/actix_identity/identity.rs.html @@ -271,9 +271,11 @@ http::StatusCode, Error, FromRequest, HttpMessage, HttpRequest, HttpResponse, }; -use anyhow::{anyhow, Context}; -use crate::config::LogoutBehaviour; +use crate::{ + config::LogoutBehaviour, + error::{GetIdentityError, LoginError, LostIdentityError, MissingIdentityError}, +}; /// A verified user identity. It can be used as a request extractor. /// @@ -360,13 +362,10 @@ } /// Retrieve the user id attached to the current session. - fn get_identity(&self) -> Result<String, anyhow::Error> { + fn get_identity(&self) -> Result<String, GetIdentityError> { self.session - .get::<String>(ID_KEY) - .context("Failed to deserialize the user identifier attached to the current session")? - .ok_or_else(|| { - anyhow!("There is no identity information attached to the current session") - }) + .get::<String>(ID_KEY)? + .ok_or_else(|| MissingIdentityError.into()) } } @@ -391,10 +390,11 @@ /// } /// } /// ``` - pub fn id(&self) -> Result<String, anyhow::Error> { - self.0.session.get(ID_KEY)?.ok_or_else(|| { - anyhow!("Bug: the identity information attached to the current session has disappeared") - }) + pub fn id(&self) -> Result<String, GetIdentityError> { + self.0 + .session + .get(ID_KEY)? + .ok_or_else(|| LostIdentityError.into()) } /// Attach a valid user identity to the current session. @@ -414,7 +414,7 @@ /// HttpResponse::Ok() /// } /// ``` - pub fn login(ext: &Extensions, id: String) -> Result<Self, anyhow::Error> { + pub fn login(ext: &Extensions, id: String) -> Result<Self, LoginError> { let inner = IdentityInner::extract(ext); inner.session.insert(ID_KEY, id)?; let now = OffsetDateTime::now_utc().unix_timestamp(); @@ -465,31 +465,31 @@ } } - pub(crate) fn extract(ext: &Extensions) -> Result<Self, anyhow::Error> { + pub(crate) fn extract(ext: &Extensions) -> Result<Self, GetIdentityError> { let inner = IdentityInner::extract(ext); inner.get_identity()?; Ok(Self(inner)) } - pub(crate) fn logged_at(&self) -> Result<Option<OffsetDateTime>, anyhow::Error> { - self.0 + pub(crate) fn logged_at(&self) -> Result<Option<OffsetDateTime>, GetIdentityError> { + Ok(self + .0 .session .get(LOGIN_UNIX_TIMESTAMP_KEY)? .map(OffsetDateTime::from_unix_timestamp) - .transpose() - .map_err(anyhow::Error::from) + .transpose()?) } - pub(crate) fn last_visited_at(&self) -> Result<Option<OffsetDateTime>, anyhow::Error> { - self.0 + pub(crate) fn last_visited_at(&self) -> Result<Option<OffsetDateTime>, GetIdentityError> { + Ok(self + .0 .session .get(LAST_VISIT_UNIX_TIMESTAMP_KEY)? .map(OffsetDateTime::from_unix_timestamp) - .transpose() - .map_err(anyhow::Error::from) + .transpose()?) } - pub(crate) fn set_last_visited_at(&self) -> Result<(), anyhow::Error> { + pub(crate) fn set_last_visited_at(&self) -> Result<(), LoginError> { let now = OffsetDateTime::now_utc().unix_timestamp(); self.0.session.insert(LAST_VISIT_UNIX_TIMESTAMP_KEY, now)?; Ok(()) diff --git a/src/actix_identity/identity_ext.rs.html b/src/actix_identity/identity_ext.rs.html index e6b849acb..694790618 100644 --- a/src/actix_identity/identity_ext.rs.html +++ b/src/actix_identity/identity_ext.rs.html @@ -27,28 +27,28 @@ 27
    use actix_web::{dev::ServiceRequest, guard::GuardContext, HttpMessage, HttpRequest};
     
    -use crate::Identity;
    +use crate::{error::GetIdentityError, Identity};
     
     /// Helper trait to retrieve an [`Identity`] instance from various `actix-web`'s types.
     pub trait IdentityExt {
         /// Retrieve the identity attached to the current session, if available.
    -    fn get_identity(&self) -> Result<Identity, anyhow::Error>;
    +    fn get_identity(&self) -> Result<Identity, GetIdentityError>;
     }
     
     impl IdentityExt for HttpRequest {
    -    fn get_identity(&self) -> Result<Identity, anyhow::Error> {
    +    fn get_identity(&self) -> Result<Identity, GetIdentityError> {
             Identity::extract(&self.extensions())
         }
     }
     
     impl IdentityExt for ServiceRequest {
    -    fn get_identity(&self) -> Result<Identity, anyhow::Error> {
    +    fn get_identity(&self) -> Result<Identity, GetIdentityError> {
             Identity::extract(&self.extensions())
         }
     }
     
     impl<'a> IdentityExt for GuardContext<'a> {
    -    fn get_identity(&self) -> Result<Identity, anyhow::Error> {
    +    fn get_identity(&self) -> Result<Identity, GetIdentityError> {
             Identity::extract(&self.req_data())
         }
     }
    diff --git a/src/actix_identity/lib.rs.html b/src/actix_identity/lib.rs.html
    index 2d54d5583..823f65b2c 100644
    --- a/src/actix_identity/lib.rs.html
    +++ b/src/actix_identity/lib.rs.html
    @@ -96,6 +96,7 @@
     96
     97
     98
    +99
     
    //! Identity management for Actix Web.
     //!
     //! `actix-identity` can be used to track identity of a user across multiple requests. It is built
    @@ -189,6 +190,7 @@
     #![warn(future_incompatible)]
     
     pub mod config;
    +pub mod error;
     mod identity;
     mod identity_ext;
     mod middleware;