the37lab-authlib 0.1.1749553514__tar.gz → 0.1.1750143654__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of the37lab-authlib might be problematic. Click here for more details.

Files changed (15) hide show
  1. {the37lab_authlib-0.1.1749553514 → the37lab_authlib-0.1.1750143654}/PKG-INFO +1 -2
  2. {the37lab_authlib-0.1.1749553514 → the37lab_authlib-0.1.1750143654}/pyproject.toml +1 -2
  3. {the37lab_authlib-0.1.1749553514 → the37lab_authlib-0.1.1750143654}/src/the37lab_authlib/auth.py +7 -5
  4. {the37lab_authlib-0.1.1749553514 → the37lab_authlib-0.1.1750143654}/src/the37lab_authlib.egg-info/PKG-INFO +1 -2
  5. {the37lab_authlib-0.1.1749553514 → the37lab_authlib-0.1.1750143654}/README.md +0 -0
  6. {the37lab_authlib-0.1.1749553514 → the37lab_authlib-0.1.1750143654}/setup.cfg +0 -0
  7. {the37lab_authlib-0.1.1749553514 → the37lab_authlib-0.1.1750143654}/src/the37lab_authlib/__init__.py +0 -0
  8. {the37lab_authlib-0.1.1749553514 → the37lab_authlib-0.1.1750143654}/src/the37lab_authlib/db.py +0 -0
  9. {the37lab_authlib-0.1.1749553514 → the37lab_authlib-0.1.1750143654}/src/the37lab_authlib/decorators.py +0 -0
  10. {the37lab_authlib-0.1.1749553514 → the37lab_authlib-0.1.1750143654}/src/the37lab_authlib/exceptions.py +0 -0
  11. {the37lab_authlib-0.1.1749553514 → the37lab_authlib-0.1.1750143654}/src/the37lab_authlib/models.py +0 -0
  12. {the37lab_authlib-0.1.1749553514 → the37lab_authlib-0.1.1750143654}/src/the37lab_authlib.egg-info/SOURCES.txt +0 -0
  13. {the37lab_authlib-0.1.1749553514 → the37lab_authlib-0.1.1750143654}/src/the37lab_authlib.egg-info/dependency_links.txt +0 -0
  14. {the37lab_authlib-0.1.1749553514 → the37lab_authlib-0.1.1750143654}/src/the37lab_authlib.egg-info/requires.txt +0 -0
  15. {the37lab_authlib-0.1.1749553514 → the37lab_authlib-0.1.1750143654}/src/the37lab_authlib.egg-info/top_level.txt +0 -0
@@ -1,10 +1,9 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: the37lab_authlib
3
- Version: 0.1.1749553514
3
+ Version: 0.1.1750143654
4
4
  Summary: Python SDK for the Authlib
5
5
  Author-email: the37lab <info@the37lab.com>
6
6
  Classifier: Programming Language :: Python :: 3
7
- Classifier: License :: Other/Proprietary License
8
7
  Classifier: Operating System :: OS Independent
9
8
  Requires-Python: >=3.9
10
9
  Description-Content-Type: text/markdown
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "the37lab_authlib"
7
- version = "0.1.1749553514"
7
+ version = "0.1.1750143654"
8
8
  description = "Python SDK for the Authlib"
9
9
  authors = [{name = "the37lab", email = "info@the37lab.com"}]
10
10
  dependencies = ["flask", "psycopg2-binary", "pyjwt", "python-dotenv", "requests", "authlib", "bcrypt"]
@@ -12,6 +12,5 @@ requires-python = ">=3.9"
12
12
  readme = "README.md"
13
13
  classifiers = [
14
14
  "Programming Language :: Python :: 3",
15
- "License :: Other/Proprietary License",
16
15
  "Operating System :: OS Independent",
17
16
  ]
@@ -47,6 +47,11 @@ class AuthManager:
47
47
 
48
48
  return auth.token
49
49
 
50
+ def get_redirect_uri(self):
51
+ redirect_uri = os.getenv('REDIRECT_URL') or url_for('auth.oauth_callback', _external=True).replace("http://", "https://")
52
+ logger.info(f"REDIRECT URI..: {redirect_uri}")
53
+ return redirect_uri
54
+
50
55
  def _validate_api_token(self, api_token):
51
56
  try:
52
57
  parsed = ApiToken.parse_token(api_token)
@@ -169,9 +174,7 @@ class AuthManager:
169
174
  if provider not in self.oauth_config:
170
175
  raise AuthError('Invalid OAuth provider', 400)
171
176
 
172
- redirect_uri = url_for('auth.oauth_callback', _external=True)
173
- logger.info("REDIRECT URI: {}".format(redirect_uri))
174
- redirect_uri = redirect_uri.replace("http://", "https://")
177
+ redirect_uri = self.get_redirect_uri()
175
178
  return jsonify({
176
179
  'redirect_url': self._get_oauth_url(provider, redirect_uri)
177
180
  })
@@ -452,8 +455,7 @@ class AuthManager:
452
455
  if provider == 'google':
453
456
  client_id = self.oauth_config['google']['client_id']
454
457
  client_secret = self.oauth_config['google']['client_secret']
455
- redirect_uri = url_for('auth.oauth_callback', _external=True)
456
- redirect_uri = redirect_uri.replace("http://", "https://")
458
+ redirect_uri = self.get_redirect_uri()
457
459
 
458
460
  # Exchange code for tokens
459
461
  token_url = 'https://oauth2.googleapis.com/token'
@@ -1,10 +1,9 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: the37lab_authlib
3
- Version: 0.1.1749553514
3
+ Version: 0.1.1750143654
4
4
  Summary: Python SDK for the Authlib
5
5
  Author-email: the37lab <info@the37lab.com>
6
6
  Classifier: Programming Language :: Python :: 3
7
- Classifier: License :: Other/Proprietary License
8
7
  Classifier: Operating System :: OS Independent
9
8
  Requires-Python: >=3.9
10
9
  Description-Content-Type: text/markdown