PoorWSGI 2.7.0__tar.gz → 2.8.1__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 (78) hide show
  1. poorwsgi-2.8.1/CONTRIBUTION.rst +113 -0
  2. {poorwsgi-2.7.0 → poorwsgi-2.8.1}/PKG-INFO +29 -10
  3. {poorwsgi-2.7.0 → poorwsgi-2.8.1}/PoorWSGI.egg-info/PKG-INFO +29 -10
  4. {poorwsgi-2.7.0 → poorwsgi-2.8.1}/PoorWSGI.egg-info/SOURCES.txt +12 -0
  5. {poorwsgi-2.7.0 → poorwsgi-2.8.1}/README.rst +10 -6
  6. {poorwsgi-2.7.0 → poorwsgi-2.8.1}/doc/ChangeLog +45 -0
  7. {poorwsgi-2.7.0 → poorwsgi-2.8.1}/doc/_poorwsgi_api.html +1 -0
  8. poorwsgi-2.8.1/doc/about.rst +111 -0
  9. poorwsgi-2.8.1/doc/documentation.rst +1475 -0
  10. poorwsgi-2.8.1/examples/aes_session.py +155 -0
  11. {poorwsgi-2.7.0 → poorwsgi-2.8.1}/examples/http_digest.py +15 -15
  12. {poorwsgi-2.7.0 → poorwsgi-2.8.1}/examples/large_file.py +25 -26
  13. {poorwsgi-2.7.0 → poorwsgi-2.8.1}/examples/metrics.py +7 -7
  14. {poorwsgi-2.7.0 → poorwsgi-2.8.1}/examples/openapi3.py +33 -26
  15. poorwsgi-2.8.1/examples/poor_session.py +150 -0
  16. {poorwsgi-2.7.0 → poorwsgi-2.8.1}/examples/put_file.py +6 -6
  17. poorwsgi-2.8.1/examples/response_closed.py +42 -0
  18. poorwsgi-2.8.1/examples/session.py +161 -0
  19. {poorwsgi-2.7.0 → poorwsgi-2.8.1}/examples/simple.py +47 -92
  20. {poorwsgi-2.7.0 → poorwsgi-2.8.1}/examples/simple_json.py +10 -10
  21. {poorwsgi-2.7.0 → poorwsgi-2.8.1}/examples/websocket.py +14 -14
  22. poorwsgi-2.8.1/poorwsgi/__init__.py +28 -0
  23. poorwsgi-2.8.1/poorwsgi/aes_session.py +165 -0
  24. {poorwsgi-2.7.0 → poorwsgi-2.8.1}/poorwsgi/digest.py +32 -29
  25. {poorwsgi-2.7.0 → poorwsgi-2.8.1}/poorwsgi/fieldstorage.py +157 -140
  26. {poorwsgi-2.7.0 → poorwsgi-2.8.1}/poorwsgi/headers.py +62 -59
  27. {poorwsgi-2.7.0 → poorwsgi-2.8.1}/poorwsgi/openapi_wrapper.py +20 -19
  28. poorwsgi-2.8.1/poorwsgi/request.py +1121 -0
  29. {poorwsgi-2.7.0 → poorwsgi-2.8.1}/poorwsgi/response.py +426 -302
  30. {poorwsgi-2.7.0 → poorwsgi-2.8.1}/poorwsgi/results.py +310 -215
  31. poorwsgi-2.8.1/poorwsgi/session.py +503 -0
  32. {poorwsgi-2.7.0 → poorwsgi-2.8.1}/poorwsgi/state.py +5 -4
  33. {poorwsgi-2.7.0 → poorwsgi-2.8.1}/poorwsgi/wsgi.py +501 -391
  34. poorwsgi-2.8.1/pyproject.toml +145 -0
  35. {poorwsgi-2.7.0 → poorwsgi-2.8.1}/setup.py +4 -5
  36. poorwsgi-2.8.1/tests/test_aes_session.py +174 -0
  37. poorwsgi-2.8.1/tests/test_application_error.py +40 -0
  38. poorwsgi-2.8.1/tests/test_digest.py +632 -0
  39. poorwsgi-2.8.1/tests/test_fieldstorage.py +1081 -0
  40. poorwsgi-2.8.1/tests/test_header.py +81 -0
  41. poorwsgi-2.8.1/tests/test_headers.py +242 -0
  42. poorwsgi-2.8.1/tests/test_request.py +1311 -0
  43. poorwsgi-2.8.1/tests/test_responses.py +1309 -0
  44. poorwsgi-2.8.1/tests/test_results.py +767 -0
  45. poorwsgi-2.8.1/tests/test_route_validation.py +228 -0
  46. poorwsgi-2.8.1/tests/test_session.py +501 -0
  47. poorwsgi-2.7.0/CONTRIBUTION.rst +0 -36
  48. poorwsgi-2.7.0/doc/about.rst +0 -111
  49. poorwsgi-2.7.0/doc/documentation.rst +0 -1327
  50. poorwsgi-2.7.0/poorwsgi/__init__.py +0 -26
  51. poorwsgi-2.7.0/poorwsgi/request.py +0 -1024
  52. poorwsgi-2.7.0/poorwsgi/session.py +0 -312
  53. poorwsgi-2.7.0/tests/test_digest.py +0 -98
  54. poorwsgi-2.7.0/tests/test_header.py +0 -67
  55. poorwsgi-2.7.0/tests/test_request.py +0 -353
  56. poorwsgi-2.7.0/tests/test_responses.py +0 -573
  57. poorwsgi-2.7.0/tests/test_session.py +0 -164
  58. {poorwsgi-2.7.0 → poorwsgi-2.8.1}/MANIFEST.in +0 -0
  59. {poorwsgi-2.7.0 → poorwsgi-2.8.1}/PoorWSGI.egg-info/dependency_links.txt +0 -0
  60. {poorwsgi-2.7.0 → poorwsgi-2.8.1}/PoorWSGI.egg-info/requires.txt +0 -0
  61. {poorwsgi-2.7.0 → poorwsgi-2.8.1}/PoorWSGI.egg-info/top_level.txt +0 -0
  62. {poorwsgi-2.7.0 → poorwsgi-2.8.1}/doc/_documentation.html +0 -0
  63. {poorwsgi-2.7.0 → poorwsgi-2.8.1}/doc/_footer.html +0 -0
  64. {poorwsgi-2.7.0 → poorwsgi-2.8.1}/doc/_header.html +0 -0
  65. {poorwsgi-2.7.0 → poorwsgi-2.8.1}/doc/_install.html +0 -0
  66. {poorwsgi-2.7.0 → poorwsgi-2.8.1}/doc/_licence.html +0 -0
  67. {poorwsgi-2.7.0 → poorwsgi-2.8.1}/doc/_poorwsgi.html +0 -0
  68. {poorwsgi-2.7.0 → poorwsgi-2.8.1}/doc/_reference.html +0 -0
  69. {poorwsgi-2.7.0 → poorwsgi-2.8.1}/doc/_text.html +0 -0
  70. {poorwsgi-2.7.0 → poorwsgi-2.8.1}/doc/install.rst +0 -0
  71. {poorwsgi-2.7.0 → poorwsgi-2.8.1}/doc/licence.txt +0 -0
  72. {poorwsgi-2.7.0 → poorwsgi-2.8.1}/doc/small-logo.png +0 -0
  73. {poorwsgi-2.7.0 → poorwsgi-2.8.1}/doc/style.css +0 -0
  74. {poorwsgi-2.7.0 → poorwsgi-2.8.1}/doc/web.css +0 -0
  75. {poorwsgi-2.7.0 → poorwsgi-2.8.1}/examples/openapi.json +0 -0
  76. {poorwsgi-2.7.0 → poorwsgi-2.8.1}/examples/test.digest +0 -0
  77. {poorwsgi-2.7.0 → poorwsgi-2.8.1}/poorwsgi/py.typed +0 -0
  78. {poorwsgi-2.7.0 → poorwsgi-2.8.1}/setup.cfg +0 -0
