Skip to content

fix: map ErrInsufficientPermissions to 403 in access-control - #126

Merged
m-t-a97 merged 1 commit into
mainfrom
fix/access-control-insufficient-permissions-403
Oct 11, 2026
Merged

m-t-a97 merged 1 commit into
mainfrom
fix/access-control-insufficient-permissions-403

Conversation

@m-t-a97

@m-t-a97 m-t-a97 commented Oct 11, 2026

Copy link
Copy Markdown
Member

The access-control handler duplicated the core error->status mapping and omitted ErrInsufficientPermissions, so an authorization failure fell through to the default 500 instead of 403.

Centralize the mapping in core/errors.StatusFor and have the access-control and admin handlers delegate to it, removing the duplicated switches that caused the drift.

Add regression tests covering ErrInsufficientPermissions for both plugins and the shared mapping.

Closes #125

The access-control handler duplicated the core error->status mapping and
omitted ErrInsufficientPermissions, so an authorization failure fell
through to the default 500 instead of 403.

Centralize the mapping in core/errors.StatusFor and have the
access-control and admin handlers delegate to it, removing the
duplicated switches that caused the drift.

Add regression tests covering ErrInsufficientPermissions for both
plugins and the shared mapping.
@m-t-a97 m-t-a97 self-assigned this Oct 11, 2026
@m-t-a97
m-t-a97 merged commit 9379375 into main Oct 11, 2026
6 checks passed
@m-t-a97
m-t-a97 deleted the fix/access-control-insufficient-permissions-403 branch October 11, 2026 18:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

BUG access-control handler maps ErrInsufficientPermissions to HTTP 500 instead of 403

1 participant