File tree Expand file tree Collapse file tree 2 files changed +4
-8
lines changed
opengrok-indexer/src/main/java/org/opengrok/indexer/authorization
plugins/src/opengrok/auth/plugin Expand file tree Collapse file tree 2 files changed +4
-8
lines changed Original file line number Diff line number Diff line change @@ -31,7 +31,7 @@ public AuthorizationException(Throwable ex) {
31
31
super (ex );
32
32
}
33
33
34
- AuthorizationException (String msg ) {
34
+ public AuthorizationException (String msg ) {
35
35
super (msg );
36
36
}
37
37
Original file line number Diff line number Diff line change @@ -104,7 +104,6 @@ protected boolean sessionExists(HttpServletRequest req) {
104
104
}
105
105
106
106
protected String getFilter (User user ) {
107
- String filter = null ;
108
107
String commonName ;
109
108
110
109
Matcher matcher = usernameCnPattern .matcher (user .getUsername ());
@@ -113,14 +112,11 @@ protected String getFilter(User user) {
113
112
LOGGER .log (Level .FINEST , "extracted common name {0} from {1}" ,
114
113
new Object []{commonName , user .getUsername ()});
115
114
} else {
116
- LOGGER .log (Level .WARNING , "cannot get common name out of {0}" ,
117
- user .getUsername ());
118
- return filter ;
115
+ throw new AuthorizationException (String .format ("cannot get common name out of %s" ,
116
+ user .getUsername ()));
119
117
}
120
118
121
- filter = "(&(objectclass=" + this .objectClass + ")(" + commonName + "))" ;
122
-
123
- return filter ;
119
+ return "(&(objectclass=" + this .objectClass + ")(" + commonName + "))" ;
124
120
}
125
121
126
122
@ Override
You can’t perform that action at this time.
0 commit comments