Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for Stripe API keys? #178

Open
wpcarro opened this issue Aug 20, 2020 · 2 comments
Open

Support for Stripe API keys? #178

wpcarro opened this issue Aug 20, 2020 · 2 comments

Comments

@wpcarro
Copy link

wpcarro commented Aug 20, 2020

Stripe has API keys that look like:

>>> 'sk_live_' + ''.join(random.choice(string.ascii_letters) for _ in range(99))
'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'
>>> 'sk_test_' + ''.join(random.choice(string.ascii_letters) for _ in range(99))
'sk_test_TXdHxxfRPIoXiKHRzTSDeJeIXTMhqJbSEhqzIxwIrhYMrRpOaKaCtKxlFWLIcQQvErEOyAULUncklegZUViHWQGorpmcOnBOITC'
>>> 'pk_test_' + ''.join(random.choice(string.ascii_letters) for _ in range(99))
'pk_test_PTUMGUyCetvhIHUKHQckarIqKphkQBNKztuQenTlhEZXzXFRhBtQdiVLjOnESmdLXJCyaKjBnluqTIRNdmCKttYZCxLeUiesbxv'
>>> 'pk_live_' + ''.join(random.choice(string.ascii_letters) for _ in range(99))
'pk_live_PnFOLGGtQOIIWcLXTdKvVmuAjkxhwOcrBIdWgPkfqyKfpYRUPpfjJzweKzfqMEjWUdVfsbKnNmvjDkLrkWxXRMHCXMJPzTOyQnB'

After calling git-secrets --install and committing code that I think git-secrets should detect, I haven't been able to trigger a failed hook. Here are my hooks:

11:12:08 λ fd . | xargs rg 'git secrets'
commit-msg
2:git secrets --commit_msg_hook -- "$@"

pre-commit
3:git secrets --pre_commit_hook -- "$@"

prepare-commit-msg
3:git secrets --prepare_commit_hook -- "$@"

Is this user error? Can anyone reproduce this?

@CubeOfCheese
Copy link

By default git-secrets doesn't detect anything. You have to specify regex patterns for git-secrets to look for.
This is done using the git secretes --add 'your regex pattern here' command.

@sparr
Copy link
Contributor

sparr commented Jun 16, 2023

Along with #194 we might add a prepopulated list of patterns from services like this. Can you describe this sort of key with a regex? Perhaps sk_live_[a-zA-Z]{50,} if 50 is the shortest valid length for the random part of such a key?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants