def index(self, **kwargs):
if cherrypy.request.process_request_body is True:
_json_doc = cherrypy.request.body.read()
else:
raise cherrypy.HTTPError(400, 'Missing Client registration body')
if _json_doc == b'':
raise cherrypy.HTTPError(400, 'Missing Client registration body')
_args = json.loads(as_unicode(_json_doc))
_mds = MetadataStatement(**_args)
try:
_mds.verify()
except (MessageException, VerificationError) as err:
raise cherrypy.CherryPyException(str(err))
else:
_jwt = self.signer.create_signed_metadata_statement(_mds,
single=True)
cherrypy.response.headers['Content-Type'] = 'application/jwt'
return as_bytes(_jwt)
评论列表
文章目录