amazon-auth 0.2.3__tar.gz → 0.2.4__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.2.3 → amazon_auth-0.2.4}/PKG-INFO +1 -1
- {amazon_auth-0.2.3 → amazon_auth-0.2.4}/amazon_auth.egg-info/PKG-INFO +1 -1
- {amazon_auth-0.2.3 → amazon_auth-0.2.4}/amazonauth/__init__.py +1 -1
- {amazon_auth-0.2.3 → amazon_auth-0.2.4}/amazonauth/contrib/waf/base.py +20 -11
- {amazon_auth-0.2.3 → amazon_auth-0.2.4}/LICENSE +0 -0
- {amazon_auth-0.2.3 → amazon_auth-0.2.4}/README.md +0 -0
- {amazon_auth-0.2.3 → amazon_auth-0.2.4}/amazon_auth.egg-info/SOURCES.txt +0 -0
- {amazon_auth-0.2.3 → amazon_auth-0.2.4}/amazon_auth.egg-info/dependency_links.txt +0 -0
- {amazon_auth-0.2.3 → amazon_auth-0.2.4}/amazon_auth.egg-info/requires.txt +0 -0
- {amazon_auth-0.2.3 → amazon_auth-0.2.4}/amazon_auth.egg-info/top_level.txt +0 -0
- {amazon_auth-0.2.3 → amazon_auth-0.2.4}/amazonauth/cli.py +0 -0
- {amazon_auth-0.2.3 → amazon_auth-0.2.4}/amazonauth/conf.py +0 -0
- {amazon_auth-0.2.3 → amazon_auth-0.2.4}/amazonauth/constants.py +0 -0
- {amazon_auth-0.2.3 → amazon_auth-0.2.4}/amazonauth/contrib/__init__.py +0 -0
- {amazon_auth-0.2.3 → amazon_auth-0.2.4}/amazonauth/contrib/browser/__init__.py +0 -0
- {amazon_auth-0.2.3 → amazon_auth-0.2.4}/amazonauth/contrib/browser/playwright.py +0 -0
- {amazon_auth-0.2.3 → amazon_auth-0.2.4}/amazonauth/contrib/waf/__init__.py +0 -0
- {amazon_auth-0.2.3 → amazon_auth-0.2.4}/amazonauth/contrib/waf/anticaptcha.py +0 -0
- {amazon_auth-0.2.3 → amazon_auth-0.2.4}/amazonauth/contrib/waf/capsolver.py +0 -0
- {amazon_auth-0.2.3 → amazon_auth-0.2.4}/amazonauth/contrib/waf/twocaptcha.py +0 -0
- {amazon_auth-0.2.3 → amazon_auth-0.2.4}/amazonauth/exception.py +0 -0
- {amazon_auth-0.2.3 → amazon_auth-0.2.4}/amazonauth/forms.py +0 -0
- {amazon_auth-0.2.3 → amazon_auth-0.2.4}/amazonauth/py.typed +0 -0
- {amazon_auth-0.2.3 → amazon_auth-0.2.4}/amazonauth/region_data.py +0 -0
- {amazon_auth-0.2.3 → amazon_auth-0.2.4}/amazonauth/selectors.py +0 -0
- {amazon_auth-0.2.3 → amazon_auth-0.2.4}/amazonauth/session.py +0 -0
- {amazon_auth-0.2.3 → amazon_auth-0.2.4}/amazonauth/util.py +0 -0
- {amazon_auth-0.2.3 → amazon_auth-0.2.4}/pyproject.toml +0 -0
- {amazon_auth-0.2.3 → amazon_auth-0.2.4}/setup.cfg +0 -0
- {amazon_auth-0.2.3 → amazon_auth-0.2.4}/tests/test_cli.py +0 -0
- {amazon_auth-0.2.3 → amazon_auth-0.2.4}/tests/test_conf.py +0 -0
- {amazon_auth-0.2.3 → amazon_auth-0.2.4}/tests/test_constants.py +0 -0
- {amazon_auth-0.2.3 → amazon_auth-0.2.4}/tests/test_package.py +0 -0
- {amazon_auth-0.2.3 → amazon_auth-0.2.4}/tests/test_session.py +0 -0
- {amazon_auth-0.2.3 → amazon_auth-0.2.4}/tests/test_util.py +0 -0
|
@@ -44,21 +44,30 @@ class AwsWafForm(AuthForm):
|
|
|
44
44
|
def __init__(self,
|
|
45
45
|
config: AmazonAuthConfig) -> None:
|
|
46
46
|
super().__init__(config, selector=None)
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
47
|
+
self._api_key: str = (os.environ.get(self.API_KEY_ENV_VAR)
|
|
48
|
+
or getattr(config, self.API_KEY_ENV_VAR.lower(), None)
|
|
49
|
+
or "")
|
|
50
|
+
self._goku: Optional[Dict[str, Any]] = None
|
|
51
|
+
self._challenge_script: Optional[str] = None
|
|
52
|
+
|
|
53
|
+
@property
|
|
54
|
+
def api_key(self) -> str:
|
|
55
|
+
"""
|
|
56
|
+
The third-party solver API key. Resolved (in order of precedence) from the :attr:`API_KEY_ENV_VAR`
|
|
57
|
+
environment variable, then from the lowercase config key of the same name on
|
|
58
|
+
:class:`~amazonauth.conf.AmazonAuthConfig`. It's only required to solve a challenge, so a solver configured
|
|
59
|
+
without one doesn't keep a session from being created.
|
|
60
|
+
|
|
61
|
+
:raises AmazonAuthError: if neither is set.
|
|
62
|
+
"""
|
|
63
|
+
if not self._api_key:
|
|
64
|
+
config_key = self.API_KEY_ENV_VAR.lower()
|
|
52
65
|
raise AmazonAuthError(
|
|
53
66
|
f"{type(self).__name__} requires the {self.API_KEY_ENV_VAR} "
|
|
54
67
|
f"environment variable, or the {config_key} config key, to be set."
|
|
55
68
|
)
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
#: of the same name on :class:`~amazonauth.conf.AmazonAuthConfig`.
|
|
59
|
-
self.api_key: str = api_key
|
|
60
|
-
self._goku: Optional[Dict[str, Any]] = None
|
|
61
|
-
self._challenge_script: Optional[str] = None
|
|
69
|
+
|
|
70
|
+
return self._api_key
|
|
62
71
|
|
|
63
72
|
def select_form(self,
|
|
64
73
|
amazon_session: "AmazonSession",
|
|
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
|
|
File without changes
|
|
File without changes
|