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.
- {amazon_auth-0.2.2 → amazon_auth-0.2.3}/PKG-INFO +1 -1
- {amazon_auth-0.2.2 → amazon_auth-0.2.3}/amazon_auth.egg-info/PKG-INFO +1 -1
- {amazon_auth-0.2.2 → amazon_auth-0.2.3}/amazonauth/__init__.py +1 -1
- {amazon_auth-0.2.2 → amazon_auth-0.2.3}/amazonauth/util.py +1 -0
- {amazon_auth-0.2.2 → amazon_auth-0.2.3}/tests/test_conf.py +21 -0
- {amazon_auth-0.2.2 → amazon_auth-0.2.3}/LICENSE +0 -0
- {amazon_auth-0.2.2 → amazon_auth-0.2.3}/README.md +0 -0
- {amazon_auth-0.2.2 → amazon_auth-0.2.3}/amazon_auth.egg-info/SOURCES.txt +0 -0
- {amazon_auth-0.2.2 → amazon_auth-0.2.3}/amazon_auth.egg-info/dependency_links.txt +0 -0
- {amazon_auth-0.2.2 → amazon_auth-0.2.3}/amazon_auth.egg-info/requires.txt +0 -0
- {amazon_auth-0.2.2 → amazon_auth-0.2.3}/amazon_auth.egg-info/top_level.txt +0 -0
- {amazon_auth-0.2.2 → amazon_auth-0.2.3}/amazonauth/cli.py +0 -0
- {amazon_auth-0.2.2 → amazon_auth-0.2.3}/amazonauth/conf.py +0 -0
- {amazon_auth-0.2.2 → amazon_auth-0.2.3}/amazonauth/constants.py +0 -0
- {amazon_auth-0.2.2 → amazon_auth-0.2.3}/amazonauth/contrib/__init__.py +0 -0
- {amazon_auth-0.2.2 → amazon_auth-0.2.3}/amazonauth/contrib/browser/__init__.py +0 -0
- {amazon_auth-0.2.2 → amazon_auth-0.2.3}/amazonauth/contrib/browser/playwright.py +0 -0
- {amazon_auth-0.2.2 → amazon_auth-0.2.3}/amazonauth/contrib/waf/__init__.py +0 -0
- {amazon_auth-0.2.2 → amazon_auth-0.2.3}/amazonauth/contrib/waf/anticaptcha.py +0 -0
- {amazon_auth-0.2.2 → amazon_auth-0.2.3}/amazonauth/contrib/waf/base.py +0 -0
- {amazon_auth-0.2.2 → amazon_auth-0.2.3}/amazonauth/contrib/waf/capsolver.py +0 -0
- {amazon_auth-0.2.2 → amazon_auth-0.2.3}/amazonauth/contrib/waf/twocaptcha.py +0 -0
- {amazon_auth-0.2.2 → amazon_auth-0.2.3}/amazonauth/exception.py +0 -0
- {amazon_auth-0.2.2 → amazon_auth-0.2.3}/amazonauth/forms.py +0 -0
- {amazon_auth-0.2.2 → amazon_auth-0.2.3}/amazonauth/py.typed +0 -0
- {amazon_auth-0.2.2 → amazon_auth-0.2.3}/amazonauth/region_data.py +0 -0
- {amazon_auth-0.2.2 → amazon_auth-0.2.3}/amazonauth/selectors.py +0 -0
- {amazon_auth-0.2.2 → amazon_auth-0.2.3}/amazonauth/session.py +0 -0
- {amazon_auth-0.2.2 → amazon_auth-0.2.3}/pyproject.toml +0 -0
- {amazon_auth-0.2.2 → amazon_auth-0.2.3}/setup.cfg +0 -0
- {amazon_auth-0.2.2 → amazon_auth-0.2.3}/tests/test_cli.py +0 -0
- {amazon_auth-0.2.2 → amazon_auth-0.2.3}/tests/test_constants.py +0 -0
- {amazon_auth-0.2.2 → amazon_auth-0.2.3}/tests/test_package.py +0 -0
- {amazon_auth-0.2.2 → amazon_auth-0.2.3}/tests/test_session.py +0 -0
- {amazon_auth-0.2.2 → amazon_auth-0.2.3}/tests/test_util.py +0 -0
|
@@ -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
|
|
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
|