wlc 3.2.0__tar.gz → 3.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.
- {wlc-3.2.0 → wlc-3.3.0}/CHANGES.md +18 -0
- {wlc-3.2.0 → wlc-3.3.0}/PKG-INFO +1 -1
- {wlc-3.2.0 → wlc-3.3.0}/SECURITY.md +14 -2
- {wlc-3.2.0 → wlc-3.3.0}/THREAT_MODEL.md +23 -9
- {wlc-3.2.0 → wlc-3.3.0}/pyproject.toml +4 -4
- {wlc-3.2.0 → wlc-3.3.0}/tests/test_base.py +13 -0
- {wlc-3.2.0 → wlc-3.3.0}/tests/test_client.py +18 -6
- {wlc-3.2.0 → wlc-3.3.0}/tests/test_config.py +38 -1
- wlc-3.3.0/tests/test_config_discovery.py +531 -0
- {wlc-3.2.0 → wlc-3.3.0}/tests/test_errors.py +51 -7
- {wlc-3.2.0 → wlc-3.3.0}/tests/test_urls.py +72 -0
- {wlc-3.2.0 → wlc-3.3.0}/wlc/base.py +4 -4
- {wlc-3.2.0 → wlc-3.3.0}/wlc/client.py +28 -18
- {wlc-3.2.0 → wlc-3.3.0}/wlc/config.py +225 -35
- {wlc-3.2.0 → wlc-3.3.0}/wlc/const.py +1 -1
- {wlc-3.2.0 → wlc-3.3.0}/wlc/main.py +10 -2
- {wlc-3.2.0 → wlc-3.3.0}/wlc.egg-info/PKG-INFO +1 -1
- {wlc-3.2.0 → wlc-3.3.0}/wlc.egg-info/SOURCES.txt +1 -0
- {wlc-3.2.0 → wlc-3.3.0}/LICENSE +0 -0
- {wlc-3.2.0 → wlc-3.3.0}/LICENSES/CC0-1.0.txt +0 -0
- {wlc-3.2.0 → wlc-3.3.0}/LICENSES/GPL-3.0-or-later.txt +0 -0
- {wlc-3.2.0 → wlc-3.3.0}/MANIFEST.in +0 -0
- {wlc-3.2.0 → wlc-3.3.0}/README.md +0 -0
- {wlc-3.2.0 → wlc-3.3.0}/completion/wlc +0 -0
- {wlc-3.2.0 → wlc-3.3.0}/setup.cfg +0 -0
- {wlc-3.2.0 → wlc-3.3.0}/tests/__init__.py +0 -0
- {wlc-3.2.0 → wlc-3.3.0}/tests/test_category.py +0 -0
- {wlc-3.2.0 → wlc-3.3.0}/tests/test_data/.weblate +0 -0
- {wlc-3.2.0 → wlc-3.3.0}/tests/test_data/api/categories +0 -0
- {wlc-3.2.0 → wlc-3.3.0}/tests/test_data/api/categories-1 +0 -0
- {wlc-3.2.0 → wlc-3.3.0}/tests/test_data/api/changes +0 -0
- {wlc-3.2.0 → wlc-3.3.0}/tests/test_data/api/components +0 -0
- {wlc-3.2.0 → wlc-3.3.0}/tests/test_data/api/components-hello-android +0 -0
- {wlc-3.2.0 → wlc-3.3.0}/tests/test_data/api/components-hello-android-file +0 -0
- {wlc-3.2.0 → wlc-3.3.0}/tests/test_data/api/components-hello-android-file--GET--format=zip +0 -0
- {wlc-3.2.0 → wlc-3.3.0}/tests/test_data/api/components-hello-olderweblate +0 -0
- {wlc-3.2.0 → wlc-3.3.0}/tests/test_data/api/components-hello-weblate +0 -0
- {wlc-3.2.0 → wlc-3.3.0}/tests/test_data/api/components-hello-weblate--DELETE-- +0 -0
- {wlc-3.2.0 → wlc-3.3.0}/tests/test_data/api/components-hello-weblate--PATCH--priority=80 +0 -0
- {wlc-3.2.0 → wlc-3.3.0}/tests/test_data/api/components-hello-weblate-changes +0 -0
- {wlc-3.2.0 → wlc-3.3.0}/tests/test_data/api/components-hello-weblate-file +0 -0
- {wlc-3.2.0 → wlc-3.3.0}/tests/test_data/api/components-hello-weblate-file--GET--format=zip +0 -0
- {wlc-3.2.0 → wlc-3.3.0}/tests/test_data/api/components-hello-weblate-lock +0 -0
- {wlc-3.2.0 → wlc-3.3.0}/tests/test_data/api/components-hello-weblate-lock--POST--lock=0 +0 -0
- {wlc-3.2.0 → wlc-3.3.0}/tests/test_data/api/components-hello-weblate-lock--POST--lock=1 +0 -0
- {wlc-3.2.0 → wlc-3.3.0}/tests/test_data/api/components-hello-weblate-lock--POST--lock=false +0 -0
- {wlc-3.2.0 → wlc-3.3.0}/tests/test_data/api/components-hello-weblate-lock--POST--lock=true +0 -0
- {wlc-3.2.0 → wlc-3.3.0}/tests/test_data/api/components-hello-weblate-repository +0 -0
- {wlc-3.2.0 → wlc-3.3.0}/tests/test_data/api/components-hello-weblate-repository--POST--operation=cleanup +0 -0
- {wlc-3.2.0 → wlc-3.3.0}/tests/test_data/api/components-hello-weblate-repository--POST--operation=commit +0 -0
- {wlc-3.2.0 → wlc-3.3.0}/tests/test_data/api/components-hello-weblate-repository--POST--operation=pull +0 -0
- {wlc-3.2.0 → wlc-3.3.0}/tests/test_data/api/components-hello-weblate-repository--POST--operation=push +0 -0
- {wlc-3.2.0 → wlc-3.3.0}/tests/test_data/api/components-hello-weblate-repository--POST--operation=reset +0 -0
- {wlc-3.2.0 → wlc-3.3.0}/tests/test_data/api/components-hello-weblate-statistics +0 -0
- {wlc-3.2.0 → wlc-3.3.0}/tests/test_data/api/components-hello-weblate-statistics--GET--page=2 +0 -0
- {wlc-3.2.0 → wlc-3.3.0}/tests/test_data/api/components-hello-weblate-statistics--GET--page=3 +0 -0
- {wlc-3.2.0 → wlc-3.3.0}/tests/test_data/api/components-hello-weblate-translations +0 -0
- {wlc-3.2.0 → wlc-3.3.0}/tests/test_data/api/components-hello-weblate-translations--GET--page=2 +0 -0
- {wlc-3.2.0 → wlc-3.3.0}/tests/test_data/api/components-hello-weblate-translations--POST--language_code=nl_BE +0 -0
- {wlc-3.2.0 → wlc-3.3.0}/tests/test_data/api/languages +0 -0
- {wlc-3.2.0 → wlc-3.3.0}/tests/test_data/api/languages--GET--page=2 +0 -0
- {wlc-3.2.0 → wlc-3.3.0}/tests/test_data/api/languages--GET--page=3 +0 -0
- {wlc-3.2.0 → wlc-3.3.0}/tests/test_data/api/languages--POST--code=tst--name=Test-Language--direction=rtl--plural=number=2--formula=n-!=-1 +0 -0
- {wlc-3.2.0 → wlc-3.3.0}/tests/test_data/api/projects +0 -0
- {wlc-3.2.0 → wlc-3.3.0}/tests/test_data/api/projects--POST--name=Hello--slug=hello--web=http---example.com---source_language=name=Malayalam--code=ml +0 -0
- {wlc-3.2.0 → wlc-3.3.0}/tests/test_data/api/projects--POST--name=denied_json--slug=denide_json--web=http---some-weblate-app.com- +0 -0
- {wlc-3.2.0 → wlc-3.3.0}/tests/test_data/api/projects-acl +0 -0
- {wlc-3.2.0 → wlc-3.3.0}/tests/test_data/api/projects-empty +0 -0
- {wlc-3.2.0 → wlc-3.3.0}/tests/test_data/api/projects-empty-components +0 -0
- {wlc-3.2.0 → wlc-3.3.0}/tests/test_data/api/projects-hello +0 -0
- {wlc-3.2.0 → wlc-3.3.0}/tests/test_data/api/projects-hello--DELETE-- +0 -0
- {wlc-3.2.0 → wlc-3.3.0}/tests/test_data/api/projects-hello-categories +0 -0
- {wlc-3.2.0 → wlc-3.3.0}/tests/test_data/api/projects-hello-changes +0 -0
- {wlc-3.2.0 → wlc-3.3.0}/tests/test_data/api/projects-hello-components +0 -0
- {wlc-3.2.0 → wlc-3.3.0}/tests/test_data/api/projects-hello-components--POST--3fcd0ab4 +0 -0
- {wlc-3.2.0 → wlc-3.3.0}/tests/test_data/api/projects-hello-components--POST--c9c26539 +0 -0
- {wlc-3.2.0 → wlc-3.3.0}/tests/test_data/api/projects-hello-languages +0 -0
- {wlc-3.2.0 → wlc-3.3.0}/tests/test_data/api/projects-hello-repository +0 -0
- {wlc-3.2.0 → wlc-3.3.0}/tests/test_data/api/projects-hello-repository--POST--operation=cleanup +0 -0
- {wlc-3.2.0 → wlc-3.3.0}/tests/test_data/api/projects-hello-repository--POST--operation=commit +0 -0
- {wlc-3.2.0 → wlc-3.3.0}/tests/test_data/api/projects-hello-repository--POST--operation=pull +0 -0
- {wlc-3.2.0 → wlc-3.3.0}/tests/test_data/api/projects-hello-repository--POST--operation=push +0 -0
- {wlc-3.2.0 → wlc-3.3.0}/tests/test_data/api/projects-hello-repository--POST--operation=reset +0 -0
- {wlc-3.2.0 → wlc-3.3.0}/tests/test_data/api/projects-hello-statistics +0 -0
- {wlc-3.2.0 → wlc-3.3.0}/tests/test_data/api/projects-invalid +0 -0
- {wlc-3.2.0 → wlc-3.3.0}/tests/test_data/api/translations +0 -0
- {wlc-3.2.0 → wlc-3.3.0}/tests/test_data/api/translations--GET--page=2 +0 -0
- {wlc-3.2.0 → wlc-3.3.0}/tests/test_data/api/translations--GET--page=3 +0 -0
- {wlc-3.2.0 → wlc-3.3.0}/tests/test_data/api/translations-hello-android-en-units +0 -0
- {wlc-3.2.0 → wlc-3.3.0}/tests/test_data/api/translations-hello-android-en-units--POST--key=test-monolingual--value=-test-me- +0 -0
- {wlc-3.2.0 → wlc-3.3.0}/tests/test_data/api/translations-hello-weblate-cs +0 -0
- {wlc-3.2.0 → wlc-3.3.0}/tests/test_data/api/translations-hello-weblate-cs--DELETE-- +0 -0
- {wlc-3.2.0 → wlc-3.3.0}/tests/test_data/api/translations-hello-weblate-cs-changes +0 -0
- {wlc-3.2.0 → wlc-3.3.0}/tests/test_data/api/translations-hello-weblate-cs-file +0 -0
- {wlc-3.2.0 → wlc-3.3.0}/tests/test_data/api/translations-hello-weblate-cs-file--GET--format=csv +0 -0
- {wlc-3.2.0 → wlc-3.3.0}/tests/test_data/api/translations-hello-weblate-cs-file--POST--3748506a +0 -0
- {wlc-3.2.0 → wlc-3.3.0}/tests/test_data/api/translations-hello-weblate-cs-file--POST--5c6a101f +0 -0
- {wlc-3.2.0 → wlc-3.3.0}/tests/test_data/api/translations-hello-weblate-cs-file--POST--85762547 +0 -0
- {wlc-3.2.0 → wlc-3.3.0}/tests/test_data/api/translations-hello-weblate-cs-file--POST--90a4957d +0 -0
- {wlc-3.2.0 → wlc-3.3.0}/tests/test_data/api/translations-hello-weblate-cs-file--POST--f8672b4c +0 -0
- {wlc-3.2.0 → wlc-3.3.0}/tests/test_data/api/translations-hello-weblate-cs-file--POST--fe040a0c +0 -0
- {wlc-3.2.0 → wlc-3.3.0}/tests/test_data/api/translations-hello-weblate-cs-repository +0 -0
- {wlc-3.2.0 → wlc-3.3.0}/tests/test_data/api/translations-hello-weblate-cs-repository--POST--operation=cleanup +0 -0
- {wlc-3.2.0 → wlc-3.3.0}/tests/test_data/api/translations-hello-weblate-cs-repository--POST--operation=commit +0 -0
- {wlc-3.2.0 → wlc-3.3.0}/tests/test_data/api/translations-hello-weblate-cs-repository--POST--operation=pull +0 -0
- {wlc-3.2.0 → wlc-3.3.0}/tests/test_data/api/translations-hello-weblate-cs-repository--POST--operation=push +0 -0
- {wlc-3.2.0 → wlc-3.3.0}/tests/test_data/api/translations-hello-weblate-cs-repository--POST--operation=reset +0 -0
- {wlc-3.2.0 → wlc-3.3.0}/tests/test_data/api/translations-hello-weblate-cs-statistics +0 -0
- {wlc-3.2.0 → wlc-3.3.0}/tests/test_data/api/translations-hello-weblate-cs-units +0 -0
- {wlc-3.2.0 → wlc-3.3.0}/tests/test_data/api/translations-hello-weblate-cs-units--GET--q=source%3A%3D%22mr%22 +0 -0
- {wlc-3.2.0 → wlc-3.3.0}/tests/test_data/api/units +0 -0
- {wlc-3.2.0 → wlc-3.3.0}/tests/test_data/api/units-123 +0 -0
- {wlc-3.2.0 → wlc-3.3.0}/tests/test_data/api/units-123--DELETE-- +0 -0
- {wlc-3.2.0 → wlc-3.3.0}/tests/test_data/api/units-123--PATCH--target=-foo---state=30 +0 -0
- {wlc-3.2.0 → wlc-3.3.0}/tests/test_data/api/units-123--PUT--target=-foo---state=30 +0 -0
- {wlc-3.2.0 → wlc-3.3.0}/tests/test_data/mock/project-local-file.pot +0 -0
- {wlc-3.2.0 → wlc-3.3.0}/tests/test_data/section +0 -0
- {wlc-3.2.0 → wlc-3.3.0}/tests/test_data/weblate.ini +0 -0
- {wlc-3.2.0 → wlc-3.3.0}/tests/test_data/wlc +0 -0
- {wlc-3.2.0 → wlc-3.3.0}/tests/test_download.py +0 -0
- {wlc-3.2.0 → wlc-3.3.0}/tests/test_insecure_http.py +0 -0
- {wlc-3.2.0 → wlc-3.3.0}/tests/test_insecure_ssl.py +0 -0
- {wlc-3.2.0 → wlc-3.3.0}/tests/test_lazy_object.py +0 -0
- {wlc-3.2.0 → wlc-3.3.0}/tests/test_main.py +0 -0
- {wlc-3.2.0 → wlc-3.3.0}/tests/test_output.py +0 -0
- {wlc-3.2.0 → wlc-3.3.0}/tests/test_package.py +0 -0
- {wlc-3.2.0 → wlc-3.3.0}/tests/test_signatures.py +0 -0
- {wlc-3.2.0 → wlc-3.3.0}/tests/test_statistics.py +0 -0
- {wlc-3.2.0 → wlc-3.3.0}/tests/test_utils.py +0 -0
- {wlc-3.2.0 → wlc-3.3.0}/tests/test_wlc.py +0 -0
- {wlc-3.2.0 → wlc-3.3.0}/wl +0 -0
- {wlc-3.2.0 → wlc-3.3.0}/wlc/__init__.py +0 -0
- {wlc-3.2.0 → wlc-3.3.0}/wlc/exceptions.py +0 -0
- {wlc-3.2.0 → wlc-3.3.0}/wlc/http_debug.py +0 -0
- {wlc-3.2.0 → wlc-3.3.0}/wlc/models.py +0 -0
- {wlc-3.2.0 → wlc-3.3.0}/wlc/output.py +0 -0
- {wlc-3.2.0 → wlc-3.3.0}/wlc/py.typed +0 -0
- {wlc-3.2.0 → wlc-3.3.0}/wlc/utils.py +0 -0
- {wlc-3.2.0 → wlc-3.3.0}/wlc.egg-info/dependency_links.txt +0 -0
- {wlc-3.2.0 → wlc-3.3.0}/wlc.egg-info/entry_points.txt +0 -0
- {wlc-3.2.0 → wlc-3.3.0}/wlc.egg-info/requires.txt +0 -0
- {wlc-3.2.0 → wlc-3.3.0}/wlc.egg-info/top_level.txt +0 -0
|
@@ -1,5 +1,23 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 3.3.0
|
|
4
|
+
|
|
5
|
+
* Released on 10th November 2026.
|
|
6
|
+
* Bound automatic project configuration discovery to the nearest repository
|
|
7
|
+
root and, on POSIX systems, trusted ownership and permissions, including
|
|
8
|
+
symlink targets.
|
|
9
|
+
* Added `--project-config` to explicitly select project configuration and
|
|
10
|
+
`--no-config` to disable configuration-file loading.
|
|
11
|
+
* Prevented malformed configuration errors from exposing file contents,
|
|
12
|
+
including API keys, in CLI diagnostics and Python exceptions.
|
|
13
|
+
* Reject API keys containing anything other than printable ASCII.
|
|
14
|
+
* Match URL-scoped API keys regardless of whether the default port is explicit,
|
|
15
|
+
while preserving precedence for exact URL matches.
|
|
16
|
+
* Reject Unicode compatibility forms of traversal and URL syntax in object
|
|
17
|
+
paths.
|
|
18
|
+
* Updated the threat model to clarify configuration and credential boundaries.
|
|
19
|
+
* Updated development dependencies, CI actions, and Docker base images.
|
|
20
|
+
|
|
3
21
|
## 3.2.0
|
|
4
22
|
|
|
5
23
|
* Released on 3rd November 2026.
|
{wlc-3.2.0 → wlc-3.3.0}/PKG-INFO
RENAMED
|
@@ -8,14 +8,26 @@ This file is maintained in https://github.com/WeblateOrg/meta/
|
|
|
8
8
|
|
|
9
9
|
# Weblate security
|
|
10
10
|
|
|
11
|
-
|
|
12
|
-
|
|
11
|
+
Report **low and medium severity** security issues in a Weblate project as
|
|
12
|
+
public GitHub issues in the affected repository.
|
|
13
|
+
|
|
14
|
+
For **high and critical severity** vulnerabilities, **do not open a public
|
|
15
|
+
issue**. Report them privately by emailing
|
|
13
16
|
[security@weblate.org](mailto:security@weblate.org) or selecting
|
|
14
17
|
**Security → Report a vulnerability** in this repository.
|
|
15
18
|
|
|
19
|
+
If you are unsure of the severity, you may start privately. If the security
|
|
20
|
+
team assesses the issue as low or medium severity, we will ask you to continue
|
|
21
|
+
in a public GitHub issue.
|
|
22
|
+
|
|
16
23
|
Please describe the issue, affected versions, and steps to reproduce it, if
|
|
17
24
|
known.
|
|
18
25
|
|
|
26
|
+
Public discussion allows the community to help review and fix low and medium
|
|
27
|
+
severity issues, while private coordination focuses on vulnerabilities with
|
|
28
|
+
serious impact. We publish security advisories only for high and critical
|
|
29
|
+
severity vulnerabilities, not for low or medium severity issues.
|
|
30
|
+
|
|
19
31
|
For security scope and assumptions, consult this repository's threat model if
|
|
20
32
|
it has one, or the [Weblate threat model][threat-model] for the main application.
|
|
21
33
|
The [security documentation][reporting] explains the full reporting and
|
|
@@ -23,7 +23,13 @@ CLI output, or downloaded files.
|
|
|
23
23
|
user-selected output paths are trusted instructions. The operating system,
|
|
24
24
|
runtime, installed package, and these trusted sources are assumed intact.
|
|
25
25
|
- **Checked-out repository:** Automatic discovery loads user configuration and
|
|
26
|
-
then the nearest project configuration in the current directory or
|
|
26
|
+
then the nearest eligible project configuration in the current directory or
|
|
27
|
+
a parent, stopping at the nearest repository root. On POSIX systems discovery
|
|
28
|
+
also stops at directories owned by another non-root user or writable by
|
|
29
|
+
everyone; discovered files must meet the same permission rules. Group-writable
|
|
30
|
+
locations remain trusted. Symlink targets must stay within these discovery
|
|
31
|
+
boundaries. Windows uses repository boundaries without POSIX permission
|
|
32
|
+
checks; access is governed by Windows ACLs.
|
|
27
33
|
Project configuration is intentionally trusted to select the endpoint,
|
|
28
34
|
repository defaults, request parameters, and a matching URL-scoped key. It
|
|
29
35
|
cannot acquire an unrelated unscoped CLI/environment key or supply transport
|
|
@@ -44,7 +50,10 @@ CLI output, or downloaded files.
|
|
|
44
50
|
validate and escape data for their own use.
|
|
45
51
|
|
|
46
52
|
An explicit `--config` loads only the named file and disables user and project
|
|
47
|
-
configuration discovery
|
|
53
|
+
configuration discovery. `--project-config` loads user configuration and the
|
|
54
|
+
explicitly selected project file, bypassing discovery location checks while
|
|
55
|
+
retaining project credential and transport restrictions. `--no-config` disables
|
|
56
|
+
all configuration-file loading; CLI/environment overrides still apply. Direct
|
|
48
57
|
construction of `Weblate` does not discover project configuration. Python
|
|
49
58
|
callers opt into configuration resolution by passing a `WeblateConfig`.
|
|
50
59
|
|
|
@@ -55,19 +64,19 @@ See the [configuration documentation][configuration-docs] and
|
|
|
55
64
|
|
|
56
65
|
### Configuration and credentials
|
|
57
66
|
|
|
58
|
-
- When project
|
|
67
|
+
- When project configuration supplies the otherwise-effective URL, a CLI or
|
|
59
68
|
environment key must be paired with a URL from the same source: `--key` with
|
|
60
69
|
`--url`, or `WLC_KEY` with `WLC_URL`. Repository-selected destinations cannot
|
|
61
70
|
silently receive these unscoped secrets.
|
|
62
|
-
-
|
|
71
|
+
- Project configuration cannot enable authenticated
|
|
63
72
|
insecure HTTP, disable TLS verification, or supply insecure origin entries.
|
|
64
73
|
Transport exceptions require a CLI/environment setting paired with its own
|
|
65
|
-
URL, or a matching origin in trusted user or explicit configuration. An
|
|
74
|
+
URL, or a matching origin in trusted user or complete explicit configuration. An
|
|
66
75
|
unscoped CLI/environment exception cannot be combined with a project URL.
|
|
67
76
|
- Authentication comes only from configured API-key sources. Automatic
|
|
68
77
|
`.netrc`/`NETRC` authentication is disabled, URL-embedded credentials are
|
|
69
|
-
rejected, and keys containing
|
|
70
|
-
before HTTP request construction.
|
|
78
|
+
rejected, and keys containing anything other than printable ASCII are
|
|
79
|
+
rejected before HTTP request construction.
|
|
71
80
|
|
|
72
81
|
These rules protect credential sources and transport policy while preserving
|
|
73
82
|
repository-driven endpoint selection. A key supplied by a repository for its
|
|
@@ -137,7 +146,9 @@ Coverage: [download tests](tests/test_download.py).
|
|
|
137
146
|
guarantee. Do not put secrets in request parameters.
|
|
138
147
|
|
|
139
148
|
Handled CLI errors also mask exact configured authorization values and
|
|
140
|
-
credentials as defense in depth.
|
|
149
|
+
credentials as defense in depth. Configuration syntax diagnostics omit file
|
|
150
|
+
contents, including when Python callers format the resulting exception.
|
|
151
|
+
This does not provide confidentiality against
|
|
141
152
|
the selected server, which already receives the key and can return arbitrary
|
|
142
153
|
content, including transformed or partial secrets. Successful output and Python
|
|
143
154
|
results can likewise contain server-provided secrets. A failure of exact-value
|
|
@@ -165,7 +176,10 @@ Implementation and coverage: [output implementation](wlc/output.py),
|
|
|
165
176
|
the installed CLI.
|
|
166
177
|
- **Repository and server selection:** Review project configuration before
|
|
167
178
|
relying on its endpoint and defaults; use a trusted explicit `--config` to
|
|
168
|
-
|
|
179
|
+
replace discovery or `--no-config` to avoid file loading. Discovery checks do
|
|
180
|
+
not secure a namespace being concurrently replaced, evaluate additional ACL
|
|
181
|
+
grants, or protect against members of a trusted writable group. A CLI or
|
|
182
|
+
environment URL can still use a matching key from
|
|
169
183
|
discovered project configuration; supply a trusted key explicitly when its
|
|
170
184
|
identity matters. Do not commit valuable keys to project configuration.
|
|
171
185
|
Choose a server appropriate for the data and operations sent to it. Server
|
|
@@ -13,7 +13,7 @@ lint = [
|
|
|
13
13
|
{ include-group = "pylint" }
|
|
14
14
|
]
|
|
15
15
|
pre-commit = [
|
|
16
|
-
"prek==0.5.
|
|
16
|
+
"prek==0.5.10"
|
|
17
17
|
]
|
|
18
18
|
pylint = [
|
|
19
19
|
"pylint==4.1.3"
|
|
@@ -25,10 +25,10 @@ test = [
|
|
|
25
25
|
"responses==0.26.3"
|
|
26
26
|
]
|
|
27
27
|
types = [
|
|
28
|
-
"ty==0.0.
|
|
28
|
+
"ty==0.0.100",
|
|
29
29
|
"mypy==2.4.1",
|
|
30
|
-
"types-pyxdg==0.28.0.
|
|
31
|
-
"types-python-dateutil==2.9.0.
|
|
30
|
+
"types-pyxdg==0.28.0.20261106",
|
|
31
|
+
"types-python-dateutil==2.9.0.20261104",
|
|
32
32
|
"types-requests==2.33.0.20261030"
|
|
33
33
|
]
|
|
34
34
|
|
|
@@ -35,6 +35,19 @@ DATA_TEST_BASE = TEST_DATA / "api"
|
|
|
35
35
|
TEST_CONFIG = TEST_DATA / "wlc"
|
|
36
36
|
TEST_SECTION = TEST_DATA / "section"
|
|
37
37
|
BODY_HASH_THRESHOLD = 100
|
|
38
|
+
CONFIG_PARSE_MARKER = "synthetic-config-secret"
|
|
39
|
+
CONFIG_PARSE_ERRORS = (
|
|
40
|
+
(f"[keys]\n{CONFIG_PARSE_MARKER}\n", "ParsingError at line 2"),
|
|
41
|
+
(f"key = {CONFIG_PARSE_MARKER}\n", "MissingSectionHeaderError at line 1"),
|
|
42
|
+
(
|
|
43
|
+
f"[keys]\n{CONFIG_PARSE_MARKER} = first\n{CONFIG_PARSE_MARKER} = second\n",
|
|
44
|
+
"DuplicateOptionError at line 3",
|
|
45
|
+
),
|
|
46
|
+
(
|
|
47
|
+
f"[{CONFIG_PARSE_MARKER}]\n[{CONFIG_PARSE_MARKER}]\n",
|
|
48
|
+
"DuplicateSectionError at line 2",
|
|
49
|
+
),
|
|
50
|
+
)
|
|
38
51
|
|
|
39
52
|
|
|
40
53
|
class BufferedStringIO(StringIO):
|
|
@@ -296,19 +296,31 @@ class WeblateAuthenticationTest(APITest):
|
|
|
296
296
|
obj = Weblate(key="KEY").get_object("acl")
|
|
297
297
|
self.assertEqual(obj.name, "ACL")
|
|
298
298
|
|
|
299
|
-
def
|
|
300
|
-
"""API keys
|
|
301
|
-
for
|
|
302
|
-
|
|
303
|
-
|
|
299
|
+
def test_api_key_rejects_unsafe_characters(self) -> None:
|
|
300
|
+
"""API keys unsafe in a header should be rejected without disclosure."""
|
|
301
|
+
for code in (
|
|
302
|
+
*range(0x20), # C0 controls and line breaks
|
|
303
|
+
*range(0x7F, 0xA0), # DEL and C1 controls
|
|
304
|
+
0xA0, # Encodable as Latin-1, but not ASCII
|
|
305
|
+
0xE9,
|
|
306
|
+
0x2028, # Not encodable as Latin-1
|
|
307
|
+
0x1F511,
|
|
308
|
+
):
|
|
309
|
+
with self.subTest(code=hex(code)):
|
|
310
|
+
key = f"invalid-secret{chr(code)}continuation"
|
|
304
311
|
with self.assertRaises(WeblateException) as raised:
|
|
305
312
|
Weblate(key=key)
|
|
306
313
|
|
|
307
314
|
message = str(raised.exception)
|
|
308
|
-
self.assertIn("
|
|
315
|
+
self.assertIn("printable ASCII", message)
|
|
309
316
|
self.assertNotIn("invalid-secret", message)
|
|
310
317
|
self.assertNotIn("continuation", message)
|
|
311
318
|
|
|
319
|
+
def test_api_key_accepts_printable_ascii(self) -> None:
|
|
320
|
+
"""Every printable ASCII character should remain usable in an API key."""
|
|
321
|
+
key = "".join(chr(code) for code in range(0x20, 0x7F))
|
|
322
|
+
self.assertEqual(Weblate(key=key).key, key)
|
|
323
|
+
|
|
312
324
|
def assert_netrc_authentication_is_ignored(self) -> None:
|
|
313
325
|
"""Assert netrc credentials are not added or used over an API token."""
|
|
314
326
|
for key, expected in (("", None), ("KEY", "Token KEY")):
|
|
@@ -5,14 +5,18 @@
|
|
|
5
5
|
"""Configuration parsing tests."""
|
|
6
6
|
|
|
7
7
|
import os
|
|
8
|
+
from configparser import Error as ConfigParserError
|
|
8
9
|
from pathlib import Path
|
|
9
10
|
from tempfile import TemporaryDirectory
|
|
11
|
+
from traceback import format_exception
|
|
10
12
|
from unittest import TestCase
|
|
11
13
|
from unittest.mock import patch
|
|
12
14
|
|
|
13
15
|
import wlc
|
|
14
16
|
from wlc.config import WeblateConfig, WLCConfigurationError
|
|
15
17
|
|
|
18
|
+
from .test_base import CONFIG_PARSE_ERRORS, CONFIG_PARSE_MARKER
|
|
19
|
+
|
|
16
20
|
TEST_DATA = Path(__file__).parent / "test_data"
|
|
17
21
|
TEST_CONFIG = TEST_DATA / "wlc"
|
|
18
22
|
|
|
@@ -77,7 +81,7 @@ class WeblateConfigTestCase(TestCase):
|
|
|
77
81
|
"""Project discovery terminates at the filesystem root."""
|
|
78
82
|
with (
|
|
79
83
|
patch("wlc.config.Path.cwd", return_value=Path(Path.cwd().anchor)),
|
|
80
|
-
patch.object(
|
|
84
|
+
patch.object(WeblateConfig, "_project_stat", return_value=None),
|
|
81
85
|
):
|
|
82
86
|
self.assertIsNone(WeblateConfig.find_project_config())
|
|
83
87
|
|
|
@@ -86,6 +90,39 @@ class WeblateConfigTestCase(TestCase):
|
|
|
86
90
|
config = WeblateConfig()
|
|
87
91
|
config.load(TEST_CONFIG)
|
|
88
92
|
|
|
93
|
+
def test_malformed_config_hides_contents(self) -> None:
|
|
94
|
+
"""Parser failures omit secrets even in formatted library tracebacks."""
|
|
95
|
+
for content, detail in CONFIG_PARSE_ERRORS:
|
|
96
|
+
with self.subTest(content=content), TemporaryDirectory() as tmpdirname:
|
|
97
|
+
path = Path(tmpdirname) / "invalid.ini"
|
|
98
|
+
path.write_text(content, encoding="utf-8")
|
|
99
|
+
with self.assertRaises(WLCConfigurationError) as raised:
|
|
100
|
+
WeblateConfig().load(path)
|
|
101
|
+
self.assertEqual(
|
|
102
|
+
str(raised.exception),
|
|
103
|
+
f"Invalid configuration file: {path} ({detail})",
|
|
104
|
+
)
|
|
105
|
+
self.assertNotIn(
|
|
106
|
+
CONFIG_PARSE_MARKER, "".join(format_exception(raised.exception))
|
|
107
|
+
)
|
|
108
|
+
|
|
109
|
+
def test_config_parser_error_without_line(self) -> None:
|
|
110
|
+
"""Parser errors without location metadata still omit their raw message."""
|
|
111
|
+
with (
|
|
112
|
+
patch(
|
|
113
|
+
"wlc.config.RawConfigParser.read",
|
|
114
|
+
side_effect=ConfigParserError("synthetic-config-secret"),
|
|
115
|
+
),
|
|
116
|
+
self.assertRaises(WLCConfigurationError) as raised,
|
|
117
|
+
):
|
|
118
|
+
WeblateConfig().load("invalid.ini")
|
|
119
|
+
self.assertEqual(
|
|
120
|
+
str(raised.exception), "Invalid configuration file: invalid.ini (Error)"
|
|
121
|
+
)
|
|
122
|
+
self.assertNotIn(
|
|
123
|
+
"synthetic-config-secret", "".join(format_exception(raised.exception))
|
|
124
|
+
)
|
|
125
|
+
|
|
89
126
|
def test_deprecated_raises_error(self) -> None:
|
|
90
127
|
"""Deprecated configuration parsing raises error."""
|
|
91
128
|
config = WeblateConfig(section="withkey")
|