oauth2client.contrib.devshell module

OAuth 2.0 utitilies for Google Developer Shell environment.

exception oauth2client.contrib.devshell.CommunicationError[source]

Bases: oauth2client.contrib.devshell.Error

Errors for communication with the Developer Shell server.

class oauth2client.contrib.devshell.CredentialInfoResponse(json_string)[source]

Bases: object

Credential information response from Developer Shell server.

The credential information response from Developer Shell socket is a PBLite-formatted JSON array with fields encoded by their index in the array:

  • Index 0 - user email
  • Index 1 - default project ID. None if the project context is not known.
  • Index 2 - OAuth2 access token. None if there is no valid auth context.
  • Index 3 - Seconds until the access token expires. None if not present.
class oauth2client.contrib.devshell.DevshellCredentials(user_agent=None)[source]

Bases: oauth2client.client.GoogleCredentials

Credentials object for Google Developer Shell environment.

This object will allow a Google Developer Shell session to identify its user to Google and other OAuth 2.0 servers that can verify assertions. It can be used for the purpose of accessing data stored under the user account.

This credential does not require a flow to instantiate because it represents a two legged flow, and therefore has all of the required information to generate and refresh its own access tokens.

classmethod from_json(json_data)[source]

Instantiate a Credentials object from a JSON description of it.

The JSON should have been produced by calling .to_json() on the object.

Parameters:json_data – string or bytes, JSON to deserialize.
Returns:An instance of a Credentials subclass.
exception oauth2client.contrib.devshell.Error[source]

Bases: exceptions.Exception

Errors for this module.

exception oauth2client.contrib.devshell.NoDevshellServer[source]

Bases: oauth2client.contrib.devshell.Error

Error when no Developer Shell server can be contacted.