Script 'mail_helper' called by obssrc
Hello community,

here is the log from the commit of package python-google-auth-oauthlib for 
openSUSE:Factory checked in at 2023-10-05 20:04:54
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/python-google-auth-oauthlib (Old)
 and      /work/SRC/openSUSE:Factory/.python-google-auth-oauthlib.new.28202 
(New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "python-google-auth-oauthlib"

Thu Oct  5 20:04:54 2023 rev:16 rq:1115768 version:1.1.0

Changes:
--------
--- 
/work/SRC/openSUSE:Factory/python-google-auth-oauthlib/python-google-auth-oauthlib.changes
  2023-07-03 17:42:56.576774224 +0200
+++ 
/work/SRC/openSUSE:Factory/.python-google-auth-oauthlib.new.28202/python-google-auth-oauthlib.changes
       2023-10-05 20:06:02.412971108 +0200
@@ -1,0 +2,10 @@
+Thu Oct  5 09:03:50 UTC 2023 - Dirk Müller <[email protected]>
+
+- update to 1.1.0:
+  * Adding support to specify browser while launching browser to
+    authention (#305) (1a9dca8), closes #303
+  * Pass thru OAuth audience during
+    InstalledAppFlow.run_local_server (#300) (fe08531)
+  * Fix grammar with fetch_token docstring (#273) (b2e3688)
+
+-------------------------------------------------------------------

Old:
----
  google-auth-oauthlib-1.0.0.tar.gz

New:
----
  google-auth-oauthlib-1.1.0.tar.gz

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ python-google-auth-oauthlib.spec ++++++
--- /var/tmp/diff_new_pack.LHvhCE/_old  2023-10-05 20:06:04.269038162 +0200
+++ /var/tmp/diff_new_pack.LHvhCE/_new  2023-10-05 20:06:04.285038740 +0200
@@ -18,7 +18,7 @@
 
 %{?sle15_python_module_pythons}
 Name:           python-google-auth-oauthlib
-Version:        1.0.0
+Version:        1.1.0
 Release:        0
 Summary:        Google authentication library
 License:        Apache-2.0

++++++ google-auth-oauthlib-1.0.0.tar.gz -> google-auth-oauthlib-1.1.0.tar.gz 
++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/google-auth-oauthlib-1.0.0/MANIFEST.in 
new/google-auth-oauthlib-1.1.0/MANIFEST.in
--- old/google-auth-oauthlib-1.0.0/MANIFEST.in  2023-02-07 21:50:41.000000000 
+0100
+++ new/google-auth-oauthlib-1.1.0/MANIFEST.in  2023-09-11 18:04:13.000000000 
+0200
@@ -1,6 +1,6 @@
 # -*- coding: utf-8 -*-
 #
-# Copyright 2020 Google LLC
+# Copyright 2023 Google LLC
 #
 # Licensed under the Apache License, Version 2.0 (the "License");
 # you may not use this file except in compliance with the License.
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/google-auth-oauthlib-1.0.0/PKG-INFO 
new/google-auth-oauthlib-1.1.0/PKG-INFO
--- old/google-auth-oauthlib-1.0.0/PKG-INFO     2023-02-07 21:53:17.732518700 
+0100
+++ new/google-auth-oauthlib-1.1.0/PKG-INFO     2023-09-11 18:07:10.124702700 
+0200
@@ -1,6 +1,6 @@
 Metadata-Version: 2.1
 Name: google-auth-oauthlib
-Version: 1.0.0
+Version: 1.1.0
 Summary: Google Authentication Library
 Home-page: 
https://github.com/GoogleCloudPlatform/google-auth-library-python-oauthlib
 Author: Google Cloud Platform
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/google-auth-oauthlib-1.0.0/google_auth_oauthlib/flow.py 
new/google-auth-oauthlib-1.1.0/google_auth_oauthlib/flow.py
--- old/google-auth-oauthlib-1.0.0/google_auth_oauthlib/flow.py 2023-02-07 
21:50:41.000000000 +0100
+++ new/google-auth-oauthlib-1.1.0/google_auth_oauthlib/flow.py 2023-09-11 
18:04:13.000000000 +0200
@@ -276,7 +276,7 @@
 
         Returns:
             Mapping[str, str]: The obtained tokens. Typically, you will not use
-                return value of this function and instead and use
+                return value of this function and instead use
                 :meth:`credentials` to obtain a
                 :class:`~google.auth.credentials.Credentials` instance.
         """
@@ -378,6 +378,8 @@
         open_browser=True,
         redirect_uri_trailing_slash=True,
         timeout_seconds=None,
+        token_audience=None,
+        browser=None,
         **kwargs
     ):
         """Run the flow using the server strategy.
@@ -412,6 +414,11 @@
                 if there are no credentials response. The value is in seconds.
                 When set to None there is no timeout.
                 Default value is None.
+            token_audience (str): Passed along with the request for an access
+                token. Determines the endpoints with which the token can be
+                used. Optional.
+            browser (str): specify which browser to open for authentication. 
If not
+                specified this defaults to default browser.
             kwargs: Additional keyword arguments passed through to
                 :meth:`authorization_url`.
 
@@ -433,7 +440,8 @@
         auth_url, _ = self.authorization_url(**kwargs)
 
         if open_browser:
-            webbrowser.open(auth_url, new=1, autoraise=True)
+            # if browser is None it defaults to default browser
+            webbrowser.get(browser).open(auth_url, new=1, autoraise=True)
 
         if authorization_prompt_message:
             print(authorization_prompt_message.format(url=auth_url))
@@ -444,7 +452,9 @@
         # Note: using https here because oauthlib is very picky that
         # OAuth 2.0 should only occur over https.
         authorization_response = wsgi_app.last_request_uri.replace("http", 
"https")
-        self.fetch_token(authorization_response=authorization_response)
+        self.fetch_token(
+            authorization_response=authorization_response, 
audience=token_audience
+        )
 
         # This closes the socket
         local_server.server_close()
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/google-auth-oauthlib-1.0.0/google_auth_oauthlib.egg-info/PKG-INFO 
new/google-auth-oauthlib-1.1.0/google_auth_oauthlib.egg-info/PKG-INFO
--- old/google-auth-oauthlib-1.0.0/google_auth_oauthlib.egg-info/PKG-INFO       
2023-02-07 21:53:17.000000000 +0100
+++ new/google-auth-oauthlib-1.1.0/google_auth_oauthlib.egg-info/PKG-INFO       
2023-09-11 18:07:10.000000000 +0200
@@ -1,6 +1,6 @@
 Metadata-Version: 2.1
 Name: google-auth-oauthlib
-Version: 1.0.0
+Version: 1.1.0
 Summary: Google Authentication Library
 Home-page: 
https://github.com/GoogleCloudPlatform/google-auth-library-python-oauthlib
 Author: Google Cloud Platform
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/google-auth-oauthlib-1.0.0/setup.py 
new/google-auth-oauthlib-1.1.0/setup.py
--- old/google-auth-oauthlib-1.0.0/setup.py     2023-02-07 21:50:41.000000000 
+0100
+++ new/google-auth-oauthlib-1.1.0/setup.py     2023-09-11 18:04:13.000000000 
+0200
@@ -27,7 +27,7 @@
     long_description = fh.read()
 
 
-version = "1.0.0"
+version = "1.1.0"
 
 setup(
     name="google-auth-oauthlib",
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/google-auth-oauthlib-1.0.0/tests/unit/test_flow.py 
new/google-auth-oauthlib-1.1.0/tests/unit/test_flow.py
--- old/google-auth-oauthlib-1.0.0/tests/unit/test_flow.py      2023-02-07 
21:50:41.000000000 +0100
+++ new/google-auth-oauthlib-1.1.0/tests/unit/test_flow.py      2023-09-11 
18:04:13.000000000 +0200
@@ -242,6 +242,7 @@
 class TestInstalledAppFlow(object):
     SCOPES = ["email", "profile"]
     REDIRECT_REQUEST_PATH = "/?code=code&state=state"
+    AUDIENCE = "dummy-audience"
 
     @pytest.fixture
     def instance(self):
@@ -303,7 +304,7 @@
         assert credentials.token == mock.sentinel.access_token
         assert credentials._refresh_token == mock.sentinel.refresh_token
         assert credentials.id_token == mock.sentinel.id_token
-        assert webbrowser_mock.open.called
+        assert webbrowser_mock.get().open.called
         assert instance.redirect_uri == f"http://localhost:{port}/";
 
         expected_auth_response = auth_redirect_url.replace("http", "https")
@@ -312,6 +313,46 @@
             client_secret=CLIENT_SECRETS_INFO["web"]["client_secret"],
             authorization_response=expected_auth_response,
             code_verifier=None,
+            audience=None,
+        )
+
+    @pytest.mark.webtest
+    @mock.patch("google_auth_oauthlib.flow.webbrowser", autospec=True)
+    def test_run_local_server_audience(
+        self, webbrowser_mock, instance, mock_fetch_token, port
+    ):
+        auth_redirect_url = urllib.parse.urljoin(
+            f"http://localhost:{port}";, self.REDIRECT_REQUEST_PATH
+        )
+
+        with concurrent.futures.ThreadPoolExecutor(max_workers=1) as pool:
+            future = pool.submit(
+                partial(
+                    instance.run_local_server, port=port, 
token_audience=self.AUDIENCE
+                )
+            )
+
+            while not future.done():
+                try:
+                    requests.get(auth_redirect_url)
+                except requests.ConnectionError:  # pragma: NO COVER
+                    pass
+
+            credentials = future.result()
+
+        assert credentials.token == mock.sentinel.access_token
+        assert credentials._refresh_token == mock.sentinel.refresh_token
+        assert credentials.id_token == mock.sentinel.id_token
+        assert webbrowser_mock.get().open.called
+        assert instance.redirect_uri == f"http://localhost:{port}/";
+
+        expected_auth_response = auth_redirect_url.replace("http", "https")
+        mock_fetch_token.assert_called_with(
+            CLIENT_SECRETS_INFO["web"]["token_uri"],
+            client_secret=CLIENT_SECRETS_INFO["web"]["client_secret"],
+            authorization_response=expected_auth_response,
+            code_verifier=None,
+            audience=self.AUDIENCE,
         )
 
     @pytest.mark.webtest
@@ -344,7 +385,7 @@
         assert credentials.token == mock.sentinel.access_token
         assert credentials._refresh_token == mock.sentinel.refresh_token
         assert credentials.id_token == mock.sentinel.id_token
-        assert webbrowser_mock.open.called
+        assert webbrowser_mock.get().open.called
         assert instance.redirect_uri == f"http://localhost:{port}";
 
         expected_auth_response = auth_redirect_url.replace("http", "https")
@@ -353,6 +394,7 @@
             client_secret=CLIENT_SECRETS_INFO["web"]["client_secret"],
             authorization_response=expected_auth_response,
             code_verifier="amanaplanacanalpanama",
+            audience=None,
         )
 
     @mock.patch("google_auth_oauthlib.flow.webbrowser", autospec=True)
@@ -368,7 +410,7 @@
 
         instance.run_local_server(open_browser=False)
 
-        assert not webbrowser_mock.open.called
+        assert not webbrowser_mock.get().open.called
 
     @mock.patch("google_auth_oauthlib.flow.webbrowser", autospec=True)
     @mock.patch("wsgiref.simple_server.make_server", autospec=True)
@@ -384,7 +426,7 @@
         my_ip = socket.gethostbyname(socket.gethostname())
         instance.run_local_server(bind_addr=my_ip, host="localhost")
 
-        assert webbrowser_mock.open.called
+        assert webbrowser_mock.get().open.called
         name, args, kwargs = make_server_mock.mock_calls[0]
         assert args[0] == my_ip
 

Reply via email to