Skip to content

Commit dced61b

Browse files
author
Vladimir Kotal
committed
change the debug prefix and initialize the header names in better way
1 parent 1a78b03 commit dced61b

File tree

2 files changed

+11
-9
lines changed

2 files changed

+11
-9
lines changed

plugins/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ In general, it should be possible to increase log level in Tomcat's
1717
### UserPlugin
1818

1919
Has a special property called "fake" that allows to insert custom headers
20-
with the "my-" prefix that would be evaluated instead of the usual SSO headers.
20+
with the "fake-" prefix that would be evaluated instead of the usual SSO headers.
2121

2222
Header insertion can be done e.g. using the Modify headers Firefox plugin.
2323

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

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -23,20 +23,22 @@
2323
package opengrok.auth.plugin.decoders;
2424

2525
/**
26-
* Almost like @{code OSSOHeaderDecoder} however uses HTTP headers with
27-
* the "my-" prefix which allows for custom header insertion.
26+
* Almost like @{code OSSOHeaderDecoder} however uses OSSO HTTP headers with
27+
* prefix which allows for custom header insertion.
2828
* This class should therefore only be used for debugging.
2929
*
3030
* @author Krystof Tulinger
3131
*/
3232
public class FakeOSSOHeaderDecoder extends OSSOHeaderDecoder {
3333

34+
private final String PREFIX = "fake-";
35+
3436
public FakeOSSOHeaderDecoder() {
35-
OSSO_COOKIE_TIMESTAMP_HEADER = "my-osso-cookie-timestamp";
36-
OSSO_TIMEOUT_EXCEEDED_HEADER = "my-osso-idle-timeout-exceeded";
37-
OSSO_SUBSCRIBER_DN_HEADER = "my-osso-subscriber-dn";
38-
OSSO_SUBSCRIBER_HEADER = "my-osso-subscriber";
39-
OSSO_USER_DN_HEADER = "my-osso-user-dn";
40-
OSSO_USER_GUID_HEADER = "my-osso-user-guid";
37+
OSSO_COOKIE_TIMESTAMP_HEADER = PREFIX + OSSOHeaderDecoder.OSSO_COOKIE_TIMESTAMP_HEADER;
38+
OSSO_TIMEOUT_EXCEEDED_HEADER = PREFIX + OSSOHeaderDecoder.OSSO_TIMEOUT_EXCEEDED_HEADER;
39+
OSSO_SUBSCRIBER_DN_HEADER = PREFIX + OSSOHeaderDecoder.OSSO_SUBSCRIBER_DN_HEADER;
40+
OSSO_SUBSCRIBER_HEADER = PREFIX + OSSOHeaderDecoder.OSSO_SUBSCRIBER_HEADER;
41+
OSSO_USER_DN_HEADER = PREFIX + OSSOHeaderDecoder.OSSO_USER_DN_HEADER;
42+
OSSO_USER_GUID_HEADER = PREFIX + OSSOHeaderDecoder.OSSO_USER_GUID_HEADER;
4143
}
4244
}

0 commit comments

Comments
 (0)