amazon-auth 0.3.0__tar.gz → 1.0.0__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.
- {amazon_auth-0.3.0 → amazon_auth-1.0.0}/PKG-INFO +2 -2
- {amazon_auth-0.3.0 → amazon_auth-1.0.0}/amazon_auth.egg-info/PKG-INFO +2 -2
- {amazon_auth-0.3.0 → amazon_auth-1.0.0}/amazonauth/__init__.py +1 -1
- {amazon_auth-0.3.0 → amazon_auth-1.0.0}/amazonauth/conf.py +3 -19
- {amazon_auth-0.3.0 → amazon_auth-1.0.0}/amazonauth/constants.py +1 -14
- {amazon_auth-0.3.0 → amazon_auth-1.0.0}/pyproject.toml +1 -1
- {amazon_auth-0.3.0 → amazon_auth-1.0.0}/LICENSE +0 -0
- {amazon_auth-0.3.0 → amazon_auth-1.0.0}/README.md +0 -0
- {amazon_auth-0.3.0 → amazon_auth-1.0.0}/amazon_auth.egg-info/SOURCES.txt +0 -0
- {amazon_auth-0.3.0 → amazon_auth-1.0.0}/amazon_auth.egg-info/dependency_links.txt +0 -0
- {amazon_auth-0.3.0 → amazon_auth-1.0.0}/amazon_auth.egg-info/requires.txt +0 -0
- {amazon_auth-0.3.0 → amazon_auth-1.0.0}/amazon_auth.egg-info/top_level.txt +0 -0
- {amazon_auth-0.3.0 → amazon_auth-1.0.0}/amazonauth/cli.py +0 -0
- {amazon_auth-0.3.0 → amazon_auth-1.0.0}/amazonauth/contrib/__init__.py +0 -0
- {amazon_auth-0.3.0 → amazon_auth-1.0.0}/amazonauth/contrib/browser/__init__.py +0 -0
- {amazon_auth-0.3.0 → amazon_auth-1.0.0}/amazonauth/contrib/browser/playwright.py +0 -0
- {amazon_auth-0.3.0 → amazon_auth-1.0.0}/amazonauth/contrib/waf/__init__.py +0 -0
- {amazon_auth-0.3.0 → amazon_auth-1.0.0}/amazonauth/contrib/waf/anticaptcha.py +0 -0
- {amazon_auth-0.3.0 → amazon_auth-1.0.0}/amazonauth/contrib/waf/base.py +0 -0
- {amazon_auth-0.3.0 → amazon_auth-1.0.0}/amazonauth/contrib/waf/capsolver.py +0 -0
- {amazon_auth-0.3.0 → amazon_auth-1.0.0}/amazonauth/contrib/waf/twocaptcha.py +0 -0
- {amazon_auth-0.3.0 → amazon_auth-1.0.0}/amazonauth/exception.py +0 -0
- {amazon_auth-0.3.0 → amazon_auth-1.0.0}/amazonauth/forms.py +0 -0
- {amazon_auth-0.3.0 → amazon_auth-1.0.0}/amazonauth/py.typed +0 -0
- {amazon_auth-0.3.0 → amazon_auth-1.0.0}/amazonauth/region_data.py +0 -0
- {amazon_auth-0.3.0 → amazon_auth-1.0.0}/amazonauth/selectors.py +0 -0
- {amazon_auth-0.3.0 → amazon_auth-1.0.0}/amazonauth/session.py +0 -0
- {amazon_auth-0.3.0 → amazon_auth-1.0.0}/amazonauth/util.py +0 -0
- {amazon_auth-0.3.0 → amazon_auth-1.0.0}/setup.cfg +0 -0
- {amazon_auth-0.3.0 → amazon_auth-1.0.0}/tests/test_cli.py +0 -0
- {amazon_auth-0.3.0 → amazon_auth-1.0.0}/tests/test_conf.py +0 -0
- {amazon_auth-0.3.0 → amazon_auth-1.0.0}/tests/test_constants.py +0 -0
- {amazon_auth-0.3.0 → amazon_auth-1.0.0}/tests/test_package.py +0 -0
- {amazon_auth-0.3.0 → amazon_auth-1.0.0}/tests/test_session.py +0 -0
- {amazon_auth-0.3.0 → amazon_auth-1.0.0}/tests/test_util.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: amazon-auth
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 1.0.0
|
|
4
4
|
Summary: Sign in to Amazon's consumer website and reuse the session from Python.
|
|
5
5
|
Author-email: Alex Laird <contact@alexlaird.com>
|
|
6
6
|
Maintainer-email: Alex Laird <contact@alexlaird.com>
|
|
@@ -9,7 +9,7 @@ Project-URL: Changelog, https://github.com/alexdlaird/amazon-auth/blob/main/CHAN
|
|
|
9
9
|
Project-URL: Sponsor, https://github.com/sponsors/alexdlaird
|
|
10
10
|
Project-URL: Source Code, https://github.com/alexdlaird/amazon-auth
|
|
11
11
|
Keywords: amazon,auth,sign-in,session
|
|
12
|
-
Classifier: Development Status ::
|
|
12
|
+
Classifier: Development Status :: 5 - Production/Stable
|
|
13
13
|
Classifier: Intended Audience :: Developers
|
|
14
14
|
Classifier: Operating System :: OS Independent
|
|
15
15
|
Classifier: Programming Language :: Python :: 3
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: amazon-auth
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 1.0.0
|
|
4
4
|
Summary: Sign in to Amazon's consumer website and reuse the session from Python.
|
|
5
5
|
Author-email: Alex Laird <contact@alexlaird.com>
|
|
6
6
|
Maintainer-email: Alex Laird <contact@alexlaird.com>
|
|
@@ -9,7 +9,7 @@ Project-URL: Changelog, https://github.com/alexdlaird/amazon-auth/blob/main/CHAN
|
|
|
9
9
|
Project-URL: Sponsor, https://github.com/sponsors/alexdlaird
|
|
10
10
|
Project-URL: Source Code, https://github.com/alexdlaird/amazon-auth
|
|
11
11
|
Keywords: amazon,auth,sign-in,session
|
|
12
|
-
Classifier: Development Status ::
|
|
12
|
+
Classifier: Development Status :: 5 - Production/Stable
|
|
13
13
|
Classifier: Intended Audience :: Developers
|
|
14
14
|
Classifier: Operating System :: OS Independent
|
|
15
15
|
Classifier: Programming Language :: Python :: 3
|
|
@@ -6,7 +6,6 @@ import logging
|
|
|
6
6
|
import os
|
|
7
7
|
import re
|
|
8
8
|
import threading
|
|
9
|
-
import warnings
|
|
10
9
|
from typing import Any, Dict, List, Optional, Set, Union
|
|
11
10
|
from urllib.parse import urlparse
|
|
12
11
|
|
|
@@ -78,7 +77,7 @@ class AmazonAuthConfig:
|
|
|
78
77
|
#: The path to use for the config file.
|
|
79
78
|
self.config_path: str = os.path.join(DEFAULT_CONFIG_DIR, "config.yml") if config_path is None else config_path
|
|
80
79
|
|
|
81
|
-
self._data: Dict[str, Any] = self.
|
|
80
|
+
self._data: Dict[str, Any] = self.default_data()
|
|
82
81
|
self._environment: Dict[str, Any] = self.read_environment()
|
|
83
82
|
self._resolved_classes: Dict[str, Any] = {}
|
|
84
83
|
self._assigned_classes: Dict[str, Any] = {}
|
|
@@ -113,7 +112,7 @@ class AmazonAuthConfig:
|
|
|
113
112
|
:return: The config values set in the environment, by config key.
|
|
114
113
|
:raises AmazonAuthError: If the value of a key with a default is not valid YAML.
|
|
115
114
|
"""
|
|
116
|
-
default_data = cls.
|
|
115
|
+
default_data = cls.default_data()
|
|
117
116
|
environment = {}
|
|
118
117
|
for name, value in os.environ.items():
|
|
119
118
|
if not name.startswith(ENVIRONMENT_VARIABLE_PREFIX) or not value:
|
|
@@ -183,21 +182,6 @@ class AmazonAuthConfig:
|
|
|
183
182
|
"max_auth_retries": 1
|
|
184
183
|
}
|
|
185
184
|
|
|
186
|
-
@staticmethod
|
|
187
|
-
def _default_data() -> Dict[str, Any]:
|
|
188
|
-
"""
|
|
189
|
-
Deprecated, use :func:`default_data` instead. To be removed in 1.0.
|
|
190
|
-
"""
|
|
191
|
-
warnings.warn("_default_data() is deprecated and will be removed in 1.0. Override default_data() instead.",
|
|
192
|
-
DeprecationWarning, stacklevel=2)
|
|
193
|
-
return AmazonAuthConfig.default_data()
|
|
194
|
-
|
|
195
|
-
@classmethod
|
|
196
|
-
def _defaults(cls) -> Dict[str, Any]:
|
|
197
|
-
if cls._default_data is not AmazonAuthConfig._default_data:
|
|
198
|
-
return cls._default_data()
|
|
199
|
-
return cls.default_data()
|
|
200
|
-
|
|
201
185
|
@staticmethod
|
|
202
186
|
def _default_cookie_jar_path() -> str:
|
|
203
187
|
return os.path.join(DEFAULT_CONFIG_DIR, "cookies.json")
|
|
@@ -225,7 +209,7 @@ class AmazonAuthConfig:
|
|
|
225
209
|
try:
|
|
226
210
|
return util.load_class(module_path.split("."), class_name)
|
|
227
211
|
except ModuleNotFoundError as e:
|
|
228
|
-
default_class_path = self.
|
|
212
|
+
default_class_path = self.default_data()[key]
|
|
229
213
|
if (class_path == default_class_path or not e.name or
|
|
230
214
|
not (module_path == e.name or module_path.startswith(f"{e.name}."))):
|
|
231
215
|
raise
|
|
@@ -2,7 +2,6 @@ __copyright__ = "Copyright (c) 2024-2025 Alex Laird"
|
|
|
2
2
|
__license__ = "MIT"
|
|
3
3
|
|
|
4
4
|
import logging
|
|
5
|
-
import warnings
|
|
6
5
|
from typing import Dict, Optional
|
|
7
6
|
from urllib.parse import urlencode, urlparse
|
|
8
7
|
|
|
@@ -130,10 +129,7 @@ class AuthConstants:
|
|
|
130
129
|
if browser:
|
|
131
130
|
self._apply_browser(browser)
|
|
132
131
|
if domain:
|
|
133
|
-
|
|
134
|
-
self._apply_domain(domain)
|
|
135
|
-
else:
|
|
136
|
-
self.apply_domain(domain)
|
|
132
|
+
self.apply_domain(domain)
|
|
137
133
|
self._apply_language_cookie(self._tld(self.BASE_URL))
|
|
138
134
|
|
|
139
135
|
@classmethod
|
|
@@ -217,15 +213,6 @@ class AuthConstants:
|
|
|
217
213
|
if auth_cookie and type(self).COOKIES_SET_WHEN_AUTHENTICATED == AuthConstants.COOKIES_SET_WHEN_AUTHENTICATED:
|
|
218
214
|
self.COOKIES_SET_WHEN_AUTHENTICATED = [auth_cookie]
|
|
219
215
|
|
|
220
|
-
def _apply_domain(self,
|
|
221
|
-
domain: str) -> None:
|
|
222
|
-
"""
|
|
223
|
-
Deprecated, use :func:`apply_domain` instead. To be removed in 1.0.
|
|
224
|
-
"""
|
|
225
|
-
warnings.warn("_apply_domain() is deprecated and will be removed in 1.0. Override apply_domain() instead.",
|
|
226
|
-
DeprecationWarning, stacklevel=2)
|
|
227
|
-
self.apply_domain(domain)
|
|
228
|
-
|
|
229
216
|
def _apply_language_cookie(self,
|
|
230
217
|
tld: str) -> None:
|
|
231
218
|
"""
|
|
@@ -21,7 +21,7 @@ dependencies = [
|
|
|
21
21
|
"pyotp>=2.9",
|
|
22
22
|
]
|
|
23
23
|
classifiers = [
|
|
24
|
-
"Development Status ::
|
|
24
|
+
"Development Status :: 5 - Production/Stable",
|
|
25
25
|
"Intended Audience :: Developers",
|
|
26
26
|
"Operating System :: OS Independent",
|
|
27
27
|
"Programming Language :: Python :: 3",
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|