@@ -0,0 +1,113 @@
1
+ Contributing to the Project
2
+ ===========================
3
+
4
+ Thank you for your interest in contributing to the PoorWSGI project! Every contribution is welcome. This document will guide you through the process of reporting a bug, suggesting an enhancement, or directly contributing code.
5
+
6
+ Reporting Bugs
7
+ --------------
8
+ If you encounter a bug, please ensure that you:
9
+
10
+ 1. Search the existing `issues <https://github.com/PoorHttp/PoorWSGI/issues>`_ to ensure the bug has not already been reported.
11
+ 2. If you cannot find the bug, create a new issue.
12
+ 3. In the description, provide as much information as possible:
13
+
14
+ * The version of PoorWSGI you are using.
15
+ * The Python version and operating system.
16
+ * A short but descriptive summary of the bug.
17
+ * Steps to reproduce the bug.
18
+ * What you expected to happen and what actually happened.
19
+
20
+ Suggesting Enhancements
21
+ -----------------------
22
+ Do you have an idea for a new feature or improvement?
23
+
24
+ 1. Create a new issue and describe your suggestion.
25
+ 2. Explain why this feature would be useful and how it should work.
26
+
27
+ Development and Code Contribution
28
+ ---------------------------------
29
+ If you want to contribute code, please follow these steps. The project is developed using a **Test-Driven Development (TDD)** approach. This means that for every new feature or bug fix, a failing test should be written first, followed by the code that makes the test pass.
30
+
31
+ 1. Setting Up the Development Environment
32
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
33
+
34
+ First, prepare your local development environment.
35
+
36
+ .. code-block:: bash
37
+
38
+ # 1. Fork the repository and clone it
39
+ git clone https://github.com/YOUR-USERNAME/PoorWSGI.git
40
+ cd PoorWSGI
41
+
42
+ # 2. Create and activate a virtual environment
43
+ python3 -m venv .venv
44
+ source .venv/bin/activate
45
+
46
+ # 3. Install the project in editable mode and the development dependencies
47
+ python -m pip install --upgrade pip
48
+ pip install -e .
49
+ pip install -U pre-commit flake8 setuptools pytest pytest-doctestplus pytest-pylint pytest-mypy ruff isort
50
+ pip install -U openapi-core uwsgi simplejson WSocket requests websocket-client
51
+ pip install -U types-simplejson types-requests types-PyYAML
52
+
53
+ # 4. Activate pre-commit hooks for automatic code checking
54
+ pre-commit install
55
+
56
+ 2. Code Style and Automatic Checks (pre-commit)
57
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
58
+
59
+ To maintain a consistent style and code quality, the project **requires the use of `pre-commit`**. This tool automatically runs a set of checks (called "hooks") before each commit. These checks include formatting, linting, and other code analyses. The configuration is defined in the `.pre-commit-config.yaml` file.
60
+
61
+ Thanks to `pre-commit`, you don't have to run all the tools manually. If a commit fails due to a check, `pre-commit` will often fix the code for you automatically. In that case, you just need to add the modified files again (`git add`) and repeat the commit.
62
+
63
+ If you still wish to run the checks manually during development (outside of a commit), you can use the following commands:
64
+
65
+ .. code-block:: bash
66
+
67
+ # Manually run all pre-commit hooks on all files
68
+ pre-commit run --all-files
69
+
70
+ # Alternatively, individual tools:
71
+ ruff format . # Formatting
72
+ ruff check . # Linting
73
+ pylint poorwsgi/ # In-depth analysis
74
+ isort . # Sorting imports
75
+
76
+ 3. Running Tests
77
+ ~~~~~~~~~~~~~~~~
78
+
79
+ As mentioned, TDD is a key part of development. All tests must pass before you submit a Pull Request.
80
+
81
+ * `tests/`: Contains unit tests.
82
+ * `tests_integrity/`: Contains integration tests, which may run real servers from the `examples/` directory.
83
+
84
+ You can run the tests using `pytest`:
85
+
86
+ .. code-block:: bash
87
+
88
+ # Run all tests (unit and integration)
89
+ pytest -v
90
+
91
+ # Run only unit tests
92
+ pytest -v tests/
93
+
94
+ # Run integration tests
95
+ pytest -v tests_integrity/
96
+
97
+ 4. Submitting Changes (Pull Request)
98
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
99
+
100
+ 1. Create a new branch for your changes: `git checkout -b feature/my-new-feature`.
101
+ 2. Make your code changes and write tests for them.
102
+ 3. Ensure that all local tests pass (`pytest -v`).
103
+ 4. Create a commit. At this point, `pre-commit` will automatically check and possibly fix your code. If it fails, make the necessary adjustments and repeat the commit.
104
+
105
+ .. code-block:: bash
106
+
107
+ git add .
108
+ git commit -m "A brief description of the changes"
109
+
110
+ 5. Push the changes to your fork: `git push origin feature/my-new-feature`.
111
+ 6. Open a `Pull Request <https://github.com/PoorHttp/PoorWSGI/pulls>`_ to the `main` branch of the main repository.
112
+
113
+ Your Pull Request will be reviewed by automated tests (CI) and one of the project maintainers. Thank you for your help!
@@ -1,6 +1,6 @@
1
- Metadata-Version: 2.1
1
+ Metadata-Version: 2.4
2
2
  Name: PoorWSGI
