mirror of
https://github.com/cozystack/cozystack.git
synced 2026-10-30 00:27:04 +09:00
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>