From 2e10b0ee648059738bcbec8202c417ace6606a4a Mon Sep 17 00:00:00 2001 From: ohmayr Date: Fri, 2 Aug 2024 21:24:53 +0000 Subject: [PATCH 1/5] chore: initial setup for async auth sessions api --- google/auth/aio/transport/requests.py | 16 ++++++++++++++++ tests/transport/aio/test_requests.py | 16 ++++++++++++++++ 2 files changed, 32 insertions(+) create mode 100644 google/auth/aio/transport/requests.py create mode 100644 tests/transport/aio/test_requests.py diff --git a/google/auth/aio/transport/requests.py b/google/auth/aio/transport/requests.py new file mode 100644 index 000000000..3ff5644f1 --- /dev/null +++ b/google/auth/aio/transport/requests.py @@ -0,0 +1,16 @@ +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +"""Transport adapter for Asynchronous HTTP Requests. +""" diff --git a/tests/transport/aio/test_requests.py b/tests/transport/aio/test_requests.py new file mode 100644 index 000000000..e33db6504 --- /dev/null +++ b/tests/transport/aio/test_requests.py @@ -0,0 +1,16 @@ +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +import google.auth.aio.transport.requests as requests_aio +import pytest # type: ignore \ No newline at end of file From 32bf2356f1f6d37fe0ab2de4112f8d27aa57c6c6 Mon Sep 17 00:00:00 2001 From: ohmayr Date: Fri, 2 Aug 2024 21:27:19 +0000 Subject: [PATCH 2/5] fix whitespace --- tests/transport/aio/test_requests.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/transport/aio/test_requests.py b/tests/transport/aio/test_requests.py index e33db6504..bb226caca 100644 --- a/tests/transport/aio/test_requests.py +++ b/tests/transport/aio/test_requests.py @@ -13,4 +13,4 @@ # limitations under the License. import google.auth.aio.transport.requests as requests_aio -import pytest # type: ignore \ No newline at end of file +import pytest # type: ignore From dcd5e30fd173079ebad2bd265119a567254eb1ad Mon Sep 17 00:00:00 2001 From: ohmayr Date: Fri, 2 Aug 2024 21:51:14 +0000 Subject: [PATCH 3/5] add init file --- google/auth/aio/transport/__init__.py | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 google/auth/aio/transport/__init__.py diff --git a/google/auth/aio/transport/__init__.py b/google/auth/aio/transport/__init__.py new file mode 100644 index 000000000..28223b843 --- /dev/null +++ b/google/auth/aio/transport/__init__.py @@ -0,0 +1,25 @@ +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +"""Transport - Async HTTP client library support. + +:mod:`google.auth.aio` is designed to work with various asynchronous client libraries such +as aiohttp. In order to work across these libraries with different +interfaces some abstraction is needed. + +This module provides two interfaces that are implemented by transport adapters +to support HTTP libraries. :class:`Request` defines the interface expected by +:mod:`google.auth` to make asynchronous requests. :class:`Response` defines the interface +for the return value of :class:`Request`. +""" From f779b77e52736fbaff864556dcea85f6461a0b2c Mon Sep 17 00:00:00 2001 From: ohmayr Date: Tue, 6 Aug 2024 21:08:50 +0000 Subject: [PATCH 4/5] update file names to aiohttp --- google/auth/aio/transport/{requests.py => aiohttp.py} | 0 tests/transport/aio/{test_requests.py => test_aiohttp.py} | 0 2 files changed, 0 insertions(+), 0 deletions(-) rename google/auth/aio/transport/{requests.py => aiohttp.py} (100%) rename tests/transport/aio/{test_requests.py => test_aiohttp.py} (100%) diff --git a/google/auth/aio/transport/requests.py b/google/auth/aio/transport/aiohttp.py similarity index 100% rename from google/auth/aio/transport/requests.py rename to google/auth/aio/transport/aiohttp.py diff --git a/tests/transport/aio/test_requests.py b/tests/transport/aio/test_aiohttp.py similarity index 100% rename from tests/transport/aio/test_requests.py rename to tests/transport/aio/test_aiohttp.py From 05d5b3371acea69dbd7215652ec8f5bf349dce9f Mon Sep 17 00:00:00 2001 From: ohmayr Date: Tue, 6 Aug 2024 21:23:54 +0000 Subject: [PATCH 5/5] update import statement --- tests/transport/aio/test_aiohttp.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/transport/aio/test_aiohttp.py b/tests/transport/aio/test_aiohttp.py index bb226caca..320eca4f2 100644 --- a/tests/transport/aio/test_aiohttp.py +++ b/tests/transport/aio/test_aiohttp.py @@ -12,5 +12,5 @@ # See the License for the specific language governing permissions and # limitations under the License. -import google.auth.aio.transport.requests as requests_aio +import google.auth.aio.transport.aiohttp as auth_aiohttp import pytest # type: ignore