posit-dev / posit-dev/kallichore

Validate bearer token when creating websocket connection

Open
#4 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Rust
Stars
2
Forks
2
PR merge metrics
No merged PRs in 30d

Description

Currently, Kallichore does bearer token validation on all the RPC endpoints that change state. For security reasons, we should also validate the bearer token when establishing a websocket connection; this is just a little more fiddly for the websocket endpoint since the Swagger crate doesn't extract the auth data from the request for us.

The token validation should go here:

https://github.com/posit-dev/kallichore/blob/e83476294cdd34bd2dc87117bbc1d6ed9cf6231a/crates/kcserver/src/server.rs#L694-L705

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start at the websocket endpoint in crates/kcserver/src/server.rs around lines 694-705, then compare how bearer tokens are validated on the state-changing RPC endpoints. Trace how the Swagger websocket request exposes authentication data, and confirm that establishing a websocket connection validates the bearer token before the connection proceeds.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
api, authentication
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
58/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.