3
- Version: 2.7.0
3
+ Version: 2.8.1
4
4
  Summary: Poor WSGI connector for Python
5
5
  Home-page: http://poorhttp.zeropage.cz/poorwsgi
6
6
  Author: Ondřej Tůma
@@ -16,7 +16,6 @@ Keywords: web wsgi development
16
16
  Classifier: Development Status :: 5 - Production/Stable
17
17
  Classifier: Environment :: Web Environment
18
18
  Classifier: Intended Audience :: Developers
19
- Classifier: License :: OSI Approved :: BSD License
20
19
  Classifier: Natural Language :: English
21
20
  Classifier: Natural Language :: Czech
22
21
  Classifier: Operating System :: MacOS :: MacOS X
@@ -27,10 +26,26 @@ Classifier: Programming Language :: Python :: 3 :: Only
27
26
  Classifier: Topic :: Internet :: WWW/HTTP :: Dynamic Content
28
27
  Classifier: Topic :: Internet :: WWW/HTTP :: WSGI :: Middleware
29
28
  Classifier: Topic :: Software Development :: Libraries :: Python Modules
30
- Requires-Python: >=3.8
29
+ Requires-Python: >=3.11
31
30
  Description-Content-Type: text/x-rst
31
+ License-File: doc/licence.txt
32
32
  Provides-Extra: jsongeneratorresponse
