-
Notifications
You must be signed in to change notification settings - Fork 351
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
filters/auth: add grant cookie encoder #2953
Conversation
@@ -12,6 +12,33 @@ import ( | |||
"golang.org/x/oauth2" | |||
) | |||
|
|||
type CookieEncoder interface { |
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.
Naming?
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.
Do we want cookie encoder or a generic token encoder that works with http.Response and may encode/extract token into/from cookie or e.g. headers?
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 existing Oauth2 approach here is designed to work with a cookie. Cookie-specific is fine for us unless you think it can be used somewhere else
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.
@AtorVdm I've updated CookieEncoder interface, please check if its suitable for the implementation you have in mind.
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.
Had a discussion with @AlexanderYastrebov. This works for us! If this is left as-is - we will implement our own compression on top. Another option is if you can split the cookie into multiple ones based on cookie max size param (can be defined). Either way this PR would be a prerequisite for this so I think it's good to get it merged.
8e67ae3
to
5f8ce1a
Compare
e42a740
to
72b043f
Compare
72b043f
to
af10778
Compare
88d4663
to
2a860d2
Compare
Add CookerEncoder interface to allow custom implementation of grant cookie encoding. For example custom implementation may store token value in some permanent key-value storage and encode key into the cookie. Another implementation may encode token value into multiple cookies. Signed-off-by: Alexander Yastrebov <alexander.yastrebov@zalando.de>
Export EncryptedCookieEncoder and decouple it from OAuthConfig. Signed-off-by: Alexander Yastrebov <alexander.yastrebov@zalando.de>
2a860d2
to
54a3e3d
Compare
👍 |
👍 |
Add CookerEncoder interface to allow custom implementation of grant cookie encoding.
For example custom implementation may store token value in some permanent key-value storage and encode key into the cookie.
Another implementation may encode token value into multiple cookies.