Commit 60e92128 authored by Cédric Le Ninivin's avatar Cédric Le Ninivin Committed by Romain Courteaud

slapos_cloud: Software Instance asJSON include SSL key and certificate

parent 40100246
...@@ -26,6 +26,7 @@ ...@@ -26,6 +26,7 @@
# #
############################################################################## ##############################################################################
from AccessControl import ClassSecurityInfo from AccessControl import ClassSecurityInfo
from App.Common import rfc1123_date
from Products.ERP5Type import Permissions from Products.ERP5Type import Permissions
from erp5.component.document.Item import Item from erp5.component.document.Item import Item
from erp5.component.document.JSONType import JSONType from erp5.component.document.JSONType import JSONType
...@@ -348,8 +349,16 @@ class SoftwareInstance(Item, JSONType): ...@@ -348,8 +349,16 @@ class SoftwareInstance(Item, JSONType):
"sla_parameters": self.getSlaXmlAsDict(), "sla_parameters": self.getSlaXmlAsDict(),
"access_status_message": self.getTextAccessStatus(), "access_status_message": self.getTextAccessStatus(),
"processing_timestamp": parameter_dict.get("timestamp"), "processing_timestamp": parameter_dict.get("timestamp"),
"key": self.getSslKey(),
"certificate": self.getSslCertificate(),
} }
result.update(parameter_dict) result.update(parameter_dict)
self.REQUEST.response.setHeader('Cache-Control',
'private, max-age=0, must-revalidate')
self.REQUEST.response.setHeader('Vary',
'REMOTE_USER')
self.REQUEST.response.setHeader('Last-Modified',
rfc1123_date(self.getModificationDate()))
return json.dumps(result, indent=2) return json.dumps(result, indent=2)
security.declareProtected(Permissions.ModifyPortalContent, 'fromJSONText') security.declareProtected(Permissions.ModifyPortalContent, 'fromJSONText')
......
...@@ -132,6 +132,16 @@ ...@@ -132,6 +132,16 @@
}\n }\n
}\n }\n
},\n },\n
"key": {\n
"title": "X509 Key",\n
"type": "string",\n
"descritpion": "X509 Key used by the instance to authentify itself on master"\n
},\n
"certificate": {\n
"title": "X509 Certificate",\n
"type": "string",\n
"descritpion": "X509 Certificate used by the instance to authentify itself on master"\n
},\n
"sla_parameters": {\n "sla_parameters": {\n
"title": "Target Node Selection Parameters",\n "title": "Target Node Selection Parameters",\n
"type": "object",\n "type": "object",\n
......
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