-
Notifications
You must be signed in to change notification settings - Fork 55
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
Store user session in browser #219
Conversation
5a5adf8
to
5a9eac5
Compare
cf19227
to
230d5b4
Compare
} else { | ||
fmt.Println("Using cookie session store") | ||
} | ||
|
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.
👌
metaT := "<meta name=\"%s\" content=\"%s\" />" | ||
assert.Contains(t, string(html), fmt.Sprintf(metaT, "return-url", "http://localhost:8080/namespaces/default")) | ||
assert.Contains(t, string(html), fmt.Sprintf(metaT, "public-path", "/custom-path")) | ||
} |
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.
Yay Tests!
server/auth/auth_test.html
Outdated
<meta name="return-url" content="{{.ReturnUrl}}" /> | ||
<meta name="public-path" content="{{.PublicPath}}" /> | ||
</head> | ||
</html> |
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.
Just thinking out loud headers may be a good way to send this data back in the callback instead of the meta of the html document.
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 want to revisit this particular piece (sending access-token to client) because when returning an html we are limitied to only the current domain and can't serve as a true API only server when it comes to auth endpoint
So instead of sending html at all, get back setting cookie items with users data, except for also breaking down the user object into 4kb cookie items to not exceed the size limit
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.
done ^
b5fc1da
to
fc2069f
Compare
What was changed
Moved user session to be stored client side
Why?
resolve #216
Allows to scale UI horizontally by making ui-server stateless
Checklist
Closes
How was this tested:
E2E: Verified that a user can login
Manual: Verified login and logout flows. Verified that API requests contain
authorization
andauthorization-extras
headers. Verified that codec requests containauthorization
header