summaryrefslogtreecommitdiffstats
path: root/base/ocsp/src
diff options
context:
space:
mode:
authorEndi S. Dewata <edewata@redhat.com>2015-04-21 16:29:45 -0400
committerEndi S. Dewata <edewata@redhat.com>2015-05-05 15:16:12 -0400
commitcb32779617947a16a0bfdc519a5ecbd0ae7019aa (patch)
treec494909409b00b53a43acacc0bcef9b931bc5474 /base/ocsp/src
parent31d96e0ba756fd05bad0c9a577bf27ef9041d490 (diff)
downloadpki-cb32779617947a16a0bfdc519a5ecbd0ae7019aa.tar.gz
pki-cb32779617947a16a0bfdc519a5ecbd0ae7019aa.tar.xz
pki-cb32779617947a16a0bfdc519a5ecbd0ae7019aa.zip
Fixed authentication data in audit log.
The REST methods may be executed by different threads even though they are invoked in the same session. A new interceptor has been added to all subsystems to make sure the SessionContext is created properly for each thread. This will fix the authentication data in the audit log. The SessionContext has also been improved to use ThreadLocal instead of a global Hashtable. https://fedorahosted.org/pki/ticket/1054
Diffstat (limited to 'base/ocsp/src')
-rw-r--r--base/ocsp/src/org/dogtagpki/server/ocsp/rest/OCSPApplication.java4
1 files changed, 3 insertions, 1 deletions
diff --git a/base/ocsp/src/org/dogtagpki/server/ocsp/rest/OCSPApplication.java b/base/ocsp/src/org/dogtagpki/server/ocsp/rest/OCSPApplication.java
index 1950edf29..8d6e4a983 100644
--- a/base/ocsp/src/org/dogtagpki/server/ocsp/rest/OCSPApplication.java
+++ b/base/ocsp/src/org/dogtagpki/server/ocsp/rest/OCSPApplication.java
@@ -10,10 +10,11 @@ import org.dogtagpki.server.rest.AccountService;
import org.dogtagpki.server.rest.AuditService;
import org.dogtagpki.server.rest.AuthMethodInterceptor;
import org.dogtagpki.server.rest.GroupService;
-import org.dogtagpki.server.rest.PKIExceptionMapper;
import org.dogtagpki.server.rest.MessageFormatInterceptor;
+import org.dogtagpki.server.rest.PKIExceptionMapper;
import org.dogtagpki.server.rest.SecurityDomainService;
import org.dogtagpki.server.rest.SelfTestService;
+import org.dogtagpki.server.rest.SessionContextInterceptor;
import org.dogtagpki.server.rest.SystemCertService;
import org.dogtagpki.server.rest.UserService;
@@ -63,6 +64,7 @@ public class OCSPApplication extends Application {
classes.add(PKIExceptionMapper.class);
// interceptors
+ singletons.add(new SessionContextInterceptor());
singletons.add(new AuthMethodInterceptor());
singletons.add(new ACLInterceptor());
singletons.add(new MessageFormatInterceptor());