Skip to content

Commit

Permalink
Revert "add envvar MAPILLARY__DISABLE_VERIFYING_SSL that disables SSL…
Browse files Browse the repository at this point in the history
… verification"

This reverts commit cff1385.
  • Loading branch information
ptpt committed Nov 27, 2024
1 parent 6bbd62f commit fe498c4
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 14 deletions.
7 changes: 0 additions & 7 deletions mapillary_tools/api_v4.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,6 @@
MAPILLARY_GRAPH_API_ENDPOINT = os.getenv(
"MAPILLARY_GRAPH_API_ENDPOINT", "https://graph.mapillary.com"
)
# https://requests.readthedocs.io/en/latest/user/advanced/#ssl-cert-verification
MAPILLARY__DISABLE_VERIFYING_SSL = (
os.getenv("MAPILLARY__DISABLE_VERIFYING_SSL") == "TRUE"
)
REQUESTS_TIMEOUT = 60 # 1 minutes


Expand All @@ -22,7 +18,6 @@ def get_upload_token(email: str, password: str) -> requests.Response:
params={"access_token": MAPILLARY_CLIENT_TOKEN},
json={"email": email, "password": password, "locale": "en_US"},
timeout=REQUESTS_TIMEOUT,
verify=not MAPILLARY__DISABLE_VERIFYING_SSL,
)
resp.raise_for_status()
return resp
Expand All @@ -40,7 +35,6 @@ def fetch_organization(
"Authorization": f"OAuth {user_access_token}",
},
timeout=REQUESTS_TIMEOUT,
verify=not MAPILLARY__DISABLE_VERIFYING_SSL,
)
resp.raise_for_status()
return resp
Expand All @@ -62,7 +56,6 @@ def logging(action_type: ActionType, properties: T.Dict) -> requests.Response:
"Authorization": f"OAuth {MAPILLARY_CLIENT_TOKEN}",
},
timeout=REQUESTS_TIMEOUT,
verify=not MAPILLARY__DISABLE_VERIFYING_SSL,
)
resp.raise_for_status()
return resp
7 changes: 0 additions & 7 deletions mapillary_tools/upload_api_v4.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,6 @@
MAPILLARY_GRAPH_API_ENDPOINT = os.getenv(
"MAPILLARY_GRAPH_API_ENDPOINT", "https://graph.mapillary.com"
)
# https://requests.readthedocs.io/en/latest/user/advanced/#ssl-cert-verification
MAPILLARY__DISABLE_VERIFYING_SSL = (
os.getenv("MAPILLARY__DISABLE_VERIFYING_SSL") == "TRUE"
)
DEFAULT_CHUNK_SIZE = 1024 * 1024 * 16 # 16MB
# According to the docs, UPLOAD_REQUESTS_TIMEOUT can be a tuple of
# (connection_timeout, read_timeout): https://requests.readthedocs.io/en/latest/user/advanced/#timeouts
Expand Down Expand Up @@ -101,7 +97,6 @@ def fetch_offset(self) -> int:
url,
headers=headers,
timeout=REQUESTS_TIMEOUT,
verify=not MAPILLARY__DISABLE_VERIFYING_SSL,
)
LOG.debug("HTTP response %s: %s", resp.status_code, resp.content)
resp.raise_for_status()
Expand Down Expand Up @@ -144,7 +139,6 @@ def upload(
headers=headers,
data=chunk,
timeout=UPLOAD_REQUESTS_TIMEOUT,
verify=not MAPILLARY__DISABLE_VERIFYING_SSL,
)
LOG.debug(
"HTTP response %s: %s", resp.status_code, _truncate_end(resp.content)
Expand Down Expand Up @@ -191,7 +185,6 @@ def finish(self, file_handle: str) -> str:
headers=headers,
json=data,
timeout=REQUESTS_TIMEOUT,
verify=not MAPILLARY__DISABLE_VERIFYING_SSL,
)
LOG.debug("HTTP response %s: %s", resp.status_code, _truncate_end(resp.content))

Expand Down

0 comments on commit fe498c4

Please sign in to comment.