Commit c4348d84 authored by Rafael Monnerat's avatar Rafael Monnerat

slapos_cloud: Drop ERP5 Login from instance and compute node

parent 693c8c5c
<allowed_content_type_list>
<portal_type id="Compute Node">
<item>Certificate Login</item>
<item>ERP5 Login</item>
</portal_type>
<portal_type id="Hosting Subscription Module">
<item>Hosting Subscription</item>
......@@ -14,7 +13,6 @@
</portal_type>
<portal_type id="Software Instance">
<item>Certificate Login</item>
<item>ERP5 Login</item>
</portal_type>
<portal_type id="Software Instance Module">
<item>Slave Instance</item>
......
......@@ -202,6 +202,14 @@ class SlapOSTestCaseMixin(testSlapOSMixin):
login.validate()
return login
def _addCertificateLogin(self, document, **kw):
login = document.newContent(
portal_type="Certificate Login",
reference=document.getReference(),
**kw)
login.validate()
return login
def makePerson(self, new_id=None, index=True, user=True):
if new_id is None:
......
......@@ -502,8 +502,7 @@ class TestSlapOSCloudSlapOSComputeNodeMixin_getCacheComputeNodeInformation(
source_administration_value=getattr(self, "person", None),
)
self.compute_node.validate()
self._addERP5Login(self.compute_node)
self._addCertificateLogin(self.compute_node)
self.tic()
......
......@@ -36,7 +36,7 @@ class TestSlapOSCoreComputePartitionSlapInterfaceWorkflow(SlapOSTestCaseMixin):
)
self.compute_node.validate()
login = self.compute_node.newContent(
portal_type="ERP5 Login",
portal_type="Certificate Login",
reference=self.compute_node.getReference()
)
login.validate()
......
......@@ -6,12 +6,6 @@
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_recorded_property_dict</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value>
</item>
<item>
<key> <string>default_reference</string> </key>
<value> <string>testSlapOSCloudComputePartitionSlapInterfaceWorkflow</string> </value>
......@@ -55,28 +49,13 @@
<item>
<key> <string>workflow_history</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAM=</string> </persistent>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value>
</item>
</dictionary>
</pickle>
</record>
<record id="2" aka="AAAAAAAAAAI=">
<pickle>
<global name="PersistentMapping" module="Persistence.mapping"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>data</string> </key>
<value>
<dictionary/>
</value>
</item>
</dictionary>
</pickle>
</record>
<record id="3" aka="AAAAAAAAAAM=">
<pickle>
<global name="PersistentMapping" module="Persistence.mapping"/>
</pickle>
......@@ -89,7 +68,7 @@
<item>
<key> <string>component_validation_workflow</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAQ=</string> </persistent>
<persistent> <string encoding="base64">AAAAAAAAAAM=</string> </persistent>
</value>
</item>
</dictionary>
......@@ -98,7 +77,7 @@
</dictionary>
</pickle>
</record>
<record id="4" aka="AAAAAAAAAAQ=">
<record id="3" aka="AAAAAAAAAAM=">
<pickle>
<global name="WorkflowHistoryList" module="Products.ERP5Type.Workflow"/>
</pickle>
......
......@@ -59,7 +59,7 @@ class TestSlapOSCoreSlapOSCloudInteractionWorkflow(SlapOSTestCaseMixin):
specialise_value=hs)
if portal_type == "Software Instance":
self._addERP5Login(instance)
self._addCertificateLogin(instance)
self.tic()
def verify_activeSense_call(self):
......@@ -130,7 +130,7 @@ class TestSlapOSCoreSlapOSCloudInteractionWorkflow(SlapOSTestCaseMixin):
portal_type='Compute Node',
title="Compute Node %s for %s" % (self.new_id, self.person_user.getReference()),
reference="TESTCOMP-%s" % self.new_id)
self._addERP5Login(compute_node)
self._addCertificateLogin(compute_node)
installation = self.portal.software_installation_module.newContent(
portal_type='Software Installation',
......@@ -173,7 +173,7 @@ class TestSlapOSCoreSlapOSCloudInteractionWorkflow(SlapOSTestCaseMixin):
portal_type='Compute Node',
title="Compute Node %s for %s" % (new_id, self.person_user.getReference()),
reference="TESTCOMP-%s" % new_id)
self._addERP5Login(compute_node)
self._addCertificateLogin(compute_node)
partition = compute_node.newContent(
portal_type='Compute Partition',
title="Partition Compute Node %s for %s" % (new_id,
......
......@@ -6,12 +6,6 @@
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_recorded_property_dict</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value>
</item>
<item>
<key> <string>default_reference</string> </key>
<value> <string>testSlapOSCloudInteractionWorkflow</string> </value>
......@@ -61,28 +55,13 @@
<item>
<key> <string>workflow_history</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAM=</string> </persistent>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value>
</item>
</dictionary>
</pickle>
</record>
<record id="2" aka="AAAAAAAAAAI=">
<pickle>
<global name="PersistentMapping" module="Persistence.mapping"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>data</string> </key>
<value>
<dictionary/>
</value>
</item>
</dictionary>
</pickle>
</record>
<record id="3" aka="AAAAAAAAAAM=">
<pickle>
<global name="PersistentMapping" module="Persistence.mapping"/>
</pickle>
......@@ -95,7 +74,7 @@
<item>
<key> <string>component_validation_workflow</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAQ=</string> </persistent>
<persistent> <string encoding="base64">AAAAAAAAAAM=</string> </persistent>
</value>
</item>
</dictionary>
......@@ -104,7 +83,7 @@
</dictionary>
</pickle>
</record>
<record id="4" aka="AAAAAAAAAAQ=">
<record id="3" aka="AAAAAAAAAAM=">
<pickle>
<global name="WorkflowHistoryList" module="Products.ERP5Type.Workflow"/>
</pickle>
......
......@@ -117,12 +117,6 @@ class TestSlapOSComputeNodeSecurity(TestSlapOSSecurityMixin):
self._assertUserDoesNotExists(user_id, reference, None)
def test_active_backward_compatibility_with_erp5_login(self):
self.test_active(login_portal_type="ERP5 Login")
def test_inactive_backward_compatibility_with_erp5_login(self):
self.test_inactive(login_portal_type="ERP5 Login")
class TestSlapOSSoftwareInstanceSecurity(TestSlapOSSecurityMixin):
portal_type = 'Software Instance'
def test_active(self, login_portal_type="Certificate Login"):
......@@ -175,12 +169,6 @@ class TestSlapOSSoftwareInstanceSecurity(TestSlapOSSecurityMixin):
self._assertUserDoesNotExists(user_id, reference, None)
def test_active_backward_compatibility_with_erp5_login(self):
self.test_active(login_portal_type="ERP5 Login")
def test_inactive_backward_compatibility_with_erp5_login(self):
self.test_inactive(login_portal_type="ERP5 Login")
class TestSlapOSPersonSecurity(TestSlapOSSecurityMixin):
def test_active(self, login_portal_type="Certificate Login"):
......
......@@ -6,12 +6,6 @@
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_recorded_property_dict</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value>
</item>
<item>
<key> <string>default_reference</string> </key>
<value> <string>testSlapOSCloudSecurityGroup</string> </value>
......@@ -55,28 +49,13 @@
<item>
<key> <string>workflow_history</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAM=</string> </persistent>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value>
</item>
</dictionary>
</pickle>
</record>
<record id="2" aka="AAAAAAAAAAI=">
<pickle>
<global name="PersistentMapping" module="Persistence.mapping"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>data</string> </key>
<value>
<dictionary/>
</value>
</item>
</dictionary>
</pickle>
</record>
<record id="3" aka="AAAAAAAAAAM=">
<pickle>
<global name="PersistentMapping" module="Persistence.mapping"/>
</pickle>
......@@ -89,7 +68,7 @@
<item>
<key> <string>component_validation_workflow</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAQ=</string> </persistent>
<persistent> <string encoding="base64">AAAAAAAAAAM=</string> </persistent>
</value>
</item>
</dictionary>
......@@ -98,7 +77,7 @@
</dictionary>
</pickle>
</record>
<record id="4" aka="AAAAAAAAAAQ=">
<record id="3" aka="AAAAAAAAAAM=">
<pickle>
<global name="WorkflowHistoryList" module="Products.ERP5Type.Workflow"/>
</pickle>
......
......@@ -84,7 +84,7 @@ class TestSlapOSShadowComputeNode(TestSlapOSSecurityMixin):
reference=reference)
compute_node.setUserId(user_id)
compute_node.newContent(portal_type='ERP5 Login',
compute_node.newContent(portal_type='Certificate Login',
reference=reference).validate()
compute_node.validate()
......@@ -125,7 +125,7 @@ class TestSlapOSShadowSoftwareInstance(TestSlapOSSecurityMixin):
instance = self.portal.getDefaultModule(portal_type=self.portal_type)\
.newContent(portal_type=self.portal_type, reference=reference)
instance.setUserId(user_id)
instance.newContent(portal_type='ERP5 Login',
instance.newContent(portal_type='Certificate Login',
reference=reference).validate()
instance.validate()
self.tic()
......
......@@ -6,12 +6,6 @@
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_recorded_property_dict</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value>
</item>
<item>
<key> <string>default_reference</string> </key>
<value> <string>testSlapOSCloudShadow</string> </value>
......@@ -55,28 +49,13 @@
<item>
<key> <string>workflow_history</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAM=</string> </persistent>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value>
</item>
</dictionary>
</pickle>
</record>
<record id="2" aka="AAAAAAAAAAI=">
<pickle>
<global name="PersistentMapping" module="Persistence.mapping"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>data</string> </key>
<value>
<dictionary/>
</value>
</item>
</dictionary>
</pickle>
</record>
<record id="3" aka="AAAAAAAAAAM=">
<pickle>
<global name="PersistentMapping" module="Persistence.mapping"/>
</pickle>
......@@ -89,7 +68,7 @@
<item>
<key> <string>component_validation_workflow</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAQ=</string> </persistent>
<persistent> <string encoding="base64">AAAAAAAAAAM=</string> </persistent>
</value>
</item>
</dictionary>
......@@ -98,7 +77,7 @@
</dictionary>
</pickle>
</record>
<record id="4" aka="AAAAAAAAAAQ=">
<record id="3" aka="AAAAAAAAAAM=">
<pickle>
<global name="WorkflowHistoryList" module="Products.ERP5Type.Workflow"/>
</pickle>
......
Compute Node | Certificate Login
Compute Node | ERP5 Login
Hosting Subscription Module | Hosting Subscription
Instance Tree Module | Instance Tree
Software Installation Module | Software Installation
Software Instance Module | Slave Instance
Software Instance Module | Software Instance
Software Instance | Certificate Login
Software Instance | ERP5 Login
\ No newline at end of file
Software Instance | Certificate Login
\ No newline at end of file
......@@ -108,17 +108,6 @@ class TestSlapOSAuthenticationPolicyL(SlapOSTestCaseMixin):
document=person,
login_portal_type="ERP5 Login")
def test_block_ERP5Login_without_password_on_compute_node(self):
self._test_login_block_if_password_is_set(
document=self._makeComputeNode()[0],
login_portal_type="ERP5 Login"
)
def test_block_ERP5Login_without_password_on_software_instance(self):
self._test_login_block_if_password_is_set(
document=self._makeDummySoftwareInstance(),
login_portal_type="ERP5 Login")
def test_block_CertificateLogin_without_password_on_person(self):
person = self.makePerson(user=0)
person.edit(
......@@ -223,17 +212,6 @@ class TestSlapOSAuthenticationPolicyL(SlapOSTestCaseMixin):
document=person,
login_portal_type="ERP5 Login")
def test_expire_ERP5Login_without_password_on_compute_node(self):
self._test_expire_when_passoword_is_set(
document=self._makeComputeNode()[0],
login_portal_type="ERP5 Login"
)
def test_expire_ERP5Login_without_password_on_software_instance(self):
self._test_expire_when_passoword_is_set(
document=self._makeDummySoftwareInstance(),
login_portal_type="ERP5 Login")
def test_expire_CertificateLogin_without_password_on_person(self):
person = self.makePerson(user=0)
person.edit(
......
......@@ -6,12 +6,6 @@
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_recorded_property_dict</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value>
</item>
<item>
<key> <string>default_reference</string> </key>
<value> <string>testSlapOSAuthenticationPolicy</string> </value>
......@@ -55,28 +49,13 @@
<item>
<key> <string>workflow_history</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAM=</string> </persistent>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value>
</item>
</dictionary>
</pickle>
</record>
<record id="2" aka="AAAAAAAAAAI=">
<pickle>
<global name="PersistentMapping" module="Persistence.mapping"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>data</string> </key>
<value>
<dictionary/>
</value>
</item>
</dictionary>
</pickle>
</record>
<record id="3" aka="AAAAAAAAAAM=">
<pickle>
<global name="PersistentMapping" module="Persistence.mapping"/>
</pickle>
......@@ -89,7 +68,7 @@
<item>
<key> <string>component_validation_workflow</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAQ=</string> </persistent>
<persistent> <string encoding="base64">AAAAAAAAAAM=</string> </persistent>
</value>
</item>
</dictionary>
......@@ -98,7 +77,7 @@
</dictionary>
</pickle>
</record>
<record id="4" aka="AAAAAAAAAAQ=">
<record id="3" aka="AAAAAAAAAAM=">
<pickle>
<global name="WorkflowHistoryList" module="Products.ERP5Type.Workflow"/>
</pickle>
......
......@@ -699,28 +699,6 @@ class TestERP5Login(TestSlapOSGroupRoleSecurityMixin):
self.assertRoles(login, person.getUserId(), ['Assignee'])
self.assertRoles(login, self.user_id, ['Owner'])
def test_ComputeNodeCanAccessLoginDocument(self):
compute_node = self.portal.compute_node_module.newContent(portal_type='Compute Node')
login = compute_node.newContent(portal_type=self.login_portal_type)
compute_node.updateLocalRolesOnSecurityGroups()
login.updateLocalRolesOnSecurityGroups()
self.assertSecurityGroup(login,
[self.user_id, compute_node.getUserId()], False)
self.assertRoles(login, compute_node.getUserId(), ['Assignee'])
self.assertRoles(login, self.user_id, ['Owner'])
def test_SoftwareInstanceCanAccessLoginDocument(self):
software_instance = self.portal.software_instance_module.newContent(portal_type='Software Instance')
login = software_instance.newContent(portal_type=self.login_portal_type)
software_instance.updateLocalRolesOnSecurityGroups()
login.updateLocalRolesOnSecurityGroups()
self.assertSecurityGroup(login,
[self.user_id, software_instance.getUserId()], False)
self.assertRoles(login, software_instance.getUserId(), ['Assignee'])
self.assertRoles(login, self.user_id, ['Owner'])
class TestCertificateLogin(TestERP5Login):
login_portal_type = "Certificate Login"
......@@ -744,25 +722,34 @@ class TestCertificateLogin(TestERP5Login):
self.assertRoles(login, self.user_id, ['Owner'])
self.assertRoles(login, compute_node.getUserId(), ['Assignor'])
class TestGoogleLogin(TestERP5Login):
login_portal_type = "Google Login"
def test_ComputeNodeCanAccessLoginDocument(self):
# Not supported to add google login inside Compute Node
pass
compute_node = self.portal.compute_node_module.newContent(portal_type='Compute Node')
login = compute_node.newContent(portal_type=self.login_portal_type)
compute_node.updateLocalRolesOnSecurityGroups()
login.updateLocalRolesOnSecurityGroups()
self.assertSecurityGroup(login,
[self.user_id, compute_node.getUserId()], False)
self.assertRoles(login, compute_node.getUserId(), ['Assignee'])
self.assertRoles(login, self.user_id, ['Owner'])
def test_SoftwareInstanceCanAccessLoginDocument(self):
# Not supported to add google login inside SoftwareInstance
pass
software_instance = self.portal.software_instance_module.newContent(portal_type='Software Instance')
login = software_instance.newContent(portal_type=self.login_portal_type)
software_instance.updateLocalRolesOnSecurityGroups()
login.updateLocalRolesOnSecurityGroups()
self.assertSecurityGroup(login,
[self.user_id, software_instance.getUserId()], False)
self.assertRoles(login, software_instance.getUserId(), ['Assignee'])
self.assertRoles(login, self.user_id, ['Owner'])
class TestGoogleLogin(TestERP5Login):
login_portal_type = "Google Login"
class TestFacebookLogin(TestERP5Login):
login_portal_type = "Facebook Login"
def test_ComputeNodeCanAccessLoginDocument(self):
# Not supported to add google login inside Compute Node
pass
def test_SoftwareInstanceCanAccessLoginDocument(self):
# Not supported to add google login inside SoftwareInstance
pass
class TestPersonModule(TestSlapOSGroupRoleSecurityMixin):
def test(self):
......
......@@ -57,8 +57,7 @@ class TestSlapOSSlapToolMixin(SlapOSTestCaseMixin):
source_administration_value=getattr(self, "person", None),
)
self.compute_node.validate()
self._addERP5Login(self.compute_node)
self._addCertificateLogin(self.compute_node)
self.tic()
......
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