rhevm-qe-automation / pytest_jira

py.test plugin to integrate with JIRA
GNU General Public License v2.0
29 stars 25 forks source link

403 Failed to parse Connect Session Auth Token #136

Closed braunman closed 8 months ago

braunman commented 8 months ago

Hi, Try to use library with personal api in jira.cfg file add url and api token (by instruction here https://docs.searchunify.com/Content/Content-Sources/Atlassian-Jira-Confluence-Authentication-Create-API-Token.htm) by get

INTERNALERROR> Traceback (most recent call last):
INTERNALERROR>   File "/Users/user/work/venv_3.10/lib/python3.10/site-packages/_pytest/main.py", line 268, in wrap_session
INTERNALERROR>     session.exitstatus = doit(config, session) or 0
INTERNALERROR>   File "/Users/user/work/venv_3.10/lib/python3.10/site-packages/_pytest/main.py", line 321, in _main
INTERNALERROR>     config.hook.pytest_collection(session=session)
INTERNALERROR>   File "/Users/user/work/venv_3.10/lib/python3.10/site-packages/pluggy/_hooks.py", line 265, in __call__
INTERNALERROR>     return self._hookexec(self.name, self.get_hookimpls(), kwargs, firstresult)
INTERNALERROR>   File "/Users/user/work/venv_3.10/lib/python3.10/site-packages/pluggy/_manager.py", line 80, in _hookexec
INTERNALERROR>     return self._inner_hookexec(hook_name, methods, kwargs, firstresult)
INTERNALERROR>   File "/Users/user/work/venv_3.10/lib/python3.10/site-packages/pluggy/_callers.py", line 60, in _multicall
INTERNALERROR>     return outcome.get_result()
INTERNALERROR>   File "/Users/user/work/venv_3.10/lib/python3.10/site-packages/pluggy/_result.py", line 60, in get_result
INTERNALERROR>     raise ex[1].with_traceback(ex[2])
INTERNALERROR>   File "/Users/user/work/venv_3.10/lib/python3.10/site-packages/pluggy/_callers.py", line 39, in _multicall
INTERNALERROR>     res = hook_impl.function(*args)
INTERNALERROR>   File "/Users/user/work/venv_3.10/lib/python3.10/site-packages/_pytest/main.py", line 332, in pytest_collection
INTERNALERROR>     session.perform_collect()
INTERNALERROR>   File "/Users/user/work/venv_3.10/lib/python3.10/site-packages/_pytest/main.py", line 660, in perform_collect
INTERNALERROR>     hook.pytest_collection_modifyitems(
INTERNALERROR>   File "/Users/user/work/venv_3.10/lib/python3.10/site-packages/pluggy/_hooks.py", line 265, in __call__
INTERNALERROR>     return self._hookexec(self.name, self.get_hookimpls(), kwargs, firstresult)
INTERNALERROR>   File "/Users/user/work/venv_3.10/lib/python3.10/site-packages/pluggy/_manager.py", line 80, in _hookexec
INTERNALERROR>     return self._inner_hookexec(hook_name, methods, kwargs, firstresult)
INTERNALERROR>   File "/Users/user/work/venv_3.10/lib/python3.10/site-packages/pluggy/_callers.py", line 60, in _multicall
INTERNALERROR>     return outcome.get_result()
INTERNALERROR>   File "/Users/user/work/venv_3.10/lib/python3.10/site-packages/pluggy/_result.py", line 60, in get_result
INTERNALERROR>     raise ex[1].with_traceback(ex[2])
INTERNALERROR>   File "/Users/user/work/venv_3.10/lib/python3.10/site-packages/pluggy/_callers.py", line 39, in _multicall
INTERNALERROR>     res = hook_impl.function(*args)
INTERNALERROR>   File "/Users/user/work/venv_3.10/lib/python3.10/site-packages/pytest_jira.py", line 125, in pytest_collection_modifyitems
INTERNALERROR>     if not self.is_issue_resolved(issue_id):
INTERNALERROR>   File "/Users/user/work/venv_3.10/lib/python3.10/site-packages/pytest_jira.py", line 78, in is_issue_resolved
INTERNALERROR>     self.issue_cache[issue_id] = self.conn.get_issue(
INTERNALERROR>   File "/Users/user/work/venv_3.10/lib/python3.10/site-packages/decorator.py", line 232, in fun
INTERNALERROR>     return caller(func, *(extras + args), **kw)
INTERNALERROR>   File "/Users/user/work/venv_3.10/lib/python3.10/site-packages/retry/api.py", line 73, in retry_decorator
INTERNALERROR>     return __retry_internal(partial(f, *args, **kwargs), exceptions, tries, delay, max_delay, backoff, jitter,
INTERNALERROR>   File "/Users/user/work/venv_3.10/lib/python3.10/site-packages/retry/api.py", line 33, in __retry_internal
INTERNALERROR>     return f()
INTERNALERROR>   File "/Users/user/work/venv_3.10/lib/python3.10/site-packages/pytest_jira.py", line 256, in get_issue
INTERNALERROR>     self.check_connection()
INTERNALERROR>   File "/Users/user/work/venv_3.10/lib/python3.10/site-packages/pytest_jira.py", line 233, in check_connection
INTERNALERROR>     r = self._jira_request(
INTERNALERROR>   File "/Users/user/work/venv_3.10/lib/python3.10/site-packages/pytest_jira.py", line 227, in _jira_request
INTERNALERROR>     rsp.raise_for_status()
INTERNALERROR>   File "/Users/user/work/venv_3.10/lib/python3.10/site-packages/requests/models.py", line 1021, in raise_for_status
INTERNALERROR>     raise HTTPError(http_error_msg, response=self)
INTERNALERROR> requests.exceptions.HTTPError: 403 Client Error: Forbidden for url: https://eeeeeeee.atlassian.net/rest/api/2/mypermissions?permissions=BROWSE_PROJECTS

if it try in postman get answer

{"error": "Failed to parse Connect Session Auth Token"}

braunman commented 8 months ago

I understood that api token (by instruction here https://docs.searchunify.com/Content/Content-Sources/Atlassian-Jira-Confluence-Authentication-Create-API-Token.htm) it is not an api token by it is password