-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Description
Describe the solution you'd like
I have the following secret in my secret.json file in a repo:
{
"client_id" : "0afae57f3ccfd9d7f5767067bc48b30f719e271ba470488056e37ab35d4b6506",
"client_secret" : "6da89121079f83b2eb6acccf8219ea982c3d79bccc3e9c6a85856480661f8fde",
"response_type" : "id_token"
}
I would like to recognize it with the default regex provided in your repo.
The following regex would do so:
(?i)((key|api|token|secret|password)[a-z0-9 .\-,]{0,25})(=|>|:=|||:|<=|=>|:|).{0,5}[\'\"]([0-9a-zA-Z-=]+)[\'\"]
What's the difference:
(=|>|:=|||:|<=|=>|:|) ... the last "|" makes null hits be positiv and continue on regex
([0-9a-zA-Z-=]+) ... the "+" ... makes the limit of 64 disappear. I am not sure if this is a good idea. As time flies by, I guess we will soon see longer secrets
Additional context
My questions:
- is that something you would like to see as a contribution?
- I did not understand how you are testing. Do you have testcases that the secret should be added to?
- How could I test the new regex against existing testcases?
cc @zricethezav