[
https://issues.apache.org/jira/browse/KNOX-3431?focusedWorklogId=1039234&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-1039234
]
ASF GitHub Bot logged work on KNOX-3431:
----------------------------------------
Author: ASF GitHub Bot
Created on: 02/Sep/26 15:22
Start Date: 02/Sep/26 15:22
Worklog Time Spent: 10m
Work Description: handavid commented on code in PR #1372:
URL: https://github.com/apache/knox/pull/1372#discussion_r3915708864
##########
gateway-server/src/main/java/org/apache/knox/gateway/services/ldap/interceptor/UserSearchInterceptor.java:
##########
@@ -71,6 +75,7 @@ public Entry lookup(LookupOperationContext ctx) throws
LdapException {
entry = backend.getUser(username, schemaManager);
} catch (Exception e) {
LOG.ldapLookupFailed(ctx.getDn().toString(),e);
+ throw new LdapOperationException(ResultCodeEnum.OTHER,
"Lookup request to backend " + getName() + " failed.", e);
Review Comment:
I picked OTHER because I didn't want to pass the backend code directly. I
think that would be confusing. e.g., if the backend credentials were changed
then passing the backend code would show "invalid credentials" to the caller.
However, this is misleading since it's not something that the caller has
control over since it's part of the proxy configuration. Similarly, it will be
confusing to show the caller "unable to connect" if there's a network problem
between the proxy and the remote backend.
Issue Time Tracking
-------------------
Worklog Id: (was: 1039234)
Time Spent: 50m (was: 40m)
> LDAP Proxy search should throw exception when any backend fails
> ---------------------------------------------------------------
>
> Key: KNOX-3431
> URL: https://issues.apache.org/jira/browse/KNOX-3431
> Project: Apache Knox
> Issue Type: Improvement
> Components: Server
> Affects Versions: 3.0.0
> Reporter: David Han
> Assignee: David Han
> Priority: Major
> Fix For: 3.1.0
>
> Time Spent: 50m
> Remaining Estimate: 0h
>
> The UserSearchInterceptor currently logs and swallows exceptions when a
> search request to the backend fails. This has the unfortunate effect of
> making it very difficult to tell if there were configuration or network
> errors connecting to the remote backend. Since the exceptions is swallowed, a
> connection error will look like users have been deleted. It would be better
> to raise the exception so it's obvious that there is a problem communicating
> with the remote backend.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)