Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

feat(session): add rustls (actix#342) #402

Merged
merged 5 commits into from
Jun 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions actix-session/CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

## Unreleased

- Added support for using `rustls` in `actix-session` instead of `native-tls`
- Remove `redis-actor-session` crate feature (and, therefore, the `actix-redis` based storage backend).

## 0.9.0
Expand Down
1 change: 1 addition & 0 deletions actix-session/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ default = []
cookie-session = []
redis-rs-session = ["redis", "rand"]
redis-rs-tls-session = ["redis-rs-session", "redis/tokio-native-tls-comp"]
redis-rs-tls-session-rustls = ["redis-rs-session", "redis/tokio-rustls-comp"]

[dependencies]
actix-service = "2"
Expand Down
12 changes: 10 additions & 2 deletions actix-session/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -108,12 +108,20 @@ By default, `actix-session` does not provide any storage backend to retrieve and
actix-session = { version = "...", features = ["redis-rs-session"] }
```

Add the `redis-rs-tls-session` feature flag if you want to connect to Redis using a secured connection:
Add the `redis-rs-tls-session` feature flag if you want to connect to Redis using a secured connection (via the `native-tls` crate):

```toml
[dependencies]
# ...
actix-session = { version = "...", features = ["redis-rs-session", "redis-rs-tls-session"] }
actix-session = { version = "...", features = ["redis-rs-tls-session"] }
```

If you instead prefer depending on `rustls`, use the `redis-rs-tls-session-rustls` feature flag:

```toml
[dependencies]
# ...
actix-session = { version = "...", features = ["redis-rs-tls-session-rustls"] }
```

You can implement your own session storage backend using the [`SessionStore`] trait.
Expand Down
12 changes: 10 additions & 2 deletions actix-session/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -116,12 +116,20 @@ attached to your sessions. You can enable:
```

Add the `redis-rs-tls-session` feature flag if you want to connect to Redis using a secured
connection:
connection (via the `native-tls` crate):

```toml
[dependencies]
# ...
actix-session = { version = "...", features = ["redis-rs-session", "redis-rs-tls-session"] }
actix-session = { version = "...", features = ["redis-rs-tls-session"] }
```

If you instead prefer depending on `rustls`, use the `redis-rs-tls-session-rustls` feature flag:

```toml
[dependencies]
# ...
actix-session = { version = "...", features = ["redis-rs-tls-session-rustls"] }
```

You can implement your own session storage backend using the [`SessionStore`] trait.
Expand Down
2 changes: 1 addition & 1 deletion actix-session/src/storage/redis_rs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ use crate::storage::{
/// ```
///
/// # TLS support
/// Add the `redis-rs-tls-session` feature flag to enable TLS support. You can then establish a TLS
/// Add the `redis-rs-tls-session` or `redis-rs-tls-session-rustls` feature flag to enable TLS support. You can then establish a TLS
/// connection to Redis using the `rediss://` URL scheme:
///
/// ```no_run
Expand Down
Loading