pywrit 0.2.13__tar.gz → 0.2.15__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.
- {pywrit-0.2.13 → pywrit-0.2.15}/PKG-INFO +13 -4
- pywrit-0.2.13/src/pywrit.egg-info/PKG-INFO → pywrit-0.2.15/README.md +9 -23
- {pywrit-0.2.13 → pywrit-0.2.15}/pyproject.toml +6 -5
- {pywrit-0.2.13 → pywrit-0.2.15}/src/pywrit/__init__.py +1 -1
- {pywrit-0.2.13 → pywrit-0.2.15}/src/pywrit/cli.py +526 -42
- pywrit-0.2.13/README.md → pywrit-0.2.15/src/pywrit.egg-info/PKG-INFO +32 -1
- {pywrit-0.2.13 → pywrit-0.2.15}/src/pywrit.egg-info/SOURCES.txt +1 -0
- {pywrit-0.2.13 → pywrit-0.2.15}/src/pywrit.egg-info/requires.txt +1 -0
- pywrit-0.2.15/tests/test_scan_go.py +344 -0
- {pywrit-0.2.13 → pywrit-0.2.15}/tests/test_scan_tsjs.py +15 -0
- {pywrit-0.2.13 → pywrit-0.2.15}/LICENSE +0 -0
- {pywrit-0.2.13 → pywrit-0.2.15}/setup.cfg +0 -0
- {pywrit-0.2.13 → pywrit-0.2.15}/src/pywrit/client.py +0 -0
- {pywrit-0.2.13 → pywrit-0.2.15}/src/pywrit/errors.py +0 -0
- {pywrit-0.2.13 → pywrit-0.2.15}/src/pywrit.egg-info/dependency_links.txt +0 -0
- {pywrit-0.2.13 → pywrit-0.2.15}/src/pywrit.egg-info/entry_points.txt +0 -0
- {pywrit-0.2.13 → pywrit-0.2.15}/src/pywrit.egg-info/top_level.txt +0 -0
- {pywrit-0.2.13 → pywrit-0.2.15}/tests/test_client.py +0 -0
- {pywrit-0.2.13 → pywrit-0.2.15}/tests/test_scan_json.py +0 -0
- {pywrit-0.2.13 → pywrit-0.2.15}/tests/test_scan_python.py +0 -0
- {pywrit-0.2.13 → pywrit-0.2.15}/tests/test_wrap.py +0 -0
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: pywrit
|
|
3
|
-
Version: 0.2.
|
|
3
|
+
Version: 0.2.15
|
|
4
4
|
Summary: Python client + CLI for Writ — the gate before the write
|
|
5
5
|
License-Expression: MIT
|
|
6
|
-
Project-URL: Homepage, https://
|
|
7
|
-
Project-URL: Documentation, https://withwrit.com
|
|
6
|
+
Project-URL: Homepage, https://withwrit.com
|
|
7
|
+
Project-URL: Documentation, https://docs.withwrit.com
|
|
8
8
|
Requires-Python: >=3.9
|
|
9
9
|
Description-Content-Type: text/markdown
|
|
10
10
|
License-File: LICENSE
|
|
@@ -13,6 +13,7 @@ Provides-Extra: polyglot
|
|
|
13
13
|
Requires-Dist: tree-sitter>=0.23; extra == "polyglot"
|
|
14
14
|
Requires-Dist: tree-sitter-typescript>=0.23; extra == "polyglot"
|
|
15
15
|
Requires-Dist: tree-sitter-javascript>=0.23; extra == "polyglot"
|
|
16
|
+
Requires-Dist: tree-sitter-go>=0.23; extra == "polyglot"
|
|
16
17
|
Provides-Extra: keywords
|
|
17
18
|
Requires-Dist: ai-agents; extra == "keywords"
|
|
18
19
|
Requires-Dist: policy; extra == "keywords"
|
|
@@ -60,7 +61,7 @@ install test.
|
|
|
60
61
|
| --- | --- | --- | --- |
|
|
61
62
|
| Python | Yes | Yes, inserts `_writ_check` gates | Parsed with the stdlib `ast`, no extra needed |
|
|
62
63
|
| TypeScript / JavaScript | Yes, with `pywrit[polyglot]` | No, scan only | Needs the extra: `pip install 'pywrit[polyglot]'`. Without it, the report says so loudly: a warning block names the unscanned files instead of reporting zero findings |
|
|
63
|
-
| Go |
|
|
64
|
+
| Go | Yes, with `pywrit[polyglot]` | No, scan only | First detection family only: database/sql Exec/ExecContext, GORM Create/Save/Update/Updates/Delete, HTTP client writes and http.NewRequest with a write method, generated-client <client>.<Resource>.<New\|Update\|Delete\|Create>; package-level generated clients not yet covered. Without the extra, the report names the unscanned Go files in the same warning block as TS/JS |
|
|
64
65
|
|
|
65
66
|
## 60-second quickstart: scan → wrap → gate
|
|
66
67
|
|
|
@@ -184,6 +185,14 @@ pipeline (twilio-style generated clients, e.g. `twilio-node`).
|
|
|
184
185
|
|
|
185
186
|

