EVOLUTION-MANAGER
Edit File: existing.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>Existing Services — python-fedora 0.10.0 documentation</title> <link rel="stylesheet" href="_static/default.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.10.0', COLLAPSE_INDEX: false, FILE_SUFFIX: '.html', HAS_SOURCE: true }; </script> <script type="text/javascript" src="_static/jquery.js"></script> <script type="text/javascript" src="_static/underscore.js"></script> <script type="text/javascript" src="_static/doctools.js"></script> <link rel="search" type="application/opensearchdescription+xml" title="Search within python-fedora 0.10.0 documentation" href="_static/opensearch.xml"/> <link rel="top" title="python-fedora 0.10.0 documentation" href="index.html" /> <link rel="next" title="Fedora Services" href="service.html" /> <link rel="prev" title="Fedora Client" href="client.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="py-modindex.html" title="Python Module Index" >modules</a> |</li> <li class="right" > <a href="service.html" title="Fedora Services" accesskey="N">next</a> |</li> <li class="right" > <a href="client.html" title="Fedora Client" accesskey="P">previous</a> |</li> <li><a href="index.html">python-fedora 0.10.0 documentation</a> »</li> </ul> </div> <div class="document"> <div class="documentwrapper"> <div class="bodywrapper"> <div class="body"> <div class="section" id="existing-services"> <h1>Existing Services<a class="headerlink" href="#existing-services" title="Permalink to this headline">¶</a></h1> <p>There are many Services in Fedora. Many of these have an interface that we can query and get back information as <a class="reference internal" href="glossary.html#term-json"><em class="xref std std-term">JSON</em></a> data. There is documentation here about both the services and the client modules that can access them.</p> <div class="section" id="fas"> <span id="fedora-account-system"></span><span id="id1"></span><h2>Fedora Account System<a class="headerlink" href="#fas" title="Permalink to this headline">¶</a></h2> <p>FAS is the Fedora Account System. It holds the account data for all of our contributors.</p> <div class="toctree-wrapper compound"> <ul class="simple"> </ul> </div> <dl class="class"> <dt id="fedora.client.AccountSystem"> <em class="property">class </em><tt class="descclassname">fedora.client.</tt><tt class="descname">AccountSystem</tt><big>(</big><em>base_url='https://admin.fedoraproject.org/accounts/'</em>, <em>*args</em>, <em>**kwargs</em><big>)</big><a class="headerlink" href="#fedora.client.AccountSystem" title="Permalink to this definition">¶</a></dt> <dd><p>An object for querying the Fedora Account System.</p> <p>The Account System object provides a python API for talking to the Fedora Account System. It abstracts the http requests, cookie handling, and other details so you can concentrate on the methods that are important to your program.</p> <div class="admonition warning"> <p class="first admonition-title">Warning</p> <p class="last">If your code is trying to use the AccountSystem object to connect to fas for multiple users you probably want to use <a class="reference internal" href="#fedora.client.FasProxyClient" title="fedora.client.FasProxyClient"><tt class="xref py py-class docutils literal"><span class="pre">FasProxyClient</span></tt></a> instead. If your code is trying to reuse a single instance of AccountSystem for multiple users you <em>definitely</em> want to use <a class="reference internal" href="#fedora.client.FasProxyClient" title="fedora.client.FasProxyClient"><tt class="xref py py-class docutils literal"><span class="pre">FasProxyClient</span></tt></a> instead. Using AccountSystem in these cases may result in a user being logged in as a different user. (This may be the case even if you instantiate a new AccountSystem object for each user if :attr:cache_session: is True since that creates a file on the file system that can end up loading session credentials for the wrong person.</p> </div> <p class="versionchanged"> <span class="versionmodified">Changed in version 0.3.26: </span>Added <a class="reference internal" href="#fedora.client.AccountSystem.gravatar_url" title="fedora.client.AccountSystem.gravatar_url"><tt class="xref py py-meth docutils literal"><span class="pre">gravatar_url()</span></tt></a> that returns a url to a gravatar for a user.</p> <p class="versionchanged"> <span class="versionmodified">Changed in version 0.3.33: </span>Renamed <a class="reference internal" href="#fedora.client.AccountSystem.gravatar_url" title="fedora.client.AccountSystem.gravatar_url"><tt class="xref py py-meth docutils literal"><span class="pre">gravatar_url()</span></tt></a> to <a class="reference internal" href="#fedora.client.AccountSystem.avatar_url" title="fedora.client.AccountSystem.avatar_url"><tt class="xref py py-meth docutils literal"><span class="pre">avatar_url()</span></tt></a>.</p> <dl class="method"> <dt id="fedora.client.AccountSystem.avatar_url"> <tt class="descname">avatar_url</tt><big>(</big><em>username</em>, <em>size=64</em>, <em>default=None</em>, <em>lookup_email=True</em>, <em>service=None</em><big>)</big><a class="headerlink" href="#fedora.client.AccountSystem.avatar_url" title="Permalink to this definition">¶</a></dt> <dd><p>Returns a URL to an avatar for a given username.</p> <p>Avatars are drawn from third party services.</p> <table class="docutils field-list" frame="void" rules="none"> <col class="field-name" /> <col class="field-body" /> <tbody valign="top"> <tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple"> <li><strong>username</strong> – FAS username to construct a avatar url for</li> <li><strong>size</strong> – size of the avatar. Allowed sizes are 32, 64, 140. Default: 64</li> <li><strong>default</strong> – If the service does not have a avatar image for the email address, this url is returned instead. Default: the fedora logo at the specified size.</li> <li><strong>lookup_email</strong> – If true, use the email from FAS for gravatar.com lookups, otherwise just append @fedoraproject.org to the username. For libravatar.org lookups, this is ignored. The openid identifier of the user is used instead. Note that gravatar.com lookups will be much slower if lookup_email is set to True since we’d have to make a query against FAS itself.</li> <li><strong>service</strong> – One of ‘libravatar’ or ‘gravatar’. Default: ‘libravatar’.</li> </ul> </td> </tr> <tr class="field-even field"><th class="field-name" colspan="2">Raises ValueError:</th></tr> <tr class="field-even field"><td> </td><td class="field-body"><p class="first">if the size parameter is not allowed or if the service is not one of ‘libravatar’ or ‘gravatar’</p> </td> </tr> <tr class="field-odd field"><th class="field-name">Return type:</th><td class="field-body"><p class="first"><tt class="xref py py-obj docutils literal"><span class="pre">str</span></tt></p> </td> </tr> <tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first last">url of a avatar for the user</p> </td> </tr> </tbody> </table> <p>If that user has no avatar entry, instruct the remote service to redirect us to the Fedora logo.</p> <p>If that user has no email attribute, then make a fake request to the third party service.</p> <p class="versionadded"> <span class="versionmodified">New in version 0.3.26.</span></p> </dd></dl> <dl class="method"> <dt id="fedora.client.AccountSystem.create_group"> <tt class="descname">create_group</tt><big>(</big><em>name</em>, <em>display_name</em>, <em>owner</em>, <em>group_type</em>, <em>invite_only=0</em>, <em>needs_sponsor=0</em>, <em>user_can_remove=1</em>, <em>prerequisite=''</em>, <em>joinmsg=''</em>, <em>apply_rules='None'</em><big>)</big><a class="headerlink" href="#fedora.client.AccountSystem.create_group" title="Permalink to this definition">¶</a></dt> <dd><p>Creates a FAS group.</p> <table class="docutils field-list" frame="void" rules="none"> <col class="field-name" /> <col class="field-body" /> <tbody valign="top"> <tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple"> <li><strong>name</strong> – The short group name (alphanumeric only).</li> <li><strong>display_name</strong> – A longer version of the group’s name.</li> <li><strong>owner</strong> – The username of the FAS account which owns the new group.</li> <li><strong>group_type</strong> – The kind of group being created. Current valid options are git, svn, hg, shell, and tracking.</li> <li><strong>invite_only</strong> – Users must be invited to the group, they cannot join on their own.</li> <li><strong>needs_sponsor</strong> – Users must be sponsored into the group.</li> <li><strong>user_can_remove</strong> – Users can remove themselves from the group.</li> <li><strong>prerequisite</strong> – Users must be in the given group (string) before they can join the new group.</li> <li><strong>joinmsg</strong> – A message shown to users when they apply to the group.</li> <li><strong>apply_rules</strong> – Rules for applying to the group, shown to users before they apply.</li> </ul> </td> </tr> <tr class="field-even field"><th class="field-name">Return type:</th><td class="field-body"><p class="first"><tt class="xref py py-obj docutils literal"><span class="pre">munch.Munch</span></tt></p> </td> </tr> <tr class="field-odd field"><th class="field-name">Returns:</th><td class="field-body"><p class="first last">A Munch containing information about the group that was created.</p> </td> </tr> </tbody> </table> <p class="versionadded"> <span class="versionmodified">New in version 0.3.29.</span></p> </dd></dl> <dl class="method"> <dt id="fedora.client.AccountSystem.get_config"> <tt class="descname">get_config</tt><big>(</big><em>username</em>, <em>application</em>, <em>attribute</em><big>)</big><a class="headerlink" href="#fedora.client.AccountSystem.get_config" title="Permalink to this definition">¶</a></dt> <dd><p>Return the config entry for the key values.</p> <table class="docutils field-list" frame="void" rules="none"> <col class="field-name" /> <col class="field-body" /> <tbody valign="top"> <tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple"> <li><strong>username</strong> – Username of the person</li> <li><strong>application</strong> – Application for which the config is set</li> <li><strong>attribute</strong> – Attribute key to lookup</li> </ul> </td> </tr> <tr class="field-even field"><th class="field-name" colspan="2">Raises AppError:</th></tr> <tr class="field-even field"><td> </td><td class="field-body"><p class="first">if the server returns an exception</p> </td> </tr> <tr class="field-odd field"><th class="field-name">Returns:</th><td class="field-body"><p class="first last">The unicode string that describes the value. If no entry matched the username, application, and attribute then None is returned.</p> </td> </tr> </tbody> </table> </dd></dl> <dl class="method"> <dt id="fedora.client.AccountSystem.get_configs_like"> <tt class="descname">get_configs_like</tt><big>(</big><em>username</em>, <em>application</em>, <em>pattern=u'*'</em><big>)</big><a class="headerlink" href="#fedora.client.AccountSystem.get_configs_like" title="Permalink to this definition">¶</a></dt> <dd><p>Return the config entries that match the keys and the pattern.</p> <p>Note: authentication on the server will prevent anyone but the user or a fas admin from viewing or changing their configs.</p> <table class="docutils field-list" frame="void" rules="none"> <col class="field-name" /> <col class="field-body" /> <tbody valign="top"> <tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple"> <li><strong>username</strong> – Username of the person</li> <li><strong>application</strong> – Application for which the config is set</li> <li><strong>pattern</strong> – A pattern to select values for. This accepts * as a wildcard character. Default=’*’</li> </ul> </td> </tr> <tr class="field-even field"><th class="field-name" colspan="2">Raises AppError:</th></tr> <tr class="field-even field"><td> </td><td class="field-body"><p class="first">if the server returns an exception</p> </td> </tr> <tr class="field-odd field"><th class="field-name">Returns:</th><td class="field-body"><p class="first last">A dict mapping <tt class="docutils literal"><span class="pre">attribute</span></tt> to <tt class="docutils literal"><span class="pre">value</span></tt>.</p> </td> </tr> </tbody> </table> </dd></dl> <dl class="method"> <dt id="fedora.client.AccountSystem.gravatar_url"> <tt class="descname">gravatar_url</tt><big>(</big><em>*args</em>, <em>**kwargs</em><big>)</big><a class="headerlink" href="#fedora.client.AccountSystem.gravatar_url" title="Permalink to this definition">¶</a></dt> <dd><p><em>Deprecated</em> - Use avatar_url.</p> <p class="versionadded"> <span class="versionmodified">New in version 0.3.26.</span></p> </dd></dl> <dl class="method"> <dt id="fedora.client.AccountSystem.group_by_id"> <tt class="descname">group_by_id</tt><big>(</big><em>group_id</em><big>)</big><a class="headerlink" href="#fedora.client.AccountSystem.group_by_id" title="Permalink to this definition">¶</a></dt> <dd><p>Returns a group object based on its id</p> </dd></dl> <dl class="method"> <dt id="fedora.client.AccountSystem.group_by_name"> <tt class="descname">group_by_name</tt><big>(</big><em>groupname</em><big>)</big><a class="headerlink" href="#fedora.client.AccountSystem.group_by_name" title="Permalink to this definition">¶</a></dt> <dd><p>Returns a group object based on its name</p> </dd></dl> <dl class="method"> <dt id="fedora.client.AccountSystem.group_data"> <tt class="descname">group_data</tt><big>(</big><em>force_refresh=None</em><big>)</big><a class="headerlink" href="#fedora.client.AccountSystem.group_data" title="Permalink to this definition">¶</a></dt> <dd><p>Return administrators/sponsors/users and group type for all groups</p> <table class="docutils field-list" frame="void" rules="none"> <col class="field-name" /> <col class="field-body" /> <tbody valign="top"> <tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>force_refresh</strong> – If true, the returned data will be queried from the database, as opposed to memcached.</td> </tr> <tr class="field-even field"><th class="field-name" colspan="2">Raises AppError:</th></tr> <tr class="field-even field"><td> </td><td class="field-body">if the query failed on the server</td> </tr> <tr class="field-odd field"><th class="field-name">Returns:</th><td class="field-body">A dict mapping group names to the group type and the user IDs of the administrator, sponsors, and users of the group.</td> </tr> </tbody> </table> <p class="versionadded"> <span class="versionmodified">New in version 0.3.8.</span></p> </dd></dl> <dl class="method"> <dt id="fedora.client.AccountSystem.group_members"> <tt class="descname">group_members</tt><big>(</big><em>groupname</em><big>)</big><a class="headerlink" href="#fedora.client.AccountSystem.group_members" title="Permalink to this definition">¶</a></dt> <dd><p>Return a list of people approved for a group.</p> <p>This method returns a list of people who are in the requested group. The people are all approved in the group. Unapproved people are not shown. The format of data is:</p> <div class="highlight-python"><pre>\[{'username': 'person1', 'role_type': 'user'}, \{'username': 'person2', 'role_type': 'sponsor'}]</pre> </div> <p>role_type can be one of ‘user’, ‘sponsor’, or ‘administrator’.</p> <p class="versionadded"> <span class="versionmodified">New in version 0.3.2.</span></p> <p class="versionchanged"> <span class="versionmodified">Changed in version 0.3.21: </span>Return a Bunch instead of a DictContainer</p> </dd></dl> <dl class="attribute"> <dt id="fedora.client.AccountSystem.insecure"> <tt class="descname">insecure</tt><a class="headerlink" href="#fedora.client.AccountSystem.insecure" title="Permalink to this definition">¶</a></dt> <dd><p>If this attribute is set to True, do not check server certificates against their CA’s. This means that man-in-the-middle attacks are possible. You might turn this option on for testing against a local version of a server with a self-signed certificate but it should be off in production.</p> </dd></dl> <dl class="method"> <dt id="fedora.client.AccountSystem.people_by_groupname"> <tt class="descname">people_by_groupname</tt><big>(</big><em>groupname</em><big>)</big><a class="headerlink" href="#fedora.client.AccountSystem.people_by_groupname" title="Permalink to this definition">¶</a></dt> <dd><p>Return a list of persons for the given groupname.</p> <table class="docutils field-list" frame="void" rules="none"> <col class="field-name" /> <col class="field-body" /> <tbody valign="top"> <tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>groupname</strong> – Name of the group to look up</td> </tr> <tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body">A list of person objects from the group. If the group contains no entries, then an empty list is returned.</td> </tr> </tbody> </table> </dd></dl> <dl class="method"> <dt id="fedora.client.AccountSystem.people_by_id"> <tt class="descname">people_by_id</tt><big>(</big><big>)</big><a class="headerlink" href="#fedora.client.AccountSystem.people_by_id" title="Permalink to this definition">¶</a></dt> <dd><p><em>Deprecated</em> Use people_by_key() instead.</p> <p>Returns a dict relating user IDs to human_name, email, username, and bugzilla email</p> <p class="versionchanged"> <span class="versionmodified">Changed in version 0.3.21: </span>Return a Bunch instead of a DictContainer</p> </dd></dl> <dl class="method"> <dt id="fedora.client.AccountSystem.people_by_key"> <tt class="descname">people_by_key</tt><big>(</big><em>key=u'username'</em>, <em>search=u'*'</em>, <em>fields=None</em><big>)</big><a class="headerlink" href="#fedora.client.AccountSystem.people_by_key" title="Permalink to this definition">¶</a></dt> <dd><p>Return a dict of people</p> <p>For example:</p> <div class="highlight-python"><div class="highlight"><pre><span class="gp">>>> </span><span class="n">ret_val</span> <span class="o">=</span> <span class="n">FASCLIENT</span><span class="o">.</span><span class="n">people_by_key</span><span class="p">(</span> <span class="gp">... </span> <span class="n">key</span><span class="o">=</span><span class="s">'email'</span><span class="p">,</span> <span class="n">search</span><span class="o">=</span><span class="s">'toshio*'</span><span class="p">,</span> <span class="n">fields</span><span class="o">=</span><span class="p">[</span><span class="s">'id'</span><span class="p">])</span> <span class="gp">>>> </span><span class="n">ret_val</span><span class="o">.</span><span class="n">keys</span><span class="p">()</span> <span class="go">a.badger@[...].com</span> <span class="go">a.badger+test1@[...].com</span> <span class="go">a.badger+test2@[...].com</span> <span class="gp">>>> </span><span class="n">ret_val</span><span class="o">.</span><span class="n">values</span><span class="p">()</span> <span class="go">100068</span> <span class="go">102023</span> <span class="go">102434</span> </pre></div> </div> <table class="docutils field-list" frame="void" rules="none"> <col class="field-name" /> <col class="field-body" /> <tbody valign="top"> <tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple"> <li><strong>key</strong> – Key used to organize the returned dictionary. Valid values are ‘id’, ‘username’, or ‘email’. Default is ‘username’.</li> <li><strong>search</strong> – Pattern to match usernames against. Defaults to the ‘*’ wildcard which matches everyone.</li> <li><strong>fields</strong> – <p>Limit the data returned to a specific list of fields. The default is to retrieve all fields. Valid fields are:</p> <blockquote> <div><ul> <li>affiliation</li> <li>alias_enabled</li> <li>bugzilla_email</li> <li>certificate_serial</li> <li>comments</li> <li>country_code</li> <li>creation</li> <li>email</li> <li>emailtoken</li> <li>facsimile</li> <li>gpg_keyid</li> <li>group_roles</li> <li>human_name</li> <li>id</li> <li>internal_comments</li> <li>ircnick</li> <li>last_seen</li> <li>latitude</li> <li>locale</li> <li>longitude</li> <li>memberships</li> <li>old_password</li> <li>password</li> <li>password_changed</li> <li>passwordtoken</li> <li>postal_address</li> <li>privacy</li> <li>roles</li> <li>ssh_key</li> <li>status</li> <li>status_change</li> <li>telephone</li> <li>timezone</li> <li>unverified_email</li> <li>username</li> </ul> </div></blockquote> <p>Note that for most users who access this data, many of these fields will be set to None due to security or privacy settings.</p> </li> </ul> </td> </tr> <tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first last">a dict relating the key value to the fields.</p> </td> </tr> </tbody> </table> <p class="versionchanged"> <span class="versionmodified">Changed in version 0.3.21: </span>Return a Bunch instead of a DictContainer</p> <p class="versionchanged"> <span class="versionmodified">Changed in version 0.3.26: </span>Fixed to return a list with both people who have signed the CLA and have not</p> </dd></dl> <dl class="method"> <dt id="fedora.client.AccountSystem.people_query"> <tt class="descname">people_query</tt><big>(</big><em>constraints=None</em>, <em>columns=None</em><big>)</big><a class="headerlink" href="#fedora.client.AccountSystem.people_query" title="Permalink to this definition">¶</a></dt> <dd><p>Returns a list of dicts representing database rows</p> <table class="docutils field-list" frame="void" rules="none"> <col class="field-name" /> <col class="field-body" /> <tbody valign="top"> <tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple"> <li><strong>constraints</strong> – A dictionary specifying WHERE constraints on columns</li> <li><strong>columns</strong> – A list of columns to be selected in the query</li> </ul> </td> </tr> <tr class="field-even field"><th class="field-name" colspan="2">Raises AppError:</th></tr> <tr class="field-even field"><td> </td><td class="field-body"><p class="first">if the query failed on the server (most likely because the server was given a bad query)</p> </td> </tr> <tr class="field-odd field"><th class="field-name">Returns:</th><td class="field-body"><p class="first last">A list of dicts representing database rows (the keys of the dict are the columns requested)</p> </td> </tr> </tbody> </table> <p class="versionadded"> <span class="versionmodified">New in version 0.3.12.1.</span></p> </dd></dl> <dl class="method"> <dt id="fedora.client.AccountSystem.person_by_id"> <tt class="descname">person_by_id</tt><big>(</big><em>person_id</em><big>)</big><a class="headerlink" href="#fedora.client.AccountSystem.person_by_id" title="Permalink to this definition">¶</a></dt> <dd><p>Returns a person object based on its id</p> </dd></dl> <dl class="method"> <dt id="fedora.client.AccountSystem.person_by_username"> <tt class="descname">person_by_username</tt><big>(</big><em>username</em><big>)</big><a class="headerlink" href="#fedora.client.AccountSystem.person_by_username" title="Permalink to this definition">¶</a></dt> <dd><p>Returns a person object based on its username</p> </dd></dl> <dl class="attribute"> <dt id="fedora.client.AccountSystem.proxy"> <tt class="descname">proxy</tt><em class="property"> = None</em><a class="headerlink" href="#fedora.client.AccountSystem.proxy" title="Permalink to this definition">¶</a></dt> <dd></dd></dl> <dl class="method"> <dt id="fedora.client.AccountSystem.set_config"> <tt class="descname">set_config</tt><big>(</big><em>username</em>, <em>application</em>, <em>attribute</em>, <em>value</em><big>)</big><a class="headerlink" href="#fedora.client.AccountSystem.set_config" title="Permalink to this definition">¶</a></dt> <dd><p>Set a config entry in FAS for the user.</p> <p>Note: authentication on the server will prevent anyone but the user or a fas admin from viewing or changing their configs.</p> <table class="docutils field-list" frame="void" rules="none"> <col class="field-name" /> <col class="field-body" /> <tbody valign="top"> <tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple"> <li><strong>username</strong> – Username of the person</li> <li><strong>application</strong> – Application for which the config is set</li> <li><strong>attribute</strong> – The name of the config key that we’re setting</li> <li><strong>value</strong> – The value to set this to</li> </ul> </td> </tr> <tr class="field-even field"><th class="field-name" colspan="2">Raises AppError:</th></tr> <tr class="field-even field"><td> </td><td class="field-body"><p class="first last">if the server returns an exception</p> </td> </tr> </tbody> </table> </dd></dl> <dl class="method"> <dt id="fedora.client.AccountSystem.user_data"> <tt class="descname">user_data</tt><big>(</big><big>)</big><a class="headerlink" href="#fedora.client.AccountSystem.user_data" title="Permalink to this definition">¶</a></dt> <dd><p>Return user data for all users in FAS</p> <p>Note: If the user is not authorized to see password hashes, ‘*’ is returned for the hash.</p> <table class="docutils field-list" frame="void" rules="none"> <col class="field-name" /> <col class="field-body" /> <tbody valign="top"> <tr class="field-odd field"><th class="field-name" colspan="2">Raises AppError:</th></tr> <tr class="field-odd field"><td> </td><td class="field-body">if the query failed on the server</td> </tr> <tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body">A dict mapping user IDs to a username, password hash, SSH public key, email address, and status.</td> </tr> </tbody> </table> <p class="versionadded"> <span class="versionmodified">New in version 0.3.8.</span></p> </dd></dl> <dl class="method"> <dt id="fedora.client.AccountSystem.user_gencert"> <tt class="descname">user_gencert</tt><big>(</big><big>)</big><a class="headerlink" href="#fedora.client.AccountSystem.user_gencert" title="Permalink to this definition">¶</a></dt> <dd><p>Generate a cert for a user</p> </dd></dl> <dl class="method"> <dt id="fedora.client.AccountSystem.user_id"> <tt class="descname">user_id</tt><big>(</big><big>)</big><a class="headerlink" href="#fedora.client.AccountSystem.user_id" title="Permalink to this definition">¶</a></dt> <dd><p>Returns a dict relating user IDs to usernames</p> </dd></dl> <dl class="method"> <dt id="fedora.client.AccountSystem.verify_password"> <tt class="descname">verify_password</tt><big>(</big><em>username</em>, <em>password</em><big>)</big><a class="headerlink" href="#fedora.client.AccountSystem.verify_password" title="Permalink to this definition">¶</a></dt> <dd><p>Return whether the username and password pair are valid.</p> <table class="docutils field-list" frame="void" rules="none"> <col class="field-name" /> <col class="field-body" /> <tbody valign="top"> <tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple"> <li><strong>username</strong> – username to try authenticating</li> <li><strong>password</strong> – password for the user</li> </ul> </td> </tr> <tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first last">True if the username/password are valid. False otherwise.</p> </td> </tr> </tbody> </table> </dd></dl> </dd></dl> <div class="section" id="threadsafe-account-system-access"> <h3>Threadsafe Account System Access<a class="headerlink" href="#threadsafe-account-system-access" title="Permalink to this headline">¶</a></h3> <p>It is not safe to use a single instance of the <a class="reference internal" href="#fedora.client.AccountSystem" title="fedora.client.AccountSystem"><tt class="xref py py-class docutils literal"><span class="pre">AccountSystem</span></tt></a> object in multiple threads. This is because instance variables are used to hold some connection-specific information (for instance, the user who is logging in). For this reason, we also provide the <a class="reference internal" href="#fedora.client.FasProxyClient" title="fedora.client.FasProxyClient"><tt class="xref py py-class docutils literal"><span class="pre">fedora.client.FasProxyClient</span></tt></a> object.</p> <p>This is especially handy when writing authn and authz adaptors that talk to fas from a multithreaded webserver.</p> <div class="toctree-wrapper compound"> <ul class="simple"> </ul> </div> <dl class="class"> <dt id="fedora.client.FasProxyClient"> <em class="property">class </em><tt class="descclassname">fedora.client.</tt><tt class="descname">FasProxyClient</tt><big>(</big><em>base_url='https://admin.fedoraproject.org/accounts/'</em>, <em>*args</em>, <em>**kwargs</em><big>)</big><a class="headerlink" href="#fedora.client.FasProxyClient" title="Permalink to this definition">¶</a></dt> <dd><p>A threadsafe client to the Fedora Account System.</p> <dl class="method"> <dt id="fedora.client.FasProxyClient.get_user_info"> <tt class="descname">get_user_info</tt><big>(</big><em>auth_params</em><big>)</big><a class="headerlink" href="#fedora.client.FasProxyClient.get_user_info" title="Permalink to this definition">¶</a></dt> <dd><p>Retrieve information about a logged in user.</p> <table class="docutils field-list" frame="void" rules="none"> <col class="field-name" /> <col class="field-body" /> <tbody valign="top"> <tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>auth_params</strong> – Auth information for a particular user. For instance, this can be a username/password pair or a session_id. Refer to <tt class="xref py py-meth docutils literal"><span class="pre">fedora.client.proxyclient.ProxyClient.send_request()</span></tt> for all the legal values for this.</td> </tr> <tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body">a tuple of session_id and information about the user.</td> </tr> <tr class="field-odd field"><th class="field-name" colspan="2">Raises AuthError:</th></tr> <tr class="field-odd field"><td> </td><td class="field-body">if the auth_params do not give access</td> </tr> </tbody> </table> </dd></dl> <dl class="method"> <dt id="fedora.client.FasProxyClient.group_list"> <tt class="descname">group_list</tt><big>(</big><em>auth_params</em><big>)</big><a class="headerlink" href="#fedora.client.FasProxyClient.group_list" title="Permalink to this definition">¶</a></dt> <dd><p>Retrieve a list of groups</p> <table class="docutils field-list" frame="void" rules="none"> <col class="field-name" /> <col class="field-body" /> <tbody valign="top"> <tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>auth_params</strong> – Auth information for a particular user. For instance, this can be a username/password pair or a session_id. Refer to <tt class="xref py py-meth docutils literal"><span class="pre">fedora.client.proxyclient.ProxyClient.send_request()</span></tt> for all the legal values for this.</td> </tr> <tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body">a tuple of session_id and information about groups. The groups information is in two fields:<table class="docutils field-list" frame="void" rules="none"> <col class="field-name" /> <col class="field-body" /> <tbody valign="top"> <tr class="field-odd field"><th class="field-name">groups:</th><td class="field-body">contains information about each group</td> </tr> <tr class="field-even field"><th class="field-name">memberships:</th><td class="field-body">contains information about which users are members of which groups</td> </tr> </tbody> </table> </td> </tr> <tr class="field-odd field"><th class="field-name" colspan="2">Raises AuthError:</th></tr> <tr class="field-odd field"><td> </td><td class="field-body">if the auth_params do not give access</td> </tr> </tbody> </table> </dd></dl> <dl class="method"> <dt id="fedora.client.FasProxyClient.login"> <tt class="descname">login</tt><big>(</big><em>username</em>, <em>password</em><big>)</big><a class="headerlink" href="#fedora.client.FasProxyClient.login" title="Permalink to this definition">¶</a></dt> <dd><p>Login to the Account System</p> <table class="docutils field-list" frame="void" rules="none"> <col class="field-name" /> <col class="field-body" /> <tbody valign="top"> <tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple"> <li><strong>username</strong> – username to send to FAS</li> <li><strong>password</strong> – Password to verify the username with</li> </ul> </td> </tr> <tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first">a tuple of the session id FAS has associated with the user and the user’s account information. This is similar to what is returned by <tt class="xref py py-meth docutils literal"><span class="pre">fedora.client.proxyclient.ProxyClient.get_user_info()</span></tt></p> </td> </tr> <tr class="field-odd field"><th class="field-name" colspan="2">Raises AuthError:</th></tr> <tr class="field-odd field"><td> </td><td class="field-body"><p class="first last">if the username and password do not work</p> </td> </tr> </tbody> </table> </dd></dl> <dl class="method"> <dt id="fedora.client.FasProxyClient.logout"> <tt class="descname">logout</tt><big>(</big><em>session_id</em><big>)</big><a class="headerlink" href="#fedora.client.FasProxyClient.logout" title="Permalink to this definition">¶</a></dt> <dd><p>Logout of the Account System</p> <table class="docutils field-list" frame="void" rules="none"> <col class="field-name" /> <col class="field-body" /> <tbody valign="top"> <tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>session_id</strong> – a FAS session_id to remove from FAS</td> </tr> </tbody> </table> </dd></dl> <dl class="method"> <dt id="fedora.client.FasProxyClient.person_by_id"> <tt class="descname">person_by_id</tt><big>(</big><em>person_id</em>, <em>auth_params</em><big>)</big><a class="headerlink" href="#fedora.client.FasProxyClient.person_by_id" title="Permalink to this definition">¶</a></dt> <dd><p>Retrieve information about a particular person</p> <table class="docutils field-list" frame="void" rules="none"> <col class="field-name" /> <col class="field-body" /> <tbody valign="top"> <tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><p class="first"><strong>auth_params</strong> – Auth information for a particular user. For instance, this can be a username/password pair or a session_id. Refer to <tt class="xref py py-meth docutils literal"><span class="pre">fedora.client.proxyclient.ProxyClient.send_request()</span></tt> for all the legal values for this.</p> </td> </tr> <tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first">a tuple of session_id and information about the user.</p> </td> </tr> <tr class="field-odd field"><th class="field-name">Raises:</th><td class="field-body"><ul class="first last simple"> <li><strong>AppError</strong> – if the server returns an exception</li> <li><strong>AuthError</strong> – if the auth_params do not give access</li> </ul> </td> </tr> </tbody> </table> </dd></dl> <dl class="method"> <dt id="fedora.client.FasProxyClient.refresh_session"> <tt class="descname">refresh_session</tt><big>(</big><em>session_id</em><big>)</big><a class="headerlink" href="#fedora.client.FasProxyClient.refresh_session" title="Permalink to this definition">¶</a></dt> <dd><p>Try to refresh a session_id to prevent it from timing out</p> <table class="docutils field-list" frame="void" rules="none"> <col class="field-name" /> <col class="field-body" /> <tbody valign="top"> <tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>session_id</strong> – FAS session_id to refresh</td> </tr> <tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body">session_id that FAS has set now</td> </tr> </tbody> </table> </dd></dl> <dl class="method"> <dt id="fedora.client.FasProxyClient.verify_password"> <tt class="descname">verify_password</tt><big>(</big><em>username</em>, <em>password</em><big>)</big><a class="headerlink" href="#fedora.client.FasProxyClient.verify_password" title="Permalink to this definition">¶</a></dt> <dd><p>Return whether the username and password pair are valid.</p> <table class="docutils field-list" frame="void" rules="none"> <col class="field-name" /> <col class="field-body" /> <tbody valign="top"> <tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple"> <li><strong>username</strong> – username to try authenticating</li> <li><strong>password</strong> – password for the user</li> </ul> </td> </tr> <tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first last">True if the username/password are valid. False otherwise.</p> </td> </tr> </tbody> </table> </dd></dl> <dl class="method"> <dt id="fedora.client.FasProxyClient.verify_session"> <tt class="descname">verify_session</tt><big>(</big><em>session_id</em><big>)</big><a class="headerlink" href="#fedora.client.FasProxyClient.verify_session" title="Permalink to this definition">¶</a></dt> <dd><p>Verify that a session is active.</p> <table class="docutils field-list" frame="void" rules="none"> <col class="field-name" /> <col class="field-body" /> <tbody valign="top"> <tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>session_id</strong> – session_id to verify is currently associated with a logged in user</td> </tr> <tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body">True if the session_id is valid. False otherwise.</td> </tr> </tbody> </table> </dd></dl> </dd></dl> </div> </div> <div class="section" id="bodhi-the-update-server"> <span id="bodhi"></span><h2>Bodhi, the Update Server<a class="headerlink" href="#bodhi-the-update-server" title="Permalink to this headline">¶</a></h2> <p>Bodhi is used to push updates from the build system to the download repositories. It lets packagers send packages to the testing repository or to the update repository.</p> <p>pythyon-fedora currently supports both the old Bodhi1 interface and the new Bodhi2 interface. By using <tt class="docutils literal"><span class="pre">fedora.client.BodhiCLient</span></tt>, the correct one should be returned to you depending on what is running live on Fedora Infrastructure servers.</p> <div class="toctree-wrapper compound"> <ul class="simple"> </ul> </div> </div> </div> </div> </div> </div> <div class="sphinxsidebar"> <div class="sphinxsidebarwrapper"> <h3><a href="index.html">Table Of Contents</a></h3> <ul> <li><a class="reference internal" href="#">Existing Services</a><ul> <li><a class="reference internal" href="#fas">Fedora Account System</a><ul> <li><a class="reference internal" href="#threadsafe-account-system-access">Threadsafe Account System Access</a><ul> </ul> </li> </ul> </li> <li><a class="reference internal" href="#bodhi-the-update-server">Bodhi, the Update Server</a><ul> </ul> </li> </ul> </li> </ul> <h4>Previous topic</h4> <p class="topless"><a href="client.html" title="previous chapter">Fedora Client</a></p> <h4>Next topic</h4> <p class="topless"><a href="service.html" title="next chapter">Fedora Services</a></p> <h3>This Page</h3> <ul class="this-page-menu"> <li><a href="_sources/existing.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" /> <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="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="py-modindex.html" title="Python Module Index" >modules</a> |</li> <li class="right" > <a href="service.html" title="Fedora Services" >next</a> |</li> <li class="right" > <a href="client.html" title="Fedora Client" >previous</a> |</li> <li><a href="index.html">python-fedora 0.10.0 documentation</a> »</li> </ul> </div> <div class="footer"> © Copyright 2007-2018 Red Hat, Inc.. Last updated on Feb 01, 2018. Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> 1.1.3. </div> </body> </html>