33
33
  Requires-Dist: simplejson; extra == "jsongeneratorresponse"
34
+ Dynamic: author
35
+ Dynamic: author-email
36
+ Dynamic: classifier
37
+ Dynamic: description
38
+ Dynamic: description-content-type
39
+ Dynamic: home-page
40
+ Dynamic: keywords
41
+ Dynamic: license
42
+ Dynamic: license-file
43
+ Dynamic: maintainer
44
+ Dynamic: maintainer-email
45
+ Dynamic: project-url
46
+ Dynamic: provides-extra
47
+ Dynamic: requires-python
48
+ Dynamic: summary
34
49
 
35
50
  .. image:: https://img.shields.io/pypi/v/PoorWSGI.svg
36
51
  :target: https://pypi.python.org/pypi/poorwsgi/
@@ -44,9 +59,13 @@ Requires-Dist: simplejson; extra == "jsongeneratorresponse"
44
59
  :target: https://pypi.python.org/pypi/poorwsgi/
45
60
  :alt: Development Status
46
61
 
47
- .. image:: https://img.shields.io/travis/PoorHTTP/PoorWSGI.svg
48
- :target: https://travis-ci.org/PoorHttp/PoorWSGI
49
- :alt: Build Status
62
+ .. image:: https://img.shields.io/github/actions/workflow/status/PoorHTTP/PoorWSGI/python-package.yml?branch=master
63
+ :target: https://github.com/PoorHttp/PoorWSGI/actions/workflows/python-package.yml
64
+ :alt: GitHub Build Workflow Status
65
+
66
+ .. image:: https://img.shields.io/github/actions/workflow/status/PoorHTTP/PoorWSGI/codeql-analysis.yml?branch=master&label=CodeQL
67
+ :target: https://github.com/PoorHttp/PoorWSGI/actions/workflows/codeql-analysis.yml
68
+ :alt: GitHub CodeQL Workflow Status
50
69
 
51
70
  .. image:: https://img.shields.io/pypi/l/PoorWSGI.svg
52
71
  :target: https://pypi.python.org/pypi/poorwsgi/
@@ -55,8 +74,8 @@ Requires-Dist: simplejson; extra == "jsongeneratorresponse"
55
74
  Poor WSGI for Python
56
75
  ====================
57
76
 
58
- Poor WSGI for Python is light WGI connector with uri routing between WSGI server
59
- and your application. The simplest way to run and test it looks like that:
77
+ Poor WSGI for Python is a lightweight WSGI connector with URI routing between the WSGI server
78
+ and your application. The simplest way to run and test it looks like this:
60
79
 
61
80
  .. code-block:: python