|
|
186
187
|
|
|
188
|
+
### Go (scan-only)
|
|
189
|
+
|
|
190
|
+
`writ scan` also finds write sites in Go. It needs the optional extra (tree-sitter based):
|
|
191
|
+
|
|
192
|
+
pip install 'pywrit[polyglot]'
|
|
193
|
+
|
|
194
|
+
Covered in this first family: `database/sql` `Exec` / `ExecContext`, GORM `Create` / `Save` / `Update` / `Updates` / `Delete`, HTTP client `Post` / `Put` / `Patch` / `Delete` and `http.NewRequest` / `NewRequestWithContext` with a write method, and generated-client calls shaped `<client>.<Resource>.<New|Update|Delete|Create>` with an uppercase resource segment (the stripe-go shape). GET/HEAD requests, `db.Query` / `QueryRow`, and bare constructors are not flagged. `_test.go` files and `vendor/` trees are skipped. Go is **scan-only**: `writ scan --apply` never rewrites `.go` files, gate those by hand. Not yet covered: package-level generated clients (`charge.New(...)`, the pre-v87 stripe-go shape), request-pipeline calls with a variable method, and raw-SQL helpers.
|
|
195
|
+
|
|
187
196
|
## GitHub Action
|
|
188
197
|
|
|
189
198
|
Scan every pull request for ungated write sites. Findings land as check
|
|
@@ -1,25 +1,3 @@
|
|
|
1
|
-
Metadata-Version: 2.4
|
|
2
|
-
Name: pywrit
|
|
3
|
-
Version: 0.2.13
|
|
4
|
-
Summary: Python client + CLI for Writ — the gate before the write
|
|
5
|
-
License-Expression: MIT
|
|
6
|
-
Project-URL: Homepage, https://github.com/withwrit/pywrit
|
|
7
|
-
Project-URL: Documentation, https://withwrit.com/docs
|
|
8
|
-
Requires-Python: >=3.9
|
|
9
|
-
Description-Content-Type: text/markdown
|
|
10
|
-
License-File: LICENSE
|
|
11
|
-
Requires-Dist: httpx>=0.27
|
|
12
|
-
Provides-Extra: polyglot
|
|
13
|
-
Requires-Dist: tree-sitter>=0.23; extra == "polyglot"
|
|
14
|
-
Requires-Dist: tree-sitter-typescript>=0.23; extra == "polyglot"
|
|
15
|
-
Requires-Dist: tree-sitter-javascript>=0.23; extra == "polyglot"
|
|
16
|
-
Provides-Extra: keywords
|
|
17
|
-
Requires-Dist: ai-agents; extra == "keywords"
|
|
18
|
-
Requires-Dist: policy; extra == "keywords"
|
|
19
|
-
Requires-Dist: audit-log; extra == "keywords"
|
|
20
|
-
Requires-Dist: guardrails; extra == "keywords"
|
|
21
|
-
Dynamic: license-file
|
|
22
|
-
|
|
23
1
|
# pywrit
|
|
24
2
|
|
|
25
3
|
**Find the dangerous writes in your Python agent's code, then gate it.** `pywrit` is the Python
|
|
@@ -60,7 +38,7 @@ install test.
|
|
|
60
38
|
| --- | --- | --- | --- |
|
|
61
39
|
| Python | Yes | Yes, inserts `_writ_check` gates | Parsed with the stdlib `ast`, no extra needed |
|
|
62
40
|
| TypeScript / JavaScript | Yes, with `pywrit[polyglot]` | No, scan only | Needs the extra: `pip install 'pywrit[polyglot]'`. Without it, the report says so loudly: a warning block names the unscanned files instead of reporting zero findings |
|
|
63
|
-
| Go |
|
|
41
|
+
| Go | Yes, with `pywrit[polyglot]` | No, scan only | First detection family only: database/sql Exec/ExecContext, GORM Create/Save/Update/Updates/Delete, HTTP client writes and http.NewRequest with a write method, generated-client <client>.<Resource>.<New\|Update\|Delete\|Create>; package-level generated clients not yet covered. Without the extra, the report names the unscanned Go files in the same warning block as TS/JS |
|
|
64
42
|
|
|
65
43
|
## 60-second quickstart: scan → wrap → gate
|
|
66
44
|
|
|
@@ -184,6 +162,14 @@ pipeline (twilio-style generated clients, e.g. `twilio-node`).
|
|
|
184
162
|
|
|
185
163
|

