Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions repodx.py
Original file line number Diff line number Diff line change
Expand Up @@ -366,6 +366,7 @@ def check_readme(repo_path):
("GitHub token", r"\bgh[pousr]_[A-Za-z0-9]{36,}\b"),
("GitHub token", r"\bgithub_pat_[A-Za-z0-9_]{60,}\b"),
("GitLab token", r"\bglpat-[A-Za-z0-9_\-]{20,}"),
("Grafana service account token", r"\bglsa_[A-Za-z0-9]{32}_[a-fA-F0-9]{8}\b"),
("npm access token", r"\bnpm_[A-Za-z0-9]{36}\b"),
("Shopify token", r"\bshp(?:at|ca|pa|ss)_[a-fA-F0-9]{32}\b"),
("DigitalOcean token", r"\bdo[op]_v1_[a-f0-9]{64}\b"),
Expand Down Expand Up @@ -425,8 +426,8 @@ def check_readme(repo_path):
# Every pattern above contains one of these strings, so lines without them are skipped quickly.
CANDIDATE_LITERALS = [
"sk-", "AKIA", "ASIA", "ghp_", "gho_", "ghu_", "ghs_", "ghr_", "github_pat_", "glpat-", "_live_",
"sb_secret_", "xox", "hf_", "npm_", "gsk_", "pplx-", "r8_", "SG.", ":AA", "AIza", "eyJ", "://", "shpat_",
"shpca_", "shppa_", "shpss_", "dop_v1_", "doo_v1_", "pypi-",
"glsa_", "sb_secret_", "xox", "hf_", "npm_", "gsk_", "pplx-", "r8_", "SG.", ":AA", "AIza", "eyJ", "://",
"shpat_", "shpca_", "shppa_", "shpss_", "dop_v1_", "doo_v1_", "pypi-",
]


Expand Down
1 change: 1 addition & 0 deletions tests/test_repodx.py
Original file line number Diff line number Diff line change
Expand Up @@ -581,6 +581,7 @@ def test_detects_provider_keys(self):
"AWS access key": fake("AKIA", "Q7ZT4MWX9RB2KD5N"),
"GitHub token": fake("ghp", "_", "q7ZT4mWx9Rb2Kd5Nf8Lp3Hs6Vc1Yj0GuE4tA"),
"GitLab token": fake("glpat", "-", "Q7zT4mWx9Rb2Kd5Nf8Lp"),
"Grafana service account token": fake("glsa", "_", "A1b2C3d4E5f6G7h8I9j0K1l2M3n4O5p6", "_", "1a2B3c4D"),
"npm access token": fake("npm_", "A1b2C3d4E5f6G7h8I9j0K1l2M3n4O5p6Q7r8"),
"Shopify token": fake("shpat", "_", "9f4e6a2b7c8d0a1b2c3d4e5f6a7b8c9d"),
"DigitalOcean token": fake("dop_v1_", "f1e2d3c4b5a69788796a5b4c3d2e1f0af9e8d7c6b5a49382716f0e1d2c3ba4b7"),
Expand Down