def add_sms_spec_to_request(self, req, federation='<STR_LIT>', loes=None,<EOL>context='<STR_LIT>', url='<STR_LIT>'):
<EOL>if federation:<EOL><INDENT>if not isinstance(federation, list):<EOL><INDENT>federation = [federation]<EOL><DEDENT><DEDENT>if not url:<EOL><INDENT>url = "<STR_LIT>".format(self.mdss_endpoint, context,<EOL>quote_plus(self.entity_id))<EOL><DEDENT>http_resp = self.httpcli(method='<STR_LIT:GET>', url=url, verify=self.verify_ssl)<EOL>if http_resp.status_code >= <NUM_LIT>:<EOL><INDENT>raise ConnectionError('<STR_LIT>'.format(http_resp.text))<EOL><DEDENT>msg = JsonWebToken().from_jwt(http_resp.text, keyjar=self.mdss_keys)<EOL>if msg['<STR_LIT>'] != self.mdss_owner:<EOL><INDENT>raise KeyError('<STR_LIT>')<EOL><DEDENT>if federation:<EOL><INDENT>_sms = dict(<EOL>[(fo, _ms) for fo, _ms in msg.items() if fo in federation])<EOL><DEDENT>else:<EOL><INDENT>_sms = msg.extra()<EOL>try:<EOL><INDENT>del _sms['<STR_LIT>']<EOL><DEDENT>except KeyError:<EOL><INDENT>pass<EOL><DEDENT><DEDENT>req.update({'<STR_LIT>': _sms})<EOL>return req<EOL>
Add signed metadata statements to the request

:param req: The request so far
:param federation: If only signed metadata statements from a specific
    set of federations should be included this is the set.
:param loes: - not used -
:param context: What kind of request/response it is: 'registration',
    'discovery' or 'response'. The later being registration response.
:param url: Just for testing !!
:return: A possibly augmented request.