Script 'mail_helper' called by obssrc Hello community, here is the log from the commit of package python-social-auth-core for openSUSE:Factory checked in at 2023-04-15 22:32:46 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/python-social-auth-core (Old) and /work/SRC/openSUSE:Factory/.python-social-auth-core.new.19717 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "python-social-auth-core" Sat Apr 15 22:32:46 2023 rev:19 rq:1079497 version:4.4.1 Changes: -------- --- /work/SRC/openSUSE:Factory/python-social-auth-core/python-social-auth-core.changes 2023-03-19 00:30:27.404056636 +0100 +++ /work/SRC/openSUSE:Factory/.python-social-auth-core.new.19717/python-social-auth-core.changes 2023-04-15 22:32:49.897428718 +0200 @@ -1,0 +2,8 @@ +Thu Apr 13 12:21:32 UTC 2023 - David Anes <david.a...@suse.com> + +- Update to 4.4.1 + - Moved Facebook Limited Login to a separate module to avoid extra + dependency + - Update Azure AD B2C base URL to match updated endpoints + +------------------------------------------------------------------- Old: ---- social-core-4.4.0.tar.gz New: ---- social-core-4.4.1.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ python-social-auth-core.spec ++++++ --- /var/tmp/diff_new_pack.Ior22K/_old 2023-04-15 22:32:50.649433056 +0200 +++ /var/tmp/diff_new_pack.Ior22K/_new 2023-04-15 22:32:50.653433079 +0200 @@ -23,7 +23,7 @@ %bcond_with saml Name: python-social-auth-core -Version: 4.4.0 +Version: 4.4.1 Release: 0 Summary: Python Social Auth Core License: BSD-3-Clause ++++++ social-core-4.4.0.tar.gz -> social-core-4.4.1.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/social-core-4.4.0/.pre-commit-config.yaml new/social-core-4.4.1/.pre-commit-config.yaml --- old/social-core-4.4.0/.pre-commit-config.yaml 2023-03-15 19:21:44.000000000 +0100 +++ new/social-core-4.4.1/.pre-commit-config.yaml 2023-03-30 12:50:25.000000000 +0200 @@ -32,7 +32,7 @@ - id: check-hooks-apply - id: check-useless-excludes - repo: https://github.com/macisamuele/language-formatters-pre-commit-hooks - rev: v2.7.0 + rev: v2.8.0 hooks: - id: pretty-format-yaml args: [--autofix, --indent, '2'] diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/social-core-4.4.0/CHANGELOG.md new/social-core-4.4.1/CHANGELOG.md --- old/social-core-4.4.0/CHANGELOG.md 2023-03-15 19:21:44.000000000 +0100 +++ new/social-core-4.4.1/CHANGELOG.md 2023-03-30 12:50:25.000000000 +0200 @@ -5,6 +5,12 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/) and this project adheres to [Semantic Versioning](http://semver.org/). +## [4.4.1](https://github.com/python-social-auth/social-core/releases/tag/4.4.1) - 2023-03-30 + +### Changed +- Moved Facebook Limited Login to a separate module to avoid extra dependency +- Update Azure AD B2C base URL to match updated endpoints + ## [4.4.0](https://github.com/python-social-auth/social-core/releases/tag/4.4.0) - 2023-03-15 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/social-core-4.4.0/docker-compose.yml new/social-core-4.4.1/docker-compose.yml --- old/social-core-4.4.0/docker-compose.yml 2023-03-15 19:21:44.000000000 +0100 +++ new/social-core-4.4.1/docker-compose.yml 2023-03-30 12:50:25.000000000 +0200 @@ -19,8 +19,8 @@ context: . dockerfile: ./files/tests/Dockerfile args: - - PYTHON_VERSIONS=3.6.12 3.7.9 3.8.7 3.9.1 + - PYTHON_VERSIONS=3.6.12 3.7.16 3.8.16 3.9.16 3.10.10 3.11.2 environment: - - PYTHON_VERSIONS=3.6.12 3.7.9 3.8.7 3.9.1 + - PYTHON_VERSIONS=3.6.12 3.7.16 3.8.16 3.9.16 3.10.10 3.11.2 volumes: - .:/code diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/social-core-4.4.0/requirements-dev.txt new/social-core-4.4.1/requirements-dev.txt --- old/social-core-4.4.0/requirements-dev.txt 2023-03-15 19:21:44.000000000 +0100 +++ new/social-core-4.4.1/requirements-dev.txt 2023-03-30 12:50:25.000000000 +0200 @@ -1 +1 @@ -pre-commit==3.1.1 +pre-commit==3.2.1 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/social-core-4.4.0/social_core/__init__.py new/social-core-4.4.1/social_core/__init__.py --- old/social-core-4.4.0/social_core/__init__.py 2023-03-15 19:21:44.000000000 +0100 +++ new/social-core-4.4.1/social_core/__init__.py 2023-03-30 12:50:25.000000000 +0200 @@ -1 +1 @@ -__version__ = "4.4.0" +__version__ = "4.4.1" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/social-core-4.4.0/social_core/backends/azuread_b2c.py new/social-core-4.4.1/social_core/backends/azuread_b2c.py --- old/social-core-4.4.0/social_core/backends/azuread_b2c.py 2023-03-15 19:21:44.000000000 +0100 +++ new/social-core-4.4.1/social_core/backends/azuread_b2c.py 2023-03-30 12:50:25.000000000 +0200 @@ -53,6 +53,7 @@ class AzureADB2COAuth2(AzureADOAuth2): name = "azuread-b2c-oauth2" + BASE_URL = "https://{tenant_name}.{authority_host}/{tenant_name}.onmicrosoft.com" AUTHORIZATION_URL = "{base_url}/oauth2/v2.0/authorize" OPENID_CONFIGURATION_URL = ( "{base_url}/v2.0/.well-known/openid-configuration?p={policy}" @@ -74,8 +75,12 @@ ] @property - def tenant_id(self): - return self.setting("TENANT_ID", "common") + def authority_host(self): + return self.setting("AUTHORITY_HOST", "b2clogin.com") + + @property + def tenant_name(self): + return self.setting("TENANT_NAME") @property def policy(self): @@ -87,6 +92,12 @@ ) return policy + @property + def base_url(self): + return self.BASE_URL.format( + tenant_name=self.tenant_name, authority_host=self.authority_host + ) + def openid_configuration_url(self): return self.OPENID_CONFIGURATION_URL.format( base_url=self.base_url, policy=self.policy diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/social-core-4.4.0/social_core/backends/facebook.py new/social-core-4.4.1/social_core/backends/facebook.py --- old/social-core-4.4.0/social_core/backends/facebook.py 2023-03-15 19:21:44.000000000 +0100 +++ new/social-core-4.4.1/social_core/backends/facebook.py 2023-03-30 12:50:25.000000000 +0200 @@ -1,5 +1,5 @@ """ -Facebook OAuth2, Canvas Application and Limited Login backends, docs at: +Facebook OAuth2, and Canvas Application backends, docs at: https://python-social-auth.readthedocs.io/en/latest/backends/facebook.html """ import base64 @@ -12,12 +12,10 @@ AuthCanceled, AuthException, AuthMissingParameter, - AuthTokenError, AuthUnknownError, ) from ..utils import constant_time_compare, handle_http_errors, parse_qs from .oauth import BaseOAuth2 -from .open_id_connect import OpenIdConnectAuth API_VERSION = 12.0 @@ -249,46 +247,3 @@ time.time() - 86400 ): return data - - -class FacebookLimitedLogin(OpenIdConnectAuth): - """Facebook Limited Login (OIDC) backend""" - - name = "facebook-limited-login" - OIDC_ENDPOINT = "https://www.facebook.com" - ACCESS_TOKEN_URL = "https://facebook.com/dialog/oauth/" - ID_TOKEN_MAX_AGE = 3600 - - def authenticate(self, *args, **kwargs): - if ( - "backend" not in kwargs - or kwargs["backend"].name != self.name - or "strategy" not in kwargs - or "response" not in kwargs - ): - return None - - # Replace response with the decoded JWT - raw_jwt = kwargs.get("response", {}).get("access_token") - kwargs["response"] = self.validate_and_return_id_token(raw_jwt, "") - return super().authenticate(*args, **kwargs) - - def get_user_details(self, response): - return { - "fullname": response.get("name"), - "email": response.get("email"), - "picture": response.get("picture"), - } - - def user_data(self, access_token, *args, **kwargs): - # We don't have an access token to call any API for the user details. - return None - - def validate_claims(self, id_token): - try: - super().validate_claims(id_token) - except AuthTokenError as e: - if "Incorrect id_token: nonce" in e.args: - # Ignore errors about nonce. We can't validate it since it's not generated server-side. - return - raise diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/social-core-4.4.0/social_core/backends/facebook_limited.py new/social-core-4.4.1/social_core/backends/facebook_limited.py --- old/social-core-4.4.0/social_core/backends/facebook_limited.py 1970-01-01 01:00:00.000000000 +0100 +++ new/social-core-4.4.1/social_core/backends/facebook_limited.py 2023-03-30 12:50:25.000000000 +0200 @@ -0,0 +1,49 @@ +""" +Facebook Limited Login backend, docs at: + https://python-social-auth.readthedocs.io/en/latest/backends/facebook.html +""" +from ..exceptions import AuthTokenError +from .open_id_connect import OpenIdConnectAuth + + +class FacebookLimitedLogin(OpenIdConnectAuth): + """Facebook Limited Login (OIDC) backend""" + + name = "facebook-limited-login" + OIDC_ENDPOINT = "https://www.facebook.com" + ACCESS_TOKEN_URL = "https://facebook.com/dialog/oauth/" + ID_TOKEN_MAX_AGE = 3600 + + def authenticate(self, *args, **kwargs): + if ( + "backend" not in kwargs + or kwargs["backend"].name != self.name + or "strategy" not in kwargs + or "response" not in kwargs + ): + return None + + # Replace response with the decoded JWT + raw_jwt = kwargs.get("response", {}).get("access_token") + kwargs["response"] = self.validate_and_return_id_token(raw_jwt, "") + return super().authenticate(*args, **kwargs) + + def get_user_details(self, response): + return { + "fullname": response.get("name"), + "email": response.get("email"), + "picture": response.get("picture"), + } + + def user_data(self, access_token, *args, **kwargs): + # We don't have an access token to call any API for the user details. + return None + + def validate_claims(self, id_token): + try: + super().validate_claims(id_token) + except AuthTokenError as e: + if "Incorrect id_token: nonce" in e.args: + # Ignore errors about nonce. We can't validate it since it's not generated server-side. + return + raise diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/social-core-4.4.0/social_core/tests/backends/test_azuread_b2c.py new/social-core-4.4.1/social_core/tests/backends/test_azuread_b2c.py --- old/social-core-4.4.0/social_core/tests/backends/test_azuread_b2c.py 2023-03-15 19:21:44.000000000 +0100 +++ new/social-core-4.4.1/social_core/tests/backends/test_azuread_b2c.py 2023-03-30 12:50:25.000000000 +0200 @@ -83,7 +83,7 @@ } -class AzureADOAuth2Test(OAuth2Test): +class AzureADB2COAuth2Test(OAuth2Test): AUTH_KEY = "abcdef12-1234-9876-0000-abcdef098765" EXPIRES_IN = 3600 AUTH_TIME = int(time()) @@ -120,7 +120,7 @@ "family_name": "Bar", "given_name": "Foo", "iat": AUTH_TIME, - "iss": "https://login.microsoftonline.com/9a9a9a9a-1111-5555-0000-bc24adfdae00/v2.0/", + "iss": "https://foobar.b2clogin.com/9a9a9a9a-1111-5555-0000-bc24adfdae00/v2.0/", "name": "FooBar", "nbf": AUTH_TIME, "oid": "11223344-5566-7788-9999-aabbccddeeff", @@ -142,7 +142,7 @@ { "SOCIAL_AUTH_" + self.name + "_POLICY": "b2c_1_signin", "SOCIAL_AUTH_" + self.name + "_KEY": self.AUTH_KEY, - "SOCIAL_AUTH_" + self.name + "_TENANT_ID": "footenant.onmicrosoft.com", + "SOCIAL_AUTH_" + self.name + "_TENANT_NAME": "footenant", } ) return settings @@ -150,7 +150,7 @@ def setUp(self): super().setUp() - keys_url = "https://login.microsoftonline.com/footenant.onmicrosoft.com/discovery/v2.0/keys?p=b2c_1_signin" + keys_url = "https://footenant.b2clogin.com/footenant.onmicrosoft.com/discovery/v2.0/keys?p=b2c_1_signin" keys_body = json.dumps( { "keys": [ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/social-core-4.4.0/social_core/tests/backends/test_facebook.py new/social-core-4.4.1/social_core/tests/backends/test_facebook.py --- old/social-core-4.4.0/social_core/tests/backends/test_facebook.py 2023-03-15 19:21:44.000000000 +0100 +++ new/social-core-4.4.1/social_core/tests/backends/test_facebook.py 2023-03-30 12:50:25.000000000 +0200 @@ -71,7 +71,7 @@ class FacebookLimitedLoginTest(OpenIdConnectTestMixin, OAuth2Test): - backend_path = "social_core.backends.facebook.FacebookLimitedLogin" + backend_path = "social_core.backends.facebook_limited.FacebookLimitedLogin" issuer = "https://facebook.com" openid_config_body = """ {