Package com.tnsai.redaction
Class CredentialPatterns
java.lang.Object
com.tnsai.redaction.CredentialPatterns
The one definition of the well-known credential shapes, shared by
Masker.hidingOutside(java.nio.file.Path) and the default catalog of tnsai-quality's
PatternRedactor.
tnsai-quality's catalog has no Slack pattern, so SLACK_TOKEN and SLACK_WEBHOOK are the masker's alone.
Each pattern favours precision: a false positive rewrites ordinary text. PII patterns
(e-mail, phone, card numbers, national ids) are not credentials and stay in
tnsai-quality.
- Since:
- 0.18.6
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final PatternAnthropic keys (sk-ant-…).static final PatternAWS access key ids (AKIA…).static final PatternBearerheader values, case-insensitive.static final PatternGitHub fine-grained (github_pat_…), classic (ghp_…), OAuth and app tokens.static final PatternJSON Web Tokens: a header and a payload long enough to look real, then the signature, which an unsigned ("alg":"none") token leaves empty.static final PatternOpenAI project (sk-proj-…) and classic (sk-…) keys, not Anthropic's.static final PatternPEM (RSA,EC,OPENSSH, PKCS #8PRIVATE KEY, …) and PGP (PGP PRIVATE KEY BLOCK) private keys, BEGIN to END across lines.static final PatternSlack tokens: bot, user and otherxox?-tokens, and app-levelxapp-tokens.static final PatternSlack incoming-webhook URLs, whose path is the secret. -
Method Summary
-
Field Details
-
OPENAI_API_KEY
OpenAI project (sk-proj-…) and classic (sk-…) keys, not Anthropic's. -
ANTHROPIC_API_KEY
Anthropic keys (sk-ant-…). -
GITHUB_PAT
GitHub fine-grained (github_pat_…), classic (ghp_…), OAuth and app tokens. -
AWS_ACCESS_KEY
AWS access key ids (AKIA…). -
JWT
JSON Web Tokens: a header and a payload long enough to look real, then the signature, which an unsigned ("alg":"none") token leaves empty. -
BEARER_TOKEN
Bearerheader values, case-insensitive. -
PRIVATE_KEY_BLOCK
PEM (RSA,EC,OPENSSH, PKCS #8PRIVATE KEY, …) and PGP (PGP PRIVATE KEY BLOCK) private keys, BEGIN to END across lines. A block cut off before its END line runs to the end of the text. -
SLACK_TOKEN
Slack tokens: bot, user and otherxox?-tokens, and app-levelxapp-tokens. -
SLACK_WEBHOOK
Slack incoming-webhook URLs, whose path is the secret.
-