diff options
| author | Barry Warsaw | 2010-02-25 17:24:27 -0500 |
|---|---|---|
| committer | Barry Warsaw | 2010-02-25 17:24:27 -0500 |
| commit | 3fd1dc135b0ad865e48b9038546ba1e1452b5897 (patch) | |
| tree | fccdd56f5b007c66282ff73b504dabea21b41c32 /src | |
| parent | e6f2ab3cbc90733ec0d12b833437f2f3a8cec4ed (diff) | |
| download | mailman-3fd1dc135b0ad865e48b9038546ba1e1452b5897.tar.gz mailman-3fd1dc135b0ad865e48b9038546ba1e1452b5897.tar.zst mailman-3fd1dc135b0ad865e48b9038546ba1e1452b5897.zip | |
Diffstat (limited to 'src')
| -rw-r--r-- | src/mailman/config/configure.zcml | 2 | ||||
| -rw-r--r-- | src/mailman/rest/configure.zcml | 116 | ||||
| -rw-r--r-- | src/mailman/rest/initialize.py | 35 | ||||
| -rw-r--r-- | src/mailman/rest/publication.py | 65 | ||||
| -rw-r--r-- | src/mailman/rest/security.py | 37 |
5 files changed, 0 insertions, 255 deletions
diff --git a/src/mailman/config/configure.zcml b/src/mailman/config/configure.zcml index e0188633b..a7d12e7a2 100644 --- a/src/mailman/config/configure.zcml +++ b/src/mailman/config/configure.zcml @@ -4,8 +4,6 @@ <include package="zope.component" file="meta.zcml"/> - <!-- include package="mailman.rest" file="configure.zcml"/ --> - <adapter for="mailman.interfaces.mailinglist.IMailingList" provides="mailman.interfaces.autorespond.IAutoResponseSet" diff --git a/src/mailman/rest/configure.zcml b/src/mailman/rest/configure.zcml deleted file mode 100644 index 6e8b3727d..000000000 --- a/src/mailman/rest/configure.zcml +++ /dev/null @@ -1,116 +0,0 @@ -<!-- -*- xml -*- --> -<configure - xmlns="http://namespaces.zope.org/zope" - xmlns:webservice="http://namespaces.canonical.com/webservice"> - - <include package="zope.component" file="meta.zcml"/> - <include package="zope.security" file="meta.zcml"/> - <include package="lazr.restful.example.wsgi" file="site.zcml"/> - - <webservice:register module="mailman.interfaces.domain" /> - <webservice:register module="mailman.interfaces.listmanager" /> - <webservice:register module="mailman.interfaces.membership" /> - <webservice:register module="mailman.interfaces.rest" /> - <webservice:register module="mailman.interfaces.system" /> - - <!-- XXX 2010-01-01 This can't be included without breaking - zope.configuration - <webservice:register module="mailman.interfaces.member" /> - --> - - <adapter factory="zope.publisher.http.HTTPCharsets" /> - - <adapter - for="mailman.interfaces.domain.IDomain - lazr.restful.simple.Request" - provides="zope.traversing.browser.interfaces.IAbsoluteURL" - factory="mailman.rest.urls.DomainURLMapper" - /> - - <adapter - for="zope.interface.Interface - lazr.restful.simple.Request" - provides="zope.traversing.browser.interfaces.IAbsoluteURL" - factory="mailman.rest.urls.FallbackURLMapper" - /> - - <!-- - XXX 2010-02-16 barry Why is this necessary? Without this, lazr.restful - does not adapt the ISystem to the FallbackURLMapper. I don't know why - that happens because the above generic mapper should do the trick. - --> - - <adapter - for="mailman.interfaces.system.ISystem - lazr.restful.simple.Request" - provides="zope.traversing.browser.interfaces.IAbsoluteURL" - factory="mailman.rest.urls.FallbackURLMapper" - /> - <adapter - for="mailman.interfaces.mailinglist.IMailingList - lazr.restful.simple.Request" - provides="zope.traversing.browser.interfaces.IAbsoluteURL" - factory="mailman.rest.urls.MailingListURLMapper" - /> - - <adapter - for="mailman.interfaces.member.IMember - lazr.restful.simple.Request" - provides="zope.traversing.browser.interfaces.IAbsoluteURL" - factory="mailman.rest.urls.MemberURLMapper" - /> - - <adapter - for="zope.publisher.interfaces.NotFound - lazr.restful.simple.Request" - provides="zope.interface.Interface" - factory="lazr.restful.error.NotFoundView" - name="index.html" - /> - - <!-- - XXX 2009-12-28 Why are these necessary? NotAMemberError and - AlreadySubscribedError are decorated with @error_status(400) so they - /should/ already be adaptable to WebServiceExceptionView. For some reason - though rest/membership.txt fails without these. - --> - - <adapter - for="mailman.interfaces.member.NotAMemberError - lazr.restful.simple.Request" - provides="zope.interface.Interface" - factory="lazr.restful.error.WebServiceExceptionView" - name="index.html" - /> - - <adapter - for="mailman.interfaces.member.AlreadySubscribedError - lazr.restful.simple.Request" - provides="zope.interface.Interface" - factory="lazr.restful.error.WebServiceExceptionView" - name="index.html" - /> - - <!-- Utilities --> - - <utility - factory="mailman.rest.webservice.AdminWebServiceRootResource" - provides="lazr.restful.interfaces.IServiceRootResource" - /> - - <utility - factory="mailman.rest.configuration.AdminWebServiceConfiguration" - provides="lazr.restful.interfaces.IWebServiceConfiguration" - /> - - <utility - factory="mailman.rest.adapters.DomainCollection" - provides="mailman.interfaces.domain.IDomainCollection" - /> - - <utility - factory="mailman.rest.adapters.SubscriptionService" - provides="mailman.interfaces.membership.ISubscriptionService" - /> - -</configure> diff --git a/src/mailman/rest/initialize.py b/src/mailman/rest/initialize.py deleted file mode 100644 index 953ba4248..000000000 --- a/src/mailman/rest/initialize.py +++ /dev/null @@ -1,35 +0,0 @@ -# Copyright (C) 2009-2010 by the Free Software Foundation, Inc. -# -# This file is part of GNU Mailman. -# -# GNU Mailman is free software: you can redistribute it and/or modify it under -# the terms of the GNU General Public License as published by the Free -# Software Foundation, either version 3 of the License, or (at your option) -# any later version. -# -# GNU Mailman is distributed in the hope that it will be useful, but WITHOUT -# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for -# more details. -# -# You should have received a copy of the GNU General Public License along with -# GNU Mailman. If not, see <http://www.gnu.org/licenses/>. - -"""Admin web service initialization.""" - -from __future__ import absolute_import, unicode_literals - -__metaclass__ = type -__all__ = [ - 'initialize', - ] - - -from zope.configuration import xmlconfig - - - -def initialize(): - """Initialize the admin web service and the Zope Component Architecture.""" - import mailman.rest - xmlconfig.file('configure.zcml', mailman.rest) diff --git a/src/mailman/rest/publication.py b/src/mailman/rest/publication.py deleted file mode 100644 index becca8fa6..000000000 --- a/src/mailman/rest/publication.py +++ /dev/null @@ -1,65 +0,0 @@ -# Copyright (C) 2009-2010 by the Free Software Foundation, Inc. -# -# This file is part of GNU Mailman. -# -# GNU Mailman is free software: you can redistribute it and/or modify it under -# the terms of the GNU General Public License as published by the Free -# Software Foundation, either version 3 of the License, or (at your option) -# any later version. -# -# GNU Mailman is distributed in the hope that it will be useful, but WITHOUT -# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for -# more details. -# -# You should have received a copy of the GNU General Public License along with -# GNU Mailman. If not, see <http://www.gnu.org/licenses/>. - -"""Publication hooks.""" - -from __future__ import absolute_import, unicode_literals - -__metaclass__ = type -__all__ = [ - 'AdminWebServicePublication', - ] - - -import logging - -from lazr.restful.simple import Publication -from zope.publisher.interfaces import NotFound - -from mailman.config import config -from mailman.interfaces.rest import IResolvePathNames - -log = logging.getLogger('mailman.http') - - - -class AdminWebServicePublication(Publication): - """Very simple implementation of `IPublication`.""" - - def traverseName(self, request, ob, name): - """See `IPublication`.""" - missing = object() - resolver = IResolvePathNames(ob, missing) - if resolver is missing: - raise NotFound(ob, name, request) - next_step = resolver.get(name) - if next_step is None: - raise NotFound(ob, name, request) - return next_step - - def handleException(self, application, request, exc_info, - retry_allowed=True): - """See `IPublication`.""" - # Any in-progress transaction must be aborted. - config.db.abort() - super(AdminWebServicePublication, self).handleException( - application, request, exc_info, retry_allowed) - - def endRequest(self, request, ob): - """Ends the interaction.""" - config.db.commit() - super(AdminWebServicePublication, self).endRequest(request, ob) diff --git a/src/mailman/rest/security.py b/src/mailman/rest/security.py deleted file mode 100644 index d33a6554c..000000000 --- a/src/mailman/rest/security.py +++ /dev/null @@ -1,37 +0,0 @@ -# Copyright (C) 2009-2010 by the Free Software Foundation, Inc. -# -# This file is part of GNU Mailman. -# -# GNU Mailman is free software: you can redistribute it and/or modify it under -# the terms of the GNU General Public License as published by the Free -# Software Foundation, either version 3 of the License, or (at your option) -# any later version. -# -# GNU Mailman is distributed in the hope that it will be useful, but WITHOUT -# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for -# more details. -# -# You should have received a copy of the GNU General Public License along with -# GNU Mailman. If not, see <http://www.gnu.org/licenses/>. - -"""Default security policy for the admin web service.""" - -from __future__ import absolute_import, unicode_literals - -__metaclass__ = type -__all__ = [ - 'AdminWebServiceSecurityPolicy', - ] - - -from zope.security.simplepolicies import PermissiveSecurityPolicy - - - -class AdminWebServiceSecurityPolicy(PermissiveSecurityPolicy): - """A very basic wide-open security policy.""" - - def checkPermission(self, permission, obj): - """By default, allow all access!""" - return True |
