Package openid :: Package server :: Module server :: Class OpenIDResponse
[frames | no frames]

Type OpenIDResponse

object --+
         |
        OpenIDResponse


I am a response to an OpenID request.
Method Summary
  __init__(self, request)
Make a response to an OpenIDRequest.
  __str__(self)
  addField(self, namespace, key, value, signed)
Add a field to this response.
  addFields(self, namespace, fields, signed)
Add a number of fields to this response.
str encodeToKVForm(self)
Encode a response in key-value colon/newline format.
str encodeToURL(self)
Encode a response as a URL for the user agent to GET.
bool needsSigning(self)
Does this response require signing?
  update(self, namespace, other)
Update my fields with those from another OpenIDResponse.
  whichEncoding(self)
How should I be encoded?
Inherited from object: __delattr__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__

Instance Variable Summary
dict fields: My parameters as a dictionary with each key mapping to one value.
OpenIDRequest request: The request I respond to.
list of str signed: The names of the fields which should be signed.

Method Details

__init__(self, request)
(Constructor)

Make a response to an OpenIDRequest.
Parameters:
request
           (type=OpenIDRequest)
Overrides:
__builtin__.object.__init__

addField(self, namespace, key, value, signed=True)

Add a field to this response.
Parameters:
namespace - The extension namespace the field is in, with no leading "openid." e.g. "sreg".
           (type=str)
key - The field's name, e.g. "fullname".
           (type=str)
value - The field's value.
           (type=str)
signed - Whether this field should be signed.
           (type=bool)

addFields(self, namespace, fields, signed=True)

Add a number of fields to this response.
Parameters:
namespace - The extension namespace the field is in, with no leading "openid." e.g. "sreg".
           (type=str)
fields - A dictionary with the fields to add. e.g. {"fullname": "Frank the Goat"}
signed - Whether these fields should be signed.
           (type=bool)

encodeToKVForm(self)

Encode a response in key-value colon/newline format.

This is a machine-readable format used to respond to messages which came directly from the consumer and not through the user agent.
Returns:
str

See Also: OpenID Specs, Key-Value Colon/Newline format

encodeToURL(self)

Encode a response as a URL for the user agent to GET.

You will generally use this URL with a HTTP redirect.
Returns:
A URL to direct the user agent back to.
           (type=str)

needsSigning(self)

Does this response require signing?
Returns:
bool

update(self, namespace, other)

Update my fields with those from another OpenIDResponse.

The idea here is that if you write an OpenID extension, it could produce a Response object with fields and signed attributes, and you could merge it with me using this method before I am signed and sent.

All entries in other.fields will have their keys prefixed with namespace and added to my fields. All elements of other.signed will be prefixed with namespace and added to my signed list.
Parameters:
namespace - The extension namespace the field is in, with no leading "openid." e.g. "sreg".
           (type=str)
other - A response object to update from.
           (type=OpenIDResponse)

whichEncoding(self)

How should I be encoded?
Returns:
one of ENCODE_URL or ENCODE_KVFORM.

Instance Variable Details

fields

My parameters as a dictionary with each key mapping to one value. Keys are parameter names with no leading "openid.". e.g. "identity" and "mac_key", never "openid.identity".
Type:
dict

request

The request I respond to.
Type:
OpenIDRequest

signed

The names of the fields which should be signed.
Type:
list of str

Generated by Epydoc 2.1 on Mon Jun 11 13:59:41 2007 http://epydoc.sf.net