#52 libpagure doesn't work any more because of anubis
Closed: Fixed by abbra. Opened by abbra.

Copy of https://pagure.io/fedora-infrastructure/issue/12886

I am using libpagure to read data from pagure tickets using an authentication token and my script doesn't work any more because of the anubis deployment.

Minimal reproducer: I have a pagure token with the following permissions:

  • Commit to a git repository via http(s)
  • Change the status of a ticket
  • Comment on a ticket
  • Create a new ticket
  • Update an issue, status, comments, custom fields...
$ cat /tmp/pagure_minimal.py 
#!/usr/bin/python3
from libpagure import Pagure
import sys
print("Access issue without any token")
pg = Pagure(pagure_repository="freeipa")
data = pg.issue_info("7979")
print(data)
print("Access issue with token")
pg2 = Pagure(pagure_repository="freeipa", pagure_token=sys.argv[1])
data2 = pg2.issue_info("7979")
print(data2)

My token is set in $PAGURE_TOKEN and when I use libpagure to access the issue:
- the API works if I don't provide any token
- the API fails if I provide my token

We figured out that adding Accept: */* header is enough to restore communication with pagure.io.

Perhaps, libpagure should set this header by default?


Fix: https://pagure.io/libpagure/pull-request/53

Metadata Update from @abbra:
- Issue close_status updated to: Fixed
- Issue status updated to: Closed (was: Open)

Metadata
Related Pull Requests