Skip to content

Commit 083cbfe

Browse files
author
Vladimir Kotal
committed
fix comments
1 parent d9cfe49 commit 083cbfe

File tree

9 files changed

+41
-22
lines changed

9 files changed

+41
-22
lines changed

plugins/LdapPlugin/src/opengrok/auth/plugin/AbstractLdapPlugin.java

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
* CDDL HEADER END
1818
*/
1919

20-
/*
20+
/*
2121
* Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
2222
*/
2323
package opengrok.auth.plugin;
@@ -38,11 +38,11 @@
3838
import org.opensolaris.opengrok.configuration.RuntimeEnvironment;
3939

4040
/**
41-
* Abstract class for all plugins working with LDAP. Takes care of
41+
* Abstract class for all plug-ins working with LDAP. Takes care of
4242
* <ul>
4343
* <li>controlling the established session</li>
4444
* <li>controlling if the session belongs to the user</li>
45-
* <li>controlling plugin version</li>
45+
* <li>controlling plug-in version</li>
4646
* </ul>
4747
*
4848
* <p>
@@ -55,7 +55,7 @@
5555
abstract public class AbstractLdapPlugin implements IAuthorizationPlugin {
5656

5757
/**
58-
* This is used to ensure that every instance of this plugin has its own
58+
* This is used to ensure that every instance of this plug-in has its own
5959
* unique name for its session parameters.
6060
*/
6161
public static long nextId = 1;
@@ -153,7 +153,8 @@ public void load(Map<String, Object> parameters) {
153153
*/
154154
protected Configuration getConfiguration(String configurationPath) throws IOException {
155155
if ((cfg = LOADED_CONFIGURATIONS.get(configurationPath)) == null) {
156-
LOADED_CONFIGURATIONS.put(configurationPath, cfg = Configuration.read(new File(configurationPath)));
156+
LOADED_CONFIGURATIONS.put(configurationPath, cfg =
157+
Configuration.read(new File(configurationPath)));
157158
}
158159
return cfg;
159160
}
@@ -205,7 +206,7 @@ protected boolean isSameUser(String sessionUsername, String authUser) {
205206

206207
/**
207208
* Check if the session exists and contains all necessary fields required by
208-
* this plugin.
209+
* this plug-in.
209210
*
210211
* @param req the HTTP request
211212
* @return true if it does; false otherwise
@@ -228,7 +229,7 @@ protected boolean sessionExists(HttpServletRequest req) {
228229
* the session is established as an empty session to avoid any exception in
229230
* the caller.
230231
*
231-
* @param req the http request
232+
* @param req the HTTP request
232233
*/
233234
@SuppressWarnings("unchecked")
234235
private void ensureSessionExists(HttpServletRequest req) {
@@ -335,7 +336,7 @@ protected void setSessionUsername(HttpServletRequest req, String value) {
335336
}
336337

337338
/**
338-
* Return the current plugin version tracked by the authorization framework.
339+
* Return the current plug-in version tracked by the authorization framework.
339340
*
340341
* @return the version
341342
*/

plugins/LdapPlugin/src/opengrok/auth/plugin/LdapAttr.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,11 @@
3535
import org.opensolaris.opengrok.configuration.Group;
3636
import org.opensolaris.opengrok.configuration.Project;
3737

38+
/**
39+
* Authorization plug-in to check user's LDAP attribute against whitelist.
40+
*
41+
* @author Krystof Tulinger
42+
*/
3843
public class LdapAttr extends AbstractLdapPlugin {
3944

4045
protected static final String ATTR_PARAM = "attribute";

plugins/LdapPlugin/src/opengrok/auth/plugin/LdapFilter.java

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
* CDDL HEADER END
1818
*/
1919

20-
/*
20+
/*
2121
* Copyright (c) 2016, 2017 Oracle and/or its affiliates. All rights reserved.
2222
*/
2323
package opengrok.auth.plugin;
@@ -34,6 +34,11 @@
3434
import org.opensolaris.opengrok.configuration.Group;
3535
import org.opensolaris.opengrok.configuration.Project;
3636

37+
/**
38+
* Authorization plug-in to check if given user matches configured LDAP filter.
39+
*
40+
* @author Krystof Tulinger
41+
*/
3742
public class LdapFilter extends AbstractLdapPlugin {
3843

3944
private static final Logger LOGGER = Logger.getLogger(LdapFilter.class.getName());

plugins/LdapPlugin/src/opengrok/auth/plugin/LdapUserPlugin.java

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
* CDDL HEADER END
1818
*/
1919

20-
/*
20+
/*
2121
* Copyright (c) 2016, 2017 Oracle and/or its affiliates. All rights reserved.
2222
*/
2323
package opengrok.auth.plugin;
@@ -30,13 +30,18 @@
3030
import org.opensolaris.opengrok.configuration.Group;
3131
import org.opensolaris.opengrok.configuration.Project;
3232

33+
/**
34+
* Authorization plug-in to extract user's LDAP attributes.
35+
*
36+
* @author Krystof Tulinger
37+
*/
3338
public class LdapUserPlugin extends AbstractLdapPlugin {
3439

3540
public static final String SESSION_ATTR = "opengrok-ldap-plugin-user";
3641

3742
/**
3843
* Check if the session exists and contains all necessary fields required by
39-
* this plugin.
44+
* this plug-in.
4045
*
4146
* @param req the HTTP request
4247
* @return true if it does; false otherwise

plugins/LdapPlugin/src/opengrok/auth/plugin/ldap/FakeLdapFacade.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
* CDDL HEADER END
1818
*/
1919

20-
/*
20+
/*
2121
* Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
2222
*/
2323
package opengrok.auth.plugin.ldap;

plugins/LdapPlugin/test/opengrok/auth/plugin/configuration/ConfigurationTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
* CDDL HEADER END
1818
*/
1919

20-
/*
20+
/*
2121
* Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved.
2222
*/
2323
package opengrok.auth.plugin.configuration;

plugins/UserPlugin/src/opengrok/auth/plugin/UserPlugin.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
* CDDL HEADER END
1818
*/
1919

20-
/*
20+
/*
2121
* Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
2222
*/
2323
package opengrok.auth.plugin;
@@ -33,8 +33,9 @@
3333
import org.opensolaris.opengrok.configuration.Project;
3434

3535
/**
36+
* Authorization plug-in to extract user info from HTTP headers.
3637
*
37-
* @author ktulinge
38+
* @author Krystof Tulinger
3839
*/
3940
public class UserPlugin implements IAuthorizationPlugin {
4041

plugins/UserPlugin/src/opengrok/auth/plugin/decoders/HeaderDecoder.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@
3131

3232
/**
3333
* Decode Oracle SSO specific headers.
34+
*
3435
* @author Krystof Tulinger
3536
*/
3637
public class HeaderDecoder implements IUserDecoder {
@@ -79,7 +80,7 @@ public User fromRequest(HttpServletRequest request) {
7980

8081
/**
8182
* Creating new user entity with provided information. The entity can be
82-
* checked if it is timeouted via {@link User#isTimeouted()}.
83+
* checked if the timeout expired via {@link User#isTimeouted()}.
8384
*/
8485
User user = new User(username, userguid, cookieTimestamp,
8586
"true".equalsIgnoreCase(timeouted));

src/org/opensolaris/opengrok/authorization/IAuthorizationPlugin.java

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
* CDDL HEADER END
1818
*/
1919

20-
/*
20+
/*
2121
* Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved.
2222
*/
2323
package org.opensolaris.opengrok.authorization;
@@ -28,26 +28,27 @@
2828
import org.opensolaris.opengrok.configuration.Project;
2929

3030
/**
31-
* Interface for authorization plugins.
31+
* Interface for authorization plug-ins.
3232
*
33-
* All plugins considered for authorization must implement this interface
33+
* All plug-ins considered for authorization must implement this interface
3434
*
3535
* @author Krystof Tulinger
3636
*/
3737
public interface IAuthorizationPlugin {
3838

3939
/**
40-
* Called when the plugin is loaded into memory. With the parameters from
40+
* Called when the plug-in is loaded into memory. With the parameters from
4141
* the configuration.
4242
*
43-
* This can be used for establishing db/ldap connection or other init stuff.
43+
* This can be used for establishing database/LDAP connection or perform
44+
* initialization.
4445
*
4546
* @param parameters parameters specified in the configuration
4647
*/
4748
void load(Map<String, Object> parameters);
4849

4950
/**
50-
* Called when the plugin is about to be deleted from the memory.
51+
* Called when the plug-in is about to be deleted from the memory.
5152
*
5253
* This can be used for releasing connections and/or other release stuff.
5354
*/

0 commit comments

Comments
 (0)