-
Notifications
You must be signed in to change notification settings - Fork 63
Conversation
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.
Looks great! thank you for doing that! a couple of nits
if !c.coverSubDomains { | ||
return "" | ||
} | ||
return fmt.Sprintf(".%s", request.URL.Hostname()) |
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.
nice! I guess this works because this is an HTTP request not a GRPC request...
Have you tried it behind an ingress? mind doing that?
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.
Tested this both with grpc endpoints through flytectl and through flyteconsole and no issues were discovered
auth/config/config.go
Outdated
} | ||
|
||
type CookieSettings struct { | ||
SameSite http.SameSite `json:"sameSite" pflag:",OPTIONAL: Allows you to declare if your cookie should be restricted to a first-party or same-site context."` |
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.
Does this parse well from a yaml config?
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.
It does if we pass int values. But added an enum wrapper for good UX.
Signed-off-by: Prafulla Mahindrakar <[email protected]>
Signed-off-by: Prafulla Mahindrakar <[email protected]>
Signed-off-by: Prafulla Mahindrakar <[email protected]>
Signed-off-by: Prafulla Mahindrakar <[email protected]>
e9723d4
to
58be79a
Compare
Codecov Report
@@ Coverage Diff @@
## master #440 +/- ##
==========================================
+ Coverage 61.35% 61.39% +0.04%
==========================================
Files 156 158 +2
Lines 11111 11181 +70
==========================================
+ Hits 6817 6865 +48
- Misses 3589 3607 +18
- Partials 705 709 +4
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report at Codecov.
|
Signed-off-by: Prafulla Mahindrakar <[email protected]>
Signed-off-by: Prafulla Mahindrakar <[email protected]>
* Adding domain to secure auth cookies Signed-off-by: Prafulla Mahindrakar <[email protected]> * Adding . suffix to the domain Signed-off-by: Prafulla Mahindrakar <[email protected]> * Add getCookiedomain Signed-off-by: Prafulla Mahindrakar <[email protected]> * Added enumers for domainMatch and sameSite and testing done Signed-off-by: Prafulla Mahindrakar <[email protected]> * Added debug make targets for admin and scheduler Signed-off-by: Prafulla Mahindrakar <[email protected]> * Added more coverage Signed-off-by: Prafulla Mahindrakar <[email protected]>
TL;DR
Allow user of flyteadmin to specify the cookie settings of there flyteadmin user auth cookies
Allowing subdomain access by setting the domain field in the cookie
and allowing to set SameSite preference to allow firstparty or thirdparty cookies to be sent from the browser.
Mode changes are applicable for only the following cookies
One thing i noticed is that dot prefix gets subsituted by the browser seems like .
source : http://bayou.io/draft/cookie.domain.html
So i didn't find any behavior change with domain setting policy for localhost or hosted.cloud-staging.union.ai
Testing done :
With LAX mode for auth cookies
With Strict mode for auth cookies
Type
Are all requirements met?
Complete description
How did you fix the bug, make the feature etc. Link to any design docs etc
Tracking Issue
Remove the 'fixes' keyword if there will be multiple PRs to fix the linked issue
fixes flyteorg/flyte#2596
Follow-up issue
NA