Syslifters / reptor

Other
11 stars 3 forks source link

403 Client Error: Forbidden #176

Closed thezakman closed 4 months ago

thezakman commented 4 months ago

I got an error saying that "Community Edition allows max. 1 active API token per user. Please delete some tokens or upgrade to Professional", but I am only using one user, this started after the last update on sysraptor. Anyone have this issue?

     DEBUG    GET URL: https://192.168.0.15/api/v1/pentestprojects/1d05b671-aa65-43ef-b033-07dfdab43740/notes/                                                 APIClient.py:125
           DEBUG    HTTP Headers: {'Content-Type': 'application/json', 'User-Agent': 'reptor CLI v0.1.0', 'Authorization': '[redacted]'}                                   APIClient.py:125
           DEBUG    Starting new HTTPS connection (1): 192.168.0.15:443                                                                                        connectionpool.py:1051
[15:28:46] DEBUG    https://192.168.0.15:443 "GET /api/v1/pentestprojects/1d05b671-aa65-43ef-b033-07dfdab43740/notes/ HTTP/11" 403 142                          connectionpool.py:546
           DEBUG    Received response: b'{"detail":"Community Edition allows max. 1 active API token per user. Please delete some tokens or upgrade to                     APIClient.py:125
                    Professional.","code":"license"}'
           DEBUG    Traceback (most recent call last):                                                                                                                        reptor.py:319
                      File "/opt/homebrew/lib/python3.11/site-packages/reptor/lib/reptor.py", line 317, in run
                        plugin.loader(reptor=self, **self._config.get("cli")).run()
                      File "/opt/homebrew/lib/python3.11/site-packages/reptor/plugins/projects/File/File.py", line 51, in run
                        self.reptor.api.notes.upload_file(
                      File "/opt/homebrew/lib/python3.11/site-packages/reptor/api/NotesAPI.py", line 254, in upload_file
                        self.get_or_create_note_by_title(
                      File "/opt/homebrew/lib/python3.11/site-packages/reptor/api/NotesAPI.py", line 215, in get_or_create_note_by_title
                        note = self.get_note_by_title(title, parent_noteid=parent_noteid)
                               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
                      File "/opt/homebrew/lib/python3.11/site-packages/reptor/api/NotesAPI.py", line 195, in get_note_by_title
                        notes_list = self.get_notes()
                                     ^^^^^^^^^^^^^^^^
                      File "/opt/homebrew/lib/python3.11/site-packages/reptor/api/NotesAPI.py", line 43, in get_notes
                        response = self.get(self.base_endpoint)
                                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
                      File "/opt/homebrew/lib/python3.11/site-packages/reptor/api/APIClient.py", line 175, in get
                        return self._do_request(*args, method="GET", **kwargs)
                               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
                      File "/opt/homebrew/lib/python3.11/site-packages/reptor/api/APIClient.py", line 171, in _do_request
                        response.raise_for_status()
                      File "/opt/homebrew/lib/python3.11/site-packages/requests/models.py", line 1024, in raise_for_status
                        raise HTTPError(http_error_msg, response=self)
                    requests.exceptions.HTTPError: 403 Client Error: Forbidden for url:
                    https://192.168.0.15/api/v1/pentestprojects/1d05b671-aa65-43ef-b033-07dfdab43740/notes/

403 Client Error: Forbidden for url: https://192.168.0.15/api/v1/pentestprojects/1d05b671-aa65-43ef-b033-07dfdab43740/notes/

aronmolnar commented 4 months ago

This was a bug in the SysReptor server (see https://github.com/Syslifters/sysreptor/issues/274).

It was fixed in the latest SysReptor version.