leftblock 0.3.2__tar.gz → 0.3.3__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.
- {leftblock-0.3.2 → leftblock-0.3.3}/PKG-INFO +4 -15
- {leftblock-0.3.2 → leftblock-0.3.3}/README.md +3 -14
- {leftblock-0.3.2 → leftblock-0.3.3}/leftblock/data/gitleaks.toml +14 -0
- {leftblock-0.3.2 → leftblock-0.3.3}/leftblock.egg-info/PKG-INFO +4 -15
- {leftblock-0.3.2 → leftblock-0.3.3}/pyproject.toml +1 -1
- {leftblock-0.3.2 → leftblock-0.3.3}/tests/test_branding.py +2 -2
- {leftblock-0.3.2 → leftblock-0.3.3}/tests/test_false_positives.py +42 -0
- {leftblock-0.3.2 → leftblock-0.3.3}/LICENSE +0 -0
- {leftblock-0.3.2 → leftblock-0.3.3}/leftblock/__init__.py +0 -0
- {leftblock-0.3.2 → leftblock-0.3.3}/leftblock/cli.py +0 -0
- {leftblock-0.3.2 → leftblock-0.3.3}/leftblock/core.py +0 -0
- {leftblock-0.3.2 → leftblock-0.3.3}/leftblock/hooks.py +0 -0
- {leftblock-0.3.2 → leftblock-0.3.3}/leftblock/merge.py +0 -0
- {leftblock-0.3.2 → leftblock-0.3.3}/leftblock.egg-info/SOURCES.txt +0 -0
- {leftblock-0.3.2 → leftblock-0.3.3}/leftblock.egg-info/dependency_links.txt +0 -0
- {leftblock-0.3.2 → leftblock-0.3.3}/leftblock.egg-info/entry_points.txt +0 -0
- {leftblock-0.3.2 → leftblock-0.3.3}/leftblock.egg-info/requires.txt +0 -0
- {leftblock-0.3.2 → leftblock-0.3.3}/leftblock.egg-info/top_level.txt +0 -0
- {leftblock-0.3.2 → leftblock-0.3.3}/setup.cfg +0 -0
- {leftblock-0.3.2 → leftblock-0.3.3}/tests/test_commit_gate.py +0 -0
- {leftblock-0.3.2 → leftblock-0.3.3}/tests/test_default_config.py +0 -0
- {leftblock-0.3.2 → leftblock-0.3.3}/tests/test_install.py +0 -0
- {leftblock-0.3.2 → leftblock-0.3.3}/tests/test_local_install.py +0 -0
- {leftblock-0.3.2 → leftblock-0.3.3}/tests/test_sensitive_rules.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: leftblock
|
|
3
|
-
Version: 0.3.
|
|
3
|
+
Version: 0.3.3
|
|
4
4
|
Summary: LeftBlock: a pluggable inspection gate for Git commits
|
|
5
5
|
License: MIT License
|
|
6
6
|
|
|
@@ -69,7 +69,7 @@ LeftBlock has been donated to **Data Parade (`DataParade-io`)**, alongside
|
|
|
69
69
|
BotSpy. Its repository is
|
|
70
70
|
[DataParade-io/LeftBlock](https://github.com/DataParade-io/LeftBlock).
|
|
71
71
|
|
|
72
|
-
|
|
72
|
+
LeftBlock is published on PyPI as `leftblock`. The current source uses `leftblock` as its
|
|
73
73
|
distribution, Python package, and CLI name. It includes no earlier package
|
|
74
74
|
aliases or command shims. The CLI is also available as
|
|
75
75
|
`python -m leftblock.cli`.
|
|
@@ -121,26 +121,15 @@ configures the integration; it does not install scanner binaries.
|
|
|
121
121
|
|
|
122
122
|
**1. Install the CLI:**
|
|
123
123
|
|
|
124
|
-
|
|
125
|
-
these changes. From that checkout, in the intended Python environment:
|
|
124
|
+
In the intended Python environment:
|
|
126
125
|
|
|
127
126
|
```bash
|
|
128
|
-
python -m pip install .
|
|
127
|
+
python -m pip install leftblock==0.3.3
|
|
129
128
|
python -m leftblock.cli --help
|
|
130
129
|
```
|
|
131
130
|
|
|
132
|
-
The installation is from local source, not a published release. Confirm the
|
|
133
|
-
checkout's commit and validation results before installing; do not assume
|
|
134
|
-
`main` or an earlier feature-branch commit contains this implementation.
|
|
135
131
|
Follow the migration checklist above before replacing an earlier setup.
|
|
136
132
|
|
|
137
|
-
After the release is published and its distribution identity is verified,
|
|
138
|
-
the versioned package installation will be:
|
|
139
|
-
|
|
140
|
-
```bash
|
|
141
|
-
python -m pip install leftblock==0.3.2
|
|
142
|
-
```
|
|
143
|
-
|
|
144
133
|
**2. Enable local staged protection:**
|
|
145
134
|
|
|
146
135
|
```bash
|
|
@@ -36,7 +36,7 @@ LeftBlock has been donated to **Data Parade (`DataParade-io`)**, alongside
|
|
|
36
36
|
BotSpy. Its repository is
|
|
37
37
|
[DataParade-io/LeftBlock](https://github.com/DataParade-io/LeftBlock).
|
|
38
38
|
|
|
39
|
-
|
|
39
|
+
LeftBlock is published on PyPI as `leftblock`. The current source uses `leftblock` as its
|
|
40
40
|
distribution, Python package, and CLI name. It includes no earlier package
|
|
41
41
|
aliases or command shims. The CLI is also available as
|
|
42
42
|
`python -m leftblock.cli`.
|
|
@@ -88,26 +88,15 @@ configures the integration; it does not install scanner binaries.
|
|
|
88
88
|
|
|
89
89
|
**1. Install the CLI:**
|
|
90
90
|
|
|
91
|
-
|
|
92
|
-
these changes. From that checkout, in the intended Python environment:
|
|
91
|
+
In the intended Python environment:
|
|
93
92
|
|
|
94
93
|
```bash
|
|
95
|
-
python -m pip install .
|
|
94
|
+
python -m pip install leftblock==0.3.3
|
|
96
95
|
python -m leftblock.cli --help
|
|
97
96
|
```
|
|
98
97
|
|
|
99
|
-
The installation is from local source, not a published release. Confirm the
|
|
100
|
-
checkout's commit and validation results before installing; do not assume
|
|
101
|
-
`main` or an earlier feature-branch commit contains this implementation.
|
|
102
98
|
Follow the migration checklist above before replacing an earlier setup.
|
|
103
99
|
|
|
104
|
-
After the release is published and its distribution identity is verified,
|
|
105
|
-
the versioned package installation will be:
|
|
106
|
-
|
|
107
|
-
```bash
|
|
108
|
-
python -m pip install leftblock==0.3.2
|
|
109
|
-
```
|
|
110
|
-
|
|
111
100
|
**2. Enable local staged protection:**
|
|
112
101
|
|
|
113
102
|
```bash
|
|
@@ -165,6 +165,20 @@ regexes = [
|
|
|
165
165
|
'''^\n? "(?:[A-Za-z][A-Za-z0-9_]*-)+[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}\.json"[ \t]*:[ \t]*-?(?:0|[1-9][0-9]*)(?:\.[0-9]+)?(?:[eE][+-]?[0-9]+)?,?[ \t]*\r?$''',
|
|
166
166
|
]
|
|
167
167
|
|
|
168
|
+
# Kanbus 0.40+ records a public per-project UUID v4 in .kanbus.yml so every
|
|
169
|
+
# clone shares one realtime topic. Accept only the top-level YAML key with a
|
|
170
|
+
# version-4 UUID; indented keys, other keys and other files stay detected.
|
|
171
|
+
[[rules.allowlists]]
|
|
172
|
+
description = "Kanbus project_id in .kanbus.yml"
|
|
173
|
+
condition = "AND"
|
|
174
|
+
paths = [
|
|
175
|
+
'''(^|/)\.kanbus\.yml$''',
|
|
176
|
+
]
|
|
177
|
+
regexTarget = "line"
|
|
178
|
+
regexes = [
|
|
179
|
+
'''^\n?project_id:[ \t]*[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}[ \t]*\r?$''',
|
|
180
|
+
]
|
|
181
|
+
|
|
168
182
|
[[rules]]
|
|
169
183
|
id = "leftblock-actor-id"
|
|
170
184
|
description = "actor/user/author ID value"
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: leftblock
|
|
3
|
-
Version: 0.3.
|
|
3
|
+
Version: 0.3.3
|
|
4
4
|
Summary: LeftBlock: a pluggable inspection gate for Git commits
|
|
5
5
|
License: MIT License
|
|
6
6
|
|
|
@@ -69,7 +69,7 @@ LeftBlock has been donated to **Data Parade (`DataParade-io`)**, alongside
|
|
|
69
69
|
BotSpy. Its repository is
|
|
70
70
|
[DataParade-io/LeftBlock](https://github.com/DataParade-io/LeftBlock).
|
|
71
71
|
|
|
72
|
-
|
|
72
|
+
LeftBlock is published on PyPI as `leftblock`. The current source uses `leftblock` as its
|
|
73
73
|
distribution, Python package, and CLI name. It includes no earlier package
|
|
74
74
|
aliases or command shims. The CLI is also available as
|
|
75
75
|
`python -m leftblock.cli`.
|
|
@@ -121,26 +121,15 @@ configures the integration; it does not install scanner binaries.
|
|
|
121
121
|
|
|
122
122
|
**1. Install the CLI:**
|
|
123
123
|
|
|
124
|
-
|
|
125
|
-
these changes. From that checkout, in the intended Python environment:
|
|
124
|
+
In the intended Python environment:
|
|
126
125
|
|
|
127
126
|
```bash
|
|
128
|
-
python -m pip install .
|
|
127
|
+
python -m pip install leftblock==0.3.3
|
|
129
128
|
python -m leftblock.cli --help
|
|
130
129
|
```
|
|
131
130
|
|
|
132
|
-
The installation is from local source, not a published release. Confirm the
|
|
133
|
-
checkout's commit and validation results before installing; do not assume
|
|
134
|
-
`main` or an earlier feature-branch commit contains this implementation.
|
|
135
131
|
Follow the migration checklist above before replacing an earlier setup.
|
|
136
132
|
|
|
137
|
-
After the release is published and its distribution identity is verified,
|
|
138
|
-
the versioned package installation will be:
|
|
139
|
-
|
|
140
|
-
```bash
|
|
141
|
-
python -m pip install leftblock==0.3.2
|
|
142
|
-
```
|
|
143
|
-
|
|
144
133
|
**2. Enable local staged protection:**
|
|
145
134
|
|
|
146
135
|
```bash
|
|
@@ -196,7 +196,7 @@ class DistributionOwnershipTests(unittest.TestCase):
|
|
|
196
196
|
|
|
197
197
|
def test_distribution_owns_only_leftblock_command(self):
|
|
198
198
|
self.assertIn("\nName: leftblock\n", "\n" + self.metadata)
|
|
199
|
-
self.assertIn("\nVersion: 0.3.
|
|
199
|
+
self.assertIn("\nVersion: 0.3.3\n", "\n" + self.metadata)
|
|
200
200
|
self.assertIn("\nLicense-File: LICENSE\n", "\n" + self.metadata)
|
|
201
201
|
self.assertEqual(dict(self.entry_points["console_scripts"]), {"leftblock": "leftblock.cli:main"})
|
|
202
202
|
|
|
@@ -208,7 +208,7 @@ class DistributionOwnershipTests(unittest.TestCase):
|
|
|
208
208
|
self.assertIn(name, self.names)
|
|
209
209
|
self.assertEqual(
|
|
210
210
|
{name.split("/")[0] for name in self.names},
|
|
211
|
-
{"leftblock", "leftblock-0.3.
|
|
211
|
+
{"leftblock", "leftblock-0.3.3.dist-info"},
|
|
212
212
|
)
|
|
213
213
|
self.assertEqual(self.rules, (PROJECT_ROOT / "leftblock/data/gitleaks.toml").read_bytes())
|
|
214
214
|
self.assertEqual(self.license, (PROJECT_ROOT / "LICENSE").read_bytes())
|
|
@@ -81,6 +81,48 @@ class KanbusIdTests(unittest.TestCase):
|
|
|
81
81
|
}))
|
|
82
82
|
|
|
83
83
|
|
|
84
|
+
def _uuid4(rng):
|
|
85
|
+
return "%s-%s-4%s-%s%s-%s" % (
|
|
86
|
+
rand_hex(rng, 8), rand_hex(rng, 4), rand_hex(rng, 3),
|
|
87
|
+
rng.choice("89ab"), rand_hex(rng, 3), rand_hex(rng, 12))
|
|
88
|
+
|
|
89
|
+
|
|
90
|
+
@unittest.skipIf(GITLEAKS is None, "gitleaks binary not installed")
|
|
91
|
+
class KanbusProjectIdTests(unittest.TestCase):
|
|
92
|
+
def _yml(self, body):
|
|
93
|
+
return scan_and_rule_ids({".kanbus.yml": body})
|
|
94
|
+
|
|
95
|
+
def test_top_level_project_id_passes(self):
|
|
96
|
+
rng = _rng()
|
|
97
|
+
self.assertEqual(self._yml(
|
|
98
|
+
"project_key: kbs\nproject_id: %s\n" % _uuid4(rng)), [])
|
|
99
|
+
self.assertEqual(scan_and_rule_ids({
|
|
100
|
+
"sub/.kanbus.yml": "project_id: %s \n" % _uuid4(rng)}), [])
|
|
101
|
+
|
|
102
|
+
def test_indented_project_id_is_flagged(self):
|
|
103
|
+
self.assertEqual(self._yml(
|
|
104
|
+
"realtime:\n project_id: %s\n" % _uuid4(_rng())),
|
|
105
|
+
["leftblock-session-uuid"])
|
|
106
|
+
|
|
107
|
+
def test_other_key_in_kanbus_yml_is_flagged(self):
|
|
108
|
+
self.assertEqual(self._yml("session_id: %s\n" % _uuid4(_rng())),
|
|
109
|
+
["leftblock-session-uuid"])
|
|
110
|
+
|
|
111
|
+
def test_project_id_outside_kanbus_yml_is_flagged(self):
|
|
112
|
+
self.assertEqual(scan_and_rule_ids({
|
|
113
|
+
"config.yml": "project_id: %s\n" % _uuid4(_rng())}),
|
|
114
|
+
["leftblock-session-uuid"])
|
|
115
|
+
|
|
116
|
+
def test_non_v4_uuid_is_flagged(self):
|
|
117
|
+
# Version nibble 1, not 4: only UUID v4 project ids are exempt.
|
|
118
|
+
rng = _rng()
|
|
119
|
+
v1 = "%s-%s-1%s-a%s-%s" % (rand_hex(rng, 8), rand_hex(rng, 4),
|
|
120
|
+
rand_hex(rng, 3), rand_hex(rng, 3),
|
|
121
|
+
rand_hex(rng, 12))
|
|
122
|
+
self.assertEqual(self._yml("project_id: %s\n" % v1),
|
|
123
|
+
["leftblock-session-uuid"])
|
|
124
|
+
|
|
125
|
+
|
|
84
126
|
@unittest.skipIf(GITLEAKS is None, "gitleaks binary not installed")
|
|
85
127
|
class MergeScopeTests(unittest.TestCase):
|
|
86
128
|
def setUp(self):
|
|
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
|