Package openid :: Module sreg :: Class SRegResponse
[frames] | no frames]

Class SRegResponse

source code

         object --+    
                  |    
extension.Extension --+
                      |
                     SRegResponse

Represents the data returned in a simple registration response inside of an OpenID id_res response. This object will be created by the OpenID server, added to the id_res response object, and then extracted from the id_res message by the Consumer.

Instance Methods [hide private]
  __init__(self, data=None, sreg_ns_uri=ns_uri)
x.__init__(...) initializes x; see x.__class__.__doc__ for signature
  getExtensionArgs(self)
Get the fields to put in the simple registration namespace when adding them to an id_res message.
  __contains__(self, field_name)
  __nonzero__(self)

Inherited from extension.Extension: toMessage

Inherited from object: __delattr__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __str__

    Read-only dictionary interface
  get(self, field_name, default=None)
Like dict.get, except that it checks that the field name is defined by the simple registration specification
  items(self)
All of the data values in this simple registration response
  iteritems(self)
  keys(self)
  iterkeys(self)
  has_key(self, key)
  __iter__(self)
  __getitem__(self, field_name)

Class Methods [hide private]
    Server
SRegResponse extractResponse(cls, request, data)
Take a SRegRequest and a dictionary of simple registration values and create a SRegResponse object containing that data.
    Consumer
SRegResponse fromSuccessResponse(cls, success_response, signed_only=True)
Create a SRegResponse object from a successful OpenID library response (openid.consumer.consumer.SuccessResponse) response message

Class Variables [hide private]
  ns_alias = 'sreg'

Instance Variables [hide private]
  data
The simple registration data, keyed by the unqualified simple registration name of the field (i.e.
  ns_uri
The namespace to which to add the arguments for this extension

Properties [hide private]

Inherited from object: __class__


Method Details [hide private]

__init__(self, data=None, sreg_ns_uri=ns_uri)
(Constructor)

source code 

x.__init__(...) initializes x; see x.__class__.__doc__ for signature
Overrides: object.__init__
(inherited documentation)

extractResponse(cls, request, data)
Class Method

source code 

Take a SRegRequest and a dictionary of simple registration values and create a SRegResponse object containing that data.
Parameters:
  • request (SRegRequest) - The simple registration request object
  • data ({str:str}) - The simple registration data for this response, as a dictionary from unqualified simple registration field name to string (unicode) value. For instance, the nickname should be stored under the key 'nickname'.
Returns: SRegResponse
a simple registration response object

fromSuccessResponse(cls, success_response, signed_only=True)
Class Method

source code 

Create a SRegResponse object from a successful OpenID library response (openid.consumer.consumer.SuccessResponse) response message
Parameters:
  • success_response (openid.consumer.consumer.SuccessResponse) - A SuccessResponse from consumer.complete()
  • signed_only (bool) - Whether to process only data that was signed in the id_res message from the server.
Returns: SRegResponse
A simple registration response containing the data that was supplied with the id_res response.

getExtensionArgs(self)

source code 

Get the fields to put in the simple registration namespace when adding them to an id_res message.
Overrides: extension.Extension.getExtensionArgs

See Also: openid.extension

get(self, field_name, default=None)

source code 

Like dict.get, except that it checks that the field name is defined by the simple registration specification

items(self)

source code 

All of the data values in this simple registration response

iteritems(self)

source code 

keys(self)

source code 

iterkeys(self)

source code 

has_key(self, key)

source code 

__contains__(self, field_name)
(In operator)

source code 

__iter__(self)

source code 

__getitem__(self, field_name)
(Indexing operator)

source code 

__nonzero__(self)
(Boolean test operator)

source code 

Class Variable Details [hide private]

ns_alias

Value:
'sreg'                                                                 
      

Instance Variable Details [hide private]

data


The simple registration data, keyed by the unqualified simple registration name of the field (i.e. nickname is keyed by 'nickname')

ns_uri


The namespace to which to add the arguments for this extension