Skip to content

Leaks API key on exception #187

Description

@ricardobranco777

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

import os
import logging
from bugzilla import Bugzilla
from bugzilla.exceptions import BugzillaError
from requests.exceptions import RequestException

URL = os.getenv("URL", "https://bugzilla.suse.com")
USER = os.getenv("USER", "test")
API_KEY = "MYAPIKEY"

try:
    client = Bugzilla(URL, force_rest=True, user=USER, api_key=API_KEY)
except (BugzillaError, RequestException) as exc:
    error = exc
    logging.error("%s", exc)

ERROR:root:HTTPSConnectionPool(host='bugzilla.suse.com', port=443): Max retries exceeded with url: /rest/version?Bugzilla_api_key=MYAPIKEY (Caused by NameResolutionError("<urllib3.connection.HTTPSConnection object at 0x7f48458cbf90>: Failed to resolve 'bugzilla.suse.com' ([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
    ContributorAuthor
  2. crazyscientist commented on Oct 27, 2023

    @crazyscientist
    Contributor

    Fixed by #188. Thank you 🙂

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions