source: TI05-delivery/trunk/doc/epydoc/private/delivery.server.AuthHandler-class.html @ 1284

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

Documentation update

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