[pbs-devel] [PATCH proxmox 1/1] auth-api: include meta information required by extjs in api endpoints

Shannon Sterz s.sterz at proxmox.com
Wed Jul 23 17:18:27 CEST 2025


On Tue Jul 22, 2025 at 10:21 PM CEST, Thomas Lamprecht wrote:
> Am 16.07.25 um 10:17 schrieb Shannon Sterz:
>> On Wed Jul 16, 2025 at 12:40 AM CEST, Thomas Lamprecht wrote:
>>> Am 10.07.25 um 15:50 schrieb Shannon Sterz:
>>>> otherwise extjs will assume the requests failed even though they were
>>>> successful.
>>>
>>> Potentially dumb question, but is this then only returning that for the
>>> extjs formatter or also for the json one?
>>
>> sadly this impacts all formaters as this type of api handler returns a
>> `Response` right away instead of a passing it through a formater like
>> other handler types. the problem with the other handler types is, that
>> they don't let you access the requests header values as easily.
>>
>> the nicest way to resolve this would probably be to pass down the
>> formater in `handle_api_request` [1] to endpoints that return an
>> `ApiResponseFuture`. so that they can handle the formatting themselves
>> (some api endpoints like those that download raw text files etc.
>> probably won't need the formater).
>
> It might be better to expose through the (RPC/REST) environment in the
> mid term, could be useful for other stuff too. Or alternatively expose
> a structured way to pass back a cookie if the methods signals support
> in the schema.
>
> But either way: we can go this route for now, while looking at this more
> closely down the line, when it either causes problems (IMO unlikely) or
> when we need something similar for another reason anyway and can clean
> this up here then too.
>
> Anyway, if you get someone to give this a spin and at least a T-b here,
> ideally a review too, I'd be still open to take this in.

alright, mira and maximiliano both tested the series and found mostly
cosmetic issues. i adopted them into a v2 and kept their T-b lines since
nothing really changed except for an additional `tracing::debug!`
statement. let me know if there is something else i can do.




More information about the pbs-devel mailing list