Package openid :: Package extensions :: Module ax :: Class FetchResponse
[frames] | no frames]

Class FetchResponse

source code

         object --+            
                  |            
extension.Extension --+        
                      |        
              AXMessage --+    
                          |    
          AXKeyValueMessage --+
                              |
                             FetchResponse

A fetch_response attribute exchange message

Instance Methods
 
__init__(self, request=None, update_url=None)
x.__init__(...) initializes x; see x.__class__.__doc__ for signature
source code
{unicode;unicode}
getExtensionArgs(self)
Serialize this object into arguments in the attribute exchange namespace
source code
 
parseExtensionArgs(self, ax_args)
Parse attribute exchange key/value arguments into this object.
source code

Inherited from AXKeyValueMessage: addValue, count, get, getSingle, setValues

Inherited from extension.Extension: toMessage

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

Class Methods
 
fromSuccessResponse(cls, success_response, signed=True)
Construct a FetchResponse object from an OpenID library SuccessResponse object.
source code
Class Variables
  mode = 'fetch_response'
The type of this attribute exchange message.

Inherited from AXMessage: ns_alias, ns_uri

Properties

Inherited from object: __class__

Method Details

__init__(self, request=None, update_url=None)
(Constructor)

source code 

x.__init__(...) initializes x; see x.__class__.__doc__ for signature

Parameters:
  • request (FetchRequest) - When supplied, I will use namespace aliases that match those in this request. I will also check to make sure I do not respond with attributes that were not requested.
  • update_url (str) - By default, update_url is taken from the request. But if you do not supply the request, you may set the update_url here.
Overrides: object.__init__

getExtensionArgs(self)

source code 

Serialize this object into arguments in the attribute exchange namespace

Returns: {unicode;unicode}
The dictionary of unqualified attribute exchange arguments that represent this fetch_response.
Overrides: extension.Extension.getExtensionArgs

parseExtensionArgs(self, ax_args)

source code 

Parse attribute exchange key/value arguments into this object.

Parameters:
  • ax_args - The attribute exchange fetch_response arguments, with namespacing removed.
Returns:
None
Raises:
  • ValueError - If the message has bad values for particular fields
  • KeyError - If the namespace mapping is bad or required arguments are missing
Overrides: AXKeyValueMessage.parseExtensionArgs

See Also: {Extension.parseExtensionArgs<openid.extension.Extension.parseExtensionArgs>}

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

source code 

Construct a FetchResponse object from an OpenID library SuccessResponse object.

Parameters:
  • success_response (openid.consumer.consumer.SuccessResponse) - A successful id_res response object
  • signed (bool) - Whether non-signed args should be processsed. If True (the default), only signed arguments will be processsed.
Returns:
A FetchResponse containing the data from the OpenID message, or None if the SuccessResponse did not contain AX extension data.
Raises:
  • AXError - when the AX data cannot be parsed.