WsgiDAV 4.3.0__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.0 → WsgiDAV-4.3.2}/CHANGELOG.md +19 -2
- {WsgiDAV-4.3.0/WsgiDAV.egg-info → WsgiDAV-4.3.2}/PKG-INFO +10 -5
- {WsgiDAV-4.3.0 → WsgiDAV-4.3.2}/README.md +2 -2
- {WsgiDAV-4.3.0 → WsgiDAV-4.3.2/WsgiDAV.egg-info}/PKG-INFO +10 -5
- WsgiDAV-4.3.2/pyproject.toml +71 -0
- {WsgiDAV-4.3.0 → WsgiDAV-4.3.2}/sample_wsgidav.yaml +5 -2
- {WsgiDAV-4.3.0 → WsgiDAV-4.3.2}/setup.cfg +1 -4
- {WsgiDAV-4.3.0 → WsgiDAV-4.3.2}/setup.py +0 -1
- {WsgiDAV-4.3.0 → WsgiDAV-4.3.2}/tests/test_http.py +0 -1
- {WsgiDAV-4.3.0 → WsgiDAV-4.3.2}/tests/test_litmus.py +3 -4
- {WsgiDAV-4.3.0 → WsgiDAV-4.3.2}/tests/test_lock_manager.py +8 -11
- {WsgiDAV-4.3.0 → WsgiDAV-4.3.2}/tests/test_property_manager.py +7 -10
- {WsgiDAV-4.3.0 → WsgiDAV-4.3.2}/tests/test_scripted.py +0 -1
- {WsgiDAV-4.3.0 → WsgiDAV-4.3.2}/tests/test_streaming.py +2 -3
- {WsgiDAV-4.3.0 → WsgiDAV-4.3.2}/tests/test_util.py +5 -6
- {WsgiDAV-4.3.0 → WsgiDAV-4.3.2}/tests/test_wsgidav_app.py +0 -1
- {WsgiDAV-4.3.0 → WsgiDAV-4.3.2}/wsgidav/__init__.py +2 -2
- {WsgiDAV-4.3.0 → WsgiDAV-4.3.2}/wsgidav/dav_error.py +13 -13
- {WsgiDAV-4.3.0 → WsgiDAV-4.3.2}/wsgidav/dav_provider.py +9 -10
- {WsgiDAV-4.3.0 → WsgiDAV-4.3.2}/wsgidav/dc/base_dc.py +3 -6
- {WsgiDAV-4.3.0 → WsgiDAV-4.3.2}/wsgidav/dc/nt_dc.py +7 -10
- {WsgiDAV-4.3.0 → WsgiDAV-4.3.2}/wsgidav/dc/pam_dc.py +1 -4
- {WsgiDAV-4.3.0 → WsgiDAV-4.3.2}/wsgidav/dc/simple_dc.py +4 -7
- {WsgiDAV-4.3.0 → WsgiDAV-4.3.2}/wsgidav/default_conf.py +3 -2
- {WsgiDAV-4.3.0 → WsgiDAV-4.3.2}/wsgidav/dir_browser/_dir_browser.py +4 -12
- {WsgiDAV-4.3.0 → WsgiDAV-4.3.2}/wsgidav/error_printer.py +5 -8
- {WsgiDAV-4.3.0 → WsgiDAV-4.3.2}/wsgidav/fs_dav_provider.py +5 -6
- {WsgiDAV-4.3.0 → WsgiDAV-4.3.2}/wsgidav/http_authenticator.py +20 -53
- {WsgiDAV-4.3.0 → WsgiDAV-4.3.2}/wsgidav/lock_man/lock_manager.py +16 -33
- {WsgiDAV-4.3.0 → WsgiDAV-4.3.2}/wsgidav/lock_man/lock_storage.py +8 -13
- {WsgiDAV-4.3.0 → WsgiDAV-4.3.2}/wsgidav/lock_man/lock_storage_redis.py +4 -7
- {WsgiDAV-4.3.0 → WsgiDAV-4.3.2}/wsgidav/mw/base_mw.py +2 -2
- {WsgiDAV-4.3.0 → WsgiDAV-4.3.2}/wsgidav/mw/cors.py +0 -1
- {WsgiDAV-4.3.0 → WsgiDAV-4.3.2}/wsgidav/mw/debug_filter.py +9 -16
- {WsgiDAV-4.3.0 → WsgiDAV-4.3.2}/wsgidav/prop_man/couch_property_manager.py +0 -1
- {WsgiDAV-4.3.0 → WsgiDAV-4.3.2}/wsgidav/prop_man/mongo_property_manager.py +1 -2
- {WsgiDAV-4.3.0 → WsgiDAV-4.3.2}/wsgidav/prop_man/property_manager.py +16 -27
- {WsgiDAV-4.3.0 → WsgiDAV-4.3.2}/wsgidav/request_resolver.py +3 -3
- {WsgiDAV-4.3.0 → WsgiDAV-4.3.2}/wsgidav/request_server.py +28 -39
- {WsgiDAV-4.3.0 → WsgiDAV-4.3.2}/wsgidav/rw_lock.py +0 -1
- WsgiDAV-4.3.2/wsgidav/samples/__init__.py +0 -0
- {WsgiDAV-4.3.0 → WsgiDAV-4.3.2}/wsgidav/samples/dav_provider_tools.py +1 -2
- {WsgiDAV-4.3.0 → WsgiDAV-4.3.2}/wsgidav/samples/hg_dav_provider.py +0 -1
- {WsgiDAV-4.3.0 → WsgiDAV-4.3.2}/wsgidav/samples/mongo_dav_provider.py +0 -1
- {WsgiDAV-4.3.0 → WsgiDAV-4.3.2}/wsgidav/samples/mysql_dav_provider.py +0 -1
- {WsgiDAV-4.3.0 → 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.0 → WsgiDAV-4.3.2}/wsgidav/server/ext_wsgiutils_server.py +16 -32
- {WsgiDAV-4.3.0 → WsgiDAV-4.3.2}/wsgidav/server/run_reloading_server.py +1 -2
- {WsgiDAV-4.3.0 → WsgiDAV-4.3.2}/wsgidav/server/server_cli.py +25 -20
- {WsgiDAV-4.3.0 → WsgiDAV-4.3.2}/wsgidav/server/server_sample.py +2 -3
- {WsgiDAV-4.3.0 → WsgiDAV-4.3.2}/wsgidav/stream_tools.py +2 -3
- {WsgiDAV-4.3.0 → WsgiDAV-4.3.2}/wsgidav/util.py +36 -42
- {WsgiDAV-4.3.0 → WsgiDAV-4.3.2}/wsgidav/wsgidav_app.py +8 -18
- {WsgiDAV-4.3.0 → WsgiDAV-4.3.2}/wsgidav/xml_tools.py +2 -8
- WsgiDAV-4.3.0/pyproject.toml +0 -29
- WsgiDAV-4.3.0/wsgidav/lock_man/__init__.py +0 -1
- WsgiDAV-4.3.0/wsgidav/prop_man/__init__.py +0 -1
- {WsgiDAV-4.3.0 → WsgiDAV-4.3.2}/LICENSE +0 -0
- {WsgiDAV-4.3.0 → WsgiDAV-4.3.2}/WsgiDAV.egg-info/SOURCES.txt +0 -0
- {WsgiDAV-4.3.0 → WsgiDAV-4.3.2}/WsgiDAV.egg-info/dependency_links.txt +0 -0
- {WsgiDAV-4.3.0 → WsgiDAV-4.3.2}/WsgiDAV.egg-info/entry_points.txt +0 -0
- {WsgiDAV-4.3.0 → WsgiDAV-4.3.2}/WsgiDAV.egg-info/not-zip-safe +0 -0
- {WsgiDAV-4.3.0 → WsgiDAV-4.3.2}/WsgiDAV.egg-info/requires.txt +0 -0
- {WsgiDAV-4.3.0 → WsgiDAV-4.3.2}/WsgiDAV.egg-info/top_level.txt +0 -0
- {WsgiDAV-4.3.0 → WsgiDAV-4.3.2}/wsgidav/dc/__init__.py +0 -0
- {WsgiDAV-4.3.0 → WsgiDAV-4.3.2}/wsgidav/dir_browser/__init__.py +0 -0
- {WsgiDAV-4.3.0 → WsgiDAV-4.3.2}/wsgidav/dir_browser/htdocs/favicon.ico +0 -0
- {WsgiDAV-4.3.0 → WsgiDAV-4.3.2}/wsgidav/dir_browser/htdocs/logo.png +0 -0
- {WsgiDAV-4.3.0 → WsgiDAV-4.3.2}/wsgidav/dir_browser/htdocs/script.js +0 -0
- {WsgiDAV-4.3.0 → WsgiDAV-4.3.2}/wsgidav/dir_browser/htdocs/style.css +0 -0
- {WsgiDAV-4.3.0 → WsgiDAV-4.3.2}/wsgidav/dir_browser/htdocs/template.html +0 -0
- {WsgiDAV-4.3.0/wsgidav/mw → WsgiDAV-4.3.2/wsgidav/lock_man}/__init__.py +0 -0
- {WsgiDAV-4.3.0/wsgidav/samples → WsgiDAV-4.3.2/wsgidav/mw}/__init__.py +0 -0
- {WsgiDAV-4.3.0/wsgidav/server → WsgiDAV-4.3.2/wsgidav/prop_man}/__init__.py +0 -0
|
@@ -1,6 +1,23 @@
|
|
|
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
|
|
13
|
+
|
|
14
|
+
- New option `suppress_version_info` to suppress WsgiDAV's version info in
|
|
15
|
+
responses (default: false).
|
|
16
|
+
- #298: `--root` argument honors `fs_dav_provider` configuration.
|
|
17
|
+
- #301: `_DAVResource` should have `is_link()` method to avoid dir_browser issues.
|
|
18
|
+
- #308: remove defusedxml dependency.
|
|
19
|
+
|
|
20
|
+
## 4.3.0 / 2023-09-24
|
|
4
21
|
|
|
5
22
|
- BREAKING:
|
|
6
23
|
- See option `fs_dav_provider.follow_symlinks` below.
|
|
@@ -17,7 +34,7 @@
|
|
|
17
34
|
[symlinks may be a security risk](https://serverfault.com/questions/244592/followsymlinks-on-apache-why-is-it-a-security-risk).<br>
|
|
18
35
|
File resources that are symlinks are still enumerated and listed by the
|
|
19
36
|
directory browser. However trying to access content will raise '403 Forbidden'
|
|
20
|
-
Pass _follow_symlinks=True_ to the FilesystemProvider constructor or yaml
|
|
37
|
+
Pass _follow_symlinks=True_ to the FilesystemProvider constructor or yaml configuration
|
|
21
38
|
to restore the previous behavior.
|
|
22
39
|
- Add `fs_dav_provider.shadow_map`, which can be used to blend in a favicon
|
|
23
40
|
when context is opened inline (#230)
|
|
@@ -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
|
|
@@ -37,15 +37,20 @@ Classifier: Topic :: Internet :: WWW/HTTP :: WSGI :: Application
|
|
|
37
37
|
Classifier: Topic :: Internet :: WWW/HTTP :: WSGI :: Server
|
|
38
38
|
Classifier: Topic :: Software Development :: Libraries :: Python Modules
|
|
39
39
|
Description-Content-Type: text/markdown
|
|
40
|
-
Provides-Extra: pam
|
|
41
40
|
License-File: LICENSE
|
|
41
|
+
Requires-Dist: defusedxml
|
|
42
|
+
Requires-Dist: Jinja2
|
|
43
|
+
Requires-Dist: json5
|
|
44
|
+
Requires-Dist: PyYAML
|
|
45
|
+
Provides-Extra: pam
|
|
46
|
+
Requires-Dist: python-pam; extra == "pam"
|
|
42
47
|
|
|
43
48
|
#  WsgiDAV
|
|
44
|
-
[](https://github.com/mar10/wsgidav/actions/workflows/tests.yml)
|
|
45
50
|
[](https://pypi.python.org/pypi/WsgiDAV/)
|
|
46
51
|
[](https://github.com/mar10/wsgidav/blob/master/LICENSE)
|
|
47
52
|
[](http://wsgidav.readthedocs.io/)
|
|
48
|
-
[](https://codecov.io/gh/mar10/wsgidav)
|
|
49
54
|
[](https://github.com/mar10/yabs)
|
|
50
55
|
[](https://stackoverflow.com/questions/tagged/WsgiDAV)
|
|
51
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
|
|
@@ -37,15 +37,20 @@ Classifier: Topic :: Internet :: WWW/HTTP :: WSGI :: Application
|
|
|
37
37
|
Classifier: Topic :: Internet :: WWW/HTTP :: WSGI :: Server
|
|
38
38
|
Classifier: Topic :: Software Development :: Libraries :: Python Modules
|
|
39
39
|
Description-Content-Type: text/markdown
|
|
40
|
-
Provides-Extra: pam
|
|
41
40
|
License-File: LICENSE
|
|
41
|
+
Requires-Dist: defusedxml
|
|
42
|
+
Requires-Dist: Jinja2
|
|
43
|
+
Requires-Dist: json5
|
|
44
|
+
Requires-Dist: PyYAML
|
|
45
|
+
Provides-Extra: pam
|
|
46
|
+
Requires-Dist: python-pam; extra == "pam"
|
|
42
47
|
|
|
43
48
|
#  WsgiDAV
|
|
44
|
-
[](https://github.com/mar10/wsgidav/actions/workflows/tests.yml)
|
|
45
50
|
[](https://pypi.python.org/pypi/WsgiDAV/)
|
|
46
51
|
[](https://github.com/mar10/wsgidav/blob/master/LICENSE)
|
|
47
52
|
[](http://wsgidav.readthedocs.io/)
|
|
48
|
-
[](https://codecov.io/gh/mar10/wsgidav)
|
|
49
54
|
[](https://github.com/mar10/yabs)
|
|
50
55
|
[](https://stackoverflow.com/questions/tagged/WsgiDAV)
|
|
51
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 = ''
|
|
@@ -135,7 +135,7 @@ provider_mapping:
|
|
|
135
135
|
path: '/path/to/share3'
|
|
136
136
|
another_arg: 42
|
|
137
137
|
|
|
138
|
-
#:
|
|
138
|
+
#: Additional configuration passed to `FilesystemProvider(..., fs_opts)`
|
|
139
139
|
fs_dav_provider:
|
|
140
140
|
#: Mapping from request URL to physical file location, e.g.
|
|
141
141
|
#: make sure that a `/favicon.ico` URL is resolved, even if a `*.html`
|
|
@@ -246,7 +246,7 @@ property_manager: null
|
|
|
246
246
|
|
|
247
247
|
#: Optional additional live property modification
|
|
248
248
|
#: Note: by default live properties like file size and last-modified time are
|
|
249
|
-
#: read-only, but that can be
|
|
249
|
+
#: read-only, but that can be overridden here if the underlying DAV provider
|
|
250
250
|
#: supports it. For now only the FileSystemProvider supports it and only namely
|
|
251
251
|
#: changes to the last-modified timestamp. Enable it with the mutable_live_props
|
|
252
252
|
#: list as below to allow clients to use the utime system call or e.g. the
|
|
@@ -288,6 +288,9 @@ lock_storage: true
|
|
|
288
288
|
#: Set verbosity level (can be overridden by -v or -q arguments)
|
|
289
289
|
verbose: 3
|
|
290
290
|
|
|
291
|
+
#: Suppress version info in HTTP response headers and error responses
|
|
292
|
+
suppress_version_info: false
|
|
293
|
+
|
|
291
294
|
logging:
|
|
292
295
|
#: Enable logging when using wsgidav in library mode (always on, when running as CLI)
|
|
293
296
|
enable: null
|
|
@@ -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,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
|
|
@@ -104,7 +103,7 @@ class WsgiDAVLitmusTest(unittest.TestCase):
|
|
|
104
103
|
raise unittest.SkipTest(f"Test requires litmus test suite{extra}")
|
|
105
104
|
|
|
106
105
|
def test_litmus_with_authentication(self):
|
|
107
|
-
"""Run litmus test suite on HTTP with
|
|
106
|
+
"""Run litmus test suite on HTTP with authentication."""
|
|
108
107
|
with WsgiDavTestServer(with_auth=True, with_ssl=False):
|
|
109
108
|
try:
|
|
110
109
|
res = subprocess.call(
|
|
@@ -117,7 +116,7 @@ class WsgiDAVLitmusTest(unittest.TestCase):
|
|
|
117
116
|
return
|
|
118
117
|
|
|
119
118
|
def test_litmus_anonymous(self):
|
|
120
|
-
"""Run litmus test suite on HTTP with
|
|
119
|
+
"""Run litmus test suite on HTTP with authentication."""
|
|
121
120
|
with WsgiDavTestServer(with_auth=False, with_ssl=False):
|
|
122
121
|
try:
|
|
123
122
|
res = subprocess.call(["litmus", "http://127.0.0.1:8080/"])
|
|
@@ -128,7 +127,7 @@ class WsgiDAVLitmusTest(unittest.TestCase):
|
|
|
128
127
|
return
|
|
129
128
|
|
|
130
129
|
def test_litmus_with_ssl_and_authentication(self):
|
|
131
|
-
"""Run litmus test suite on SSL / HTTPS with
|
|
130
|
+
"""Run litmus test suite on SSL / HTTPS with authentication."""
|
|
132
131
|
with WsgiDavTestServer(with_auth=True, with_ssl=True):
|
|
133
132
|
try:
|
|
134
133
|
res = subprocess.call(
|
|
@@ -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
|
|
@@ -53,7 +52,7 @@ class MockProxyResource(DAVNonCollection):
|
|
|
53
52
|
# print("begin_write: {}".format(self.target_path))
|
|
54
53
|
queue = FileLikeQueue(max_size=1)
|
|
55
54
|
|
|
56
|
-
# Simulate an
|
|
55
|
+
# Simulate an asynchronous consumer. We use a file, so we can check
|
|
57
56
|
# the result from the parent unittest process. In real live this could be
|
|
58
57
|
# requests.post(..., data=queue), ...
|
|
59
58
|
def _consumer():
|
|
@@ -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,12 +226,12 @@ 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 == ""
|
|
234
233
|
# The library logger should default to INFO level
|
|
235
|
-
# (this output will not be
|
|
234
|
+
# (this output will not be visible, because the base logger only has a NullHandler)
|
|
236
235
|
assert ".debug" not in baseOutput
|
|
237
236
|
assert ".info" in baseOutput
|
|
238
237
|
assert ".warning" in baseOutput
|
|
@@ -251,12 +250,12 @@ 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
|
|
258
257
|
# The library logger should default to INFO level
|
|
259
|
-
# (this output will not be
|
|
258
|
+
# (this output will not be visible, because the base logger only has a NullHandler)
|
|
260
259
|
assert ".debug" not in baseOutput
|
|
261
260
|
assert ".info" in baseOutput
|
|
262
261
|
assert ".warning" in 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:
|
|
@@ -9,7 +8,7 @@ Implements a DAVError class that is used to signal WebDAV and HTTP errors.
|
|
|
9
8
|
import datetime
|
|
10
9
|
from html import escape as html_escape
|
|
11
10
|
|
|
12
|
-
from wsgidav import
|
|
11
|
+
from wsgidav import util, xml_tools
|
|
13
12
|
from wsgidav.xml_tools import etree
|
|
14
13
|
|
|
15
14
|
__docformat__ = "reStructuredText"
|
|
@@ -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,14 +247,15 @@ 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
|
-
"<a href='https://github.com/mar10/wsgidav/'>
|
|
258
|
-
|
|
256
|
+
"<a href='https://github.com/mar10/wsgidav/'>{}</a> - {}".format(
|
|
257
|
+
util.public_wsgidav_info,
|
|
258
|
+
html_escape(str(datetime.datetime.now()), "utf-8"),
|
|
259
259
|
)
|
|
260
260
|
)
|
|
261
261
|
html.append("</body></html>")
|
|
@@ -280,7 +280,7 @@ def get_http_status_string(v):
|
|
|
280
280
|
try:
|
|
281
281
|
return ERROR_DESCRIPTIONS[code]
|
|
282
282
|
except KeyError:
|
|
283
|
-
return "{} Status"
|
|
283
|
+
return f"{code} Status"
|
|
284
284
|
|
|
285
285
|
|
|
286
286
|
def get_response_page(v):
|
|
@@ -296,4 +296,4 @@ def as_DAVError(e):
|
|
|
296
296
|
# traceback.print_exc()
|
|
297
297
|
return DAVError(HTTP_INTERNAL_ERROR, src_exception=e)
|
|
298
298
|
else:
|
|
299
|
-
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:
|
|
@@ -84,7 +83,6 @@ import sys
|
|
|
84
83
|
import time
|
|
85
84
|
import traceback
|
|
86
85
|
from abc import ABC, abstractmethod
|
|
87
|
-
from datetime import datetime
|
|
88
86
|
from typing import Optional
|
|
89
87
|
from urllib.parse import quote, unquote
|
|
90
88
|
|
|
@@ -220,7 +218,7 @@ class _DAVResource(ABC):
|
|
|
220
218
|
return None
|
|
221
219
|
raise NotImplementedError
|
|
222
220
|
|
|
223
|
-
def get_creation_date(self) -> Optional[
|
|
221
|
+
def get_creation_date(self) -> Optional[float]:
|
|
224
222
|
"""Records the time and date the resource was created.
|
|
225
223
|
|
|
226
224
|
The creationdate property should be defined on all DAV compliant
|
|
@@ -269,7 +267,7 @@ class _DAVResource(ABC):
|
|
|
269
267
|
elif os.extsep in self.name:
|
|
270
268
|
ext = self.name.split(os.extsep)[-1].upper()
|
|
271
269
|
if len(ext) < 5:
|
|
272
|
-
return {"type": "{}-File"
|
|
270
|
+
return {"type": f"{ext}-File"}
|
|
273
271
|
return {"type": "File"}
|
|
274
272
|
|
|
275
273
|
def get_etag(self):
|
|
@@ -313,6 +311,9 @@ class _DAVResource(ABC):
|
|
|
313
311
|
"""
|
|
314
312
|
return None
|
|
315
313
|
|
|
314
|
+
def is_link(self):
|
|
315
|
+
return False
|
|
316
|
+
|
|
316
317
|
def set_last_modified(self, dest_path, time_stamp, *, dry_run):
|
|
317
318
|
"""Set last modified time for destPath to timeStamp on epoch-format"""
|
|
318
319
|
raise NotImplementedError
|
|
@@ -388,7 +389,7 @@ class _DAVResource(ABC):
|
|
|
388
389
|
return quote(self.provider.share_path + self.get_preferred_path())
|
|
389
390
|
|
|
390
391
|
# def getRefKey(self):
|
|
391
|
-
# """Return an
|
|
392
|
+
# """Return an unambiguous identifier string for a resource.
|
|
392
393
|
#
|
|
393
394
|
# Since it is always unique for one resource, <refKey> is used as key for
|
|
394
395
|
# the lock- and property storage dictionaries.
|
|
@@ -818,16 +819,14 @@ class _DAVResource(ABC):
|
|
|
818
819
|
)
|
|
819
820
|
except Exception:
|
|
820
821
|
_logger.warning(
|
|
821
|
-
"Provider does not support set_last_modified on {}."
|
|
822
|
-
self.path
|
|
823
|
-
)
|
|
822
|
+
f"Provider does not support set_last_modified on {self.path}."
|
|
824
823
|
)
|
|
825
824
|
|
|
826
825
|
# Unsupported or not allowed
|
|
827
826
|
raise DAVError(HTTP_FORBIDDEN)
|
|
828
827
|
|
|
829
828
|
# Handle MS Windows Win32LastModifiedTime, if enabled.
|
|
830
|
-
# Note that the WebDAV client in Win7 and
|
|
829
|
+
# Note that the WebDAV client in Win7 and earlier has issues and can't be used
|
|
831
830
|
# with this so we ignore older clients. Others pre-Win10 should be tested.
|
|
832
831
|
if name.startswith("{urn:schemas-microsoft-com:}"):
|
|
833
832
|
agent = self.environ.get("HTTP_USER_AGENT", "None")
|
|
@@ -1097,7 +1096,7 @@ class _DAVResource(ABC):
|
|
|
1097
1096
|
- Live properties should be moved too (e.g. creationdate)
|
|
1098
1097
|
- Non-collections must be moved, not copied
|
|
1099
1098
|
- For collections, this function behaves like in copy-mode:
|
|
1100
|
-
|
|
1099
|
+
destination collection must be created and properties are copied.
|
|
1101
1100
|
Members are NOT created.
|
|
1102
1101
|
The source collection MUST NOT be removed.
|
|
1103
1102
|
|