Joe Gregorio | 6e53703 | 2011-02-09 23:04:26 -0500 | [diff] [blame] | 1 | |
| 2 | <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> |
| 3 | <html><head><title>Python: module oauth2client.client</title> |
| 4 | </head><body bgcolor="#f0f0f8"> |
| 5 | |
| 6 | <table width="100%" cellspacing=0 cellpadding=2 border=0 summary="heading"> |
| 7 | <tr bgcolor="#7799ee"> |
| 8 | <td valign=bottom> <br> |
| 9 | <font color="#ffffff" face="helvetica, arial"> <br><big><big><strong><a href="oauth2client.html"><font color="#ffffff">oauth2client</font></a>.client</strong></big></big></font></td |
| 10 | ><td align=right valign=bottom |
Joe Gregorio | a845167 | 2011-09-15 09:53:21 -0400 | [diff] [blame] | 11 | ><font color="#ffffff" face="helvetica, arial"><a href=".">index</a><br><a href="file:/usr/local/google/home/jcgregorio/projects/apiclient/oauth2client/client.py">/usr/local/google/home/jcgregorio/projects/apiclient/oauth2client/client.py</a></font></td></tr></table> |
| 12 | <p><tt>An OAuth 2.0 client.<br> |
Joe Gregorio | 6e53703 | 2011-02-09 23:04:26 -0500 | [diff] [blame] | 13 | <br> |
Joe Gregorio | a845167 | 2011-09-15 09:53:21 -0400 | [diff] [blame] | 14 | Tools for interacting with OAuth 2.0 protected resources.</tt></p> |
Joe Gregorio | 6e53703 | 2011-02-09 23:04:26 -0500 | [diff] [blame] | 15 | <p> |
| 16 | <table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section"> |
| 17 | <tr bgcolor="#aa55cc"> |
| 18 | <td colspan=3 valign=bottom> <br> |
| 19 | <font color="#ffffff" face="helvetica, arial"><big><strong>Modules</strong></big></font></td></tr> |
| 20 | |
| 21 | <tr><td bgcolor="#aa55cc"><tt> </tt></td><td> </td> |
| 22 | <td width="100%"><table width="100%" summary="list"><tr><td width="25%" valign=top><a href="copy.html">copy</a><br> |
| 23 | <a href="datetime.html">datetime</a><br> |
| 24 | </td><td width="25%" valign=top><a href="httplib2.html">httplib2</a><br> |
| 25 | <a href="logging.html">logging</a><br> |
| 26 | </td><td width="25%" valign=top><a href="simplejson.html">simplejson</a><br> |
| 27 | <a href="urllib.html">urllib</a><br> |
| 28 | </td><td width="25%" valign=top><a href="urlparse.html">urlparse</a><br> |
| 29 | </td></tr></table></td></tr></table><p> |
| 30 | <table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section"> |
| 31 | <tr bgcolor="#ee77aa"> |
| 32 | <td colspan=3 valign=bottom> <br> |
| 33 | <font color="#ffffff" face="helvetica, arial"><big><strong>Classes</strong></big></font></td></tr> |
| 34 | |
| 35 | <tr><td bgcolor="#ee77aa"><tt> </tt></td><td> </td> |
| 36 | <td width="100%"><dl> |
| 37 | <dt><font face="helvetica, arial"><a href="__builtin__.html#object">__builtin__.object</a> |
| 38 | </font></dt><dd> |
| 39 | <dl> |
| 40 | <dt><font face="helvetica, arial"><a href="oauth2client.client.html#Credentials">Credentials</a> |
| 41 | </font></dt><dd> |
| 42 | <dl> |
| 43 | <dt><font face="helvetica, arial"><a href="oauth2client.client.html#OAuth2Credentials">OAuth2Credentials</a> |
Joe Gregorio | 3b79fa8 | 2011-02-17 11:47:17 -0500 | [diff] [blame] | 44 | </font></dt><dd> |
| 45 | <dl> |
| 46 | <dt><font face="helvetica, arial"><a href="oauth2client.client.html#AccessTokenCredentials">AccessTokenCredentials</a> |
Joe Gregorio | b9e63ff | 2011-06-30 12:38:10 -0400 | [diff] [blame] | 47 | </font></dt><dt><font face="helvetica, arial"><a href="oauth2client.client.html#AssertionCredentials">AssertionCredentials</a> |
Joe Gregorio | 6e53703 | 2011-02-09 23:04:26 -0500 | [diff] [blame] | 48 | </font></dt></dl> |
| 49 | </dd> |
Joe Gregorio | 3b79fa8 | 2011-02-17 11:47:17 -0500 | [diff] [blame] | 50 | </dl> |
| 51 | </dd> |
Joe Gregorio | 6e53703 | 2011-02-09 23:04:26 -0500 | [diff] [blame] | 52 | <dt><font face="helvetica, arial"><a href="oauth2client.client.html#Flow">Flow</a> |
| 53 | </font></dt><dd> |
| 54 | <dl> |
| 55 | <dt><font face="helvetica, arial"><a href="oauth2client.client.html#OAuth2WebServerFlow">OAuth2WebServerFlow</a> |
| 56 | </font></dt></dl> |
| 57 | </dd> |
Joe Gregorio | 3b79fa8 | 2011-02-17 11:47:17 -0500 | [diff] [blame] | 58 | <dt><font face="helvetica, arial"><a href="oauth2client.client.html#Storage">Storage</a> |
| 59 | </font></dt></dl> |
Joe Gregorio | 6e53703 | 2011-02-09 23:04:26 -0500 | [diff] [blame] | 60 | </dd> |
| 61 | <dt><font face="helvetica, arial"><a href="exceptions.html#Exception">exceptions.Exception</a>(<a href="exceptions.html#BaseException">exceptions.BaseException</a>) |
| 62 | </font></dt><dd> |
| 63 | <dl> |
| 64 | <dt><font face="helvetica, arial"><a href="oauth2client.client.html#Error">Error</a> |
| 65 | </font></dt><dd> |
| 66 | <dl> |
Joe Gregorio | 3b79fa8 | 2011-02-17 11:47:17 -0500 | [diff] [blame] | 67 | <dt><font face="helvetica, arial"><a href="oauth2client.client.html#AccessTokenCredentialsError">AccessTokenCredentialsError</a> |
Joe Gregorio | f826111 | 2011-02-19 14:51:56 -0500 | [diff] [blame] | 68 | </font></dt><dt><font face="helvetica, arial"><a href="oauth2client.client.html#AccessTokenRefreshError">AccessTokenRefreshError</a> |
| 69 | </font></dt><dt><font face="helvetica, arial"><a href="oauth2client.client.html#FlowExchangeError">FlowExchangeError</a> |
Joe Gregorio | 6e53703 | 2011-02-09 23:04:26 -0500 | [diff] [blame] | 70 | </font></dt></dl> |
| 71 | </dd> |
| 72 | </dl> |
| 73 | </dd> |
| 74 | </dl> |
| 75 | <p> |
| 76 | <table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section"> |
| 77 | <tr bgcolor="#ffc8d8"> |
| 78 | <td colspan=3 valign=bottom> <br> |
Joe Gregorio | 3b79fa8 | 2011-02-17 11:47:17 -0500 | [diff] [blame] | 79 | <font color="#000000" face="helvetica, arial"><a name="AccessTokenCredentials">class <strong>AccessTokenCredentials</strong></a>(<a href="oauth2client.client.html#OAuth2Credentials">OAuth2Credentials</a>)</font></td></tr> |
| 80 | |
| 81 | <tr bgcolor="#ffc8d8"><td rowspan=2><tt> </tt></td> |
Joe Gregorio | a845167 | 2011-09-15 09:53:21 -0400 | [diff] [blame] | 82 | <td colspan=2><tt><a href="#Credentials">Credentials</a> <a href="__builtin__.html#object">object</a> for OAuth 2.0.<br> |
Joe Gregorio | 3b79fa8 | 2011-02-17 11:47:17 -0500 | [diff] [blame] | 83 | <br> |
Joe Gregorio | a845167 | 2011-09-15 09:53:21 -0400 | [diff] [blame] | 84 | <a href="#Credentials">Credentials</a> can be applied to an httplib2.Http <a href="__builtin__.html#object">object</a> using the<br> |
| 85 | <a href="#AccessTokenCredentials-authorize">authorize</a>() method, which then signs each request from that <a href="__builtin__.html#object">object</a><br> |
| 86 | with the OAuth 2.0 access token. This set of credentials is for the<br> |
| 87 | use case where you have acquired an OAuth 2.0 access_token from<br> |
| 88 | another place such as a JavaScript client or another web<br> |
| 89 | application, and wish to use it from Python. Because only the<br> |
| 90 | access_token is present it can not be refreshed and will in time<br> |
Joe Gregorio | 3b79fa8 | 2011-02-17 11:47:17 -0500 | [diff] [blame] | 91 | expire.<br> |
| 92 | <br> |
Joe Gregorio | fffa7d7 | 2011-02-18 17:20:39 -0500 | [diff] [blame] | 93 | <a href="#AccessTokenCredentials">AccessTokenCredentials</a> objects may be safely pickled and unpickled.<br> |
Joe Gregorio | 3b79fa8 | 2011-02-17 11:47:17 -0500 | [diff] [blame] | 94 | <br> |
| 95 | Usage:<br> |
| 96 | credentials = <a href="#AccessTokenCredentials">AccessTokenCredentials</a>('<an access token>',<br> |
| 97 | 'my-user-agent/1.0')<br> |
| 98 | http = httplib2.Http()<br> |
| 99 | http = credentials.<a href="#AccessTokenCredentials-authorize">authorize</a>(http)<br> |
| 100 | <br> |
| 101 | Exceptions:<br> |
| 102 | AccessTokenCredentialsExpired: raised when the access_token expires or is<br> |
| 103 | revoked.<br> </tt></td></tr> |
| 104 | <tr><td> </td> |
| 105 | <td width="100%"><dl><dt>Method resolution order:</dt> |
| 106 | <dd><a href="oauth2client.client.html#AccessTokenCredentials">AccessTokenCredentials</a></dd> |
| 107 | <dd><a href="oauth2client.client.html#OAuth2Credentials">OAuth2Credentials</a></dd> |
| 108 | <dd><a href="oauth2client.client.html#Credentials">Credentials</a></dd> |
| 109 | <dd><a href="__builtin__.html#object">__builtin__.object</a></dd> |
| 110 | </dl> |
| 111 | <hr> |
| 112 | Methods defined here:<br> |
| 113 | <dl><dt><a name="AccessTokenCredentials-__init__"><strong>__init__</strong></a>(self, access_token, user_agent)</dt><dd><tt>Create an instance of <a href="#OAuth2Credentials">OAuth2Credentials</a><br> |
| 114 | <br> |
| 115 | This is one of the few types if <a href="#Credentials">Credentials</a> that you should contrust,<br> |
| 116 | <a href="#Credentials">Credentials</a> objects are usually instantiated by a <a href="#Flow">Flow</a>.<br> |
| 117 | <br> |
| 118 | Args:<br> |
Joe Gregorio | 9384170 | 2011-03-02 16:12:05 -0800 | [diff] [blame] | 119 | access_token: string, access token.<br> |
Joe Gregorio | 3b79fa8 | 2011-02-17 11:47:17 -0500 | [diff] [blame] | 120 | user_agent: string, The HTTP User-Agent to provide for this application.<br> |
| 121 | <br> |
| 122 | Notes:<br> |
| 123 | store: callable, a callable that when passed a Credential<br> |
| 124 | will store the credential back to where it came from.</tt></dd></dl> |
| 125 | |
| 126 | <hr> |
Joe Gregorio | a845167 | 2011-09-15 09:53:21 -0400 | [diff] [blame] | 127 | Class methods defined here:<br> |
| 128 | <dl><dt><a name="AccessTokenCredentials-from_json"><strong>from_json</strong></a>(cls, s)<font color="#909090"><font face="helvetica, arial"> from <a href="__builtin__.html#type">__builtin__.type</a></font></font></dt></dl> |
| 129 | |
| 130 | <hr> |
Joe Gregorio | 3b79fa8 | 2011-02-17 11:47:17 -0500 | [diff] [blame] | 131 | Methods inherited from <a href="oauth2client.client.html#OAuth2Credentials">OAuth2Credentials</a>:<br> |
| 132 | <dl><dt><a name="AccessTokenCredentials-__getstate__"><strong>__getstate__</strong></a>(self)</dt><dd><tt>Trim the state down to something that can be pickled.</tt></dd></dl> |
| 133 | |
| 134 | <dl><dt><a name="AccessTokenCredentials-__setstate__"><strong>__setstate__</strong></a>(self, state)</dt><dd><tt>Reconstitute the state of the <a href="__builtin__.html#object">object</a> from being pickled.</tt></dd></dl> |
| 135 | |
| 136 | <dl><dt><a name="AccessTokenCredentials-authorize"><strong>authorize</strong></a>(self, http)</dt><dd><tt>Authorize an httplib2.Http instance with these credentials.<br> |
| 137 | <br> |
| 138 | Args:<br> |
| 139 | http: An instance of httplib2.Http<br> |
| 140 | or something that acts like it.<br> |
| 141 | <br> |
| 142 | Returns:<br> |
| 143 | A modified instance of http that was passed in.<br> |
| 144 | <br> |
| 145 | Example:<br> |
| 146 | <br> |
| 147 | h = httplib2.Http()<br> |
| 148 | h = credentials.<a href="#AccessTokenCredentials-authorize">authorize</a>(h)<br> |
| 149 | <br> |
Joe Gregorio | a845167 | 2011-09-15 09:53:21 -0400 | [diff] [blame] | 150 | You can't create a new OAuth subclass of httplib2.Authenication<br> |
| 151 | because it never gets passed the absolute URI, which is needed for<br> |
| 152 | signing. So instead we have to overload 'request' with a closure<br> |
| 153 | that adds in the Authorization header and then calls the original<br> |
| 154 | version of 'request()'.</tt></dd></dl> |
Joe Gregorio | 3b79fa8 | 2011-02-17 11:47:17 -0500 | [diff] [blame] | 155 | |
Joe Gregorio | a845167 | 2011-09-15 09:53:21 -0400 | [diff] [blame] | 156 | <dl><dt><a name="AccessTokenCredentials-set_store"><strong>set_store</strong></a>(self, store)</dt><dd><tt>Set the <a href="#Storage">Storage</a> for the credential.<br> |
Joe Gregorio | 3b79fa8 | 2011-02-17 11:47:17 -0500 | [diff] [blame] | 157 | <br> |
| 158 | Args:<br> |
Joe Gregorio | a845167 | 2011-09-15 09:53:21 -0400 | [diff] [blame] | 159 | store: <a href="#Storage">Storage</a>, an implementation of Stroage <a href="__builtin__.html#object">object</a>.<br> |
Joe Gregorio | 3b79fa8 | 2011-02-17 11:47:17 -0500 | [diff] [blame] | 160 | This is needed to store the latest access_token if it<br> |
Joe Gregorio | a845167 | 2011-09-15 09:53:21 -0400 | [diff] [blame] | 161 | has expired and been refreshed. This implementation uses<br> |
| 162 | locking to check for updates before updating the<br> |
| 163 | access_token.</tt></dd></dl> |
| 164 | |
| 165 | <dl><dt><a name="AccessTokenCredentials-to_json"><strong>to_json</strong></a>(self)</dt></dl> |
Joe Gregorio | 3b79fa8 | 2011-02-17 11:47:17 -0500 | [diff] [blame] | 166 | |
| 167 | <hr> |
Joe Gregorio | 9ce4b62 | 2011-02-17 15:32:11 -0500 | [diff] [blame] | 168 | Data descriptors inherited from <a href="oauth2client.client.html#OAuth2Credentials">OAuth2Credentials</a>:<br> |
Joe Gregorio | a845167 | 2011-09-15 09:53:21 -0400 | [diff] [blame] | 169 | <dl><dt><strong>access_token_expired</strong></dt> |
| 170 | <dd><tt>True if the credential is expired or invalid.<br> |
| 171 | <br> |
| 172 | If the token_expiry isn't set, we assume the token doesn't expire.</tt></dd> |
Joe Gregorio | 9ce4b62 | 2011-02-17 15:32:11 -0500 | [diff] [blame] | 173 | </dl> |
| 174 | <hr> |
Joe Gregorio | a845167 | 2011-09-15 09:53:21 -0400 | [diff] [blame] | 175 | Class methods inherited from <a href="oauth2client.client.html#Credentials">Credentials</a>:<br> |
| 176 | <dl><dt><a name="AccessTokenCredentials-new_from_json"><strong>new_from_json</strong></a>(cls, s)<font color="#909090"><font face="helvetica, arial"> from <a href="__builtin__.html#type">__builtin__.type</a></font></font></dt><dd><tt>Utility class method to instantiate a <a href="#Credentials">Credentials</a> subclass from a JSON<br> |
| 177 | representation produced by <a href="#AccessTokenCredentials-to_json">to_json</a>().<br> |
| 178 | <br> |
| 179 | Args:<br> |
| 180 | s: string, JSON from <a href="#AccessTokenCredentials-to_json">to_json</a>().<br> |
| 181 | <br> |
| 182 | Returns:<br> |
| 183 | An instance of the subclass of <a href="#Credentials">Credentials</a> that was serialized with<br> |
| 184 | <a href="#AccessTokenCredentials-to_json">to_json</a>().</tt></dd></dl> |
| 185 | |
| 186 | <hr> |
Joe Gregorio | 3b79fa8 | 2011-02-17 11:47:17 -0500 | [diff] [blame] | 187 | Data descriptors inherited from <a href="oauth2client.client.html#Credentials">Credentials</a>:<br> |
| 188 | <dl><dt><strong>__dict__</strong></dt> |
| 189 | <dd><tt>dictionary for instance variables (if defined)</tt></dd> |
| 190 | </dl> |
| 191 | <dl><dt><strong>__weakref__</strong></dt> |
| 192 | <dd><tt>list of weak references to the object (if defined)</tt></dd> |
| 193 | </dl> |
Joe Gregorio | a845167 | 2011-09-15 09:53:21 -0400 | [diff] [blame] | 194 | <hr> |
| 195 | Data and other attributes inherited from <a href="oauth2client.client.html#Credentials">Credentials</a>:<br> |
| 196 | <dl><dt><strong>NON_SERIALIZED_MEMBERS</strong> = ['store']</dl> |
| 197 | |
Joe Gregorio | 3b79fa8 | 2011-02-17 11:47:17 -0500 | [diff] [blame] | 198 | </td></tr></table> <p> |
| 199 | <table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section"> |
| 200 | <tr bgcolor="#ffc8d8"> |
| 201 | <td colspan=3 valign=bottom> <br> |
| 202 | <font color="#000000" face="helvetica, arial"><a name="AccessTokenCredentialsError">class <strong>AccessTokenCredentialsError</strong></a>(<a href="oauth2client.client.html#Error">Error</a>)</font></td></tr> |
| 203 | |
| 204 | <tr bgcolor="#ffc8d8"><td rowspan=2><tt> </tt></td> |
| 205 | <td colspan=2><tt>Having only the access_token means no refresh is possible.<br> </tt></td></tr> |
| 206 | <tr><td> </td> |
| 207 | <td width="100%"><dl><dt>Method resolution order:</dt> |
| 208 | <dd><a href="oauth2client.client.html#AccessTokenCredentialsError">AccessTokenCredentialsError</a></dd> |
| 209 | <dd><a href="oauth2client.client.html#Error">Error</a></dd> |
| 210 | <dd><a href="exceptions.html#Exception">exceptions.Exception</a></dd> |
| 211 | <dd><a href="exceptions.html#BaseException">exceptions.BaseException</a></dd> |
| 212 | <dd><a href="__builtin__.html#object">__builtin__.object</a></dd> |
| 213 | </dl> |
| 214 | <hr> |
| 215 | Data descriptors inherited from <a href="oauth2client.client.html#Error">Error</a>:<br> |
| 216 | <dl><dt><strong>__weakref__</strong></dt> |
| 217 | <dd><tt>list of weak references to the object (if defined)</tt></dd> |
| 218 | </dl> |
| 219 | <hr> |
| 220 | Methods inherited from <a href="exceptions.html#Exception">exceptions.Exception</a>:<br> |
Joe Gregorio | 90e7ec2 | 2011-07-06 10:09:20 -0400 | [diff] [blame] | 221 | <dl><dt><a name="AccessTokenCredentialsError-__init__"><strong>__init__</strong></a>(...)</dt><dd><tt>x.<a href="#AccessTokenCredentialsError-__init__">__init__</a>(...) initializes x; see x.__class__.__doc__ for signature</tt></dd></dl> |
Joe Gregorio | 3b79fa8 | 2011-02-17 11:47:17 -0500 | [diff] [blame] | 222 | |
| 223 | <hr> |
| 224 | Data and other attributes inherited from <a href="exceptions.html#Exception">exceptions.Exception</a>:<br> |
| 225 | <dl><dt><strong>__new__</strong> = <built-in method __new__ of type object><dd><tt>T.<a href="#AccessTokenCredentialsError-__new__">__new__</a>(S, ...) -> a new <a href="__builtin__.html#object">object</a> with type S, a subtype of T</tt></dl> |
| 226 | |
| 227 | <hr> |
| 228 | Methods inherited from <a href="exceptions.html#BaseException">exceptions.BaseException</a>:<br> |
| 229 | <dl><dt><a name="AccessTokenCredentialsError-__delattr__"><strong>__delattr__</strong></a>(...)</dt><dd><tt>x.<a href="#AccessTokenCredentialsError-__delattr__">__delattr__</a>('name') <==> del x.name</tt></dd></dl> |
| 230 | |
| 231 | <dl><dt><a name="AccessTokenCredentialsError-__getattribute__"><strong>__getattribute__</strong></a>(...)</dt><dd><tt>x.<a href="#AccessTokenCredentialsError-__getattribute__">__getattribute__</a>('name') <==> x.name</tt></dd></dl> |
| 232 | |
| 233 | <dl><dt><a name="AccessTokenCredentialsError-__getitem__"><strong>__getitem__</strong></a>(...)</dt><dd><tt>x.<a href="#AccessTokenCredentialsError-__getitem__">__getitem__</a>(y) <==> x[y]</tt></dd></dl> |
| 234 | |
| 235 | <dl><dt><a name="AccessTokenCredentialsError-__getslice__"><strong>__getslice__</strong></a>(...)</dt><dd><tt>x.<a href="#AccessTokenCredentialsError-__getslice__">__getslice__</a>(i, j) <==> x[i:j]<br> |
| 236 | <br> |
| 237 | Use of negative indices is not supported.</tt></dd></dl> |
| 238 | |
| 239 | <dl><dt><a name="AccessTokenCredentialsError-__reduce__"><strong>__reduce__</strong></a>(...)</dt></dl> |
| 240 | |
| 241 | <dl><dt><a name="AccessTokenCredentialsError-__repr__"><strong>__repr__</strong></a>(...)</dt><dd><tt>x.<a href="#AccessTokenCredentialsError-__repr__">__repr__</a>() <==> repr(x)</tt></dd></dl> |
| 242 | |
| 243 | <dl><dt><a name="AccessTokenCredentialsError-__setattr__"><strong>__setattr__</strong></a>(...)</dt><dd><tt>x.<a href="#AccessTokenCredentialsError-__setattr__">__setattr__</a>('name', value) <==> x.name = value</tt></dd></dl> |
| 244 | |
| 245 | <dl><dt><a name="AccessTokenCredentialsError-__setstate__"><strong>__setstate__</strong></a>(...)</dt></dl> |
| 246 | |
| 247 | <dl><dt><a name="AccessTokenCredentialsError-__str__"><strong>__str__</strong></a>(...)</dt><dd><tt>x.<a href="#AccessTokenCredentialsError-__str__">__str__</a>() <==> str(x)</tt></dd></dl> |
| 248 | |
| 249 | <dl><dt><a name="AccessTokenCredentialsError-__unicode__"><strong>__unicode__</strong></a>(...)</dt></dl> |
| 250 | |
| 251 | <hr> |
| 252 | Data descriptors inherited from <a href="exceptions.html#BaseException">exceptions.BaseException</a>:<br> |
| 253 | <dl><dt><strong>__dict__</strong></dt> |
| 254 | </dl> |
| 255 | <dl><dt><strong>args</strong></dt> |
| 256 | </dl> |
| 257 | <dl><dt><strong>message</strong></dt> |
| 258 | </dl> |
| 259 | </td></tr></table> <p> |
| 260 | <table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section"> |
| 261 | <tr bgcolor="#ffc8d8"> |
| 262 | <td colspan=3 valign=bottom> <br> |
Joe Gregorio | f826111 | 2011-02-19 14:51:56 -0500 | [diff] [blame] | 263 | <font color="#000000" face="helvetica, arial"><a name="AccessTokenRefreshError">class <strong>AccessTokenRefreshError</strong></a>(<a href="oauth2client.client.html#Error">Error</a>)</font></td></tr> |
| 264 | |
| 265 | <tr bgcolor="#ffc8d8"><td rowspan=2><tt> </tt></td> |
Joe Gregorio | ad258e2 | 2011-02-22 22:53:30 -0500 | [diff] [blame] | 266 | <td colspan=2><tt><a href="#Error">Error</a> trying to refresh an expired access token.<br> </tt></td></tr> |
Joe Gregorio | f826111 | 2011-02-19 14:51:56 -0500 | [diff] [blame] | 267 | <tr><td> </td> |
| 268 | <td width="100%"><dl><dt>Method resolution order:</dt> |
| 269 | <dd><a href="oauth2client.client.html#AccessTokenRefreshError">AccessTokenRefreshError</a></dd> |
| 270 | <dd><a href="oauth2client.client.html#Error">Error</a></dd> |
| 271 | <dd><a href="exceptions.html#Exception">exceptions.Exception</a></dd> |
| 272 | <dd><a href="exceptions.html#BaseException">exceptions.BaseException</a></dd> |
| 273 | <dd><a href="__builtin__.html#object">__builtin__.object</a></dd> |
| 274 | </dl> |
| 275 | <hr> |
| 276 | Data descriptors inherited from <a href="oauth2client.client.html#Error">Error</a>:<br> |
| 277 | <dl><dt><strong>__weakref__</strong></dt> |
| 278 | <dd><tt>list of weak references to the object (if defined)</tt></dd> |
| 279 | </dl> |
| 280 | <hr> |
| 281 | Methods inherited from <a href="exceptions.html#Exception">exceptions.Exception</a>:<br> |
Joe Gregorio | 90e7ec2 | 2011-07-06 10:09:20 -0400 | [diff] [blame] | 282 | <dl><dt><a name="AccessTokenRefreshError-__init__"><strong>__init__</strong></a>(...)</dt><dd><tt>x.<a href="#AccessTokenRefreshError-__init__">__init__</a>(...) initializes x; see x.__class__.__doc__ for signature</tt></dd></dl> |
Joe Gregorio | f826111 | 2011-02-19 14:51:56 -0500 | [diff] [blame] | 283 | |
| 284 | <hr> |
| 285 | Data and other attributes inherited from <a href="exceptions.html#Exception">exceptions.Exception</a>:<br> |
| 286 | <dl><dt><strong>__new__</strong> = <built-in method __new__ of type object><dd><tt>T.<a href="#AccessTokenRefreshError-__new__">__new__</a>(S, ...) -> a new <a href="__builtin__.html#object">object</a> with type S, a subtype of T</tt></dl> |
| 287 | |
| 288 | <hr> |
| 289 | Methods inherited from <a href="exceptions.html#BaseException">exceptions.BaseException</a>:<br> |
| 290 | <dl><dt><a name="AccessTokenRefreshError-__delattr__"><strong>__delattr__</strong></a>(...)</dt><dd><tt>x.<a href="#AccessTokenRefreshError-__delattr__">__delattr__</a>('name') <==> del x.name</tt></dd></dl> |
| 291 | |
| 292 | <dl><dt><a name="AccessTokenRefreshError-__getattribute__"><strong>__getattribute__</strong></a>(...)</dt><dd><tt>x.<a href="#AccessTokenRefreshError-__getattribute__">__getattribute__</a>('name') <==> x.name</tt></dd></dl> |
| 293 | |
| 294 | <dl><dt><a name="AccessTokenRefreshError-__getitem__"><strong>__getitem__</strong></a>(...)</dt><dd><tt>x.<a href="#AccessTokenRefreshError-__getitem__">__getitem__</a>(y) <==> x[y]</tt></dd></dl> |
| 295 | |
| 296 | <dl><dt><a name="AccessTokenRefreshError-__getslice__"><strong>__getslice__</strong></a>(...)</dt><dd><tt>x.<a href="#AccessTokenRefreshError-__getslice__">__getslice__</a>(i, j) <==> x[i:j]<br> |
| 297 | <br> |
| 298 | Use of negative indices is not supported.</tt></dd></dl> |
| 299 | |
| 300 | <dl><dt><a name="AccessTokenRefreshError-__reduce__"><strong>__reduce__</strong></a>(...)</dt></dl> |
| 301 | |
| 302 | <dl><dt><a name="AccessTokenRefreshError-__repr__"><strong>__repr__</strong></a>(...)</dt><dd><tt>x.<a href="#AccessTokenRefreshError-__repr__">__repr__</a>() <==> repr(x)</tt></dd></dl> |
| 303 | |
| 304 | <dl><dt><a name="AccessTokenRefreshError-__setattr__"><strong>__setattr__</strong></a>(...)</dt><dd><tt>x.<a href="#AccessTokenRefreshError-__setattr__">__setattr__</a>('name', value) <==> x.name = value</tt></dd></dl> |
| 305 | |
| 306 | <dl><dt><a name="AccessTokenRefreshError-__setstate__"><strong>__setstate__</strong></a>(...)</dt></dl> |
| 307 | |
| 308 | <dl><dt><a name="AccessTokenRefreshError-__str__"><strong>__str__</strong></a>(...)</dt><dd><tt>x.<a href="#AccessTokenRefreshError-__str__">__str__</a>() <==> str(x)</tt></dd></dl> |
| 309 | |
| 310 | <dl><dt><a name="AccessTokenRefreshError-__unicode__"><strong>__unicode__</strong></a>(...)</dt></dl> |
| 311 | |
| 312 | <hr> |
| 313 | Data descriptors inherited from <a href="exceptions.html#BaseException">exceptions.BaseException</a>:<br> |
| 314 | <dl><dt><strong>__dict__</strong></dt> |
| 315 | </dl> |
| 316 | <dl><dt><strong>args</strong></dt> |
| 317 | </dl> |
| 318 | <dl><dt><strong>message</strong></dt> |
| 319 | </dl> |
| 320 | </td></tr></table> <p> |
| 321 | <table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section"> |
| 322 | <tr bgcolor="#ffc8d8"> |
| 323 | <td colspan=3 valign=bottom> <br> |
Joe Gregorio | b9e63ff | 2011-06-30 12:38:10 -0400 | [diff] [blame] | 324 | <font color="#000000" face="helvetica, arial"><a name="AssertionCredentials">class <strong>AssertionCredentials</strong></a>(<a href="oauth2client.client.html#OAuth2Credentials">OAuth2Credentials</a>)</font></td></tr> |
| 325 | |
| 326 | <tr bgcolor="#ffc8d8"><td rowspan=2><tt> </tt></td> |
Joe Gregorio | a845167 | 2011-09-15 09:53:21 -0400 | [diff] [blame] | 327 | <td colspan=2><tt>Abstract <a href="#Credentials">Credentials</a> <a href="__builtin__.html#object">object</a> used for OAuth 2.0 assertion grants.<br> |
Joe Gregorio | b9e63ff | 2011-06-30 12:38:10 -0400 | [diff] [blame] | 328 | <br> |
Joe Gregorio | a845167 | 2011-09-15 09:53:21 -0400 | [diff] [blame] | 329 | This credential does not require a flow to instantiate because it<br> |
| 330 | represents a two legged flow, and therefore has all of the required<br> |
| 331 | information to generate and refresh its own access tokens. It must<br> |
| 332 | be subclassed to generate the appropriate assertion string.<br> |
Joe Gregorio | b9e63ff | 2011-06-30 12:38:10 -0400 | [diff] [blame] | 333 | <br> |
| 334 | <a href="#AssertionCredentials">AssertionCredentials</a> objects may be safely pickled and unpickled.<br> </tt></td></tr> |
| 335 | <tr><td> </td> |
| 336 | <td width="100%"><dl><dt>Method resolution order:</dt> |
| 337 | <dd><a href="oauth2client.client.html#AssertionCredentials">AssertionCredentials</a></dd> |
| 338 | <dd><a href="oauth2client.client.html#OAuth2Credentials">OAuth2Credentials</a></dd> |
| 339 | <dd><a href="oauth2client.client.html#Credentials">Credentials</a></dd> |
| 340 | <dd><a href="__builtin__.html#object">__builtin__.object</a></dd> |
| 341 | </dl> |
| 342 | <hr> |
| 343 | Methods defined here:<br> |
Joe Gregorio | a845167 | 2011-09-15 09:53:21 -0400 | [diff] [blame] | 344 | <dl><dt><a name="AssertionCredentials-__init__"><strong>__init__</strong></a>(self, assertion_type, user_agent, token_uri<font color="#909090">='https://accounts.google.com/o/oauth2/token'</font>, **unused_kwargs)</dt><dd><tt>Constructor for AssertionFlowCredentials.<br> |
Joe Gregorio | b9e63ff | 2011-06-30 12:38:10 -0400 | [diff] [blame] | 345 | <br> |
| 346 | Args:<br> |
| 347 | assertion_type: string, assertion type that will be declared to the auth<br> |
| 348 | server<br> |
| 349 | user_agent: string, The HTTP User-Agent to provide for this application.<br> |
| 350 | token_uri: string, URI for token endpoint. For convenience<br> |
| 351 | defaults to Google's endpoints but any OAuth 2.0 provider can be used.</tt></dd></dl> |
| 352 | |
| 353 | <hr> |
| 354 | Methods inherited from <a href="oauth2client.client.html#OAuth2Credentials">OAuth2Credentials</a>:<br> |
| 355 | <dl><dt><a name="AssertionCredentials-__getstate__"><strong>__getstate__</strong></a>(self)</dt><dd><tt>Trim the state down to something that can be pickled.</tt></dd></dl> |
| 356 | |
| 357 | <dl><dt><a name="AssertionCredentials-__setstate__"><strong>__setstate__</strong></a>(self, state)</dt><dd><tt>Reconstitute the state of the <a href="__builtin__.html#object">object</a> from being pickled.</tt></dd></dl> |
| 358 | |
| 359 | <dl><dt><a name="AssertionCredentials-authorize"><strong>authorize</strong></a>(self, http)</dt><dd><tt>Authorize an httplib2.Http instance with these credentials.<br> |
| 360 | <br> |
| 361 | Args:<br> |
| 362 | http: An instance of httplib2.Http<br> |
| 363 | or something that acts like it.<br> |
| 364 | <br> |
| 365 | Returns:<br> |
| 366 | A modified instance of http that was passed in.<br> |
| 367 | <br> |
| 368 | Example:<br> |
| 369 | <br> |
| 370 | h = httplib2.Http()<br> |
| 371 | h = credentials.<a href="#AssertionCredentials-authorize">authorize</a>(h)<br> |
| 372 | <br> |
Joe Gregorio | a845167 | 2011-09-15 09:53:21 -0400 | [diff] [blame] | 373 | You can't create a new OAuth subclass of httplib2.Authenication<br> |
| 374 | because it never gets passed the absolute URI, which is needed for<br> |
| 375 | signing. So instead we have to overload 'request' with a closure<br> |
| 376 | that adds in the Authorization header and then calls the original<br> |
| 377 | version of 'request()'.</tt></dd></dl> |
Joe Gregorio | b9e63ff | 2011-06-30 12:38:10 -0400 | [diff] [blame] | 378 | |
Joe Gregorio | a845167 | 2011-09-15 09:53:21 -0400 | [diff] [blame] | 379 | <dl><dt><a name="AssertionCredentials-set_store"><strong>set_store</strong></a>(self, store)</dt><dd><tt>Set the <a href="#Storage">Storage</a> for the credential.<br> |
Joe Gregorio | b9e63ff | 2011-06-30 12:38:10 -0400 | [diff] [blame] | 380 | <br> |
| 381 | Args:<br> |
Joe Gregorio | a845167 | 2011-09-15 09:53:21 -0400 | [diff] [blame] | 382 | store: <a href="#Storage">Storage</a>, an implementation of Stroage <a href="__builtin__.html#object">object</a>.<br> |
Joe Gregorio | b9e63ff | 2011-06-30 12:38:10 -0400 | [diff] [blame] | 383 | This is needed to store the latest access_token if it<br> |
Joe Gregorio | a845167 | 2011-09-15 09:53:21 -0400 | [diff] [blame] | 384 | has expired and been refreshed. This implementation uses<br> |
| 385 | locking to check for updates before updating the<br> |
| 386 | access_token.</tt></dd></dl> |
| 387 | |
| 388 | <dl><dt><a name="AssertionCredentials-to_json"><strong>to_json</strong></a>(self)</dt></dl> |
| 389 | |
| 390 | <hr> |
| 391 | Class methods inherited from <a href="oauth2client.client.html#OAuth2Credentials">OAuth2Credentials</a>:<br> |
| 392 | <dl><dt><a name="AssertionCredentials-from_json"><strong>from_json</strong></a>(cls, s)<font color="#909090"><font face="helvetica, arial"> from <a href="__builtin__.html#type">__builtin__.type</a></font></font></dt><dd><tt>Instantiate a <a href="#Credentials">Credentials</a> <a href="__builtin__.html#object">object</a> from a JSON description of it. The JSON<br> |
| 393 | should have been produced by calling .<a href="#AssertionCredentials-to_json">to_json</a>() on the <a href="__builtin__.html#object">object</a>.<br> |
| 394 | <br> |
| 395 | Args:<br> |
| 396 | data: dict, A deserialized JSON <a href="__builtin__.html#object">object</a>.<br> |
| 397 | <br> |
| 398 | Returns:<br> |
| 399 | An instance of a <a href="#Credentials">Credentials</a> subclass.</tt></dd></dl> |
Joe Gregorio | b9e63ff | 2011-06-30 12:38:10 -0400 | [diff] [blame] | 400 | |
| 401 | <hr> |
| 402 | Data descriptors inherited from <a href="oauth2client.client.html#OAuth2Credentials">OAuth2Credentials</a>:<br> |
Joe Gregorio | a845167 | 2011-09-15 09:53:21 -0400 | [diff] [blame] | 403 | <dl><dt><strong>access_token_expired</strong></dt> |
| 404 | <dd><tt>True if the credential is expired or invalid.<br> |
| 405 | <br> |
| 406 | If the token_expiry isn't set, we assume the token doesn't expire.</tt></dd> |
Joe Gregorio | b9e63ff | 2011-06-30 12:38:10 -0400 | [diff] [blame] | 407 | </dl> |
| 408 | <hr> |
Joe Gregorio | a845167 | 2011-09-15 09:53:21 -0400 | [diff] [blame] | 409 | Class methods inherited from <a href="oauth2client.client.html#Credentials">Credentials</a>:<br> |
| 410 | <dl><dt><a name="AssertionCredentials-new_from_json"><strong>new_from_json</strong></a>(cls, s)<font color="#909090"><font face="helvetica, arial"> from <a href="__builtin__.html#type">__builtin__.type</a></font></font></dt><dd><tt>Utility class method to instantiate a <a href="#Credentials">Credentials</a> subclass from a JSON<br> |
| 411 | representation produced by <a href="#AssertionCredentials-to_json">to_json</a>().<br> |
| 412 | <br> |
| 413 | Args:<br> |
| 414 | s: string, JSON from <a href="#AssertionCredentials-to_json">to_json</a>().<br> |
| 415 | <br> |
| 416 | Returns:<br> |
| 417 | An instance of the subclass of <a href="#Credentials">Credentials</a> that was serialized with<br> |
| 418 | <a href="#AssertionCredentials-to_json">to_json</a>().</tt></dd></dl> |
| 419 | |
| 420 | <hr> |
Joe Gregorio | b9e63ff | 2011-06-30 12:38:10 -0400 | [diff] [blame] | 421 | Data descriptors inherited from <a href="oauth2client.client.html#Credentials">Credentials</a>:<br> |
| 422 | <dl><dt><strong>__dict__</strong></dt> |
| 423 | <dd><tt>dictionary for instance variables (if defined)</tt></dd> |
| 424 | </dl> |
| 425 | <dl><dt><strong>__weakref__</strong></dt> |
| 426 | <dd><tt>list of weak references to the object (if defined)</tt></dd> |
| 427 | </dl> |
Joe Gregorio | a845167 | 2011-09-15 09:53:21 -0400 | [diff] [blame] | 428 | <hr> |
| 429 | Data and other attributes inherited from <a href="oauth2client.client.html#Credentials">Credentials</a>:<br> |
| 430 | <dl><dt><strong>NON_SERIALIZED_MEMBERS</strong> = ['store']</dl> |
| 431 | |
Joe Gregorio | b9e63ff | 2011-06-30 12:38:10 -0400 | [diff] [blame] | 432 | </td></tr></table> <p> |
| 433 | <table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section"> |
| 434 | <tr bgcolor="#ffc8d8"> |
| 435 | <td colspan=3 valign=bottom> <br> |
Joe Gregorio | 6e53703 | 2011-02-09 23:04:26 -0500 | [diff] [blame] | 436 | <font color="#000000" face="helvetica, arial"><a name="Credentials">class <strong>Credentials</strong></a>(<a href="__builtin__.html#object">__builtin__.object</a>)</font></td></tr> |
| 437 | |
| 438 | <tr bgcolor="#ffc8d8"><td rowspan=2><tt> </tt></td> |
| 439 | <td colspan=2><tt>Base class for all <a href="#Credentials">Credentials</a> objects.<br> |
| 440 | <br> |
Joe Gregorio | a845167 | 2011-09-15 09:53:21 -0400 | [diff] [blame] | 441 | Subclasses must define an <a href="#Credentials-authorize">authorize</a>() method that applies the credentials to<br> |
| 442 | an HTTP transport.<br> |
| 443 | <br> |
| 444 | Subclasses must also specify a classmethod named 'from_json' that takes a JSON<br> |
| 445 | string as input and returns an instaniated Crentials <a href="__builtin__.html#object">object</a>.<br> </tt></td></tr> |
Joe Gregorio | 6e53703 | 2011-02-09 23:04:26 -0500 | [diff] [blame] | 446 | <tr><td> </td> |
| 447 | <td width="100%">Methods defined here:<br> |
| 448 | <dl><dt><a name="Credentials-authorize"><strong>authorize</strong></a>(self, http)</dt><dd><tt>Take an httplib2.Http instance (or equivalent) and<br> |
| 449 | authorizes it for the set of credentials, usually by<br> |
| 450 | replacing http.request() with a method that adds in<br> |
| 451 | the appropriate headers and then delegates to the original<br> |
| 452 | Http.request() method.</tt></dd></dl> |
| 453 | |
Joe Gregorio | a845167 | 2011-09-15 09:53:21 -0400 | [diff] [blame] | 454 | <dl><dt><a name="Credentials-to_json"><strong>to_json</strong></a>(self)</dt><dd><tt>Creating a JSON representation of an instance of <a href="#Credentials">Credentials</a>.<br> |
| 455 | <br> |
| 456 | Returns:<br> |
| 457 | string, a JSON representation of this instance, suitable to pass to<br> |
| 458 | from_json().</tt></dd></dl> |
| 459 | |
| 460 | <hr> |
| 461 | Class methods defined here:<br> |
| 462 | <dl><dt><a name="Credentials-new_from_json"><strong>new_from_json</strong></a>(cls, s)<font color="#909090"><font face="helvetica, arial"> from <a href="__builtin__.html#type">__builtin__.type</a></font></font></dt><dd><tt>Utility class method to instantiate a <a href="#Credentials">Credentials</a> subclass from a JSON<br> |
| 463 | representation produced by <a href="#Credentials-to_json">to_json</a>().<br> |
| 464 | <br> |
| 465 | Args:<br> |
| 466 | s: string, JSON from <a href="#Credentials-to_json">to_json</a>().<br> |
| 467 | <br> |
| 468 | Returns:<br> |
| 469 | An instance of the subclass of <a href="#Credentials">Credentials</a> that was serialized with<br> |
| 470 | <a href="#Credentials-to_json">to_json</a>().</tt></dd></dl> |
| 471 | |
Joe Gregorio | 6e53703 | 2011-02-09 23:04:26 -0500 | [diff] [blame] | 472 | <hr> |
| 473 | Data descriptors defined here:<br> |
| 474 | <dl><dt><strong>__dict__</strong></dt> |
| 475 | <dd><tt>dictionary for instance variables (if defined)</tt></dd> |
| 476 | </dl> |
| 477 | <dl><dt><strong>__weakref__</strong></dt> |
| 478 | <dd><tt>list of weak references to the object (if defined)</tt></dd> |
| 479 | </dl> |
Joe Gregorio | a845167 | 2011-09-15 09:53:21 -0400 | [diff] [blame] | 480 | <hr> |
| 481 | Data and other attributes defined here:<br> |
| 482 | <dl><dt><strong>NON_SERIALIZED_MEMBERS</strong> = ['store']</dl> |
| 483 | |
Joe Gregorio | 6e53703 | 2011-02-09 23:04:26 -0500 | [diff] [blame] | 484 | </td></tr></table> <p> |
| 485 | <table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section"> |
| 486 | <tr bgcolor="#ffc8d8"> |
| 487 | <td colspan=3 valign=bottom> <br> |
| 488 | <font color="#000000" face="helvetica, arial"><a name="Error">class <strong>Error</strong></a>(<a href="exceptions.html#Exception">exceptions.Exception</a>)</font></td></tr> |
| 489 | |
| 490 | <tr bgcolor="#ffc8d8"><td rowspan=2><tt> </tt></td> |
| 491 | <td colspan=2><tt>Base error for this module.<br> </tt></td></tr> |
| 492 | <tr><td> </td> |
| 493 | <td width="100%"><dl><dt>Method resolution order:</dt> |
| 494 | <dd><a href="oauth2client.client.html#Error">Error</a></dd> |
| 495 | <dd><a href="exceptions.html#Exception">exceptions.Exception</a></dd> |
| 496 | <dd><a href="exceptions.html#BaseException">exceptions.BaseException</a></dd> |
| 497 | <dd><a href="__builtin__.html#object">__builtin__.object</a></dd> |
| 498 | </dl> |
| 499 | <hr> |
| 500 | Data descriptors defined here:<br> |
| 501 | <dl><dt><strong>__weakref__</strong></dt> |
| 502 | <dd><tt>list of weak references to the object (if defined)</tt></dd> |
| 503 | </dl> |
| 504 | <hr> |
| 505 | Methods inherited from <a href="exceptions.html#Exception">exceptions.Exception</a>:<br> |
Joe Gregorio | 90e7ec2 | 2011-07-06 10:09:20 -0400 | [diff] [blame] | 506 | <dl><dt><a name="Error-__init__"><strong>__init__</strong></a>(...)</dt><dd><tt>x.<a href="#Error-__init__">__init__</a>(...) initializes x; see x.__class__.__doc__ for signature</tt></dd></dl> |
Joe Gregorio | 6e53703 | 2011-02-09 23:04:26 -0500 | [diff] [blame] | 507 | |
| 508 | <hr> |
| 509 | Data and other attributes inherited from <a href="exceptions.html#Exception">exceptions.Exception</a>:<br> |
| 510 | <dl><dt><strong>__new__</strong> = <built-in method __new__ of type object><dd><tt>T.<a href="#Error-__new__">__new__</a>(S, ...) -> a new <a href="__builtin__.html#object">object</a> with type S, a subtype of T</tt></dl> |
| 511 | |
| 512 | <hr> |
| 513 | Methods inherited from <a href="exceptions.html#BaseException">exceptions.BaseException</a>:<br> |
| 514 | <dl><dt><a name="Error-__delattr__"><strong>__delattr__</strong></a>(...)</dt><dd><tt>x.<a href="#Error-__delattr__">__delattr__</a>('name') <==> del x.name</tt></dd></dl> |
| 515 | |
| 516 | <dl><dt><a name="Error-__getattribute__"><strong>__getattribute__</strong></a>(...)</dt><dd><tt>x.<a href="#Error-__getattribute__">__getattribute__</a>('name') <==> x.name</tt></dd></dl> |
| 517 | |
| 518 | <dl><dt><a name="Error-__getitem__"><strong>__getitem__</strong></a>(...)</dt><dd><tt>x.<a href="#Error-__getitem__">__getitem__</a>(y) <==> x[y]</tt></dd></dl> |
| 519 | |
| 520 | <dl><dt><a name="Error-__getslice__"><strong>__getslice__</strong></a>(...)</dt><dd><tt>x.<a href="#Error-__getslice__">__getslice__</a>(i, j) <==> x[i:j]<br> |
| 521 | <br> |
| 522 | Use of negative indices is not supported.</tt></dd></dl> |
| 523 | |
| 524 | <dl><dt><a name="Error-__reduce__"><strong>__reduce__</strong></a>(...)</dt></dl> |
| 525 | |
| 526 | <dl><dt><a name="Error-__repr__"><strong>__repr__</strong></a>(...)</dt><dd><tt>x.<a href="#Error-__repr__">__repr__</a>() <==> repr(x)</tt></dd></dl> |
| 527 | |
| 528 | <dl><dt><a name="Error-__setattr__"><strong>__setattr__</strong></a>(...)</dt><dd><tt>x.<a href="#Error-__setattr__">__setattr__</a>('name', value) <==> x.name = value</tt></dd></dl> |
| 529 | |
| 530 | <dl><dt><a name="Error-__setstate__"><strong>__setstate__</strong></a>(...)</dt></dl> |
| 531 | |
| 532 | <dl><dt><a name="Error-__str__"><strong>__str__</strong></a>(...)</dt><dd><tt>x.<a href="#Error-__str__">__str__</a>() <==> str(x)</tt></dd></dl> |
| 533 | |
| 534 | <dl><dt><a name="Error-__unicode__"><strong>__unicode__</strong></a>(...)</dt></dl> |
| 535 | |
| 536 | <hr> |
| 537 | Data descriptors inherited from <a href="exceptions.html#BaseException">exceptions.BaseException</a>:<br> |
| 538 | <dl><dt><strong>__dict__</strong></dt> |
| 539 | </dl> |
| 540 | <dl><dt><strong>args</strong></dt> |
| 541 | </dl> |
| 542 | <dl><dt><strong>message</strong></dt> |
| 543 | </dl> |
| 544 | </td></tr></table> <p> |
| 545 | <table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section"> |
| 546 | <tr bgcolor="#ffc8d8"> |
| 547 | <td colspan=3 valign=bottom> <br> |
| 548 | <font color="#000000" face="helvetica, arial"><a name="Flow">class <strong>Flow</strong></a>(<a href="__builtin__.html#object">__builtin__.object</a>)</font></td></tr> |
| 549 | |
| 550 | <tr bgcolor="#ffc8d8"><td rowspan=2><tt> </tt></td> |
| 551 | <td colspan=2><tt>Base class for all <a href="#Flow">Flow</a> objects.<br> </tt></td></tr> |
| 552 | <tr><td> </td> |
| 553 | <td width="100%">Data descriptors defined here:<br> |
| 554 | <dl><dt><strong>__dict__</strong></dt> |
| 555 | <dd><tt>dictionary for instance variables (if defined)</tt></dd> |
| 556 | </dl> |
| 557 | <dl><dt><strong>__weakref__</strong></dt> |
| 558 | <dd><tt>list of weak references to the object (if defined)</tt></dd> |
| 559 | </dl> |
| 560 | </td></tr></table> <p> |
| 561 | <table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section"> |
| 562 | <tr bgcolor="#ffc8d8"> |
| 563 | <td colspan=3 valign=bottom> <br> |
Joe Gregorio | f826111 | 2011-02-19 14:51:56 -0500 | [diff] [blame] | 564 | <font color="#000000" face="helvetica, arial"><a name="FlowExchangeError">class <strong>FlowExchangeError</strong></a>(<a href="oauth2client.client.html#Error">Error</a>)</font></td></tr> |
| 565 | |
| 566 | <tr bgcolor="#ffc8d8"><td rowspan=2><tt> </tt></td> |
Joe Gregorio | ad258e2 | 2011-02-22 22:53:30 -0500 | [diff] [blame] | 567 | <td colspan=2><tt><a href="#Error">Error</a> trying to exchange an authorization grant for an access token.<br> </tt></td></tr> |
Joe Gregorio | f826111 | 2011-02-19 14:51:56 -0500 | [diff] [blame] | 568 | <tr><td> </td> |
| 569 | <td width="100%"><dl><dt>Method resolution order:</dt> |
| 570 | <dd><a href="oauth2client.client.html#FlowExchangeError">FlowExchangeError</a></dd> |
| 571 | <dd><a href="oauth2client.client.html#Error">Error</a></dd> |
| 572 | <dd><a href="exceptions.html#Exception">exceptions.Exception</a></dd> |
| 573 | <dd><a href="exceptions.html#BaseException">exceptions.BaseException</a></dd> |
| 574 | <dd><a href="__builtin__.html#object">__builtin__.object</a></dd> |
| 575 | </dl> |
| 576 | <hr> |
| 577 | Data descriptors inherited from <a href="oauth2client.client.html#Error">Error</a>:<br> |
| 578 | <dl><dt><strong>__weakref__</strong></dt> |
| 579 | <dd><tt>list of weak references to the object (if defined)</tt></dd> |
| 580 | </dl> |
| 581 | <hr> |
| 582 | Methods inherited from <a href="exceptions.html#Exception">exceptions.Exception</a>:<br> |
Joe Gregorio | 90e7ec2 | 2011-07-06 10:09:20 -0400 | [diff] [blame] | 583 | <dl><dt><a name="FlowExchangeError-__init__"><strong>__init__</strong></a>(...)</dt><dd><tt>x.<a href="#FlowExchangeError-__init__">__init__</a>(...) initializes x; see x.__class__.__doc__ for signature</tt></dd></dl> |
Joe Gregorio | f826111 | 2011-02-19 14:51:56 -0500 | [diff] [blame] | 584 | |
| 585 | <hr> |
| 586 | Data and other attributes inherited from <a href="exceptions.html#Exception">exceptions.Exception</a>:<br> |
| 587 | <dl><dt><strong>__new__</strong> = <built-in method __new__ of type object><dd><tt>T.<a href="#FlowExchangeError-__new__">__new__</a>(S, ...) -> a new <a href="__builtin__.html#object">object</a> with type S, a subtype of T</tt></dl> |
| 588 | |
| 589 | <hr> |
| 590 | Methods inherited from <a href="exceptions.html#BaseException">exceptions.BaseException</a>:<br> |
| 591 | <dl><dt><a name="FlowExchangeError-__delattr__"><strong>__delattr__</strong></a>(...)</dt><dd><tt>x.<a href="#FlowExchangeError-__delattr__">__delattr__</a>('name') <==> del x.name</tt></dd></dl> |
| 592 | |
| 593 | <dl><dt><a name="FlowExchangeError-__getattribute__"><strong>__getattribute__</strong></a>(...)</dt><dd><tt>x.<a href="#FlowExchangeError-__getattribute__">__getattribute__</a>('name') <==> x.name</tt></dd></dl> |
| 594 | |
| 595 | <dl><dt><a name="FlowExchangeError-__getitem__"><strong>__getitem__</strong></a>(...)</dt><dd><tt>x.<a href="#FlowExchangeError-__getitem__">__getitem__</a>(y) <==> x[y]</tt></dd></dl> |
| 596 | |
| 597 | <dl><dt><a name="FlowExchangeError-__getslice__"><strong>__getslice__</strong></a>(...)</dt><dd><tt>x.<a href="#FlowExchangeError-__getslice__">__getslice__</a>(i, j) <==> x[i:j]<br> |
| 598 | <br> |
| 599 | Use of negative indices is not supported.</tt></dd></dl> |
| 600 | |
| 601 | <dl><dt><a name="FlowExchangeError-__reduce__"><strong>__reduce__</strong></a>(...)</dt></dl> |
| 602 | |
| 603 | <dl><dt><a name="FlowExchangeError-__repr__"><strong>__repr__</strong></a>(...)</dt><dd><tt>x.<a href="#FlowExchangeError-__repr__">__repr__</a>() <==> repr(x)</tt></dd></dl> |
| 604 | |
| 605 | <dl><dt><a name="FlowExchangeError-__setattr__"><strong>__setattr__</strong></a>(...)</dt><dd><tt>x.<a href="#FlowExchangeError-__setattr__">__setattr__</a>('name', value) <==> x.name = value</tt></dd></dl> |
| 606 | |
| 607 | <dl><dt><a name="FlowExchangeError-__setstate__"><strong>__setstate__</strong></a>(...)</dt></dl> |
| 608 | |
| 609 | <dl><dt><a name="FlowExchangeError-__str__"><strong>__str__</strong></a>(...)</dt><dd><tt>x.<a href="#FlowExchangeError-__str__">__str__</a>() <==> str(x)</tt></dd></dl> |
| 610 | |
| 611 | <dl><dt><a name="FlowExchangeError-__unicode__"><strong>__unicode__</strong></a>(...)</dt></dl> |
| 612 | |
| 613 | <hr> |
| 614 | Data descriptors inherited from <a href="exceptions.html#BaseException">exceptions.BaseException</a>:<br> |
| 615 | <dl><dt><strong>__dict__</strong></dt> |
| 616 | </dl> |
| 617 | <dl><dt><strong>args</strong></dt> |
| 618 | </dl> |
| 619 | <dl><dt><strong>message</strong></dt> |
| 620 | </dl> |
| 621 | </td></tr></table> <p> |
| 622 | <table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section"> |
| 623 | <tr bgcolor="#ffc8d8"> |
| 624 | <td colspan=3 valign=bottom> <br> |
Joe Gregorio | 6e53703 | 2011-02-09 23:04:26 -0500 | [diff] [blame] | 625 | <font color="#000000" face="helvetica, arial"><a name="OAuth2Credentials">class <strong>OAuth2Credentials</strong></a>(<a href="oauth2client.client.html#Credentials">Credentials</a>)</font></td></tr> |
| 626 | |
| 627 | <tr bgcolor="#ffc8d8"><td rowspan=2><tt> </tt></td> |
Joe Gregorio | a845167 | 2011-09-15 09:53:21 -0400 | [diff] [blame] | 628 | <td colspan=2><tt><a href="#Credentials">Credentials</a> <a href="__builtin__.html#object">object</a> for OAuth 2.0.<br> |
Joe Gregorio | 6e53703 | 2011-02-09 23:04:26 -0500 | [diff] [blame] | 629 | <br> |
Joe Gregorio | 3b79fa8 | 2011-02-17 11:47:17 -0500 | [diff] [blame] | 630 | <a href="#Credentials">Credentials</a> can be applied to an httplib2.Http <a href="__builtin__.html#object">object</a> using the <a href="#OAuth2Credentials-authorize">authorize</a>()<br> |
| 631 | method, which then signs each request from that <a href="__builtin__.html#object">object</a> with the OAuth 2.0<br> |
| 632 | access token.<br> |
Joe Gregorio | 6e53703 | 2011-02-09 23:04:26 -0500 | [diff] [blame] | 633 | <br> |
| 634 | <a href="#OAuth2Credentials">OAuth2Credentials</a> objects may be safely pickled and unpickled.<br> </tt></td></tr> |
| 635 | <tr><td> </td> |
| 636 | <td width="100%"><dl><dt>Method resolution order:</dt> |
| 637 | <dd><a href="oauth2client.client.html#OAuth2Credentials">OAuth2Credentials</a></dd> |
| 638 | <dd><a href="oauth2client.client.html#Credentials">Credentials</a></dd> |
| 639 | <dd><a href="__builtin__.html#object">__builtin__.object</a></dd> |
| 640 | </dl> |
| 641 | <hr> |
| 642 | Methods defined here:<br> |
| 643 | <dl><dt><a name="OAuth2Credentials-__getstate__"><strong>__getstate__</strong></a>(self)</dt><dd><tt>Trim the state down to something that can be pickled.</tt></dd></dl> |
| 644 | |
Joe Gregorio | a845167 | 2011-09-15 09:53:21 -0400 | [diff] [blame] | 645 | <dl><dt><a name="OAuth2Credentials-__init__"><strong>__init__</strong></a>(self, access_token, client_id, client_secret, refresh_token, token_expiry, token_uri, user_agent)</dt><dd><tt>Create an instance of <a href="#OAuth2Credentials">OAuth2Credentials</a>.<br> |
Joe Gregorio | 6e53703 | 2011-02-09 23:04:26 -0500 | [diff] [blame] | 646 | <br> |
| 647 | This constructor is not usually called by the user, instead<br> |
Joe Gregorio | 3b79fa8 | 2011-02-17 11:47:17 -0500 | [diff] [blame] | 648 | <a href="#OAuth2Credentials">OAuth2Credentials</a> objects are instantiated by the <a href="#OAuth2WebServerFlow">OAuth2WebServerFlow</a>.<br> |
Joe Gregorio | 6e53703 | 2011-02-09 23:04:26 -0500 | [diff] [blame] | 649 | <br> |
| 650 | Args:<br> |
Joe Gregorio | a845167 | 2011-09-15 09:53:21 -0400 | [diff] [blame] | 651 | access_token: string, access token.<br> |
Joe Gregorio | 3b79fa8 | 2011-02-17 11:47:17 -0500 | [diff] [blame] | 652 | client_id: string, client identifier.<br> |
| 653 | client_secret: string, client secret.<br> |
Joe Gregorio | 3b79fa8 | 2011-02-17 11:47:17 -0500 | [diff] [blame] | 654 | refresh_token: string, refresh token.<br> |
Joe Gregorio | a845167 | 2011-09-15 09:53:21 -0400 | [diff] [blame] | 655 | token_expiry: datetime, when the access_token expires.<br> |
| 656 | token_uri: string, URI of token endpoint.<br> |
Joe Gregorio | 6e53703 | 2011-02-09 23:04:26 -0500 | [diff] [blame] | 657 | user_agent: string, The HTTP User-Agent to provide for this application.<br> |
| 658 | <br> |
Joe Gregorio | 6e53703 | 2011-02-09 23:04:26 -0500 | [diff] [blame] | 659 | Notes:<br> |
| 660 | store: callable, a callable that when passed a Credential<br> |
| 661 | will store the credential back to where it came from.<br> |
| 662 | This is needed to store the latest access_token if it<br> |
| 663 | has expired and been refreshed.</tt></dd></dl> |
| 664 | |
| 665 | <dl><dt><a name="OAuth2Credentials-__setstate__"><strong>__setstate__</strong></a>(self, state)</dt><dd><tt>Reconstitute the state of the <a href="__builtin__.html#object">object</a> from being pickled.</tt></dd></dl> |
| 666 | |
Joe Gregorio | 3b79fa8 | 2011-02-17 11:47:17 -0500 | [diff] [blame] | 667 | <dl><dt><a name="OAuth2Credentials-authorize"><strong>authorize</strong></a>(self, http)</dt><dd><tt>Authorize an httplib2.Http instance with these credentials.<br> |
| 668 | <br> |
| 669 | Args:<br> |
Joe Gregorio | 6e53703 | 2011-02-09 23:04:26 -0500 | [diff] [blame] | 670 | http: An instance of httplib2.Http<br> |
| 671 | or something that acts like it.<br> |
| 672 | <br> |
| 673 | Returns:<br> |
| 674 | A modified instance of http that was passed in.<br> |
| 675 | <br> |
| 676 | Example:<br> |
| 677 | <br> |
| 678 | h = httplib2.Http()<br> |
| 679 | h = credentials.<a href="#OAuth2Credentials-authorize">authorize</a>(h)<br> |
| 680 | <br> |
Joe Gregorio | a845167 | 2011-09-15 09:53:21 -0400 | [diff] [blame] | 681 | You can't create a new OAuth subclass of httplib2.Authenication<br> |
| 682 | because it never gets passed the absolute URI, which is needed for<br> |
| 683 | signing. So instead we have to overload 'request' with a closure<br> |
| 684 | that adds in the Authorization header and then calls the original<br> |
| 685 | version of 'request()'.</tt></dd></dl> |
Joe Gregorio | 6e53703 | 2011-02-09 23:04:26 -0500 | [diff] [blame] | 686 | |
Joe Gregorio | a845167 | 2011-09-15 09:53:21 -0400 | [diff] [blame] | 687 | <dl><dt><a name="OAuth2Credentials-set_store"><strong>set_store</strong></a>(self, store)</dt><dd><tt>Set the <a href="#Storage">Storage</a> for the credential.<br> |
Joe Gregorio | 6e53703 | 2011-02-09 23:04:26 -0500 | [diff] [blame] | 688 | <br> |
| 689 | Args:<br> |
Joe Gregorio | a845167 | 2011-09-15 09:53:21 -0400 | [diff] [blame] | 690 | store: <a href="#Storage">Storage</a>, an implementation of Stroage <a href="__builtin__.html#object">object</a>.<br> |
Joe Gregorio | 6e53703 | 2011-02-09 23:04:26 -0500 | [diff] [blame] | 691 | This is needed to store the latest access_token if it<br> |
Joe Gregorio | a845167 | 2011-09-15 09:53:21 -0400 | [diff] [blame] | 692 | has expired and been refreshed. This implementation uses<br> |
| 693 | locking to check for updates before updating the<br> |
| 694 | access_token.</tt></dd></dl> |
| 695 | |
| 696 | <dl><dt><a name="OAuth2Credentials-to_json"><strong>to_json</strong></a>(self)</dt></dl> |
| 697 | |
| 698 | <hr> |
| 699 | Class methods defined here:<br> |
| 700 | <dl><dt><a name="OAuth2Credentials-from_json"><strong>from_json</strong></a>(cls, s)<font color="#909090"><font face="helvetica, arial"> from <a href="__builtin__.html#type">__builtin__.type</a></font></font></dt><dd><tt>Instantiate a <a href="#Credentials">Credentials</a> <a href="__builtin__.html#object">object</a> from a JSON description of it. The JSON<br> |
| 701 | should have been produced by calling .<a href="#OAuth2Credentials-to_json">to_json</a>() on the <a href="__builtin__.html#object">object</a>.<br> |
| 702 | <br> |
| 703 | Args:<br> |
| 704 | data: dict, A deserialized JSON <a href="__builtin__.html#object">object</a>.<br> |
| 705 | <br> |
| 706 | Returns:<br> |
| 707 | An instance of a <a href="#Credentials">Credentials</a> subclass.</tt></dd></dl> |
Joe Gregorio | 6e53703 | 2011-02-09 23:04:26 -0500 | [diff] [blame] | 708 | |
| 709 | <hr> |
Joe Gregorio | 9ce4b62 | 2011-02-17 15:32:11 -0500 | [diff] [blame] | 710 | Data descriptors defined here:<br> |
Joe Gregorio | a845167 | 2011-09-15 09:53:21 -0400 | [diff] [blame] | 711 | <dl><dt><strong>access_token_expired</strong></dt> |
| 712 | <dd><tt>True if the credential is expired or invalid.<br> |
| 713 | <br> |
| 714 | If the token_expiry isn't set, we assume the token doesn't expire.</tt></dd> |
Joe Gregorio | 9ce4b62 | 2011-02-17 15:32:11 -0500 | [diff] [blame] | 715 | </dl> |
| 716 | <hr> |
Joe Gregorio | a845167 | 2011-09-15 09:53:21 -0400 | [diff] [blame] | 717 | Class methods inherited from <a href="oauth2client.client.html#Credentials">Credentials</a>:<br> |
| 718 | <dl><dt><a name="OAuth2Credentials-new_from_json"><strong>new_from_json</strong></a>(cls, s)<font color="#909090"><font face="helvetica, arial"> from <a href="__builtin__.html#type">__builtin__.type</a></font></font></dt><dd><tt>Utility class method to instantiate a <a href="#Credentials">Credentials</a> subclass from a JSON<br> |
| 719 | representation produced by <a href="#OAuth2Credentials-to_json">to_json</a>().<br> |
| 720 | <br> |
| 721 | Args:<br> |
| 722 | s: string, JSON from <a href="#OAuth2Credentials-to_json">to_json</a>().<br> |
| 723 | <br> |
| 724 | Returns:<br> |
| 725 | An instance of the subclass of <a href="#Credentials">Credentials</a> that was serialized with<br> |
| 726 | <a href="#OAuth2Credentials-to_json">to_json</a>().</tt></dd></dl> |
| 727 | |
| 728 | <hr> |
Joe Gregorio | 6e53703 | 2011-02-09 23:04:26 -0500 | [diff] [blame] | 729 | Data descriptors inherited from <a href="oauth2client.client.html#Credentials">Credentials</a>:<br> |
| 730 | <dl><dt><strong>__dict__</strong></dt> |
| 731 | <dd><tt>dictionary for instance variables (if defined)</tt></dd> |
| 732 | </dl> |
| 733 | <dl><dt><strong>__weakref__</strong></dt> |
| 734 | <dd><tt>list of weak references to the object (if defined)</tt></dd> |
| 735 | </dl> |
Joe Gregorio | a845167 | 2011-09-15 09:53:21 -0400 | [diff] [blame] | 736 | <hr> |
| 737 | Data and other attributes inherited from <a href="oauth2client.client.html#Credentials">Credentials</a>:<br> |
| 738 | <dl><dt><strong>NON_SERIALIZED_MEMBERS</strong> = ['store']</dl> |
| 739 | |
Joe Gregorio | 6e53703 | 2011-02-09 23:04:26 -0500 | [diff] [blame] | 740 | </td></tr></table> <p> |
| 741 | <table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section"> |
| 742 | <tr bgcolor="#ffc8d8"> |
| 743 | <td colspan=3 valign=bottom> <br> |
| 744 | <font color="#000000" face="helvetica, arial"><a name="OAuth2WebServerFlow">class <strong>OAuth2WebServerFlow</strong></a>(<a href="oauth2client.client.html#Flow">Flow</a>)</font></td></tr> |
| 745 | |
| 746 | <tr bgcolor="#ffc8d8"><td rowspan=2><tt> </tt></td> |
| 747 | <td colspan=2><tt>Does the Web Server <a href="#Flow">Flow</a> for OAuth 2.0.<br> |
| 748 | <br> |
| 749 | <a href="#OAuth2Credentials">OAuth2Credentials</a> objects may be safely pickled and unpickled.<br> </tt></td></tr> |
| 750 | <tr><td> </td> |
| 751 | <td width="100%"><dl><dt>Method resolution order:</dt> |
| 752 | <dd><a href="oauth2client.client.html#OAuth2WebServerFlow">OAuth2WebServerFlow</a></dd> |
| 753 | <dd><a href="oauth2client.client.html#Flow">Flow</a></dd> |
| 754 | <dd><a href="__builtin__.html#object">__builtin__.object</a></dd> |
| 755 | </dl> |
| 756 | <hr> |
| 757 | Methods defined here:<br> |
Joe Gregorio | a845167 | 2011-09-15 09:53:21 -0400 | [diff] [blame] | 758 | <dl><dt><a name="OAuth2WebServerFlow-__init__"><strong>__init__</strong></a>(self, client_id, client_secret, scope, user_agent, auth_uri<font color="#909090">='https://accounts.google.com/o/oauth2/auth'</font>, token_uri<font color="#909090">='https://accounts.google.com/o/oauth2/token'</font>, **kwargs)</dt><dd><tt>Constructor for <a href="#OAuth2WebServerFlow">OAuth2WebServerFlow</a>.<br> |
Joe Gregorio | 6e53703 | 2011-02-09 23:04:26 -0500 | [diff] [blame] | 759 | <br> |
| 760 | Args:<br> |
Joe Gregorio | 3b79fa8 | 2011-02-17 11:47:17 -0500 | [diff] [blame] | 761 | client_id: string, client identifier.<br> |
| 762 | client_secret: string client secret.<br> |
| 763 | scope: string, scope of the credentials being requested.<br> |
Joe Gregorio | 6e53703 | 2011-02-09 23:04:26 -0500 | [diff] [blame] | 764 | user_agent: string, HTTP User-Agent to provide for this application.<br> |
Joe Gregorio | 3b79fa8 | 2011-02-17 11:47:17 -0500 | [diff] [blame] | 765 | auth_uri: string, URI for authorization endpoint. For convenience<br> |
| 766 | defaults to Google's endpoints but any OAuth 2.0 provider can be used.<br> |
| 767 | token_uri: string, URI for token endpoint. For convenience<br> |
| 768 | defaults to Google's endpoints but any OAuth 2.0 provider can be used.<br> |
Joe Gregorio | 6e53703 | 2011-02-09 23:04:26 -0500 | [diff] [blame] | 769 | **kwargs: dict, The keyword arguments are all optional and required<br> |
| 770 | parameters for the OAuth calls.</tt></dd></dl> |
| 771 | |
| 772 | <dl><dt><a name="OAuth2WebServerFlow-step1_get_authorize_url"><strong>step1_get_authorize_url</strong></a>(self, redirect_uri<font color="#909090">='oob'</font>)</dt><dd><tt>Returns a URI to redirect to the provider.<br> |
| 773 | <br> |
| 774 | Args:<br> |
| 775 | redirect_uri: string, Either the string 'oob' for a non-web-based<br> |
| 776 | application, or a URI that handles the callback from<br> |
| 777 | the authorization server.<br> |
| 778 | <br> |
| 779 | If redirect_uri is 'oob' then pass in the<br> |
| 780 | generated verification code to step2_exchange,<br> |
| 781 | otherwise pass in the query parameters received<br> |
| 782 | at the callback uri to step2_exchange.</tt></dd></dl> |
| 783 | |
Joe Gregorio | f826111 | 2011-02-19 14:51:56 -0500 | [diff] [blame] | 784 | <dl><dt><a name="OAuth2WebServerFlow-step2_exchange"><strong>step2_exchange</strong></a>(self, code, http<font color="#909090">=None</font>)</dt><dd><tt>Exhanges a code for <a href="#OAuth2Credentials">OAuth2Credentials</a>.<br> |
Joe Gregorio | 6e53703 | 2011-02-09 23:04:26 -0500 | [diff] [blame] | 785 | <br> |
| 786 | Args:<br> |
| 787 | code: string or dict, either the code as a string, or a dictionary<br> |
| 788 | of the query parameters to the redirect_uri, which contains<br> |
Joe Gregorio | f826111 | 2011-02-19 14:51:56 -0500 | [diff] [blame] | 789 | the code.<br> |
| 790 | http: httplib2.Http, optional http instance to use to do the fetch</tt></dd></dl> |
Joe Gregorio | 6e53703 | 2011-02-09 23:04:26 -0500 | [diff] [blame] | 791 | |
| 792 | <hr> |
| 793 | Data descriptors inherited from <a href="oauth2client.client.html#Flow">Flow</a>:<br> |
| 794 | <dl><dt><strong>__dict__</strong></dt> |
| 795 | <dd><tt>dictionary for instance variables (if defined)</tt></dd> |
| 796 | </dl> |
| 797 | <dl><dt><strong>__weakref__</strong></dt> |
| 798 | <dd><tt>list of weak references to the object (if defined)</tt></dd> |
| 799 | </dl> |
| 800 | </td></tr></table> <p> |
| 801 | <table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section"> |
| 802 | <tr bgcolor="#ffc8d8"> |
| 803 | <td colspan=3 valign=bottom> <br> |
Joe Gregorio | 3b79fa8 | 2011-02-17 11:47:17 -0500 | [diff] [blame] | 804 | <font color="#000000" face="helvetica, arial"><a name="Storage">class <strong>Storage</strong></a>(<a href="__builtin__.html#object">__builtin__.object</a>)</font></td></tr> |
| 805 | |
| 806 | <tr bgcolor="#ffc8d8"><td rowspan=2><tt> </tt></td> |
| 807 | <td colspan=2><tt>Base class for all <a href="#Storage">Storage</a> objects.<br> |
| 808 | <br> |
Joe Gregorio | a845167 | 2011-09-15 09:53:21 -0400 | [diff] [blame] | 809 | Store and retrieve a single credential. This class supports locking<br> |
| 810 | such that multiple processes and threads can operate on a single<br> |
| 811 | store.<br> </tt></td></tr> |
Joe Gregorio | 3b79fa8 | 2011-02-17 11:47:17 -0500 | [diff] [blame] | 812 | <tr><td> </td> |
| 813 | <td width="100%">Methods defined here:<br> |
Joe Gregorio | a845167 | 2011-09-15 09:53:21 -0400 | [diff] [blame] | 814 | <dl><dt><a name="Storage-acquire_lock"><strong>acquire_lock</strong></a>(self)</dt><dd><tt>Acquires any lock necessary to access this <a href="#Storage">Storage</a>.<br> |
| 815 | <br> |
| 816 | This lock is not reentrant.</tt></dd></dl> |
| 817 | |
Joe Gregorio | 3b79fa8 | 2011-02-17 11:47:17 -0500 | [diff] [blame] | 818 | <dl><dt><a name="Storage-get"><strong>get</strong></a>(self)</dt><dd><tt>Retrieve credential.<br> |
| 819 | <br> |
Joe Gregorio | a845167 | 2011-09-15 09:53:21 -0400 | [diff] [blame] | 820 | The <a href="#Storage">Storage</a> lock must *not* be held when this is called.<br> |
| 821 | <br> |
Joe Gregorio | 3b79fa8 | 2011-02-17 11:47:17 -0500 | [diff] [blame] | 822 | Returns:<br> |
Joe Gregorio | 20a5aa9 | 2011-04-01 17:44:25 -0400 | [diff] [blame] | 823 | oauth2client.client.<a href="#Credentials">Credentials</a></tt></dd></dl> |
Joe Gregorio | 3b79fa8 | 2011-02-17 11:47:17 -0500 | [diff] [blame] | 824 | |
Joe Gregorio | a845167 | 2011-09-15 09:53:21 -0400 | [diff] [blame] | 825 | <dl><dt><a name="Storage-locked_get"><strong>locked_get</strong></a>(self)</dt><dd><tt>Retrieve credential.<br> |
| 826 | <br> |
| 827 | The <a href="#Storage">Storage</a> lock must be held when this is called.<br> |
| 828 | <br> |
| 829 | Returns:<br> |
| 830 | oauth2client.client.<a href="#Credentials">Credentials</a></tt></dd></dl> |
| 831 | |
| 832 | <dl><dt><a name="Storage-locked_put"><strong>locked_put</strong></a>(self, credentials)</dt><dd><tt>Write a credential.<br> |
| 833 | <br> |
| 834 | The <a href="#Storage">Storage</a> lock must be held when this is called.<br> |
Joe Gregorio | 3b79fa8 | 2011-02-17 11:47:17 -0500 | [diff] [blame] | 835 | <br> |
| 836 | Args:<br> |
| 837 | credentials: <a href="#Credentials">Credentials</a>, the credentials to store.</tt></dd></dl> |
| 838 | |
Joe Gregorio | a845167 | 2011-09-15 09:53:21 -0400 | [diff] [blame] | 839 | <dl><dt><a name="Storage-put"><strong>put</strong></a>(self, credentials)</dt><dd><tt>Write a credential.<br> |
| 840 | <br> |
| 841 | The <a href="#Storage">Storage</a> lock must be held when this is called.<br> |
| 842 | <br> |
| 843 | Args:<br> |
| 844 | credentials: <a href="#Credentials">Credentials</a>, the credentials to store.</tt></dd></dl> |
| 845 | |
| 846 | <dl><dt><a name="Storage-release_lock"><strong>release_lock</strong></a>(self)</dt><dd><tt>Release the <a href="#Storage">Storage</a> lock.<br> |
| 847 | <br> |
| 848 | Trying to release a lock that isn't held will result in a<br> |
| 849 | RuntimeError.</tt></dd></dl> |
| 850 | |
Joe Gregorio | 3b79fa8 | 2011-02-17 11:47:17 -0500 | [diff] [blame] | 851 | <hr> |
| 852 | Data descriptors defined here:<br> |
| 853 | <dl><dt><strong>__dict__</strong></dt> |
| 854 | <dd><tt>dictionary for instance variables (if defined)</tt></dd> |
| 855 | </dl> |
| 856 | <dl><dt><strong>__weakref__</strong></dt> |
| 857 | <dd><tt>list of weak references to the object (if defined)</tt></dd> |
| 858 | </dl> |
Joe Gregorio | 6e53703 | 2011-02-09 23:04:26 -0500 | [diff] [blame] | 859 | </td></tr></table></td></tr></table><p> |
| 860 | <table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section"> |
| 861 | <tr bgcolor="#55aa55"> |
| 862 | <td colspan=3 valign=bottom> <br> |
| 863 | <font color="#ffffff" face="helvetica, arial"><big><strong>Data</strong></big></font></td></tr> |
| 864 | |
| 865 | <tr><td bgcolor="#55aa55"><tt> </tt></td><td> </td> |
Joe Gregorio | a845167 | 2011-09-15 09:53:21 -0400 | [diff] [blame] | 866 | <td width="100%"><strong>EXPIRY_FORMAT</strong> = '%Y-%m-%dT%H:%M:%S.%fZ'<br> |
| 867 | <strong>__author__</strong> = 'jcgregorio@google.com (Joe Gregorio)'<br> |
| 868 | <strong>logger</strong> = <logging.Logger instance></td></tr></table><p> |
Joe Gregorio | 6e53703 | 2011-02-09 23:04:26 -0500 | [diff] [blame] | 869 | <table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section"> |
| 870 | <tr bgcolor="#7799ee"> |
| 871 | <td colspan=3 valign=bottom> <br> |
| 872 | <font color="#ffffff" face="helvetica, arial"><big><strong>Author</strong></big></font></td></tr> |
| 873 | |
| 874 | <tr><td bgcolor="#7799ee"><tt> </tt></td><td> </td> |
| 875 | <td width="100%">jcgregorio@google.com (Joe Gregorio)</td></tr></table> |
| 876 | </body></html> |