summaryrefslogtreecommitdiffstats
path: root/base/common/src/com/netscape/cms/servlet/request/KeyRequestService.java
diff options
context:
space:
mode:
authorEndi Sukma Dewata <edewata@redhat.com>2012-10-25 11:52:15 -0500
committerEndi Sukma Dewata <edewata@redhat.com>2012-10-29 10:38:38 -0500
commitc1aa8b2d05cb1873990d1a3e9cf007cca240f135 (patch)
treef12c76eaa1c385a79e40e7b38123360279c05fc0 /base/common/src/com/netscape/cms/servlet/request/KeyRequestService.java
parent748605a324266bb515a3d1124bc55deb3be4df71 (diff)
downloadpki-c1aa8b2d05cb1873990d1a3e9cf007cca240f135.tar.gz
pki-c1aa8b2d05cb1873990d1a3e9cf007cca240f135.tar.xz
pki-c1aa8b2d05cb1873990d1a3e9cf007cca240f135.zip
Enabled authentication for key services.
The web.xml in KRA has been modified to enable the authentication for key and key request services. Some tools have been added to access the services via command-line. Ticket #376
Diffstat (limited to 'base/common/src/com/netscape/cms/servlet/request/KeyRequestService.java')
-rw-r--r--base/common/src/com/netscape/cms/servlet/request/KeyRequestService.java15
1 files changed, 10 insertions, 5 deletions
diff --git a/base/common/src/com/netscape/cms/servlet/request/KeyRequestService.java b/base/common/src/com/netscape/cms/servlet/request/KeyRequestService.java
index 775c0ed28..12f3bb7ee 100644
--- a/base/common/src/com/netscape/cms/servlet/request/KeyRequestService.java
+++ b/base/common/src/com/netscape/cms/servlet/request/KeyRequestService.java
@@ -42,6 +42,11 @@ import com.netscape.cmsutil.ldap.LDAPUtil;
*/
public class KeyRequestService extends PKIService implements KeyRequestResource {
+ public static final int DEFAULT_START = 0;
+ public static final int DEFAULT_PAGESIZE = 20;
+ public static final int DEFAULT_MAXRESULTS = 100;
+ public static final int DEFAULT_MAXTIME = 10;
+
/**
* Used to retrieve key request info for a specific request
*/
@@ -169,17 +174,17 @@ public class KeyRequestService extends PKIService implements KeyRequestResource
* Used to generate list of key requests based on the search parameters
*/
public KeyRequestInfos listRequests(String requestState, String requestType, String clientID,
- RequestId start, int pageSize, int maxResults, int maxTime) {
+ RequestId start, Integer pageSize, Integer maxResults, Integer maxTime) {
// auth and authz
// get ldap filter
String filter = createSearchFilter(requestState, requestType, clientID);
CMS.debug("listRequests: filter is " + filter);
- // get start marker
- if (start == null) {
- start = new RequestId(KeyRequestResource.DEFAULT_START);
- }
+ start = start == null ? new RequestId(KeyRequestService.DEFAULT_START) : start;
+ pageSize = pageSize == null ? DEFAULT_PAGESIZE : pageSize;
+ maxResults = maxResults == null ? DEFAULT_MAXRESULTS : maxResults;
+ maxTime = maxTime == null ? DEFAULT_MAXTIME : maxTime;
KeyRequestDAO reqDAO = new KeyRequestDAO();
KeyRequestInfos requests;