Compare commits

..

No commits in common. "8a9200e62785718235823ca99aaf8eb2c9e3fd83" and "49e1d16c6f1c197023e19a5e34324f5c04eec4bb" have entirely different histories.

2 changed files with 3 additions and 5 deletions

View File

@ -2,8 +2,8 @@
Monitor GitHub events and clone repositories to search for secrets, and more. Monitor GitHub events and clone repositories to search for secrets, and more.
## Overview ## Overview
GitMon allows an operator to continually monitor the [GitHub Events API](https://docs.github.com/en/rest/activity/events) GitMon allows an operator to continually monitor the GitHub Events API to collect
to collect metadata and look for secret leakage. metadata and look for secret leakage.
When certain events such as _CreateEvent_ or _DeleteEvent_ are observed, GitMon When certain events such as _CreateEvent_ or _DeleteEvent_ are observed, GitMon
will send the repository URL to a worker that will clone the repository and will send the repository URL to a worker that will clone the repository and

View File

@ -6,15 +6,13 @@ from requests.packages.urllib3.util.retry import Retry
class GitHubApi: class GitHubApi:
def __init__(self, headers=None, proxy=None): def __init__(self, proxy=None):
self.base_url = 'https://api.github.com' self.base_url = 'https://api.github.com'
self.session = requests.Session() self.session = requests.Session()
retries = Retry(total=3, backoff_factor=1) retries = Retry(total=3, backoff_factor=1)
self.session.mount('https://', HTTPAdapter(max_retries=retries)) self.session.mount('https://', HTTPAdapter(max_retries=retries))
if headers:
self.session.headers.update(headers)
if proxy: if proxy:
self.session.proxies.update(proxy) self.session.proxies.update(proxy)