62
81
 
@@ -73,7 +92,7 @@ and your application. The simplest way to run and test it looks like that:
73
92
  httpd = make_server('127.0.0.1', 8080, app)
74
93
  httpd.serve_forever()
75
94
 
76
- You can use python wsgiref.simple_server for test it:
95
+ You can use Python's wsgiref.simple_server to test it:
77
96
 
78
97
  .. code-block::
79
98
 
@@ -1,6 +1,6 @@
1
- Metadata-Version: 2.1
1
+ Metadata-Version: 2.4
2
2
  Name: PoorWSGI
3
- Version: 2.7.0
3
+ Version: 2.8.1
4
4
  Summary: Poor WSGI connector for Python
5
5
  Home-page: http://poorhttp.zeropage.cz/poorwsgi
6
6
  Author: Ondřej Tůma
@@ -16,7 +16,6 @@ Keywords: web wsgi development
16
16
  Classifier: Development Status :: 5 - Production/Stable
17
17
  Classifier: Environment :: Web Environment
18
18
  Classifier: Intended Audience :: Developers
19
- Classifier: License :: OSI Approved :: BSD License
20
19
  Classifier: Natural Language :: English
21
20
  Classifier: Natural Language :: Czech
22
21
  Classifier: Operating System :: MacOS :: MacOS X
@@ -27,10 +26,26 @@ Classifier: Programming Language :: Python :: 3 :: Only
27
26
  Classifier: Topic :: Internet :: WWW/HTTP :: Dynamic Content
28
27
  Classifier: Topic :: Internet :: WWW/HTTP :: WSGI :: Middleware
29
28
  Classifier: Topic :: Software Development :: Libraries :: Python Modules
30
- Requires-Python: >=3.8
29
+ Requires-Python: >=3.11
31
30
  Description-Content-Type: text/x-rst
31
+ License-File: doc/licence.txt
32
32
  Provides-Extra: jsongeneratorresponse
33
33
  Requires-Dist: simplejson; extra == "jsongeneratorresponse"
34
+ Dynamic: author
35
+ Dynamic: author-email
36
+ Dynamic: classifier
37
+ Dynamic: description
38
+ Dynamic: description-content-type
39
+ Dynamic: home-page
40
+ Dynamic: keywords
41
+ Dynamic: license
42
+ Dynamic: license-file
43
+ Dynamic: maintainer
44
+ Dynamic: maintainer-email
45
+ Dynamic: project-url
46
+ Dynamic: provides-extra
47
+ Dynamic: requires-python
48
+ Dynamic: summary
34
49
 
35
50
  .. image:: https://img.shields.io/pypi/v/PoorWSGI.svg
36
51
  :target: https://pypi.python.org/pypi/poorwsgi/
@@ -44,9 +59,13 @@ Requires-Dist: simplejson; extra == "jsongeneratorresponse"
44
59
  :target: https://pypi.python.org/pypi/poorwsgi/
45
60
  :alt: Development Status
46
61
 
47
- .. image:: https://img.shields.io/travis/PoorHTTP/PoorWSGI.svg
48
- :target: https://travis-ci.org/PoorHttp/PoorWSGI
49
- :alt: Build Status
62
+ .. image:: https://img.shields.io/github/actions/workflow/status/PoorHTTP/PoorWSGI/python-package.yml?branch=master
63
+ :target: https://github.com/PoorHttp/PoorWSGI/actions/workflows/python-package.yml
64
+ :alt: GitHub Build Workflow Status
65
+
66
+ .. image:: https://img.shields.io/github/actions/workflow/status/PoorHTTP/PoorWSGI/codeql-analysis.yml?branch=master&label=CodeQL
67
+ :target: https://github.com/PoorHttp/PoorWSGI/actions/workflows/codeql-analysis.yml
68
+ :alt: GitHub CodeQL Workflow Status
50
69
 
51
70
  .. image:: https://img.shields.io/pypi/l/PoorWSGI.svg
52
71
  :target: https://pypi.python.org/pypi/poorwsgi/
@@ -55,8 +74,8 @@ Requires-Dist: simplejson; extra == "jsongeneratorresponse"
55
74
  Poor WSGI for Python
56
75
  ====================
57
76
 
58
- Poor WSGI for Python is light WGI connector with uri routing between WSGI server
59
- and your application. The simplest way to run and test it looks like that:
77
+ Poor WSGI for Python is a lightweight WSGI connector with URI routing between the WSGI server
78
+ and your application. The simplest way to run and test it looks like this:
60
79
 
