Vishwas Rajashekar c18a4a975d fix(authz): metrics: deny authenticated users not in ACL even with anonymous read (#4131)
* fix(authz): metrics: reject users not in list even with anonymous read

Even when anonymous reads are enabled for metrics, users not in the
allowed list should not be allowed.

This change also refactors the MetricsAuthzHandler to align better
with this logic.

Signed-off-by: Vishwas Rajashekar <dev@vrajashkr.com>

* fix(authz): address review comments

Address comments to pass username when present
to AuthzFail if user is not allowed for metrics.
This changes the response to Forbidden instead of
Unauthorized.

Use isAnonymous() check instead of only checking for
empty username.

Signed-off-by: Vishwas Rajashekar <dev@vrajashkr.com>

* fix(authz): fix additional review comments

Fix a few more review comments

Signed-off-by: Vishwas Rajashekar <dev@vrajashkr.com>

---------

Signed-off-by: Vishwas Rajashekar <dev@vrajashkr.com>
2026-06-14 17:29:22 +03:00
2024-01-17 17:22:33 +02:00
2026-05-11 09:29:05 +03:00
2026-06-11 17:22:15 -07:00
2026-06-11 17:22:15 -07:00
2025-05-25 11:57:49 +03:00
2026-06-11 17:22:15 -07:00
2024-03-14 09:43:42 -07:00
2019-06-21 15:29:19 -07:00

zot

build test nightly jobs codecov conformance CodeQL CII Best Practices OpenSSF Scorecard Go Reference FOSSA Status

zot: a production-ready vendor-neutral OCI image registry - images stored in OCI image format, distribution specification on-the-wire, that's it!

Documentation for zot is located at: https://zotregistry.dev

Code of conduct details are here.

License

FOSSA Status

Languages
Go 93%
Shell 6.4%
Makefile 0.4%