summaryrefslogtreecommitdiffstats
path: root/base/ca
diff options
context:
space:
mode:
authorAde Lee <alee@redhat.com>2014-09-01 12:53:28 -0400
committerAde Lee <alee@redhat.com>2014-09-02 15:45:33 -0400
commit0507afc6b1226b2878aafde8487eba736c74514f (patch)
treed08bc1b97c7652ce30396619a126b1dab494bb0d /base/ca
parent99e6330ce13e55ac325d76bdc33f1b1b00cba5d3 (diff)
downloadpki-0507afc6b1226b2878aafde8487eba736c74514f.tar.gz
pki-0507afc6b1226b2878aafde8487eba736c74514f.tar.xz
pki-0507afc6b1226b2878aafde8487eba736c74514f.zip
Fix kra-connector-remove
The code to remove the connector from the pki CLI was found to be broken because of invalid message type (partly due to void returns). On uninstall, we need to remove the kra-connector from all relevant CA's in the security domain. The best way to do this is to keep kra-connector info in LDAP, so that only one call is needed. Until that change has been made, we are adding a hack to remove the connector from all CA's in the secutrity domain (if it exists). Due to issues with proxy configurations, we will continue to use sslget and a url-encoded-form version of the servlet. In addition, it was found that when removing a KRA from a shared subsystem, the updateDomainXML servlet was erroneously returning failure when it was unsuccessful in removing a non-existent user from a group. Ticket 1113
Diffstat (limited to 'base/ca')
-rw-r--r--base/ca/src/org/dogtagpki/server/ca/rest/KRAConnectorService.java12
1 files changed, 6 insertions, 6 deletions
diff --git a/base/ca/src/org/dogtagpki/server/ca/rest/KRAConnectorService.java b/base/ca/src/org/dogtagpki/server/ca/rest/KRAConnectorService.java
index 93e571aa2..0216558bf 100644
--- a/base/ca/src/org/dogtagpki/server/ca/rest/KRAConnectorService.java
+++ b/base/ca/src/org/dogtagpki/server/ca/rest/KRAConnectorService.java
@@ -20,7 +20,6 @@ package org.dogtagpki.server.ca.rest;
import javax.servlet.http.HttpServletRequest;
import javax.ws.rs.core.Context;
import javax.ws.rs.core.HttpHeaders;
-import javax.ws.rs.core.MultivaluedMap;
import javax.ws.rs.core.Request;
import javax.ws.rs.core.Response;
import javax.ws.rs.core.UriInfo;
@@ -51,13 +50,14 @@ public class KRAConnectorService extends PKIService implements KRAConnectorResou
private HttpServletRequest servletRequest;
@Override
- public void addConnector(KRAConnectorInfo info) {
+ public Response addConnector(KRAConnectorInfo info) {
if (info == null) throw new BadRequestException("KRA connector info is null.");
try {
KRAConnectorProcessor processor = new KRAConnectorProcessor(getLocale(headers));
processor.addConnector(info);
+ return createNoContentResponse();
} catch (EBaseException e) {
e.printStackTrace();
throw new PKIException(e.getMessage());
@@ -65,7 +65,7 @@ public class KRAConnectorService extends PKIService implements KRAConnectorResou
}
@Override
- public void removeConnector(String host, String port) {
+ public Response removeConnector(String host, String port) {
if (host == null) throw new BadRequestException("KRA connector host is null.");
if (port == null) throw new BadRequestException("KRA connector port is null.");
@@ -73,6 +73,7 @@ public class KRAConnectorService extends PKIService implements KRAConnectorResou
try {
KRAConnectorProcessor processor = new KRAConnectorProcessor(getLocale(headers));
processor.removeConnector(host, port);
+ return createNoContentResponse();
} catch (EBaseException e) {
e.printStackTrace();
throw new PKIException(e.getMessage());
@@ -80,9 +81,8 @@ public class KRAConnectorService extends PKIService implements KRAConnectorResou
}
@Override
- public void addConnector(MultivaluedMap<String, String> form) {
- KRAConnectorInfo info = new KRAConnectorInfo(form);
- addConnector(info);
+ public Response removeConnectorForm(String host, String port) {
+ return removeConnector(host, port);
}
@Override