Files
Hippolyzer/docs/html/modules/login.html
2009-04-27 22:48:01 +00:00

177 lines
8.6 KiB
HTML

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>login &mdash; Pyogp v0.1 documentation</title>
<link rel="stylesheet" href="../_static/sphinxdoc.css" type="text/css" />
<link rel="stylesheet" href="../_static/pygments.css" type="text/css" />
<script type="text/javascript">
var DOCUMENTATION_OPTIONS = {
URL_ROOT: '../',
VERSION: '0.1',
COLLAPSE_MODINDEX: false,
FILE_SUFFIX: '.html',
HAS_SOURCE: true
};
</script>
<script type="text/javascript" src="../_static/jquery.js"></script>
<script type="text/javascript" src="../_static/doctools.js"></script>
<link rel="top" title="Pyogp v0.1 documentation" href="../index.html" />
<link rel="up" title="Modules" href="../modules.html" />
<link rel="next" title="message" href="message.html" />
<link rel="prev" title="llsd_sender" href="llsd_sender.html" />
</head>
<body>
<div class="related">
<h3>Navigation</h3>
<ul>
<li class="right" style="margin-right: 10px">
<a href="../genindex.html" title="General Index"
accesskey="I">index</a></li>
<li class="right" >
<a href="../modindex.html" title="Global Module Index"
accesskey="M">modules</a> |</li>
<li class="right" >
<a href="message.html" title="message"
accesskey="N">next</a> |</li>
<li class="right" >
<a href="llsd_sender.html" title="llsd_sender"
accesskey="P">previous</a> |</li>
<li><a href="../index.html">Pyogp v0.1 documentation</a> &raquo;</li>
<li><a href="../modules.html" accesskey="U">Modules</a> &raquo;</li>
</ul>
</div>
<div class="sphinxsidebar">
<div class="sphinxsidebarwrapper">
<h4>Previous topic</h4>
<p class="topless"><a href="llsd_sender.html"
title="previous chapter"><tt class="docutils literal docutils literal docutils literal"><span class="pre">llsd_sender</span></tt></a></p>
<h4>Next topic</h4>
<p class="topless"><a href="message.html"
title="next chapter"><tt class="docutils literal"><span class="pre">message</span></tt></a></p>
<h3>This Page</h3>
<ul class="this-page-menu">
<li><a href="../_sources/modules/login.txt"
rel="nofollow">Show Source</a></li>
</ul>
<div id="searchbox" style="display: none">
<h3>Quick search</h3>
<form class="search" action="../search.html" method="get">
<input type="text" name="q" size="18" />
<input type="submit" value="Go" />
<input type="hidden" name="check_keywords" value="yes" />
<input type="hidden" name="area" value="default" />
</form>
<p class="searchtip" style="font-size: 90%">
Enter search terms or a module, class or function name.
</p>
</div>
<script type="text/javascript">$('#searchbox').show(0);</script>
</div>
</div>
<div class="document">
<div class="documentwrapper">
<div class="bodywrapper">
<div class="body">
<div class="section" id="module-pyogp.lib.base.login">
<h1><tt class="xref docutils literal"><span class="pre">login</span></tt><a class="headerlink" href="#module-pyogp.lib.base.login" title="Permalink to this headline"></a></h1>
<dl class="class">
<dt id="pyogp.lib.base.login.OGPLoginParams">
<em class="property">
class </em><tt class="descclassname">pyogp.lib.base.login.</tt><tt class="descname">OGPLoginParams</tt><big>(</big><em>firstname</em>, <em>lastname</em>, <em>password</em><big>)</big><a class="headerlink" href="#pyogp.lib.base.login.OGPLoginParams" title="Permalink to this definition"></a></dt>
<dd><p>an OGP plain password credential</p>
<p>initialize this credential</p>
<dl class="method">
<dt id="pyogp.lib.base.login.OGPLoginParams.serialize">
<tt class="descname">serialize</tt><big>(</big><big>)</big><a class="headerlink" href="#pyogp.lib.base.login.OGPLoginParams.serialize" title="Permalink to this definition"></a></dt>
<dd>return a dictionary of login params</dd></dl>
</dd></dl>
<dl class="class">
<dt id="pyogp.lib.base.login.Login">
<em class="property">
class </em><tt class="descclassname">pyogp.lib.base.login.</tt><tt class="descname">Login</tt><big>(</big><em>settings=None</em>, <em>handler=None</em><big>)</big><a class="headerlink" href="#pyogp.lib.base.login.Login" title="Permalink to this definition"></a></dt>
<dd><p>logs into a login endpoint</p>
<dl class="docutils">
<dt>There are 2 cases here: &#8216;legacy&#8217; login and &#8216;OGP&#8217; login.</dt>
<dd>Legacy = standard Second Life/OpenSim login
OGP = Open Grid Protocol enabled grid, where one logs into an agent domain</dd>
</dl>
<p>Example (legacy oriented):</p>
<p>The login type is determined by parsing the login uri
&#8216;legacy&#8217; = login.cgi
&#8216;ogp&#8217; = auth.cgi</p>
<p>Initialize the login class
&gt;&gt;&gt; login = Login()</p>
<p>Setup some login parameters.
&gt;&gt;&gt; login_params = LegacyLoginParams(&#8216;firstname&#8217;, &#8216;lastname&#8217;, &#8216;password&#8217;)
&gt;&gt;&gt; login_params = login_params.serialize()</p>
<p>login stores &amp; returns the response from the loginuri (in our example a mock response)
&gt;&gt;&gt; login.login(&#8216;<a class="reference external" href="http://localhost:12345/login.cgi">http://localhost:12345/login.cgi</a>&#8216;, login_params, &#8216;region&#8217;)
{&#8216;login&#8217;: &#8216;true&#8217;, &#8216;seed_capability&#8217;: &#8216;<a class="reference external" href="http://127.0.0.1:12345/seed_cap">http://127.0.0.1:12345/seed_cap</a>&#8216;}</p>
<div class="highlight-python"><div class="highlight"><pre><span class="gp">&gt;&gt;&gt; </span><span class="n">login</span><span class="o">.</span><span class="n">response</span><span class="p">[</span><span class="s">&#39;login&#39;</span><span class="p">]</span>
<span class="go">true</span>
</pre></div>
</div>
<p>Sample implementations: examples/sample_login.py
Tests: tests/login.txt, tests/test_legacy_login.py, tests/test_ogp_login.py</p>
<p>initialize the login object</p>
<dl class="method">
<dt id="pyogp.lib.base.login.Login.login">
<tt class="descname">login</tt><big>(</big><em>loginuri=None</em>, <em>login_params=None</em>, <em>start_location=None</em>, <em>handler=None</em><big>)</big><a class="headerlink" href="#pyogp.lib.base.login.Login.login" title="Permalink to this definition"></a></dt>
<dd>high level login initiator, returns the login response as a dict</dd></dl>
</dd></dl>
<dl class="class">
<dt id="pyogp.lib.base.login.LegacyLoginParams">
<em class="property">
class </em><tt class="descclassname">pyogp.lib.base.login.</tt><tt class="descname">LegacyLoginParams</tt><big>(</big><em>firstname</em>, <em>lastname</em>, <em>password</em><big>)</big><a class="headerlink" href="#pyogp.lib.base.login.LegacyLoginParams" title="Permalink to this definition"></a></dt>
<dd><p>a legacy plain password credential</p>
<p>initialize this credential</p>
<dl class="method">
<dt id="pyogp.lib.base.login.LegacyLoginParams.serialize">
<tt class="descname">serialize</tt><big>(</big><big>)</big><a class="headerlink" href="#pyogp.lib.base.login.LegacyLoginParams.serialize" title="Permalink to this definition"></a></dt>
<dd>return a dictionary of login params</dd></dl>
</dd></dl>
</div>
</div>
</div>
</div>
<div class="clearer"></div>
</div>
<div class="related">
<h3>Navigation</h3>
<ul>
<li class="right" style="margin-right: 10px">
<a href="../genindex.html" title="General Index"
>index</a></li>
<li class="right" >
<a href="../modindex.html" title="Global Module Index"
>modules</a> |</li>
<li class="right" >
<a href="message.html" title="message"
>next</a> |</li>
<li class="right" >
<a href="llsd_sender.html" title="llsd_sender"
>previous</a> |</li>
<li><a href="../index.html">Pyogp v0.1 documentation</a> &raquo;</li>
<li><a href="../modules.html" >Modules</a> &raquo;</li>
</ul>
</div>
<div class="footer">
&copy; Copyright 2009, Pyogp team.
Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> 0.6.1.
</div>
</body>
</html>