Allow client first message authentication for websockets

オープン
#4,276 コメント 0 件 リアクション 1 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

まだ誰も着手していません。

評価

難易度
5/5
見積もり時間
1週間以上
初心者へのやさしさ
35/100
issue の種類
機能追加
明瞭さ
説明が足りない
活発さ
活発
技術スタック
java, spring

調査の方向性

まず、Spring Cloud Gateway の WebSocket 処理と、WebSocket メッセージの変更についての issue #1940 の議論を確認します。クライアントからの最初のメッセージで認証情報を受け付けるための API と認証フローを定義し、そのメッセージを downstream に渡さず保持するかどうかも含めます。合意されたスコープと、それに対応する gateway の動作が決まれば完了とします。

索引モデルが issue の本文から書いたものです。

説明

waiting-for-triage

Is your feature request related to a problem? Please describe.
Using the first message of the websocket as the client authentication seems to be an established practice (see for example https://github.com/whatwg/websockets/issues/16#issuecomment-4846373821 ) (alternative to using the http handshake with cookies or query parameter or basic auth or subprotocol for browsers where setting the Authorization header is not possible). It is currently not easily doable with spring cloud gateway.

Describe the solution you'd like
Allow the gateway to implement security when the auth comes in the first client message. Any API that would help with this would be nice. Since there are many imaginable ways to allow this and a lot of details, I can discuss further if this is interesting ?

Describe alternatives you've considered
Other authentication mecanisms

Additional context
I saw https://github.com/spring-cloud/spring-cloud-gateway/issues/1940 where modifying the websocket messages was not supported, ideally for this one the first authenticating message would not be relayed downstream, hopefully this simpler behavior of swalling a single message is ok ?

主要言語
Java
スター
4.9k
フォーク
3.5k
平均マージ
1日 13時間
マージ済み PR(30日)
14

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

spring-cloud/spring-cloud-gateway のほかの issue

spring-cloud/spring-cloud-gateway の issue をすべて見る

似ている issue

Java の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。