WsgiDAV 4.3.1__tar.gz → 4.3.2__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.
- {WsgiDAV-4.3.1 → WsgiDAV-4.3.2}/CHANGELOG.md +11 -2
- {WsgiDAV-4.3.1/WsgiDAV.egg-info → WsgiDAV-4.3.2}/PKG-INFO +4 -4
- {WsgiDAV-4.3.1 → WsgiDAV-4.3.2}/README.md +2 -2
- {WsgiDAV-4.3.1 → WsgiDAV-4.3.2/WsgiDAV.egg-info}/PKG-INFO +4 -4
- WsgiDAV-4.3.2/pyproject.toml +71 -0
- {WsgiDAV-4.3.1 → WsgiDAV-4.3.2}/setup.cfg +1 -4
- {WsgiDAV-4.3.1 → WsgiDAV-4.3.2}/setup.py +0 -1
- {WsgiDAV-4.3.1 → WsgiDAV-4.3.2}/tests/test_http.py +0 -1
- {WsgiDAV-4.3.1 → WsgiDAV-4.3.2}/tests/test_litmus.py +0 -1
- {WsgiDAV-4.3.1 → WsgiDAV-4.3.2}/tests/test_lock_manager.py +8 -11
- {WsgiDAV-4.3.1 → WsgiDAV-4.3.2}/tests/test_property_manager.py +7 -10
- {WsgiDAV-4.3.1 → WsgiDAV-4.3.2}/tests/test_scripted.py +0 -1
- {WsgiDAV-4.3.1 → WsgiDAV-4.3.2}/tests/test_streaming.py +1 -2
- {WsgiDAV-4.3.1 → WsgiDAV-4.3.2}/tests/test_util.py +3 -4
- {WsgiDAV-4.3.1 → WsgiDAV-4.3.2}/tests/test_wsgidav_app.py +0 -1
- {WsgiDAV-4.3.1 → WsgiDAV-4.3.2}/wsgidav/__init__.py +2 -2
- {WsgiDAV-4.3.1 → WsgiDAV-4.3.2}/wsgidav/dav_error.py +9 -10
- {WsgiDAV-4.3.1 → WsgiDAV-4.3.2}/wsgidav/dav_provider.py +2 -5
- {WsgiDAV-4.3.1 → WsgiDAV-4.3.2}/wsgidav/dc/base_dc.py +3 -6
- {WsgiDAV-4.3.1 → WsgiDAV-4.3.2}/wsgidav/dc/nt_dc.py +7 -10
- {WsgiDAV-4.3.1 → WsgiDAV-4.3.2}/wsgidav/dc/pam_dc.py +1 -4
- {WsgiDAV-4.3.1 → WsgiDAV-4.3.2}/wsgidav/dc/simple_dc.py +4 -7
- {WsgiDAV-4.3.1 → WsgiDAV-4.3.2}/wsgidav/default_conf.py +0 -1
- {WsgiDAV-4.3.1 → WsgiDAV-4.3.2}/wsgidav/dir_browser/_dir_browser.py +3 -10
- {WsgiDAV-4.3.1 → WsgiDAV-4.3.2}/wsgidav/error_printer.py +5 -8
- {WsgiDAV-4.3.1 → WsgiDAV-4.3.2}/wsgidav/fs_dav_provider.py +4 -5
- {WsgiDAV-4.3.1 → WsgiDAV-4.3.2}/wsgidav/http_authenticator.py +20 -53
- {WsgiDAV-4.3.1 → WsgiDAV-4.3.2}/wsgidav/lock_man/lock_manager.py +15 -32
- {WsgiDAV-4.3.1 → WsgiDAV-4.3.2}/wsgidav/lock_man/lock_storage.py +8 -13
- {WsgiDAV-4.3.1 → WsgiDAV-4.3.2}/wsgidav/lock_man/lock_storage_redis.py +4 -7
- {WsgiDAV-4.3.1 → WsgiDAV-4.3.2}/wsgidav/mw/base_mw.py +2 -2
- {WsgiDAV-4.3.1 → WsgiDAV-4.3.2}/wsgidav/mw/cors.py +0 -1
- {WsgiDAV-4.3.1 → WsgiDAV-4.3.2}/wsgidav/mw/debug_filter.py +8 -15
- {WsgiDAV-4.3.1 → WsgiDAV-4.3.2}/wsgidav/prop_man/couch_property_manager.py +0 -1
- {WsgiDAV-4.3.1 → WsgiDAV-4.3.2}/wsgidav/prop_man/mongo_property_manager.py +0 -1
- {WsgiDAV-4.3.1 → WsgiDAV-4.3.2}/wsgidav/prop_man/property_manager.py +16 -27
- {WsgiDAV-4.3.1 → WsgiDAV-4.3.2}/wsgidav/request_resolver.py +3 -3
- {WsgiDAV-4.3.1 → WsgiDAV-4.3.2}/wsgidav/request_server.py +28 -39
- {WsgiDAV-4.3.1 → WsgiDAV-4.3.2}/wsgidav/rw_lock.py +0 -1
- WsgiDAV-4.3.2/wsgidav/samples/__init__.py +0 -0
- {WsgiDAV-4.3.1 → WsgiDAV-4.3.2}/wsgidav/samples/dav_provider_tools.py +1 -2
- {WsgiDAV-4.3.1 → WsgiDAV-4.3.2}/wsgidav/samples/hg_dav_provider.py +0 -1
- {WsgiDAV-4.3.1 → WsgiDAV-4.3.2}/wsgidav/samples/mongo_dav_provider.py +0 -1
- {WsgiDAV-4.3.1 → WsgiDAV-4.3.2}/wsgidav/samples/mysql_dav_provider.py +0 -1
- {WsgiDAV-4.3.1 → WsgiDAV-4.3.2}/wsgidav/samples/virtual_dav_provider.py +3 -4
- WsgiDAV-4.3.2/wsgidav/server/__init__.py +0 -0
- {WsgiDAV-4.3.1 → WsgiDAV-4.3.2}/wsgidav/server/ext_wsgiutils_server.py +13 -28
- {WsgiDAV-4.3.1 → WsgiDAV-4.3.2}/wsgidav/server/run_reloading_server.py +1 -2
- {WsgiDAV-4.3.1 → WsgiDAV-4.3.2}/wsgidav/server/server_cli.py +6 -8
- {WsgiDAV-4.3.1 → WsgiDAV-4.3.2}/wsgidav/server/server_sample.py +0 -1
- {WsgiDAV-4.3.1 → WsgiDAV-4.3.2}/wsgidav/stream_tools.py +0 -1
- {WsgiDAV-4.3.1 → WsgiDAV-4.3.2}/wsgidav/util.py +24 -38
- {WsgiDAV-4.3.1 → WsgiDAV-4.3.2}/wsgidav/wsgidav_app.py +8 -20
- {WsgiDAV-4.3.1 → WsgiDAV-4.3.2}/wsgidav/xml_tools.py +2 -3
- WsgiDAV-4.3.1/pyproject.toml +0 -35
- WsgiDAV-4.3.1/wsgidav/lock_man/__init__.py +0 -1
- WsgiDAV-4.3.1/wsgidav/prop_man/__init__.py +0 -1
- {WsgiDAV-4.3.1 → WsgiDAV-4.3.2}/LICENSE +0 -0
- {WsgiDAV-4.3.1 → WsgiDAV-4.3.2}/WsgiDAV.egg-info/SOURCES.txt +0 -0
- {WsgiDAV-4.3.1 → WsgiDAV-4.3.2}/WsgiDAV.egg-info/dependency_links.txt +0 -0
- {WsgiDAV-4.3.1 → WsgiDAV-4.3.2}/WsgiDAV.egg-info/entry_points.txt +0 -0
- {WsgiDAV-4.3.1 → WsgiDAV-4.3.2}/WsgiDAV.egg-info/not-zip-safe +0 -0
- {WsgiDAV-4.3.1 → WsgiDAV-4.3.2}/WsgiDAV.egg-info/requires.txt +0 -0
- {WsgiDAV-4.3.1 → WsgiDAV-4.3.2}/WsgiDAV.egg-info/top_level.txt +0 -0
- {WsgiDAV-4.3.1 → WsgiDAV-4.3.2}/sample_wsgidav.yaml +0 -0
- {WsgiDAV-4.3.1 → WsgiDAV-4.3.2}/wsgidav/dc/__init__.py +0 -0
- {WsgiDAV-4.3.1 → WsgiDAV-4.3.2}/wsgidav/dir_browser/__init__.py +0 -0
- {WsgiDAV-4.3.1 → WsgiDAV-4.3.2}/wsgidav/dir_browser/htdocs/favicon.ico +0 -0
- {WsgiDAV-4.3.1 → WsgiDAV-4.3.2}/wsgidav/dir_browser/htdocs/logo.png +0 -0
- {WsgiDAV-4.3.1 → WsgiDAV-4.3.2}/wsgidav/dir_browser/htdocs/script.js +0 -0
- {WsgiDAV-4.3.1 → WsgiDAV-4.3.2}/wsgidav/dir_browser/htdocs/style.css +0 -0
- {WsgiDAV-4.3.1 → WsgiDAV-4.3.2}/wsgidav/dir_browser/htdocs/template.html +0 -0
- {WsgiDAV-4.3.1/wsgidav/mw → WsgiDAV-4.3.2/wsgidav/lock_man}/__init__.py +0 -0
- {WsgiDAV-4.3.1/wsgidav/samples → WsgiDAV-4.3.2/wsgidav/mw}/__init__.py +0 -0
- {WsgiDAV-4.3.1/wsgidav/server → WsgiDAV-4.3.2/wsgidav/prop_man}/__init__.py +0 -0
|
@@ -1,12 +1,21 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
-
## 4.3.
|
|
3
|
+
## 4.3.3 / Unreleased
|
|
4
|
+
|
|
5
|
+
## 4.3.2 / 2024-03-29
|
|
6
|
+
|
|
7
|
+
- [#318](https://github.com/mar10/wsgidav/issues/318)
|
|
8
|
+
- Test with Python 3.12
|
|
9
|
+
- Update to black 24.3
|
|
10
|
+
- Use ruff instead of flake8
|
|
11
|
+
|
|
12
|
+
## 4.3.1 / 2024-03-24
|
|
4
13
|
|
|
5
14
|
- New option `suppress_version_info` to suppress WsgiDAV's version info in
|
|
6
15
|
responses (default: false).
|
|
7
16
|
- #298: `--root` argument honors `fs_dav_provider` configuration.
|
|
8
17
|
- #301: `_DAVResource` should have `is_link()` method to avoid dir_browser issues.
|
|
9
|
-
-
|
|
18
|
+
- #308: remove defusedxml dependency.
|
|
10
19
|
|
|
11
20
|
## 4.3.0 / 2023-09-24
|
|
12
21
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: WsgiDAV
|
|
3
|
-
Version: 4.3.
|
|
3
|
+
Version: 4.3.2
|
|
4
4
|
Summary: Generic and extendable WebDAV server based on WSGI
|
|
5
5
|
Home-page: https://github.com/mar10/wsgidav
|
|
6
6
|
Author: Martin Wendt
|
|
@@ -24,11 +24,11 @@ Classifier: Operating System :: OS Independent
|
|
|
24
24
|
Classifier: Programming Language :: Python
|
|
25
25
|
Classifier: Programming Language :: Python :: 3
|
|
26
26
|
Classifier: Programming Language :: Python :: 3 :: Only
|
|
27
|
-
Classifier: Programming Language :: Python :: 3.7
|
|
28
27
|
Classifier: Programming Language :: Python :: 3.8
|
|
29
28
|
Classifier: Programming Language :: Python :: 3.9
|
|
30
29
|
Classifier: Programming Language :: Python :: 3.10
|
|
31
30
|
Classifier: Programming Language :: Python :: 3.11
|
|
31
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
32
32
|
Classifier: Topic :: Internet :: WWW/HTTP
|
|
33
33
|
Classifier: Topic :: Internet :: WWW/HTTP :: HTTP Servers
|
|
34
34
|
Classifier: Topic :: Internet :: WWW/HTTP :: Dynamic Content
|
|
@@ -46,11 +46,11 @@ Provides-Extra: pam
|
|
|
46
46
|
Requires-Dist: python-pam; extra == "pam"
|
|
47
47
|
|
|
48
48
|
#  WsgiDAV
|
|
49
|
-
[](https://github.com/mar10/wsgidav/actions/workflows/tests.yml)
|
|
50
50
|
[](https://pypi.python.org/pypi/WsgiDAV/)
|
|
51
51
|
[](https://github.com/mar10/wsgidav/blob/master/LICENSE)
|
|
52
52
|
[](http://wsgidav.readthedocs.io/)
|
|
53
|
-
[](https://codecov.io/gh/mar10/wsgidav)
|
|
54
54
|
[](https://github.com/mar10/yabs)
|
|
55
55
|
[](https://stackoverflow.com/questions/tagged/WsgiDAV)
|
|
56
56
|
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
#  WsgiDAV
|
|
2
|
-
[](https://github.com/mar10/wsgidav/actions/workflows/tests.yml)
|
|
3
3
|
[](https://pypi.python.org/pypi/WsgiDAV/)
|
|
4
4
|
[](https://github.com/mar10/wsgidav/blob/master/LICENSE)
|
|
5
5
|
[](http://wsgidav.readthedocs.io/)
|
|
6
|
-
[](https://codecov.io/gh/mar10/wsgidav)
|
|
7
7
|
[](https://github.com/mar10/yabs)
|
|
8
8
|
[](https://stackoverflow.com/questions/tagged/WsgiDAV)
|
|
9
9
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: WsgiDAV
|
|
3
|
-
Version: 4.3.
|
|
3
|
+
Version: 4.3.2
|
|
4
4
|
Summary: Generic and extendable WebDAV server based on WSGI
|
|
5
5
|
Home-page: https://github.com/mar10/wsgidav
|
|
6
6
|
Author: Martin Wendt
|
|
@@ -24,11 +24,11 @@ Classifier: Operating System :: OS Independent
|
|
|
24
24
|
Classifier: Programming Language :: Python
|
|
25
25
|
Classifier: Programming Language :: Python :: 3
|
|
26
26
|
Classifier: Programming Language :: Python :: 3 :: Only
|
|
27
|
-
Classifier: Programming Language :: Python :: 3.7
|
|
28
27
|
Classifier: Programming Language :: Python :: 3.8
|
|
29
28
|
Classifier: Programming Language :: Python :: 3.9
|
|
30
29
|
Classifier: Programming Language :: Python :: 3.10
|
|
31
30
|
Classifier: Programming Language :: Python :: 3.11
|
|
31
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
32
32
|
Classifier: Topic :: Internet :: WWW/HTTP
|
|
33
33
|
Classifier: Topic :: Internet :: WWW/HTTP :: HTTP Servers
|
|
34
34
|
Classifier: Topic :: Internet :: WWW/HTTP :: Dynamic Content
|
|
@@ -46,11 +46,11 @@ Provides-Extra: pam
|
|
|
46
46
|
Requires-Dist: python-pam; extra == "pam"
|
|
47
47
|
|
|
48
48
|
#  WsgiDAV
|
|
49
|
-
[](https://github.com/mar10/wsgidav/actions/workflows/tests.yml)
|
|
50
50
|
[](https://pypi.python.org/pypi/WsgiDAV/)
|
|
51
51
|
[](https://github.com/mar10/wsgidav/blob/master/LICENSE)
|
|
52
52
|
[](http://wsgidav.readthedocs.io/)
|
|
53
|
-
[](https://codecov.io/gh/mar10/wsgidav)
|
|
54
54
|
[](https://github.com/mar10/yabs)
|
|
55
55
|
[](https://stackoverflow.com/questions/tagged/WsgiDAV)
|
|
56
56
|
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
[tool.black]
|
|
2
|
+
line-length = 88
|
|
3
|
+
target-version = ['py38', 'py39', 'py310', 'py311']
|
|
4
|
+
include = '\.pyi?$'
|
|
5
|
+
exclude = '''
|
|
6
|
+
/(
|
|
7
|
+
\.git
|
|
8
|
+
| \.hg
|
|
9
|
+
| \.tox
|
|
10
|
+
| \.venv
|
|
11
|
+
| \.eggs
|
|
12
|
+
| \.cache
|
|
13
|
+
| build
|
|
14
|
+
| __pycache__
|
|
15
|
+
| dist
|
|
16
|
+
| \.*
|
|
17
|
+
|
|
18
|
+
)/
|
|
19
|
+
'''
|
|
20
|
+
|
|
21
|
+
[tool.isort]
|
|
22
|
+
# See https://black.readthedocs.io/en/stable/compatible_configs.html
|
|
23
|
+
profile = "black"
|
|
24
|
+
src_paths = ["wsgidav", "tests"]
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
[tool.ruff]
|
|
28
|
+
# Decrease the maximum line length to 79 characters.
|
|
29
|
+
# line-length = 79
|
|
30
|
+
# Support Python 3.10+.
|
|
31
|
+
target-version = "py38"
|
|
32
|
+
src = ["wsgidav", "tests"]
|
|
33
|
+
|
|
34
|
+
[tool.ruff.lint.isort]
|
|
35
|
+
known-first-party = ["wsgidav", "tests"]
|
|
36
|
+
|
|
37
|
+
[tool.ruff.lint]
|
|
38
|
+
select = [
|
|
39
|
+
"B", # bugbear
|
|
40
|
+
"E", # pycodestyle
|
|
41
|
+
"F", # pyflakes
|
|
42
|
+
"G", # flake8-logging-format
|
|
43
|
+
"UP", # pyupgrade
|
|
44
|
+
"T", # print, ...
|
|
45
|
+
# "D", # pydocstyle
|
|
46
|
+
"I", # isort
|
|
47
|
+
# "C", # codespell
|
|
48
|
+
# "SIM", #
|
|
49
|
+
]
|
|
50
|
+
ignore = [
|
|
51
|
+
# We need the old syntax for python <= 3.9
|
|
52
|
+
"UP006", # Use `list` instead of `List` for type annotations (since Py39)
|
|
53
|
+
"UP007", # Use `X | Y` for type annotations (since Py310)
|
|
54
|
+
"E721", # Do not compare types, use `isinstance()`
|
|
55
|
+
"E501", # Line too long
|
|
56
|
+
"G001", # Logging statement uses str.format
|
|
57
|
+
"G002", # Logging statement uses % formatting
|
|
58
|
+
"G004", # Logging format string does not contain any variables
|
|
59
|
+
"T201", # `print()` statement found
|
|
60
|
+
"T203", # `pprint()` statement found
|
|
61
|
+
"UP031", # Use format specifiers instead of percent format
|
|
62
|
+
]
|
|
63
|
+
|
|
64
|
+
# [tool.ruff.pydocstyle]
|
|
65
|
+
# convention = "google"
|
|
66
|
+
|
|
67
|
+
[tool.codespell]
|
|
68
|
+
skip = '.git,*.pdf,*.svg,*.lock,*.css,logs'
|
|
69
|
+
check-hidden = true
|
|
70
|
+
# ignore-regex = ''
|
|
71
|
+
# ignore-words-list = ''
|
|
@@ -30,11 +30,11 @@ classifiers =
|
|
|
30
30
|
Programming Language :: Python
|
|
31
31
|
Programming Language :: Python :: 3
|
|
32
32
|
Programming Language :: Python :: 3 :: Only
|
|
33
|
-
Programming Language :: Python :: 3.7
|
|
34
33
|
Programming Language :: Python :: 3.8
|
|
35
34
|
Programming Language :: Python :: 3.9
|
|
36
35
|
Programming Language :: Python :: 3.10
|
|
37
36
|
Programming Language :: Python :: 3.11
|
|
37
|
+
Programming Language :: Python :: 3.12
|
|
38
38
|
Topic :: Internet :: WWW/HTTP
|
|
39
39
|
Topic :: Internet :: WWW/HTTP :: HTTP Servers
|
|
40
40
|
Topic :: Internet :: WWW/HTTP :: Dynamic Content
|
|
@@ -106,9 +106,6 @@ addopts =
|
|
|
106
106
|
testpaths =
|
|
107
107
|
.
|
|
108
108
|
tests
|
|
109
|
-
|
|
110
|
-
[flake8]
|
|
111
|
-
enable-extensions = G
|
|
112
109
|
exclude =
|
|
113
110
|
__pycache__,
|
|
114
111
|
.cache,
|
|
@@ -1,10 +1,8 @@
|
|
|
1
|
-
# -*- coding: utf-8 -*-
|
|
2
1
|
# (c) 2009-2023 Martin Wendt and contributors; see WsgiDAV https://github.com/mar10/wsgidav
|
|
3
2
|
# Licensed under the MIT license:
|
|
4
3
|
# http://www.opensource.org/licenses/mit-license.php
|
|
5
4
|
"""Unit test for lock_manager.py"""
|
|
6
5
|
import os
|
|
7
|
-
import sys
|
|
8
6
|
import unittest
|
|
9
7
|
from tempfile import gettempdir
|
|
10
8
|
from time import sleep
|
|
@@ -375,13 +373,12 @@ class ShelveTest(BasicTest):
|
|
|
375
373
|
"""Test lock_manager.ShelveLockManager()."""
|
|
376
374
|
|
|
377
375
|
def setUp(self):
|
|
378
|
-
if sys.version_info < (3, 0):
|
|
379
|
-
|
|
380
|
-
else:
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
)
|
|
376
|
+
# if sys.version_info < (3, 0):
|
|
377
|
+
# modifier = "-py2" # shelve formats are incompatible
|
|
378
|
+
# else:
|
|
379
|
+
# modifier = "-py3"
|
|
380
|
+
modifier = "-py3"
|
|
381
|
+
self.path = os.path.join(gettempdir(), f"wsgidav-locks{modifier}.shelve")
|
|
385
382
|
storage = lock_storage.LockStorageShelve(self.path)
|
|
386
383
|
self.lm = lock_manager.LockManager(storage)
|
|
387
384
|
self.lm._verbose = 2
|
|
@@ -411,9 +408,9 @@ class RedisTest(BasicTest):
|
|
|
411
408
|
|
|
412
409
|
r = redis.Redis()
|
|
413
410
|
r.ping()
|
|
414
|
-
except redis.exceptions.ConnectionError:
|
|
411
|
+
except redis.exceptions.ConnectionError as e:
|
|
415
412
|
RedisTest._redis_connect_failed = True
|
|
416
|
-
raise unittest.SkipTest("Test requires a running redis instance")
|
|
413
|
+
raise unittest.SkipTest("Test requires a running redis instance") from e
|
|
417
414
|
storage = LockStorageRedis()
|
|
418
415
|
self.lm = lock_manager.LockManager(storage)
|
|
419
416
|
self.lm._verbose = 2
|
|
@@ -1,10 +1,8 @@
|
|
|
1
|
-
# -*- coding: utf-8 -*-
|
|
2
1
|
# (c) 2009-2023 Martin Wendt and contributors; see WsgiDAV https://github.com/mar10/wsgidav
|
|
3
2
|
# Licensed under the MIT license:
|
|
4
3
|
# http://www.opensource.org/licenses/mit-license.php
|
|
5
4
|
"""Unit test for property_manager.py"""
|
|
6
5
|
import os
|
|
7
|
-
import sys
|
|
8
6
|
import unittest
|
|
9
7
|
from tempfile import gettempdir
|
|
10
8
|
|
|
@@ -52,7 +50,7 @@ class BasicTest(unittest.TestCase):
|
|
|
52
50
|
try:
|
|
53
51
|
pm.get_properties(self.respath)
|
|
54
52
|
except Exception:
|
|
55
|
-
print("NOTE: if this fails, try to delete the temp files: {}"
|
|
53
|
+
print(f"NOTE: if this fails, try to delete the temp files: {pm}")
|
|
56
54
|
raise
|
|
57
55
|
assert pm._loaded, "PM must be opened after first access"
|
|
58
56
|
|
|
@@ -89,13 +87,12 @@ class ShelveTest(BasicTest):
|
|
|
89
87
|
"""Test property_manager.ShelvePropertyManager()."""
|
|
90
88
|
|
|
91
89
|
def setUp(self):
|
|
92
|
-
if sys.version_info < (3, 0):
|
|
93
|
-
|
|
94
|
-
else:
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
)
|
|
90
|
+
# if sys.version_info < (3, 0):
|
|
91
|
+
# modifier = "-py2" # shelve formats are incompatible
|
|
92
|
+
# else:
|
|
93
|
+
# modifier = "-py3"
|
|
94
|
+
modifier = "-py3"
|
|
95
|
+
self.path = os.path.join(gettempdir(), f"wsgidav-props{modifier}.shelve")
|
|
99
96
|
# Note: os.remove(self.path) does not work, because Shelve may append
|
|
100
97
|
# a file extension.
|
|
101
98
|
# if os.path.exists(self.path):
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
# -*- coding: utf-8 -*-
|
|
2
1
|
# (c) 2009-2023 Martin Wendt and contributors; see WsgiDAV https://github.com/mar10/wsgidav
|
|
3
2
|
# Licensed under the MIT license:
|
|
4
3
|
# http://www.opensource.org/licenses/mit-license.php
|
|
@@ -75,7 +74,7 @@ class MockProxyResource(DAVNonCollection):
|
|
|
75
74
|
return queue
|
|
76
75
|
|
|
77
76
|
def end_write(self, *, with_errors):
|
|
78
|
-
print("end_write: {
|
|
77
|
+
print(f"end_write: {self.target_path}")
|
|
79
78
|
self.worker.join()
|
|
80
79
|
|
|
81
80
|
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
# -*- coding: utf-8 -*-
|
|
2
1
|
# (c) 2009-2023 Martin Wendt and contributors; see WsgiDAV https://github.com/mar10/wsgidav
|
|
3
2
|
# Licensed under the MIT license:
|
|
4
3
|
# http://www.opensource.org/licenses/mit-license.php
|
|
@@ -227,7 +226,7 @@ class LoggerTest(unittest.TestCase):
|
|
|
227
226
|
|
|
228
227
|
rootOutput, baseOutput = self.getLogOutput()
|
|
229
228
|
# Printed for debugging, when test fails:
|
|
230
|
-
print("ROOT OUTPUT:\n{!r}\nBASE OUTPUT:\n{!r}"
|
|
229
|
+
print(f"ROOT OUTPUT:\n{rootOutput!r}\nBASE OUTPUT:\n{baseOutput!r}")
|
|
231
230
|
|
|
232
231
|
# No output should be generated in the root logger
|
|
233
232
|
assert rootOutput == ""
|
|
@@ -251,7 +250,7 @@ class LoggerTest(unittest.TestCase):
|
|
|
251
250
|
|
|
252
251
|
rootOutput, baseOutput = self.getLogOutput()
|
|
253
252
|
# Printed for debugging, when test fails:
|
|
254
|
-
print("ROOT OUTPUT:\n{!r}\nBASE OUTPUT:\n{!r}"
|
|
253
|
+
print(f"ROOT OUTPUT:\n{rootOutput!r}\nBASE OUTPUT:\n{baseOutput!r}")
|
|
255
254
|
|
|
256
255
|
# Now output we should see output in the root logger
|
|
257
256
|
assert rootOutput == baseOutput
|
|
@@ -293,7 +292,7 @@ class LoggerTest(unittest.TestCase):
|
|
|
293
292
|
|
|
294
293
|
rootOutput, baseOutput = self.getLogOutput()
|
|
295
294
|
# Printed for debugging, when test fails:
|
|
296
|
-
print("ROOT OUTPUT:\n{!r}\nBASE OUTPUT:\n{!r}"
|
|
295
|
+
print(f"ROOT OUTPUT:\n{rootOutput!r}\nBASE OUTPUT:\n{baseOutput!r}")
|
|
297
296
|
|
|
298
297
|
# init_logging() removes all other handlers
|
|
299
298
|
assert rootOutput == ""
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
# -*- coding: utf-8 -*-
|
|
2
1
|
"""
|
|
3
2
|
Current WsgiDAV version number.
|
|
4
3
|
|
|
@@ -15,7 +14,8 @@ NOTE:
|
|
|
15
14
|
When pywin32 is installed, number must be a.b.c for MSI builds?
|
|
16
15
|
"3.0.0a4" seems not to work in this case!
|
|
17
16
|
"""
|
|
18
|
-
|
|
17
|
+
|
|
18
|
+
__version__ = "4.3.2"
|
|
19
19
|
|
|
20
20
|
# make version accessible as 'wsgidav.__version__'
|
|
21
21
|
# from wsgidav._version import __version__ # noqa: F401
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
# -*- coding: utf-8 -*-
|
|
2
1
|
# (c) 2009-2023 Martin Wendt and contributors; see WsgiDAV https://github.com/mar10/wsgidav
|
|
3
2
|
# Original PyFileServer (c) 2005 Ho Chun Wei.
|
|
4
3
|
# Licensed under the MIT license:
|
|
@@ -136,7 +135,7 @@ class DAVErrorCondition:
|
|
|
136
135
|
self.hrefs = []
|
|
137
136
|
|
|
138
137
|
def __str__(self):
|
|
139
|
-
return "{}({
|
|
138
|
+
return f"{self.condition_code}({self.hrefs})"
|
|
140
139
|
|
|
141
140
|
def add_href(self, href):
|
|
142
141
|
assert href.startswith("/")
|
|
@@ -204,19 +203,19 @@ class DAVError(Exception):
|
|
|
204
203
|
)
|
|
205
204
|
|
|
206
205
|
def __repr__(self):
|
|
207
|
-
return "DAVError({
|
|
206
|
+
return f"DAVError({self.get_user_info()})"
|
|
208
207
|
|
|
209
208
|
def get_user_info(self):
|
|
210
209
|
"""Return readable string."""
|
|
211
210
|
if self.value in ERROR_DESCRIPTIONS:
|
|
212
|
-
s = "{
|
|
211
|
+
s = f"{ERROR_DESCRIPTIONS[self.value]}"
|
|
213
212
|
else:
|
|
214
213
|
s = f"{self.value}"
|
|
215
214
|
|
|
216
215
|
if self.context_info:
|
|
217
216
|
s += f": {self.context_info}"
|
|
218
217
|
elif self.value in ERROR_RESPONSES:
|
|
219
|
-
s += ": {
|
|
218
|
+
s += f": {ERROR_RESPONSES[self.value]}"
|
|
220
219
|
|
|
221
220
|
if self.src_exception:
|
|
222
221
|
s += f"\n Source exception: {self.src_exception!r}"
|
|
@@ -248,10 +247,10 @@ class DAVError(Exception):
|
|
|
248
247
|
html.append(
|
|
249
248
|
" <meta http-equiv='Content-Type' content='text/html; charset=utf-8'>"
|
|
250
249
|
)
|
|
251
|
-
html.append(" <title>{}</title>"
|
|
250
|
+
html.append(f" <title>{status}</title>")
|
|
252
251
|
html.append("</head><body>")
|
|
253
|
-
html.append(" <h1>{}</h1>"
|
|
254
|
-
html.append(" <p>{
|
|
252
|
+
html.append(f" <h1>{status}</h1>")
|
|
253
|
+
html.append(f" <p>{html_escape(self.get_user_info())}</p>")
|
|
255
254
|
html.append("<hr/>")
|
|
256
255
|
html.append(
|
|
257
256
|
"<a href='https://github.com/mar10/wsgidav/'>{}</a> - {}".format(
|
|
@@ -281,7 +280,7 @@ def get_http_status_string(v):
|
|
|
281
280
|
try:
|
|
282
281
|
return ERROR_DESCRIPTIONS[code]
|
|
283
282
|
except KeyError:
|
|
284
|
-
return "{} Status"
|
|
283
|
+
return f"{code} Status"
|
|
285
284
|
|
|
286
285
|
|
|
287
286
|
def get_response_page(v):
|
|
@@ -297,4 +296,4 @@ def as_DAVError(e):
|
|
|
297
296
|
# traceback.print_exc()
|
|
298
297
|
return DAVError(HTTP_INTERNAL_ERROR, src_exception=e)
|
|
299
298
|
else:
|
|
300
|
-
return DAVError(HTTP_INTERNAL_ERROR, "{}"
|
|
299
|
+
return DAVError(HTTP_INTERNAL_ERROR, f"{e}")
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
# -*- coding: utf-8 -*-
|
|
2
1
|
# (c) 2009-2023 Martin Wendt and contributors; see WsgiDAV https://github.com/mar10/wsgidav
|
|
3
2
|
# Original PyFileServer (c) 2005 Ho Chun Wei.
|
|
4
3
|
# Licensed under the MIT license:
|
|
@@ -268,7 +267,7 @@ class _DAVResource(ABC):
|
|
|
268
267
|
elif os.extsep in self.name:
|
|
269
268
|
ext = self.name.split(os.extsep)[-1].upper()
|
|
270
269
|
if len(ext) < 5:
|
|
271
|
-
return {"type": "{}-File"
|
|
270
|
+
return {"type": f"{ext}-File"}
|
|
272
271
|
return {"type": "File"}
|
|
273
272
|
|
|
274
273
|
def get_etag(self):
|
|
@@ -820,9 +819,7 @@ class _DAVResource(ABC):
|
|
|
820
819
|
)
|
|
821
820
|
except Exception:
|
|
822
821
|
_logger.warning(
|
|
823
|
-
"Provider does not support set_last_modified on {}."
|
|
824
|
-
self.path
|
|
825
|
-
)
|
|
822
|
+
f"Provider does not support set_last_modified on {self.path}."
|
|
826
823
|
)
|
|
827
824
|
|
|
828
825
|
# Unsupported or not allowed
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
# -*- coding: utf-8 -*-
|
|
2
1
|
# (c) 2009-2023 Martin Wendt and contributors; see WsgiDAV https://github.com/mar10/wsgidav
|
|
3
2
|
# Licensed under the MIT license: http://www.opensource.org/licenses/mit-license.php
|
|
4
3
|
"""
|
|
@@ -60,7 +59,7 @@ class BaseDomainController(ABC):
|
|
|
60
59
|
self.config = config
|
|
61
60
|
|
|
62
61
|
def __str__(self):
|
|
63
|
-
return "{
|
|
62
|
+
return f"{self.__class__.__name__}()"
|
|
64
63
|
|
|
65
64
|
def _calc_realm_from_path_provider(self, path_info, environ):
|
|
66
65
|
"""Internal helper for derived classes to implement get_domain_realm()."""
|
|
@@ -74,10 +73,8 @@ class BaseDomainController(ABC):
|
|
|
74
73
|
_share, dav_provider = self.wsgidav_app.resolve_provider(path_info)
|
|
75
74
|
|
|
76
75
|
if not dav_provider:
|
|
77
|
-
logger.
|
|
78
|
-
"_calc_realm_from_path_provider({!r}): {!r}"
|
|
79
|
-
util.safe_re_encode(path_info, sys.stdout.encoding), None
|
|
80
|
-
)
|
|
76
|
+
logger.warning(
|
|
77
|
+
f"_calc_realm_from_path_provider({util.safe_re_encode(path_info, sys.stdout.encoding)!r}): {None!r}"
|
|
81
78
|
)
|
|
82
79
|
return None
|
|
83
80
|
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
# -*- coding: utf-8 -*-
|
|
2
1
|
# (c) 2009-2023 Martin Wendt and contributors; see WsgiDAV https://github.com/mar10/wsgidav
|
|
3
2
|
# Original PyFileServer (c) 2005 Ho Chun Wei.
|
|
4
3
|
# Licensed under the MIT license: http://www.opensource.org/licenses/mit-license.php
|
|
@@ -96,8 +95,8 @@ class NTDomainController(BaseDomainController):
|
|
|
96
95
|
self.preset_server = dc_conf.get("preset_server")
|
|
97
96
|
|
|
98
97
|
def __str__(self):
|
|
99
|
-
return
|
|
100
|
-
self.__class__.__name__
|
|
98
|
+
return (
|
|
99
|
+
f"{self.__class__.__name__}({self.preset_domain!r}, {self.preset_server!r})"
|
|
101
100
|
)
|
|
102
101
|
|
|
103
102
|
def get_domain_realm(self, path_info, environ):
|
|
@@ -181,9 +180,9 @@ class NTDomainController(BaseDomainController):
|
|
|
181
180
|
if un == userinfo["name"].lower():
|
|
182
181
|
return True
|
|
183
182
|
except win32net.error as e:
|
|
184
|
-
_logger.exception("NetUserEnum: {}"
|
|
183
|
+
_logger.exception(f"NetUserEnum: {e}")
|
|
185
184
|
return False
|
|
186
|
-
_logger.info("User {!r} not found on server {!r}"
|
|
185
|
+
_logger.info(f"User {user_name!r} not found on server {server!r}")
|
|
187
186
|
return False
|
|
188
187
|
|
|
189
188
|
def _auth_user(self, user_name, password, domain, server):
|
|
@@ -205,18 +204,16 @@ class NTDomainController(BaseDomainController):
|
|
|
205
204
|
win32security.LOGON32_PROVIDER_DEFAULT,
|
|
206
205
|
)
|
|
207
206
|
if not htoken:
|
|
208
|
-
_logger.warning(
|
|
209
|
-
"LogonUser({!r}, {!r}, '***') failed.".format(user_name, domain)
|
|
210
|
-
)
|
|
207
|
+
_logger.warning(f"LogonUser({user_name!r}, {domain!r}, '***') failed.")
|
|
211
208
|
return False
|
|
212
209
|
except win32security.error as err:
|
|
213
210
|
_logger.warning(
|
|
214
|
-
"LogonUser({!r}, {!r}, '***') failed: {}"
|
|
211
|
+
f"LogonUser({user_name!r}, {domain!r}, '***') failed: {err}"
|
|
215
212
|
)
|
|
216
213
|
return False
|
|
217
214
|
finally:
|
|
218
215
|
if htoken:
|
|
219
216
|
htoken.Close()
|
|
220
217
|
|
|
221
|
-
_logger.debug("User {!r} logged on."
|
|
218
|
+
_logger.debug(f"User {user_name!r} logged on.")
|
|
222
219
|
return True
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
# -*- coding: utf-8 -*-
|
|
2
1
|
# (c) 2009-2023 Martin Wendt and contributors; see WsgiDAV https://github.com/mar10/wsgidav
|
|
3
2
|
# Licensed under the MIT license: http://www.opensource.org/licenses/mit-license.php
|
|
4
3
|
"""
|
|
@@ -60,9 +59,7 @@ class PAMDomainController(BaseDomainController):
|
|
|
60
59
|
)
|
|
61
60
|
if not is_ok:
|
|
62
61
|
_logger.warning(
|
|
63
|
-
"pam.authenticate({!r}, '<redacted>', {!r}) failed with code {}: {}"
|
|
64
|
-
user_name, self.pam_service, self.pam.code, self.pam.reason
|
|
65
|
-
)
|
|
62
|
+
f"pam.authenticate({user_name!r}, '<redacted>', {self.pam_service!r}) failed with code {self.pam.code}: {self.pam.reason}"
|
|
66
63
|
)
|
|
67
64
|
return False
|
|
68
65
|
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
# -*- coding: utf-8 -*-
|
|
2
1
|
# (c) 2009-2023 Martin Wendt and contributors; see WsgiDAV https://github.com/mar10/wsgidav
|
|
3
2
|
# Original PyFileServer (c) 2005 Ho Chun Wei.
|
|
4
3
|
# Licensed under the MIT license:
|
|
@@ -83,14 +82,12 @@ class SimpleDomainController(BaseDomainController):
|
|
|
83
82
|
for share, data in self.user_map.items():
|
|
84
83
|
if type(data) not in (bool, dict) or not data:
|
|
85
84
|
raise RuntimeError(
|
|
86
|
-
"Invalid option: simple_dc.user_mapping[{!r}]: must be True or non-empty dict."
|
|
87
|
-
share
|
|
88
|
-
)
|
|
85
|
+
f"Invalid option: simple_dc.user_mapping[{share!r}]: must be True or non-empty dict."
|
|
89
86
|
)
|
|
90
87
|
return
|
|
91
88
|
|
|
92
89
|
def __str__(self):
|
|
93
|
-
return "{
|
|
90
|
+
return f"{self.__class__.__name__}()"
|
|
94
91
|
|
|
95
92
|
def _get_realm_entry(self, realm, user_name=None):
|
|
96
93
|
"""Return the matching user_map entry (falling back to default '*' if any)."""
|
|
@@ -111,8 +108,8 @@ class SimpleDomainController(BaseDomainController):
|
|
|
111
108
|
realm_entry = self._get_realm_entry(realm)
|
|
112
109
|
if realm_entry is None:
|
|
113
110
|
_logger.error(
|
|
114
|
-
'Missing configuration simple_dc.user_mapping["{}"] (or "*"): '
|
|
115
|
-
"realm is not accessible!"
|
|
111
|
+
f'Missing configuration simple_dc.user_mapping["{realm}"] (or "*"): '
|
|
112
|
+
"realm is not accessible!"
|
|
116
113
|
)
|
|
117
114
|
return realm_entry is not True
|
|
118
115
|
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
# -*- coding: utf-8 -*-
|
|
2
1
|
# (c) 2009-2023 Martin Wendt and contributors; see WsgiDAV https://github.com/mar10/wsgidav
|
|
3
2
|
# Licensed under the MIT license:
|
|
4
3
|
# http://www.opensource.org/licenses/mit-license.php
|
|
@@ -60,9 +59,7 @@ class WsgiDavDirBrowser(BaseMiddleware):
|
|
|
60
59
|
self.htdocs_path = os.path.join(os.path.dirname(__file__), "htdocs")
|
|
61
60
|
|
|
62
61
|
if not os.path.isdir(self.htdocs_path):
|
|
63
|
-
raise ValueError(
|
|
64
|
-
"Invalid dir_browser htdocs_path {!r}".format(self.htdocs_path)
|
|
65
|
-
)
|
|
62
|
+
raise ValueError(f"Invalid dir_browser htdocs_path {self.htdocs_path!r}")
|
|
66
63
|
|
|
67
64
|
# Add an additional read-only FS provider that serves the dir_browser assets
|
|
68
65
|
self.wsgidav_app.add_provider(ASSET_SHARE, self.htdocs_path, readonly=True)
|
|
@@ -152,9 +149,7 @@ class WsgiDavDirBrowser(BaseMiddleware):
|
|
|
152
149
|
e = DAVError(value, context_info, src_exception, err_condition)
|
|
153
150
|
if self.verbose >= 4:
|
|
154
151
|
_logger.warning(
|
|
155
|
-
"Raising DAVError {}"
|
|
156
|
-
safe_re_encode(e.get_user_info(), sys.stdout.encoding)
|
|
157
|
-
)
|
|
152
|
+
f"Raising DAVError {safe_re_encode(e.get_user_info(), sys.stdout.encoding)}"
|
|
158
153
|
)
|
|
159
154
|
raise e
|
|
160
155
|
|
|
@@ -297,9 +292,7 @@ class WsgiDavDirBrowser(BaseMiddleware):
|
|
|
297
292
|
rows.append(entry)
|
|
298
293
|
if ignored_list:
|
|
299
294
|
_logger.debug(
|
|
300
|
-
"Dir browser ignored {} entries: {}"
|
|
301
|
-
len(ignored_list), ignored_list
|
|
302
|
-
)
|
|
295
|
+
f"Dir browser ignored {len(ignored_list)} entries: {ignored_list}"
|
|
303
296
|
)
|
|
304
297
|
|
|
305
298
|
# sort
|