Files
cozystack/pkg
Aleksei Sviridkin 60b6cf3fdc refactor(api): return typed apierrors from TenantNamespace registry helpers
The access-check helpers returned plain fmt.Errorf values, which the
apiserver coerces to 500 InternalError regardless of the actual failure.
A request without user identity now surfaces as 401 Unauthorized, and a
RoleBinding list failure as 500 InternalError with a typed Status body.

Get also repackages a NotFound from the backing Namespace lookup so the
Status body reports the tenantnamespaces resource instead of namespaces.

The Watch goroutine already logs access-check failures and skips the
event, so no untyped error escapes to the client from that path.

Assisted-By: Claude <noreply@anthropic.com>
Signed-off-by: Aleksei Sviridkin <f@lex.la>
2026-06-24 15:39:00 +03:00
..