txhttputil 1.2.12__tar.gz → 1.3.0__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.
- txhttputil-1.3.0/PKG-INFO +18 -0
- txhttputil-1.3.0/pyproject.toml +41 -0
- txhttputil-1.3.0/txhttputil/__init__.py +3 -0
- {txhttputil-1.2.12 → txhttputil-1.3.0}/txhttputil/site/FileUploadRequest.py +11 -2
- {txhttputil-1.2.12 → txhttputil-1.3.0}/txhttputil/site/StaticFileResource.py +5 -0
- txhttputil-1.3.0/txhttputil.egg-info/PKG-INFO +18 -0
- {txhttputil-1.2.12 → txhttputil-1.3.0}/txhttputil.egg-info/SOURCES.txt +1 -1
- txhttputil-1.3.0/txhttputil.egg-info/requires.txt +8 -0
- txhttputil-1.2.12/PKG-INFO +0 -11
- txhttputil-1.2.12/setup.py +0 -41
- txhttputil-1.2.12/txhttputil/__init__.py +0 -3
- txhttputil-1.2.12/txhttputil.egg-info/PKG-INFO +0 -11
- txhttputil-1.2.12/txhttputil.egg-info/requires.txt +0 -8
- {txhttputil-1.2.12 → txhttputil-1.3.0}/LICENSE +0 -0
- {txhttputil-1.2.12 → txhttputil-1.3.0}/README.md +0 -0
- {txhttputil-1.2.12 → txhttputil-1.3.0}/setup.cfg +0 -0
- {txhttputil-1.2.12 → txhttputil-1.3.0}/txhttputil/downloader/HttpFileDownloader.py +0 -0
- {txhttputil-1.2.12 → txhttputil-1.3.0}/txhttputil/downloader/HttpResourceProxy.py +0 -0
- {txhttputil-1.2.12 → txhttputil-1.3.0}/txhttputil/downloader/__init__.py +0 -0
- {txhttputil-1.2.12 → txhttputil-1.3.0}/txhttputil/login_page/LoginElement.py +0 -0
- {txhttputil-1.2.12 → txhttputil-1.3.0}/txhttputil/login_page/LoginTemplate.xml +0 -0
- {txhttputil-1.2.12 → txhttputil-1.3.0}/txhttputil/login_page/__init__.py +0 -0
- {txhttputil-1.2.12 → txhttputil-1.3.0}/txhttputil/site/AuthCredentials.py +0 -0
- {txhttputil-1.2.12 → txhttputil-1.3.0}/txhttputil/site/AuthResource.py +0 -0
- {txhttputil-1.2.12 → txhttputil-1.3.0}/txhttputil/site/AuthSessionWrapper.py +0 -0
- {txhttputil-1.2.12 → txhttputil-1.3.0}/txhttputil/site/AuthUserDetails.py +0 -0
- {txhttputil-1.2.12 → txhttputil-1.3.0}/txhttputil/site/BasicResource.py +0 -0
- {txhttputil-1.2.12 → txhttputil-1.3.0}/txhttputil/site/FileUnderlayResource.py +0 -0
- {txhttputil-1.2.12 → txhttputil-1.3.0}/txhttputil/site/FileUnderlayResourceTest.py +0 -0
- {txhttputil-1.2.12 → txhttputil-1.3.0}/txhttputil/site/RedirectToHttpsResource.py +0 -0
- {txhttputil-1.2.12 → txhttputil-1.3.0}/txhttputil/site/RedirectionRule.py +0 -0
- {txhttputil-1.2.12 → txhttputil-1.3.0}/txhttputil/site/ResourceCreator.py +0 -0
- {txhttputil-1.2.12 → txhttputil-1.3.0}/txhttputil/site/RootResource.py +0 -0
- {txhttputil-1.2.12 → txhttputil-1.3.0}/txhttputil/site/RootSiteTest.py +0 -0
- {txhttputil-1.2.12 → txhttputil-1.3.0}/txhttputil/site/SiteUtil.py +0 -0
- {txhttputil-1.2.12 → txhttputil-1.3.0}/txhttputil/site/__init__.py +0 -0
- {txhttputil-1.2.12 → txhttputil-1.3.0}/txhttputil/util/DeferUtil.py +0 -0
- {txhttputil-1.2.12 → txhttputil-1.3.0}/txhttputil/util/ModuleUtil.py +0 -0
- {txhttputil-1.2.12 → txhttputil-1.3.0}/txhttputil/util/PemUtil.py +0 -0
- {txhttputil-1.2.12 → txhttputil-1.3.0}/txhttputil/util/SslUtil.py +0 -0
- {txhttputil-1.2.12 → txhttputil-1.3.0}/txhttputil/util/__init__.py +0 -0
- {txhttputil-1.2.12 → txhttputil-1.3.0}/txhttputil.egg-info/dependency_links.txt +0 -0
- {txhttputil-1.2.12 → txhttputil-1.3.0}/txhttputil.egg-info/top_level.txt +0 -0
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
Metadata-Version: 2.1
|
|
2
|
+
Name: txhttputil
|
|
3
|
+
Version: 1.3.0
|
|
4
|
+
Summary: Synerty utility classes for serving a static site with twisted.web with user permissions.
|
|
5
|
+
Author-email: Synerty <contact@synerty.com>
|
|
6
|
+
Project-URL: Homepage, https://github.com/Synerty/txhttputil
|
|
7
|
+
Project-URL: Download, https://github.com/Synerty/txhttputil/tarball/1.2.11
|
|
8
|
+
Keywords: twisted,resource,file,download,synerty
|
|
9
|
+
Classifier: Programming Language :: Python :: 3.9
|
|
10
|
+
License-File: LICENSE
|
|
11
|
+
Requires-Dist: pytz
|
|
12
|
+
Requires-Dist: txwebsocket>=1.0.1
|
|
13
|
+
Requires-Dist: filetype
|
|
14
|
+
Requires-Dist: pem
|
|
15
|
+
Requires-Dist: pytmpdir
|
|
16
|
+
Requires-Dist: treelib>=1.6.4
|
|
17
|
+
Requires-Dist: cryptography
|
|
18
|
+
Requires-Dist: pyOpenSSL
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
[build-system]
|
|
2
|
+
requires = ["setuptools>=61.2"]
|
|
3
|
+
build-backend = "setuptools.build_meta"
|
|
4
|
+
|
|
5
|
+
[project]
|
|
6
|
+
name = "txhttputil"
|
|
7
|
+
version = "1.3.0"
|
|
8
|
+
authors = [{name = "Synerty", email = "contact@synerty.com"}]
|
|
9
|
+
description = "Synerty utility classes for serving a static site with twisted.web with user permissions."
|
|
10
|
+
keywords = [
|
|
11
|
+
"twisted",
|
|
12
|
+
"resource",
|
|
13
|
+
"file",
|
|
14
|
+
"download",
|
|
15
|
+
"synerty",
|
|
16
|
+
]
|
|
17
|
+
classifiers = ["Programming Language :: Python :: 3.9"]
|
|
18
|
+
dependencies = [
|
|
19
|
+
"pytz",
|
|
20
|
+
"txwebsocket>=1.0.1",
|
|
21
|
+
"filetype",
|
|
22
|
+
"pem",
|
|
23
|
+
"pytmpdir",
|
|
24
|
+
"treelib>=1.6.4",
|
|
25
|
+
"cryptography",
|
|
26
|
+
"pyOpenSSL",
|
|
27
|
+
]
|
|
28
|
+
|
|
29
|
+
[project.urls]
|
|
30
|
+
Homepage = "https://github.com/Synerty/txhttputil"
|
|
31
|
+
Download = "https://github.com/Synerty/txhttputil/tarball/1.2.11"
|
|
32
|
+
|
|
33
|
+
[tool.setuptools]
|
|
34
|
+
packages = [
|
|
35
|
+
"txhttputil",
|
|
36
|
+
"txhttputil.downloader",
|
|
37
|
+
"txhttputil.login_page",
|
|
38
|
+
"txhttputil.site",
|
|
39
|
+
"txhttputil.util",
|
|
40
|
+
]
|
|
41
|
+
include-package-data = false
|
|
@@ -10,7 +10,6 @@ import logging
|
|
|
10
10
|
import os
|
|
11
11
|
from urllib.parse import parse_qs
|
|
12
12
|
|
|
13
|
-
from twisted.web.http import _parseHeader
|
|
14
13
|
|
|
15
14
|
from pytmpdir.spooled_named_temporary_file import (
|
|
16
15
|
SpooledNamedTemporaryFile,
|
|
@@ -95,7 +94,7 @@ class FileUploadRequest(server.Request):
|
|
|
95
94
|
|
|
96
95
|
if self.method == b"POST" and ctype and clength:
|
|
97
96
|
mfd = b"multipart/form-data"
|
|
98
|
-
key, pdict = _parseHeader(ctype)
|
|
97
|
+
key, pdict = self._parseHeader(ctype)
|
|
99
98
|
# This weird CONTENT-LENGTH param is required by
|
|
100
99
|
# cgi.parse_multipart() in some versions of Python 3.7+, see
|
|
101
100
|
# bpo-29979. It looks like this will be relaxed and backported, see
|
|
@@ -241,3 +240,13 @@ class FileUploadRequest(server.Request):
|
|
|
241
240
|
|
|
242
241
|
fp.seek(rewind) # restore cursor
|
|
243
242
|
return partdict
|
|
243
|
+
|
|
244
|
+
def _parseHeader(self, line):
|
|
245
|
+
# cgi.parse_header requires a str
|
|
246
|
+
key, pdict = cgi.parse_header(line.decode("charmap"))
|
|
247
|
+
|
|
248
|
+
# We want the key as bytes, and cgi.parse_multipart (which consumes
|
|
249
|
+
# pdict) expects a dict of str keys but bytes values
|
|
250
|
+
key = key.encode("charmap")
|
|
251
|
+
pdict = {x: y.encode("charmap") for x, y in pdict.items()}
|
|
252
|
+
return (key, pdict)
|
|
@@ -34,6 +34,7 @@ class StaticFileResource(BasicResource):
|
|
|
34
34
|
|
|
35
35
|
__STATIC_MIME_TYPES = [
|
|
36
36
|
(".js.map", "application/json"),
|
|
37
|
+
(".css.map", "application/json"),
|
|
37
38
|
(".js", "application/javascript"),
|
|
38
39
|
]
|
|
39
40
|
|
|
@@ -61,6 +62,10 @@ class StaticFileResource(BasicResource):
|
|
|
61
62
|
pathname2url(filePath), strict=False
|
|
62
63
|
)[0]
|
|
63
64
|
|
|
65
|
+
if self._mimetype is None:
|
|
66
|
+
# fallback to arbitrary binary data
|
|
67
|
+
self._mimetype = "application/octet-stream"
|
|
68
|
+
|
|
64
69
|
assert self._mimetype, "Unknown mime type for: %s" % filePath
|
|
65
70
|
|
|
66
71
|
def render_GET(self, request):
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
Metadata-Version: 2.1
|
|
2
|
+
Name: txhttputil
|
|
3
|
+
Version: 1.3.0
|
|
4
|
+
Summary: Synerty utility classes for serving a static site with twisted.web with user permissions.
|
|
5
|
+
Author-email: Synerty <contact@synerty.com>
|
|
6
|
+
Project-URL: Homepage, https://github.com/Synerty/txhttputil
|
|
7
|
+
Project-URL: Download, https://github.com/Synerty/txhttputil/tarball/1.2.11
|
|
8
|
+
Keywords: twisted,resource,file,download,synerty
|
|
9
|
+
Classifier: Programming Language :: Python :: 3.9
|
|
10
|
+
License-File: LICENSE
|
|
11
|
+
Requires-Dist: pytz
|
|
12
|
+
Requires-Dist: txwebsocket>=1.0.1
|
|
13
|
+
Requires-Dist: filetype
|
|
14
|
+
Requires-Dist: pem
|
|
15
|
+
Requires-Dist: pytmpdir
|
|
16
|
+
Requires-Dist: treelib>=1.6.4
|
|
17
|
+
Requires-Dist: cryptography
|
|
18
|
+
Requires-Dist: pyOpenSSL
|
txhttputil-1.2.12/PKG-INFO
DELETED
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
Metadata-Version: 2.1
|
|
2
|
-
Name: txhttputil
|
|
3
|
-
Version: 1.2.12
|
|
4
|
-
Summary: Synerty utility classes for serving a static site with twisted.web with user permissions.
|
|
5
|
-
Home-page: https://github.com/Synerty/txhttputil
|
|
6
|
-
Download-URL: https://github.com/Synerty/txhttputil/tarball/1.2.12
|
|
7
|
-
Author: Synerty
|
|
8
|
-
Author-email: contact@synerty.com
|
|
9
|
-
Keywords: twisted,resource,file,download,synerty
|
|
10
|
-
Classifier: Programming Language :: Python :: 3.9
|
|
11
|
-
License-File: LICENSE
|
txhttputil-1.2.12/setup.py
DELETED
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
from setuptools import setup
|
|
2
|
-
|
|
3
|
-
package_name = "txhttputil"
|
|
4
|
-
package_version = '1.2.12'
|
|
5
|
-
|
|
6
|
-
requirements = [
|
|
7
|
-
"pytz",
|
|
8
|
-
"txwebsocket>=1.0.1",
|
|
9
|
-
"filetype",
|
|
10
|
-
"pem",
|
|
11
|
-
"pytmpdir",
|
|
12
|
-
"treelib>=1.6.1,<2.0",
|
|
13
|
-
"cryptography < 38.0.0", # PEEK-1777
|
|
14
|
-
"pyOpenSSL <= 19.1.0", # PEEK-1136 PEEK-2065
|
|
15
|
-
]
|
|
16
|
-
|
|
17
|
-
setup(
|
|
18
|
-
name="txhttputil",
|
|
19
|
-
packages=[
|
|
20
|
-
"txhttputil",
|
|
21
|
-
"txhttputil.downloader",
|
|
22
|
-
"txhttputil.login_page",
|
|
23
|
-
"txhttputil.site",
|
|
24
|
-
"txhttputil.util",
|
|
25
|
-
],
|
|
26
|
-
package_data={"txhttputil.login_page": ["*.xml"]},
|
|
27
|
-
version=package_version,
|
|
28
|
-
install_requires=requirements,
|
|
29
|
-
description="Synerty utility classes for serving a static site with twisted.web with user permissions.",
|
|
30
|
-
author="Synerty",
|
|
31
|
-
author_email="contact@synerty.com",
|
|
32
|
-
url="https://github.com/Synerty/txhttputil",
|
|
33
|
-
download_url=(
|
|
34
|
-
"https://github.com/Synerty/%s/tarball/%s"
|
|
35
|
-
% (package_name, package_version)
|
|
36
|
-
),
|
|
37
|
-
keywords=["twisted", "resource", "file", "download", "synerty"],
|
|
38
|
-
classifiers=[
|
|
39
|
-
"Programming Language :: Python :: 3.9",
|
|
40
|
-
],
|
|
41
|
-
)
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
Metadata-Version: 2.1
|
|
2
|
-
Name: txhttputil
|
|
3
|
-
Version: 1.2.12
|
|
4
|
-
Summary: Synerty utility classes for serving a static site with twisted.web with user permissions.
|
|
5
|
-
Home-page: https://github.com/Synerty/txhttputil
|
|
6
|
-
Download-URL: https://github.com/Synerty/txhttputil/tarball/1.2.12
|
|
7
|
-
Author: Synerty
|
|
8
|
-
Author-email: contact@synerty.com
|
|
9
|
-
Keywords: twisted,resource,file,download,synerty
|
|
10
|
-
Classifier: Programming Language :: Python :: 3.9
|
|
11
|
-
License-File: LICENSE
|
|
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
|