l.s.o.e.m.MacaroonResponse(Extension) : class documentation

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
def __init__(self, discharge_macaroon_raw=None, macaroon_ns_uri=MACAROON_NS):
Undocumented
@classmethod
def extractResponse(cls, request, discharge_macaroon_raw):
Take a C{L{MacaroonRequest}} and a serialized discharge macaroon and create a C{L{MacaroonResponse}} object containing that data.

@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

@classmethod
def fromSuccessResponse(cls, success_response, signed_only=True):
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
def getExtensionArgs(self):
Get the fields to put in the macaroon namespace when adding them to an C{id_res} message.

@see: openid.extension

API Documentation for Launchpad, generated by pydoctor at 2022-06-16 00:00:12.