Leaks API key on exception · Issue #330 · maxtepkeev/python-redmine · GitHub
Skip to content

Leaks API key on exception #330

Closed
Closed

Description

@ricardobranco777

The quick way to test it is with no Internet connection:

import os
import logging
from redminelib import Redmine
from redminelib.exceptions import BaseRedmineError
from requests.exceptions import RequestException

URL = os.getenv("URL", "https://progress.opensuse.org")
USER = os.getenv("USER", "test")
API_KEY = "MYAPIKEY"

try:
    client = Redmine(URL, username=USER, key=API_KEY)
    client.issue.get(777)
except (BaseRedmineError, RequestException) as exc:
    logging.error("%s", exc)

ERROR:root:HTTPSConnectionPool(host='progress.opensuse.org', port=443): Max retries exceeded with url: /issues/777.json?key=MYAPIKEY (Caused by NameResolutionError("<urllib3.connection.HTTPSConnection object at 0x7fa218b31450>: Failed to resolve 'progress.opensuse.org' ([Errno -3] Temporary failure in name resolution)"))

The only workaround is to catch requests.exceptions.ConnectionError.

Activity

  1. ricardobranco777 commented on Sep 26, 2023

    @ricardobranco777
    Author
  2. self-assigned this
    on Mar 3, 2024
  3. maxtepkeev commented on Mar 3, 2024

    @maxtepkeev
    Owner

    Fixed in #328. Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions