leakkill 0.3.0__tar.gz → 0.4.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.
- {leakkill-0.3.0/src/leakkill.egg-info → leakkill-0.4.1}/PKG-INFO +38 -14
- {leakkill-0.3.0 → leakkill-0.4.1}/README.md +37 -13
- {leakkill-0.3.0 → leakkill-0.4.1}/src/leakkill/__init__.py +1 -1
- {leakkill-0.3.0 → leakkill-0.4.1}/src/leakkill/cli.py +27 -4
- {leakkill-0.3.0 → leakkill-0.4.1}/src/leakkill/providers.py +84 -4
- {leakkill-0.3.0 → leakkill-0.4.1}/src/leakkill/scanner.py +16 -2
- {leakkill-0.3.0 → leakkill-0.4.1/src/leakkill.egg-info}/PKG-INFO +38 -14
- {leakkill-0.3.0 → leakkill-0.4.1}/tests/test_cli.py +26 -0
- {leakkill-0.3.0 → leakkill-0.4.1}/tests/test_providers.py +45 -0
- {leakkill-0.3.0 → leakkill-0.4.1}/tests/test_scanner.py +23 -0
- {leakkill-0.3.0 → leakkill-0.4.1}/LICENSE +0 -0
- {leakkill-0.3.0 → leakkill-0.4.1}/pyproject.toml +0 -0
- {leakkill-0.3.0 → leakkill-0.4.1}/setup.cfg +0 -0
- {leakkill-0.3.0 → leakkill-0.4.1}/src/leakkill/__main__.py +0 -0
- {leakkill-0.3.0 → leakkill-0.4.1}/src/leakkill/aws.py +0 -0
- {leakkill-0.3.0 → leakkill-0.4.1}/src/leakkill/guard.py +0 -0
- {leakkill-0.3.0 → leakkill-0.4.1}/src/leakkill/report.py +0 -0
- {leakkill-0.3.0 → leakkill-0.4.1}/src/leakkill.egg-info/SOURCES.txt +0 -0
- {leakkill-0.3.0 → leakkill-0.4.1}/src/leakkill.egg-info/dependency_links.txt +0 -0
- {leakkill-0.3.0 → leakkill-0.4.1}/src/leakkill.egg-info/entry_points.txt +0 -0
- {leakkill-0.3.0 → leakkill-0.4.1}/src/leakkill.egg-info/top_level.txt +0 -0
- {leakkill-0.3.0 → leakkill-0.4.1}/tests/test_guard.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: leakkill
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.4.1
|
|
4
4
|
Summary: Find leaked secrets, check if they're live, revoke them in one command, and keep them out of AI coding agents
|
|
5
5
|
Author-email: Ayush <andymylove24@gmail.com>
|
|
6
6
|
License-Expression: MIT
|
|
@@ -71,8 +71,9 @@ including secrets you already "deleted"), `--exclude-tests` and `--json`.
|
|
|
71
71
|
| Slack tokens (`xox…`) | ✅ user and workspace | ✅ `auth.revoke` |
|
|
72
72
|
| Discord webhooks | ✅ server and channel | ✅ deletes the webhook |
|
|
73
73
|
| AWS access key and secret | ✅ IAM ARN and account (STS, needs no permissions) | ⚠️ deactivates the key if it has `iam:UpdateAccessKey`, otherwise console steps |
|
|
74
|
-
|
|
|
75
|
-
|
|
|
74
|
+
| SendGrid (`SG.`) | ✅ scopes | ✅ the key deletes itself if it has API-key permissions |
|
|
75
|
+
| Stripe (live and test keys), OpenAI, Anthropic, OpenRouter, Groq, Hugging Face, Replicate, DigitalOcean, npm, Telegram, Slack webhooks | ✅ (account or username where the API returns it) | ❌ the provider has no API for it, so you get the exact page or command |
|
|
76
|
+
| Google API keys, Shopify, PyPI, Docker Hub, Twilio, Postman, Perplexity, Linear, Azure Storage, private keys, JWTs, credentials in URLs, generic high-entropy secrets | detected, not verified | step-by-step rotation guidance |
|
|
76
77
|
|
|
77
78
|
## How it compares
|
|
78
79
|
|
|
@@ -80,9 +81,9 @@ including secrets you already "deleted"), `--exclude-tests` and `--json`.
|
|
|
80
81
|
|---|---|---|---|---|---|
|
|
81
82
|
| Price | **Free (MIT)** | Free (MIT) | Free (AGPL) | Free for individuals, roughly $15–30/dev/month for teams | Free on public repos, $19/committer/month on private |
|
|
82
83
|
| Runs fully local | ✅ | ✅ | ✅ | ❌ SaaS | ❌ GitHub only |
|
|
83
|
-
| Detectors |
|
|
84
|
-
| Checks if a key is live | ✅
|
|
85
|
-
| Revokes from the CLI | ✅
|
|
84
|
+
| Detectors | 31 | 150+ | 800+ | 550+ | [provider list](https://docs.github.com/en/code-security/secret-scanning/introduction/supported-secret-scanning-patterns) |
|
|
85
|
+
| Checks if a key is live | ✅ 17 providers | ❌ | ✅ (its main strength) | ✅ | ✅ some |
|
|
86
|
+
| Revokes from the CLI | ✅ 6 providers | ❌ | ❌ (Enterprise) | partial | ❌ |
|
|
86
87
|
| Incident report and history-purge steps | ✅ Markdown file | ❌ | ❌ | ✅ dashboard and playbooks | ❌ |
|
|
87
88
|
| Guards AI coding agents | ✅ Claude Code hooks | ❌ | ❌ | ❌ | ❌ |
|
|
88
89
|
| Dependencies | none | Go binary | Go binary | CLI + account | GitHub |
|
|
@@ -92,11 +93,20 @@ if breadth of detection matters most, run Gitleaks or TruffleHog alongside leakk
|
|
|
92
93
|
|
|
93
94
|
### Tested with real credentials
|
|
94
95
|
|
|
95
|
-
End to end on Windows with
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
96
|
+
End to end on Windows with real, throwaway credentials:
|
|
97
|
+
|
|
98
|
+
| Credential | `verify` | `revoke --yes` | `verify` again |
|
|
99
|
+
|---|---|---|---|
|
|
100
|
+
| GitHub token | LIVE, correct user | REVOKED (HTTP 202) | DEAD |
|
|
101
|
+
| Discord webhook | LIVE, correct server and channel | REVOKED (HTTP 204) | DEAD |
|
|
102
|
+
| Slack bot token | LIVE, correct bot and workspace | REVOKED | DEAD (the app was uninstalled, as Slack documents) |
|
|
103
|
+
| Slack webhook | LIVE | (died with the app) | DEAD |
|
|
104
|
+
| Stripe test key | LIVE, correct account, "test mode" | manual roll in dashboard | |
|
|
105
|
+
| Hugging Face token | LIVE, correct user and token role | manual delete | |
|
|
106
|
+
|
|
107
|
+
Against the real AWS, GitLab, Anthropic and npm APIs, invalid keys are correctly reported DEAD.
|
|
108
|
+
Providers not yet tested with a live key (OpenAI, OpenRouter, Groq, Replicate, DigitalOcean,
|
|
109
|
+
SendGrid, Telegram) are covered by tests using simulated API responses.
|
|
100
110
|
|
|
101
111
|
### Benchmark (reproducible, run October 2026)
|
|
102
112
|
|
|
@@ -150,13 +160,27 @@ This was tested live with the Claude Code CLI: prompts with keys, `Read .env`, `
|
|
|
150
160
|
command that builds the file name at runtime can get past it. Pair it with OS-level permissions for
|
|
151
161
|
hard guarantees.
|
|
152
162
|
|
|
153
|
-
## Use in CI (GitHub
|
|
163
|
+
## Use in CI (GitHub Action)
|
|
154
164
|
|
|
155
165
|
```yaml
|
|
156
|
-
-
|
|
157
|
-
-
|
|
166
|
+
- uses: actions/checkout@v4
|
|
167
|
+
- uses: ayushanand27/leakkill@v0
|
|
158
168
|
```
|
|
159
169
|
|
|
170
|
+
The build fails if a secret is found, and the incident report appears in the job summary. Options:
|
|
171
|
+
|
|
172
|
+
```yaml
|
|
173
|
+
- uses: ayushanand27/leakkill@v0
|
|
174
|
+
with:
|
|
175
|
+
path: . # files or directories to scan
|
|
176
|
+
exclude-tests: true # skip test_* files and tests/ dirs
|
|
177
|
+
history: true # scan every commit (needs `fetch-depth: 0` on checkout)
|
|
178
|
+
verify: true # check secrets with their providers; fail only if one is LIVE
|
|
179
|
+
```
|
|
180
|
+
|
|
181
|
+
The action exposes `found` (the number of unique secrets) as an output. Outside GitHub Actions, use
|
|
182
|
+
`pip install leakkill && leakkill scan .`.
|
|
183
|
+
|
|
160
184
|
## Use with the pre-commit framework
|
|
161
185
|
|
|
162
186
|
```yaml
|
|
@@ -52,8 +52,9 @@ including secrets you already "deleted"), `--exclude-tests` and `--json`.
|
|
|
52
52
|
| Slack tokens (`xox…`) | ✅ user and workspace | ✅ `auth.revoke` |
|
|
53
53
|
| Discord webhooks | ✅ server and channel | ✅ deletes the webhook |
|
|
54
54
|
| AWS access key and secret | ✅ IAM ARN and account (STS, needs no permissions) | ⚠️ deactivates the key if it has `iam:UpdateAccessKey`, otherwise console steps |
|
|
55
|
-
|
|
|
56
|
-
|
|
|
55
|
+
| SendGrid (`SG.`) | ✅ scopes | ✅ the key deletes itself if it has API-key permissions |
|
|
56
|
+
| Stripe (live and test keys), OpenAI, Anthropic, OpenRouter, Groq, Hugging Face, Replicate, DigitalOcean, npm, Telegram, Slack webhooks | ✅ (account or username where the API returns it) | ❌ the provider has no API for it, so you get the exact page or command |
|
|
57
|
+
| Google API keys, Shopify, PyPI, Docker Hub, Twilio, Postman, Perplexity, Linear, Azure Storage, private keys, JWTs, credentials in URLs, generic high-entropy secrets | detected, not verified | step-by-step rotation guidance |
|
|
57
58
|
|
|
58
59
|
## How it compares
|
|
59
60
|
|
|
@@ -61,9 +62,9 @@ including secrets you already "deleted"), `--exclude-tests` and `--json`.
|
|
|
61
62
|
|---|---|---|---|---|---|
|
|
62
63
|
| Price | **Free (MIT)** | Free (MIT) | Free (AGPL) | Free for individuals, roughly $15–30/dev/month for teams | Free on public repos, $19/committer/month on private |
|
|
63
64
|
| Runs fully local | ✅ | ✅ | ✅ | ❌ SaaS | ❌ GitHub only |
|
|
64
|
-
| Detectors |
|
|
65
|
-
| Checks if a key is live | ✅
|
|
66
|
-
| Revokes from the CLI | ✅
|
|
65
|
+
| Detectors | 31 | 150+ | 800+ | 550+ | [provider list](https://docs.github.com/en/code-security/secret-scanning/introduction/supported-secret-scanning-patterns) |
|
|
66
|
+
| Checks if a key is live | ✅ 17 providers | ❌ | ✅ (its main strength) | ✅ | ✅ some |
|
|
67
|
+
| Revokes from the CLI | ✅ 6 providers | ❌ | ❌ (Enterprise) | partial | ❌ |
|
|
67
68
|
| Incident report and history-purge steps | ✅ Markdown file | ❌ | ❌ | ✅ dashboard and playbooks | ❌ |
|
|
68
69
|
| Guards AI coding agents | ✅ Claude Code hooks | ❌ | ❌ | ❌ | ❌ |
|
|
69
70
|
| Dependencies | none | Go binary | Go binary | CLI + account | GitHub |
|
|
@@ -73,11 +74,20 @@ if breadth of detection matters most, run Gitleaks or TruffleHog alongside leakk
|
|
|
73
74
|
|
|
74
75
|
### Tested with real credentials
|
|
75
76
|
|
|
76
|
-
End to end on Windows with
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
77
|
+
End to end on Windows with real, throwaway credentials:
|
|
78
|
+
|
|
79
|
+
| Credential | `verify` | `revoke --yes` | `verify` again |
|
|
80
|
+
|---|---|---|---|
|
|
81
|
+
| GitHub token | LIVE, correct user | REVOKED (HTTP 202) | DEAD |
|
|
82
|
+
| Discord webhook | LIVE, correct server and channel | REVOKED (HTTP 204) | DEAD |
|
|
83
|
+
| Slack bot token | LIVE, correct bot and workspace | REVOKED | DEAD (the app was uninstalled, as Slack documents) |
|
|
84
|
+
| Slack webhook | LIVE | (died with the app) | DEAD |
|
|
85
|
+
| Stripe test key | LIVE, correct account, "test mode" | manual roll in dashboard | |
|
|
86
|
+
| Hugging Face token | LIVE, correct user and token role | manual delete | |
|
|
87
|
+
|
|
88
|
+
Against the real AWS, GitLab, Anthropic and npm APIs, invalid keys are correctly reported DEAD.
|
|
89
|
+
Providers not yet tested with a live key (OpenAI, OpenRouter, Groq, Replicate, DigitalOcean,
|
|
90
|
+
SendGrid, Telegram) are covered by tests using simulated API responses.
|
|
81
91
|
|
|
82
92
|
### Benchmark (reproducible, run October 2026)
|
|
83
93
|
|
|
@@ -131,13 +141,27 @@ This was tested live with the Claude Code CLI: prompts with keys, `Read .env`, `
|
|
|
131
141
|
command that builds the file name at runtime can get past it. Pair it with OS-level permissions for
|
|
132
142
|
hard guarantees.
|
|
133
143
|
|
|
134
|
-
## Use in CI (GitHub
|
|
144
|
+
## Use in CI (GitHub Action)
|
|
135
145
|
|
|
136
146
|
```yaml
|
|
137
|
-
-
|
|
138
|
-
-
|
|
147
|
+
- uses: actions/checkout@v4
|
|
148
|
+
- uses: ayushanand27/leakkill@v0
|
|
139
149
|
```
|
|
140
150
|
|
|
151
|
+
The build fails if a secret is found, and the incident report appears in the job summary. Options:
|
|
152
|
+
|
|
153
|
+
```yaml
|
|
154
|
+
- uses: ayushanand27/leakkill@v0
|
|
155
|
+
with:
|
|
156
|
+
path: . # files or directories to scan
|
|
157
|
+
exclude-tests: true # skip test_* files and tests/ dirs
|
|
158
|
+
history: true # scan every commit (needs `fetch-depth: 0` on checkout)
|
|
159
|
+
verify: true # check secrets with their providers; fail only if one is LIVE
|
|
160
|
+
```
|
|
161
|
+
|
|
162
|
+
The action exposes `found` (the number of unique secrets) as an output. Outside GitHub Actions, use
|
|
163
|
+
`pip install leakkill && leakkill scan .`.
|
|
164
|
+
|
|
141
165
|
## Use with the pre-commit framework
|
|
142
166
|
|
|
143
167
|
```yaml
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
"""leakkill: find leaked secrets, check if they're live, revoke them, and guard AI coding agents."""
|
|
2
|
-
__version__ = "0.
|
|
2
|
+
__version__ = "0.4.1"
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
Common options: --staged (pre-commit), --history (all commits), --exclude-tests, --json.
|
|
12
12
|
Ignore a line with `leakkill:ignore`; ignore paths with globs in .leakkillignore.
|
|
13
13
|
"""
|
|
14
|
-
import argparse, json, os, sys
|
|
14
|
+
import argparse, difflib, json, os, sys
|
|
15
15
|
from concurrent.futures import ThreadPoolExecutor
|
|
16
16
|
from dataclasses import dataclass
|
|
17
17
|
|
|
@@ -92,6 +92,10 @@ def summary(items):
|
|
|
92
92
|
return s + "."
|
|
93
93
|
|
|
94
94
|
|
|
95
|
+
def _target(args):
|
|
96
|
+
return "git history" if args.history else "staged changes" if args.staged else " ".join(args.paths or ["."])
|
|
97
|
+
|
|
98
|
+
|
|
95
99
|
def cmd_scan(args, verify=False):
|
|
96
100
|
items = collect(args)
|
|
97
101
|
if verify and items:
|
|
@@ -101,6 +105,9 @@ def cmd_scan(args, verify=False):
|
|
|
101
105
|
else:
|
|
102
106
|
print_items(items)
|
|
103
107
|
print(summary(items))
|
|
108
|
+
if args.report:
|
|
109
|
+
with open(args.report, "w", encoding="utf-8") as f:
|
|
110
|
+
f.write(report.render(items, _target(args), verified=verify))
|
|
104
111
|
if verify:
|
|
105
112
|
return 1 if any(i.result.status == providers.LIVE for i in items) else 0
|
|
106
113
|
return 1 if items else 0
|
|
@@ -125,6 +132,9 @@ def cmd_revoke(args):
|
|
|
125
132
|
print(f"\n{len(live)} live secret(s): {len(auto)} can be revoked automatically, {len(manual)} need manual steps.")
|
|
126
133
|
for i in manual:
|
|
127
134
|
print(f" #{i.n} {i.kind}: {providers.PROVIDERS[i.kind].manual}")
|
|
135
|
+
for i in auto:
|
|
136
|
+
if providers.PROVIDERS[i.kind].side_effect:
|
|
137
|
+
print(f" note for #{i.n} {i.kind}: {providers.PROVIDERS[i.kind].side_effect}")
|
|
128
138
|
if not args.yes:
|
|
129
139
|
if auto:
|
|
130
140
|
print(f"\nDry run. Re-run with --yes to revoke: " + ", ".join(f"#{i.n}" for i in auto))
|
|
@@ -143,7 +153,7 @@ def cmd_report(args):
|
|
|
143
153
|
items = collect(args)
|
|
144
154
|
if items and not args.no_verify:
|
|
145
155
|
verify_all(items)
|
|
146
|
-
target =
|
|
156
|
+
target = _target(args)
|
|
147
157
|
with open(args.output, "w", encoding="utf-8") as f:
|
|
148
158
|
f.write(report.render(items, target, verified=not args.no_verify))
|
|
149
159
|
print(f"Report written to {os.path.abspath(args.output)} ({len(items)} unique secret(s)).")
|
|
@@ -164,8 +174,9 @@ def parser():
|
|
|
164
174
|
p = argparse.ArgumentParser(prog="leakkill", description=__doc__, formatter_class=argparse.RawDescriptionHelpFormatter)
|
|
165
175
|
p.add_argument("--version", action="version", version=f"leakkill {__version__}")
|
|
166
176
|
sub = p.add_subparsers(dest="cmd")
|
|
167
|
-
|
|
168
|
-
|
|
177
|
+
for name, h in (("scan", "find secrets (offline)"), ("verify", "find secrets and check which are live")):
|
|
178
|
+
sp = sub.add_parser(name, parents=[common], help=h)
|
|
179
|
+
sp.add_argument("--report", metavar="FILE", help="also write the Markdown incident report to FILE")
|
|
169
180
|
r = sub.add_parser("revoke", parents=[common], help="revoke live secrets (dry run unless --yes)")
|
|
170
181
|
r.add_argument("--only", help="comma-separated ids from `leakkill verify`, e.g. 1,3")
|
|
171
182
|
r.add_argument("--yes", action="store_true", help="actually revoke")
|
|
@@ -178,6 +189,16 @@ def parser():
|
|
|
178
189
|
return p
|
|
179
190
|
|
|
180
191
|
|
|
192
|
+
def check_paths(paths):
|
|
193
|
+
"""A security tool must never report 'Clean.' for something it didn't scan (e.g. a typo'd command)."""
|
|
194
|
+
missing = [p for p in paths if not os.path.exists(p)]
|
|
195
|
+
for p in missing:
|
|
196
|
+
hint = difflib.get_close_matches(p, sorted(COMMANDS), n=1)
|
|
197
|
+
print(f"leakkill: no such file or directory: {p}" + (f" (did you mean `leakkill {hint[0]}`?)" if hint else ""),
|
|
198
|
+
file=sys.stderr)
|
|
199
|
+
return not missing
|
|
200
|
+
|
|
201
|
+
|
|
181
202
|
def main(argv=None):
|
|
182
203
|
argv = list(sys.argv[1:] if argv is None else argv)
|
|
183
204
|
if argv and argv[0] in LEGACY:
|
|
@@ -185,6 +206,8 @@ def main(argv=None):
|
|
|
185
206
|
if not argv or (argv[0] not in COMMANDS and argv[0] not in ("-h", "--help", "--version")):
|
|
186
207
|
argv.insert(0, "scan")
|
|
187
208
|
args = parser().parse_args(argv)
|
|
209
|
+
if args.cmd in ("scan", "verify", "revoke", "report") and not check_paths(args.paths):
|
|
210
|
+
return 2
|
|
188
211
|
if args.cmd == "guard":
|
|
189
212
|
return guard_mod.guard(sys.stdin.read())
|
|
190
213
|
if args.cmd == "install-hook":
|
|
@@ -143,7 +143,8 @@ def stripe_verify(s, ctx):
|
|
|
143
143
|
code, _, body = http("GET", "https://api.stripe.com/v1/account", {"Authorization": auth})
|
|
144
144
|
if code == 200:
|
|
145
145
|
j = _json(body)
|
|
146
|
-
return Result(LIVE, f"{j.get('id')} {j.get('email') or j.get('business_profile', {}).get('name') or ''}".strip()
|
|
146
|
+
return Result(LIVE, f"{j.get('id')} {j.get('email') or j.get('business_profile', {}).get('name') or ''}".strip(),
|
|
147
|
+
"test mode" if "_test_" in s else "LIVE MODE: real money")
|
|
147
148
|
if code == 403: # restricted key without account read permission: valid but limited
|
|
148
149
|
return Result(LIVE, note="restricted key")
|
|
149
150
|
return _by_status(code)
|
|
@@ -222,31 +223,110 @@ def telegram_verify(s, ctx):
|
|
|
222
223
|
return _by_status(code, dead=(401, 404))
|
|
223
224
|
|
|
224
225
|
|
|
226
|
+
# ---------------------------------------------------------------- more AI / dev platforms
|
|
227
|
+
def _bearer_get(url, s):
|
|
228
|
+
return http("GET", url, {"Authorization": f"Bearer {s}"})
|
|
229
|
+
|
|
230
|
+
|
|
231
|
+
def huggingface_verify(s, ctx):
|
|
232
|
+
code, _, body = _bearer_get("https://huggingface.co/api/whoami-v2", s)
|
|
233
|
+
if code == 200:
|
|
234
|
+
j = _json(body)
|
|
235
|
+
role = (j.get("auth") or {}).get("accessToken", {}).get("role", "")
|
|
236
|
+
return Result(LIVE, j.get("name", "?"), f"token role: {role}" if role else "")
|
|
237
|
+
return _by_status(code)
|
|
238
|
+
|
|
239
|
+
|
|
240
|
+
def openrouter_verify(s, ctx):
|
|
241
|
+
code, _, body = _bearer_get("https://openrouter.ai/api/v1/key", s)
|
|
242
|
+
if code == 200:
|
|
243
|
+
d = _json(body).get("data") or {}
|
|
244
|
+
return Result(LIVE, d.get("label", ""), f"limit remaining: {d.get('limit_remaining')}")
|
|
245
|
+
return _by_status(code)
|
|
246
|
+
|
|
247
|
+
|
|
248
|
+
def digitalocean_verify(s, ctx):
|
|
249
|
+
code, _, body = _bearer_get("https://api.digitalocean.com/v2/account", s)
|
|
250
|
+
if code == 200:
|
|
251
|
+
return Result(LIVE, (_json(body).get("account") or {}).get("email", "?"))
|
|
252
|
+
return _by_status(code)
|
|
253
|
+
|
|
254
|
+
|
|
255
|
+
def replicate_verify(s, ctx):
|
|
256
|
+
code, _, body = _bearer_get("https://api.replicate.com/v1/account", s)
|
|
257
|
+
return _by_status(code, identity=_json(body).get("username", "") if code == 200 else "")
|
|
258
|
+
|
|
259
|
+
|
|
260
|
+
def groq_verify(s, ctx):
|
|
261
|
+
code, _, _ = _bearer_get("https://api.groq.com/openai/v1/models", s)
|
|
262
|
+
return _by_status(code)
|
|
263
|
+
|
|
264
|
+
|
|
265
|
+
def sendgrid_verify(s, ctx):
|
|
266
|
+
code, _, body = _bearer_get("https://api.sendgrid.com/v3/scopes", s)
|
|
267
|
+
if code == 200:
|
|
268
|
+
return Result(LIVE, note=f"{len(_json(body).get('scopes', []))} scopes")
|
|
269
|
+
return _by_status(code)
|
|
270
|
+
|
|
271
|
+
|
|
272
|
+
def sendgrid_revoke(s, res):
|
|
273
|
+
# Key format is SG.<api_key_id>.<secret>, so a leaked key can delete itself if it has API-key permissions.
|
|
274
|
+
code, _, _ = http("DELETE", f"https://api.sendgrid.com/v3/api_keys/{s.split('.')[1]}",
|
|
275
|
+
{"Authorization": f"Bearer {s}"})
|
|
276
|
+
if code == 204:
|
|
277
|
+
return True, "HTTP 204"
|
|
278
|
+
return False, f"HTTP {code}: this key can't delete itself, use the dashboard"
|
|
279
|
+
|
|
280
|
+
|
|
225
281
|
@dataclass
|
|
226
282
|
class Provider:
|
|
227
283
|
verify: object = None
|
|
228
284
|
revoke: object = None
|
|
229
285
|
manual: str = ""
|
|
286
|
+
side_effect: str = "" # shown before revoking, so nobody is surprised
|
|
230
287
|
|
|
231
288
|
|
|
232
289
|
PROVIDERS = {
|
|
233
290
|
"GitHub token": Provider(github_verify, github_revoke,
|
|
234
|
-
"Delete it at https://github.com/settings/tokens (or the app's settings for gho_/ghu_ tokens)."
|
|
291
|
+
"Delete it at https://github.com/settings/tokens (or the app's settings for gho_/ghu_ tokens).",
|
|
292
|
+
"GitHub emails the token's owner that it was revoked as exposed."),
|
|
235
293
|
"GitLab token": Provider(gitlab_verify, gitlab_revoke,
|
|
236
294
|
"Revoke it at https://gitlab.com/-/user_settings/personal_access_tokens."),
|
|
237
295
|
"Slack token": Provider(slack_verify, slack_revoke,
|
|
238
|
-
"Regenerate it in your app's 'OAuth & Permissions' page at https://api.slack.com/apps."
|
|
296
|
+
"Regenerate it in your app's 'OAuth & Permissions' page at https://api.slack.com/apps.",
|
|
297
|
+
"For apps without token rotation this uninstalls the app from the workspace: its other "
|
|
298
|
+
"tokens and webhooks stop working too, and it must be reinstalled."),
|
|
239
299
|
"Slack webhook": Provider(slack_webhook_verify, None,
|
|
240
300
|
"Remove the webhook in your app's 'Incoming Webhooks' page at https://api.slack.com/apps."),
|
|
241
301
|
"Discord webhook": Provider(discord_webhook_verify, discord_webhook_revoke,
|
|
242
302
|
"Server Settings > Integrations > Webhooks > delete the webhook."),
|
|
243
303
|
"Stripe key": Provider(stripe_verify, None,
|
|
244
|
-
"Roll the key at https://dashboard.stripe.com/apikeys (Stripe has no API to revoke keys)."
|
|
304
|
+
"Roll the key at https://dashboard.stripe.com/apikeys (Stripe has no API to revoke keys). "
|
|
305
|
+
"Test-mode keys can't move money but still expose your test data."),
|
|
245
306
|
"AWS access key": Provider(aws_verify, aws_revoke,
|
|
246
307
|
"Deactivate then delete it in IAM > Users > Security credentials "
|
|
247
308
|
"(https://console.aws.amazon.com/iam/home#/security_credentials), then check CloudTrail "
|
|
248
309
|
"for activity from this key."),
|
|
249
310
|
"OpenAI API key": Provider(openai_verify, None, "Revoke it at https://platform.openai.com/api-keys."),
|
|
311
|
+
"OpenRouter key": Provider(openrouter_verify, None, "Delete it at https://openrouter.ai/settings/keys."),
|
|
312
|
+
"Hugging Face token": Provider(huggingface_verify, None, "Invalidate it at https://huggingface.co/settings/tokens."),
|
|
313
|
+
"Groq key": Provider(groq_verify, None, "Delete it at https://console.groq.com/keys."),
|
|
314
|
+
"Replicate token": Provider(replicate_verify, None, "Delete it at https://replicate.com/account/api-tokens."),
|
|
315
|
+
"SendGrid key": Provider(sendgrid_verify, sendgrid_revoke,
|
|
316
|
+
"Delete it at https://app.sendgrid.com/settings/api_keys.",
|
|
317
|
+
"Deleting is permanent: anything still using this key stops sending email."),
|
|
318
|
+
"DigitalOcean token": Provider(digitalocean_verify, None,
|
|
319
|
+
"Delete it at https://cloud.digitalocean.com/account/api/tokens."),
|
|
320
|
+
"Perplexity key": Provider(None, None, "Delete it in Perplexity: Settings > API keys."),
|
|
321
|
+
"Shopify token": Provider(None, None, "Rotate it in Shopify admin: Settings > Apps > Develop apps > your app > "
|
|
322
|
+
"API credentials."),
|
|
323
|
+
"PyPI token": Provider(None, None, "Remove it at https://pypi.org/manage/account/token/."),
|
|
324
|
+
"Docker Hub token": Provider(None, None, "Delete it in Docker Hub: Account settings > Personal access tokens."),
|
|
325
|
+
"Twilio API key": Provider(None, None, "Delete it in the Twilio console: Account > API keys & tokens."),
|
|
326
|
+
"Postman key": Provider(None, None, "Delete it in Postman: Settings > API keys."),
|
|
327
|
+
"Linear key": Provider(None, None, "Revoke it in Linear: Settings > Security & access > Personal API keys."),
|
|
328
|
+
"Azure storage key": Provider(None, None, "Rotate it in the Azure portal: Storage account > Security + networking > "
|
|
329
|
+
"Access keys > Rotate key."),
|
|
250
330
|
"Anthropic API key": Provider(anthropic_verify, None, "Delete it at https://console.anthropic.com/settings/keys."),
|
|
251
331
|
"npm token": Provider(npm_verify, None, "Run `npm token list` then `npm token revoke <id>`, "
|
|
252
332
|
"or use https://www.npmjs.com/settings/<user>/tokens."),
|
|
@@ -11,9 +11,23 @@ RULES = {
|
|
|
11
11
|
"Slack token": re.compile(r"\b(xox[abposre]-[A-Za-z0-9-]{10,})"),
|
|
12
12
|
"Slack webhook": re.compile(r"(https://hooks\.slack\.com/services/T[A-Z0-9]+/B[A-Z0-9]+/[A-Za-z0-9]{20,})"),
|
|
13
13
|
"Discord webhook": re.compile(r"(https://(?:ptb\.|canary\.)?discord(?:app)?\.com/api/webhooks/\d+/[A-Za-z0-9_\-]{60,})"),
|
|
14
|
-
"Stripe key": re.compile(r"\b([sr]
|
|
14
|
+
"Stripe key": re.compile(r"\b([sr]k_(?:live|test)_[0-9A-Za-z]{20,})\b"),
|
|
15
15
|
"Anthropic API key": re.compile(r"\b(sk-ant-[A-Za-z0-9_\-]{32,})"),
|
|
16
|
-
"
|
|
16
|
+
"OpenRouter key": re.compile(r"\b(sk-or-v1-[a-f0-9]{64})\b"),
|
|
17
|
+
"OpenAI API key": re.compile(r"\b(sk-(?!ant-|or-)(?:proj-|svcacct-|admin-)?[A-Za-z0-9_\-]{32,})"),
|
|
18
|
+
"Hugging Face token": re.compile(r"\b(hf_[A-Za-z0-9]{34,40})\b"),
|
|
19
|
+
"Groq key": re.compile(r"\b(gsk_[A-Za-z0-9]{48,56})\b"),
|
|
20
|
+
"Replicate token": re.compile(r"\b(r8_[A-Za-z0-9]{37})\b"),
|
|
21
|
+
"Perplexity key": re.compile(r"\b(pplx-[A-Za-z0-9]{48})\b"),
|
|
22
|
+
"SendGrid key": re.compile(r"\b(SG\.[A-Za-z0-9_\-]{22}\.[A-Za-z0-9_\-]{43})(?![A-Za-z0-9_\-])"),
|
|
23
|
+
"DigitalOcean token": re.compile(r"\b(do[po]_v1_[a-f0-9]{64})\b"),
|
|
24
|
+
"Shopify token": re.compile(r"\b(shp(?:at|ca|pa|ss)_[a-fA-F0-9]{32})\b"),
|
|
25
|
+
"PyPI token": re.compile(r"\b(pypi-AgEIcHlwaS5vcmc[A-Za-z0-9_\-]{50,})"),
|
|
26
|
+
"Docker Hub token": re.compile(r"\b(dckr_pat_[A-Za-z0-9_\-]{27})(?![A-Za-z0-9_\-])"),
|
|
27
|
+
"Twilio API key": re.compile(r"\b(SK[0-9a-fA-F]{32})\b"),
|
|
28
|
+
"Postman key": re.compile(r"\b(PMAK-[a-f0-9]{24}-[a-f0-9]{34})\b"),
|
|
29
|
+
"Linear key": re.compile(r"\b(lin_api_[A-Za-z0-9]{40})\b"),
|
|
30
|
+
"Azure storage key": re.compile(r"(?i)AccountKey=([A-Za-z0-9+/]{86}==)"),
|
|
17
31
|
"npm token": re.compile(r"\b(npm_[A-Za-z0-9]{36})\b"),
|
|
18
32
|
"Telegram bot token": re.compile(r"\b(\d{8,10}:AA[A-Za-z0-9_\-]{33})(?![A-Za-z0-9_\-])"),
|
|
19
33
|
"Google API key": re.compile(r"\b(AIza[0-9A-Za-z_\-]{35})"),
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: leakkill
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.4.1
|
|
4
4
|
Summary: Find leaked secrets, check if they're live, revoke them in one command, and keep them out of AI coding agents
|
|
5
5
|
Author-email: Ayush <andymylove24@gmail.com>
|
|
6
6
|
License-Expression: MIT
|
|
@@ -71,8 +71,9 @@ including secrets you already "deleted"), `--exclude-tests` and `--json`.
|
|
|
71
71
|
| Slack tokens (`xox…`) | ✅ user and workspace | ✅ `auth.revoke` |
|
|
72
72
|
| Discord webhooks | ✅ server and channel | ✅ deletes the webhook |
|
|
73
73
|
| AWS access key and secret | ✅ IAM ARN and account (STS, needs no permissions) | ⚠️ deactivates the key if it has `iam:UpdateAccessKey`, otherwise console steps |
|
|
74
|
-
|
|
|
75
|
-
|
|
|
74
|
+
| SendGrid (`SG.`) | ✅ scopes | ✅ the key deletes itself if it has API-key permissions |
|
|
75
|
+
| Stripe (live and test keys), OpenAI, Anthropic, OpenRouter, Groq, Hugging Face, Replicate, DigitalOcean, npm, Telegram, Slack webhooks | ✅ (account or username where the API returns it) | ❌ the provider has no API for it, so you get the exact page or command |
|
|
76
|
+
| Google API keys, Shopify, PyPI, Docker Hub, Twilio, Postman, Perplexity, Linear, Azure Storage, private keys, JWTs, credentials in URLs, generic high-entropy secrets | detected, not verified | step-by-step rotation guidance |
|
|
76
77
|
|
|
77
78
|
## How it compares
|
|
78
79
|
|
|
@@ -80,9 +81,9 @@ including secrets you already "deleted"), `--exclude-tests` and `--json`.
|
|
|
80
81
|
|---|---|---|---|---|---|
|
|
81
82
|
| Price | **Free (MIT)** | Free (MIT) | Free (AGPL) | Free for individuals, roughly $15–30/dev/month for teams | Free on public repos, $19/committer/month on private |
|
|
82
83
|
| Runs fully local | ✅ | ✅ | ✅ | ❌ SaaS | ❌ GitHub only |
|
|
83
|
-
| Detectors |
|
|
84
|
-
| Checks if a key is live | ✅
|
|
85
|
-
| Revokes from the CLI | ✅
|
|
84
|
+
| Detectors | 31 | 150+ | 800+ | 550+ | [provider list](https://docs.github.com/en/code-security/secret-scanning/introduction/supported-secret-scanning-patterns) |
|
|
85
|
+
| Checks if a key is live | ✅ 17 providers | ❌ | ✅ (its main strength) | ✅ | ✅ some |
|
|
86
|
+
| Revokes from the CLI | ✅ 6 providers | ❌ | ❌ (Enterprise) | partial | ❌ |
|
|
86
87
|
| Incident report and history-purge steps | ✅ Markdown file | ❌ | ❌ | ✅ dashboard and playbooks | ❌ |
|
|
87
88
|
| Guards AI coding agents | ✅ Claude Code hooks | ❌ | ❌ | ❌ | ❌ |
|
|
88
89
|
| Dependencies | none | Go binary | Go binary | CLI + account | GitHub |
|
|
@@ -92,11 +93,20 @@ if breadth of detection matters most, run Gitleaks or TruffleHog alongside leakk
|
|
|
92
93
|
|
|
93
94
|
### Tested with real credentials
|
|
94
95
|
|
|
95
|
-
End to end on Windows with
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
96
|
+
End to end on Windows with real, throwaway credentials:
|
|
97
|
+
|
|
98
|
+
| Credential | `verify` | `revoke --yes` | `verify` again |
|
|
99
|
+
|---|---|---|---|
|
|
100
|
+
| GitHub token | LIVE, correct user | REVOKED (HTTP 202) | DEAD |
|
|
101
|
+
| Discord webhook | LIVE, correct server and channel | REVOKED (HTTP 204) | DEAD |
|
|
102
|
+
| Slack bot token | LIVE, correct bot and workspace | REVOKED | DEAD (the app was uninstalled, as Slack documents) |
|
|
103
|
+
| Slack webhook | LIVE | (died with the app) | DEAD |
|
|
104
|
+
| Stripe test key | LIVE, correct account, "test mode" | manual roll in dashboard | |
|
|
105
|
+
| Hugging Face token | LIVE, correct user and token role | manual delete | |
|
|
106
|
+
|
|
107
|
+
Against the real AWS, GitLab, Anthropic and npm APIs, invalid keys are correctly reported DEAD.
|
|
108
|
+
Providers not yet tested with a live key (OpenAI, OpenRouter, Groq, Replicate, DigitalOcean,
|
|
109
|
+
SendGrid, Telegram) are covered by tests using simulated API responses.
|
|
100
110
|
|
|
101
111
|
### Benchmark (reproducible, run October 2026)
|
|
102
112
|
|
|
@@ -150,13 +160,27 @@ This was tested live with the Claude Code CLI: prompts with keys, `Read .env`, `
|
|
|
150
160
|
command that builds the file name at runtime can get past it. Pair it with OS-level permissions for
|
|
151
161
|
hard guarantees.
|
|
152
162
|
|
|
153
|
-
## Use in CI (GitHub
|
|
163
|
+
## Use in CI (GitHub Action)
|
|
154
164
|
|
|
155
165
|
```yaml
|
|
156
|
-
-
|
|
157
|
-
-
|
|
166
|
+
- uses: actions/checkout@v4
|
|
167
|
+
- uses: ayushanand27/leakkill@v0
|
|
158
168
|
```
|
|
159
169
|
|
|
170
|
+
The build fails if a secret is found, and the incident report appears in the job summary. Options:
|
|
171
|
+
|
|
172
|
+
```yaml
|
|
173
|
+
- uses: ayushanand27/leakkill@v0
|
|
174
|
+
with:
|
|
175
|
+
path: . # files or directories to scan
|
|
176
|
+
exclude-tests: true # skip test_* files and tests/ dirs
|
|
177
|
+
history: true # scan every commit (needs `fetch-depth: 0` on checkout)
|
|
178
|
+
verify: true # check secrets with their providers; fail only if one is LIVE
|
|
179
|
+
```
|
|
180
|
+
|
|
181
|
+
The action exposes `found` (the number of unique secrets) as an output. Outside GitHub Actions, use
|
|
182
|
+
`pip install leakkill && leakkill scan .`.
|
|
183
|
+
|
|
160
184
|
## Use with the pre-commit framework
|
|
161
185
|
|
|
162
186
|
```yaml
|
|
@@ -63,3 +63,29 @@ def test_leakkillignore(tmp_path, monkeypatch):
|
|
|
63
63
|
def test_legacy_flags_still_work(tmp_path, monkeypatch):
|
|
64
64
|
project(tmp_path, monkeypatch)
|
|
65
65
|
assert cli.main([]) == 1 and cli.main(["--exclude-tests", "."]) == 1
|
|
66
|
+
|
|
67
|
+
|
|
68
|
+
def test_scan_report_option_writes_report_in_same_run(tmp_path, monkeypatch):
|
|
69
|
+
project(tmp_path, monkeypatch); fake_verify(monkeypatch)
|
|
70
|
+
assert cli.main(["verify", "--report", "r.md"]) == 1
|
|
71
|
+
md = (tmp_path / "r.md").read_text(encoding="utf-8")
|
|
72
|
+
assert "**1 live**" in md and GH not in md
|
|
73
|
+
|
|
74
|
+
|
|
75
|
+
def test_revoke_dry_run_warns_about_side_effects(tmp_path, monkeypatch, capsys):
|
|
76
|
+
project(tmp_path, monkeypatch); fake_verify(monkeypatch)
|
|
77
|
+
cli.main(["revoke"])
|
|
78
|
+
assert "GitHub emails the token's owner" in capsys.readouterr().out
|
|
79
|
+
|
|
80
|
+
|
|
81
|
+
def test_typo_command_is_an_error_not_clean(tmp_path, monkeypatch, capsys):
|
|
82
|
+
monkeypatch.chdir(tmp_path)
|
|
83
|
+
assert cli.main(["verfiy"]) == 2
|
|
84
|
+
out = capsys.readouterr()
|
|
85
|
+
assert "Clean" not in out.out and "did you mean `leakkill verify`" in out.err
|
|
86
|
+
|
|
87
|
+
|
|
88
|
+
def test_missing_path_is_an_error(tmp_path, monkeypatch, capsys):
|
|
89
|
+
monkeypatch.chdir(tmp_path)
|
|
90
|
+
assert cli.main(["scan", "does-not-exist"]) == 2
|
|
91
|
+
assert "no such file or directory: does-not-exist" in capsys.readouterr().err
|
|
@@ -127,3 +127,48 @@ def test_redirects_are_never_followed():
|
|
|
127
127
|
code, _, _ = P.http("GET", f"http://127.0.0.1:{srv.server_port}/start", {"Authorization": "Bearer secret"})
|
|
128
128
|
srv.server_close()
|
|
129
129
|
assert code == 302 and [p for p, _ in hits] == ["/start"]
|
|
130
|
+
|
|
131
|
+
|
|
132
|
+
def test_huggingface_live_with_name_and_role(fake):
|
|
133
|
+
fake({("GET", "https://huggingface.co/api/whoami-v2"):
|
|
134
|
+
(200, {}, b'{"name":"ayush","auth":{"accessToken":{"role":"read"}}}')})
|
|
135
|
+
r = P.verify("Hugging Face token", "hf_x")
|
|
136
|
+
assert (r.status, r.identity, r.note) == (P.LIVE, "ayush", "token role: read")
|
|
137
|
+
|
|
138
|
+
def test_simple_bearer_providers_live_and_dead(fake):
|
|
139
|
+
cases = {"OpenRouter key": "https://openrouter.ai/api/v1/key",
|
|
140
|
+
"DigitalOcean token": "https://api.digitalocean.com/v2/account",
|
|
141
|
+
"Replicate token": "https://api.replicate.com/v1/account",
|
|
142
|
+
"Groq key": "https://api.groq.com/openai/v1/models",
|
|
143
|
+
"SendGrid key": "https://api.sendgrid.com/v3/scopes"}
|
|
144
|
+
for kind, url in cases.items():
|
|
145
|
+
f = fake({("GET", url): (200, {}, b'{}')})
|
|
146
|
+
assert P.verify(kind, "tok").status == P.LIVE, kind
|
|
147
|
+
assert f.calls[0][2]["Authorization"] == "Bearer tok"
|
|
148
|
+
fake({("GET", url): (401, {}, b'')})
|
|
149
|
+
assert P.verify(kind, "tok").status == P.DEAD, kind
|
|
150
|
+
|
|
151
|
+
def test_digitalocean_identity(fake):
|
|
152
|
+
fake({("GET", "https://api.digitalocean.com/v2/account"): (200, {}, b'{"account":{"email":"a@b.c"}}')})
|
|
153
|
+
assert P.verify("DigitalOcean token", "dop_v1_x").identity == "a@b.c"
|
|
154
|
+
|
|
155
|
+
def test_sendgrid_revoke_deletes_itself_by_key_id(fake):
|
|
156
|
+
key = "SG.KEYID123.secretpart"
|
|
157
|
+
f = fake({("DELETE", "https://api.sendgrid.com/v3/api_keys/KEYID123"): (204, {}, b"")})
|
|
158
|
+
assert P.revoke("SendGrid key", key, P.Result(P.LIVE))[0]
|
|
159
|
+
assert f.calls[0][2]["Authorization"] == f"Bearer {key}"
|
|
160
|
+
|
|
161
|
+
def test_sendgrid_revoke_without_permission_falls_back(fake):
|
|
162
|
+
fake({("DELETE", "https://api.sendgrid.com/v3/api_keys/K"): (403, {}, b"")})
|
|
163
|
+
ok, msg = P.revoke("SendGrid key", "SG.K.s", P.Result(P.LIVE))
|
|
164
|
+
assert not ok and "dashboard" in msg
|
|
165
|
+
|
|
166
|
+
def test_stripe_test_mode_labelled(fake):
|
|
167
|
+
fake({("GET", "https://api.stripe.com/v1/account"): (200, {}, b'{"id":"acct_1","email":"a@b.c"}')})
|
|
168
|
+
r = P.verify("Stripe key", "sk_test_x")
|
|
169
|
+
assert r.status == P.LIVE and r.note == "test mode"
|
|
170
|
+
|
|
171
|
+
def test_every_detector_has_remediation():
|
|
172
|
+
from leakkill.scanner import RULES
|
|
173
|
+
for kind in list(RULES) + ["High-entropy secret"]:
|
|
174
|
+
assert P.PROVIDERS[kind].manual, kind
|
|
@@ -56,3 +56,26 @@ def test_url_real_password_found_and_masked():
|
|
|
56
56
|
def test_test_named_vars_and_hashes_ignored():
|
|
57
57
|
assert not kinds('MASKED_TEST_SECRET2 = "2JgchWvM1tpxT2lfz9aydoXW9yT1DN3NdLiejYxOOlzzV4nhBbYqmqZYbAV3V5Bf"')
|
|
58
58
|
assert not kinds("ADMIN_PASSWORD = 'pbkdf2_sha256$30000$Vo0VlMnkR4Bk$qEvtdyZRWTcOsCnI/oQ7fVOu1XAURIZYoOZ3iq8Dr4M='")
|
|
59
|
+
|
|
60
|
+
NEW = {
|
|
61
|
+
"OpenRouter key": "sk-or-v1-" + "a" * 64,
|
|
62
|
+
"Hugging Face token": "hf_" + "A" * 34,
|
|
63
|
+
"Groq key": "gsk_" + "A" * 52,
|
|
64
|
+
"Replicate token": "r8_" + "A" * 37,
|
|
65
|
+
"Perplexity key": "pplx-" + "A" * 48,
|
|
66
|
+
"SendGrid key": "SG." + "A" * 22 + "." + "B" * 43,
|
|
67
|
+
"DigitalOcean token": "dop_v1_" + "a" * 64,
|
|
68
|
+
"Shopify token": "shpat_" + "a" * 32,
|
|
69
|
+
"PyPI token": "pypi-AgEIcHlwaS5vcmc" + "A" * 60,
|
|
70
|
+
"Docker Hub token": "dckr_pat_" + "A" * 27,
|
|
71
|
+
"Twilio API key": "SK" + "a" * 32,
|
|
72
|
+
"Postman key": "PMAK-" + "a" * 24 + "-" + "b" * 34,
|
|
73
|
+
"Linear key": "lin_api_" + "A" * 40,
|
|
74
|
+
"Azure storage key": "AccountKey=" + "A" * 86 + "==",
|
|
75
|
+
"Stripe key": "sk_test_" + "A" * 24,
|
|
76
|
+
}
|
|
77
|
+
def test_new_providers_detected_exactly():
|
|
78
|
+
for kind, token in NEW.items():
|
|
79
|
+
assert kinds(f'x = "{token}"') == [kind], (kind, kinds(f'x = "{token}"'))
|
|
80
|
+
def test_openrouter_not_reported_as_openai():
|
|
81
|
+
assert "OpenAI API key" not in kinds(NEW["OpenRouter key"])
|
|
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
|