summaryrefslogtreecommitdiffstats
path: root/base/ca
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/ca
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/ca')
-rw-r--r--base/ca/src/org/dogtagpki/server/ca/rest/CAApplication.java4
1 files changed, 3 insertions, 1 deletions
diff --git a/base/ca/src/org/dogtagpki/server/ca/rest/CAApplication.java b/base/ca/src/org/dogtagpki/server/ca/rest/CAApplication.java
index d73b794da..8c6c8cbe5 100644
--- a/base/ca/src/org/dogtagpki/server/ca/rest/CAApplication.java
+++ b/base/ca/src/org/dogtagpki/server/ca/rest/CAApplication.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;
@@ -89,6 +90,7 @@ public class CAApplication extends Application {
classes.add(PKIExceptionMapper.class);
// interceptors
+ singletons.add(new SessionContextInterceptor());
singletons.add(new AuthMethodInterceptor());
singletons.add(new ACLInterceptor());
singletons.add(new MessageFormatInterceptor());