docs(axum-extra): clarify cookie-key-expansion for Key::derive_from (fixes #2646) (#3769)

Co-authored-by: Cursor <[email protected]>
This commit is contained in:
吴杨帆
2026-05-17 10:41:49 +02:00
committed by GitHub
co-authored by Cursor
parent 6ed9210351
commit 16313be447
+11
View File
@@ -1,6 +1,12 @@
//! Cookie parsing and cookie jar management.
//!
//! See [`CookieJar`], [`SignedCookieJar`], and [`PrivateCookieJar`] for more details.
//!
//! ## `Key::derive_from`
//!
//! The [`Key::derive_from`] method is provided by the underlying [`cookie`] crate, whose docs
//! refer to the `key-expansion` feature. In `axum-extra`, enable **`cookie-key-expansion`**
//! instead (see the [crate-level feature list](crate#feature-flags)).
use axum_core::{
extract::FromRequestParts,
@@ -25,7 +31,12 @@ pub use self::signed::SignedCookieJar;
pub use cookie::{Cookie, Expiration, SameSite};
/// Cookie signing and encryption key.
///
/// When using [`Key::derive_from`], enable the **`cookie-key-expansion`** feature on
/// `axum-extra` (not `key-expansion` from the [`cookie`] crate).
#[cfg(any(feature = "cookie-signed", feature = "cookie-private"))]
#[doc(inline)]
pub use cookie::Key;
/// Extractor that grabs cookies from the request and manages the jar.