Commit aebb5950 authored by Łukasz Nowak's avatar Łukasz Nowak

Rebrand Vifib Machine plugin to SlapOS namespace.

parent d7f0a0b2
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="SlapOSMachineAuthenticationPlugin" module="Products.SlapOS.SlapOSMachineAuthenticationPlugin"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>id</string> </key>
<value> <string>slapos_machine</string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string></string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
<dictionary> <dictionary>
<item> <item>
<key> <string>active_sense_method_id</string> </key> <key> <string>active_sense_method_id</string> </key>
<value> <string>Alarm_checkPromiseVifibPAS</string> </value> <value> <string>Alarm_checkPromiseSlapOSPAS</string> </value>
</item> </item>
<item> <item>
<key> <string>alarm_notification_mode</string> </key> <key> <string>alarm_notification_mode</string> </key>
...@@ -30,7 +30,7 @@ ...@@ -30,7 +30,7 @@
</item> </item>
<item> <item>
<key> <string>id</string> </key> <key> <string>id</string> </key>
<value> <string>promise_vifib_pas</string> </value> <value> <string>promise_slapos_pas</string> </value>
</item> </item>
<item> <item>
<key> <string>periodicity_day_frequency</string> </key> <key> <string>periodicity_day_frequency</string> </key>
...@@ -93,11 +93,11 @@ ...@@ -93,11 +93,11 @@
</item> </item>
<item> <item>
<key> <string>solve_method_id</string> </key> <key> <string>solve_method_id</string> </key>
<value> <string>Alarm_fixPromiseVifibPAS</string> </value> <value> <string>Alarm_fixWithActiveSense</string> </value>
</item> </item>
<item> <item>
<key> <string>title</string> </key> <key> <string>title</string> </key>
<value> <string>Pluggable Auth Service Vifib Promise</string> </value> <value> <string>Pluggable Auth Service SlapOS Promise</string> </value>
</item> </item>
</dictionary> </dictionary>
</pickle> </pickle>
......
...@@ -2,19 +2,23 @@ ...@@ -2,19 +2,23 @@
<ZopeData> <ZopeData>
<record id="1" aka="AAAAAAAAAAE="> <record id="1" aka="AAAAAAAAAAE=">
<pickle> <pickle>
<global name="VifibMachineAuthenticationPlugin" module="Products.Vifib.VifibMachineAuthenticationPlugin"/> <global name="Folder" module="OFS.Folder"/>
</pickle> </pickle>
<pickle> <pickle>
<dictionary> <dictionary>
<item>
<key> <string>_objects</string> </key>
<value>
<tuple/>
</value>
</item>
<item> <item>
<key> <string>id</string> </key> <key> <string>id</string> </key>
<value> <string>vifib_machine_authentication</string> </value> <value> <string>slapos_promise</string> </value>
</item> </item>
<item> <item>
<key> <string>title</string> </key> <key> <string>title</string> </key>
<value> <value> <string></string> </value>
<none/>
</value>
</item> </item>
</dictionary> </dictionary>
</pickle> </pickle>
......
...@@ -52,25 +52,22 @@ ...@@ -52,25 +52,22 @@
<key> <string>_body</string> </key> <key> <string>_body</string> </key>
<value> <string>promise_dict = {\n <value> <string>promise_dict = {\n
\'IExtractionPlugin\': [\n \'IExtractionPlugin\': [\n
\'Vifib Machine Authentication Plugin\',\n \'SlapOS Machine Authentication Plugin\',\n
],\n ],\n
\'IAuthenticationPlugin\': [\n \'IAuthenticationPlugin\': [\n
\'Vifib Machine Authentication Plugin\',\n \'SlapOS Machine Authentication Plugin\',\n
\'Vifib Shadow Authentication Plugin\',\n
\'SlapOS Shadow Authentication Plugin\',\n \'SlapOS Shadow Authentication Plugin\',\n
],\n ],\n
\'IGroupsPlugin\': [\n \'IGroupsPlugin\': [\n
\'Vifib Machine Authentication Plugin\',\n \'SlapOS Machine Authentication Plugin\',\n
\'Vifib Shadow Authentication Plugin\',\n
\'SlapOS Shadow Authentication Plugin\',\n \'SlapOS Shadow Authentication Plugin\',\n
],\n ],\n
\'IUserEnumerationPlugin\': [\n \'IUserEnumerationPlugin\': [\n
\'Vifib Machine Authentication Plugin\',\n \'SlapOS Machine Authentication Plugin\',\n
\'Vifib Shadow Authentication Plugin\',\n
\'SlapOS Shadow Authentication Plugin\',\n \'SlapOS Shadow Authentication Plugin\',\n
]\n ]\n
}\n }\n
context.Alarm_checkPromiseVifibPASBase(promise_dict, tag, fixit=fixit, **kw)\n context.Alarm_checkPromiseSlapOSPASBase(promise_dict, tag, fixit=fixit, **kw)\n
</string> </value> </string> </value>
</item> </item>
<item> <item>
...@@ -79,7 +76,7 @@ context.Alarm_checkPromiseVifibPASBase(promise_dict, tag, fixit=fixit, **kw)\n ...@@ -79,7 +76,7 @@ context.Alarm_checkPromiseVifibPASBase(promise_dict, tag, fixit=fixit, **kw)\n
</item> </item>
<item> <item>
<key> <string>id</string> </key> <key> <string>id</string> </key>
<value> <string>Alarm_checkPromiseVifibPAS</string> </value> <value> <string>Alarm_checkPromiseSlapOSPAS</string> </value>
</item> </item>
</dictionary> </dictionary>
</pickle> </pickle>
......
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="PythonScript" module="Products.PythonScripts.PythonScript"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>Script_magic</string> </key>
<value> <int>3</int> </value>
</item>
<item>
<key> <string>_bind_names</string> </key>
<value>
<object>
<klass>
<global name="NameAssignments" module="Shared.DC.Scripts.Bindings"/>
</klass>
<tuple/>
<state>
<dictionary>
<item>
<key> <string>_asgns</string> </key>
<value>
<dictionary>
<item>
<key> <string>name_container</string> </key>
<value> <string>container</string> </value>
</item>
<item>
<key> <string>name_context</string> </key>
<value> <string>context</string> </value>
</item>
<item>
<key> <string>name_m_self</string> </key>
<value> <string>script</string> </value>
</item>
<item>
<key> <string>name_subpath</string> </key>
<value> <string>traverse_subpath</string> </value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</state>
</object>
</value>
</item>
<item>
<key> <string>_body</string> </key>
<value> <string>from Products.CMFActivity.ActiveResult import ActiveResult\n
\n
portal = context.getPortalObject()\n
def mergePASDictDifference(portal, d, fixit):\n
plugins = portal.acl_users.plugins\n
error_list = []\n
plugin_type_info = plugins.listPluginTypeInfo()\n
for plugin, active_list in d.iteritems():\n
plugin_info = [q for q in plugin_type_info if q[\'id\'] == plugin][0]\n
found_list = plugins.listPlugins(plugin_info[\'interface\'])\n
meta_type_list = [q[1].meta_type for q in found_list]\n
for expected in active_list:\n
if expected not in meta_type_list:\n
error = \'Plugin %s missing %s.\' % (plugin, expected)\n
if fixit: \n
existing = [q for q in portal.acl_users.objectValues() if q.meta_type == expected]\n
if len(existing) == 0:\n
error_list.append(\'%s not found\' % expected)\n
else:\n
plugins.activatePlugin(plugin_info[\'interface\'], existing[0].getId())\n
error += \' Fixed.\'\n
error_list.append(error)\n
\n
return error_list\n
\n
pas_difference = mergePASDictDifference(portal, promise_dict, fixit)\n
if len(pas_difference) != 0:\n
if fixit:\n
severity = 0\n
else:\n
severity = 1\n
summary = "PAS not configured as expected"\n
if fixit:\n
summary += \' (fixed)\'\n
detail = "Difference:\\n%s" % (\'\\n\'.join(pas_difference), )\n
else:\n
severity = 0\n
summary = "Nothing to do."\n
detail = ""\n
\n
active_result = ActiveResult()\n
active_result.edit(\n
summary=summary, \n
severity=severity,\n
detail=detail)\n
\n
context.newActiveProcess().postResult(active_result)\n
</string> </value>
</item>
<item>
<key> <string>_params</string> </key>
<value> <string>promise_dict, tag, fixit=False, **kw</string> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>Alarm_checkPromiseSlapOSPASBase</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
...@@ -59,7 +59,7 @@ ...@@ -59,7 +59,7 @@
</item> </item>
<item> <item>
<key> <string>id</string> </key> <key> <string>id</string> </key>
<value> <string>Alarm_fixPromiseVifibPAS</string> </value> <value> <string>Alarm_fixWithActiveSense</string> </value>
</item> </item>
</dictionary> </dictionary>
</pickle> </pickle>
......
115 116
\ No newline at end of file \ No newline at end of file
acl_users/slapos_machine
acl_users/slapos_shadow acl_users/slapos_shadow
computer_module/template_computer computer_module/template_computer
computer_module/template_computer/** computer_module/template_computer/**
hosting_subscription_module/template_hosting_subscription hosting_subscription_module/template_hosting_subscription
person_module/template_member person_module/template_member
person_module/template_member/** person_module/template_member/**
portal_alarms/promise_slapos_pas
portal_alarms/slapos_allocate_instance portal_alarms/slapos_allocate_instance
software_installation_module/template_software_installation software_installation_module/template_software_installation
software_instance_module/template_software_instance software_instance_module/template_software_instance
\ No newline at end of file
slapos_cloud slapos_cloud
\ No newline at end of file slapos_promise
\ No newline at end of file
109 110
\ No newline at end of file \ No newline at end of file
...@@ -3,7 +3,6 @@ acl_users/erp5_google_extraction ...@@ -3,7 +3,6 @@ acl_users/erp5_google_extraction
acl_users/vifib_browser_id_authentication acl_users/vifib_browser_id_authentication
acl_users/vifib_facebook_authentication acl_users/vifib_facebook_authentication
acl_users/vifib_google_authentication acl_users/vifib_google_authentication
acl_users/vifib_machine_authentication
currency_module/EUR currency_module/EUR
document_module/1 document_module/1
notification_message_module/vifib_hosting_hosting_request notification_message_module/vifib_hosting_hosting_request
......
527 528
\ No newline at end of file \ No newline at end of file
...@@ -30,7 +30,7 @@ ...@@ -30,7 +30,7 @@
from Acquisition import Implicit from Acquisition import Implicit
from AccessControl import ClassSecurityInfo, getSecurityManager, Unauthorized from AccessControl import ClassSecurityInfo, getSecurityManager, Unauthorized
from Products.Vifib.VifibMachineAuthenticationPlugin import getUserByLogin from Products.SlapOS.SlapOSMachineAuthenticationPlugin import getUserByLogin
from Products.ERP5Type import Permissions from Products.ERP5Type import Permissions
from ComputedAttribute import ComputedAttribute from ComputedAttribute import ComputedAttribute
from zLOG import LOG, ERROR from zLOG import LOG, ERROR
......
23 24
\ No newline at end of file \ No newline at end of file
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
# programmers who take the whole responsibility of assessing all potential # programmers who take the whole responsibility of assessing all potential
# consequences resulting from its eventual inadequacies and bugs # consequences resulting from its eventual inadequacies and bugs
# End users who are looking for a ready-to-use solution with commercial # End users who are looking for a ready-to-use solution with commercial
# guarantees and support are strongly adviced to contract a Free Software # guarantees and support are strongly advised to contract a Free Software
# Service Company # Service Company
# #
# This program is Free Software; you can redistribute it and/or # This program is Free Software; you can redistribute it and/or
...@@ -51,21 +51,21 @@ from Products.ZSQLCatalog.SQLCatalog import Query, ComplexQuery ...@@ -51,21 +51,21 @@ from Products.ZSQLCatalog.SQLCatalog import Query, ComplexQuery
from Products.ERP5Security.ERP5UserManager import getValidAssignmentList from Products.ERP5Security.ERP5UserManager import getValidAssignmentList
#Form for new plugin in ZMI #Form for new plugin in ZMI
manage_addVifibMachineAuthenticationPluginForm = PageTemplateFile( manage_addSlapOSMachineAuthenticationPluginForm = PageTemplateFile(
'www/Vifib_addVifibMachineAuthenticationPlugin', globals(), 'www/SlapOS_addSlapOSMachineAuthenticationPlugin', globals(),
__name__='manage_addVifibMachineAuthenticationPluginForm') __name__='manage_addSlapOSMachineAuthenticationPluginForm')
def addVifibMachineAuthenticationPlugin(dispatcher, id, title=None, REQUEST=None): def addSlapOSMachineAuthenticationPlugin(dispatcher, id, title=None, REQUEST=None):
""" Add a VifibMachineAuthenticationPlugin to a Pluggable Auth Service. """ """ Add a SlapOSMachineAuthenticationPlugin to a Pluggable Auth Service. """
plugin = VifibMachineAuthenticationPlugin(id, title) plugin = SlapOSMachineAuthenticationPlugin(id, title)
dispatcher._setObject(plugin.getId(), plugin) dispatcher._setObject(plugin.getId(), plugin)
if REQUEST is not None: if REQUEST is not None:
REQUEST['RESPONSE'].redirect( REQUEST['RESPONSE'].redirect(
'%s/manage_workspace' '%s/manage_workspace'
'?manage_tabs_message=' '?manage_tabs_message='
'VifibMachineAuthenticationPlugin+added.' 'SlapOSMachineAuthenticationPlugin+added.'
% dispatcher.absolute_url()) % dispatcher.absolute_url())
@transactional_cached(lambda portal, *args: args) @transactional_cached(lambda portal, *args: args)
...@@ -101,12 +101,12 @@ def getUserByLogin(portal, login): ...@@ -101,12 +101,12 @@ def getUserByLogin(portal, login):
# by default (feature). # by default (feature).
return [x.getObject() for x in result if x['reference'] in login] return [x.getObject() for x in result if x['reference'] in login]
class VifibMachineAuthenticationPlugin(BasePlugin): class SlapOSMachineAuthenticationPlugin(BasePlugin):
""" """
Plugin to authenicate as machines. Plugin to authenicate as machines.
""" """
meta_type = "Vifib Machine Authentication Plugin" meta_type = "SlapOS Machine Authentication Plugin"
security = ClassSecurityInfo() security = ClassSecurityInfo()
def __init__(self, id, title=None): def __init__(self, id, title=None):
...@@ -174,7 +174,7 @@ class VifibMachineAuthenticationPlugin(BasePlugin): ...@@ -174,7 +174,7 @@ class VifibMachineAuthenticationPlugin(BasePlugin):
except ConflictError: except ConflictError:
raise raise
except: except:
LOG('VifibMachineAuthenticationPlugin', PROBLEM, 'getUserByLogin failed', LOG('SlapOSMachineAuthenticationPlugin', PROBLEM, 'getUserByLogin failed',
error=sys.exc_info()) error=sys.exc_info())
# Here we must raise an exception to prevent callers from caching # Here we must raise an exception to prevent callers from caching
# a result of a degraded situation. # a result of a degraded situation.
...@@ -346,17 +346,14 @@ class VifibMachineAuthenticationPlugin(BasePlugin): ...@@ -346,17 +346,14 @@ class VifibMachineAuthenticationPlugin(BasePlugin):
return tuple(user_info) return tuple(user_info)
#List implementation of class #List implementation of class
classImplements(VifibMachineAuthenticationPlugin, classImplements(SlapOSMachineAuthenticationPlugin,
plugins.IAuthenticationPlugin) plugins.IAuthenticationPlugin)
classImplements( VifibMachineAuthenticationPlugin, classImplements( SlapOSMachineAuthenticationPlugin,
plugins.ILoginPasswordHostExtractionPlugin plugins.ILoginPasswordHostExtractionPlugin)
) classImplements( SlapOSMachineAuthenticationPlugin,
classImplements( VifibMachineAuthenticationPlugin, plugins.IGroupsPlugin)
plugins.IGroupsPlugin classImplements( SlapOSMachineAuthenticationPlugin,
) plugins.IUserEnumerationPlugin)
classImplements( VifibMachineAuthenticationPlugin,
plugins.IUserEnumerationPlugin
) InitializeClass(SlapOSMachineAuthenticationPlugin)
InitializeClass(VifibMachineAuthenticationPlugin)
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
############################################################################## ##############################################################################
# #
# Copyright (c) 2012 Vifib SA and Contributors. All Rights Reserved. # Copyright (c) 2012 Nexedi SA and Contributors. All Rights Reserved.
# #
# WARNING: This program as such is intended to be used by professional # WARNING: This program as such is intended to be used by professional
# programmers who take the whole responsibility of assessing all potential # programmers who take the whole responsibility of assessing all potential
...@@ -38,6 +38,7 @@ content_constructors = () ...@@ -38,6 +38,7 @@ content_constructors = ()
portal_tools = () portal_tools = ()
from Products.PluggableAuthService.PluggableAuthService import registerMultiPlugin from Products.PluggableAuthService.PluggableAuthService import registerMultiPlugin
import SlapOSMachineAuthenticationPlugin
import SlapOSShadowAuthenticationPlugin import SlapOSShadowAuthenticationPlugin
def initialize(context): def initialize(context):
...@@ -47,6 +48,14 @@ def initialize(context): ...@@ -47,6 +48,14 @@ def initialize(context):
portal_tools=portal_tools, content_constructors=content_constructors, portal_tools=portal_tools, content_constructors=content_constructors,
content_classes=content_classes) content_classes=content_classes)
context.registerClass( SlapOSMachineAuthenticationPlugin.SlapOSMachineAuthenticationPlugin
, permission=ManageUsers
, constructors=(
SlapOSMachineAuthenticationPlugin.manage_addSlapOSMachineAuthenticationPluginForm,
SlapOSMachineAuthenticationPlugin.addSlapOSMachineAuthenticationPlugin, )
, visibility=None
, icon='www/portal.gif'
)
context.registerClass( SlapOSShadowAuthenticationPlugin.SlapOSShadowAuthenticationPlugin context.registerClass( SlapOSShadowAuthenticationPlugin.SlapOSShadowAuthenticationPlugin
, permission=ManageUsers , permission=ManageUsers
, constructors=( , constructors=(
...@@ -57,4 +66,5 @@ def initialize(context): ...@@ -57,4 +66,5 @@ def initialize(context):
) )
registerMultiPlugin(SlapOSMachineAuthenticationPlugin.SlapOSMachineAuthenticationPlugin.meta_type)
registerMultiPlugin(SlapOSShadowAuthenticationPlugin.SlapOSShadowAuthenticationPlugin.meta_type) registerMultiPlugin(SlapOSShadowAuthenticationPlugin.SlapOSShadowAuthenticationPlugin.meta_type)
<h1 tal:replace="structure here/manage_page_header">Header</h1> <h1 tal:replace="structure here/manage_page_header">Header</h1>
<h2 tal:define="form_title string:Add Vifib Machine Authentication Plugin" <h2 tal:define="form_title string:Add SlapOS Machine Authentication Plugin"
tal:replace="structure here/manage_form_title">Form Title</h2> tal:replace="structure here/manage_form_title">Form Title</h2>
<p class="form-help"> <p class="form-help">
Vifib Machine Authentication Plugin allows to login machines (Computers and SlapOS Machine Authentication Plugin allows to login machines (Computers and
Software Instances) Software Instances)
</p> </p>
<form action="addVifibMachineAuthenticationPlugin" method="post"> <form action="addSlapOSMachineAuthenticationPlugin" method="post">
<table cellspacing="0" cellpadding="2" border="0"> <table cellspacing="0" cellpadding="2" border="0">
<tr> <tr>
<td align="left" valign="top"> <td align="left" valign="top">
......
...@@ -41,7 +41,6 @@ from Tool import SlapTool, VifibRestApiTool ...@@ -41,7 +41,6 @@ from Tool import SlapTool, VifibRestApiTool
portal_tools = ( SlapTool.SlapTool, VifibRestApiTool.VifibRestApiTool) portal_tools = ( SlapTool.SlapTool, VifibRestApiTool.VifibRestApiTool)
from Products.PluggableAuthService.PluggableAuthService import registerMultiPlugin from Products.PluggableAuthService.PluggableAuthService import registerMultiPlugin
import VifibMachineAuthenticationPlugin
import VifibCookieHashExtractionPlugin import VifibCookieHashExtractionPlugin
def initialize(context): def initialize(context):
...@@ -51,15 +50,6 @@ def initialize(context): ...@@ -51,15 +50,6 @@ def initialize(context):
portal_tools=portal_tools, content_constructors=content_constructors, portal_tools=portal_tools, content_constructors=content_constructors,
content_classes=content_classes) content_classes=content_classes)
context.registerClass( VifibMachineAuthenticationPlugin.VifibMachineAuthenticationPlugin
, permission=ManageUsers
, constructors=(
VifibMachineAuthenticationPlugin.manage_addVifibMachineAuthenticationPluginForm,
VifibMachineAuthenticationPlugin.addVifibMachineAuthenticationPlugin, )
, visibility=None
, icon='www/portal.gif'
)
context.registerClass( VifibCookieHashExtractionPlugin.VifibFacebookServerExtractionPlugin context.registerClass( VifibCookieHashExtractionPlugin.VifibFacebookServerExtractionPlugin
, permission=ManageUsers , permission=ManageUsers
, constructors=( , constructors=(
...@@ -88,7 +78,6 @@ def initialize(context): ...@@ -88,7 +78,6 @@ def initialize(context):
) )
registerMultiPlugin(VifibMachineAuthenticationPlugin.VifibMachineAuthenticationPlugin.meta_type)
registerMultiPlugin(VifibCookieHashExtractionPlugin.VifibFacebookServerExtractionPlugin.meta_type) registerMultiPlugin(VifibCookieHashExtractionPlugin.VifibFacebookServerExtractionPlugin.meta_type)
registerMultiPlugin(VifibCookieHashExtractionPlugin.VifibGoogleServerExtractionPlugin.meta_type) registerMultiPlugin(VifibCookieHashExtractionPlugin.VifibGoogleServerExtractionPlugin.meta_type)
registerMultiPlugin(VifibCookieHashExtractionPlugin.VifibBrowserIDExtractionPlugin.meta_type) registerMultiPlugin(VifibCookieHashExtractionPlugin.VifibBrowserIDExtractionPlugin.meta_type)
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