Compare commits

...

2 Commits

Author SHA1 Message Date
8a9200e627 Add header support 2023-11-10 19:42:16 -05:00
d00b009706 Update README.md 2023-11-10 19:41:20 -05:00
2 changed files with 5 additions and 3 deletions

View File

@ -2,8 +2,8 @@
Monitor GitHub events and clone repositories to search for secrets, and more.
## Overview
GitMon allows an operator to continually monitor the GitHub Events API to collect
metadata and look for secret leakage.
GitMon allows an operator to continually monitor the [GitHub Events API](https://docs.github.com/en/rest/activity/events)
to collect metadata and look for secret leakage.
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

View File

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