Package openid :: Package extensions :: 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
 
__init__(self, data=None, sreg_ns_uri='http://openid.net/extensions/sreg/1.1')
x.__init__(...) initializes x; see x.__class__.__doc__ for signature
source code
 
getExtensionArgs(self)
Get the fields to put in the simple registration namespace when adding them to an id_res message.
source code
 
__contains__(self, field_name) source code
 
__nonzero__(self) source code

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
source code
 
items(self)
All of the data values in this simple registration response
source code
 
iteritems(self) source code
 
keys(self) source code
 
iterkeys(self) source code
 
has_key(self, key) source code
 
__iter__(self) source code
 
__getitem__(self, field_name) source code
Class Methods
    Server
SRegResponse
extractResponse(cls, request, data)
Take a SRegRequest and a dictionary of simple registration values and create a SRegResponse object containing that data.
source code
    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
source code
Class Variables
  ns_alias = 'sreg'
Instance Variables
  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

Inherited from object: __class__

Method Details

__init__(self, data=None, sreg_ns_uri='http://openid.net/extensions/sreg/1.1')
(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.

Returns:
A dictionary of completely non-namespaced arguments to be added. For example, if the extension's alias is 'uncle', and this method returns {'meat':'Hot Rats'}, the final message will contain {'openid.uncle.meat':'Hot Rats'}
Overrides: extension.Extension.getExtensionArgs

See Also: openid.extension


Instance Variable Details

data

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