Arksine / moonraker

Web API Server for Klipper
https://moonraker.readthedocs.io
GNU General Public License v3.0
1.05k stars 406 forks source link

spoolman: add support for aditional headers #870

Open LobodPl opened 3 months ago

LobodPl commented 3 months ago

Adds additional_headers parameter, to define extra headers passed with all spoolman requests.

Use case: Spoolman has no auth and api is all public. You use your printers in different locations, so you put Spoolman behind ZeroTrust (CloudFlare for example) to use only 1 instance. You will need to pass extradata along with all spoolman requests to get through ZeroTrust Gateway.

Arksine commented 3 months ago

Thanks. I'm a bit weary of adding this functionality directly to Moonraker. It seems like it would be possible to proxy requests to Spoolman and add any additional necessary headers there, which would be the preferable way of handling unique setups that don't apply to the majority of users.

LobodPl commented 3 months ago

Thanks. I'm a bit weary of adding this functionality directly to Moonraker. It seems like it would be possible to proxy requests to Spoolman and add any additional necessary headers there, which would be the preferable way of handling unique setups that don't apply to the majority of users.

Hello, good point of view. For me my change is as rare as use of the spoolman itself, but right now I'm also sceptic if it should be a part of moonraker itself.