source: TI05-delivery/trunk/doc/epydoc/public/delivery.server.AuthHandler-class.html @ 1187

Subversion URL: http://proj.badc.rl.ac.uk/svn/ndg/TI05-delivery/trunk/doc/epydoc/public/delivery.server.AuthHandler-class.html@1187
Revision 1187, 10.7 KB checked in by spascoe, 13 years ago (diff)

Auto-generated documentation included for the python-server interface.

Some file clean up prior to alpha. Fixed some confusion between authentication
and authorisation in the API.

The embedded client test case is disabled because it doesn't work :-(.

Line 
1<?xml version="1.0" encoding="iso-8859-1"?>
2<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
3          "DTD/xhtml1-transitional.dtd">
4<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
5<head>
6  <title>delivery.server.AuthHandler</title>
7  <link rel="stylesheet" href="epydoc.css" type="text/css"></link>
8</head>
9<body bgcolor="white" text="black" link="blue" vlink="#204080"
10      alink="#204080">
11
12<!-- =========== START OF NAVBAR =========== -->
13<table class="navbar" border="0" width="100%" cellpadding="0" bgcolor="#a0c0ff" cellspacing="0">
14  <tr valign="center">
15    <th class="navbar">&nbsp;&nbsp;&nbsp;<a class="navbar" href="delivery-module.html">Home</a>&nbsp;&nbsp;&nbsp;</th>
16    <th class="navbar">&nbsp;&nbsp;&nbsp;<a class="navbar" href="trees.html">Trees</a>&nbsp;&nbsp;&nbsp;</th>
17    <th class="navbar">&nbsp;&nbsp;&nbsp;<a class="navbar" href="indices.html">Index</a>&nbsp;&nbsp;&nbsp;</th>
18    <th class="navbar">&nbsp;&nbsp;&nbsp;<a class="navbar" href="help.html">Help</a>&nbsp;&nbsp;&nbsp;</th>
19    <th class="navbar" width="100%"></th>
20  </tr>
21</table>
22<table width="100%" cellpadding="0" cellspacing="0">
23  <tr valign="top">
24    <td width="100%">
25      <font size="-1"><b class="breadcrumbs">
26        <a href="delivery-module.html">Package&nbsp;delivery</a> ::
27        <a href="delivery.server-module.html">Module&nbsp;server</a> ::
28        Class&nbsp;AuthHandler
29      </b></font></br>
30    </td>
31    <td><table cellpadding="0" cellspacing="0">
32      <tr><td align="right"><font size="-2">[<a href="../private/delivery.server.AuthHandler-class.html">show&nbsp;private</a>&nbsp;|&nbsp;hide&nbsp;private]</font></td></tr>
33      <tr><td align="right"><font size="-2">[<a href="frames.html"target="_top">frames</a>&nbsp;|&nbsp;<a href="delivery.server.AuthHandler-class.html" target="_top">no&nbsp;frames</a>]</font></td></tr>
34    </table></td>
35</tr></table>
36
37<!-- =========== START OF CLASS DESCRIPTION =========== -->
38<h2 class="class">Type AuthHandler</h2>
39
40<pre class="base-tree">
41<a href="__builtin__.object-class.html"><code>object</code></a> --+
42         |
43        <b>AuthHandler</b>
44</pre><br />
45
46<dl><dt><b>Known Subclasses:</b></dt>
47<dd>
48    <a href="delivery.server.BasicClientAuthHandler-class.html"><code>BasicClientAuthHandler</code></a></dd></dl>
49
50<hr/>
51
52Abstract base class for implementing authentication.
53
54Subclasses should implement the authorise() method to authenticate clients connecting to
55the server.  An AuthHandler object is passed to start() when initialising the server.<hr/>
56
57
58<!-- =========== START OF METHOD SUMMARY =========== -->
59<table class="summary" border="1" cellpadding="3" cellspacing="0" width="100%" bgcolor="white">
60<tr bgcolor="#70b0f0" class="summary">
61  <th colspan="2">Method Summary</th></tr>
62<tr><td align="right" valign="top" width="15%"><font size="-1">&nbsp;</font></td>
63  <td><code><span class="summary-sig"><a href="delivery.server.AuthHandler-class.html#authenticate" class="summary-sig-name"><code>authenticate</code></a>(<span class=summary-sig-arg>self</span>)</span></code>
64<br />
65Authenticate a connection.</td></tr>
66<tr><td align="right" valign="top" width="15%"><font size="-1">&nbsp;</font></td>
67  <td><code><span class="summary-sig"><a href="delivery.server.AuthHandler-class.html#recv" class="summary-sig-name"><code>recv</code></a>(<span class=summary-sig-arg>self</span>)</span></code>
68<br />
69Receive a message from the client during authorisation.</td></tr>
70<tr><td align="right" valign="top" width="15%"><font size="-1">&nbsp;</font></td>
71  <td><code><span class="summary-sig"><a href="delivery.server.AuthHandler-class.html#send" class="summary-sig-name"><code>send</code></a>(<span class=summary-sig-arg>self</span>,
72          <span class=summary-sig-arg>buffer</span>)</span></code>
73<br />
74Send a message to the client during authorisation.</td></tr>
75<tr bgcolor="#e8f0f8" class="group">
76  <th colspan="2">&nbsp;&nbsp;&nbsp;&nbsp;Inherited from object</th></tr>
77<tr><td align="right" valign="top" width="15%"><font size="-1">&nbsp;</font></td>
78  <td><code><span class="summary-sig"><a href="__builtin__.object-class.html#__init__" class="summary-sig-name"><code>__init__</code></a>(<span class="summary-sig-vararg">...</span>)</span></code>
79<br />
80x.__init__(...) initializes x; see x.__class__.__doc__ for signature...</td></tr>
81<tr><td align="right" valign="top" width="15%"><font size="-1">&nbsp;</font></td>
82  <td><code><span class="summary-sig"><a href="__builtin__.object-class.html#__delattr__" class="summary-sig-name"><code>__delattr__</code></a>(<span class="summary-sig-vararg">...</span>)</span></code>
83<br />
84x.__delattr__('name') <==> del x.name...</td></tr>
85<tr><td align="right" valign="top" width="15%"><font size="-1">&nbsp;</font></td>
86  <td><code><span class="summary-sig"><a href="__builtin__.object-class.html#__getattribute__" class="summary-sig-name"><code>__getattribute__</code></a>(<span class="summary-sig-vararg">...</span>)</span></code>
87<br />
88x.__getattribute__('name') <==> x.name...</td></tr>
89<tr><td align="right" valign="top" width="15%"><font size="-1">&nbsp;</font></td>
90  <td><code><span class="summary-sig"><a href="__builtin__.object-class.html#__hash__" class="summary-sig-name"><code>__hash__</code></a>(<span class=summary-sig-arg>x</span>)</span></code>
91<br />
92x.__hash__() <==> hash(x)...</td></tr>
93<tr><td align="right" valign="top" width="15%"><font size="-1">&nbsp;</font></td>
94  <td><code><span class="summary-sig"><a href="__builtin__.object-class.html#__new__" class="summary-sig-name"><code>__new__</code></a>(<span class=summary-sig-arg>T</span>,
95          <span class=summary-sig-arg>S</span>,
96          <span class="summary-sig-vararg">...</span>)</span></code>
97<br />
98T.__new__(S, ...) -> a new object with type S, a subtype of T...</td></tr>
99<tr><td align="right" valign="top" width="15%"><font size="-1">&nbsp;</font></td>
100  <td><code><span class="summary-sig"><a href="__builtin__.object-class.html#__reduce__" class="summary-sig-name"><code>__reduce__</code></a>(<span class="summary-sig-vararg">...</span>)</span></code>
101<br />
102helper for pickle...</td></tr>
103<tr><td align="right" valign="top" width="15%"><font size="-1">&nbsp;</font></td>
104  <td><code><span class="summary-sig"><a href="__builtin__.object-class.html#__reduce_ex__" class="summary-sig-name"><code>__reduce_ex__</code></a>(<span class="summary-sig-vararg">...</span>)</span></code>
105<br />
106helper for pickle...</td></tr>
107<tr><td align="right" valign="top" width="15%"><font size="-1">&nbsp;</font></td>
108  <td><code><span class="summary-sig"><a href="__builtin__.object-class.html#__repr__" class="summary-sig-name"><code>__repr__</code></a>(<span class=summary-sig-arg>x</span>)</span></code>
109<br />
110x.__repr__() <==> repr(x)...</td></tr>
111<tr><td align="right" valign="top" width="15%"><font size="-1">&nbsp;</font></td>
112  <td><code><span class="summary-sig"><a href="__builtin__.object-class.html#__setattr__" class="summary-sig-name"><code>__setattr__</code></a>(<span class="summary-sig-vararg">...</span>)</span></code>
113<br />
114x.__setattr__('name', value) <==> x.name = value...</td></tr>
115<tr><td align="right" valign="top" width="15%"><font size="-1">&nbsp;</font></td>
116  <td><code><span class="summary-sig"><a href="__builtin__.object-class.html#__str__" class="summary-sig-name"><code>__str__</code></a>(<span class=summary-sig-arg>x</span>)</span></code>
117<br />
118x.__str__() <==> str(x)...</td></tr>
119</table><br />
120
121
122<!-- =========== START OF METHOD DETAILS =========== -->
123<table class="details" border="1" cellpadding="3" cellspacing="0" width="100%" bgcolor="white">
124<tr bgcolor="#70b0f0" class="details">
125  <th colspan="2">Method Details</th></tr>
126</table>
127
128<a name="authenticate"></a>
129<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td>
130  <h3><span class="sig"><span class="sig-name">authenticate</span>(<span class=sig-arg>self</span>)</span>
131  </h3>
132Authenticate a connection.
133
134This function should be overridden in subclasses to implement authentication using
135the method calls self.send() and send.recv().  It is called by the bbftp server process
136created using the start() function.
137  <dl><dt></dt><dd>
138    <dl><dt><b>Returns:</b></dt>
139      <dd>
140an AuthzHandler instance if authentication succeeds.  Any false value is considered
141    an authorisation failure.
142      </dd>
143    </dl>
144    <dl><dt><b>Raises:</b></dt>
145      <dd><code><b>AuthorisationFailure</b></code> -
146the preferred way of signaling authorisation failure to
147    the bbftp server process.    </dl>
148<p><b>Note:</b> because the server process forks on each connection, calls to authorise() will
149    see the state of the python interpreter as it was when start() was called.
150</p>
151
152  </dd></dl>
153</td></tr></table>
154
155<a name="recv"></a>
156<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td>
157  <h3><span class="sig"><span class="sig-name">recv</span>(<span class=sig-arg>self</span>)</span>
158  </h3>
159Receive a message from the client during authorisation.
160
161This method must only be used from within self.authorise() which has been called
162from the bbftp server process started by start().
163  <dl><dt></dt><dd>
164    <dl><dt><b>Returns:</b></dt>
165      <dd>
166a string containing the message received.      </dd>
167    </dl>
168  </dd></dl>
169</td></tr></table>
170
171<a name="send"></a>
172<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td>
173  <h3><span class="sig"><span class="sig-name">send</span>(<span class=sig-arg>self</span>,
174          <span class=sig-arg>buffer</span>)</span>
175  </h3>
176Send a message to the client during authorisation.
177
178This method must only be used from within self.authorise() which has been called
179from the bbftp server process started by start().
180  <dl><dt></dt><dd>
181    <dl><dt><b>Parameters:</b></dt>
182      <dd><code><b>buffer</b></code> -
183 a string containing the message to send.
184      </dd>
185    </dl>
186  </dd></dl>
187</td></tr></table>
188<br />
189
190
191<!-- =========== START OF NAVBAR =========== -->
192<table class="navbar" border="0" width="100%" cellpadding="0" bgcolor="#a0c0ff" cellspacing="0">
193  <tr valign="center">
194    <th class="navbar">&nbsp;&nbsp;&nbsp;<a class="navbar" href="delivery-module.html">Home</a>&nbsp;&nbsp;&nbsp;</th>
195    <th class="navbar">&nbsp;&nbsp;&nbsp;<a class="navbar" href="trees.html">Trees</a>&nbsp;&nbsp;&nbsp;</th>
196    <th class="navbar">&nbsp;&nbsp;&nbsp;<a class="navbar" href="indices.html">Index</a>&nbsp;&nbsp;&nbsp;</th>
197    <th class="navbar">&nbsp;&nbsp;&nbsp;<a class="navbar" href="help.html">Help</a>&nbsp;&nbsp;&nbsp;</th>
198    <th class="navbar" width="100%"></th>
199  </tr>
200</table>
201
202<table border="0" cellpadding="0" cellspacing="0" width="100%">
203  <tr>
204    <td align="left"><font size="-2">Generated by Epydoc 2.1 on Thu Jun 15 10:05:48 2006</font></td>
205    <td align="right"><a href="http://epydoc.sourceforge.net"
206                      ><font size="-2">http://epydoc.sf.net</font></a></td>
207  </tr>
208</table>
209</body>
210</html>
Note: See TracBrowser for help on using the repository browser.