diff options
author | Endi S. Dewata <edewata@redhat.com> | 2016-05-04 21:30:29 +0200 |
---|---|---|
committer | Endi S. Dewata <edewata@redhat.com> | 2016-05-04 21:30:29 +0200 |
commit | a31f24fcba558ea4efbfeb51b28f3e59e2281dfc (patch) | |
tree | e2ad880b5227f6880b125fbce4015ab92506ed57 | |
parent | 08da75f59394292c9a84766173576001fb6e71dc (diff) | |
download | pki-a31f24fcba558ea4efbfeb51b28f3e59e2281dfc.tar.gz pki-a31f24fcba558ea4efbfeb51b28f3e59e2281dfc.tar.xz pki-a31f24fcba558ea4efbfeb51b28f3e59e2281dfc.zip |
Added createUsers() and configureSecurityDomain().
4 files changed, 48 insertions, 7 deletions
diff --git a/base/common/python/pki/system.py b/base/common/python/pki/system.py index 46b1d4051..65ca32183 100644 --- a/base/common/python/pki/system.py +++ b/base/common/python/pki/system.py @@ -275,6 +275,26 @@ class SystemConfigClient(object): headers) return response.json() + def createUsers(self): + """ + Contacts the server and invokes the Java configuration REST API to + create subsystem users. + """ + headers = {'Content-type': 'application/json', + 'Accept': 'application/json'} + self.connection.post('/rest/installer/finalize', None, + headers) + + def configureSecurityDomain(self): + """ + Contacts the server and invokes the Java configuration REST API to + configure security domain. + """ + headers = {'Content-type': 'application/json', + 'Accept': 'application/json'} + response = self.connection.post('/rest/installer/finalize', None, + headers) + def finalize(self): """ Contacts the server and invokes the Java configuration REST API to diff --git a/base/common/src/com/netscape/certsrv/system/SystemConfigResource.java b/base/common/src/com/netscape/certsrv/system/SystemConfigResource.java index 104a0af08..3ad8abf96 100644 --- a/base/common/src/com/netscape/certsrv/system/SystemConfigResource.java +++ b/base/common/src/com/netscape/certsrv/system/SystemConfigResource.java @@ -32,6 +32,14 @@ public interface SystemConfigResource { public ConfigurationResponse configure(ConfigurationRequest data) throws Exception; @POST + @Path("createUsers") + public void createUsers() throws Exception; + + @POST + @Path("configureSecurityDomain") + public void configureSecurityDomain() throws Exception; + + @POST @Path("finalize") public ConfigurationResponse finalizeConfiguration() throws Exception; } 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 aa20e76c2..cc350e947 100644 --- a/base/server/cms/src/org/dogtagpki/server/rest/SystemConfigService.java +++ b/base/server/cms/src/org/dogtagpki/server/rest/SystemConfigService.java @@ -220,15 +220,26 @@ public class SystemConfigService extends PKIService implements SystemConfigResou if (data.getBackupKeys().equals("true")) { backupKeys(data); } + } + + @Override + public void createUsers() { + + HttpSession session = servletRequest.getSession(); + ConfigurationRequest request = (ConfigurationRequest)session.getAttribute("configuration_request"); + ConfigurationResponse response = (ConfigurationResponse)session.getAttribute("configuration_response"); - // configure admin - CMS.debug("=== Admin Configuration ==="); - configureAdministrator(data, response); + configureAdministrator(request, response); + setupDBUser(request); + } + + @Override + public void configureSecurityDomain() { + + HttpSession session = servletRequest.getSession(); + ConfigurationRequest request = (ConfigurationRequest)session.getAttribute("configuration_request"); - // create or update security domain - CMS.debug("=== Finalization ==="); - setupSecurityDomain(data); - setupDBUser(data); + setupSecurityDomain(request); } @Override diff --git a/base/server/python/pki/server/deployment/pkihelper.py b/base/server/python/pki/server/deployment/pkihelper.py index f4bc518b9..13a7755b8 100644 --- a/base/server/python/pki/server/deployment/pkihelper.py +++ b/base/server/python/pki/server/deployment/pkihelper.py @@ -3818,6 +3818,8 @@ class ConfigClient: try: client = pki.system.SystemConfigClient(connection) client.configure(data) + client.createUsers() + client.configureSecurityDomain() response = client.finalize() config.pki_log.debug( |