preslavmihaylov / todocheck

A static code analyser for annotated TODO comments
MIT License
426 stars 42 forks source link

Authentication to selfhosted jira v8.20.11 fails #196

Closed Jasper-Ben closed 2 years ago

Jasper-Ben commented 2 years ago

Used config:

origin: <jira_url>
issue_tracker: JIRA
auth:
  type: apitoken
  options:
    username: <username>

Auth token is parsed via environment variable:

TODOCHECK_AUTH_TOKEN=MY_TOKEN todocheck -verbose

Todo comment:

    # TODO RDPHOEN-1359: Unfreeze meta-openembedded after patch apply on cryptsetup has been fixed.

Error:

couldn't check todo line: couldn't fetch task status: bad status code upon fetching task: 403

User is definitely allowed access to the said issue. Am I doing something wrong or is Jira integration currently broken? Can someone confirm?

preslavmihaylov commented 2 years ago

When I integrated JIRA, I've tested it against an atlassian-hosted instance. Unfortunately, I don't have access to a self-hosted JIRA, but I can try providing some debugging pointers & would appreciate your help to debunk this

preslavmihaylov commented 2 years ago

Could you try running:

AUTH=$(echo -n '<username>:<auth-token>' | openssl base64)
curl -H "Authorization: Basic $AUTH" <jira_url>/rest/api/2/issue/RDPHOEN-1359

You can start debugging what the issue is from there. That is what todocheck is executing as HTTP request under the hood.

preslavmihaylov commented 2 years ago

In the meantime, I'll attempt setting up self-hosted JIRA locally & reproducing the issue

Jasper-Ben commented 2 years ago

:wave: @preslavmihaylov sure thing, happy to help! Can you msg me directly at jasper.orschulko@iris-sensing.com as log msgs might contain semi-sensitive data and I'd like to avoid having to tripple check them before posting them here.

Jasper-Ben commented 2 years ago

In the meantime, I'll attempt setting up self-hosted JIRA locally & reproducing the issue

be aware, there have been some changes to JIRA licensing. AFAIK the selfhosted "server" variant does not exist any more, only the expensive "datacenter" license. I believe we are on datacenter, however it should behave more or less exactly to the server variant.

Not sure, if it is possible to easily obtain a trial datacenter license.

Jasper-Ben commented 2 years ago

Found your mail on your website. Will send you the logs