@secretlint/secretlint-rule-stripe
v13.0.2
Published
A secretlint rule for detecting Stripe API keys
Downloads
425
Maintainers
Readme
@secretlint/secretlint-rule-stripe
A secretlint rule for detecting Stripe API keys.
Detected Key Types
| Key Type | Prefix | Format |
|---|---|---|
| Live Secret Key | sk_live_ | sk_live_ + 24–99 alphanumeric chars |
| Test Secret Key | sk_test_ | sk_test_ + 24–99 alphanumeric chars |
| Live Restricted Key | rk_live_ | rk_live_ + 24–99 alphanumeric chars |
| Test Restricted Key | rk_test_ | rk_test_ + 24–99 alphanumeric chars |
References:
- Stripe API keys documentation
- GitHub Push Protection: supported provider "Stripe"
Install
Install with npm:
npm install @secretlint/secretlint-rule-stripeUsage
Via .secretlintrc.json:
{
"rules": [
{
"id": "@secretlint/secretlint-rule-stripe"
}
]
}Options
export type Options = {
/**
* Define allow pattern written by RegExp-like strings
* See https://github.com/textlint/regexp-string-matcher#regexp-like-string
**/
allows?: string[];
};Messages
STRIPE_SECRET_KEY_LIVE
Detected a Stripe Live Secret Key (sk_live_ prefix).
STRIPE_SECRET_KEY_TEST
Detected a Stripe Test Secret Key (sk_test_ prefix).
STRIPE_RESTRICTED_KEY_LIVE
Detected a Stripe Live Restricted Key (rk_live_ prefix).
STRIPE_RESTRICTED_KEY_TEST
Detected a Stripe Test Restricted Key (rk_test_ prefix).
Changelog
See Releases page.
Running tests
Install devDependencies and Run npm test:
npm testContributing
Pull requests and stars are always welcome.
For bugs and feature requests, please create an issue.
- Fork it!
- Create your feature branch:
git checkout -b my-new-feature - Commit your changes:
git commit -am 'Add some feature' - Push to the branch:
git push origin my-new-feature - Submit a pull request :D
License
MIT © azu
