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

added support to read proxy settings from env vars #2571

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
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
1 change: 1 addition & 0 deletions connectors/sources/box.py
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,7 @@ def __init__(self, configuration):
self._logger = logger
self.is_enterprise = configuration["is_enterprise"]
self._http_session = aiohttp.ClientSession(
trust_env=True,
base_url=BASE_URL, raise_for_status=True
)
self.token = AccessToken(
Expand Down
1 change: 1 addition & 0 deletions connectors/sources/confluence.py
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,7 @@ def _get_session(self):
basic_auth = aiohttp.BasicAuth(login=auth[0], password=auth[1])
timeout = aiohttp.ClientTimeout(total=None) # pyright: ignore
self.session = aiohttp.ClientSession(
trust_env=True,
auth=basic_auth,
headers={
"accept": "application/json",
Expand Down
6 changes: 5 additions & 1 deletion connectors/sources/dropbox.py
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,11 @@ def _get_session(self):
self._logger.debug("Generating aiohttp client session")
timeout = aiohttp.ClientTimeout(total=None)

return aiohttp.ClientSession(timeout=timeout, raise_for_status=True)
return aiohttp.ClientSession(
trust_env=True,
timeout=timeout,
raise_for_status=True
)

async def close(self):
self._sleeps.cancel()
Expand Down
1 change: 1 addition & 0 deletions connectors/sources/github.py
Original file line number Diff line number Diff line change
Expand Up @@ -737,6 +737,7 @@ def _get_session(self):
connector = aiohttp.TCPConnector(ssl=self.ssl_ctx)
timeout = aiohttp.ClientTimeout(total=None)
return aiohttp.ClientSession(
trust_env=True,
timeout=timeout,
raise_for_status=True,
connector=connector,
Expand Down
3 changes: 3 additions & 0 deletions connectors/sources/graphql.py
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,7 @@ def session(self):
}
)
return aiohttp.ClientSession(
trust_env=True,
headers=self.headers,
timeout=timeout,
raise_for_status=True,
Expand All @@ -107,13 +108,15 @@ def session(self):
password=self.configuration["password"],
)
return aiohttp.ClientSession(
trust_env=True,
auth=basic_auth,
headers=self.headers,
timeout=timeout,
raise_for_status=True,
)
else:
return aiohttp.ClientSession(
trust_env=True,
headers=self.headers,
timeout=timeout,
raise_for_status=True,
Expand Down
1 change: 1 addition & 0 deletions connectors/sources/jira.py
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,7 @@ def _get_session(self):
basic_auth = aiohttp.BasicAuth(login=login, password=password)
timeout = aiohttp.ClientTimeout(total=None) # pyright: ignore
self.session = aiohttp.ClientSession(
trust_env=True,
auth=basic_auth,
headers={
"accept": "application/json",
Expand Down
1 change: 1 addition & 0 deletions connectors/sources/microsoft_teams.py
Original file line number Diff line number Diff line change
Expand Up @@ -364,6 +364,7 @@ class MicrosoftTeamsClient:
def __init__(self, tenant_id, client_id, client_secret, username, password):
self._sleeps = CancellableSleeps()
self._http_session = aiohttp.ClientSession(
trust_env=True,
headers={
"accept": "application/json",
"content-type": "application/json",
Expand Down
1 change: 1 addition & 0 deletions connectors/sources/notion.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ def session(self):
connector = aiohttp.TCPConnector(limit=MAX_CONCURRENT_CLIENT_SUPPORT)

return aiohttp.ClientSession(
trust_env=True,
connector=connector,
raise_for_status=True,
)
Expand Down
1 change: 1 addition & 0 deletions connectors/sources/onedrive.py
Original file line number Diff line number Diff line change
Expand Up @@ -249,6 +249,7 @@ def session(self):
connector = aiohttp.TCPConnector(limit=DEFAULT_PARALLEL_CONNECTION_COUNT)
timeout = aiohttp.ClientTimeout(total=REQUEST_TIMEOUT)
return aiohttp.ClientSession(
trust_env=True,
timeout=timeout,
raise_for_status=True,
connector=connector,
Expand Down
1 change: 1 addition & 0 deletions connectors/sources/opentext_documentum.py
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,7 @@ def _get_session(self):
auth = aiohttp.BasicAuth(login=login, password=password)
timeout = aiohttp.ClientTimeout(total=None)
return aiohttp.ClientSession(
trust_env=True,
auth=auth,
headers={
"content-type": "application/vnd.emc.documentum+json",
Expand Down
5 changes: 4 additions & 1 deletion connectors/sources/outlook.py
Original file line number Diff line number Diff line change
Expand Up @@ -358,7 +358,10 @@ def __init__(self, client_id, client_secret, tenant_id):

@cached_property
def _get_session(self):
return aiohttp.ClientSession(raise_for_status=True)
return aiohttp.ClientSession(
trust_env=True,
raise_for_status=True
)

async def close(self):
await self._get_session.close()
Expand Down
1 change: 1 addition & 0 deletions connectors/sources/salesforce.py
Original file line number Diff line number Diff line change
Expand Up @@ -200,6 +200,7 @@ def set_logger(self, logger_):
@cached_property
def session(self):
return aiohttp.ClientSession(
trust_env=True,
timeout=aiohttp.ClientTimeout(total=None),
)

Expand Down
1 change: 1 addition & 0 deletions connectors/sources/servicenow.py
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,7 @@ def _get_session(self):
timeout = aiohttp.ClientTimeout(total=None) # pyright: ignore

return aiohttp.ClientSession(
trust_env=True,
connector=connector,
base_url=self.configuration["url"],
auth=basic_auth,
Expand Down
1 change: 1 addition & 0 deletions connectors/sources/sharepoint_online.py
Original file line number Diff line number Diff line change
Expand Up @@ -526,6 +526,7 @@ def __init__(self, tenant_id, tenant_name, client_id, client_secret):
# Change the value at your own risk
tcp_connector = aiohttp.TCPConnector(limit=DEFAULT_PARALLEL_CONNECTION_COUNT)
self._http_session = aiohttp.ClientSession( # TODO: lazy create this
trust_env=True,
connector=tcp_connector,
headers={
"accept": "application/json",
Expand Down
1 change: 1 addition & 0 deletions connectors/sources/sharepoint_server.py
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,7 @@ def _get_session(self):
timeout = aiohttp.ClientTimeout(total=None) # pyright: ignore

self.session = aiohttp.ClientSession(
trust_env=True,
auth=aiohttp.BasicAuth(
login=self.configuration["username"],
password=self.configuration["password"],
Expand Down
1 change: 1 addition & 0 deletions connectors/sources/slack.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ class SlackClient:
def __init__(self, configuration):
self.token = configuration["token"]
self._http_session = aiohttp.ClientSession(
trust_env=True,
headers=self._headers(),
timeout=aiohttp.ClientTimeout(total=None),
raise_for_status=True,
Expand Down
5 changes: 4 additions & 1 deletion connectors/sources/zoom.py
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,10 @@ def __init__(self, configuration):
self._logger = logger

self.configuration = configuration
self.http_session = aiohttp.ClientSession(raise_for_status=True)
self.http_session = aiohttp.ClientSession(
trust_env=True,
raise_for_status=True
)

self.api_token = ZoomAPIToken(
http_session=self.http_session,
Expand Down