[pbs-devel] [PATCH proxmox-backup] api: metrics: check permissions before reading any data from the cache

Thomas Lamprecht t.lamprecht at proxmox.com
Wed Oct 16 09:26:31 CEST 2024


Am 15/10/2024 um 15:50 schrieb Lukas Wagner:
> Reading from the metric cache is somewhat expensive, so validate as many
> of the required permissions as possible. For host metrics, we can
> do the full check in advance. For datastores, we check if we have
> audit permissions for *any* datastore. If we do not have privs for
> either of those, we return early and avoid reading from the
> cache altogether.
> 
> Signed-off-by: Lukas Wagner <l.wagner at proxmox.com>
> Suggested-by: Wolfgang Bumiller <w.bumiller at proxmox.com>

tiny nit: these should be normally switched, to keep the causal order intact.
I.e., the suggestion normally happens before you make the change that you
sign-off, that's also why r-b/t-b trailers should get added below ones s-o-b.




More information about the pbs-devel mailing list