summaryrefslogtreecommitdiffstats
path: root/base
diff options
context:
space:
mode:
authorEndi S. Dewata <edewata@redhat.com>2016-02-06 00:49:51 +0100
committerEndi S. Dewata <edewata@redhat.com>2016-02-08 20:38:51 +0100
commit7356540cc68c41c0f13b0f11794a79ac57a37d04 (patch)
treea7d8e0be8e66570b0fbb0fe8a4466ceb0aece45f /base
parentc4f904f78c5916534eb4e464d20596f159ff567d (diff)
downloadpki-7356540cc68c41c0f13b0f11794a79ac57a37d04.tar.gz
pki-7356540cc68c41c0f13b0f11794a79ac57a37d04.tar.xz
pki-7356540cc68c41c0f13b0f11794a79ac57a37d04.zip
Fixed token modify operation.
The TPS UI and CLI have been modified to accept only user ID and policy attributes when modifying a token. https://fedorahosted.org/pki/ticket/1687
Diffstat (limited to 'base')
-rw-r--r--base/java-tools/src/com/netscape/cmstools/tps/token/TokenModifyCLI.java30
-rw-r--r--base/tps/shared/webapps/tps/ui/index.html2
-rw-r--r--base/tps/src/org/dogtagpki/server/tps/rest/TokenService.java30
3 files changed, 1 insertions, 61 deletions
diff --git a/base/java-tools/src/com/netscape/cmstools/tps/token/TokenModifyCLI.java b/base/java-tools/src/com/netscape/cmstools/tps/token/TokenModifyCLI.java
index 071d15000..a5eac68d2 100644
--- a/base/java-tools/src/com/netscape/cmstools/tps/token/TokenModifyCLI.java
+++ b/base/java-tools/src/com/netscape/cmstools/tps/token/TokenModifyCLI.java
@@ -51,18 +51,6 @@ public class TokenModifyCLI extends CLI {
option.setArgName("User ID");
options.addOption(option);
- option = new Option(null, "type", true, "Type");
- option.setArgName("Type");
- options.addOption(option);
-
- option = new Option(null, "applet", true, "Applet ID");
- option.setArgName("Applet ID");
- options.addOption(option);
-
- option = new Option(null, "key-info", true, "Key info");
- option.setArgName("Key info");
- options.addOption(option);
-
option = new Option(null, "policy", true, "Policy");
option.setArgName("Policy");
options.addOption(option);
@@ -111,24 +99,6 @@ public class TokenModifyCLI extends CLI {
modify = true;
}
- String type = cmd.getOptionValue("type");
- if (type != null) {
- tokenData.setType(type);
- modify = true;
- }
-
- String appletID = cmd.getOptionValue("applet");
- if (appletID != null) {
- tokenData.setAppletID(appletID);
- modify = true;
- }
-
- String keyInfo = cmd.getOptionValue("key-info");
- if (keyInfo != null) {
- tokenData.setKeyInfo(keyInfo);
- modify = true;
- }
-
String policy = cmd.getOptionValue("policy");
if (policy != null) {
tokenData.setPolicy(policy);
diff --git a/base/tps/shared/webapps/tps/ui/index.html b/base/tps/shared/webapps/tps/ui/index.html
index 2354e8d1c..8080a125c 100644
--- a/base/tps/shared/webapps/tps/ui/index.html
+++ b/base/tps/shared/webapps/tps/ui/index.html
@@ -303,7 +303,7 @@ $(function() {
el: content,
url: "token.html",
model: new TokenModel({ id: id }),
- editable: ["userID", "type", "appletID", "keyInfo", "policy"]
+ editable: ["userID", "policy"]
}).open();
});
diff --git a/base/tps/src/org/dogtagpki/server/tps/rest/TokenService.java b/base/tps/src/org/dogtagpki/server/tps/rest/TokenService.java
index cb660f3b1..1a447a73e 100644
--- a/base/tps/src/org/dogtagpki/server/tps/rest/TokenService.java
+++ b/base/tps/src/org/dogtagpki/server/tps/rest/TokenService.java
@@ -480,36 +480,6 @@ public class TokenService extends PKIService implements TokenResource {
}
}
- // update type if specified
- String type = tokenData.getType();
- if (type != null) {
- if (type.equals("")) { // remove value if empty
- tokenRecord.setType(null);
- } else { // otherwise replace value
- tokenRecord.setType(type);
- }
- }
-
- // update applet ID if specified
- String appletID = tokenData.getAppletID();
- if (appletID != null) {
- if (appletID.equals("")) { // remove value if empty
- tokenRecord.setAppletID(null);
- } else { // otherwise replace value
- tokenRecord.setAppletID(appletID);
- }
- }
-
- // update key info if specified
- String keyInfo = tokenData.getKeyInfo();
- if (keyInfo != null) {
- if (keyInfo.equals("")) { // remove value if empty
- tokenRecord.setKeyInfo(null);
- } else { // otherwise replace value
- tokenRecord.setKeyInfo(keyInfo);
- }
- }
-
// update policy if specified
String policy = tokenData.getPolicy();
if (policy != null) {