You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[Server] Mask internal errors consistently during list authorization #2177
ResultFilter.filter() masks unexpected exceptions, but rethrows 5xx BaseExceptions with their original messages. Each source must therefore sanitize its own error messages. The registered-model parent lookup already does this and has regression coverage.
Make a list-item authorizer throw BaseException(INTERNAL, "test-only backend detail").
Run the item through ResultFilter.filter().
The outer catch rethrows that message unchanged.
Expected behavior
Handle internal error masking in the outer list-filter catch, so every list path has the same protection. Preserve error codes and original causes, and keep actionable OPA UNAVAILABLE messages. Permission denials and existing 4xx filtering should keep their current behavior.
Add focused regression coverage for direct and SpEL-wrapped failures. Once the outer catch handles masking, remove the redundant registered-model lookup wrapper.
System
Server at dc45fb6c; applies to both Casbin and OPA.
I have a fix implemented and tested locally, and want to confirm two behavior details before opening the PR:
Masking scope: ResultFilter.filter() masks every non-UNAVAILABLE server-side BaseException (INTERNAL, DATA_LOSS, UNIMPLEMENTED, COMMIT_STATE_UNKNOWN) with "Failed to authorize list items" while keeping the original ErrorCode and cause. The removed REGISTERED_MODEL parent-lookup wrapper previously masked those codes too, so masking only INTERNAL would newly expose them.
UNAVAILABLE passthrough: removing the REGISTERED_MODEL wrapper lets ErrorCode.UNAVAILABLE pass through on the list path. In current code KeyMapper catalog/schema lookups wrap database errors as INTERNAL, so only OpaAuthorizer and JCasbinAuthorizer throw UNAVAILABLE on list authorization.
Does this match what you want, or would you prefer narrowing masking to ErrorCode.INTERNAL only?
Activity
[Server] Configure OPA authorization in the server (#2078)
greglum commentedon Nov 27, 2026
take
greglum commentedon Nov 27, 2026
I have a fix implemented and tested locally, and want to confirm two behavior details before opening the PR:
ResultFilter.filter()masks every non-UNAVAILABLEserver-sideBaseException(INTERNAL,DATA_LOSS,UNIMPLEMENTED,COMMIT_STATE_UNKNOWN) with"Failed to authorize list items"while keeping the originalErrorCodeand cause. The removedREGISTERED_MODELparent-lookup wrapper previously masked those codes too, so masking onlyINTERNALwould newly expose them.UNAVAILABLEpassthrough: removing theREGISTERED_MODELwrapper letsErrorCode.UNAVAILABLEpass through on the list path. In current codeKeyMappercatalog/schema lookups wrap database errors asINTERNAL, so onlyOpaAuthorizerandJCasbinAuthorizerthrowUNAVAILABLEon list authorization.Does this match what you want, or would you prefer narrowing masking to
ErrorCode.INTERNALonly?