|
18 | 18 | */
|
19 | 19 |
|
20 | 20 | /*
|
21 |
| - * Copyright (c) 2016, 2021, Oracle and/or its affiliates. All rights reserved. |
| 21 | + * Copyright (c) 2016, 2022, Oracle and/or its affiliates. All rights reserved. |
22 | 22 | */
|
23 | 23 | package opengrok.auth.plugin;
|
24 | 24 |
|
@@ -57,9 +57,11 @@ public class LdapUserPlugin extends AbstractLdapPlugin {
|
57 | 57 | * List of configuration names.
|
58 | 58 | * <ul>
|
59 | 59 | * <li><code>filter</code> is LDAP filter used for searching (optional)</li>
|
60 |
| - * <li><code>useDN</code> boolean value indicating if User.username should be treated as Distinguished Name (optional, default is false)</li> |
| 60 | + * <li><code>useDN</code> boolean value indicating if User.username should be treated as Distinguished Name |
| 61 | + * (optional, default is false)</li> |
61 | 62 | * <li><code>attributes</code> is comma separated list of LDAP attributes to be produced (mandatory)</li>
|
62 |
| - * <li><code>instance</code> integer that can be used to identify instance of this plugin by other LDAP plugins (optional, default empty)</li> |
| 63 | + * <li><code>instance</code> integer that can be used to identify instance of this plugin by other LDAP plugins |
| 64 | + * (optional, default empty)</li> |
63 | 65 | * </ul>
|
64 | 66 | */
|
65 | 67 | static final String LDAP_FILTER = "filter";
|
@@ -89,8 +91,7 @@ public void load(Map<String, Object> parameters) {
|
89 | 91 | private void init(Map<String, Object> parameters) {
|
90 | 92 | String attributesVal;
|
91 | 93 | if ((attributesVal = (String) parameters.get(ATTRIBUTES)) == null) {
|
92 |
| - throw new NullPointerException("Missing configuration parameter [" + ATTRIBUTES + |
93 |
| - "] in the setup"); |
| 94 | + throw new NullPointerException("Missing configuration parameter [" + ATTRIBUTES + "] in the setup"); |
94 | 95 | }
|
95 | 96 | attrSet = new HashSet<>(Arrays.asList(attributesVal.split(",")));
|
96 | 97 |
|
@@ -119,8 +120,7 @@ private void init(Map<String, Object> parameters) {
|
119 | 120 | */
|
120 | 121 | @Override
|
121 | 122 | protected boolean sessionExists(HttpServletRequest req) {
|
122 |
| - return super.sessionExists(req) |
123 |
| - && req.getSession().getAttribute(getSessionAttrName()) != null; |
| 123 | + return super.sessionExists(req) && req.getSession().getAttribute(getSessionAttrName()) != null; |
124 | 124 | }
|
125 | 125 |
|
126 | 126 | /**
|
@@ -157,8 +157,7 @@ public void fillSession(HttpServletRequest req, User user) {
|
157 | 157 | String dn = null;
|
158 | 158 | if (Boolean.TRUE.equals(useDN)) {
|
159 | 159 | dn = user.getUsername();
|
160 |
| - LOGGER.log(Level.FINEST, "using DN ''{0}'' for user {1}", |
161 |
| - new Object[]{dn, user}); |
| 160 | + LOGGER.log(Level.FINEST, "using DN ''{0}'' for user {1}", new Object[]{dn, user}); |
162 | 161 | }
|
163 | 162 |
|
164 | 163 | String expandedFilter = null;
|
|
0 commit comments