crossbario / crossbar

Crossbar.io - WAMP application router
https://crossbar.io/
Other
2.05k stars 274 forks source link

Meta API: forward transport info from proxy to router #2000

Closed oberstet closed 2 years ago

oberstet commented 2 years ago

When a client connects to a proxy frontend worker, the client will be authenticated at the frontend proxy, after which a backend connection to a backend router worker is established. That latter backend connection is using its own authentication ("xyz-proxy").

The backend router worker will currently only remember the session and transport information associated with the proxy->router backend connection, not session and transport details of the original incoming frontend connection.

But we need (also) the latter for the WAMP meta API!

Here is an example of above, with the location marked where we need to forward the frontend session and transport information when establishing the backend connection:

Bildschirmfoto von 2022-04-24 10-44-21

oberstet commented 2 years ago

Once a proxy frontend session from a connecting client is established, some details of the already accepted frontend session and transport are stored

https://github.com/crossbario/crossbar/blob/8521972e03e20b56193046343a9f5209ac81ac5c/crossbar/worker/proxy.py#L198

and later picked up again

https://github.com/crossbario/crossbar/blob/8521972e03e20b56193046343a9f5209ac81ac5c/crossbar/worker/proxy.py#L564

however, we should forward that info and the transport details of the frontend session in authextra when joining the respective realm on the backend connection to a router worker

https://github.com/crossbario/crossbar/blob/8521972e03e20b56193046343a9f5209ac81ac5c/crossbar/worker/proxy.py#L327


once we have that, we can use the frontend session and transport details then known to the router worker

https://github.com/crossbario/crossbar/blob/8521972e03e20b56193046343a9f5209ac81ac5c/crossbar/router/router.py#L75

holding the service session for the realm in the WAMP meta API

https://github.com/crossbario/crossbar/blob/8521972e03e20b56193046343a9f5209ac81ac5c/crossbar/router/service.py#L230

oberstet commented 2 years ago

this is now fixed, that is, the connecting transport details are forwarded - but not yet picked up at the router end https://github.com/crossbario/crossbar/issues/2006