Skip to content

Commit fd8440e

Browse files
committed
feat: add several other GitHub access token patterns
- OAuth access tokens - refresh token - app installation token - PAT v2
1 parent a223fcb commit fd8440e

File tree

2 files changed

+31
-0
lines changed

2 files changed

+31
-0
lines changed

CHANGELOG.md

+1
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ All notable changes to this project will be documented in this file.
1818

1919
### Features
2020

21+
- *(client)* Identify several other GitHub token types as secrets
2122
- *(daemon)* Follow XDG_RUNTIME_DIR if set ([#2171](https://github.com/atuinsh/atuin/issues/2171))
2223
- *(gui)* Automatically install and setup the cli/shell ([#2139](https://github.com/atuinsh/atuin/issues/2139))
2324
- *(gui)* Add activity calendar to the homepage ([#2160](https://github.com/atuinsh/atuin/issues/2160))

crates/atuin-client/src/secrets.rs

+30
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,36 @@ pub static SECRET_PATTERNS: &[(&str, &str, &str)] = &[
4242
"github_pat_[a-zA-Z0-9]{22}_[a-zA-Z0-9]{59}",
4343
"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", // also legit, also expired
4444
),
45+
(
46+
"GitHub OAuth Access Token",
47+
"gho_[A-Za-z0-9]{36}",
48+
"gho_1234567890abcdefghijklmnopqrstuvwx", // not a real token
49+
),
50+
(
51+
"GitHub OAuth Access Token (user)",
52+
"ghu_[A-Za-z0-9]{36}",
53+
"ghu_1234567890abcdefghijklmnopqrstuvwx", // not a real token
54+
),
55+
(
56+
"GitHub App Installation Access Token",
57+
"ghs_[A-Za-z0-9]{36}",
58+
"ghs_1234567890abcdefghijklmnopqrstuvwx", // not a real token
59+
),
60+
(
61+
"GitHub Refresh Token",
62+
"ghr_[A-Za-z0-9]{76}",
63+
"ghr_1234567890abcdefghijklmnopqrstuvwx1234567890abcdefghijklmnopqrstuvwx1234567890abcdefghijklmnopqrstuvwx", // not a real token
64+
),
65+
(
66+
"GitHub App Installation Access Token",
67+
"v1\\.[0-9A-Fa-f]{40}",
68+
"v1.1234567890abcdefghijklmnopqrstuvwx1234567890abcdefghijklmnopqrstuvwx", // not a real token
69+
),
70+
(
71+
"GitHub Personal Access Token (v2)",
72+
"gh1_[A-Za-z0-9]{21}_[A-Za-z0-9]{59}|github_pat_[0-9][A-Za-z0-9]{21}_[A-Za-z0-9]{59}",
73+
"gh1_1234567890abcdefghijklmnopqrstuvwx_1234567890abcdefghijklmnopqrstuvwx", // not a real token
74+
),
4575
(
4676
"GitLab PAT",
4777
"glpat-[a-zA-Z0-9_]{20}",

0 commit comments

Comments
 (0)