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

Type SRegResponse

object --+    
         |    
 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.
Method Summary
  __init__(self, data, sreg_ns_uri)
  __contains__(self, field_name)
  __nonzero__(self)
  getExtensionArgs(self)
Get the fields to put in the simple registration namespace when adding them to an id_res message.
Inherited from Extension: toMessage
Inherited from object: __delattr__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __str__
    Server
SRegResponse extractResponse(cls, request, data)
Take a SRegRequest and a dictionary of simple registration values and create a SRegResponse object containing that data. (Class method)
    Consumer
SRegResponse fromSuccessResponse(cls, success_response, signed_only)
Create a SRegResponse object from a successful OpenID library response (openid.consumer.consumer.SuccessResponse) response message (Class method)
    Read-only dictionary interface
  keys(self)
  iterkeys(self)
  items(self)
All of the data values in this simple registration response
  iteritems(self)
  __iter__(self)
  get(self, field_name, default)
Like dict.get, except that it checks that the field name is defined by the simple registration specification
  __getitem__(self, field_name)
  has_key(self, key)

Instance Variable Summary
  data: The simple registration data, keyed by the unqualified simple registration name of the field (i.e.
  ns_uri: The URI under which the simple registration data was stored in the response message.

Class Variable Summary
str ns_alias = 'sreg'

Instance Method Details

items(self)

All of the data values in this simple registration response

get(self, field_name, default=None)

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

getExtensionArgs(self)

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

See Also: openid.extension


Class Method Details

extractResponse(cls, request, data)

Take a SRegRequest and a dictionary of simple registration values and create a SRegResponse object containing that data.
Parameters:
request - The simple registration request object
           (type=SRegRequest)
data - 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'.
           (type={str:str})
Returns:
a simple registration response object
           (type=SRegResponse)

fromSuccessResponse(cls, success_response, signed_only=True)

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

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')

ns_uri

The URI under which the simple registration data was stored in the response message.

Class Variable Details

ns_alias

Type:
str
Value:
'sreg'                                                                 

Generated by Epydoc 2.1 on Fri Dec 14 16:10:52 2007 http://epydoc.sf.net