diff options
| author | Endi S. Dewata <edewata@redhat.com> | 2014-04-23 11:24:08 -0400 |
|---|---|---|
| committer | Endi S. Dewata <edewata@redhat.com> | 2014-04-30 12:23:52 -0400 |
| commit | 602ae21f6ef30ddfffeb22b743ce910b40757b3a (patch) | |
| tree | 55efe11ebdfd0be5426619e282417abd66ed0db4 /base/server/cms/src | |
| parent | f3c8cd311ebcec1578269d2071f92700d33e3955 (diff) | |
Fixed TPS connector configuration.
The code that configures the TPS connectors during installation
has been modified to use the ConnectionDatabase, which is also
used by the CLI/UI after the installation.
The code has also been fixed to configure the correct properties
as defined in CS.cfg. The static properties have been removed
from CS.cfg because now they will be generated dynamically by
the ConnectionDatabase.
Due to class dependency issue, the methods for configuring the TPS
connectors have been moved from ConfigurationUtils into a new
TPSInstaller class.
The URI's in ConfigurationRequest have been converted from String
into URI to simplify validation.
Ticket #890
Diffstat (limited to 'base/server/cms/src')
| -rw-r--r-- | base/server/cms/src/com/netscape/cms/servlet/csadmin/ConfigurationUtils.java | 45 | ||||
| -rw-r--r-- | base/server/cms/src/org/dogtagpki/server/rest/SystemConfigService.java | 27 |
2 files changed, 4 insertions, 68 deletions
diff --git a/base/server/cms/src/com/netscape/cms/servlet/csadmin/ConfigurationUtils.java b/base/server/cms/src/com/netscape/cms/servlet/csadmin/ConfigurationUtils.java index 51c42b7b9..6f37de735 100644 --- a/base/server/cms/src/com/netscape/cms/servlet/csadmin/ConfigurationUtils.java +++ b/base/server/cms/src/com/netscape/cms/servlet/csadmin/ConfigurationUtils.java @@ -3964,51 +3964,6 @@ public class ConfigurationUtils { return s; } - public static void updateCAConnInfo(URI caUri, String subsystemNick) { - IConfigStore cs = CMS.getConfigStore(); - - cs.putString("preop.cainfo.select", caUri.toString()); - cs.putString("conn.ca1.clientNickname", subsystemNick); - cs.putString("conn.ca1.hostport", caUri.getHost() + ":" + caUri.getPort()); - cs.putString("conn.ca1.hostagentport", caUri.getHost() + ":" + caUri.getPort()); - cs.putString("conn.ca1.hostadminport", caUri.getHost() + ":" + caUri.getPort()); - } - - public static void updateKRAConnInfo(boolean enableServerSideKeyGen, URI kraUri, String subsystemNick) { - IConfigStore cs = CMS.getConfigStore(); - if (enableServerSideKeyGen) { - cs.putString("preop.krainfo.select", kraUri.toString()); - cs.putString("conn.drm1.clientNickname", subsystemNick); - cs.putString("conn.drm1.hostport", kraUri.getHost() + ":" + kraUri.getPort()); - cs.putString("conn.tks1.serverKeygen", "true"); - cs.putString("op.enroll.userKey.keyGen.encryption.serverKeygen.enable", "true"); - cs.putString("op.enroll.userKeyTemporary.keyGen.encryption.serverKeygen.enable", "true"); - cs.putString("op.enroll.soKey.keyGen.encryption.serverKeygen.enable", "true"); - cs.putString("op.enroll.soKeyTemporary.keyGen.encryption.serverKeygen.enable", "true"); - } else { - // no keygen - cs.putString("conn.tks1.serverKeygen", "false"); - cs.putString("op.enroll.userKey.keyGen.encryption.serverKeygen.enable", "false"); - cs.putString("op.enroll.userKeyTemporary.keyGen.encryption.serverKeygen.enable", "false"); - cs.putString("op.enroll.userKey.keyGen.encryption.recovery.destroyed.scheme", "GenerateNewKey"); - cs.putString("op.enroll.userKeyTemporary.keyGen.encryption.recovery.onHold.scheme", "GenerateNewKey"); - cs.putString("conn.drm1.clientNickname", ""); - cs.putString("conn.drm1.hostport", ""); - cs.putString("op.enroll.soKey.keyGen.encryption.serverKeygen.enable", "false"); - cs.putString("op.enroll.soKeyTemporary.keyGen.encryption.serverKeygen.enable", "false"); - cs.putString("op.enroll.soKey.keyGen.encryption.recovery.destroyed.scheme", "GenerateNewKey"); - cs.putString("op.enroll.soKeyTemporary.keyGen.encryption.recovery.onHold.scheme", "GenerateNewKey"); - } - } - - public static void updateTKSConnInfo(URI tksUri, String subsystemNick) { - IConfigStore cs = CMS.getConfigStore(); - - cs.putString("preop.tksinfo.select", tksUri.toString()); - cs.putString("conn.tks1.clientNickname", subsystemNick); - cs.putString("conn.tks1.hostport", tksUri.getHost() + ":" + tksUri.getPort()); - } - public static void updateAuthdbInfo(String basedn, String host, String port, String secureConn) { IConfigStore cs = CMS.getConfigStore(); diff --git a/base/server/cms/src/org/dogtagpki/server/rest/SystemConfigService.java b/base/server/cms/src/org/dogtagpki/server/rest/SystemConfigService.java index 902dc88f0..3aad2a232 100644 --- a/base/server/cms/src/org/dogtagpki/server/rest/SystemConfigService.java +++ b/base/server/cms/src/org/dogtagpki/server/rest/SystemConfigService.java @@ -19,7 +19,6 @@ package org.dogtagpki.server.rest; import java.math.BigInteger; import java.net.MalformedURLException; -import java.net.URI; import java.net.URISyntaxException; import java.net.URL; import java.security.NoSuchAlgorithmException; @@ -114,7 +113,7 @@ public class SystemConfigService extends PKIService implements SystemConfigResou * @see com.netscape.cms.servlet.csadmin.SystemConfigurationResource#configure(javax.ws.rs.core.MultivaluedMap) */ @Override - public ConfigurationResponse configure(MultivaluedMap<String, String> form) { + public ConfigurationResponse configure(MultivaluedMap<String, String> form) throws URISyntaxException { ConfigurationRequest data = new ConfigurationRequest(form); return configure(data); } @@ -1166,36 +1165,18 @@ public class SystemConfigService extends PKIService implements SystemConfigResou } if (csType.equals("TPS")) { - if ((data.getCaUri() == null) || data.getCaUri().isEmpty()) { + if (data.getCaUri() == null) { throw new BadRequestException("CA URI not provided"); } - try { - @SuppressWarnings("unused") - URI ca_uri = new URI(data.getCaUri()); - } catch (URISyntaxException e) { - throw new BadRequestException("Invalid CA URI"); - } - if ((data.getTksUri() == null) || data.getTksUri().isEmpty()) { + if (data.getTksUri() == null) { throw new BadRequestException("TKS URI not provided"); } - try { - @SuppressWarnings("unused") - URI tks_uri = new URI(data.getTksUri()); - } catch (URISyntaxException e) { - throw new BadRequestException("Invalid TKS URI"); - } if (data.getEnableServerSideKeyGen().equalsIgnoreCase("true")) { - if ((data.getKraUri() == null) || data.getKraUri().isEmpty()) { + if (data.getKraUri() == null) { throw new BadRequestException("KRA URI required if server-side key generation requested"); } - try { - @SuppressWarnings("unused") - URI kra_uri = new URI(data.getKraUri()); - } catch (URISyntaxException e) { - throw new BadRequestException("Invalid KRA URI"); - } } if ((data.getAuthdbBaseDN()==null) || data.getAuthdbBaseDN().isEmpty()) { |