61
80
  .. code-block:: python
62
81
 
@@ -73,7 +92,7 @@ and your application. The simplest way to run and test it looks like that:
73
92
  httpd = make_server('127.0.0.1', 8080, app)
74
93
  httpd.serve_forever()
75
94
 
76
- You can use python wsgiref.simple_server for test it:
95
+ You can use Python's wsgiref.simple_server to test it:
77
96
 
78
97
  .. code-block::
79
98
 
@@ -1,6 +1,7 @@
1
1
  CONTRIBUTION.rst
2
2
  MANIFEST.in
3
3
  README.rst
4
+ pyproject.toml
4
5
  setup.py
5
6
  PoorWSGI.egg-info/PKG-INFO
6
7
  PoorWSGI.egg-info/SOURCES.txt
@@ -24,17 +25,22 @@ doc/licence.txt
24
25
  doc/small-logo.png
25
26
  doc/style.css
26
27
  doc/web.css
28
+ examples/aes_session.py
27
29
  examples/http_digest.py
28
30
  examples/large_file.py
29
31
  examples/metrics.py
30
32
  examples/openapi.json
31
33
  examples/openapi3.py
34
+ examples/poor_session.py
32
35
  examples/put_file.py
36
+ examples/response_closed.py
37
+ examples/session.py
33
38
  examples/simple.py
34
39
  examples/simple_json.py
35
40
  examples/test.digest
36
41
  examples/websocket.py
37
42
  poorwsgi/__init__.py
43
+ poorwsgi/aes_session.py
38
44
  poorwsgi/digest.py
39
45
  poorwsgi/fieldstorage.py
40
46
  poorwsgi/headers.py
@@ -46,8 +52,14 @@ poorwsgi/results.py
46
52
  poorwsgi/session.py
47
53
  poorwsgi/state.py
48
54
  poorwsgi/wsgi.py
55
+ tests/test_aes_session.py
56
+ tests/test_application_error.py
49
57
  tests/test_digest.py
58
+ tests/test_fieldstorage.py
50
59
  tests/test_header.py
60
+ tests/test_headers.py
51
61
  tests/test_request.py
52
62
  tests/test_responses.py
63
+ tests/test_results.py
64
+ tests/test_route_validation.py
53
65
  tests/test_session.py
@@ -10,9 +10,13 @@
10
10
  :target: https://pypi.python.org/pypi/poorwsgi/
11
11
  :alt: Development Status
12
12
 
13
- .. image:: https://img.shields.io/travis/PoorHTTP/PoorWSGI.svg
14
- :target: https://travis-ci.org/PoorHttp/PoorWSGI
15
- :alt: Build Status
13
+ .. image:: https://img.shields.io/github/actions/workflow/status/PoorHTTP/PoorWSGI/python-package.yml?branch=master
14
+ :target: https://github.com/PoorHttp/PoorWSGI/actions/workflows/python-package.yml
15
+ :alt: GitHub Build Workflow Status
16
+
17
+ .. image:: https://img.shields.io/github/actions/workflow/status/PoorHTTP/PoorWSGI/codeql-analysis.yml?branch=master&label=CodeQL
18
+ :target: https://github.com/PoorHttp/PoorWSGI/actions/workflows/codeql-analysis.yml
19
+ :alt: GitHub CodeQL Workflow Status
16
20
 
17
21
  .. image:: https://img.shields.io/pypi/l/PoorWSGI.svg
18
22
  :target: https://pypi.python.org/pypi/poorwsgi/
@@ -21,8 +25,8 @@
21
25
  Poor WSGI for Python
22
26
  ====================
23
27
 
24
- Poor WSGI for Python is light WGI connector with uri routing between WSGI server
25
- and your application. The simplest way to run and test it looks like that:
28
+ Poor WSGI for Python is a lightweight WSGI connector with URI routing between the WSGI server
29
+ and your application. The simplest way to run and test it looks like this:
26
30
 
27
31
  .. code-block:: python
28
32
 
@@ -39,7 +43,7 @@ and your application. The simplest way to run and test it looks like that:
39
43
  httpd = make_server('127.0.0.1', 8080, app)
40
44
  httpd.serve_forever()
41
45
 
