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 | d02bf5e | 2012-03-02 13:21:32 -0800 | [diff] [blame^] | 11 | ><font color="#ffffff" face="helvetica, arial"><a href=".">index</a><br><a href="file:/home/jcgregorio/projects/google-api-python-client/oauth2client/client.py">/home/jcgregorio/projects/google-api-python-client/oauth2client/client.py</a></font></td></tr></table> |
Joe Gregorio | a845167 | 2011-09-15 09:53:21 -0400 | [diff] [blame] | 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> |
Joe Gregorio | b417caf | 2011-12-08 12:04:24 -0500 | [diff] [blame] | 22 | <td width="100%"><table width="100%" summary="list"><tr><td width="25%" valign=top><a href="base64.html">base64</a><br> |
| 23 | <a href="oauth2client.clientsecrets.html">oauth2client.clientsecrets</a><br> |
Joe Gregorio | 761c456 | 2011-10-28 14:36:24 -0400 | [diff] [blame] | 24 | <a href="copy.html">copy</a><br> |
Joe Gregorio | b417caf | 2011-12-08 12:04:24 -0500 | [diff] [blame] | 25 | </td><td width="25%" valign=top><a href="datetime.html">datetime</a><br> |
| 26 | <a href="httplib2.html">httplib2</a><br> |
Joe Gregorio | 6e53703 | 2011-02-09 23:04:26 -0500 | [diff] [blame] | 27 | <a href="logging.html">logging</a><br> |
Joe Gregorio | b417caf | 2011-12-08 12:04:24 -0500 | [diff] [blame] | 28 | </td><td width="25%" valign=top><a href="os.html">os</a><br> |
Joe Gregorio | 3d55ac5 | 2012-02-21 10:11:19 -0500 | [diff] [blame] | 29 | <a href="json.html">json</a><br> |
Joe Gregorio | b417caf | 2011-12-08 12:04:24 -0500 | [diff] [blame] | 30 | <a href="sys.html">sys</a><br> |
| 31 | </td><td width="25%" valign=top><a href="time.html">time</a><br> |
Joe Gregorio | 6e53703 | 2011-02-09 23:04:26 -0500 | [diff] [blame] | 32 | <a href="urllib.html">urllib</a><br> |
Joe Gregorio | 761c456 | 2011-10-28 14:36:24 -0400 | [diff] [blame] | 33 | <a href="urlparse.html">urlparse</a><br> |
Joe Gregorio | b417caf | 2011-12-08 12:04:24 -0500 | [diff] [blame] | 34 | </td></tr></table></td></tr></table><p> |
Joe Gregorio | 6e53703 | 2011-02-09 23:04:26 -0500 | [diff] [blame] | 35 | <table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section"> |
| 36 | <tr bgcolor="#ee77aa"> |
| 37 | <td colspan=3 valign=bottom> <br> |
| 38 | <font color="#ffffff" face="helvetica, arial"><big><strong>Classes</strong></big></font></td></tr> |
| 39 | |
| 40 | <tr><td bgcolor="#ee77aa"><tt> </tt></td><td> </td> |
| 41 | <td width="100%"><dl> |
| 42 | <dt><font face="helvetica, arial"><a href="__builtin__.html#object">__builtin__.object</a> |
| 43 | </font></dt><dd> |
| 44 | <dl> |
| 45 | <dt><font face="helvetica, arial"><a href="oauth2client.client.html#Credentials">Credentials</a> |
| 46 | </font></dt><dd> |
| 47 | <dl> |
| 48 | <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] | 49 | </font></dt><dd> |
| 50 | <dl> |
| 51 | <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] | 52 | </font></dt><dt><font face="helvetica, arial"><a href="oauth2client.client.html#AssertionCredentials">AssertionCredentials</a> |
Joe Gregorio | b417caf | 2011-12-08 12:04:24 -0500 | [diff] [blame] | 53 | </font></dt><dd> |
| 54 | <dl> |
| 55 | <dt><font face="helvetica, arial"><a href="oauth2client.client.html#SignedJwtAssertionCredentials">SignedJwtAssertionCredentials</a> |
Joe Gregorio | 6e53703 | 2011-02-09 23:04:26 -0500 | [diff] [blame] | 56 | </font></dt></dl> |
| 57 | </dd> |
Joe Gregorio | 3b79fa8 | 2011-02-17 11:47:17 -0500 | [diff] [blame] | 58 | </dl> |
| 59 | </dd> |
Joe Gregorio | b417caf | 2011-12-08 12:04:24 -0500 | [diff] [blame] | 60 | </dl> |
| 61 | </dd> |
Joe Gregorio | 6e53703 | 2011-02-09 23:04:26 -0500 | [diff] [blame] | 62 | <dt><font face="helvetica, arial"><a href="oauth2client.client.html#Flow">Flow</a> |
| 63 | </font></dt><dd> |
| 64 | <dl> |
| 65 | <dt><font face="helvetica, arial"><a href="oauth2client.client.html#OAuth2WebServerFlow">OAuth2WebServerFlow</a> |
| 66 | </font></dt></dl> |
| 67 | </dd> |
Joe Gregorio | 3d55ac5 | 2012-02-21 10:11:19 -0500 | [diff] [blame] | 68 | <dt><font face="helvetica, arial"><a href="oauth2client.client.html#MemoryCache">MemoryCache</a> |
| 69 | </font></dt><dt><font face="helvetica, arial"><a href="oauth2client.client.html#Storage">Storage</a> |
Joe Gregorio | 3b79fa8 | 2011-02-17 11:47:17 -0500 | [diff] [blame] | 70 | </font></dt></dl> |
Joe Gregorio | 6e53703 | 2011-02-09 23:04:26 -0500 | [diff] [blame] | 71 | </dd> |
| 72 | <dt><font face="helvetica, arial"><a href="exceptions.html#Exception">exceptions.Exception</a>(<a href="exceptions.html#BaseException">exceptions.BaseException</a>) |
| 73 | </font></dt><dd> |
| 74 | <dl> |
| 75 | <dt><font face="helvetica, arial"><a href="oauth2client.client.html#Error">Error</a> |
| 76 | </font></dt><dd> |
| 77 | <dl> |
Joe Gregorio | 3b79fa8 | 2011-02-17 11:47:17 -0500 | [diff] [blame] | 78 | <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] | 79 | </font></dt><dt><font face="helvetica, arial"><a href="oauth2client.client.html#AccessTokenRefreshError">AccessTokenRefreshError</a> |
| 80 | </font></dt><dt><font face="helvetica, arial"><a href="oauth2client.client.html#FlowExchangeError">FlowExchangeError</a> |
Joe Gregorio | 761c456 | 2011-10-28 14:36:24 -0400 | [diff] [blame] | 81 | </font></dt><dt><font face="helvetica, arial"><a href="oauth2client.client.html#UnknownClientSecretsFlowError">UnknownClientSecretsFlowError</a> |
Joe Gregorio | b417caf | 2011-12-08 12:04:24 -0500 | [diff] [blame] | 82 | </font></dt><dt><font face="helvetica, arial"><a href="oauth2client.client.html#VerifyJwtTokenError">VerifyJwtTokenError</a> |
Joe Gregorio | 6e53703 | 2011-02-09 23:04:26 -0500 | [diff] [blame] | 83 | </font></dt></dl> |
| 84 | </dd> |
| 85 | </dl> |
| 86 | </dd> |
| 87 | </dl> |
| 88 | <p> |
| 89 | <table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section"> |
| 90 | <tr bgcolor="#ffc8d8"> |
| 91 | <td colspan=3 valign=bottom> <br> |
Joe Gregorio | 3b79fa8 | 2011-02-17 11:47:17 -0500 | [diff] [blame] | 92 | <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> |
| 93 | |
| 94 | <tr bgcolor="#ffc8d8"><td rowspan=2><tt> </tt></td> |
Joe Gregorio | a845167 | 2011-09-15 09:53:21 -0400 | [diff] [blame] | 95 | <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] | 96 | <br> |
Joe Gregorio | a845167 | 2011-09-15 09:53:21 -0400 | [diff] [blame] | 97 | <a href="#Credentials">Credentials</a> can be applied to an httplib2.Http <a href="__builtin__.html#object">object</a> using the<br> |
| 98 | <a href="#AccessTokenCredentials-authorize">authorize</a>() method, which then signs each request from that <a href="__builtin__.html#object">object</a><br> |
| 99 | with the OAuth 2.0 access token. This set of credentials is for the<br> |
| 100 | use case where you have acquired an OAuth 2.0 access_token from<br> |
| 101 | another place such as a JavaScript client or another web<br> |
| 102 | application, and wish to use it from Python. Because only the<br> |
| 103 | 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] | 104 | expire.<br> |
| 105 | <br> |
Joe Gregorio | fffa7d7 | 2011-02-18 17:20:39 -0500 | [diff] [blame] | 106 | <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] | 107 | <br> |
| 108 | Usage:<br> |
| 109 | credentials = <a href="#AccessTokenCredentials">AccessTokenCredentials</a>('<an access token>',<br> |
| 110 | 'my-user-agent/1.0')<br> |
| 111 | http = httplib2.Http()<br> |
| 112 | http = credentials.<a href="#AccessTokenCredentials-authorize">authorize</a>(http)<br> |
| 113 | <br> |
| 114 | Exceptions:<br> |
| 115 | AccessTokenCredentialsExpired: raised when the access_token expires or is<br> |
| 116 | revoked.<br> </tt></td></tr> |
| 117 | <tr><td> </td> |
| 118 | <td width="100%"><dl><dt>Method resolution order:</dt> |
| 119 | <dd><a href="oauth2client.client.html#AccessTokenCredentials">AccessTokenCredentials</a></dd> |
| 120 | <dd><a href="oauth2client.client.html#OAuth2Credentials">OAuth2Credentials</a></dd> |
| 121 | <dd><a href="oauth2client.client.html#Credentials">Credentials</a></dd> |
| 122 | <dd><a href="__builtin__.html#object">__builtin__.object</a></dd> |
| 123 | </dl> |
| 124 | <hr> |
| 125 | Methods defined here:<br> |
| 126 | <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> |
| 127 | <br> |
| 128 | This is one of the few types if <a href="#Credentials">Credentials</a> that you should contrust,<br> |
| 129 | <a href="#Credentials">Credentials</a> objects are usually instantiated by a <a href="#Flow">Flow</a>.<br> |
| 130 | <br> |
| 131 | Args:<br> |
Joe Gregorio | 9384170 | 2011-03-02 16:12:05 -0800 | [diff] [blame] | 132 | access_token: string, access token.<br> |
Joe Gregorio | 3b79fa8 | 2011-02-17 11:47:17 -0500 | [diff] [blame] | 133 | user_agent: string, The HTTP User-Agent to provide for this application.<br> |
| 134 | <br> |
| 135 | Notes:<br> |
| 136 | store: callable, a callable that when passed a Credential<br> |
| 137 | will store the credential back to where it came from.</tt></dd></dl> |
| 138 | |
| 139 | <hr> |
Joe Gregorio | a845167 | 2011-09-15 09:53:21 -0400 | [diff] [blame] | 140 | Class methods defined here:<br> |
| 141 | <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> |
| 142 | |
| 143 | <hr> |
Joe Gregorio | 3b79fa8 | 2011-02-17 11:47:17 -0500 | [diff] [blame] | 144 | Methods inherited from <a href="oauth2client.client.html#OAuth2Credentials">OAuth2Credentials</a>:<br> |
| 145 | <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> |
| 146 | |
| 147 | <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> |
| 148 | |
Joe Gregorio | 3d55ac5 | 2012-02-21 10:11:19 -0500 | [diff] [blame] | 149 | <dl><dt><a name="AccessTokenCredentials-apply"><strong>apply</strong></a>(self, headers)</dt><dd><tt>Add the authorization to the headers.<br> |
| 150 | <br> |
| 151 | Args:<br> |
| 152 | headers: dict, the headers to add the Authorization header to.</tt></dd></dl> |
| 153 | |
Joe Gregorio | 3b79fa8 | 2011-02-17 11:47:17 -0500 | [diff] [blame] | 154 | <dl><dt><a name="AccessTokenCredentials-authorize"><strong>authorize</strong></a>(self, http)</dt><dd><tt>Authorize an httplib2.Http instance with these credentials.<br> |
| 155 | <br> |
Joe Gregorio | 3d55ac5 | 2012-02-21 10:11:19 -0500 | [diff] [blame] | 156 | The modified http.request method will add authentication headers to each<br> |
| 157 | request and will refresh access_tokens when a 401 is received on a<br> |
| 158 | request. In addition the http.request method has a credentials property,<br> |
| 159 | http.request.credentials, which is the <a href="#Credentials">Credentials</a> <a href="__builtin__.html#object">object</a> that authorized<br> |
| 160 | it.<br> |
| 161 | <br> |
Joe Gregorio | 3b79fa8 | 2011-02-17 11:47:17 -0500 | [diff] [blame] | 162 | Args:<br> |
| 163 | http: An instance of httplib2.Http<br> |
| 164 | or something that acts like it.<br> |
| 165 | <br> |
| 166 | Returns:<br> |
| 167 | A modified instance of http that was passed in.<br> |
| 168 | <br> |
| 169 | Example:<br> |
| 170 | <br> |
| 171 | h = httplib2.Http()<br> |
| 172 | h = credentials.<a href="#AccessTokenCredentials-authorize">authorize</a>(h)<br> |
| 173 | <br> |
Joe Gregorio | a845167 | 2011-09-15 09:53:21 -0400 | [diff] [blame] | 174 | You can't create a new OAuth subclass of httplib2.Authenication<br> |
| 175 | because it never gets passed the absolute URI, which is needed for<br> |
| 176 | signing. So instead we have to overload 'request' with a closure<br> |
| 177 | that adds in the Authorization header and then calls the original<br> |
| 178 | version of 'request()'.</tt></dd></dl> |
Joe Gregorio | 3b79fa8 | 2011-02-17 11:47:17 -0500 | [diff] [blame] | 179 | |
Joe Gregorio | 3d55ac5 | 2012-02-21 10:11:19 -0500 | [diff] [blame] | 180 | <dl><dt><a name="AccessTokenCredentials-refresh"><strong>refresh</strong></a>(self, http)</dt><dd><tt>Forces a refresh of the access_token.<br> |
| 181 | <br> |
| 182 | Args:<br> |
| 183 | http: httplib2.Http, an http <a href="__builtin__.html#object">object</a> to be used to make the refresh<br> |
| 184 | request.</tt></dd></dl> |
| 185 | |
Joe Gregorio | a845167 | 2011-09-15 09:53:21 -0400 | [diff] [blame] | 186 | <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] | 187 | <br> |
| 188 | Args:<br> |
Joe Gregorio | a845167 | 2011-09-15 09:53:21 -0400 | [diff] [blame] | 189 | 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] | 190 | This is needed to store the latest access_token if it<br> |
Joe Gregorio | a845167 | 2011-09-15 09:53:21 -0400 | [diff] [blame] | 191 | has expired and been refreshed. This implementation uses<br> |
| 192 | locking to check for updates before updating the<br> |
| 193 | access_token.</tt></dd></dl> |
| 194 | |
| 195 | <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] | 196 | |
| 197 | <hr> |
Joe Gregorio | 9ce4b62 | 2011-02-17 15:32:11 -0500 | [diff] [blame] | 198 | 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] | 199 | <dl><dt><strong>access_token_expired</strong></dt> |
| 200 | <dd><tt>True if the credential is expired or invalid.<br> |
| 201 | <br> |
| 202 | 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] | 203 | </dl> |
| 204 | <hr> |
Joe Gregorio | a845167 | 2011-09-15 09:53:21 -0400 | [diff] [blame] | 205 | Class methods inherited from <a href="oauth2client.client.html#Credentials">Credentials</a>:<br> |
| 206 | <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> |
| 207 | representation produced by <a href="#AccessTokenCredentials-to_json">to_json</a>().<br> |
| 208 | <br> |
| 209 | Args:<br> |
| 210 | s: string, JSON from <a href="#AccessTokenCredentials-to_json">to_json</a>().<br> |
| 211 | <br> |
| 212 | Returns:<br> |
| 213 | An instance of the subclass of <a href="#Credentials">Credentials</a> that was serialized with<br> |
| 214 | <a href="#AccessTokenCredentials-to_json">to_json</a>().</tt></dd></dl> |
| 215 | |
| 216 | <hr> |
Joe Gregorio | 3b79fa8 | 2011-02-17 11:47:17 -0500 | [diff] [blame] | 217 | Data descriptors inherited from <a href="oauth2client.client.html#Credentials">Credentials</a>:<br> |
| 218 | <dl><dt><strong>__dict__</strong></dt> |
| 219 | <dd><tt>dictionary for instance variables (if defined)</tt></dd> |
| 220 | </dl> |
| 221 | <dl><dt><strong>__weakref__</strong></dt> |
| 222 | <dd><tt>list of weak references to the object (if defined)</tt></dd> |
| 223 | </dl> |
Joe Gregorio | a845167 | 2011-09-15 09:53:21 -0400 | [diff] [blame] | 224 | <hr> |
| 225 | Data and other attributes inherited from <a href="oauth2client.client.html#Credentials">Credentials</a>:<br> |
| 226 | <dl><dt><strong>NON_SERIALIZED_MEMBERS</strong> = ['store']</dl> |
| 227 | |
Joe Gregorio | 3b79fa8 | 2011-02-17 11:47:17 -0500 | [diff] [blame] | 228 | </td></tr></table> <p> |
| 229 | <table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section"> |
| 230 | <tr bgcolor="#ffc8d8"> |
| 231 | <td colspan=3 valign=bottom> <br> |
| 232 | <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> |
| 233 | |
| 234 | <tr bgcolor="#ffc8d8"><td rowspan=2><tt> </tt></td> |
| 235 | <td colspan=2><tt>Having only the access_token means no refresh is possible.<br> </tt></td></tr> |
| 236 | <tr><td> </td> |
| 237 | <td width="100%"><dl><dt>Method resolution order:</dt> |
| 238 | <dd><a href="oauth2client.client.html#AccessTokenCredentialsError">AccessTokenCredentialsError</a></dd> |
| 239 | <dd><a href="oauth2client.client.html#Error">Error</a></dd> |
| 240 | <dd><a href="exceptions.html#Exception">exceptions.Exception</a></dd> |
| 241 | <dd><a href="exceptions.html#BaseException">exceptions.BaseException</a></dd> |
| 242 | <dd><a href="__builtin__.html#object">__builtin__.object</a></dd> |
| 243 | </dl> |
| 244 | <hr> |
| 245 | Data descriptors inherited from <a href="oauth2client.client.html#Error">Error</a>:<br> |
| 246 | <dl><dt><strong>__weakref__</strong></dt> |
| 247 | <dd><tt>list of weak references to the object (if defined)</tt></dd> |
| 248 | </dl> |
| 249 | <hr> |
| 250 | Methods inherited from <a href="exceptions.html#Exception">exceptions.Exception</a>:<br> |
Joe Gregorio | b417caf | 2011-12-08 12:04:24 -0500 | [diff] [blame] | 251 | <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] | 252 | |
| 253 | <hr> |
| 254 | Data and other attributes inherited from <a href="exceptions.html#Exception">exceptions.Exception</a>:<br> |
| 255 | <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> |
| 256 | |
| 257 | <hr> |
| 258 | Methods inherited from <a href="exceptions.html#BaseException">exceptions.BaseException</a>:<br> |
| 259 | <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> |
| 260 | |
| 261 | <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> |
| 262 | |
| 263 | <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> |
| 264 | |
| 265 | <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> |
| 266 | <br> |
| 267 | Use of negative indices is not supported.</tt></dd></dl> |
| 268 | |
| 269 | <dl><dt><a name="AccessTokenCredentialsError-__reduce__"><strong>__reduce__</strong></a>(...)</dt></dl> |
| 270 | |
| 271 | <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> |
| 272 | |
| 273 | <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> |
| 274 | |
| 275 | <dl><dt><a name="AccessTokenCredentialsError-__setstate__"><strong>__setstate__</strong></a>(...)</dt></dl> |
| 276 | |
| 277 | <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> |
| 278 | |
| 279 | <dl><dt><a name="AccessTokenCredentialsError-__unicode__"><strong>__unicode__</strong></a>(...)</dt></dl> |
| 280 | |
| 281 | <hr> |
| 282 | Data descriptors inherited from <a href="exceptions.html#BaseException">exceptions.BaseException</a>:<br> |
| 283 | <dl><dt><strong>__dict__</strong></dt> |
| 284 | </dl> |
| 285 | <dl><dt><strong>args</strong></dt> |
| 286 | </dl> |
| 287 | <dl><dt><strong>message</strong></dt> |
| 288 | </dl> |
| 289 | </td></tr></table> <p> |
| 290 | <table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section"> |
| 291 | <tr bgcolor="#ffc8d8"> |
| 292 | <td colspan=3 valign=bottom> <br> |
Joe Gregorio | f826111 | 2011-02-19 14:51:56 -0500 | [diff] [blame] | 293 | <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> |
| 294 | |
| 295 | <tr bgcolor="#ffc8d8"><td rowspan=2><tt> </tt></td> |
Joe Gregorio | ad258e2 | 2011-02-22 22:53:30 -0500 | [diff] [blame] | 296 | <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] | 297 | <tr><td> </td> |
| 298 | <td width="100%"><dl><dt>Method resolution order:</dt> |
| 299 | <dd><a href="oauth2client.client.html#AccessTokenRefreshError">AccessTokenRefreshError</a></dd> |
| 300 | <dd><a href="oauth2client.client.html#Error">Error</a></dd> |
| 301 | <dd><a href="exceptions.html#Exception">exceptions.Exception</a></dd> |
| 302 | <dd><a href="exceptions.html#BaseException">exceptions.BaseException</a></dd> |
| 303 | <dd><a href="__builtin__.html#object">__builtin__.object</a></dd> |
| 304 | </dl> |
| 305 | <hr> |
| 306 | Data descriptors inherited from <a href="oauth2client.client.html#Error">Error</a>:<br> |
| 307 | <dl><dt><strong>__weakref__</strong></dt> |
| 308 | <dd><tt>list of weak references to the object (if defined)</tt></dd> |
| 309 | </dl> |
| 310 | <hr> |
| 311 | Methods inherited from <a href="exceptions.html#Exception">exceptions.Exception</a>:<br> |
Joe Gregorio | b417caf | 2011-12-08 12:04:24 -0500 | [diff] [blame] | 312 | <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] | 313 | |
| 314 | <hr> |
| 315 | Data and other attributes inherited from <a href="exceptions.html#Exception">exceptions.Exception</a>:<br> |
| 316 | <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> |
| 317 | |
| 318 | <hr> |
| 319 | Methods inherited from <a href="exceptions.html#BaseException">exceptions.BaseException</a>:<br> |
| 320 | <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> |
| 321 | |
| 322 | <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> |
| 323 | |
| 324 | <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> |
| 325 | |
| 326 | <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> |
| 327 | <br> |
| 328 | Use of negative indices is not supported.</tt></dd></dl> |
| 329 | |
| 330 | <dl><dt><a name="AccessTokenRefreshError-__reduce__"><strong>__reduce__</strong></a>(...)</dt></dl> |
| 331 | |
| 332 | <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> |
| 333 | |
| 334 | <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> |
| 335 | |
| 336 | <dl><dt><a name="AccessTokenRefreshError-__setstate__"><strong>__setstate__</strong></a>(...)</dt></dl> |
| 337 | |
| 338 | <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> |
| 339 | |
| 340 | <dl><dt><a name="AccessTokenRefreshError-__unicode__"><strong>__unicode__</strong></a>(...)</dt></dl> |
| 341 | |
| 342 | <hr> |
| 343 | Data descriptors inherited from <a href="exceptions.html#BaseException">exceptions.BaseException</a>:<br> |
| 344 | <dl><dt><strong>__dict__</strong></dt> |
| 345 | </dl> |
| 346 | <dl><dt><strong>args</strong></dt> |
| 347 | </dl> |
| 348 | <dl><dt><strong>message</strong></dt> |
| 349 | </dl> |
| 350 | </td></tr></table> <p> |
| 351 | <table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section"> |
| 352 | <tr bgcolor="#ffc8d8"> |
| 353 | <td colspan=3 valign=bottom> <br> |
Joe Gregorio | b9e63ff | 2011-06-30 12:38:10 -0400 | [diff] [blame] | 354 | <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> |
| 355 | |
| 356 | <tr bgcolor="#ffc8d8"><td rowspan=2><tt> </tt></td> |
Joe Gregorio | a845167 | 2011-09-15 09:53:21 -0400 | [diff] [blame] | 357 | <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] | 358 | <br> |
Joe Gregorio | a845167 | 2011-09-15 09:53:21 -0400 | [diff] [blame] | 359 | This credential does not require a flow to instantiate because it<br> |
| 360 | represents a two legged flow, and therefore has all of the required<br> |
| 361 | information to generate and refresh its own access tokens. It must<br> |
| 362 | be subclassed to generate the appropriate assertion string.<br> |
Joe Gregorio | b9e63ff | 2011-06-30 12:38:10 -0400 | [diff] [blame] | 363 | <br> |
| 364 | <a href="#AssertionCredentials">AssertionCredentials</a> objects may be safely pickled and unpickled.<br> </tt></td></tr> |
| 365 | <tr><td> </td> |
| 366 | <td width="100%"><dl><dt>Method resolution order:</dt> |
| 367 | <dd><a href="oauth2client.client.html#AssertionCredentials">AssertionCredentials</a></dd> |
| 368 | <dd><a href="oauth2client.client.html#OAuth2Credentials">OAuth2Credentials</a></dd> |
| 369 | <dd><a href="oauth2client.client.html#Credentials">Credentials</a></dd> |
| 370 | <dd><a href="__builtin__.html#object">__builtin__.object</a></dd> |
| 371 | </dl> |
| 372 | <hr> |
| 373 | Methods defined here:<br> |
Joe Gregorio | a845167 | 2011-09-15 09:53:21 -0400 | [diff] [blame] | 374 | <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] | 375 | <br> |
| 376 | Args:<br> |
| 377 | assertion_type: string, assertion type that will be declared to the auth<br> |
| 378 | server<br> |
| 379 | user_agent: string, The HTTP User-Agent to provide for this application.<br> |
| 380 | token_uri: string, URI for token endpoint. For convenience<br> |
| 381 | defaults to Google's endpoints but any OAuth 2.0 provider can be used.</tt></dd></dl> |
| 382 | |
| 383 | <hr> |
| 384 | Methods inherited from <a href="oauth2client.client.html#OAuth2Credentials">OAuth2Credentials</a>:<br> |
| 385 | <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> |
| 386 | |
| 387 | <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> |
| 388 | |
Joe Gregorio | 3d55ac5 | 2012-02-21 10:11:19 -0500 | [diff] [blame] | 389 | <dl><dt><a name="AssertionCredentials-apply"><strong>apply</strong></a>(self, headers)</dt><dd><tt>Add the authorization to the headers.<br> |
| 390 | <br> |
| 391 | Args:<br> |
| 392 | headers: dict, the headers to add the Authorization header to.</tt></dd></dl> |
| 393 | |
Joe Gregorio | b9e63ff | 2011-06-30 12:38:10 -0400 | [diff] [blame] | 394 | <dl><dt><a name="AssertionCredentials-authorize"><strong>authorize</strong></a>(self, http)</dt><dd><tt>Authorize an httplib2.Http instance with these credentials.<br> |
| 395 | <br> |
Joe Gregorio | 3d55ac5 | 2012-02-21 10:11:19 -0500 | [diff] [blame] | 396 | The modified http.request method will add authentication headers to each<br> |
| 397 | request and will refresh access_tokens when a 401 is received on a<br> |
| 398 | request. In addition the http.request method has a credentials property,<br> |
| 399 | http.request.credentials, which is the <a href="#Credentials">Credentials</a> <a href="__builtin__.html#object">object</a> that authorized<br> |
| 400 | it.<br> |
| 401 | <br> |
Joe Gregorio | b9e63ff | 2011-06-30 12:38:10 -0400 | [diff] [blame] | 402 | Args:<br> |
| 403 | http: An instance of httplib2.Http<br> |
| 404 | or something that acts like it.<br> |
| 405 | <br> |
| 406 | Returns:<br> |
| 407 | A modified instance of http that was passed in.<br> |
| 408 | <br> |
| 409 | Example:<br> |
| 410 | <br> |
| 411 | h = httplib2.Http()<br> |
| 412 | h = credentials.<a href="#AssertionCredentials-authorize">authorize</a>(h)<br> |
| 413 | <br> |
Joe Gregorio | a845167 | 2011-09-15 09:53:21 -0400 | [diff] [blame] | 414 | You can't create a new OAuth subclass of httplib2.Authenication<br> |
| 415 | because it never gets passed the absolute URI, which is needed for<br> |
| 416 | signing. So instead we have to overload 'request' with a closure<br> |
| 417 | that adds in the Authorization header and then calls the original<br> |
| 418 | version of 'request()'.</tt></dd></dl> |
Joe Gregorio | b9e63ff | 2011-06-30 12:38:10 -0400 | [diff] [blame] | 419 | |
Joe Gregorio | 3d55ac5 | 2012-02-21 10:11:19 -0500 | [diff] [blame] | 420 | <dl><dt><a name="AssertionCredentials-refresh"><strong>refresh</strong></a>(self, http)</dt><dd><tt>Forces a refresh of the access_token.<br> |
| 421 | <br> |
| 422 | Args:<br> |
| 423 | http: httplib2.Http, an http <a href="__builtin__.html#object">object</a> to be used to make the refresh<br> |
| 424 | request.</tt></dd></dl> |
| 425 | |
Joe Gregorio | a845167 | 2011-09-15 09:53:21 -0400 | [diff] [blame] | 426 | <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] | 427 | <br> |
| 428 | Args:<br> |
Joe Gregorio | a845167 | 2011-09-15 09:53:21 -0400 | [diff] [blame] | 429 | 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] | 430 | This is needed to store the latest access_token if it<br> |
Joe Gregorio | a845167 | 2011-09-15 09:53:21 -0400 | [diff] [blame] | 431 | has expired and been refreshed. This implementation uses<br> |
| 432 | locking to check for updates before updating the<br> |
| 433 | access_token.</tt></dd></dl> |
| 434 | |
| 435 | <dl><dt><a name="AssertionCredentials-to_json"><strong>to_json</strong></a>(self)</dt></dl> |
| 436 | |
| 437 | <hr> |
| 438 | Class methods inherited from <a href="oauth2client.client.html#OAuth2Credentials">OAuth2Credentials</a>:<br> |
| 439 | <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> |
| 440 | should have been produced by calling .<a href="#AssertionCredentials-to_json">to_json</a>() on the <a href="__builtin__.html#object">object</a>.<br> |
| 441 | <br> |
| 442 | Args:<br> |
| 443 | data: dict, A deserialized JSON <a href="__builtin__.html#object">object</a>.<br> |
| 444 | <br> |
| 445 | Returns:<br> |
| 446 | 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] | 447 | |
| 448 | <hr> |
| 449 | 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] | 450 | <dl><dt><strong>access_token_expired</strong></dt> |
| 451 | <dd><tt>True if the credential is expired or invalid.<br> |
| 452 | <br> |
| 453 | 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] | 454 | </dl> |
| 455 | <hr> |
Joe Gregorio | a845167 | 2011-09-15 09:53:21 -0400 | [diff] [blame] | 456 | Class methods inherited from <a href="oauth2client.client.html#Credentials">Credentials</a>:<br> |
| 457 | <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> |
| 458 | representation produced by <a href="#AssertionCredentials-to_json">to_json</a>().<br> |
| 459 | <br> |
| 460 | Args:<br> |
| 461 | s: string, JSON from <a href="#AssertionCredentials-to_json">to_json</a>().<br> |
| 462 | <br> |
| 463 | Returns:<br> |
| 464 | An instance of the subclass of <a href="#Credentials">Credentials</a> that was serialized with<br> |
| 465 | <a href="#AssertionCredentials-to_json">to_json</a>().</tt></dd></dl> |
| 466 | |
| 467 | <hr> |
Joe Gregorio | b9e63ff | 2011-06-30 12:38:10 -0400 | [diff] [blame] | 468 | Data descriptors inherited from <a href="oauth2client.client.html#Credentials">Credentials</a>:<br> |
| 469 | <dl><dt><strong>__dict__</strong></dt> |
| 470 | <dd><tt>dictionary for instance variables (if defined)</tt></dd> |
| 471 | </dl> |
| 472 | <dl><dt><strong>__weakref__</strong></dt> |
| 473 | <dd><tt>list of weak references to the object (if defined)</tt></dd> |
| 474 | </dl> |
Joe Gregorio | a845167 | 2011-09-15 09:53:21 -0400 | [diff] [blame] | 475 | <hr> |
| 476 | Data and other attributes inherited from <a href="oauth2client.client.html#Credentials">Credentials</a>:<br> |
| 477 | <dl><dt><strong>NON_SERIALIZED_MEMBERS</strong> = ['store']</dl> |
| 478 | |
Joe Gregorio | b9e63ff | 2011-06-30 12:38:10 -0400 | [diff] [blame] | 479 | </td></tr></table> <p> |
| 480 | <table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section"> |
| 481 | <tr bgcolor="#ffc8d8"> |
| 482 | <td colspan=3 valign=bottom> <br> |
Joe Gregorio | 6e53703 | 2011-02-09 23:04:26 -0500 | [diff] [blame] | 483 | <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> |
| 484 | |
| 485 | <tr bgcolor="#ffc8d8"><td rowspan=2><tt> </tt></td> |
| 486 | <td colspan=2><tt>Base class for all <a href="#Credentials">Credentials</a> objects.<br> |
| 487 | <br> |
Joe Gregorio | a845167 | 2011-09-15 09:53:21 -0400 | [diff] [blame] | 488 | Subclasses must define an <a href="#Credentials-authorize">authorize</a>() method that applies the credentials to<br> |
| 489 | an HTTP transport.<br> |
| 490 | <br> |
| 491 | Subclasses must also specify a classmethod named 'from_json' that takes a JSON<br> |
Joe Gregorio | d02bf5e | 2012-03-02 13:21:32 -0800 | [diff] [blame^] | 492 | string as input and returns an instaniated <a href="#Credentials">Credentials</a> <a href="__builtin__.html#object">object</a>.<br> </tt></td></tr> |
Joe Gregorio | 6e53703 | 2011-02-09 23:04:26 -0500 | [diff] [blame] | 493 | <tr><td> </td> |
| 494 | <td width="100%">Methods defined here:<br> |
Joe Gregorio | 3d55ac5 | 2012-02-21 10:11:19 -0500 | [diff] [blame] | 495 | <dl><dt><a name="Credentials-apply"><strong>apply</strong></a>(self, headers)</dt><dd><tt>Add the authorization to the headers.<br> |
| 496 | <br> |
| 497 | Args:<br> |
| 498 | headers: dict, the headers to add the Authorization header to.</tt></dd></dl> |
| 499 | |
Joe Gregorio | 6e53703 | 2011-02-09 23:04:26 -0500 | [diff] [blame] | 500 | <dl><dt><a name="Credentials-authorize"><strong>authorize</strong></a>(self, http)</dt><dd><tt>Take an httplib2.Http instance (or equivalent) and<br> |
| 501 | authorizes it for the set of credentials, usually by<br> |
| 502 | replacing http.request() with a method that adds in<br> |
| 503 | the appropriate headers and then delegates to the original<br> |
| 504 | Http.request() method.</tt></dd></dl> |
| 505 | |
Joe Gregorio | 3d55ac5 | 2012-02-21 10:11:19 -0500 | [diff] [blame] | 506 | <dl><dt><a name="Credentials-refresh"><strong>refresh</strong></a>(self, http)</dt><dd><tt>Forces a refresh of the access_token.<br> |
| 507 | <br> |
| 508 | Args:<br> |
| 509 | http: httplib2.Http, an http <a href="__builtin__.html#object">object</a> to be used to make the refresh<br> |
| 510 | request.</tt></dd></dl> |
| 511 | |
Joe Gregorio | a845167 | 2011-09-15 09:53:21 -0400 | [diff] [blame] | 512 | <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> |
| 513 | <br> |
| 514 | Returns:<br> |
| 515 | string, a JSON representation of this instance, suitable to pass to<br> |
| 516 | from_json().</tt></dd></dl> |
| 517 | |
| 518 | <hr> |
| 519 | Class methods defined here:<br> |
| 520 | <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> |
| 521 | representation produced by <a href="#Credentials-to_json">to_json</a>().<br> |
| 522 | <br> |
| 523 | Args:<br> |
| 524 | s: string, JSON from <a href="#Credentials-to_json">to_json</a>().<br> |
| 525 | <br> |
| 526 | Returns:<br> |
| 527 | An instance of the subclass of <a href="#Credentials">Credentials</a> that was serialized with<br> |
| 528 | <a href="#Credentials-to_json">to_json</a>().</tt></dd></dl> |
| 529 | |
Joe Gregorio | 6e53703 | 2011-02-09 23:04:26 -0500 | [diff] [blame] | 530 | <hr> |
| 531 | Data descriptors defined here:<br> |
| 532 | <dl><dt><strong>__dict__</strong></dt> |
| 533 | <dd><tt>dictionary for instance variables (if defined)</tt></dd> |
| 534 | </dl> |
| 535 | <dl><dt><strong>__weakref__</strong></dt> |
| 536 | <dd><tt>list of weak references to the object (if defined)</tt></dd> |
| 537 | </dl> |
Joe Gregorio | a845167 | 2011-09-15 09:53:21 -0400 | [diff] [blame] | 538 | <hr> |
| 539 | Data and other attributes defined here:<br> |
| 540 | <dl><dt><strong>NON_SERIALIZED_MEMBERS</strong> = ['store']</dl> |
| 541 | |
Joe Gregorio | 6e53703 | 2011-02-09 23:04:26 -0500 | [diff] [blame] | 542 | </td></tr></table> <p> |
| 543 | <table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section"> |
| 544 | <tr bgcolor="#ffc8d8"> |
| 545 | <td colspan=3 valign=bottom> <br> |
| 546 | <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> |
| 547 | |
| 548 | <tr bgcolor="#ffc8d8"><td rowspan=2><tt> </tt></td> |
| 549 | <td colspan=2><tt>Base error for this module.<br> </tt></td></tr> |
| 550 | <tr><td> </td> |
| 551 | <td width="100%"><dl><dt>Method resolution order:</dt> |
| 552 | <dd><a href="oauth2client.client.html#Error">Error</a></dd> |
| 553 | <dd><a href="exceptions.html#Exception">exceptions.Exception</a></dd> |
| 554 | <dd><a href="exceptions.html#BaseException">exceptions.BaseException</a></dd> |
| 555 | <dd><a href="__builtin__.html#object">__builtin__.object</a></dd> |
| 556 | </dl> |
| 557 | <hr> |
| 558 | Data descriptors defined here:<br> |
| 559 | <dl><dt><strong>__weakref__</strong></dt> |
| 560 | <dd><tt>list of weak references to the object (if defined)</tt></dd> |
| 561 | </dl> |
| 562 | <hr> |
| 563 | Methods inherited from <a href="exceptions.html#Exception">exceptions.Exception</a>:<br> |
Joe Gregorio | b417caf | 2011-12-08 12:04:24 -0500 | [diff] [blame] | 564 | <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] | 565 | |
| 566 | <hr> |
| 567 | Data and other attributes inherited from <a href="exceptions.html#Exception">exceptions.Exception</a>:<br> |
| 568 | <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> |
| 569 | |
| 570 | <hr> |
| 571 | Methods inherited from <a href="exceptions.html#BaseException">exceptions.BaseException</a>:<br> |
| 572 | <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> |
| 573 | |
| 574 | <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> |
| 575 | |
| 576 | <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> |
| 577 | |
| 578 | <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> |
| 579 | <br> |
| 580 | Use of negative indices is not supported.</tt></dd></dl> |
| 581 | |
| 582 | <dl><dt><a name="Error-__reduce__"><strong>__reduce__</strong></a>(...)</dt></dl> |
| 583 | |
| 584 | <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> |
| 585 | |
| 586 | <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> |
| 587 | |
| 588 | <dl><dt><a name="Error-__setstate__"><strong>__setstate__</strong></a>(...)</dt></dl> |
| 589 | |
| 590 | <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> |
| 591 | |
| 592 | <dl><dt><a name="Error-__unicode__"><strong>__unicode__</strong></a>(...)</dt></dl> |
| 593 | |
| 594 | <hr> |
| 595 | Data descriptors inherited from <a href="exceptions.html#BaseException">exceptions.BaseException</a>:<br> |
| 596 | <dl><dt><strong>__dict__</strong></dt> |
| 597 | </dl> |
| 598 | <dl><dt><strong>args</strong></dt> |
| 599 | </dl> |
| 600 | <dl><dt><strong>message</strong></dt> |
| 601 | </dl> |
| 602 | </td></tr></table> <p> |
| 603 | <table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section"> |
| 604 | <tr bgcolor="#ffc8d8"> |
| 605 | <td colspan=3 valign=bottom> <br> |
| 606 | <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> |
| 607 | |
| 608 | <tr bgcolor="#ffc8d8"><td rowspan=2><tt> </tt></td> |
| 609 | <td colspan=2><tt>Base class for all <a href="#Flow">Flow</a> objects.<br> </tt></td></tr> |
| 610 | <tr><td> </td> |
| 611 | <td width="100%">Data descriptors defined here:<br> |
| 612 | <dl><dt><strong>__dict__</strong></dt> |
| 613 | <dd><tt>dictionary for instance variables (if defined)</tt></dd> |
| 614 | </dl> |
| 615 | <dl><dt><strong>__weakref__</strong></dt> |
| 616 | <dd><tt>list of weak references to the object (if defined)</tt></dd> |
| 617 | </dl> |
| 618 | </td></tr></table> <p> |
| 619 | <table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section"> |
| 620 | <tr bgcolor="#ffc8d8"> |
| 621 | <td colspan=3 valign=bottom> <br> |
Joe Gregorio | f826111 | 2011-02-19 14:51:56 -0500 | [diff] [blame] | 622 | <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> |
| 623 | |
| 624 | <tr bgcolor="#ffc8d8"><td rowspan=2><tt> </tt></td> |
Joe Gregorio | ad258e2 | 2011-02-22 22:53:30 -0500 | [diff] [blame] | 625 | <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] | 626 | <tr><td> </td> |
| 627 | <td width="100%"><dl><dt>Method resolution order:</dt> |
| 628 | <dd><a href="oauth2client.client.html#FlowExchangeError">FlowExchangeError</a></dd> |
| 629 | <dd><a href="oauth2client.client.html#Error">Error</a></dd> |
| 630 | <dd><a href="exceptions.html#Exception">exceptions.Exception</a></dd> |
| 631 | <dd><a href="exceptions.html#BaseException">exceptions.BaseException</a></dd> |
| 632 | <dd><a href="__builtin__.html#object">__builtin__.object</a></dd> |
| 633 | </dl> |
| 634 | <hr> |
| 635 | Data descriptors inherited from <a href="oauth2client.client.html#Error">Error</a>:<br> |
| 636 | <dl><dt><strong>__weakref__</strong></dt> |
| 637 | <dd><tt>list of weak references to the object (if defined)</tt></dd> |
| 638 | </dl> |
| 639 | <hr> |
| 640 | Methods inherited from <a href="exceptions.html#Exception">exceptions.Exception</a>:<br> |
Joe Gregorio | b417caf | 2011-12-08 12:04:24 -0500 | [diff] [blame] | 641 | <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] | 642 | |
| 643 | <hr> |
| 644 | Data and other attributes inherited from <a href="exceptions.html#Exception">exceptions.Exception</a>:<br> |
| 645 | <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> |
| 646 | |
| 647 | <hr> |
| 648 | Methods inherited from <a href="exceptions.html#BaseException">exceptions.BaseException</a>:<br> |
| 649 | <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> |
| 650 | |
| 651 | <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> |
| 652 | |
| 653 | <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> |
| 654 | |
| 655 | <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> |
| 656 | <br> |
| 657 | Use of negative indices is not supported.</tt></dd></dl> |
| 658 | |
| 659 | <dl><dt><a name="FlowExchangeError-__reduce__"><strong>__reduce__</strong></a>(...)</dt></dl> |
| 660 | |
| 661 | <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> |
| 662 | |
| 663 | <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> |
| 664 | |
| 665 | <dl><dt><a name="FlowExchangeError-__setstate__"><strong>__setstate__</strong></a>(...)</dt></dl> |
| 666 | |
| 667 | <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> |
| 668 | |
| 669 | <dl><dt><a name="FlowExchangeError-__unicode__"><strong>__unicode__</strong></a>(...)</dt></dl> |
| 670 | |
| 671 | <hr> |
| 672 | Data descriptors inherited from <a href="exceptions.html#BaseException">exceptions.BaseException</a>:<br> |
| 673 | <dl><dt><strong>__dict__</strong></dt> |
| 674 | </dl> |
| 675 | <dl><dt><strong>args</strong></dt> |
| 676 | </dl> |
| 677 | <dl><dt><strong>message</strong></dt> |
| 678 | </dl> |
| 679 | </td></tr></table> <p> |
| 680 | <table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section"> |
| 681 | <tr bgcolor="#ffc8d8"> |
| 682 | <td colspan=3 valign=bottom> <br> |
Joe Gregorio | 3d55ac5 | 2012-02-21 10:11:19 -0500 | [diff] [blame] | 683 | <font color="#000000" face="helvetica, arial"><a name="MemoryCache">class <strong>MemoryCache</strong></a>(<a href="__builtin__.html#object">__builtin__.object</a>)</font></td></tr> |
| 684 | |
| 685 | <tr bgcolor="#ffc8d8"><td rowspan=2><tt> </tt></td> |
| 686 | <td colspan=2><tt>httplib2 Cache implementation which only caches locally.<br> </tt></td></tr> |
| 687 | <tr><td> </td> |
| 688 | <td width="100%">Methods defined here:<br> |
| 689 | <dl><dt><a name="MemoryCache-__init__"><strong>__init__</strong></a>(self)</dt></dl> |
| 690 | |
| 691 | <dl><dt><a name="MemoryCache-delete"><strong>delete</strong></a>(self, key)</dt></dl> |
| 692 | |
| 693 | <dl><dt><a name="MemoryCache-get"><strong>get</strong></a>(self, key)</dt></dl> |
| 694 | |
| 695 | <dl><dt><a name="MemoryCache-set"><strong>set</strong></a>(self, key, value)</dt></dl> |
| 696 | |
| 697 | <hr> |
| 698 | Data descriptors defined here:<br> |
| 699 | <dl><dt><strong>__dict__</strong></dt> |
| 700 | <dd><tt>dictionary for instance variables (if defined)</tt></dd> |
| 701 | </dl> |
| 702 | <dl><dt><strong>__weakref__</strong></dt> |
| 703 | <dd><tt>list of weak references to the object (if defined)</tt></dd> |
| 704 | </dl> |
| 705 | </td></tr></table> <p> |
| 706 | <table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section"> |
| 707 | <tr bgcolor="#ffc8d8"> |
| 708 | <td colspan=3 valign=bottom> <br> |
Joe Gregorio | 6e53703 | 2011-02-09 23:04:26 -0500 | [diff] [blame] | 709 | <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> |
| 710 | |
| 711 | <tr bgcolor="#ffc8d8"><td rowspan=2><tt> </tt></td> |
Joe Gregorio | a845167 | 2011-09-15 09:53:21 -0400 | [diff] [blame] | 712 | <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] | 713 | <br> |
Joe Gregorio | 3b79fa8 | 2011-02-17 11:47:17 -0500 | [diff] [blame] | 714 | <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> |
Joe Gregorio | b417caf | 2011-12-08 12:04:24 -0500 | [diff] [blame] | 715 | method, which then adds the OAuth 2.0 access token to each request.<br> |
Joe Gregorio | 6e53703 | 2011-02-09 23:04:26 -0500 | [diff] [blame] | 716 | <br> |
| 717 | <a href="#OAuth2Credentials">OAuth2Credentials</a> objects may be safely pickled and unpickled.<br> </tt></td></tr> |
| 718 | <tr><td> </td> |
| 719 | <td width="100%"><dl><dt>Method resolution order:</dt> |
| 720 | <dd><a href="oauth2client.client.html#OAuth2Credentials">OAuth2Credentials</a></dd> |
| 721 | <dd><a href="oauth2client.client.html#Credentials">Credentials</a></dd> |
| 722 | <dd><a href="__builtin__.html#object">__builtin__.object</a></dd> |
| 723 | </dl> |
| 724 | <hr> |
| 725 | Methods defined here:<br> |
| 726 | <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> |
| 727 | |
Joe Gregorio | b417caf | 2011-12-08 12:04:24 -0500 | [diff] [blame] | 728 | <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, id_token<font color="#909090">=None</font>)</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] | 729 | <br> |
| 730 | This constructor is not usually called by the user, instead<br> |
Joe Gregorio | 3b79fa8 | 2011-02-17 11:47:17 -0500 | [diff] [blame] | 731 | <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] | 732 | <br> |
| 733 | Args:<br> |
Joe Gregorio | a845167 | 2011-09-15 09:53:21 -0400 | [diff] [blame] | 734 | access_token: string, access token.<br> |
Joe Gregorio | 3b79fa8 | 2011-02-17 11:47:17 -0500 | [diff] [blame] | 735 | client_id: string, client identifier.<br> |
| 736 | client_secret: string, client secret.<br> |
Joe Gregorio | 3b79fa8 | 2011-02-17 11:47:17 -0500 | [diff] [blame] | 737 | refresh_token: string, refresh token.<br> |
Joe Gregorio | a845167 | 2011-09-15 09:53:21 -0400 | [diff] [blame] | 738 | token_expiry: datetime, when the access_token expires.<br> |
| 739 | token_uri: string, URI of token endpoint.<br> |
Joe Gregorio | 6e53703 | 2011-02-09 23:04:26 -0500 | [diff] [blame] | 740 | user_agent: string, The HTTP User-Agent to provide for this application.<br> |
Joe Gregorio | b417caf | 2011-12-08 12:04:24 -0500 | [diff] [blame] | 741 | id_token: <a href="__builtin__.html#object">object</a>, The identity of the resource owner.<br> |
Joe Gregorio | 6e53703 | 2011-02-09 23:04:26 -0500 | [diff] [blame] | 742 | <br> |
Joe Gregorio | 6e53703 | 2011-02-09 23:04:26 -0500 | [diff] [blame] | 743 | Notes:<br> |
Joe Gregorio | b417caf | 2011-12-08 12:04:24 -0500 | [diff] [blame] | 744 | store: callable, A callable that when passed a Credential<br> |
Joe Gregorio | 6e53703 | 2011-02-09 23:04:26 -0500 | [diff] [blame] | 745 | will store the credential back to where it came from.<br> |
| 746 | This is needed to store the latest access_token if it<br> |
| 747 | has expired and been refreshed.</tt></dd></dl> |
| 748 | |
| 749 | <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> |
| 750 | |
Joe Gregorio | 3d55ac5 | 2012-02-21 10:11:19 -0500 | [diff] [blame] | 751 | <dl><dt><a name="OAuth2Credentials-apply"><strong>apply</strong></a>(self, headers)</dt><dd><tt>Add the authorization to the headers.<br> |
| 752 | <br> |
| 753 | Args:<br> |
| 754 | headers: dict, the headers to add the Authorization header to.</tt></dd></dl> |
| 755 | |
Joe Gregorio | 3b79fa8 | 2011-02-17 11:47:17 -0500 | [diff] [blame] | 756 | <dl><dt><a name="OAuth2Credentials-authorize"><strong>authorize</strong></a>(self, http)</dt><dd><tt>Authorize an httplib2.Http instance with these credentials.<br> |
| 757 | <br> |
Joe Gregorio | 3d55ac5 | 2012-02-21 10:11:19 -0500 | [diff] [blame] | 758 | The modified http.request method will add authentication headers to each<br> |
| 759 | request and will refresh access_tokens when a 401 is received on a<br> |
| 760 | request. In addition the http.request method has a credentials property,<br> |
| 761 | http.request.credentials, which is the <a href="#Credentials">Credentials</a> <a href="__builtin__.html#object">object</a> that authorized<br> |
| 762 | it.<br> |
| 763 | <br> |
Joe Gregorio | 3b79fa8 | 2011-02-17 11:47:17 -0500 | [diff] [blame] | 764 | Args:<br> |
Joe Gregorio | 6e53703 | 2011-02-09 23:04:26 -0500 | [diff] [blame] | 765 | http: An instance of httplib2.Http<br> |
| 766 | or something that acts like it.<br> |
| 767 | <br> |
| 768 | Returns:<br> |
| 769 | A modified instance of http that was passed in.<br> |
| 770 | <br> |
| 771 | Example:<br> |
| 772 | <br> |
| 773 | h = httplib2.Http()<br> |
| 774 | h = credentials.<a href="#OAuth2Credentials-authorize">authorize</a>(h)<br> |
| 775 | <br> |
Joe Gregorio | a845167 | 2011-09-15 09:53:21 -0400 | [diff] [blame] | 776 | You can't create a new OAuth subclass of httplib2.Authenication<br> |
| 777 | because it never gets passed the absolute URI, which is needed for<br> |
| 778 | signing. So instead we have to overload 'request' with a closure<br> |
| 779 | that adds in the Authorization header and then calls the original<br> |
| 780 | version of 'request()'.</tt></dd></dl> |
Joe Gregorio | 6e53703 | 2011-02-09 23:04:26 -0500 | [diff] [blame] | 781 | |
Joe Gregorio | 3d55ac5 | 2012-02-21 10:11:19 -0500 | [diff] [blame] | 782 | <dl><dt><a name="OAuth2Credentials-refresh"><strong>refresh</strong></a>(self, http)</dt><dd><tt>Forces a refresh of the access_token.<br> |
| 783 | <br> |
| 784 | Args:<br> |
| 785 | http: httplib2.Http, an http <a href="__builtin__.html#object">object</a> to be used to make the refresh<br> |
| 786 | request.</tt></dd></dl> |
| 787 | |
Joe Gregorio | a845167 | 2011-09-15 09:53:21 -0400 | [diff] [blame] | 788 | <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] | 789 | <br> |
| 790 | Args:<br> |
Joe Gregorio | a845167 | 2011-09-15 09:53:21 -0400 | [diff] [blame] | 791 | 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] | 792 | This is needed to store the latest access_token if it<br> |
Joe Gregorio | a845167 | 2011-09-15 09:53:21 -0400 | [diff] [blame] | 793 | has expired and been refreshed. This implementation uses<br> |
| 794 | locking to check for updates before updating the<br> |
| 795 | access_token.</tt></dd></dl> |
| 796 | |
| 797 | <dl><dt><a name="OAuth2Credentials-to_json"><strong>to_json</strong></a>(self)</dt></dl> |
| 798 | |
| 799 | <hr> |
| 800 | Class methods defined here:<br> |
| 801 | <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> |
| 802 | should have been produced by calling .<a href="#OAuth2Credentials-to_json">to_json</a>() on the <a href="__builtin__.html#object">object</a>.<br> |
| 803 | <br> |
| 804 | Args:<br> |
| 805 | data: dict, A deserialized JSON <a href="__builtin__.html#object">object</a>.<br> |
| 806 | <br> |
| 807 | Returns:<br> |
| 808 | 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] | 809 | |
| 810 | <hr> |
Joe Gregorio | 9ce4b62 | 2011-02-17 15:32:11 -0500 | [diff] [blame] | 811 | Data descriptors defined here:<br> |
Joe Gregorio | a845167 | 2011-09-15 09:53:21 -0400 | [diff] [blame] | 812 | <dl><dt><strong>access_token_expired</strong></dt> |
| 813 | <dd><tt>True if the credential is expired or invalid.<br> |
| 814 | <br> |
| 815 | 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] | 816 | </dl> |
| 817 | <hr> |
Joe Gregorio | a845167 | 2011-09-15 09:53:21 -0400 | [diff] [blame] | 818 | Class methods inherited from <a href="oauth2client.client.html#Credentials">Credentials</a>:<br> |
| 819 | <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> |
| 820 | representation produced by <a href="#OAuth2Credentials-to_json">to_json</a>().<br> |
| 821 | <br> |
| 822 | Args:<br> |
| 823 | s: string, JSON from <a href="#OAuth2Credentials-to_json">to_json</a>().<br> |
| 824 | <br> |
| 825 | Returns:<br> |
| 826 | An instance of the subclass of <a href="#Credentials">Credentials</a> that was serialized with<br> |
| 827 | <a href="#OAuth2Credentials-to_json">to_json</a>().</tt></dd></dl> |
| 828 | |
| 829 | <hr> |
Joe Gregorio | 6e53703 | 2011-02-09 23:04:26 -0500 | [diff] [blame] | 830 | Data descriptors inherited from <a href="oauth2client.client.html#Credentials">Credentials</a>:<br> |
| 831 | <dl><dt><strong>__dict__</strong></dt> |
| 832 | <dd><tt>dictionary for instance variables (if defined)</tt></dd> |
| 833 | </dl> |
| 834 | <dl><dt><strong>__weakref__</strong></dt> |
| 835 | <dd><tt>list of weak references to the object (if defined)</tt></dd> |
| 836 | </dl> |
Joe Gregorio | a845167 | 2011-09-15 09:53:21 -0400 | [diff] [blame] | 837 | <hr> |
| 838 | Data and other attributes inherited from <a href="oauth2client.client.html#Credentials">Credentials</a>:<br> |
| 839 | <dl><dt><strong>NON_SERIALIZED_MEMBERS</strong> = ['store']</dl> |
| 840 | |
Joe Gregorio | 6e53703 | 2011-02-09 23:04:26 -0500 | [diff] [blame] | 841 | </td></tr></table> <p> |
| 842 | <table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section"> |
| 843 | <tr bgcolor="#ffc8d8"> |
| 844 | <td colspan=3 valign=bottom> <br> |
| 845 | <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> |
| 846 | |
| 847 | <tr bgcolor="#ffc8d8"><td rowspan=2><tt> </tt></td> |
| 848 | <td colspan=2><tt>Does the Web Server <a href="#Flow">Flow</a> for OAuth 2.0.<br> |
| 849 | <br> |
| 850 | <a href="#OAuth2Credentials">OAuth2Credentials</a> objects may be safely pickled and unpickled.<br> </tt></td></tr> |
| 851 | <tr><td> </td> |
| 852 | <td width="100%"><dl><dt>Method resolution order:</dt> |
| 853 | <dd><a href="oauth2client.client.html#OAuth2WebServerFlow">OAuth2WebServerFlow</a></dd> |
| 854 | <dd><a href="oauth2client.client.html#Flow">Flow</a></dd> |
| 855 | <dd><a href="__builtin__.html#object">__builtin__.object</a></dd> |
| 856 | </dl> |
| 857 | <hr> |
| 858 | Methods defined here:<br> |
Joe Gregorio | 761c456 | 2011-10-28 14:36:24 -0400 | [diff] [blame] | 859 | <dl><dt><a name="OAuth2WebServerFlow-__init__"><strong>__init__</strong></a>(self, client_id, client_secret, scope, user_agent<font color="#909090">=None</font>, 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] | 860 | <br> |
| 861 | Args:<br> |
Joe Gregorio | 3b79fa8 | 2011-02-17 11:47:17 -0500 | [diff] [blame] | 862 | client_id: string, client identifier.<br> |
| 863 | client_secret: string client secret.<br> |
Joe Gregorio | 761c456 | 2011-10-28 14:36:24 -0400 | [diff] [blame] | 864 | scope: string or list of strings, scope(s) of the credentials being<br> |
| 865 | requested.<br> |
Joe Gregorio | 6e53703 | 2011-02-09 23:04:26 -0500 | [diff] [blame] | 866 | user_agent: string, HTTP User-Agent to provide for this application.<br> |
Joe Gregorio | 3b79fa8 | 2011-02-17 11:47:17 -0500 | [diff] [blame] | 867 | auth_uri: string, URI for authorization endpoint. For convenience<br> |
| 868 | defaults to Google's endpoints but any OAuth 2.0 provider can be used.<br> |
| 869 | token_uri: string, URI for token endpoint. For convenience<br> |
| 870 | 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] | 871 | **kwargs: dict, The keyword arguments are all optional and required<br> |
| 872 | parameters for the OAuth calls.</tt></dd></dl> |
| 873 | |
Joe Gregorio | 3d55ac5 | 2012-02-21 10:11:19 -0500 | [diff] [blame] | 874 | <dl><dt><a name="OAuth2WebServerFlow-step1_get_authorize_url"><strong>step1_get_authorize_url</strong></a>(self, redirect_uri<font color="#909090">='urn:ietf:wg:oauth:2.0:oob'</font>)</dt><dd><tt>Returns a URI to redirect to the provider.<br> |
Joe Gregorio | 6e53703 | 2011-02-09 23:04:26 -0500 | [diff] [blame] | 875 | <br> |
| 876 | Args:<br> |
Joe Gregorio | 3d55ac5 | 2012-02-21 10:11:19 -0500 | [diff] [blame] | 877 | redirect_uri: string, Either the string 'urn:ietf:wg:oauth:2.0:oob' for<br> |
| 878 | a non-web-based application, or a URI that handles the callback from<br> |
| 879 | the authorization server.<br> |
Joe Gregorio | 6e53703 | 2011-02-09 23:04:26 -0500 | [diff] [blame] | 880 | <br> |
Joe Gregorio | 3d55ac5 | 2012-02-21 10:11:19 -0500 | [diff] [blame] | 881 | If redirect_uri is 'urn:ietf:wg:oauth:2.0:oob' then pass in the<br> |
Joe Gregorio | 6e53703 | 2011-02-09 23:04:26 -0500 | [diff] [blame] | 882 | generated verification code to step2_exchange,<br> |
| 883 | otherwise pass in the query parameters received<br> |
| 884 | at the callback uri to step2_exchange.</tt></dd></dl> |
| 885 | |
Joe Gregorio | f826111 | 2011-02-19 14:51:56 -0500 | [diff] [blame] | 886 | <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] | 887 | <br> |
| 888 | Args:<br> |
| 889 | code: string or dict, either the code as a string, or a dictionary<br> |
| 890 | of the query parameters to the redirect_uri, which contains<br> |
Joe Gregorio | f826111 | 2011-02-19 14:51:56 -0500 | [diff] [blame] | 891 | the code.<br> |
| 892 | 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] | 893 | |
| 894 | <hr> |
| 895 | Data descriptors inherited from <a href="oauth2client.client.html#Flow">Flow</a>:<br> |
| 896 | <dl><dt><strong>__dict__</strong></dt> |
| 897 | <dd><tt>dictionary for instance variables (if defined)</tt></dd> |
| 898 | </dl> |
| 899 | <dl><dt><strong>__weakref__</strong></dt> |
| 900 | <dd><tt>list of weak references to the object (if defined)</tt></dd> |
| 901 | </dl> |
| 902 | </td></tr></table> <p> |
| 903 | <table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section"> |
| 904 | <tr bgcolor="#ffc8d8"> |
| 905 | <td colspan=3 valign=bottom> <br> |
Joe Gregorio | b417caf | 2011-12-08 12:04:24 -0500 | [diff] [blame] | 906 | <font color="#000000" face="helvetica, arial"><a name="SignedJwtAssertionCredentials">class <strong>SignedJwtAssertionCredentials</strong></a>(<a href="oauth2client.client.html#AssertionCredentials">AssertionCredentials</a>)</font></td></tr> |
| 907 | |
| 908 | <tr bgcolor="#ffc8d8"><td rowspan=2><tt> </tt></td> |
| 909 | <td colspan=2><tt><a href="#Credentials">Credentials</a> <a href="__builtin__.html#object">object</a> used for OAuth 2.0 Signed JWT assertion grants.<br> |
| 910 | <br> |
| 911 | This credential does not require a flow to instantiate because it<br> |
| 912 | represents a two legged flow, and therefore has all of the required<br> |
| 913 | information to generate and refresh its own access tokens.<br> </tt></td></tr> |
| 914 | <tr><td> </td> |
| 915 | <td width="100%"><dl><dt>Method resolution order:</dt> |
| 916 | <dd><a href="oauth2client.client.html#SignedJwtAssertionCredentials">SignedJwtAssertionCredentials</a></dd> |
| 917 | <dd><a href="oauth2client.client.html#AssertionCredentials">AssertionCredentials</a></dd> |
| 918 | <dd><a href="oauth2client.client.html#OAuth2Credentials">OAuth2Credentials</a></dd> |
| 919 | <dd><a href="oauth2client.client.html#Credentials">Credentials</a></dd> |
| 920 | <dd><a href="__builtin__.html#object">__builtin__.object</a></dd> |
| 921 | </dl> |
| 922 | <hr> |
| 923 | Methods defined here:<br> |
| 924 | <dl><dt><a name="SignedJwtAssertionCredentials-__init__"><strong>__init__</strong></a>(self, service_account_name, private_key, scope, private_key_password<font color="#909090">='notasecret'</font>, user_agent<font color="#909090">=None</font>, token_uri<font color="#909090">='https://accounts.google.com/o/oauth2/token'</font>, **kwargs)</dt><dd><tt>Constructor for <a href="#SignedJwtAssertionCredentials">SignedJwtAssertionCredentials</a>.<br> |
| 925 | <br> |
| 926 | Args:<br> |
| 927 | service_account_name: string, id for account, usually an email address.<br> |
| 928 | private_key: string, private key in P12 format.<br> |
| 929 | scope: string or list of strings, scope(s) of the credentials being<br> |
| 930 | requested.<br> |
| 931 | private_key_password: string, password for private_key.<br> |
| 932 | user_agent: string, HTTP User-Agent to provide for this application.<br> |
| 933 | token_uri: string, URI for token endpoint. For convenience<br> |
| 934 | defaults to Google's endpoints but any OAuth 2.0 provider can be used.<br> |
| 935 | kwargs: kwargs, Additional parameters to add to the JWT token, for<br> |
| 936 | example prn=joe@xample.org.</tt></dd></dl> |
| 937 | |
| 938 | <hr> |
| 939 | Class methods defined here:<br> |
| 940 | <dl><dt><a name="SignedJwtAssertionCredentials-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> |
| 941 | |
| 942 | <hr> |
| 943 | Data and other attributes defined here:<br> |
| 944 | <dl><dt><strong>MAX_TOKEN_LIFETIME_SECS</strong> = 3600</dl> |
| 945 | |
| 946 | <hr> |
| 947 | Methods inherited from <a href="oauth2client.client.html#OAuth2Credentials">OAuth2Credentials</a>:<br> |
| 948 | <dl><dt><a name="SignedJwtAssertionCredentials-__getstate__"><strong>__getstate__</strong></a>(self)</dt><dd><tt>Trim the state down to something that can be pickled.</tt></dd></dl> |
| 949 | |
| 950 | <dl><dt><a name="SignedJwtAssertionCredentials-__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> |
| 951 | |
Joe Gregorio | 3d55ac5 | 2012-02-21 10:11:19 -0500 | [diff] [blame] | 952 | <dl><dt><a name="SignedJwtAssertionCredentials-apply"><strong>apply</strong></a>(self, headers)</dt><dd><tt>Add the authorization to the headers.<br> |
| 953 | <br> |
| 954 | Args:<br> |
| 955 | headers: dict, the headers to add the Authorization header to.</tt></dd></dl> |
| 956 | |
Joe Gregorio | b417caf | 2011-12-08 12:04:24 -0500 | [diff] [blame] | 957 | <dl><dt><a name="SignedJwtAssertionCredentials-authorize"><strong>authorize</strong></a>(self, http)</dt><dd><tt>Authorize an httplib2.Http instance with these credentials.<br> |
| 958 | <br> |
Joe Gregorio | 3d55ac5 | 2012-02-21 10:11:19 -0500 | [diff] [blame] | 959 | The modified http.request method will add authentication headers to each<br> |
| 960 | request and will refresh access_tokens when a 401 is received on a<br> |
| 961 | request. In addition the http.request method has a credentials property,<br> |
| 962 | http.request.credentials, which is the <a href="#Credentials">Credentials</a> <a href="__builtin__.html#object">object</a> that authorized<br> |
| 963 | it.<br> |
| 964 | <br> |
Joe Gregorio | b417caf | 2011-12-08 12:04:24 -0500 | [diff] [blame] | 965 | Args:<br> |
| 966 | http: An instance of httplib2.Http<br> |
| 967 | or something that acts like it.<br> |
| 968 | <br> |
| 969 | Returns:<br> |
| 970 | A modified instance of http that was passed in.<br> |
| 971 | <br> |
| 972 | Example:<br> |
| 973 | <br> |
| 974 | h = httplib2.Http()<br> |
| 975 | h = credentials.<a href="#SignedJwtAssertionCredentials-authorize">authorize</a>(h)<br> |
| 976 | <br> |
| 977 | You can't create a new OAuth subclass of httplib2.Authenication<br> |
| 978 | because it never gets passed the absolute URI, which is needed for<br> |
| 979 | signing. So instead we have to overload 'request' with a closure<br> |
| 980 | that adds in the Authorization header and then calls the original<br> |
| 981 | version of 'request()'.</tt></dd></dl> |
| 982 | |
Joe Gregorio | 3d55ac5 | 2012-02-21 10:11:19 -0500 | [diff] [blame] | 983 | <dl><dt><a name="SignedJwtAssertionCredentials-refresh"><strong>refresh</strong></a>(self, http)</dt><dd><tt>Forces a refresh of the access_token.<br> |
| 984 | <br> |
| 985 | Args:<br> |
| 986 | http: httplib2.Http, an http <a href="__builtin__.html#object">object</a> to be used to make the refresh<br> |
| 987 | request.</tt></dd></dl> |
| 988 | |
Joe Gregorio | b417caf | 2011-12-08 12:04:24 -0500 | [diff] [blame] | 989 | <dl><dt><a name="SignedJwtAssertionCredentials-set_store"><strong>set_store</strong></a>(self, store)</dt><dd><tt>Set the <a href="#Storage">Storage</a> for the credential.<br> |
| 990 | <br> |
| 991 | Args:<br> |
| 992 | store: <a href="#Storage">Storage</a>, an implementation of Stroage <a href="__builtin__.html#object">object</a>.<br> |
| 993 | This is needed to store the latest access_token if it<br> |
| 994 | has expired and been refreshed. This implementation uses<br> |
| 995 | locking to check for updates before updating the<br> |
| 996 | access_token.</tt></dd></dl> |
| 997 | |
| 998 | <dl><dt><a name="SignedJwtAssertionCredentials-to_json"><strong>to_json</strong></a>(self)</dt></dl> |
| 999 | |
| 1000 | <hr> |
| 1001 | Data descriptors inherited from <a href="oauth2client.client.html#OAuth2Credentials">OAuth2Credentials</a>:<br> |
| 1002 | <dl><dt><strong>access_token_expired</strong></dt> |
| 1003 | <dd><tt>True if the credential is expired or invalid.<br> |
| 1004 | <br> |
| 1005 | If the token_expiry isn't set, we assume the token doesn't expire.</tt></dd> |
| 1006 | </dl> |
| 1007 | <hr> |
| 1008 | Class methods inherited from <a href="oauth2client.client.html#Credentials">Credentials</a>:<br> |
| 1009 | <dl><dt><a name="SignedJwtAssertionCredentials-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> |
| 1010 | representation produced by <a href="#SignedJwtAssertionCredentials-to_json">to_json</a>().<br> |
| 1011 | <br> |
| 1012 | Args:<br> |
| 1013 | s: string, JSON from <a href="#SignedJwtAssertionCredentials-to_json">to_json</a>().<br> |
| 1014 | <br> |
| 1015 | Returns:<br> |
| 1016 | An instance of the subclass of <a href="#Credentials">Credentials</a> that was serialized with<br> |
| 1017 | <a href="#SignedJwtAssertionCredentials-to_json">to_json</a>().</tt></dd></dl> |
| 1018 | |
| 1019 | <hr> |
| 1020 | Data descriptors inherited from <a href="oauth2client.client.html#Credentials">Credentials</a>:<br> |
| 1021 | <dl><dt><strong>__dict__</strong></dt> |
| 1022 | <dd><tt>dictionary for instance variables (if defined)</tt></dd> |
| 1023 | </dl> |
| 1024 | <dl><dt><strong>__weakref__</strong></dt> |
| 1025 | <dd><tt>list of weak references to the object (if defined)</tt></dd> |
| 1026 | </dl> |
| 1027 | <hr> |
| 1028 | Data and other attributes inherited from <a href="oauth2client.client.html#Credentials">Credentials</a>:<br> |
| 1029 | <dl><dt><strong>NON_SERIALIZED_MEMBERS</strong> = ['store']</dl> |
| 1030 | |
| 1031 | </td></tr></table> <p> |
| 1032 | <table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section"> |
| 1033 | <tr bgcolor="#ffc8d8"> |
| 1034 | <td colspan=3 valign=bottom> <br> |
Joe Gregorio | 3b79fa8 | 2011-02-17 11:47:17 -0500 | [diff] [blame] | 1035 | <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> |
| 1036 | |
| 1037 | <tr bgcolor="#ffc8d8"><td rowspan=2><tt> </tt></td> |
| 1038 | <td colspan=2><tt>Base class for all <a href="#Storage">Storage</a> objects.<br> |
| 1039 | <br> |
Joe Gregorio | a845167 | 2011-09-15 09:53:21 -0400 | [diff] [blame] | 1040 | Store and retrieve a single credential. This class supports locking<br> |
| 1041 | such that multiple processes and threads can operate on a single<br> |
| 1042 | store.<br> </tt></td></tr> |
Joe Gregorio | 3b79fa8 | 2011-02-17 11:47:17 -0500 | [diff] [blame] | 1043 | <tr><td> </td> |
| 1044 | <td width="100%">Methods defined here:<br> |
Joe Gregorio | a845167 | 2011-09-15 09:53:21 -0400 | [diff] [blame] | 1045 | <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> |
| 1046 | <br> |
| 1047 | This lock is not reentrant.</tt></dd></dl> |
| 1048 | |
Joe Gregorio | 3d55ac5 | 2012-02-21 10:11:19 -0500 | [diff] [blame] | 1049 | <dl><dt><a name="Storage-delete"><strong>delete</strong></a>(self)</dt><dd><tt>Delete credential.<br> |
| 1050 | <br> |
| 1051 | Frees any resources associated with storing the credential.<br> |
| 1052 | The <a href="#Storage">Storage</a> lock must *not* be held when this is called.<br> |
| 1053 | <br> |
| 1054 | Returns:<br> |
| 1055 | None</tt></dd></dl> |
| 1056 | |
Joe Gregorio | 3b79fa8 | 2011-02-17 11:47:17 -0500 | [diff] [blame] | 1057 | <dl><dt><a name="Storage-get"><strong>get</strong></a>(self)</dt><dd><tt>Retrieve credential.<br> |
| 1058 | <br> |
Joe Gregorio | a845167 | 2011-09-15 09:53:21 -0400 | [diff] [blame] | 1059 | The <a href="#Storage">Storage</a> lock must *not* be held when this is called.<br> |
| 1060 | <br> |
Joe Gregorio | 3b79fa8 | 2011-02-17 11:47:17 -0500 | [diff] [blame] | 1061 | Returns:<br> |
Joe Gregorio | 20a5aa9 | 2011-04-01 17:44:25 -0400 | [diff] [blame] | 1062 | oauth2client.client.<a href="#Credentials">Credentials</a></tt></dd></dl> |
Joe Gregorio | 3b79fa8 | 2011-02-17 11:47:17 -0500 | [diff] [blame] | 1063 | |
Joe Gregorio | 3d55ac5 | 2012-02-21 10:11:19 -0500 | [diff] [blame] | 1064 | <dl><dt><a name="Storage-locked_delete"><strong>locked_delete</strong></a>(self)</dt><dd><tt>Delete a credential.<br> |
| 1065 | <br> |
| 1066 | The <a href="#Storage">Storage</a> lock must be held when this is called.</tt></dd></dl> |
| 1067 | |
Joe Gregorio | a845167 | 2011-09-15 09:53:21 -0400 | [diff] [blame] | 1068 | <dl><dt><a name="Storage-locked_get"><strong>locked_get</strong></a>(self)</dt><dd><tt>Retrieve credential.<br> |
| 1069 | <br> |
| 1070 | The <a href="#Storage">Storage</a> lock must be held when this is called.<br> |
| 1071 | <br> |
| 1072 | Returns:<br> |
| 1073 | oauth2client.client.<a href="#Credentials">Credentials</a></tt></dd></dl> |
| 1074 | |
| 1075 | <dl><dt><a name="Storage-locked_put"><strong>locked_put</strong></a>(self, credentials)</dt><dd><tt>Write a credential.<br> |
| 1076 | <br> |
| 1077 | 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] | 1078 | <br> |
| 1079 | Args:<br> |
| 1080 | credentials: <a href="#Credentials">Credentials</a>, the credentials to store.</tt></dd></dl> |
| 1081 | |
Joe Gregorio | a845167 | 2011-09-15 09:53:21 -0400 | [diff] [blame] | 1082 | <dl><dt><a name="Storage-put"><strong>put</strong></a>(self, credentials)</dt><dd><tt>Write a credential.<br> |
| 1083 | <br> |
| 1084 | The <a href="#Storage">Storage</a> lock must be held when this is called.<br> |
| 1085 | <br> |
| 1086 | Args:<br> |
| 1087 | credentials: <a href="#Credentials">Credentials</a>, the credentials to store.</tt></dd></dl> |
| 1088 | |
| 1089 | <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> |
| 1090 | <br> |
| 1091 | Trying to release a lock that isn't held will result in a<br> |
| 1092 | RuntimeError.</tt></dd></dl> |
| 1093 | |
Joe Gregorio | 3b79fa8 | 2011-02-17 11:47:17 -0500 | [diff] [blame] | 1094 | <hr> |
| 1095 | Data descriptors defined here:<br> |
| 1096 | <dl><dt><strong>__dict__</strong></dt> |
| 1097 | <dd><tt>dictionary for instance variables (if defined)</tt></dd> |
| 1098 | </dl> |
| 1099 | <dl><dt><strong>__weakref__</strong></dt> |
| 1100 | <dd><tt>list of weak references to the object (if defined)</tt></dd> |
| 1101 | </dl> |
Joe Gregorio | 761c456 | 2011-10-28 14:36:24 -0400 | [diff] [blame] | 1102 | </td></tr></table> <p> |
| 1103 | <table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section"> |
| 1104 | <tr bgcolor="#ffc8d8"> |
| 1105 | <td colspan=3 valign=bottom> <br> |
| 1106 | <font color="#000000" face="helvetica, arial"><a name="UnknownClientSecretsFlowError">class <strong>UnknownClientSecretsFlowError</strong></a>(<a href="oauth2client.client.html#Error">Error</a>)</font></td></tr> |
| 1107 | |
| 1108 | <tr bgcolor="#ffc8d8"><td rowspan=2><tt> </tt></td> |
| 1109 | <td colspan=2><tt>The client secrets file called for an unknown type of OAuth 2.0 flow.<br> </tt></td></tr> |
| 1110 | <tr><td> </td> |
| 1111 | <td width="100%"><dl><dt>Method resolution order:</dt> |
| 1112 | <dd><a href="oauth2client.client.html#UnknownClientSecretsFlowError">UnknownClientSecretsFlowError</a></dd> |
| 1113 | <dd><a href="oauth2client.client.html#Error">Error</a></dd> |
| 1114 | <dd><a href="exceptions.html#Exception">exceptions.Exception</a></dd> |
| 1115 | <dd><a href="exceptions.html#BaseException">exceptions.BaseException</a></dd> |
| 1116 | <dd><a href="__builtin__.html#object">__builtin__.object</a></dd> |
| 1117 | </dl> |
| 1118 | <hr> |
| 1119 | Data descriptors inherited from <a href="oauth2client.client.html#Error">Error</a>:<br> |
| 1120 | <dl><dt><strong>__weakref__</strong></dt> |
| 1121 | <dd><tt>list of weak references to the object (if defined)</tt></dd> |
| 1122 | </dl> |
| 1123 | <hr> |
| 1124 | Methods inherited from <a href="exceptions.html#Exception">exceptions.Exception</a>:<br> |
Joe Gregorio | b417caf | 2011-12-08 12:04:24 -0500 | [diff] [blame] | 1125 | <dl><dt><a name="UnknownClientSecretsFlowError-__init__"><strong>__init__</strong></a>(...)</dt><dd><tt>x.<a href="#UnknownClientSecretsFlowError-__init__">__init__</a>(...) initializes x; see x.__class__.__doc__ for signature</tt></dd></dl> |
Joe Gregorio | 761c456 | 2011-10-28 14:36:24 -0400 | [diff] [blame] | 1126 | |
| 1127 | <hr> |
| 1128 | Data and other attributes inherited from <a href="exceptions.html#Exception">exceptions.Exception</a>:<br> |
| 1129 | <dl><dt><strong>__new__</strong> = <built-in method __new__ of type object><dd><tt>T.<a href="#UnknownClientSecretsFlowError-__new__">__new__</a>(S, ...) -> a new <a href="__builtin__.html#object">object</a> with type S, a subtype of T</tt></dl> |
| 1130 | |
| 1131 | <hr> |
| 1132 | Methods inherited from <a href="exceptions.html#BaseException">exceptions.BaseException</a>:<br> |
| 1133 | <dl><dt><a name="UnknownClientSecretsFlowError-__delattr__"><strong>__delattr__</strong></a>(...)</dt><dd><tt>x.<a href="#UnknownClientSecretsFlowError-__delattr__">__delattr__</a>('name') <==> del x.name</tt></dd></dl> |
| 1134 | |
| 1135 | <dl><dt><a name="UnknownClientSecretsFlowError-__getattribute__"><strong>__getattribute__</strong></a>(...)</dt><dd><tt>x.<a href="#UnknownClientSecretsFlowError-__getattribute__">__getattribute__</a>('name') <==> x.name</tt></dd></dl> |
| 1136 | |
| 1137 | <dl><dt><a name="UnknownClientSecretsFlowError-__getitem__"><strong>__getitem__</strong></a>(...)</dt><dd><tt>x.<a href="#UnknownClientSecretsFlowError-__getitem__">__getitem__</a>(y) <==> x[y]</tt></dd></dl> |
| 1138 | |
| 1139 | <dl><dt><a name="UnknownClientSecretsFlowError-__getslice__"><strong>__getslice__</strong></a>(...)</dt><dd><tt>x.<a href="#UnknownClientSecretsFlowError-__getslice__">__getslice__</a>(i, j) <==> x[i:j]<br> |
| 1140 | <br> |
| 1141 | Use of negative indices is not supported.</tt></dd></dl> |
| 1142 | |
| 1143 | <dl><dt><a name="UnknownClientSecretsFlowError-__reduce__"><strong>__reduce__</strong></a>(...)</dt></dl> |
| 1144 | |
| 1145 | <dl><dt><a name="UnknownClientSecretsFlowError-__repr__"><strong>__repr__</strong></a>(...)</dt><dd><tt>x.<a href="#UnknownClientSecretsFlowError-__repr__">__repr__</a>() <==> repr(x)</tt></dd></dl> |
| 1146 | |
| 1147 | <dl><dt><a name="UnknownClientSecretsFlowError-__setattr__"><strong>__setattr__</strong></a>(...)</dt><dd><tt>x.<a href="#UnknownClientSecretsFlowError-__setattr__">__setattr__</a>('name', value) <==> x.name = value</tt></dd></dl> |
| 1148 | |
| 1149 | <dl><dt><a name="UnknownClientSecretsFlowError-__setstate__"><strong>__setstate__</strong></a>(...)</dt></dl> |
| 1150 | |
| 1151 | <dl><dt><a name="UnknownClientSecretsFlowError-__str__"><strong>__str__</strong></a>(...)</dt><dd><tt>x.<a href="#UnknownClientSecretsFlowError-__str__">__str__</a>() <==> str(x)</tt></dd></dl> |
| 1152 | |
| 1153 | <dl><dt><a name="UnknownClientSecretsFlowError-__unicode__"><strong>__unicode__</strong></a>(...)</dt></dl> |
| 1154 | |
| 1155 | <hr> |
| 1156 | Data descriptors inherited from <a href="exceptions.html#BaseException">exceptions.BaseException</a>:<br> |
| 1157 | <dl><dt><strong>__dict__</strong></dt> |
| 1158 | </dl> |
| 1159 | <dl><dt><strong>args</strong></dt> |
| 1160 | </dl> |
| 1161 | <dl><dt><strong>message</strong></dt> |
| 1162 | </dl> |
Joe Gregorio | b417caf | 2011-12-08 12:04:24 -0500 | [diff] [blame] | 1163 | </td></tr></table> <p> |
| 1164 | <table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section"> |
| 1165 | <tr bgcolor="#ffc8d8"> |
| 1166 | <td colspan=3 valign=bottom> <br> |
| 1167 | <font color="#000000" face="helvetica, arial"><a name="VerifyJwtTokenError">class <strong>VerifyJwtTokenError</strong></a>(<a href="oauth2client.client.html#Error">Error</a>)</font></td></tr> |
| 1168 | |
| 1169 | <tr bgcolor="#ffc8d8"><td rowspan=2><tt> </tt></td> |
| 1170 | <td colspan=2><tt>Could on retrieve certificates for validation.<br> </tt></td></tr> |
| 1171 | <tr><td> </td> |
| 1172 | <td width="100%"><dl><dt>Method resolution order:</dt> |
| 1173 | <dd><a href="oauth2client.client.html#VerifyJwtTokenError">VerifyJwtTokenError</a></dd> |
| 1174 | <dd><a href="oauth2client.client.html#Error">Error</a></dd> |
| 1175 | <dd><a href="exceptions.html#Exception">exceptions.Exception</a></dd> |
| 1176 | <dd><a href="exceptions.html#BaseException">exceptions.BaseException</a></dd> |
| 1177 | <dd><a href="__builtin__.html#object">__builtin__.object</a></dd> |
| 1178 | </dl> |
| 1179 | <hr> |
| 1180 | Data descriptors inherited from <a href="oauth2client.client.html#Error">Error</a>:<br> |
| 1181 | <dl><dt><strong>__weakref__</strong></dt> |
| 1182 | <dd><tt>list of weak references to the object (if defined)</tt></dd> |
| 1183 | </dl> |
| 1184 | <hr> |
| 1185 | Methods inherited from <a href="exceptions.html#Exception">exceptions.Exception</a>:<br> |
| 1186 | <dl><dt><a name="VerifyJwtTokenError-__init__"><strong>__init__</strong></a>(...)</dt><dd><tt>x.<a href="#VerifyJwtTokenError-__init__">__init__</a>(...) initializes x; see x.__class__.__doc__ for signature</tt></dd></dl> |
| 1187 | |
| 1188 | <hr> |
| 1189 | Data and other attributes inherited from <a href="exceptions.html#Exception">exceptions.Exception</a>:<br> |
| 1190 | <dl><dt><strong>__new__</strong> = <built-in method __new__ of type object><dd><tt>T.<a href="#VerifyJwtTokenError-__new__">__new__</a>(S, ...) -> a new <a href="__builtin__.html#object">object</a> with type S, a subtype of T</tt></dl> |
| 1191 | |
| 1192 | <hr> |
| 1193 | Methods inherited from <a href="exceptions.html#BaseException">exceptions.BaseException</a>:<br> |
| 1194 | <dl><dt><a name="VerifyJwtTokenError-__delattr__"><strong>__delattr__</strong></a>(...)</dt><dd><tt>x.<a href="#VerifyJwtTokenError-__delattr__">__delattr__</a>('name') <==> del x.name</tt></dd></dl> |
| 1195 | |
| 1196 | <dl><dt><a name="VerifyJwtTokenError-__getattribute__"><strong>__getattribute__</strong></a>(...)</dt><dd><tt>x.<a href="#VerifyJwtTokenError-__getattribute__">__getattribute__</a>('name') <==> x.name</tt></dd></dl> |
| 1197 | |
| 1198 | <dl><dt><a name="VerifyJwtTokenError-__getitem__"><strong>__getitem__</strong></a>(...)</dt><dd><tt>x.<a href="#VerifyJwtTokenError-__getitem__">__getitem__</a>(y) <==> x[y]</tt></dd></dl> |
| 1199 | |
| 1200 | <dl><dt><a name="VerifyJwtTokenError-__getslice__"><strong>__getslice__</strong></a>(...)</dt><dd><tt>x.<a href="#VerifyJwtTokenError-__getslice__">__getslice__</a>(i, j) <==> x[i:j]<br> |
| 1201 | <br> |
| 1202 | Use of negative indices is not supported.</tt></dd></dl> |
| 1203 | |
| 1204 | <dl><dt><a name="VerifyJwtTokenError-__reduce__"><strong>__reduce__</strong></a>(...)</dt></dl> |
| 1205 | |
| 1206 | <dl><dt><a name="VerifyJwtTokenError-__repr__"><strong>__repr__</strong></a>(...)</dt><dd><tt>x.<a href="#VerifyJwtTokenError-__repr__">__repr__</a>() <==> repr(x)</tt></dd></dl> |
| 1207 | |
| 1208 | <dl><dt><a name="VerifyJwtTokenError-__setattr__"><strong>__setattr__</strong></a>(...)</dt><dd><tt>x.<a href="#VerifyJwtTokenError-__setattr__">__setattr__</a>('name', value) <==> x.name = value</tt></dd></dl> |
| 1209 | |
| 1210 | <dl><dt><a name="VerifyJwtTokenError-__setstate__"><strong>__setstate__</strong></a>(...)</dt></dl> |
| 1211 | |
| 1212 | <dl><dt><a name="VerifyJwtTokenError-__str__"><strong>__str__</strong></a>(...)</dt><dd><tt>x.<a href="#VerifyJwtTokenError-__str__">__str__</a>() <==> str(x)</tt></dd></dl> |
| 1213 | |
| 1214 | <dl><dt><a name="VerifyJwtTokenError-__unicode__"><strong>__unicode__</strong></a>(...)</dt></dl> |
| 1215 | |
| 1216 | <hr> |
| 1217 | Data descriptors inherited from <a href="exceptions.html#BaseException">exceptions.BaseException</a>:<br> |
| 1218 | <dl><dt><strong>__dict__</strong></dt> |
| 1219 | </dl> |
| 1220 | <dl><dt><strong>args</strong></dt> |
| 1221 | </dl> |
| 1222 | <dl><dt><strong>message</strong></dt> |
| 1223 | </dl> |
Joe Gregorio | 6e53703 | 2011-02-09 23:04:26 -0500 | [diff] [blame] | 1224 | </td></tr></table></td></tr></table><p> |
| 1225 | <table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section"> |
Joe Gregorio | 761c456 | 2011-10-28 14:36:24 -0400 | [diff] [blame] | 1226 | <tr bgcolor="#eeaa77"> |
| 1227 | <td colspan=3 valign=bottom> <br> |
| 1228 | <font color="#ffffff" face="helvetica, arial"><big><strong>Functions</strong></big></font></td></tr> |
| 1229 | |
| 1230 | <tr><td bgcolor="#eeaa77"><tt> </tt></td><td> </td> |
| 1231 | <td width="100%"><dl><dt><a name="-flow_from_clientsecrets"><strong>flow_from_clientsecrets</strong></a>(filename, scope, message<font color="#909090">=None</font>)</dt><dd><tt>Create a <a href="#Flow">Flow</a> from a clientsecrets file.<br> |
| 1232 | <br> |
| 1233 | Will create the right kind of <a href="#Flow">Flow</a> based on the contents of the clientsecrets<br> |
| 1234 | file or will raise InvalidClientSecretsError for unknown types of Flows.<br> |
| 1235 | <br> |
| 1236 | Args:<br> |
| 1237 | filename: string, File name of client secrets.<br> |
| 1238 | scope: string or list of strings, scope(s) to request.<br> |
| 1239 | message: string, A friendly string to display to the user if the<br> |
| 1240 | clientsecrets file is missing or invalid. If message is provided then<br> |
| 1241 | sys.exit will be called in the case of an error. If message in not<br> |
| 1242 | provided then clientsecrets.InvalidClientSecretsError will be raised.<br> |
| 1243 | <br> |
| 1244 | Returns:<br> |
| 1245 | A <a href="#Flow">Flow</a> <a href="__builtin__.html#object">object</a>.<br> |
| 1246 | <br> |
| 1247 | Raises:<br> |
| 1248 | <a href="#UnknownClientSecretsFlowError">UnknownClientSecretsFlowError</a> if the file describes an unknown kind of <a href="#Flow">Flow</a>.<br> |
| 1249 | clientsecrets.InvalidClientSecretsError if the clientsecrets file is<br> |
| 1250 | invalid.</tt></dd></dl> |
Joe Gregorio | b417caf | 2011-12-08 12:04:24 -0500 | [diff] [blame] | 1251 | <dl><dt><a name="-verify_id_token"><strong>verify_id_token</strong></a>(id_token, audience, http<font color="#909090">=None</font>, cert_uri<font color="#909090">='https://www.googleapis.com/oauth2/v1/certs'</font>)</dt><dd><tt>Verifies a signed JWT id_token.<br> |
| 1252 | <br> |
| 1253 | Args:<br> |
| 1254 | id_token: string, A Signed JWT.<br> |
| 1255 | audience: string, The audience 'aud' that the token should be for.<br> |
| 1256 | http: httplib2.Http, instance to use to make the HTTP request. Callers<br> |
| 1257 | should supply an instance that has caching enabled.<br> |
| 1258 | cert_uri: string, URI of the certificates in JSON format to<br> |
| 1259 | verify the JWT against.<br> |
| 1260 | <br> |
| 1261 | Returns:<br> |
| 1262 | The deserialized JSON in the JWT.<br> |
| 1263 | <br> |
| 1264 | Raises:<br> |
| 1265 | oauth2client.crypt.AppIdentityError if the JWT fails to verify.</tt></dd></dl> |
Joe Gregorio | 761c456 | 2011-10-28 14:36:24 -0400 | [diff] [blame] | 1266 | </td></tr></table><p> |
| 1267 | <table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section"> |
Joe Gregorio | 6e53703 | 2011-02-09 23:04:26 -0500 | [diff] [blame] | 1268 | <tr bgcolor="#55aa55"> |
| 1269 | <td colspan=3 valign=bottom> <br> |
| 1270 | <font color="#ffffff" face="helvetica, arial"><big><strong>Data</strong></big></font></td></tr> |
| 1271 | |
| 1272 | <tr><td bgcolor="#55aa55"><tt> </tt></td><td> </td> |
Joe Gregorio | 3d55ac5 | 2012-02-21 10:11:19 -0500 | [diff] [blame] | 1273 | <td width="100%"><strong>EXPIRY_FORMAT</strong> = '%Y-%m-%dT%H:%M:%SZ'<br> |
Joe Gregorio | b417caf | 2011-12-08 12:04:24 -0500 | [diff] [blame] | 1274 | <strong>HAS_OPENSSL</strong> = True<br> |
| 1275 | <strong>ID_TOKEN_VERIFICATON_CERTS</strong> = 'https://www.googleapis.com/oauth2/v1/certs'<br> |
Joe Gregorio | 3d55ac5 | 2012-02-21 10:11:19 -0500 | [diff] [blame] | 1276 | <strong>OOB_CALLBACK_URN</strong> = 'urn:ietf:wg:oauth:2.0:oob'<br> |
Joe Gregorio | a845167 | 2011-09-15 09:53:21 -0400 | [diff] [blame] | 1277 | <strong>__author__</strong> = 'jcgregorio@google.com (Joe Gregorio)'<br> |
Joe Gregorio | b417caf | 2011-12-08 12:04:24 -0500 | [diff] [blame] | 1278 | <strong>logger</strong> = <logging.Logger instance></td></tr></table><p> |
Joe Gregorio | 6e53703 | 2011-02-09 23:04:26 -0500 | [diff] [blame] | 1279 | <table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section"> |
| 1280 | <tr bgcolor="#7799ee"> |
| 1281 | <td colspan=3 valign=bottom> <br> |
| 1282 | <font color="#ffffff" face="helvetica, arial"><big><strong>Author</strong></big></font></td></tr> |
| 1283 | |
| 1284 | <tr><td bgcolor="#7799ee"><tt> </tt></td><td> </td> |
| 1285 | <td width="100%">jcgregorio@google.com (Joe Gregorio)</td></tr></table> |
| 1286 | </body></html> |