BurntNail / vent

Website for managing House Events
https://blog.maguire.tech/posts/projects/vent/
MIT License
4 stars 1 forks source link

fix(deps): update rust crate tower-sessions to 0.10 - autoclosed #213

Closed renovate[bot] closed 8 months ago

renovate[bot] commented 10 months ago

Mend Renovate

This PR contains the following updates:

Package Type Update Change
tower-sessions dependencies minor 0.8 -> 0.10

Release Notes

maxcountryman/tower-sessions (tower-sessions) ### [`v0.10.0`](https://togithub.com/maxcountryman/tower-sessions/blob/HEAD/CHANGELOG.md#0100) [Compare Source](https://togithub.com/maxcountryman/tower-sessions/compare/v0.9.1...v0.10.0) **Breaking Changes** - Improve session ID [#​141](https://togithub.com/maxcountryman/tower-sessions/issues/141) - Relocate previously bundled stores [#​145](https://togithub.com/maxcountryman/tower-sessions/issues/145) - Move service out of core [#​146](https://togithub.com/maxcountryman/tower-sessions/issues/146) Session IDs now boast 66 bits of entropy and are shorter, saving network bandwidth and improving the secure nature of sessions. We no longer bundle session stores via feature flags and as such applications must be updated to require the stores directly. For example, applications that use the `tower-sessions-sqlx-store` should update their `Cargo.toml` like so: ```toml tower-sessions = "0.10.0" tower-sessions-sqlx-store = { version = "0.10.0", features = ["sqlite"] } ``` Assuming a SQLite store, as an example. Furthermore, imports will also need to be updated accordingly. For example: ```rust use std::net::SocketAddr; use axum::{response::IntoResponse, routing::get, Router}; use serde::{Deserialize, Serialize}; use time::Duration; use tower_sessions::{session_store::ExpiredDeletion, Expiry, Session, SessionManagerLayer}; use tower_sessions_sqlx_store::{sqlx::SqlitePool, SqliteStore}; const COUNTER_KEY: &str = "counter"; #[derive(Serialize, Deserialize, Default)] struct Counter(usize); #[tokio::main] async fn main() -> Result<(), Box> { let pool = SqlitePool::connect("sqlite::memory:").await?; let session_store = SqliteStore::new(pool); session_store.migrate().await?; let deletion_task = tokio::task::spawn( session_store .clone() .continuously_delete_expired(tokio::time::Duration::from_secs(60)), ); let session_layer = SessionManagerLayer::new(session_store) .with_secure(false) .with_expiry(Expiry::OnInactivity(Duration::seconds(10))); let app = Router::new().route("/", get(handler)).layer(session_layer); let addr = SocketAddr::from(([127, 0, 0, 1], 3000)); let listener = tokio::net::TcpListener::bind(&addr).await?; axum::serve(listener, app.into_make_service()).await?; deletion_task.await??; Ok(()) } async fn handler(session: Session) -> impl IntoResponse { let counter: Counter = session.get(COUNTER_KEY).await.unwrap().unwrap_or_default(); session.insert(COUNTER_KEY, counter.0 + 1).await.unwrap(); format!("Current count: {}", counter.0) } ``` Finally, the service itself has been moved out of the core crate, which makes this crate smaller as well as establishes better boundaries between code. Thank you for bearing with us: we are approaching longer term stability and aim to minimize churn going forward as we begin to move toward a 1.0 release. ### [`v0.9.1`](https://togithub.com/maxcountryman/tower-sessions/blob/HEAD/CHANGELOG.md#091) [Compare Source](https://togithub.com/maxcountryman/tower-sessions/compare/v0.9.0...v0.9.1) - Ensure `clear` works before record loading. [#​134](https://togithub.com/maxcountryman/tower-sessions/issues/134) ### [`v0.9.0`](https://togithub.com/maxcountryman/tower-sessions/blob/HEAD/CHANGELOG.md#090) [Compare Source](https://togithub.com/maxcountryman/tower-sessions/compare/v0.8.2...v0.9.0) **Breakiung Changes** - Make service infallible. [#​132](https://togithub.com/maxcountryman/tower-sessions/issues/132) This updates the service such that it always returns a response directly. In practice this means that e.g. `axum` applications no longer need the `HandleErrorLayer` and instead can use the layer directly. Note that if you use other fallible `tower` middleware, you will still need to use `HandleErrorLayer`. As such we've also remove the `MissingCookies` and `MissingId` variants from the session error enum. ### [`v0.8.2`](https://togithub.com/maxcountryman/tower-sessions/blob/HEAD/CHANGELOG.md#082) [Compare Source](https://togithub.com/maxcountryman/tower-sessions/compare/v0.8.1...v0.8.2) - Derive `PartialEq` for `Record`. [#​125](https://togithub.com/maxcountryman/tower-sessions/issues/125) ### [`v0.8.1`](https://togithub.com/maxcountryman/tower-sessions/blob/HEAD/CHANGELOG.md#081) [Compare Source](https://togithub.com/maxcountryman/tower-sessions/compare/v0.8.0...v0.8.1) - Allow constructing `RedisStore` from `RedisPool`. [#​122](https://togithub.com/maxcountryman/tower-sessions/issues/122)

Configuration

📅 Schedule: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).

🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.

Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

🔕 Ignore: Close this PR and you won't be reminded about this update again.



This PR has been generated by Mend Renovate. View repository job log here.

renovate[bot] commented 10 months ago

⚠ Artifact update problem

Renovate failed to update an artifact related to this branch. You probably do not want to merge this PR as-is.

♻ Renovate will retry this branch, including artifacts, only when one of the following happens:

The artifact failure details are included below:

File name: Cargo.lock
Command failed: cargo update --config net.git-fetch-with-cli=true --manifest-path Cargo.toml --package tower-sessions@0.8.0 --precise 0.10.0
    Updating crates.io index
error: failed to select a version for the requirement `tower-sessions = "^0.8.0"`
candidate versions found which didn't match: 0.10.0
location searched: crates.io index
required by package `axum-login v0.11.0`
    ... which satisfies dependency `axum-login = "^0.11"` (locked to 0.11.0) of package `vent v0.1.0 (/tmp/renovate/repos/github/BurntNail/vent)`
perhaps a crate was updated and forgotten to be re-vendored?