Skip to content

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

Closed
wants to merge 2 commits into from
Closed

Conversation

lorenzo-cavazzi
Copy link
Member

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

@lorenzo-cavazzi lorenzo-cavazzi deployed to renku-ci-ui-1888 June 7, 2022 16:39 Active
@RenkuBot
Copy link
Contributor

RenkuBot commented Jun 7, 2022

You can access the deployment of this PR at https://renku-ci-ui-1888.dev.renku.ch

Comment on lines +157 to +158
// ! Should we Upgrade here?
// ! Verify the Origin since same-origin policy doesn't work for WS
Copy link
Member Author

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?
Copy link
Member Author

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

Comment on lines +161 to +163
const sessionId = request.headers["ui-server-session"] ?
request.headers["ui-server-session"] as string :
"";
Copy link
Member Author

@lorenzo-cavazzi lorenzo-cavazzi Jun 14, 2022

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

@lorenzo-cavazzi
Copy link
Member Author

Superseded by #2004

@lorenzo-cavazzi lorenzo-cavazzi deleted the 1338server-websockets branch August 19, 2022 16:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants