-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
PrivateCookieJar
for managing private cookies
#900
Conversation
@@ -15,6 +15,9 @@ use http::{ | |||
}; | |||
use std::{convert::Infallible, fmt, marker::PhantomData}; | |||
|
|||
mod private; | |||
|
|||
pub use self::private::PrivateCookieJar; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Gonna move the plaintext and signed versions to their own mods in a follow up PR
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since the underlying cookie library seems to have some support for this using CookieJar::private_jar
and such, should we maybe have the ability to manage some plain, some signed / private cookies using a single jar?
@@ -32,7 +32,7 @@ axum-macros = { path = "../axum-macros", version = "0.2", optional = true } | |||
serde = { version = "1.0", optional = true } | |||
serde_json = { version = "1.0.71", optional = true } | |||
percent-encoding = { version = "2.1", optional = true } | |||
cookie-lib = { package = "cookie", version = "0.16", features = ["percent-encode", "signed"], optional = true } | |||
cookie-lib = { package = "cookie", version = "0.16", features = ["percent-encode", "signed", "private"], optional = true } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe pass through the features instead? I.e. have a signed-cookies
feature that activates SignedCookieJar
and cookie-lib/signed
, equivalent for private
/ PrivateCookieJar
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I played around with some time ago but couldn't find a decent way of passing in the Key
. You can get it manually via an extension and pass it in when passing .private_jar(key)
but didn't like that too much 🤷
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
and yeah did think about adding separate features for enabling signed or private jars since it pulls in a few deps but thats a breaking change and we just shipped a new major yesterday :P
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The -extra
crate is separate for a reason, no? People sign up for frequent breaking changes when using it ^^
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yeah thats true :P
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Raised all questions I could think off, I'll you decide how to proceed with crate features and stuff like that.
Oh, I didn't realize auto-merge was enabled. Well, any changes can still be done in separate PRs 🙂 |
Fixes #896
Its pretty much identical to
SignedCookieJar
but private.