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

Class FetchRequest

source code

         object --+        
                  |        
extension.Extension --+    
                      |    
              AXMessage --+
                          |
                         FetchRequest

An attribute exchange 'fetch_request' message. This message is sent by a relying party when it wishes to obtain attributes about the subject of an OpenID authentication request.

Instance Methods
 
__init__(self, update_url=None)
x.__init__(...) initializes x; see x.__class__.__doc__ for signature
source code
 
add(self, attribute)
Add an attribute to this attribute exchange request.
source code
{unicode:unicode}
getExtensionArgs(self)
Get the serialized form of this attribute fetch request.
source code
[str]
getRequiredAttrs(self)
Get the type URIs for all attributes that have been marked as required.
source code
 
parseExtensionArgs(self, ax_args)
Given attribute exchange arguments, populate this FetchRequest.
source code
 
iterAttrs(self)
Iterate over the AttrInfo objects that are contained in this fetch_request.
source code
 
__iter__(self)
Iterate over the attribute type URIs in this fetch_request
source code
 
has_key(self, type_uri)
Is the given type URI present in this fetch_request?
source code
 
__contains__(self, type_uri)
Is the given type URI present in this fetch_request?
source code

Inherited from extension.Extension: toMessage

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

Class Methods
FetchRequest or None
fromOpenIDRequest(cls, openid_request)
Extract a FetchRequest from an OpenID message
source code
Class Variables
  mode = 'fetch_request'
The type of this attribute exchange message.

Inherited from AXMessage: ns_alias, ns_uri

Instance Variables
{str:AttrInfo} requested_attributes
The attributes that have been requested thus far, indexed by the type URI.
  update_url
A URL that will accept responses for this attribute exchange request, even in the absence of the user who made this request.
Properties

Inherited from object: __class__

Method Details

__init__(self, update_url=None)
(Constructor)

source code 

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

Overrides: object.__init__
(inherited documentation)

add(self, attribute)

source code 

Add an attribute to this attribute exchange request.

Parameters:
  • attribute (AttrInfo) - The attribute that is being requested
Returns:
None
Raises:
  • KeyError - when the requested attribute is already present in this fetch request.

getExtensionArgs(self)

source code 

Get the serialized form of this attribute fetch request.

Returns: {unicode:unicode}
The fetch request message parameters
Overrides: extension.Extension.getExtensionArgs

getRequiredAttrs(self)

source code 

Get the type URIs for all attributes that have been marked as required.

Returns: [str]
A list of the type URIs for attributes that have been marked as required.

fromOpenIDRequest(cls, openid_request)
Class Method

source code 

Extract a FetchRequest from an OpenID message

Parameters:
Returns: FetchRequest or None
The FetchRequest extracted from the message or None, if the message contained no AX extension.
Raises:
  • KeyError - if the AuthRequest is not consistent in its use of namespace aliases.
  • AXError - When parseExtensionArgs would raise same.

See Also: parseExtensionArgs

parseExtensionArgs(self, ax_args)

source code 

Given attribute exchange arguments, populate this FetchRequest.

Parameters:
  • ax_args (dict) - Attribute Exchange arguments from the request. As returned from Message.getArgs.
Raises:
  • KeyError - if the message is not consistent in its use of namespace aliases.
  • NotAXMessage - If ax_args does not include an Attribute Exchange mode.
  • AXError - If the data to be parsed does not follow the attribute exchange specification. At least when 'if_available' or 'required' is not specified for a particular attribute type.