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.
Files changed (35) hide show
  1. {amazon_auth-0.2.3 → amazon_auth-0.2.4}/PKG-INFO +1 -1
  2. {amazon_auth-0.2.3 → amazon_auth-0.2.4}/amazon_auth.egg-info/PKG-INFO +1 -1
  3. {amazon_auth-0.2.3 → amazon_auth-0.2.4}/amazonauth/__init__.py +1 -1
  4. {amazon_auth-0.2.3 → amazon_auth-0.2.4}/amazonauth/contrib/waf/base.py +20 -11
  5. {amazon_auth-0.2.3 → amazon_auth-0.2.4}/LICENSE +0 -0
  6. {amazon_auth-0.2.3 → amazon_auth-0.2.4}/README.md +0 -0
  7. {amazon_auth-0.2.3 → amazon_auth-0.2.4}/amazon_auth.egg-info/SOURCES.txt +0 -0
  8. {amazon_auth-0.2.3 → amazon_auth-0.2.4}/amazon_auth.egg-info/dependency_links.txt +0 -0
  9. {amazon_auth-0.2.3 → amazon_auth-0.2.4}/amazon_auth.egg-info/requires.txt +0 -0
  10. {amazon_auth-0.2.3 → amazon_auth-0.2.4}/amazon_auth.egg-info/top_level.txt +0 -0
  11. {amazon_auth-0.2.3 → amazon_auth-0.2.4}/amazonauth/cli.py +0 -0
  12. {amazon_auth-0.2.3 → amazon_auth-0.2.4}/amazonauth/conf.py +0 -0
  13. {amazon_auth-0.2.3 → amazon_auth-0.2.4}/amazonauth/constants.py +0 -0
  14. {amazon_auth-0.2.3 → amazon_auth-0.2.4}/amazonauth/contrib/__init__.py +0 -0
  15. {amazon_auth-0.2.3 → amazon_auth-0.2.4}/amazonauth/contrib/browser/__init__.py +0 -0
  16. {amazon_auth-0.2.3 → amazon_auth-0.2.4}/amazonauth/contrib/browser/playwright.py +0 -0
  17. {amazon_auth-0.2.3 → amazon_auth-0.2.4}/amazonauth/contrib/waf/__init__.py +0 -0
  18. {amazon_auth-0.2.3 → amazon_auth-0.2.4}/amazonauth/contrib/waf/anticaptcha.py +0 -0
  19. {amazon_auth-0.2.3 → amazon_auth-0.2.4}/amazonauth/contrib/waf/capsolver.py +0 -0
  20. {amazon_auth-0.2.3 → amazon_auth-0.2.4}/amazonauth/contrib/waf/twocaptcha.py +0 -0
  21. {amazon_auth-0.2.3 → amazon_auth-0.2.4}/amazonauth/exception.py +0 -0
  22. {amazon_auth-0.2.3 → amazon_auth-0.2.4}/amazonauth/forms.py +0 -0
  23. {amazon_auth-0.2.3 → amazon_auth-0.2.4}/amazonauth/py.typed +0 -0
  24. {amazon_auth-0.2.3 → amazon_auth-0.2.4}/amazonauth/region_data.py +0 -0
  25. {amazon_auth-0.2.3 → amazon_auth-0.2.4}/amazonauth/selectors.py +0 -0
  26. {amazon_auth-0.2.3 → amazon_auth-0.2.4}/amazonauth/session.py +0 -0
  27. {amazon_auth-0.2.3 → amazon_auth-0.2.4}/amazonauth/util.py +0 -0
  28. {amazon_auth-0.2.3 → amazon_auth-0.2.4}/pyproject.toml +0 -0
  29. {amazon_auth-0.2.3 → amazon_auth-0.2.4}/setup.cfg +0 -0
  30. {amazon_auth-0.2.3 → amazon_auth-0.2.4}/tests/test_cli.py +0 -0
  31. {amazon_auth-0.2.3 → amazon_auth-0.2.4}/tests/test_conf.py +0 -0
  32. {amazon_auth-0.2.3 → amazon_auth-0.2.4}/tests/test_constants.py +0 -0
  33. {amazon_auth-0.2.3 → amazon_auth-0.2.4}/tests/test_package.py +0 -0
  34. {amazon_auth-0.2.3 → amazon_auth-0.2.4}/tests/test_session.py +0 -0
  35. {amazon_auth-0.2.3 → amazon_auth-0.2.4}/tests/test_util.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: amazon-auth
3
- Version: 0.2.3
3
+ Version: 0.2.4
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>
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: amazon-auth
3
- Version: 0.2.3
3
+ Version: 0.2.4
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>
@@ -1,4 +1,4 @@
1
1
  __copyright__ = "Copyright (c) 2026 Alex Laird"
2
2
  __license__ = "MIT"
3
- __version__ = "0.2.3"
3
+ __version__ = "0.2.4"
4
4
  __muppets__ = "no strings attached"
@@ -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
- config_key = self.API_KEY_ENV_VAR.lower()
48
- api_key = (os.environ.get(self.API_KEY_ENV_VAR)
49
- or getattr(config, config_key, None)
50
- or "")
51
- if not api_key:
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
- #: The third-party solver API key. Resolved (in order of precedence) from the
57
- #: :attr:`API_KEY_ENV_VAR` environment variable, then from the lowercase config key
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