openid-certification / oidctest

THE CERTIFICATION TEST SUITE HAS BEEN MIGRATED TO A NEW SERVICE https://www.certificatinon.openid.net
Other
49 stars 15 forks source link

improve error messaging when webfinger is enabled but not configured #135

Open zandbelt opened 5 years ago

zandbelt commented 5 years ago

That situation now leads to a stacktrace presented to the tester:

Traceback (most recent call last):
  File "/usr/local/lib/python3.6/dist-packages/oidctest-0.7.3-py3.6.egg/oidctest/op/func.py", line 39, in set_webfinger_resource
    oper.resource = oper.op_args["resource"]
KeyError: 'resource'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/local/lib/python3.6/dist-packages/oidctest-0.7.3-py3.6.egg/oidctest/op/func.py", line 44, in set_webfinger_resource
    "webfinger_email")
  File "/usr/local/lib/python3.6/dist-packages/otest-0.7.2-py3.6.egg/otest/conversation.py", line 77, in get_tool_attribute
    return kwargs['default']
KeyError: 'default'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/local/lib/python3.6/dist-packages/otest-0.7.2-py3.6.egg/otest/operation.py", line 116, in _setup
    op(self, arg)
  File "/usr/local/lib/python3.6/dist-packages/oidctest-0.7.3-py3.6.egg/oidctest/op/func.py", line 47, in set_webfinger_resource
    'If you want to do dynamic webfinger discovery you '
otest.func.SetUpError: If you want to do dynamic webfinger discovery you must define "webfinger_url" or "webfinger_email" in the "tool" configuration

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/local/lib/python3.6/dist-packages/oidctest-0.7.3-py3.6.egg/oidctest/optt/__init__.py", line 103, in run
    resp = self.tester.run(test, **self.webenv)
  File "/usr/local/lib/python3.6/dist-packages/oidctest-0.7.3-py3.6.egg/oidctest/tool.py", line 105, in run
    return self.run_flow(test_id, conf=kw_args["conf"])
  File "/usr/local/lib/python3.6/dist-packages/otest-0.7.2-py3.6.egg/otest/aus/tool.py", line 84, in run_flow
    _oper.setup(self.profiles.PROFILEMAP)
  File "/usr/local/lib/python3.6/dist-packages/otest-0.7.2-py3.6.egg/otest/operation.py", line 150, in setup
    self._setup()
  File "/usr/local/lib/python3.6/dist-packages/otest-0.7.2-py3.6.egg/otest/operation.py", line 124, in _setup
    raise cherrypy.HTTPError(message=_txt)
cherrypy._cperror.HTTPError: (500, "Can't do <function set_webfinger_resource at 0x7f4d835ea158>")

we should extract the root cause:

otest.func.SetUpError: If you want to do dynamic webfinger discovery you must define "webfinger_url" or "webfinger_email" in the "tool" configuration

and present this is a better way.