Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[GitHub] Respect validate_server_cert attribute #354

Merged
merged 3 commits into from
May 16, 2020
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 10 additions & 2 deletions oauthenticator/github.py
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,7 @@ async def authenticate(self, handler, data=None):
method="POST",
headers={"Accept": "application/json"},
body='', # Body is required for a POST...
validate_cert=self.validate_server_cert
consideRatio marked this conversation as resolved.
Show resolved Hide resolved
)

resp = await http_client.fetch(req)
Expand All @@ -155,7 +156,10 @@ async def authenticate(self, handler, data=None):

# Determine who the logged in user is
req = HTTPRequest(
self.github_api + "/user", method="GET", headers=_api_headers(access_token)
self.github_api + "/user",
method="GET",
headers=_api_headers(access_token),
validate_cert=self.validate_server_cert
consideRatio marked this conversation as resolved.
Show resolved Hide resolved
)
resp = await http_client.fetch(req)
resp_json = json.loads(resp.body.decode('utf8', 'replace'))
Expand Down Expand Up @@ -205,7 +209,11 @@ async def _check_organization_whitelist(self, org, username, access_token):
org,
username,
)
req = HTTPRequest(check_membership_url, method="GET", headers=headers)
req = HTTPRequest(
check_membership_url,
method="GET",
headers=headers,
validate_cert=self.validate_server_cert)
consideRatio marked this conversation as resolved.
Show resolved Hide resolved
self.log.debug(
"Checking GitHub organization membership: %s in %s?", username, org
)
Expand Down