[Zope] (Script) Python needs xmlrpclib

alan runyan runyaga@thisbox.com
Fri, 22 Jun 2001 09:00:33 -0500


There are magical things beyond my control happening - security mechanisms.
As this is a security issue and there is no way (that I know) around it --
its that much more frustrating.  99% of sane people, in development - would
like to turn MOST security restrictions off.  Is there a way to tell
Guard.py, "down boy!" ??

dealing with BEA Weblogic (which relies on Java's security model) -- there
are the same issues.  but you can basically tell the Java Security model
allow_what_god_shouldnt_be_able_to_do.

please someone shed light on this.  it seems no one I run across understands
how to do this (use External Method, is the response I get) or anything
about the new security model of ZOPE. -- which *appears* to be
understandable and sane.  NOTE: External Methods (which are what most people
use, I would bet) have 0 security mechanism.  that is why they are so
powerful.  ZOPE preaches TTW.  (Script) Python needs to be able to have as
much power as External Methods, IMO.

~runyaga

trying to get (Script) Python to use xmlrpclib

here is my (Script) Python, getXML:
from Products.ExposedModules.xmlrpclib import Server
s=Server('http://betty.userland.com')
n=s.examples.getStateName(41)
return n

here is my lib/python/Products/ExposedModules/__init__.py:
from Products.PythonScripts.Utility import allow_module, allow_class
from AccessControl import ModuleSecurityInfo, ClassSecurityInfo
from Globals import InitializeClass
import xmlrpclib

ModuleSecurityInfo('Products').declarePublic('ExposedModules')
ModuleSecurityInfo('Products.ExposedModules').declarePublic('xmlrpclib')
ModuleSecurityInfo('Products.ExposedModule.xmlrpclib').declarePublic('Server
')

allow_module('Products.ExposedModules.xmlrpclib')
security.declarePublic('Server')

from xmlrpclib import Server

allow_class(Server)
#security.apply(globals())

here is my bloddy traceback:
Error Type: Fault
Error Value: <Fault 7: 'Can\'t evaluate the expression because the name
"_guarded_reads" hasn\'t been defined.'>

Traceback (innermost last):
  File
/home/runyaga/ZopeInstallation/Zope_software_home/lib/python/ZPublisher/Publ
ish.py, line 223, in publish_module
  File
/home/runyaga/ZopeInstallation/Zope_software_home/lib/python/ZPublisher/Publ
ish.py, line 187, in publish
  File
/home/runyaga/ZopeInstallation/Zope_software_home/lib/python/Zope/__init__.p
y, line 226, in zpublisher_exception_hook
    (Object: ApplicationDefaultPermissions)
  File
/home/runyaga/ZopeInstallation/Zope_software_home/lib/python/ZPublisher/Publ
ish.py, line 171, in publish
  File
/home/runyaga/ZopeInstallation/Zope_software_home/lib/python/ZPublisher/mapp
ly.py, line 160, in mapply
    (Object: getXML)
  File
/home/runyaga/ZopeInstallation/Zope_software_home/lib/python/ZPublisher/Publ
ish.py, line 112, in call_object
    (Object: getXML)
  File
/home/runyaga/ZopeInstallation/Zope_software_home/lib/python/Shared/DC/Scrip
ts/Bindings.py, line 324, in __call__
    (Object: getXML)
  File
/home/runyaga/ZopeInstallation/Zope_software_home/lib/python/Shared/DC/Scrip
ts/Bindings.py, line 354, in _bindAndExec
    (Object: getXML)
  File
/home/runyaga/ZopeInstallation/Zope_software_home/lib/python/Products/Python
Scripts/PythonScript.py, line 359, in _exec
    (Object: getXML)
    (Info: ({'script': <PythonScript instance at 89a3a10>, 'context':
<Application instance at 8a07f00>, 'container': <Application instance at
8a07f00>, 'traverse_subpath': []}, (), {}, None))
  File Script (Python), line 3, in getXML
    (Object: guard)
  File
/home/runyaga/ZopeInstallation/Zope_software_home/lib/python/RestrictedPytho
n/Guards.py, line 115, in guard
  File
/home/runyaga/ZopeInstallation/Zope_software_home/lib/python/Products/Expose
dModules/xmlrpclib.py, line 547, in __call__
  File
/home/runyaga/ZopeInstallation/Zope_software_home/lib/python/Products/Expose
dModules/xmlrpclib.py, line 630, in __request
  File
/home/runyaga/ZopeInstallation/Zope_software_home/lib/python/Products/Expose
dModules/xmlrpclib.py, line 585, in request
  File
/home/runyaga/ZopeInstallation/Zope_software_home/lib/python/Products/Expose
dModules/xmlrpclib.py, line 601, in parse_response
  File
/home/runyaga/ZopeInstallation/Zope_software_home/lib/python/Products/Expose
dModules/xmlrpclib.py, line 371, in close
Fault: (see above)