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

Part of lp.services.openid.extensions.macaroon View In Hierarchy

An object to hold the state of a discharge macaroon request.

@ivar caveat_id: The SSO third-party caveat ID from the root macaroon
    that the RP wants to discharge.
@type caveat_id: str

@group Consumer: requestField, getExtensionArgs, addToOpenIDRequest
@group Server: fromOpenIDRequest, parseExtensionArgs
Method __init__ Initialize an empty discharge macaroon request.
Class Method fromOpenIDRequest Create a discharge macaroon request that contains the fields that
Method parseExtensionArgs Parse the unqualified macaroon request parameters and add them to
Method getExtensionArgs Get a dictionary of unqualified macaroon request parameters
def __init__(self, caveat_id=None, macaroon_ns_uri=MACAROON_NS):
Initialize an empty discharge macaroon request.
@classmethod
def fromOpenIDRequest(cls, request):
Create a discharge macaroon request that contains the fields that were requested in the OpenID request with the given arguments.

@param request: The OpenID request @type request: openid.server.CheckIDRequest

@returns: The newly-created discharge macaroon request @rtype: C{L{MacaroonRequest}}

def parseExtensionArgs(self, args):
Parse the unqualified macaroon request parameters and add them to this object.

This method is essentially the inverse of C{L{getExtensionArgs}}. It restores the serialized macaroon request fields.

If you are extracting arguments from a standard OpenID checkid_* request, you probably want to use C{L{fromOpenIDRequest}}, which will extract the macaroon namespace and arguments from the OpenID request. This method is intended for cases where the OpenID server needs more control over how the arguments are parsed than that method provides.

args = message.getArgs(MACAROON_NS) request.parseExtensionArgs(args)

@param args: The unqualified macaroon arguments @type args: {str:str}

@returns: None; updates this object

def getExtensionArgs(self):
Get a dictionary of unqualified macaroon request parameters representing this request.

This method is essentially the inverse of C{L{parseExtensionArgs}}. It serializes the macaroon request fields.

@rtype: {str:str}

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