Part of lp.services.openid.extensions.macaroon View In Hierarchy
Represents the data returned in a discharge macaroon response inside an OpenID C{id_res} response. This object will be created by the OpenID server, added to the C{id_res} response object, and then extracted from the C{id_res} message by the Consumer. @ivar discharge_macaroon_raw: The serialized discharge macaroon. @type discharge_macaroon_raw: str @ivar ns_uri: The URI under which the macaroon data was stored in the response message. @group Server: extractResponse @group Consumer: fromSuccessResponse @group Read-only dictionary interface: keys, iterkeys, items, iteritems, __iter__, get, __getitem__, keys, has_key
Method | __init__ | Undocumented |
Class Method | extractResponse | Take a C{L{MacaroonRequest}} and a serialized discharge macaroon |
Class Method | fromSuccessResponse | Create a C{L{MacaroonResponse}} object from a successful OpenID |
Method | getExtensionArgs | Get the fields to put in the macaroon namespace when adding them |
@param request: The macaroon request object. @type request: MacaroonRequest
@param discharge_macaroon_raw: The serialized discharge macaroon. @type discharge_macaroon_raw: str
@returns: a macaroon response object @rtype: MacaroonResponse
Create a C{L{MacaroonResponse}} object from a successful OpenID library response message (C{L{openid.consumer.consumer.SuccessResponse}}). @param success_response: A SuccessResponse from consumer.complete(). @type success_response: C{L{openid.consumer.consumer.SuccessResponse}} @param signed_only: Whether to process only data that was signed in the C{id_res} message from the server. @type signed_only: bool @returns: A macaroon response containing the data that was supplied with the C{id_res} response. @rtype: MacaroonResponse