-
Notifications
You must be signed in to change notification settings - Fork 6
feat(server): websocket #1888
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
feat(server): websocket #1888
Conversation
You can access the deployment of this PR at https://renku-ci-ui-1888.dev.renku.ch |
// ! Should we Upgrade here? | ||
// ! Verify the Origin since same-origin policy doesn't work for WS |
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.
This is a nice-to-have for extra security, but probably not that urgent
|
||
function configureWebsocket(server: ws.Server, authenticator: Authenticator, storage: Storage): void { | ||
server.on("connection", async (socket, request) => { | ||
// ! Should we Upgrade here? |
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 answer seems to be "yes". Otherwise, I get inconsistent results when authenticating using the cookies.
REFERENCE: https://github.com/websockets/ws#client-authentication
const sessionId = request.headers["ui-server-session"] ? | ||
request.headers["ui-server-session"] as string : | ||
""; |
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.
This logic is wrong for the real-world application. We should actually get the "ui-server-session"
section from the Cookies -- there is no "ui-server-session"
header
Superseded by #2004 |
Still a draft⚠️
For the documentation, check the README file in the
/server/src/websocket
folder.Websocket channel available at
wss://<URL>/ui-server/ws
/deploy #persist
re #1338