summaryrefslogtreecommitdiffstats
path: root/base/tps/shared
diff options
context:
space:
mode:
authorEndi S. Dewata <edewata@redhat.com>2016-05-10 19:23:15 +0200
committerEndi S. Dewata <edewata@redhat.com>2016-05-13 16:49:51 +0200
commitb932140728e34eb6f986646690a69d494c341ff7 (patch)
tree141bd68b9ea73b7521add87e3f9f5e50251c62c2 /base/tps/shared
parentad0422d07cf0303d33f01868e79911dd84e754f5 (diff)
downloadpki-b932140728e34eb6f986646690a69d494c341ff7.tar.gz
pki-b932140728e34eb6f986646690a69d494c341ff7.tar.xz
pki-b932140728e34eb6f986646690a69d494c341ff7.zip
Added warning message for token reuse.
The TPS UI has been modified to show a warning message about removing the certificates and keys from the token when marking it for reuse. https://fedorahosted.org/pki/ticket/2287
Diffstat (limited to 'base/tps/shared')
-rw-r--r--base/tps/shared/webapps/tps/js/token.js30
-rw-r--r--base/tps/shared/webapps/tps/ui/token.html1
-rw-r--r--base/tps/shared/webapps/tps/ui/tokens.html1
3 files changed, 32 insertions, 0 deletions
diff --git a/base/tps/shared/webapps/tps/js/token.js b/base/tps/shared/webapps/tps/js/token.js
index b5c3e9544..5c7bc0ca7 100644
--- a/base/tps/shared/webapps/tps/js/token.js
+++ b/base/tps/shared/webapps/tps/js/token.js
@@ -31,6 +31,10 @@ var TokenStatus = {
TERMINATED : "Terminated"
};
+var TOKEN_REUSE_MESSAGE = "When reusing a token that was previously " +
+ "enrolled, out of security concerns, make sure the certificate and " +
+ "key objects are removed from the token.";
+
var TokenModel = Model.extend({
urlRoot: "/tps/rest/tokens",
parseResponse: function(response) {
@@ -210,6 +214,19 @@ var TokenPage = EntryPage.extend({
dialog.close();
});
+ var orig_status = dialog.entry["status"].name;
+ var status_field = dialog.$("select[name=status]");
+ var warning_area = dialog.$(".pki-warning");
+
+ status_field.change(function() {
+ var status = status_field.val();
+ if (orig_status == "TERMINATED" && status == "UNFORMATTED") {
+ warning_area.text(TOKEN_REUSE_MESSAGE);
+ } else {
+ warning_area.empty();
+ }
+ });
+
dialog.open();
});
@@ -333,6 +350,19 @@ var TokenTableItem = TableItem.extend({
dialog.close();
});
+ var orig_status = dialog.entry["status"].name;
+ var status_field = dialog.$("select[name=status]");
+ var warning_area = dialog.$(".pki-warning");
+
+ status_field.change(function() {
+ var status = status_field.val();
+ if (orig_status == "TERMINATED" && status == "UNFORMATTED") {
+ warning_area.text(TOKEN_REUSE_MESSAGE);
+ } else {
+ warning_area.empty();
+ }
+ });
+
dialog.open();
}
});
diff --git a/base/tps/shared/webapps/tps/ui/token.html b/base/tps/shared/webapps/tps/ui/token.html
index bc4b01d22..458fb724b 100644
--- a/base/tps/shared/webapps/tps/ui/token.html
+++ b/base/tps/shared/webapps/tps/ui/token.html
@@ -81,6 +81,7 @@
<select name="status">
</select><br>
</fieldset>
+ <span class="pki-warning"></span>
</div>
<div class="modal-footer">
<button name="save" class="btn btn-primary">Save</button>
diff --git a/base/tps/shared/webapps/tps/ui/tokens.html b/base/tps/shared/webapps/tps/ui/tokens.html
index b085c0b06..c2f62270c 100644
--- a/base/tps/shared/webapps/tps/ui/tokens.html
+++ b/base/tps/shared/webapps/tps/ui/tokens.html
@@ -120,6 +120,7 @@
<select name="status">
</select><br>
</fieldset>
+ <span class="pki-warning"></span>
</div>
<div class="modal-footer">
<button name="save" class="btn btn-primary">Save</button>