Skip to content

Commits on Source 164

64 additional commits have been omitted to prevent performance issues.
......@@ -33,12 +33,6 @@
<classpathentry kind="lib" path="/usr/share/java/jakarta-commons-httpclient.jar"/>
<classpathentry kind="lib" path="/usr/share/java/junit.jar"/>
<classpathentry kind="lib" path="/usr/share/java/ldapjdk.jar"/>
<classpathentry kind="lib" path="/usr/share/java/jackson/jackson-core-asl.jar"/>
<classpathentry kind="lib" path="/usr/share/java/jackson/jackson-jaxrs.jar"/>
<classpathentry kind="lib" path="/usr/share/java/jackson/jackson-mapper-asl.jar"/>
<classpathentry kind="lib" path="/usr/share/java/jackson/jackson-mrbean.jar"/>
<classpathentry kind="lib" path="/usr/share/java/jackson/jackson-smile.jar"/>
<classpathentry kind="lib" path="/usr/share/java/jackson/jackson-xc.jar"/>
<classpathentry kind="lib" path="/usr/share/java/jaxb-api.jar"/>
<classpathentry kind="lib" path="/usr/share/java/httpcomponents/httpclient.jar"/>
<classpathentry kind="lib" path="/usr/share/java/httpcomponents/httpcore.jar"/>
......@@ -46,7 +40,6 @@
<classpathentry kind="lib" path="/usr/share/java/resteasy/resteasy-client.jar"/>
<classpathentry kind="lib" path="/usr/share/java/resteasy/resteasy-jaxb-provider.jar"/>
<classpathentry kind="lib" path="/usr/share/java/resteasy/resteasy-jaxrs.jar"/>
<classpathentry kind="lib" path="/usr/share/java/resteasy/resteasy-jackson-provider.jar"/>
<classpathentry kind="lib" path="/usr/share/java/servlet.jar"/>
<classpathentry kind="lib" path="/usr/share/java/velocity.jar"/>
<classpathentry kind="lib" path="/usr/share/java/xerces-j2.jar"/>
......@@ -69,5 +62,8 @@
<classpathentry kind="lib" path="/usr/share/java/jboss-annotations-1.2-api/jboss-annotations-api_1.2_spec.jar"/>
<classpathentry kind="lib" path="/usr/share/java/tomcat/tomcat-juli.jar"/>
<classpathentry kind="lib" path="/usr/share/java/tomcat/jaspic-api.jar"/>
<classpathentry kind="lib" path="/usr/share/java/jackson-databind.jar"/>
<classpathentry kind="lib" path="/usr/share/java/jackson-core.jar"/>
<classpathentry kind="lib" path="/usr/share/java/resteasy/resteasy-jackson2-provider.jar"/>
<classpathentry kind="output" path="build/classes"/>
</classpath>
......@@ -5,132 +5,52 @@ services:
- docker
cache: pip
jobs:
include:
env:
- BASE_IMAGE_VERSION=28 TASK="PKI"
- BASE_IMAGE_VERSION=28 TASK="IPA"
- BASE_IMAGE_VERSION=29 TASK="PKI"
- BASE_IMAGE_VERSION=29 TASK="IPA"
# F27 Image
- env:
- TASK="PKI Test on F27"
- BASE_IMAGE_VERSION=27
before_install:
- set -a && source travis/global_variables
- echo -e $gerrit_ssh_key >> ~/.ssh/id_rsa && chmod 600 ~/.ssh/id_rsa
- touch ${LOGS}
- travis/post-test-started.sh
install:
- travis/builder-init.sh
- docker exec -i ${CONTAINER} ${SCRIPTDIR}/pki-init.sh
- docker exec -i ${CONTAINER} ${SCRIPTDIR}/pki-build.sh
- docker exec -i ${CONTAINER} ${SCRIPTDIR}/pki-install.sh
script:
- docker exec -i ${CONTAINER} ${SCRIPTDIR}/ds-create.sh
- docker exec -i ${CONTAINER} ${SCRIPTDIR}/ca-create.sh
- docker exec -i ${CONTAINER} ${SCRIPTDIR}/kra-create.sh
- docker exec -i ${CONTAINER} ${SCRIPTDIR}/ocsp-create.sh
- docker exec -i ${CONTAINER} ${SCRIPTDIR}/tks-create.sh
- docker exec -i ${CONTAINER} ${SCRIPTDIR}/tps-create.sh
- docker exec -i ${CONTAINER} ${SCRIPTDIR}/tps-remove.sh
- docker exec -i ${CONTAINER} ${SCRIPTDIR}/tks-remove.sh
- docker exec -i ${CONTAINER} ${SCRIPTDIR}/ocsp-remove.sh
- docker exec -i ${CONTAINER} ${SCRIPTDIR}/kra-remove.sh
- docker exec -i ${CONTAINER} ${SCRIPTDIR}/ca-remove.sh
- docker exec -i ${CONTAINER} ${SCRIPTDIR}/ds-remove.sh
after_failure:
- travis/post-test-failed.sh
after_script:
- cat ${LOGS}
- docker kill ${CONTAINER}
- docker rm ${CONTAINER}
- env:
- TASK="IPA Test on F27"
- BASE_IMAGE_VERSION=27
before_install:
- set -a && source travis/global_variables
- echo -e $gerrit_ssh_key >> ~/.ssh/id_rsa && chmod 600 ~/.ssh/id_rsa
- touch ${LOGS}
install:
# Setup the required build environment
- travis/builder-init.sh
# Initialize PKI build env
- docker exec -i ${CONTAINER} ${SCRIPTDIR}/pki-init.sh
# Trigger build process
- docker exec -i ${CONTAINER} ${SCRIPTDIR}/pki-build.sh --with-pkgs=base,server,ca,kra
# Initialize IPA test environment
- docker exec -i ${CONTAINER} ${SCRIPTDIR}/ipa-init.sh
# Install recently build Dogtag RPMS
- docker exec -i ${CONTAINER} ${SCRIPTDIR}/pki-install.sh
script:
- docker exec -i ${CONTAINER} ${SCRIPTDIR}/ipa-test.sh
after_failure:
- travis/post-test-failed.sh
after_script:
- cat ${LOGS}
- docker kill ${CONTAINER}
- docker rm ${CONTAINER}
# F28 image
- env:
- TASK="PKI Test on F28"
- BASE_IMAGE_VERSION=28
before_install:
- set -a && source travis/global_variables
- echo -e $gerrit_ssh_key >> ~/.ssh/id_rsa && chmod 600 ~/.ssh/id_rsa
- touch ${LOGS}
install:
- travis/builder-init.sh
- docker exec -i ${CONTAINER} ${SCRIPTDIR}/pki-init.sh
# Trigger build process
- docker exec -i ${CONTAINER} ${SCRIPTDIR}/pki-build.sh
- docker exec -i ${CONTAINER} ${SCRIPTDIR}/pki-install.sh
script:
- docker exec -i ${CONTAINER} ${SCRIPTDIR}/ds-create.sh
- docker exec -i ${CONTAINER} ${SCRIPTDIR}/ca-create.sh
- docker exec -i ${CONTAINER} ${SCRIPTDIR}/kra-create.sh
- docker exec -i ${CONTAINER} ${SCRIPTDIR}/ocsp-create.sh
- docker exec -i ${CONTAINER} ${SCRIPTDIR}/tks-create.sh
- docker exec -i ${CONTAINER} ${SCRIPTDIR}/tps-create.sh
- docker exec -i ${CONTAINER} ${SCRIPTDIR}/tps-remove.sh
- docker exec -i ${CONTAINER} ${SCRIPTDIR}/tks-remove.sh
- docker exec -i ${CONTAINER} ${SCRIPTDIR}/ocsp-remove.sh
- docker exec -i ${CONTAINER} ${SCRIPTDIR}/kra-remove.sh
- docker exec -i ${CONTAINER} ${SCRIPTDIR}/ca-remove.sh
- docker exec -i ${CONTAINER} ${SCRIPTDIR}/ds-remove.sh
after_failure:
- travis/post-test-failed.sh
after_script:
- cat ${LOGS}
- docker kill ${CONTAINER}
- docker rm ${CONTAINER}
- env:
- TASK="IPA Test on F28"
- BASE_IMAGE_VERSION=28
before_install:
- set -a && source travis/global_variables
- echo -e $gerrit_ssh_key >> ~/.ssh/id_rsa && chmod 600 ~/.ssh/id_rsa
- touch ${LOGS}
install:
# Setup the required build environment
- travis/builder-init.sh
# Initialize PKI build env
- docker exec -i ${CONTAINER} ${SCRIPTDIR}/pki-init.sh
# Trigger build process
- docker exec -i ${CONTAINER} ${SCRIPTDIR}/pki-build.sh --with-pkgs=base,server,ca,kra
# Initialize IPA test environment
- docker exec -i ${CONTAINER} ${SCRIPTDIR}/ipa-init.sh
# If IPA, first initialize IPA env, then install new PKI RPMS
- if [ $TASK = "IPA" ]; then docker exec -i ${CONTAINER} ${SCRIPTDIR}/ipa-init.sh; fi
# Install recently build Dogtag RPMS
- docker exec -i ${CONTAINER} ${SCRIPTDIR}/pki-install.sh
script:
- docker exec -i ${CONTAINER} ${SCRIPTDIR}/ipa-test.sh
after_failure:
- travis/post-test-failed.sh
- >
if [ $TASK = "IPA" ]; then
docker exec -i ${CONTAINER} ${SCRIPTDIR}/ipa-test.sh
else
docker exec -i ${CONTAINER} ${SCRIPTDIR}/ds-create.sh
docker exec -i ${CONTAINER} ${SCRIPTDIR}/ca-create.sh
docker exec -i ${CONTAINER} ${SCRIPTDIR}/kra-create.sh
docker exec -i ${CONTAINER} ${SCRIPTDIR}/ocsp-create.sh
docker exec -i ${CONTAINER} ${SCRIPTDIR}/tks-create.sh
docker exec -i ${CONTAINER} ${SCRIPTDIR}/tps-create.sh
docker exec -i ${CONTAINER} ${SCRIPTDIR}/tps-remove.sh
docker exec -i ${CONTAINER} ${SCRIPTDIR}/tks-remove.sh
docker exec -i ${CONTAINER} ${SCRIPTDIR}/ocsp-remove.sh
docker exec -i ${CONTAINER} ${SCRIPTDIR}/kra-remove.sh
docker exec -i ${CONTAINER} ${SCRIPTDIR}/ca-remove.sh
docker exec -i ${CONTAINER} ${SCRIPTDIR}/ds-remove.sh
fi
after_script:
- cat ${LOGS}
- docker kill ${CONTAINER}
- docker rm ${CONTAINER}
- stage: Verification Label
before_install:
- echo -e $gerrit_ssh_key >> ~/.ssh/id_rsa && chmod 600 ~/.ssh/id_rsa
script:
- travis/post-test-passed.sh
......@@ -107,51 +107,48 @@ find_file(HTTPCORE_JAR
/usr/share/java
)
find_file(JACKSON_CORE_JAR
find_file(JACKSON2_CORE_JAR
NAMES
jackson-core-asl.jar
jackson-core.jar
PATHS
/usr/share/java/jackson
/usr/share/java
)
find_file(JACKSON_JAXRS_JAR
find_file(JACKSON2_DATABIND_JAR
NAMES
jackson-jaxrs.jar
jackson-databind.jar
PATHS
/usr/share/java/jackson
/usr/share/java
)
find_file(JACKSON_MAPPER_JAR
find_file(JACKSON2_ANNOTATIONS_JAR
NAMES
jackson-mapper-asl.jar
jackson-annotations.jar
PATHS
/usr/share/java/jackson
/usr/share/java
)
find_file(JACKSON_MRBEAN_JAR
find_file(JACKSON2_JAXRS_BASE_JAR
NAMES
jackson-mrbean.jar
jackson-jaxrs-base.jar
PATHS
/usr/share/java/jackson
/usr/share/java/jackson-jaxrs-providers
/usr/share/java
)
find_file(JACKSON_SMILE_JAR
find_file(JACKSON2_JAXRS_JSON_PROVIDER_JAR
NAMES
jackson-smile.jar
jackson-jaxrs-json-provider.jar
PATHS
/usr/share/java/jackson
/usr/share/java/jackson-jaxrs-providers
/usr/share/java
)
find_file(JACKSON_XC_JAR
find_file(JACKSON2_JAXB_ANNOTATIONS_JAR
NAMES
jackson-xc.jar
jackson-module-jaxb-annotations.jar
PATHS
/usr/share/java/jackson
/usr/share/java/jackson-modules
/usr/share/java
)
......@@ -208,6 +205,20 @@ find_file(RESTEASY_ATOM_PROVIDER_JAR
${RESTEASY_LIB}
)
find_file(RESTEASY_CLIENT_JAR
NAMES
resteasy-client.jar
PATHS
${RESTEASY_LIB}
)
find_file(SYMKEY_JAR
NAMES
symkey.jar
PATHS
${JAVA_LIB_INSTALL_DIR}
)
find_file(JASPIC_API_JAR
NAMES
jaspic-api.jar
......@@ -311,6 +322,47 @@ find_file(XML_COMMONS_RESOLVER_JAR
/usr/share/java
)
find_file(BASE_JAR
NAMES
idm-console-base.jar
PATHS
${JAVA_LIB_INSTALL_DIR}
/usr/share/java
)
find_file(MMC_JAR
NAMES
idm-console-mcc.jar
PATHS
${JAVA_LIB_INSTALL_DIR}
/usr/share/java
)
find_file(MMC_EN_JAR
NAMES
idm-console-mcc_en.jar
PATHS
${JAVA_LIB_INSTALL_DIR}
/usr/share/java
)
find_file(NMCLF_JAR
NAMES
idm-console-nmclf.jar
PATHS
${JAVA_LIB_INSTALL_DIR}
/usr/share/java
)
find_file(NMCLF_EN_JAR
NAMES
idm-console-nmclf_en.jar
PATHS
${JAVA_LIB_INSTALL_DIR}
/usr/share/java
)
# The order is important!
if (BUILD_PKI_CORE OR BUILD_PKI_CONSOLE)
add_subdirectory(test)
......
Name: pki
Specification-Version: ${APPLICATION_VERSION_MAJOR}.${APPLICATION_VERSION_MINOR}
Implementation-Version: ${APPLICATION_VERSION}
Specification-Version: ${APPLICATION_VERSION}
Implementation-Version: ${VERSION}
desc=This certificate profile is for enrolling user certificates with ECC keys by using the CMC certificate request with CMC Signature authentication.
visible=true
visible=false
enable=true
enableBy=admin
auth.instance_id=CMCAuth
......
/* --- BEGIN COPYRIGHT BLOCK ---
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; version 2 of the License.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along
* with this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Copyright (C) 2018 Red Hat, Inc.
* All rights reserved.
* --- END COPYRIGHT BLOCK ---
*
* @author Endi S. Dewata
*/
var CertificateModel = Model.extend({
urlRoot: "/ca/rest/certs",
parseResponse: function(response) {
return {
id: response.id,
serialNumber: response.id,
subjectDN: response.SubjectDN,
issuerDN: response.IssuerDN,
status: response.Status,
notValidBefore: response.NotBefore,
notValidAfter: response.NotAfter,
encoded: response.Encoded,
};
}
});
var CertificateCollection = Collection.extend({
urlRoot: "/ca/rest/certs",
getEntries: function(response) {
return response.entries;
},
getLinks: function(response) {
return response.Link;
},
parseEntry: function(entry) {
return new CertificateModel({
id: entry.id,
serialNumber: entry.id,
subjectDN: entry.SubjectDN,
issuerDN: entry.IssuerDN,
issuedOn: entry.IssuedOn,
issuedBy: entry.IssuedBy,
type: entry.Type,
version: entry.Version,
keyLength: entry.KeyLength,
keyAlgorithmOID: entry.KeyAlgorithmOID,
status: entry.Status,
notValidBefore: entry.NotValidBefore,
notValidAfter: entry.NotValidAfter
});
}
});
var CertificatePage = EntryPage.extend({
initialize: function(options) {
var self = this;
CertificatePage.__super__.initialize.call(self, options);
}
});
var CertificatesTable = ModelTable.extend({
initialize: function(options) {
var self = this;
CertificatesTable.__super__.initialize.call(self, options);
}
});
var CertificatesPage = Page.extend({
load: function() {
var self = this;
var table = new CertificatesTable({
el: $("table[name='certificates']"),
collection: self.collection
});
table.render();
}
});
/* --- BEGIN COPYRIGHT BLOCK ---
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; version 2 of the License.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along
* with this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Copyright (C) 2018 Red Hat, Inc.
* All rights reserved.
* --- END COPYRIGHT BLOCK ---
*
* @author Endi S. Dewata
*/
var CertRequestModel = Model.extend({
urlRoot: "/ca/rest/certrequests",
parseResponse: function(response) {
var url = response.requestURL;
var i = url.lastIndexOf('/');
return {
id: url.substring(i + 1),
type: response.requestType,
status: response.requestStatus,
certRequestType: response.certRequestType,
certId: response.certId,
operationResult: response.operationResult,
};
}
});
var CertRequestCollection = Collection.extend({
urlRoot: "/ca/rest/agent/certrequests",
getEntries: function(response) {
return response.entries;
},
getLinks: function(response) {
return response.Link;
},
parseEntry: function(entry) {
var url = entry.requestURL;
var i = url.lastIndexOf('/');
return new CertRequestModel({
id: url.substring(i + 1),
type: entry.requestType,
status: entry.requestStatus,
certRequestType: entry.certRequestType,
certId: entry.certId,
operationResult: entry.operationResult,
});
}
});
var CertRequestPage = EntryPage.extend({
initialize: function(options) {
var self = this;
CertRequestPage.__super__.initialize.call(self, options);
}
});
var CertRequestsTable = ModelTable.extend({
initialize: function(options) {
var self = this;
CertRequestsTable.__super__.initialize.call(self, options);
}
});
var CertRequestsPage = Page.extend({
load: function() {
var self = this;
var table = new CertRequestsTable({
el: $("table[name='certrequests']"),
collection: self.collection
});
table.render();
}
});
/* --- BEGIN COPYRIGHT BLOCK ---
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; version 2 of the License.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along
* with this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Copyright (C) 2018 Red Hat, Inc.
* All rights reserved.
* --- END COPYRIGHT BLOCK ---
*
* @author Endi S. Dewata
*/
var ProfileModel = Model.extend({
urlRoot: "/ca/rest/profiles",
parseResponse: function(response) {
return {
id: response.id,
classId: response.classId,
name: response.name,
description: response.description,
enabled: response.enabled,
visible: response.visible,
enabledBy: response.enabledBy,
authenticatorId: response.authenticatorId,
authzAcl: response.authzAcl,
renewal: response.renewal,
};
}
});
var ProfileCollection = Collection.extend({
urlRoot: "/ca/rest/profiles",
getEntries: function(response) {
return response.entries;
},
getLinks: function(response) {
return response.Link;
},
parseEntry: function(entry) {
return new ProfileModel({
id: entry.profileId,
name: entry.profileName,
description: entry.profileDescription,
});
}
});
var ProfilePage = EntryPage.extend({
initialize: function(options) {
var self = this;
ProfilePage.__super__.initialize.call(self, options);
}
});
var ProfilesTable = ModelTable.extend({
initialize: function(options) {
var self = this;
ProfilesTable.__super__.initialize.call(self, options);
}
});
var ProfilesPage = Page.extend({
load: function() {
var self = this;
var table = new ProfilesTable({
el: $("table[name='profiles']"),
collection: self.collection
});
table.render();
}
});
<!-- --- BEGIN COPYRIGHT BLOCK ---
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; version 2 of the License.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License along
with this program; if not, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
Copyright (C) 2018 Red Hat, Inc.
All rights reserved.
--- END COPYRIGHT BLOCK --- -->
<div class="pki-header">
<ol class="breadcrumb">
<li><a href="#">Home</a></li>
<li><a href="#certs">Certificates</a></li>
<li class="active"><strong><span name="title">Certificate ${id}</span></strong></li>
</ol>
<span name="title" class="pki-title">Certificate ${id}</span>
</div>
<div name="certificate" class="pki-fields">
<fieldset>
<label>Serial Number</label>
<input name="id" readonly="readonly"><br>
<label>Subject DN</label>
<input name="subjectDN" size="80" readonly="readonly"><br>
<label>Issuer DN</label>
<input name="issuerDN" size="80" readonly="readonly"><br>
<label>Status</label>
<input name="status" readonly="readonly"><br>
<label>Not Valid Before</label>
<input name="notValidBefore" readonly="readonly"><br>
<label>Not Valid After</label>
<input name="notValidAfter" readonly="readonly"><br>
<label>Certificate</label>
<textarea name="encoded" cols="80" rows="20" readonly="readonly"></textarea><br>
</fieldset>
</div>
<!-- --- BEGIN COPYRIGHT BLOCK ---
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; version 2 of the License.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License along
with this program; if not, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
Copyright (C) 2018 Red Hat, Inc.
All rights reserved.
--- END COPYRIGHT BLOCK --- -->
<div class="pki-header">
<ol class="breadcrumb">
<li><a href="#">Home</a></li>
<li><a href="#certrequests">Requests</a></li>
<li class="active"><strong><span name="title">Request ${id}</span></strong></li>
</ol>
<span name="title" class="pki-title">Request ${id}</span>
</div>
<div name="certrequest" class="pki-fields">
<fieldset>
<label>ID</label>
<input name="id" readonly="readonly"><br>
<label>Type</label>
<input name="type" readonly="readonly"><br>
<label>Status</label>
<input name="status" readonly="readonly"><br>
<label>CSR Type</label>
<input name="certRequestType" readonly="readonly"><br>
<label>Certificate ID</label>
<input name="certId" readonly="readonly"><br>
<label>Result</label>
<input name="operationResult" readonly="readonly"><br>
</fieldset>
</div>
<!-- --- BEGIN COPYRIGHT BLOCK ---
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; version 2 of the License.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License along
with this program; if not, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
Copyright (C) 2018 Red Hat, Inc.
All rights reserved.
--- END COPYRIGHT BLOCK --- -->
<div class="pki-header">
<ol class="breadcrumb">
<li><a href="#">Home</a></li>
<li class="active"><strong>Requests</strong></li>
</ol>
<span class="pki-title">Requests</span>
</div>
<table name="certrequests">
<thead>
<tr>
<th class="pki-table-actions" colspan="7">
<span name="search">
<input name="search" type="text" placeholder="Search...">
</span>
<span class="pki-table-buttons">
</span>
</th>
</tr>
<tr>
<th class="pki-select-column"><input id="certrequests-selectall" type="checkbox"><label for="certrequests-selectall">&nbsp;</label></tdh>
<th>ID</th>
<th>Type</th>
<th>Status</th>
<th>CSR Type</th>
<th>Certificate ID</th>
<th>Result</th>
</tr>
</thead>
<tbody>
<tr>
<td class="pki-select-column"><input id="certrequests-select" type="checkbox"><label for="certrequests-select">&nbsp;</label></td>
<td name="id"><a href="#certrequests/${id}">${id}</a></td>
<td name="type">${type}</td>
<td name="status">${status}</td>
<td name="certRequestType">${certRequestType}</td>
<td name="certId"><a href="#certs/${certId}">${certId}</a></td>
<td name="operationResult">${operationResult}</td>
</tr>
</tbody>
<tfoot>
<tr>
<th class="pki-table-actions" colspan="7">
<div class="pki-table-info">
Total: <span name="totalEntries">0</span> entries
</div>
<div class="pki-page-controls">
<ul class="pagination">
<li><a href="#" name="first"><span class="i fa fa-angle-double-left"></span></a></li>
<li><a href="#" name="prev"><span class="i fa fa-angle-left"></span></a></li>
</ul>
<span class="pki-page-jump">
<input name="page" type="text" value="1"> of <span name="totalPages">1</span>
</span>
<ul class="pagination">
<li><a href="#" name="next"><span class="i fa fa-angle-right"></span></a></li>
<li><a href="#" name="last"><span class="i fa fa-angle-double-right"></span></a></li>
</ul>
</div>
</th>
</tr>
</tfoot>
</table>
<!-- --- BEGIN COPYRIGHT BLOCK ---
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; version 2 of the License.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License along
with this program; if not, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
Copyright (C) 2018 Red Hat, Inc.
All rights reserved.
--- END COPYRIGHT BLOCK --- -->
<div class="pki-header">
<ol class="breadcrumb">
<li><a href="#">Home</a></li>
<li class="active"><strong>Certificates</strong></li>
</ol>
<span class="pki-title">Certificates</span>
</div>
<table name="certificates">
<thead>
<tr>
<th class="pki-table-actions" colspan="7">
<span name="search">
<input name="search" type="text" placeholder="Search...">
</span>
<span class="pki-table-buttons">
</span>
</th>
</tr>
<tr>
<th class="pki-select-column"><input id="certs-selectall" type="checkbox"><label for="certs-selectall">&nbsp;</label></tdh>
<th>Serial Number</th>
<th>Subject DN</th>
<th>Issued By</th>
<th>Status</th>
<th>Not Valid Before</th>
<th>Not Valid After</th>
</tr>
</thead>
<tbody>
<tr>
<td class="pki-select-column"><input id="certs-select" type="checkbox"><label for="certs-select">&nbsp;</label></td>
<td name="id"><a href="#certs/${id}">${id}</a></td>
<td name="subjectDN">${subjectDN}</td>
<td name="issuedBy">${issuedBy}</td>
<td name="status">${status}</td>
<td name="notValidBefore">${notValidBefore}</td>
<td name="notValidAfter">${notValidAfter}</td>
</tr>
</tbody>
<tfoot>
<tr>
<th class="pki-table-actions" colspan="7">
<div class="pki-table-info">
Total: <span name="totalEntries">0</span> entries
</div>
<div class="pki-page-controls">
<ul class="pagination">
<li><a href="#" name="first"><span class="i fa fa-angle-double-left"></span></a></li>
<li><a href="#" name="prev"><span class="i fa fa-angle-left"></span></a></li>
</ul>
<span class="pki-page-jump">
<input name="page" type="text" value="1"> of <span name="totalPages">1</span>
</span>
<ul class="pagination">
<li><a href="#" name="next"><span class="i fa fa-angle-right"></span></a></li>
<li><a href="#" name="last"><span class="i fa fa-angle-double-right"></span></a></li>
</ul>
</div>
</th>
</tr>
</tfoot>
</table>
<!-- --- BEGIN COPYRIGHT BLOCK ---
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; version 2 of the License.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License along
with this program; if not, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
Copyright (C) 2018 Red Hat, Inc.
All rights reserved.
--- END COPYRIGHT BLOCK --- -->
<div class="pki-header">
<ol class="breadcrumb">
<li><a href="#">Home</a></li>
</ol>
<span name="title" class="pki-title">Certificate Authority</span>
</div>
<div class="panel panel-default">
<div class="panel-heading">
<h3 class="panel-title">Certificate Management</h3>
</div>
<div class="panel-body pki-menu">
<ul>
<li><a href="#certs">Certificates</a></li>
<li><a href="#certrequests">Requests</a></li>
<li><a href="#profiles">Profiles</a></li>
</ul>
</div>
</div>
<div name="home-accounts" class="panel panel-default" style="display: none;">
<div class="panel-heading">
<h3 class="panel-title">Account Management</h3>
</div>
<div class="panel-body pki-menu">
<ul>
<li><a href="#users">Users</a></li>
<li><a href="#groups">Groups</a></li>
</ul>
</div>
</div>
<!-- --- BEGIN COPYRIGHT BLOCK ---
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; version 2 of the License.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License along
with this program; if not, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
Copyright (C) 2018 Red Hat, Inc.
All rights reserved.
--- END COPYRIGHT BLOCK --- -->
<html>
<head>
<title>Certificate Authority</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link href="/pki/css/patternfly.css" rel="stylesheet" media="screen, print">
<link href="/pki/css/pki-ui.css" rel="stylesheet" type="text/css">
<script src="/pki/js/jquery.js"></script>
<script src="/pki/js/underscore.js"></script>
<script src="/pki/js/backbone.js"></script>
<script src="/pki/js/bootstrap.js"></script>
<script src="/pki/js/patternfly.js"></script>
<script src="/pki/js/pki.js"></script>
<script src="/pki/js/pki-ui.js"></script>
<script src="/pki/js/pki-banner.js"></script>
<script src="/pki/js/pki-account.js"></script>
<script src="/pki/js/pki-group.js"></script>
<script src="/pki/js/pki-user.js"></script>
<script src="/ca/js/cert.js"></script>
<script src="/ca/js/certrequest.js"></script>
<script src="/ca/js/profile.js"></script>
<script>
$(function() {
var content = $("#content");
var router = new Backbone.Router();
router.route("", "home", function() {
new HomePage({
el: content,
url: "/ca/ui/home.html"
}).open();
});
router.route("certs", "certs", function() {
new CertificatesPage({
el: content,
url: "certs.html",
collection: new CertificateCollection()
}).open();
});
router.route("certs/:id", "cert", function(id) {
new CertificatePage({
el: content,
url: "cert.html",
model: new CertificateModel({ id: id })
}).open();
});
router.route("certrequests", "certrequests", function() {
new CertRequestsPage({
el: content,
url: "certrequests.html",
collection: new CertRequestCollection()
}).open();
});
router.route("certrequests/:id", "certrequest", function(id) {
new CertRequestPage({
el: content,
url: "certrequest.html",
model: new CertRequestModel({ id: id })
}).open();
});
router.route("profiles", "profiles", function() {
new ProfilesPage({
el: content,
url: "profiles.html",
collection: new ProfileCollection()
}).open();
});
router.route("profiles/:id", "profile", function(id) {
new ProfilePage({
el: content,
url: "profile.html",
model: new ProfileModel({ id: id })
}).open();
});
router.route("users", "users", function() {
new UsersPage({
el: content,
collection: new UserCollection(null, {
urlRoot: "/ca/rest/admin/users"
}),
url: "/pki/ui/users.html"
}).open();
});
router.route("users/:id", "user", function(id) {
new UserPage({
el: content,
url: "/pki/ui/user.html",
model: new UserModel({ id: id }, {
urlRoot: "/ca/rest/admin/users"
}),
editable: ["fullName", "email"]
}).open();
});
router.route("users/:id/roles", "user-roles", function(id) {
new UserRolesPage({
el: content,
url: "/pki/ui/user-roles.html",
collection: new UserRoleCollection(null, {
userID: id,
urlRoot: "/ca/rest/admin/users/" + id + "/memberships"
})
}).open();
});
router.route("users/:id/certs", "user-certs", function(id) {
new UserCertsPage({
el: content,
url: "/pki/ui/user-certs.html",
collection: new UserCertCollection(null, {
userID: id,
urlRoot: "/ca/rest/admin/users/" + id + "/certs"
})
}).open();
});
router.route("new-user", "new-user", function() {
new UserPage({
el: content,
url: "/pki/ui/user.html",
model: new UserModel(null, {
urlRoot: "/ca/rest/admin/users"
}),
mode: "add",
title: "New User",
editable: ["userID", "fullName", "email"],
parentHash: "#users"
}).open();
});
router.route("groups", "groups", function() {
new GroupsPage({
el: content,
collection: new GroupCollection(null, {
urlRoot: "/ca/rest/admin/groups"
}),
url: "/pki/ui/groups.html"
}).open();
});
router.route("groups/:id", "group", function(id) {
new GroupPage({
el: content,
url: "/pki/ui/group.html",
model: new GroupModel({ id: id }, {
urlRoot: "/ca/rest/admin/groups"
}),
editable: ["description"]
}).open();
});
router.route("new-group", "new-group", function() {
new GroupPage({
el: content,
url: "/pki/ui/group.html",
model: new GroupModel(null, {
urlRoot: "/ca/rest/admin/groups"
}),
mode: "add",
title: "New Group",
editable: ["groupID", "description"],
parentHash: "#groups"
}).open();
});
router.route("logout", "logout", function() {
// destroy server session
account.logout({
success: function() {
// clear browser cache
PKI.logout({
success: function() {
window.location.href = "/ca";
},
error: function() {
alert("Logout not supported by the browser. Please clear Active Logins or close the browser.");
}
});
},
error: function() {
alert("Logout failed. Please close the browser.");
}
});
});
var account = new Account("/ca/rest/account");
account.login({
success: function(data, textStatus, jqXHR) {
var roles = PKI.user.Roles.Role;
var user = $("#navigation [name=account] [name=username]");
user.text(PKI.user.FullName);
var accounts_menu = $("#navigation [name=accounts]");
if (_.contains(roles, "Administrators")) {
accounts_menu.show();
} else {
accounts_menu.hide();
}
Backbone.history.start();
},
error: function(jqXHR, textStatus, errorThrown) {
window.location.href = "/ca";
}
});
});
</script>
</head>
<body>
<nav id="navigation" class="navbar navbar-default navbar-pf" role="navigation">
<div class="navbar-header">
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse-1">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a class="navbar-brand" href="/ca">
<b>Certificate Authority</b>
</a>
</div>
<div class="collapse navbar-collapse navbar-collapse-1">
<ul class="nav navbar-nav navbar-utility">
<!--
<li name="status"><a href="#">Status</a></li>
-->
<li name="account" class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown">
<span class="pficon pficon-user"></span>
<span name="username"></span><b class="caret"></b>
</a>
<ul class="dropdown-menu">
<li name="logout"><a href="#logout">Logout</a></li>
</ul>
</li>
</ul>
<ul class="nav navbar-nav navbar-primary">
<li name="home"><a href="#"><span class="glyphicon glyphicon-home"></span> Home</a></li>
<li name="certs"><a href="#certs">Certificates</a></li>
<li name="certrequests"><a href="#certrequests">Requests</a></li>
<li name="profiles"><a href="#profiles">Profiles</a></li>
<li name="accounts" class="dropdown context" style="display: none;">
<a href="#" class="dropdown-toggle" data-toggle="dropdown">
Accounts
<b class="caret"></b>
</a>
<ul class="dropdown-menu">
<li><a href="#users">Users</a></li>
<li><a href="#groups">Groups</a></li>
</ul>
</li>
</ul>
</div>
</nav>
<div id="content">
</div>
<div id="confirm-dialog" class="modal">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">
<span class="pficon pficon-close"></span>
</button>
<h4 class="modal-title">Confirmation</h4>
</div>
<div class="modal-body">
</div>
<div class="modal-footer">
<button name="ok" class="btn btn-danger">OK</button>
<button name="cancel" class="btn btn-default" data-dismiss="modal">Cancel</button>
</div>
</div>
</div>
</div>
<div id="error-dialog" class="modal">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">
<span class="pficon pficon-close"></span>
</button>
<h4 class="modal-title">Error</h4>
</div>
<div class="modal-body">
<fieldset>
<span name="content"></span>
</fieldset>
</div>
<div class="modal-footer">
<button name="close" class="btn btn-primary">Close</button>
</div>
</div>
</div>
</div>
</body>
</html>
<!-- --- BEGIN COPYRIGHT BLOCK ---
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; version 2 of the License.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License along
with this program; if not, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
Copyright (C) 2018 Red Hat, Inc.
All rights reserved.
--- END COPYRIGHT BLOCK --- -->
<div class="pki-header">
<ol class="breadcrumb">
<li><a href="#">Home</a></li>
<li><a href="#profiles">Profiles</a></li>
<li class="active"><strong><span name="title">Profile ${id}</span></strong></li>
</ol>
<span name="title" class="pki-title">Profile ${id}</span>
</div>
<div name="profile" class="pki-fields">
<fieldset>
<label>ID</label>
<input name="id" readonly="readonly"><br>
<label>Name</label>
<input name="name" size="80" readonly="readonly"><br>
<label>Description</label>
<input name="description" size="80" readonly="readonly"><br>
<label>Enabled</label>
<input name="enabled" readonly="readonly"><br>
<label>Enabled By</label>
<input name="enabledBy" readonly="readonly"><br>
<label>Visible</label>
<input name="visible" readonly="readonly"><br>
<label>Authentication</label>
<input name="authenticatorId" readonly="readonly"><br>
<label>Authorization</label>
<input name="authzAcl" readonly="readonly"><br>
<label>Renewal</label>
<input name="renewal" readonly="readonly"><br>
</fieldset>
</div>
<!-- --- BEGIN COPYRIGHT BLOCK ---
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; version 2 of the License.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License along
with this program; if not, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
Copyright (C) 2018 Red Hat, Inc.
All rights reserved.
--- END COPYRIGHT BLOCK --- -->
<div class="pki-header">
<ol class="breadcrumb">
<li><a href="#">Home</a></li>
<li class="active"><strong>Profiles</strong></li>
</ol>
<span class="pki-title">Profiles</span>
</div>
<table name="profiles">
<thead>
<tr>
<th class="pki-table-actions" colspan="4">
<span name="search">
<input name="search" type="text" placeholder="Search...">
</span>
<span class="pki-table-buttons">
</span>
</th>
</tr>
<tr>
<th class="pki-select-column"><input id="profiles-selectall" type="checkbox"><label for="profiles-selectall">&nbsp;</label></tdh>
<th>ID</th>
<th>Name</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="pki-select-column"><input id="profiles-select" type="checkbox"><label for="profiles-select">&nbsp;</label></td>
<td name="id"><a href="#profiles/${id}">${id}</a></td>
<td name="name">${name}</td>
<td name="description">${description}</td>
</tr>
</tbody>
<tfoot>
<tr>
<th class="pki-table-actions" colspan="4">
<div class="pki-table-info">
Total: <span name="totalEntries">0</span> entries
</div>
<div class="pki-page-controls">
<ul class="pagination">
<li><a href="#" name="first"><span class="i fa fa-angle-double-left"></span></a></li>
<li><a href="#" name="prev"><span class="i fa fa-angle-left"></span></a></li>
</ul>
<span class="pki-page-jump">
<input name="page" type="text" value="1"> of <span name="totalPages">1</span>
</span>
<ul class="pagination">
<li><a href="#" name="next"><span class="i fa fa-angle-right"></span></a></li>
<li><a href="#" name="last"><span class="i fa fa-angle-double-right"></span></a></li>
</ul>
</div>
</th>
</tr>
</tfoot>
</table>
project(pki-ca_java NONE)
# '${JAVA_LIB_INSTALL_DIR}' jars
find_file(JSS_JAR
NAMES
jss4.jar
PATHS
${JAVA_LIB_INSTALL_DIR}
)
find_file(RESTEASY_JAXRS_JAR
NAMES
resteasy-jaxrs.jar
PATHS
${RESTEASY_LIB}
)
find_file(RESTEASY_ATOM_PROVIDER_JAR
NAMES
resteasy-atom-provider.jar
PATHS
${RESTEASY_LIB}
)
# build pki-ca
javac(pki-ca-classes
SOURCES
......@@ -29,7 +7,7 @@ javac(pki-ca-classes
CLASSPATH
${SLF4J_API_JAR}
${COMMONS_CODEC_JAR} ${COMMONS_IO_JAR} ${COMMONS_LANG_JAR}
${JACKSON_CORE_JAR} ${JACKSON_MAPPER_JAR}
${JACKSON2_CORE_JAR} ${JACKSON2_DATABIND_JAR}
${JSS_JAR} ${SYMKEY_JAR}
${LDAPJDK_JAR}
${SERVLET_JAR} ${TOMCAT_CATALINA_JAR}
......
......@@ -143,6 +143,7 @@ import com.netscape.cmscore.dbs.CertificateRepository;
import com.netscape.cmscore.dbs.DBSubsystem;
import com.netscape.cmscore.dbs.ReplicaIDRepository;
import com.netscape.cmscore.ldap.PublisherProcessor;
import com.netscape.cmscore.ldapconn.LdapBoundConnFactory;
import com.netscape.cmscore.listeners.ListenerPlugin;
import com.netscape.cmscore.request.RequestSubsystem;
import com.netscape.cmscore.security.KeyCertUtil;
......@@ -223,7 +224,7 @@ public class CertificateAuthority
/* The static conn factory is initialised by the host authority's
* 'init' method, before any lightweight CAs are instantiated
*/
private static ILdapConnFactory dbFactory = null;
private static ILdapConnFactory dbFactory = new LdapBoundConnFactory("CertificateAuthority");
private static final Map<AuthorityID, ICertificateAuthority> caMap =
Collections.synchronizedSortedMap(new TreeMap<AuthorityID, ICertificateAuthority>());
......@@ -520,7 +521,6 @@ public class CertificateAuthority
mConfig = config;
if (isHostAuthority()) {
dbFactory = CMS.getLdapBoundConnFactory("CertificateAuthority");
dbFactory.init(CMS.getConfigStore().getSubStore("internaldb"));
}
......
......@@ -23,8 +23,8 @@ import java.io.InputStream;
import java.util.Collection;
import java.util.Stack;
import org.codehaus.jackson.JsonNode;
import org.codehaus.jackson.map.ObjectMapper;
import com.fasterxml.jackson.databind.JsonNode;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.netscape.certsrv.apps.CMS;
import com.netscape.certsrv.base.EBaseException;
......@@ -83,8 +83,8 @@ public class ExternalProcessKeyRetriever implements KeyRetriever {
*/
private Result parseResult(InputStream in) throws IOException {
JsonNode root = (new ObjectMapper()).readTree(in);
String cert = root.path("certificate").getTextValue();
byte[] pao = root.path("wrapped_key").getBinaryValue();
String cert = root.path("certificate").textValue();
byte[] pao = root.path("wrapped_key").binaryValue();
if (cert == null)
throw new RuntimeException("missing \"certificate\" field");
if (pao == null)
......
......@@ -27,6 +27,10 @@ import com.netscape.cmscore.selftests.SelfTestSubsystem;
public class CAEngine extends CMSEngine {
public CAEngine() {
super("CA");
}
protected void loadSubsystems() throws EBaseException {
super.loadSubsystems();
......