Comments (10)
Moreover, I'd like to be able to split words if a string is written with CamelCase but not if the entire string is with uppercase.
'FooBarBaz' => ['foo', 'bar', 'baz']
'FOO' => ['foo']
'FOo' => ['f', 'oo']
'FoO' => ['fo', 'o']
from eslint-plugin-no-secrets.
It could also support some options like:
- minimum number of delimiters
if it's set to 3:
'FOO_BAR_BAZ' => ['foo', 'bar', 'baz]
'FOO_BAR' => 'foo_bar'
- minimum number of words in a CamelCase string:
if it's set to 3:
'FooBarBaz' => ['foo', 'bar', 'baz]
'FooBar' => ['foobar']
- minimum word length in a CamelCase string:
if it's set to 3:
'FooBarBaz' => ['foo', 'bar', 'baz]
'FoBar' => ['fobar']
'FoBarBaz' => ['fobar', 'baz']
- maximum number for a given delimiter:
we set '@' to be a delimiter with max one time:
'[email protected]' => ['john', 'gmail.com']
'foo@bar@baz' => ['foo@bar@baz']
from eslint-plugin-no-secrets.
Hey Piotr,
Thanks for the detailed feature request and taking the time out of your day to make this project better. I think I can make the delimiter configurable since I'm just using String#split
. Let me work on a design this week and I'll update this thread.
Cheers,
Nick
from eslint-plugin-no-secrets.
When are you going to implement these improvements?
If you don't have enough time, I can open a PR.
from eslint-plugin-no-secrets.
Hey @oprogramador, that would be great! I'm moving this weekend so I'm kind of short on time.
from eslint-plugin-no-secrets.
I wrote this plugin https://github.com/oprogramador/eslint-plugin-no-credentials
Anyway thanks for your plugin, it helped me to write mine.
from eslint-plugin-no-secrets.
Hey @oprogramador,
I've added two options to help out with false positives
- additionalDelimiters: In addition to splitting the string by whitespace, tokens will be further split by these delimiters
- ignoreCase: Ignores character case when calculating entropy. This could lead to some false negatives
I'm testing this over some real world scenarios. I think I might remove ignoreCase since it's causing too many false negatives. Splitting by camel case has also some false negatives. I wanted to know your thoughts on this since your feedback has been very helpful.
Cheers,
Nick
from eslint-plugin-no-secrets.
false negative - you mean a secret which isn't detected?
from eslint-plugin-no-secrets.
@oprogramador Yes. Particularly JWT. I found that I had to tune the regular expression so that it would have a certain number of lowercase afterwards. It was still helpful.
from eslint-plugin-no-secrets.
After using this, I think this feature works on all of your use cases. Closing this for now.
from eslint-plugin-no-secrets.
Related Issues (9)
- [feature request] Blacklist particular statements HOT 7
- does this library support ESLint 7? HOT 3
- Unexpected token v when used with eslint-plugin-json HOT 9
- question: find secrets in comments? HOT 3
- continuous integration HOT 6
- real entropy HOT 10
- upgrading dependencies HOT 4
- is there a Changelog? HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from eslint-plugin-no-secrets.