Commit 7b7b712f authored by Rafael Monnerat's avatar Rafael Monnerat

slapos_jio: Add support for multiple certificate for a given user

    This drops certificate revocation, it only requires to invalidate the Certificate Login to make login invalid.
parent cf57decd
......@@ -45,6 +45,8 @@ url_list = [
"gadget_erp5_page_slap_facebook_login_view.html",
"gadget_erp5_page_slap_google_login_view.html",
"gadget_erp5_page_slap_erp5_login_view.html",
"gadget_erp5_page_slap_certificate_login_view.html",
"gadget_erp5_page_slap_certificate_login_view.js",
"gadget_erp5_page_slap_google_login_view.js",
"gadget_erp5_page_slap_facebook_login_view.js",
"gadget_erp5_page_slap_erp5_login_view.js",
......
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="ActionInformation" module="Products.CMFCore.ActionInformation"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>action</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value>
</item>
<item>
<key> <string>categories</string> </key>
<value>
<tuple>
<string>action_type/object_jio_view</string>
</tuple>
</value>
</item>
<item>
<key> <string>category</string> </key>
<value> <string>object_jio_view</string> </value>
</item>
<item>
<key> <string>condition</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>description</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>icon</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>slaposjs_view</string> </value>
</item>
<item>
<key> <string>permissions</string> </key>
<value>
<tuple>
<string>View</string>
</tuple>
</value>
</item>
<item>
<key> <string>priority</string> </key>
<value> <float>1.0</float> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>View</string> </value>
</item>
<item>
<key> <string>visible</string> </key>
<value> <int>1</int> </value>
</item>
</dictionary>
</pickle>
</record>
<record id="2" aka="AAAAAAAAAAI=">
<pickle>
<global name="Expression" module="Products.CMFCore.Expression"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>text</string> </key>
<value> <string>string:${object_url}/Login_viewAsHateoas</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<!DOCTYPE html>
<html>
<!--
data-i18n=Data updated.
data-i18n=Reference
data-i18n=Info
-->
<head>
<meta http-equiv="Content-type" content="text/html; charset=utf-8" />
<meta name="viewport" content="width=device-width, user-scalable=no" />
<title>Certificate Login</title>
<!-- renderjs -->
<script src="rsvp.js" type="text/javascript"></script>
<script src="renderjs.js" type="text/javascript"></script>
<!-- custom script -->
<script src="gadget_erp5_page_slap_certificate_login_view.js" type="text/javascript"></script>
</head>
<body>
<form class="save_form ui-body-c" novalidate>
<button type="submit" class="ui-btn ui-btn-b ui-btn-inline
ui-icon-edit ui-btn-icon-right ui-screen-hidden"></button>
<div data-gadget-url="gadget_erp5_form.html"
data-gadget-scope="form_view"
data-gadget-sandbox="public">
</div>
</form>
</body>
</html>
/*global window, rJS, RSVP, jIO, Blob */
/*jslint nomen: true, indent: 2, maxerr: 3 */
(function (window, rJS, RSVP) {
"use strict";
rJS(window)
/////////////////////////////////////////////////////////////////
// Acquired methods
/////////////////////////////////////////////////////////////////
.declareAcquiredMethod("updateHeader", "updateHeader")
.declareAcquiredMethod("updatePanel", "updatePanel")
.declareAcquiredMethod("getUrlParameter", "getUrlParameter")
.declareAcquiredMethod("getUrlFor", "getUrlFor")
.declareAcquiredMethod("getSetting", "getSetting")
.declareAcquiredMethod("updateDocument", "updateDocument")
.declareAcquiredMethod("jio_getAttachment", "jio_getAttachment")
.declareAcquiredMethod("jio_putAttachment", "jio_putAttachment")
.declareAcquiredMethod("notifySubmitting", "notifySubmitting")
.declareAcquiredMethod("notifySubmitted", 'notifySubmitted')
.declareAcquiredMethod("jio_allDocs", "jio_allDocs")
.declareAcquiredMethod("getTranslationList", "getTranslationList")
/////////////////////////////////////////////////////////////////
// declared methods
/////////////////////////////////////////////////////////////////
.declareMethod("render", function (options) {
return this.changeState({
jio_key: options.jio_key,
doc: options.doc,
editable: 1
});
})
.onEvent('submit', function () {
var gadget = this;
return gadget.notifySubmitting()
.push(function () {
return gadget.getDeclaredGadget('form_view');
})
.push(function (form_gadget) {
return form_gadget.getContent();
})
.push(function (content) {
return gadget.updateDocument(content);
})
.push(function () {
return gadget.notifySubmitted({message: gadget.message_translation, status: 'success'});
});
})
.declareMethod("triggerSubmit", function () {
return this.element.querySelector('button[type="submit"]').click();
})
.onStateChange(function () {
var gadget = this,
page_title_translation,
translation_list = [
"Data updated.",
"Reference",
"Certificate Login:"
];
return new RSVP.Queue()
.push(function () {
return RSVP.all([
gadget.getDeclaredGadget('form_view'),
gadget.getSetting("hateoas_url"),
gadget.getTranslationList(translation_list)
]);
})
.push(function (result) {
gadget.message_translation = result[2][0];
page_title_translation = result[2][2];
return result[0].render({
erp5_document: {
"_embedded": {"_view": {
"my_reference": {
"description": "",
"title": result[2][1],
"default": gadget.state.doc.reference,
"css_class": "",
"required": 1,
"editable": 0,
"key": "reference",
"hidden": 0,
"type": "StringField"
}
}},
"_links": {
"type": {
// form_list display portal_type in header
name: ""
}
}
},
form_definition: {
group_list: [[
"left",
[["my_reference"]]
]]
}
});
})
.push(function () {
return gadget.updatePanel({
jio_key: "person_module"
});
})
.push(function () {
return RSVP.all([
gadget.getUrlFor({command: 'history_previous'}),
gadget.getUrlFor({command: "change", options: {page: "slap_invalidate_login"}})
]);
})
.push(function (url_list) {
var header_dict = {
selection_url: url_list[0],
page_title: page_title_translation + " " + gadget.state.doc.reference,
delete_url: url_list[1]
};
return gadget.updateHeader(header_dict);
});
});
}(window, rJS, RSVP));
\ No newline at end of file
......@@ -11,8 +11,6 @@
.declareAcquiredMethod("updatePanel", "updatePanel")
.declareAcquiredMethod("getSetting", "getSetting")
.declareAcquiredMethod("getUrlFor", "getUrlFor")
.declareAcquiredMethod("redirect", "redirect")
.declareAcquiredMethod("jio_post", "jio_post")
.declareAcquiredMethod("jio_getAttachment", "jio_getAttachment")
.declareAcquiredMethod("notifySubmitting", "notifySubmitting")
.declareAcquiredMethod("notifySubmitted", 'notifySubmitted')
......@@ -149,9 +147,12 @@
.push(function (url_list) {
var header_dict = {
page_title: page_title_translation,
submit_action: true,
selection_url: url_list[0]
};
if (options.key === undefined) {
header_dict.submit_action = true;
}
return gadget.updateHeader(header_dict);
});
});
......
......@@ -283,7 +283,7 @@
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>986.45437.22132.61764</string> </value>
<value> <string>1010.19575.46252.59357</string> </value>
</item>
<item>
<key> <string>state</string> </key>
......@@ -303,7 +303,7 @@
</tuple>
<state>
<tuple>
<float>1602259006.04</float>
<float>1691436974.71</float>
<string>UTC</string>
</tuple>
</state>
......
......@@ -197,11 +197,11 @@
"key": "slap_person_login_listbox",
"lines": 20,
"list_method": "portal_catalog",
"query": "urn:jio:allDocs?query=%28portal_type%3A%28%22" +
"ERP5 Login" + "%22%20OR%20%22" +
"Google Login" + "%22%20OR%20%22" +
"Facebook Login" + "%22%29%20AND%20" +
"validation_state%3Avalidated%29",
"query": "urn:jio:allDocs?query=portal_type%3A%28%22ERP5 Login%22%20" +
"OR%20%22Certificate Login%22%20" +
"OR%20%22Google Login%22%20" +
"OR%20%22Facebook Login%22%29%20" +
"AND%20validation_state%3Avalidated",
"portal_type": [],
"search_column_list": column_list,
"sort_column_list": column_list,
......@@ -314,8 +314,6 @@
})
.push(function (setting_list) {
return RSVP.all([
gadget.getUrlFor({command: "change", options: {editable: true}}),
gadget.getUrlFor({command: "change", options: {jio_key: setting_list[0], page: "slap_person_revoke_certificate"}}),
gadget.getUrlFor({command: "change", options: {jio_key: setting_list[0], page: "slap_person_request_certificate"}}),
gadget.getUrlFor({command: "change", options: {jio_key: setting_list[0], page: "slap_person_get_token"}}),
gadget.getUrlFor({command: "change", options: {jio_key: setting_list[0], page: "slap_person_add_erp5_login"}}),
......@@ -329,18 +327,14 @@
var header_dict = {
page_title: gadget.account_translation + " : " + gadget.state.doc.first_name + " " + gadget.state.doc.last_name,
save_action: true,
request_certificate_url: result[2],
revoke_certificate_url: result[1],
token_url: result[3],
add_login_url: result[4],
add_organisation_url: result[5],
selection_url: result[6]
request_certificate_url: result[0],
token_url: result[1],
add_login_url: result[2],
add_organisation_url: result[3],
selection_url: result[4]
};
if (gadget.state.doc.contract_relative_url) {
header_dict.contract_url = result[7];
}
if (!gadget.state.editable) {
header_dict.edit_content = result[0];
header_dict.contract_url = result[6];
}
return gadget.updateHeader(header_dict);
});
......
......@@ -247,7 +247,7 @@
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>1001.59425.29682.52855</string> </value>
<value> <string>1010.19458.9837.34030</string> </value>
</item>
<item>
<key> <string>state</string> </key>
......@@ -267,7 +267,7 @@
</tuple>
<state>
<tuple>
<float>1659068534.69</float>
<float>1691430088.29</float>
<string>UTC</string>
</tuple>
</state>
......
Accounting Transaction Module | slaposjs_view
Category | slaposjs_view
Certificate Login | slaposjs_view
Cloud Contract | slaposjs_view
Compute Node Module | slaposjs_view
Compute Node | slaposjs_view
......
......@@ -38,6 +38,8 @@ web_page_module/rjs_gadget_erp5_page_slap_all_invoice_list_html
web_page_module/rjs_gadget_erp5_page_slap_all_invoice_list_js
web_page_module/rjs_gadget_erp5_page_slap_all_ticket_list_html
web_page_module/rjs_gadget_erp5_page_slap_all_ticket_list_js
web_page_module/rjs_gadget_erp5_page_slap_certificate_login_view_html
web_page_module/rjs_gadget_erp5_page_slap_certificate_login_view_js
web_page_module/rjs_gadget_erp5_page_slap_close_ticket_html
web_page_module/rjs_gadget_erp5_page_slap_close_ticket_js
web_page_module/rjs_gadget_erp5_page_slap_compute_node_get_token_html
......
......@@ -38,6 +38,8 @@ web_page_module/rjs_gadget_erp5_page_slap_all_invoice_list_html
web_page_module/rjs_gadget_erp5_page_slap_all_invoice_list_js
web_page_module/rjs_gadget_erp5_page_slap_all_ticket_list_html
web_page_module/rjs_gadget_erp5_page_slap_all_ticket_list_js
web_page_module/rjs_gadget_erp5_page_slap_certificate_login_view_html
web_page_module/rjs_gadget_erp5_page_slap_certificate_login_view_js
web_page_module/rjs_gadget_erp5_page_slap_close_ticket_html
web_page_module/rjs_gadget_erp5_page_slap_close_ticket_js
web_page_module/rjs_gadget_erp5_page_slap_compute_node_get_token_html
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment