capwx 0.1.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.
Files changed (104) hide show
  1. capwx-0.1.0/.gitattributes +4 -0
  2. capwx-0.1.0/.github/workflows/ci.yml +91 -0
  3. capwx-0.1.0/.github/workflows/release.yml +48 -0
  4. capwx-0.1.0/.gitignore +44 -0
  5. capwx-0.1.0/CHANGELOG.md +39 -0
  6. capwx-0.1.0/LICENSE +202 -0
  7. capwx-0.1.0/NOTICE +31 -0
  8. capwx-0.1.0/PKG-INFO +403 -0
  9. capwx-0.1.0/README.md +377 -0
  10. capwx-0.1.0/SECURITY.md +31 -0
  11. capwx-0.1.0/UPSTREAM.md +70 -0
  12. capwx-0.1.0/docs/licence-review.md +55 -0
  13. capwx-0.1.0/docs/security-checklist.md +68 -0
  14. capwx-0.1.0/pyproject.toml +74 -0
  15. capwx-0.1.0/scripts/check_dist.py +152 -0
  16. capwx-0.1.0/scripts/gen_vectors.mjs +190 -0
  17. capwx-0.1.0/scripts/vendor_assets.py +200 -0
  18. capwx-0.1.0/src/capwx/__init__.py +52 -0
  19. capwx-0.1.0/src/capwx/_crypto.py +127 -0
  20. capwx-0.1.0/src/capwx/_jsint.py +68 -0
  21. capwx-0.1.0/src/capwx/_types.py +35 -0
  22. capwx-0.1.0/src/capwx/_vendor/__init__.py +1 -0
  23. capwx-0.1.0/src/capwx/_vendor/hashwx/COMMIT +1 -0
  24. capwx-0.1.0/src/capwx/_vendor/hashwx/LICENSE +165 -0
  25. capwx-0.1.0/src/capwx/_vendor/hashwx/SHA256 +1 -0
  26. capwx-0.1.0/src/capwx/_vendor/hashwx/__init__.py +1 -0
  27. capwx-0.1.0/src/capwx/_vendor/hashwx/hashwx.wasm +0 -0
  28. capwx-0.1.0/src/capwx/challenge.py +545 -0
  29. capwx-0.1.0/src/capwx/config.py +116 -0
  30. capwx-0.1.0/src/capwx/contrib/__init__.py +1 -0
  31. capwx-0.1.0/src/capwx/contrib/django/__init__.py +7 -0
  32. capwx-0.1.0/src/capwx/contrib/django/_types.py +12 -0
  33. capwx-0.1.0/src/capwx/contrib/django/apps.py +22 -0
  34. capwx-0.1.0/src/capwx/contrib/django/conf.py +334 -0
  35. capwx-0.1.0/src/capwx/contrib/django/decorators.py +68 -0
  36. capwx-0.1.0/src/capwx/contrib/django/forms.py +68 -0
  37. capwx-0.1.0/src/capwx/contrib/django/management/__init__.py +0 -0
  38. capwx-0.1.0/src/capwx/contrib/django/management/commands/__init__.py +0 -0
  39. capwx-0.1.0/src/capwx/contrib/django/management/commands/capwx_check.py +200 -0
  40. capwx-0.1.0/src/capwx/contrib/django/static/capwx/VERSIONS.json +51 -0
  41. capwx-0.1.0/src/capwx/contrib/django/static/capwx/cap.min.js +1 -0
  42. capwx-0.1.0/src/capwx/contrib/django/static/capwx/cap_wasm_bg.wasm +0 -0
  43. capwx-0.1.0/src/capwx/contrib/django/static/capwx/hashwx-LICENSE.txt +165 -0
  44. capwx-0.1.0/src/capwx/contrib/django/static/capwx/hashwx.wasm +0 -0
  45. capwx-0.1.0/src/capwx/contrib/django/static/capwx/pako_inflate.min.js +2 -0
  46. capwx-0.1.0/src/capwx/contrib/django/templates/capwx/scripts.html +14 -0
  47. capwx-0.1.0/src/capwx/contrib/django/templates/capwx/widget.html +2 -0
  48. capwx-0.1.0/src/capwx/contrib/django/templatetags/__init__.py +0 -0
  49. capwx-0.1.0/src/capwx/contrib/django/templatetags/capwx.py +61 -0
  50. capwx-0.1.0/src/capwx/contrib/django/urls.py +17 -0
  51. capwx-0.1.0/src/capwx/contrib/django/views.py +212 -0
  52. capwx-0.1.0/src/capwx/contrib/ninja/__init__.py +11 -0
  53. capwx-0.1.0/src/capwx/contrib/ninja/router.py +252 -0
  54. capwx-0.1.0/src/capwx/errors.py +35 -0
  55. capwx-0.1.0/src/capwx/protocols/__init__.py +1 -0
  56. capwx-0.1.0/src/capwx/protocols/hashwx.py +227 -0
  57. capwx-0.1.0/src/capwx/protocols/instrumentation/__init__.py +59 -0
  58. capwx-0.1.0/src/capwx/protocols/instrumentation/detect.py +394 -0
  59. capwx-0.1.0/src/capwx/protocols/instrumentation/generator.py +632 -0
  60. capwx-0.1.0/src/capwx/protocols/instrumentation/obfuscate.py +110 -0
  61. capwx-0.1.0/src/capwx/protocols/instrumentation/verify.py +191 -0
  62. capwx-0.1.0/src/capwx/protocols/sha256_pow.py +71 -0
  63. capwx-0.1.0/src/capwx/py.typed +0 -0
  64. capwx-0.1.0/src/capwx/stores/__init__.py +61 -0
  65. capwx-0.1.0/src/capwx/stores/django_cache.py +62 -0
  66. capwx-0.1.0/src/capwx/stores/memory.py +79 -0
  67. capwx-0.1.0/src/capwx/stores/redis.py +124 -0
  68. capwx-0.1.0/src/capwx/tokens.py +337 -0
  69. capwx-0.1.0/tests/_solver.py +78 -0
  70. capwx-0.1.0/tests/django_project/__init__.py +1 -0
  71. capwx-0.1.0/tests/django_project/forms.py +19 -0
  72. capwx-0.1.0/tests/django_project/hooks.py +28 -0
  73. capwx-0.1.0/tests/django_project/settings.py +82 -0
  74. capwx-0.1.0/tests/django_project/templates/test/e2e.html +13 -0
  75. capwx-0.1.0/tests/django_project/templates/test/form.html +10 -0
  76. capwx-0.1.0/tests/django_project/templates/test/page.html +11 -0
  77. capwx-0.1.0/tests/django_project/urls.py +13 -0
  78. capwx-0.1.0/tests/django_project/urls_ninja.py +39 -0
  79. capwx-0.1.0/tests/django_project/views.py +43 -0
  80. capwx-0.1.0/tests/e2e/conftest.py +100 -0
  81. capwx-0.1.0/tests/e2e/support.py +26 -0
  82. capwx-0.1.0/tests/e2e/test_browser.py +170 -0
  83. capwx-0.1.0/tests/test_challenge.py +673 -0
  84. capwx-0.1.0/tests/test_config.py +190 -0
  85. capwx-0.1.0/tests/test_crypto.py +249 -0
  86. capwx-0.1.0/tests/test_detect.py +813 -0
  87. capwx-0.1.0/tests/test_django.py +470 -0
  88. capwx-0.1.0/tests/test_error_paths.py +339 -0
  89. capwx-0.1.0/tests/test_hashwx.py +267 -0
  90. capwx-0.1.0/tests/test_instrumentation.py +546 -0
  91. capwx-0.1.0/tests/test_instrumentation_gen.py +319 -0
  92. capwx-0.1.0/tests/test_interop_node.py +177 -0
  93. capwx-0.1.0/tests/test_jsint.py +261 -0
  94. capwx-0.1.0/tests/test_ninja.py +307 -0
  95. capwx-0.1.0/tests/test_security_checks.py +179 -0
  96. capwx-0.1.0/tests/test_settings_and_command.py +146 -0
  97. capwx-0.1.0/tests/test_sha256_pow.py +130 -0
  98. capwx-0.1.0/tests/test_stores.py +494 -0
  99. capwx-0.1.0/tests/test_tokens.py +540 -0
  100. capwx-0.1.0/tests/vectors/crypto.json +45 -0
  101. capwx-0.1.0/tests/vectors/hashwx.json +25 -0
  102. capwx-0.1.0/tests/vectors/instrumentation.json +62 -0
  103. capwx-0.1.0/tests/vectors/vectors.json +15 -0
  104. capwx-0.1.0/uv.lock +1032 -0
@@ -0,0 +1,4 @@
1
+ * text=auto
2
+ src/capwx/contrib/django/static/capwx/* -text
3
+ src/capwx/_vendor/hashwx/* -text
4
+ *.wasm binary
@@ -0,0 +1,91 @@
1
+ name: CI
2
+
3
+ on:
4
+ push:
5
+ branches: [main]
6
+ pull_request:
7
+
8
+ permissions:
9
+ contents: read
10
+
11
+ jobs:
12
+ lint:
13
+ name: ruff and pyright
14
+ runs-on: ubuntu-latest
15
+ steps:
16
+ - uses: actions/checkout@v4
17
+ - uses: astral-sh/setup-uv@v6
18
+ - name: Sync dependencies
19
+ run: uv sync --group dev --extra django --extra ninja
20
+ - name: ruff check
21
+ run: uv run ruff check .
22
+ - name: ruff format check
23
+ run: uv run ruff format --check .
24
+ - name: pyright (strict, src/capwx)
25
+ run: uv run pyright
26
+
27
+ unit:
28
+ name: unit (py${{ matrix.python }}, ${{ matrix.os }})
29
+ runs-on: ${{ matrix.os }}
30
+ strategy:
31
+ fail-fast: false
32
+ matrix:
33
+ os: [ubuntu-latest, macos-latest, windows-latest]
34
+ python: ["3.10", "3.11", "3.12", "3.13", "3.14"]
35
+ steps:
36
+ - uses: actions/checkout@v4
37
+ - uses: astral-sh/setup-uv@v6
38
+ - name: Install Python ${{ matrix.python }}
39
+ run: uv python install ${{ matrix.python }}
40
+ - name: Sync dependencies
41
+ run: uv sync --group dev --extra django --extra ninja --python ${{ matrix.python }}
42
+ - name: "Unit tests with coverage (fails under 90% on src/capwx)"
43
+ run: |
44
+ uv run --python ${{ matrix.python }} coverage run -m pytest
45
+ uv run coverage report
46
+
47
+ redis:
48
+ name: unit with Redis (ubuntu)
49
+ runs-on: ubuntu-latest
50
+ services:
51
+ redis:
52
+ image: redis:7
53
+ ports: ["6379:6379"]
54
+ options: >-
55
+ --health-cmd "redis-cli ping" --health-interval 5s --health-timeout 3s --health-retries 10
56
+ env:
57
+ REDIS_URL: redis://localhost:6379/0
58
+ steps:
59
+ - uses: actions/checkout@v4
60
+ - uses: astral-sh/setup-uv@v6
61
+ - name: Sync dependencies
62
+ run: uv sync --group dev --extra django --extra ninja --extra redis
63
+ - name: Redis store tests (not skipped here)
64
+ run: uv run pytest tests/test_stores.py -v
65
+
66
+ e2e:
67
+ name: browser e2e (chromium)
68
+ runs-on: ubuntu-latest
69
+ steps:
70
+ - uses: actions/checkout@v4
71
+ - uses: astral-sh/setup-uv@v6
72
+ - name: Sync dependencies
73
+ run: uv sync --group dev --group e2e --extra django --extra ninja
74
+ - name: Install Chromium
75
+ run: uv run playwright install --with-deps chromium
76
+ - name: Browser e2e tests (real cap-widget)
77
+ run: uv run pytest -m e2e tests/e2e -v
78
+
79
+ node:
80
+ name: node interop (node 22)
81
+ runs-on: ubuntu-latest
82
+ steps:
83
+ - uses: actions/checkout@v4
84
+ - uses: astral-sh/setup-uv@v6
85
+ - uses: actions/setup-node@v4
86
+ with:
87
+ node-version: "22"
88
+ - name: Sync dependencies
89
+ run: uv sync --group dev --extra django --extra ninja
90
+ - name: Node interop tests (capjs-core installed in a temp dir by the test)
91
+ run: uv run pytest -m node tests/test_interop_node.py -v
@@ -0,0 +1,48 @@
1
+ name: Release
2
+
3
+ # Tag vX.Y.Z -> build the sdist and wheel, check them, publish to PyPI with Trusted Publishing
4
+ # (OpenID Connect; no API token is stored in the repository).
5
+
6
+ on:
7
+ push:
8
+ tags: ["v*"]
9
+
10
+ permissions:
11
+ contents: read
12
+
13
+ jobs:
14
+ build:
15
+ name: build and check distributions
16
+ runs-on: ubuntu-latest
17
+ steps:
18
+ - uses: actions/checkout@v4
19
+ - uses: astral-sh/setup-uv@v6
20
+ - name: Build sdist and wheel
21
+ run: uv build
22
+ - name: The tag must match the package version
23
+ run: |
24
+ version="$(ls dist/capwx-*.whl | sed -E 's#.*/capwx-([^-]+)-py3.*#\1#')"
25
+ test "v${version}" = "${GITHUB_REF_NAME}"
26
+ - name: Check the artifacts contain everything a release ships
27
+ run: uv run --no-project python scripts/check_dist.py dist
28
+ - uses: actions/upload-artifact@v4
29
+ with:
30
+ name: dist
31
+ path: dist/
32
+
33
+ publish:
34
+ name: publish to PyPI
35
+ needs: build
36
+ runs-on: ubuntu-latest
37
+ environment:
38
+ name: pypi
39
+ url: https://pypi.org/p/capwx
40
+ permissions:
41
+ id-token: write # Trusted Publishing: the job exchanges an OIDC token for a PyPI upload token
42
+ steps:
43
+ - uses: actions/download-artifact@v4
44
+ with:
45
+ name: dist
46
+ path: dist/
47
+ - name: Publish to PyPI
48
+ uses: pypa/gh-action-pypi-publish@release/v1
capwx-0.1.0/.gitignore ADDED
@@ -0,0 +1,44 @@
1
+ # Build and distribution
2
+ dist/
3
+ build/
4
+ *.egg-info/
5
+ *.whl
6
+ *.tar.gz
7
+
8
+ # Virtual environments
9
+ .venv/
10
+ venv/
11
+ env/
12
+
13
+ # Python caches and tooling
14
+ __pycache__/
15
+ *.py[cod]
16
+ .pytest_cache/
17
+ .ruff_cache/
18
+ .pyright/
19
+ .mypy_cache/
20
+ .coverage
21
+ .coverage.*
22
+ htmlcov/
23
+ coverage.xml
24
+
25
+ # Environment and local secrets
26
+ .env
27
+ .env.*
28
+ !.env.example
29
+ *.local
30
+
31
+ # Editors and OS
32
+ .idea/
33
+ .vscode/
34
+ *.swp
35
+ .DS_Store
36
+ Thumbs.db
37
+
38
+ # Node (scripts/gen_vectors.mjs, interop tests)
39
+ node_modules/
40
+ package-lock.json
41
+
42
+ # Playwright
43
+ test-results/
44
+ playwright-report/
@@ -0,0 +1,39 @@
1
+ # Changelog
2
+
3
+ All notable changes to this project are documented here. The format follows
4
+ [Keep a Changelog](https://keepachangelog.com/en/1.1.0/).
5
+
6
+ ## [0.1.0] - Unreleased
7
+
8
+ First release. Pre-release until a `v0.1.0` tag is published to PyPI.
9
+
10
+ ### Added
11
+
12
+ - Format-2 Cap protocol server: `create_challenge`, `redeem` and their async twins, for the
13
+ `hashwx`, `sha256-pow` and `instrumentation` protocols. Compatible with `capjs-core` 0.1.5 (verified
14
+ in both directions by the `node` test suite).
15
+ - Verification tokens: `validate_token`, `siteverify` and async twins. Stored tokens (single use with a
16
+ store) and stateless tokens (valid until expiry).
17
+ - Stores: `MemoryStore` (development), `DjangoCacheStore`, `RedisStore` and `AsyncRedisStore`.
18
+ - Instrumentation: a generated probe script and a verifier, with automation detection and risk flags.
19
+ - Django integration (`capwx.contrib.django`): settings with per-site overrides, endpoints under a
20
+ URL prefix of your choice, `{% capwx_scripts %}` and `{% capwx_widget %}` template tags,
21
+ `CapField`, `@require_cap`, CSRF modes, `BEFORE_CHALLENGE_HOOK` and `DIFFICULTY_HOOK`, and the
22
+ `capwx_check` management command.
23
+ - Django Ninja integration (`capwx.contrib.ninja`): `build_router`, `install` and `CapRequired`.
24
+ - Vendored assets: the server `hashwx.wasm` (LGPL-3.0, separate file) and the browser assets, each
25
+ with a pinned SHA-256 and `VERSIONS.json`. See [UPSTREAM.md](UPSTREAM.md).
26
+ - Documentation: README, [SECURITY.md](SECURITY.md), [UPSTREAM.md](UPSTREAM.md) and
27
+ [docs/security-checklist.md](docs/security-checklist.md).
28
+
29
+ ### Security
30
+
31
+ - `repr()` of `CapConfig` and of the Django site configuration no longer shows the secrets.
32
+ - `DjangoCacheStore.take` is atomic where `cache.add` is atomic (Redis, Memcached, locmem), so a
33
+ verification token cannot be consumed twice by two concurrent requests. Previously it was a
34
+ get-then-delete.
35
+ - `hashwx` and `sha256-pow` verification bound the difficulty they accept, as minting does. An empty
36
+ `sha256-pow` target matched every nonce.
37
+ - `CapRequired(field="")` accepts only the header, as documented. An empty JSON key was accepted before.
38
+ - A `DIFFICULTY_HOOK` or `BEFORE_CHALLENGE_HOOK` dotted path that cannot be imported is reported as
39
+ `ImproperlyConfigured`, not as a bare `ImportError`.
capwx-0.1.0/LICENSE ADDED
@@ -0,0 +1,202 @@
1
+
2
+ Apache License
3
+ Version 2.0, January 2004
4
+ http://www.apache.org/licenses/
5
+
6
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
7
+
8
+ 1. Definitions.
9
+
10
+ "License" shall mean the terms and conditions for use, reproduction,
11
+ and distribution as defined by Sections 1 through 9 of this document.
12
+
13
+ "Licensor" shall mean the copyright owner or entity authorized by
14
+ the copyright owner that is granting the License.
15
+
16
+ "Legal Entity" shall mean the union of the acting entity and all
17
+ other entities that control, are controlled by, or are under common
18
+ control with that entity. For the purposes of this definition,
19
+ "control" means (i) the power, direct or indirect, to cause the
20
+ direction or management of such entity, whether by contract or
21
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
22
+ outstanding shares, or (iii) beneficial ownership of such entity.
23
+
24
+ "You" (or "Your") shall mean an individual or Legal Entity
25
+ exercising permissions granted by this License.
26
+
27
+ "Source" form shall mean the preferred form for making modifications,
28
+ including but not limited to software source code, documentation
29
+ source, and configuration files.
30
+
31
+ "Object" form shall mean any form resulting from mechanical
32
+ transformation or translation of a Source form, including but
33
+ not limited to compiled object code, generated documentation,
34
+ and conversions to other media types.
35
+
36
+ "Work" shall mean the work of authorship, whether in Source or
37
+ Object form, made available under the License, as indicated by a
38
+ copyright notice that is included in or attached to the work
39
+ (an example is provided in the Appendix below).
40
+
41
+ "Derivative Works" shall mean any work, whether in Source or Object
42
+ form, that is based on (or derived from) the Work and for which the
43
+ editorial revisions, annotations, elaborations, or other modifications
44
+ represent, as a whole, an original work of authorship. For the purposes
45
+ of this License, Derivative Works shall not include works that remain
46
+ separable from, or merely link (or bind by name) to the interfaces of,
47
+ the Work and Derivative Works thereof.
48
+
49
+ "Contribution" shall mean any work of authorship, including
50
+ the original version of the Work and any modifications or additions
51
+ to that Work or Derivative Works thereof, that is intentionally
52
+ submitted to Licensor for inclusion in the Work by the copyright owner
53
+ or by an individual or Legal Entity authorized to submit on behalf of
54
+ the copyright owner. For the purposes of this definition, "submitted"
55
+ means any form of electronic, verbal, or written communication sent
56
+ to the Licensor or its representatives, including but not limited to
57
+ communication on electronic mailing lists, source code control systems,
58
+ and issue tracking systems that are managed by, or on behalf of, the
59
+ Licensor for the purpose of discussing and improving the Work, but
60
+ excluding communication that is conspicuously marked or otherwise
61
+ designated in writing by the copyright owner as "Not a Contribution."
62
+
63
+ "Contributor" shall mean Licensor and any individual or Legal Entity
64
+ on behalf of whom a Contribution has been received by Licensor and
65
+ subsequently incorporated within the Work.
66
+
67
+ 2. Grant of Copyright License. Subject to the terms and conditions of
68
+ this License, each Contributor hereby grants to You a perpetual,
69
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
70
+ copyright license to reproduce, prepare Derivative Works of,
71
+ publicly display, publicly perform, sublicense, and distribute the
72
+ Work and such Derivative Works in Source or Object form.
73
+
74
+ 3. Grant of Patent License. Subject to the terms and conditions of
75
+ this License, each Contributor hereby grants to You a perpetual,
76
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
77
+ (except as stated in this section) patent license to make, have made,
78
+ use, offer to sell, sell, import, and otherwise transfer the Work,
79
+ where such license applies only to those patent claims licensable
80
+ by such Contributor that are necessarily infringed by their
81
+ Contribution(s) alone or by combination of their Contribution(s)
82
+ with the Work to which such Contribution(s) was submitted. If You
83
+ institute patent litigation against any entity (including a
84
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
85
+ or a Contribution incorporated within the Work constitutes direct
86
+ or contributory patent infringement, then any patent licenses
87
+ granted to You under this License for that Work shall terminate
88
+ as of the date such litigation is filed.
89
+
90
+ 4. Redistribution. You may reproduce and distribute copies of the
91
+ Work or Derivative Works thereof in any medium, with or without
92
+ modifications, and in Source or Object form, provided that You
93
+ meet the following conditions:
94
+
95
+ (a) You must give any other recipients of the Work or
96
+ Derivative Works a copy of this License; and
97
+
98
+ (b) You must cause any modified files to carry prominent notices
99
+ stating that You changed the files; and
100
+
101
+ (c) You must retain, in the Source form of any Derivative Works
102
+ that You distribute, all copyright, patent, trademark, and
103
+ attribution notices from the Source form of the Work,
104
+ excluding those notices that do not pertain to any part of
105
+ the Derivative Works; and
106
+
107
+ (d) If the Work includes a "NOTICE" text file as part of its
108
+ distribution, then any Derivative Works that You distribute must
109
+ include a readable copy of the attribution notices contained
110
+ within such NOTICE file, excluding those notices that do not
111
+ pertain to any part of the Derivative Works, in at least one
112
+ of the following places: within a NOTICE text file distributed
113
+ as part of the Derivative Works; within the Source form or
114
+ documentation, if provided along with the Derivative Works; or,
115
+ within a display generated by the Derivative Works, if and
116
+ wherever such third-party notices normally appear. The contents
117
+ of the NOTICE file are for informational purposes only and
118
+ do not modify the License. You may add Your own attribution
119
+ notices within Derivative Works that You distribute, alongside
120
+ or as an addendum to the NOTICE text from the Work, provided
121
+ that such additional attribution notices cannot be construed
122
+ as modifying the License.
123
+
124
+ You may add Your own copyright statement to Your modifications and
125
+ may provide additional or different license terms and conditions
126
+ for use, reproduction, or distribution of Your modifications, or
127
+ for any such Derivative Works as a whole, provided Your use,
128
+ reproduction, and distribution of the Work otherwise complies with
129
+ the conditions stated in this License.
130
+
131
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
132
+ any Contribution intentionally submitted for inclusion in the Work
133
+ by You to the Licensor shall be under the terms and conditions of
134
+ this License, without any additional terms or conditions.
135
+ Notwithstanding the above, nothing herein shall supersede or modify
136
+ the terms of any separate license agreement you may have executed
137
+ with Licensor regarding such Contributions.
138
+
139
+ 6. Trademarks. This License does not grant permission to use the trade
140
+ names, trademarks, service marks, or product names of the Licensor,
141
+ except as required for reasonable and customary use in describing the
142
+ origin of the Work and reproducing the content of the NOTICE file.
143
+
144
+ 7. Disclaimer of Warranty. Unless required by applicable law or
145
+ agreed to in writing, Licensor provides the Work (and each
146
+ Contributor provides its Contributions) on an "AS IS" BASIS,
147
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
148
+ implied, including, without limitation, any warranties or conditions
149
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
150
+ PARTICULAR PURPOSE. You are solely responsible for determining the
151
+ appropriateness of using or redistributing the Work and assume any
152
+ risks associated with Your exercise of permissions under this License.
153
+
154
+ 8. Limitation of Liability. In no event and under no legal theory,
155
+ whether in tort (including negligence), contract, or otherwise,
156
+ unless required by applicable law (such as deliberate and grossly
157
+ negligent acts) or agreed to in writing, shall any Contributor be
158
+ liable to You for damages, including any direct, indirect, special,
159
+ incidental, or consequential damages of any character arising as a
160
+ result of this License or out of the use or inability to use the
161
+ Work (including but not limited to damages for loss of goodwill,
162
+ work stoppage, computer failure or malfunction, or any and all
163
+ other commercial damages or losses), even if such Contributor
164
+ has been advised of the possibility of such damages.
165
+
166
+ 9. Accepting Warranty or Additional Liability. While redistributing
167
+ the Work or Derivative Works thereof, You may choose to offer,
168
+ and charge a fee for, acceptance of support, warranty, indemnity,
169
+ or other liability obligations and/or rights consistent with this
170
+ License. However, in accepting such obligations, You may act only
171
+ on Your own behalf and on Your sole responsibility, not on behalf
172
+ of any other Contributor, and only if You agree to indemnify,
173
+ defend, and hold each Contributor harmless for any liability
174
+ incurred by, or claims asserted against, such Contributor by reason
175
+ of your accepting any such warranty or additional liability.
176
+
177
+ END OF TERMS AND CONDITIONS
178
+
179
+ APPENDIX: How to apply the Apache License to your work.
180
+
181
+ To apply the Apache License to your work, attach the following
182
+ boilerplate notice, with the fields enclosed by brackets "[]"
183
+ replaced with your own identifying information. (Don't include
184
+ the brackets!) The text should be enclosed in the appropriate
185
+ comment syntax for the file format. We also recommend that a
186
+ file or class name and description of purpose be included on the
187
+ same "printed page" as the copyright notice for easier
188
+ identification within third-party archives.
189
+
190
+ Copyright [yyyy] [name of copyright owner]
191
+
192
+ Licensed under the Apache License, Version 2.0 (the "License");
193
+ you may not use this file except in compliance with the License.
194
+ You may obtain a copy of the License at
195
+
196
+ http://www.apache.org/licenses/LICENSE-2.0
197
+
198
+ Unless required by applicable law or agreed to in writing, software
199
+ distributed under the License is distributed on an "AS IS" BASIS,
200
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
201
+ See the License for the specific language governing permissions and
202
+ limitations under the License.
capwx-0.1.0/NOTICE ADDED
@@ -0,0 +1,31 @@
1
+ capwx
2
+ Copyright 2026 capwx contributors
3
+
4
+ This product is licensed under the Apache License, Version 2.0 (see LICENSE).
5
+
6
+ capwx is an unofficial Python implementation and is not affiliated with Cap.
7
+
8
+ This product includes and/or is derived from the following third-party works:
9
+
10
+ 1. Cap (https://github.com/tiagozip/cap)
11
+ Copyright (c) tiagozip and Cap contributors.
12
+ Licensed under the Apache License, Version 2.0.
13
+ Pinned commit: 29bbe6fbe284786cdb0d4489e5040aee6042b2a4
14
+ Ported parts: core/src (capjs-core 0.1.5) protocol logic, instrumentation
15
+ generation and detection.
16
+ Vendored browser assets (src/capwx/contrib/django/static/capwx/):
17
+ cap-widget 0.1.58 (cap.min.js), @cap.js/wasm 0.0.8 (cap_wasm_bg.wasm),
18
+ pako 2.1.0 (pako_inflate.min.js, MIT).
19
+
20
+ 2. HashWX (https://github.com/tevador/hashwx)
21
+ Copyright (c) tevador.
22
+ Licensed under the GNU Lesser General Public License, Version 3.
23
+ Pinned commit: 74b567a31276a4c5d7cb232a5b7639467f49f961
24
+ Vendored binary: src/capwx/_vendor/hashwx/hashwx.wasm (also shipped as
25
+ static/capwx/hashwx.wasm). The licence text is in
26
+ src/capwx/_vendor/hashwx/LICENSE and static/capwx/hashwx-LICENSE.txt.
27
+ The HashWX source code is not included in capwx; the wasm binary is a
28
+ separate file that can be replaced with a user-supplied build
29
+ (config option hashwx_wasm_path).
30
+
31
+ Full details, pins and the re-sync procedure are in UPSTREAM.md.