42
- You can use python wsgiref.simple_server for test it:
46
+ You can use Python's wsgiref.simple_server to test it:
43
47
 
44
48
  .. code-block::
45
49
 
@@ -1,3 +1,48 @@
1
+ ==== 2.8.1 ====
2
+ * Session, PoorSession, AESSession: validate same_site argument
3
+ - Accepted values are 'Strict', 'Lax', 'None', or False
4
+ - ValueError is raised for any other value
5
+ - ValueError is raised when same_site='None' and secure=False
6
+ (browsers reject SameSite=None without the Secure flag)
7
+ - Type annotation corrected from Union[str, bool] to
8
+ Union[str, Literal[False]]
9
+ * Updated docstrings and documentation to document valid same_site
10
+ values, the Secure requirement for 'None', and raised exceptions
11
+ * Fix Session.destroy() with max_age: Max-Age=-1 was overwritten by
12
+ the subsequent write() call; _destroyed flag now prevents that
13
+ * Unit tests for session.py and aes_session.py: 100% coverage
14
+ - get_token, check_token, NoCompress
15
+ - Session.destroy() with max_age and secure
16
+ - Session.header() with a headers argument
17
+ - PoorSession and AESSession: str key, empty cookie, short
18
+ signature/payload, non-dict data
19
+ * Consolidate tool configuration into pyproject.toml
20
+ - ruff.toml and .isort.cfg removed
21
+ - pytest testpaths and coverage source configured
22
+
23
+ ==== 2.8.0 ====
24
+ * Fix I/O operation on closed file/buffer error in Response classes (#21)
25
+ * Validate route filter definitions to reject spaces with clear error
26
+ messages (#25)
27
+ * Bad PATH_INFO encoding exception handling (#37, #38)
28
+ * Updated openapi3.py example to openapi-core 0.23+ API (Spec replaced
29
+ by OpenAPI)
30
+ * Drop Python 3.9 and 3.10 support, require Python >= 3.11
31
+ * Session base class - plain cookie wrapper for server-side session IDs or
32
+ JWTs; PoorSession inherits from Session
33
+ * PoorSession cookie encryption - ! existing cookies are invalidated !
34
+ - Self-contained encrypted session cookie using shake_256 XOF keystream
35
+ (1024 B) and byte-substitution (no external dependencies)
36
+ - HMAC-SHA256 authentication (Encrypt-then-MAC); tampered or forged
37
+ cookies are rejected
38
+ - Domain-separated key derivation for keystream, MAC and permutation
39
+ - Users will be logged out after upgrading from a previous version
40
+ * AESSession - stronger self-contained session cookie (requires pyaes)
41
+ - AES-256-CTR encryption with a fresh random 16-byte nonce per write
42
+ (prevents CTR nonce-reuse attacks)
43
+ - HMAC-SHA256 authentication with domain-separated keys (Encrypt-then-MAC)
44
+ - Inherits from Session; same interface as PoorSession
45
+
1
46
  ==== 2.7.0 ====
2
47
  * Reserved Request.db attribute for usage
3
48
  * Right HTTPException type annotation
@@ -7,6 +7,7 @@
7
7
  {% set api = api + load_module('headers') %}
8
8
  {% set api = api + load_module('fieldstorage') %}
9
9
  {% set api = api + load_module('session') %}
10
+ {% set api = api + load_module('aes_session') %}
10
11
  {% set api = api + load_module('digest') %}
11
12
  {% set api = api + load_module('results') %}
12
13
  {% set api = api + load_module('state') %}
@@ -0,0 +1,111 @@
1
+ About PoorWSGI
2
+ ==============
3
+ PoorWSGI for Python is a lightweight WSGI connector with URI routing between the WSGI
4
+ server and your application. It has a request object similar to mod_python,
5
+ which is passed to all URI or HTTP state handlers. The simplest way to run and
6
+ test it with wsgiref.simple_server looks like this:
7
+
8
+ .. code:: python
9
+
10
+ from wsgiref.simple_server import make_server
11
+ from poorwsgi import Application
12
+
13
+ app = Application('test')
14
+
15
+ @app.route('/test')
16
+ def root_uri(req):
17
+ return 'Hello world'
18
+
19
+ if __name__ == '__main__':
20
+ httpd = make_server('127.0.0.1', 8080, app)
21
+ httpd.serve_forever()
22
+
23
+ .. code:: sh
24
+
25
+ ~$ python simple.py
26
+
27
+ It has basic error pages like 403, 404, 405, 500, or 501. A 500 internal server
28
+ error will have debug output if poor_Debug is set. Additionally, there is a special debug page
29
+ on the ``/debug-info`` URI, which is also available when poor_Debug is set.
30
+
31
+ .. code:: sh
32
+
33
+ ~$ poor_Debug=On python simple.py
34
+
35
+ PoorWSGI has some functions that you can use as a real HTTP server, which can
36
+ send files with the correct MIME type from disk, or generate directory listings.
37
+ See the Configuration section for more info.
38
+
39
+ .. code:: sh
40
+
41
+ ~$ poor_DocumentRoot=./web poor_DocumentIndex=On python simple.py
42
+
43
+ The Story
44
+ =========
45
+ Once upon a time, there was a King. Or there was a Prince. Oh, maybe, there wasn't a
46
+ prince, but probably there was a Programmer, hmm, okay, a programmer. And this
47
+ programmer knew Apache's mod_python. Yes, it was a very, very bad paragon, but
48
+ before Python, he was programming in PHP. So mod_python was a big movement in the
49
+ right direction at that time.
50
+
51
+ He was finding out how he could write and host Python applications on a server.
52
+ And as he knew some closed-source framework that worked correctly, he wrote
53
+ another similar one for his own use. That is the basis of Poor Publisher. But WSGI was
54
+ coming, so he had an idea to write a new backend for his applications. That
55
+ is the basis of Poor HTTP and PoorWSGI.
56
+
57
+ Sometimes, Poor HTTP and PoorWSGI were one project. It was a better way, but
58
+ that wasn't the right way. After some time, he divided these two projects into
59
+ PoorWSGI and Poor HTTP projects. But there was a flawed concept in the PoorWSGI
60
+ framework, which wasn't a framework in fact. So he looked for other projects and
61
+ saw how nice it could be to create a WSGI application for the user. That is when
62
+ PoorWSGI was rewritten into library-type code, and the application became a
63
+ callable class with some nice routing methods and decorators.
64
+
65
+ This is the story of one programmer and his WSGI framework, which is not a
66
+ framework in fact, because it only handles URI requests with some mod_python
67
+ compatibility layer. As you can see, there are several ways this project can
68
+ evolve. Its author, the programmer, uses it on his projects, and it would be
69
+ very nice if there were more programmers than just him who used this little
70
+ project. Let's call it a WSGI connector.
71
+
72
+ If you have any questions, proposals, bug fixes, text corrections, or any
73
+ other matters, please send me an email to *mcbig at zeropage.cz*, or you can
74
+ create an issue on GitHub: https://github.com/PoorHttp/PoorWSGI/issues.
75
+ Thank you so much.
76
+
77
+ ChangeLog
78
+ =========
79
+ For release history or differences between releases, you can use git diff, diff
80
+ log, the git2cl tool, or consult the ChangeLog from the source code or on the Git
81
+ repository's web page. See:
82
+
83
+ https://github.com/PoorHttp/PoorWSGI/blob/master/doc/ChangeLog
84
+
85
+ Examples
86
+ ========
87
+ These are published application test files. You can download them, study them,
88
+ test them, or use them as you wish. See:
89
+
90
+ **http_digest.py**
91
+ https://github.com/PoorHttp/PoorWSGI/blob/master/examples/http_digest.py
92
+ https://github.com/PoorHttp/PoorWSGI/blob/master/examples/test.digest
93
+
94
+ **large_file.py**
95
+ https://github.com/PoorHttp/PoorWSGI/blob/master/examples/large_file.py
96
+
97
+ **put_file.py**
98
+
99
+ Example of uploading a file via the PUT method, similar to WebDAV.
100
+
101
+ https://github.com/PoorHttp/PoorWSGI/blob/master/examples/put_file.py
102
+
103
+ **openapi3.py**
104
+ https://github.com/PoorHttp/PoorWSGI/blob/master/examples/openapi3.py
105
+ https://github.com/PoorHttp/PoorWSGI/blob/master/examples/openapi.json
106
+
107
+ **simple.py**
108
+ https://github.com/PoorHttp/PoorWSGI/blob/master/examples/simple.py
109
+
110
+ **websocket.py**
111
+ https://github.com/PoorHttp/PoorWSGI/blob/master/examples/websocket.py