session-guard 0.3.0

Stolen session cookies become useless: rotating tokens with reuse detection and risk-based step-up for Rust web apps.
Documentation
# THIS FILE IS AUTOMATICALLY GENERATED BY CARGO
#
# When uploading crates to the registry Cargo will automatically
# "normalize" Cargo.toml files for maximal compatibility
# with all versions of Cargo and also rewrite `path` dependencies
# to registry (e.g., crates.io) dependencies.
#
# If you are reading this file be aware that the original Cargo.toml
# will likely look very different (and much more reasonable).
# See Cargo.toml.orig for the original contents.

[package]
edition = "2024"
rust-version = "1.94"
name = "session-guard"
version = "0.3.0"
build = "build.rs"
include = [
    "build.rs",
    "src/**/*",
    "migrations/**/*",
    "README.md",
    "CHANGELOG.md",
    "LICENSE-MIT",
    "LICENSE-APACHE",
]
autolib = false
autobins = false
autoexamples = false
autotests = false
autobenches = false
description = "Stolen session cookies become useless: rotating tokens with reuse detection and risk-based step-up for Rust web apps."
documentation = "https://docs.rs/session-guard"
readme = "README.md"
keywords = [
    "session",
    "authentication",
    "security",
    "axum",
    "cookie",
]
categories = [
    "authentication",
    "web-programming",
    "web-programming::http-server",
]
license = "MIT OR Apache-2.0"
repository = "https://github.com/A-Line-Services/session-guard"

[package.metadata.docs.rs]
all-features = true
rustdoc-args = [
    "--cfg",
    "docsrs",
]

[features]
aide = [
    "axum",
    "dep:aide",
]
axum = [
    "tokio",
    "dep:axum",
    "dep:http",
    "dep:tower-layer",
    "dep:tower-service",
]
default = []
maxmind = [
    "dep:maxminddb",
    "dep:arc-swap",
]
metrics = ["dep:metrics"]
postgres = ["dep:sqlx"]
testing = []
tokio = ["dep:tokio"]
valkey = ["dep:redis"]

[lib]
name = "session_guard"
path = "src/lib.rs"

[dependencies.aide]
version = "0.15.1"
optional = true
default-features = false

[dependencies.arc-swap]
version = "1.9.2"
optional = true

[dependencies.axum]
version = "0.8.9"
features = [
    "json",
    "tokio",
]
optional = true
default-features = false

[dependencies.base64]
version = "0.23.1"

[dependencies.chrono]
version = "0.4.45"
features = [
    "std",
    "clock",
    "serde",
]
default-features = false

[dependencies.getrandom]
version = "0.4.3"

[dependencies.http]
version = "1.5.0"
optional = true

[dependencies.ipnet]
version = "2.12.2"
features = ["serde"]

[dependencies.maxminddb]
version = "0.32.0"
optional = true

[dependencies.metrics]
version = "0.24.6"
optional = true

[dependencies.quick_cache]
version = "0.7.0"

[dependencies.redis]
version = "1.7.1"
features = [
    "tokio-comp",
    "connection-manager",
    "cluster-async",
    "script",
]
optional = true
default-features = false

[dependencies.secrecy]
version = "0.10.3"

[dependencies.serde]
version = "1.0.229"
features = ["derive"]

[dependencies.serde_json]
version = "1.0.154"

[dependencies.sha2]
version = "0.11.1"

[dependencies.sqlx]
version = "0.9.0"
features = [
    "postgres",
    "runtime-tokio",
    "chrono",
    "uuid",
    "migrate",
    "macros",
    "ipnet",
    "json",
]
optional = true
default-features = false

[dependencies.subtle]
version = "2.6.1"

[dependencies.thiserror]
version = "2.0.21"

[dependencies.tokio]
version = "1.53.3"
features = [
    "rt",
    "time",
]
optional = true
default-features = false

[dependencies.tower-layer]
version = "0.3.3"
optional = true

[dependencies.tower-service]
version = "0.3.3"
optional = true

[dependencies.tracing]
version = "0.1.44"

[dependencies.uuid]
version = "1.28.0"
features = [
    "v4",
    "serde",
]

[dependencies.woothee]
version = "0.13.0"

[dependencies.zeroize]
version = "1.9.1"

[dev-dependencies.aide]
version = "0.15.1"
features = [
    "axum",
    "axum-json",
]

[dev-dependencies.axum]
version = "0.8.9"
features = ["macros"]

[dev-dependencies.criterion]
version = "0.8.2"
features = ["async_tokio"]

[dev-dependencies.http-body-util]
version = "0.1.5"

[dev-dependencies.proptest]
version = "1.12.0"

[dev-dependencies.reqwest]
version = "0.13.5"
features = [
    "json",
    "cookies",
]
default-features = false

[dev-dependencies.rovo]
version = "0.4.14"
features = ["swagger"]

[dev-dependencies.testcontainers]
version = "0.28.0"
features = ["reusable-containers"]

[dev-dependencies.tokio]
version = "1.53.3"
features = [
    "full",
    "test-util",
]

[dev-dependencies.tower]
version = "0.5.3"
features = ["util"]

[lints.clippy]
module_name_repetitions = "allow"
must_use_candidate = "allow"

[lints.clippy.pedantic]
level = "warn"
priority = -1

[lints.rust]
missing_docs = "warn"
unsafe_code = "forbid"