amazon-auth 0.2.2__tar.gz → 0.2.3__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.2 → amazon_auth-0.2.3}/PKG-INFO +1 -1
  2. {amazon_auth-0.2.2 → amazon_auth-0.2.3}/amazon_auth.egg-info/PKG-INFO +1 -1
  3. {amazon_auth-0.2.2 → amazon_auth-0.2.3}/amazonauth/__init__.py +1 -1
  4. {amazon_auth-0.2.2 → amazon_auth-0.2.3}/amazonauth/util.py +1 -0
  5. {amazon_auth-0.2.2 → amazon_auth-0.2.3}/tests/test_conf.py +21 -0
  6. {amazon_auth-0.2.2 → amazon_auth-0.2.3}/LICENSE +0 -0
  7. {amazon_auth-0.2.2 → amazon_auth-0.2.3}/README.md +0 -0
  8. {amazon_auth-0.2.2 → amazon_auth-0.2.3}/amazon_auth.egg-info/SOURCES.txt +0 -0
  9. {amazon_auth-0.2.2 → amazon_auth-0.2.3}/amazon_auth.egg-info/dependency_links.txt +0 -0
  10. {amazon_auth-0.2.2 → amazon_auth-0.2.3}/amazon_auth.egg-info/requires.txt +0 -0
  11. {amazon_auth-0.2.2 → amazon_auth-0.2.3}/amazon_auth.egg-info/top_level.txt +0 -0
  12. {amazon_auth-0.2.2 → amazon_auth-0.2.3}/amazonauth/cli.py +0 -0
  13. {amazon_auth-0.2.2 → amazon_auth-0.2.3}/amazonauth/conf.py +0 -0
  14. {amazon_auth-0.2.2 → amazon_auth-0.2.3}/amazonauth/constants.py +0 -0
  15. {amazon_auth-0.2.2 → amazon_auth-0.2.3}/amazonauth/contrib/__init__.py +0 -0
  16. {amazon_auth-0.2.2 → amazon_auth-0.2.3}/amazonauth/contrib/browser/__init__.py +0 -0
  17. {amazon_auth-0.2.2 → amazon_auth-0.2.3}/amazonauth/contrib/browser/playwright.py +0 -0
  18. {amazon_auth-0.2.2 → amazon_auth-0.2.3}/amazonauth/contrib/waf/__init__.py +0 -0
  19. {amazon_auth-0.2.2 → amazon_auth-0.2.3}/amazonauth/contrib/waf/anticaptcha.py +0 -0
  20. {amazon_auth-0.2.2 → amazon_auth-0.2.3}/amazonauth/contrib/waf/base.py +0 -0
  21. {amazon_auth-0.2.2 → amazon_auth-0.2.3}/amazonauth/contrib/waf/capsolver.py +0 -0
  22. {amazon_auth-0.2.2 → amazon_auth-0.2.3}/amazonauth/contrib/waf/twocaptcha.py +0 -0
  23. {amazon_auth-0.2.2 → amazon_auth-0.2.3}/amazonauth/exception.py +0 -0
  24. {amazon_auth-0.2.2 → amazon_auth-0.2.3}/amazonauth/forms.py +0 -0
  25. {amazon_auth-0.2.2 → amazon_auth-0.2.3}/amazonauth/py.typed +0 -0
  26. {amazon_auth-0.2.2 → amazon_auth-0.2.3}/amazonauth/region_data.py +0 -0
  27. {amazon_auth-0.2.2 → amazon_auth-0.2.3}/amazonauth/selectors.py +0 -0
  28. {amazon_auth-0.2.2 → amazon_auth-0.2.3}/amazonauth/session.py +0 -0
  29. {amazon_auth-0.2.2 → amazon_auth-0.2.3}/pyproject.toml +0 -0
  30. {amazon_auth-0.2.2 → amazon_auth-0.2.3}/setup.cfg +0 -0
  31. {amazon_auth-0.2.2 → amazon_auth-0.2.3}/tests/test_cli.py +0 -0
  32. {amazon_auth-0.2.2 → amazon_auth-0.2.3}/tests/test_constants.py +0 -0
  33. {amazon_auth-0.2.2 → amazon_auth-0.2.3}/tests/test_package.py +0 -0
  34. {amazon_auth-0.2.2 → amazon_auth-0.2.3}/tests/test_session.py +0 -0
  35. {amazon_auth-0.2.2 → amazon_auth-0.2.3}/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.2
3
+ Version: 0.2.3
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.2
3
+ Version: 0.2.3
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.2"
3
+ __version__ = "0.2.3"
4
4
  __muppets__ = "no strings attached"
@@ -156,6 +156,7 @@ def write_private_file(path: str,
156
156
  :param path: The file to write.
157
157
  :param content: The text to write.
158
158
  """
159
+ path = os.path.realpath(path)
159
160
  file_descriptor, temp_path = tempfile.mkstemp(dir=os.path.dirname(path) or ".",
160
161
  prefix=f".{os.path.basename(path)}-", suffix=".tmp")
161
162
  try:
@@ -188,6 +188,27 @@ some_custom_config: {custom_config}
188
188
  self.assertEqual(0o600, os.stat(config_path).st_mode & 0o777)
189
189
  self.assertEqual([], [name for name in os.listdir(os.path.dirname(config_path)) if name.endswith(".tmp")])
190
190
 
191
+ @unittest.skipIf(sys.platform == "win32", reason="Windows does not support POSIX file permissions")
192
+ def test_saved_config_is_written_through_a_symlink(self):
193
+ # GIVEN
194
+ target_dir = os.path.join(conf.DEFAULT_CONFIG_DIR, "dotfiles")
195
+ os.makedirs(target_dir, exist_ok=True)
196
+ target_path = os.path.join(target_dir, "config.yml")
197
+ with open(target_path, "w") as f:
198
+ f.write("max_auth_attempts: 3\n")
199
+ config_path = os.path.join(conf.DEFAULT_CONFIG_DIR, "linked-config.yml")
200
+ os.symlink(target_path, config_path)
201
+ config = AmazonAuthConfig(config_path=config_path)
202
+
203
+ # WHEN
204
+ config.update_config("max_auth_attempts", 7)
205
+
206
+ # THEN
207
+ self.assertTrue(os.path.islink(config_path))
208
+ with open(target_path, "r") as f:
209
+ self.assertEqual(7, yaml.safe_load(f)["max_auth_attempts"])
210
+ self.assertEqual(0o600, os.stat(target_path).st_mode & 0o777)
211
+
191
212
  def test_update_config(self):
192
213
  # GIVEN
193
214
  config = AmazonAuthConfig(data={
File without changes
File without changes
File without changes
File without changes