|
|
186
164
|
|
|
165
|
+
### Go (scan-only)
|
|
166
|
+
|
|
167
|
+
`writ scan` also finds write sites in Go. It needs the optional extra (tree-sitter based):
|
|
168
|
+
|
|
169
|
+
pip install 'pywrit[polyglot]'
|
|
170
|
+
|
|
171
|
+
Covered in this first family: `database/sql` `Exec` / `ExecContext`, GORM `Create` / `Save` / `Update` / `Updates` / `Delete`, HTTP client `Post` / `Put` / `Patch` / `Delete` and `http.NewRequest` / `NewRequestWithContext` with a write method, and generated-client calls shaped `<client>.<Resource>.<New|Update|Delete|Create>` with an uppercase resource segment (the stripe-go shape). GET/HEAD requests, `db.Query` / `QueryRow`, and bare constructors are not flagged. `_test.go` files and `vendor/` trees are skipped. Go is **scan-only**: `writ scan --apply` never rewrites `.go` files, gate those by hand. Not yet covered: package-level generated clients (`charge.New(...)`, the pre-v87 stripe-go shape), request-pipeline calls with a variable method, and raw-SQL helpers.
|
|
172
|
+
|
|
187
173
|
## GitHub Action
|
|
188
174
|
|
|
189
175
|
Scan every pull request for ungated write sites. Findings land as check
|
|
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
|
|
|
4
4
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "pywrit"
|
|
7
|
-
version = "0.2.
|
|
7
|
+
version = "0.2.15"
|
|
8
8
|
description = "Python client + CLI for Writ — the gate before the write"
|
|
9
9
|
readme = "README.md"
|
|
10
10
|
license = "MIT"
|
|
@@ -12,18 +12,19 @@ requires-python = ">=3.9"
|
|
|
12
12
|
dependencies = ["httpx>=0.27"]
|
|
13
13
|
|
|
14
14
|
[project.optional-dependencies]
|
|
15
|
-
# `pip install 'pywrit[polyglot]'`: lets `writ scan` parse TypeScript
|
|
16
|
-
# JavaScript (scan only). Python scanning never needs it.
|
|
15
|
+
# `pip install 'pywrit[polyglot]'`: lets `writ scan` parse TypeScript,
|
|
16
|
+
# JavaScript, and Go (scan only). Python scanning never needs it.
|
|
17
17
|
polyglot = [
|
|
18
18
|
"tree-sitter>=0.23",
|
|
19
19
|
"tree-sitter-typescript>=0.23",
|
|
20
20
|
"tree-sitter-javascript>=0.23",
|
|
21
|
+
"tree-sitter-go>=0.23",
|
|
21
22
|
]
|
|
22
23
|
keywords = ["ai-agents", "policy", "audit-log", "guardrails"]
|
|
23
24
|
|
|
24
25
|
[project.urls]
|
|
25
|
-
Homepage = "https://
|
|
26
|
-
Documentation = "https://withwrit.com
|
|
26
|
+
Homepage = "https://withwrit.com"
|
|
27
|
+
Documentation = "https://docs.withwrit.com"
|
|
27
28
|
|
|
28
29
|
[project.scripts]
|
|
29
30
|
writ = "pywrit.cli:main"
|