[Zope3-checkins] CVS: Zope3/src/zope/app/interfaces/publisher - http.py:1.1
Stephan Richter
srichter@cosmos.phy.tufts.edu
Thu, 31 Jul 2003 23:21:40 -0400
Update of /cvs-repository/Zope3/src/zope/app/interfaces/publisher
In directory cvs.zope.org:/tmp/cvs-serv1850/interfaces/publisher
Added Files:
http.py
Log Message:
After I finally got sick of not having a Login/Logout button, I implemented
it. The code is simple and straight forward. If someone has a different
authentication method (cookies or via URL), then s/he just needs to register
their own ling.html and logout.html following pretty much what I have done
for HTTP Authentication.
Only one thing is left: How in the world do you want to write tests for
this functionality?!? As sson as I hear a good suggestion I will add a test
or two for this code.
=== Added File Zope3/src/zope/app/interfaces/publisher/http.py ===
##############################################################################
#
# Copyright (c) 2002 Zope Corporation and Contributors.
# All Rights Reserved.
#
# This software is subject to the provisions of the Zope Public License,
# Version 2.0 (ZPL). A copy of the ZPL should accompany this distribution.
# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
# WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
# FOR A PARTICULAR PURPOSE.
#
##############################################################################
"""Zope's HTTP-specific Publisher interfaces.
$Id: http.py,v 1.1 2003/08/01 03:21:35 srichter Exp $
"""
from zope.publisher.interfaces.http import IHTTPView
class ILogin(IHTTPView):
"""A simple login interface."""
def login():
"""Login the user.
This method should generate some sort of UI to request the username
and password.
"""
class ILogout(IHTTPView):
"""A simple logout interface."""
def logout():
"""Logout the user.
This can mean different things. For example, when dealing with
cookie-based logins (browser), then it simply means deleting the
cookie. If we deal with HTTP Authentication, we just want to send
another challenge.
"""