Allow client first message authentication for websockets

Aperta
#4,276 0 commenti 1 reazione 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
5/5
Tempo stimato
Più di una settimana
Idoneità per principianti
35/100
Tipo di issue
Funzionalità
Chiarezza
Da chiarire
Stato di attività
Attiva
Stack tecnologico
java, spring

Direzione di ricerca

Iniziare esaminando la gestione di WebSocket di Spring Cloud Gateway e la discussione nell’issue #1940 sulla modifica dei messaggi WebSocket. Definire l’API e il flusso di autenticazione per accettare le credenziali nel primo messaggio del client, inclusa la valutazione se tale messaggio debba essere trattenuto e non inoltrato al downstream; il lavoro sarà considerato completato quando saranno concordati l’ambito e il comportamento corrispondente del gateway.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

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 ?

Lingua principale
Java
Stelle
4.9k
Fork
3.5k
Merge medio
1g 13h
PR unite (30g)
14

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di spring-cloud/spring-cloud-gateway

Tutte le issue di spring-cloud/spring-cloud-gateway

Issue simili

Altre issue su Java

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.