1
0
mirror of https://github.com/actix/actix-extras.git synced 2025-06-26 02:19:22 +02:00

docs(httpauth): add HttpAuthentication::with_fn examples

This commit is contained in:
Rob Ede
2024-06-11 03:55:41 +01:00
parent 515a727ca3
commit b9e47d61c3
3 changed files with 54 additions and 7 deletions

View File

@ -25,7 +25,7 @@ We refer to the cookie used for sessions as a **session cookie**. Its content is
`actix-session` provides an easy-to-use framework to manage sessions in applications built on top of Actix Web. [`SessionMiddleware`] is the middleware underpinning the functionality provided by `actix-session`; it takes care of all the session cookie handling and instructs the **storage backend** to create/delete/update the session state based on the operations performed against the active [`Session`].
`actix-session` provides some built-in storage backends: ([`CookieSessionStore`], [`RedisSessionStore`], and [`RedisActorSessionStore`]) - you can create a custom storage backend by implementing the [`SessionStore`] trait.
`actix-session` provides some built-in storage backends: ([`CookieSessionStore`], [`RedisSessionStore`]) - you can create a custom storage backend by implementing the [`SessionStore`] trait.
Further reading on sessions:
@ -108,7 +108,7 @@ By default, `actix-session` does not provide any storage backend to retrieve and
actix-session = { version = "...", features = ["redis-session"] }
```
Add the `redis-session-native-tls` feature flag if you want to connect to Redis using a secured connection (via the `native-tls` crate):
Add the `redis-session-native-tls` feature flag if you want to connect to Redis using a secure connection (via the `native-tls` crate):
```toml
[dependencies]
@ -116,7 +116,7 @@ By default, `actix-session` does not provide any storage backend to retrieve and
actix-session = { version = "...", features = ["redis-session-native-tls"] }
```
If you instead prefer depending on `rustls`, use the `redis-session-rustls` feature flag:
If you, instead, prefer depending on `rustls`, use the `redis-session-rustls` feature flag:
```toml
[dependencies]
@ -129,6 +129,5 @@ You can implement your own session storage backend using the [`SessionStore`] tr
[`SessionStore`]: storage::SessionStore
[`CookieSessionStore`]: storage::CookieSessionStore
[`RedisSessionStore`]: storage::RedisSessionStore
[`RedisActorSessionStore`]: storage::RedisActorSessionStore
<!-- cargo-rdme end -->

View File

@ -27,8 +27,8 @@
//! against the active [`Session`].
//!
//! `actix-session` provides some built-in storage backends: ([`CookieSessionStore`],
//! [`RedisSessionStore`], and [`RedisActorSessionStore`]) - you can create a custom storage backend
//! by implementing the [`SessionStore`] trait.
//! [`RedisSessionStore`]) - you can create a custom storage backend by implementing the
//! [`SessionStore`] trait.
//!
//! Further reading on sessions:
//! - [RFC 6265](https://datatracker.ietf.org/doc/html/rfc6265);
@ -136,7 +136,6 @@
//! [`SessionStore`]: storage::SessionStore
//! [`CookieSessionStore`]: storage::CookieSessionStore
//! [`RedisSessionStore`]: storage::RedisSessionStore
//! [`RedisActorSessionStore`]: storage::RedisActorSessionStore
#![forbid(unsafe_code)]
#![deny(rust_2018_idioms, nonstandard_style)]