Python implementation of git-secrets
Project description
Python Git Secrets
A pure Python library providing git-secrets functionality.
We don't plan to do everything that git-secrets does (i.e. placing patterns in your .gitconfig file), but provide you with the building blocks for matching patterns you don't want exposed to the world via Github. This will allow you to run the tool in an AWS Lambda function with no dependence on external binaries.
There are no longer AWS credentials in this repository (at one time there were inactive AWS credentials used for testing purposes.) Now testing is performed by generating AWS credential strings on the fly using the same pattern that AWS uses for their creds.
Requirements
- Dulwich - A pure Python Git implementation.
Sample usage
Run the python-git-secrets.py
command to try it out:
(venv) [mbacchi@hostname python-git-secrets]$ python samples/python-git-secrets.py --scan flask-quotes --repository https://github.com/mbacchi/flask-quotes --use_local_repo -r
Scanning flask-quotes recursively
flask-quotes
SCANNING: flask-quotes/app.py
Found verboten string in path flask-quotes
Running Tests
To run tests, execute test_driver.py
from the top level directory, you'll see output similar to:
(venv) [mbacchi@hostname python-git-secrets]$ python test_driver.py
....
----------------------------------------------------------------------
Ran 4 tests in 0.005s
OK
TODO
- create logging capabilities
- enable verbose output
- support more git-secrets tests
Meta
Matt Bacchi - mbacchi@gmail.com
Distributed under the BSD (Simplified) license. See LICENSE
for more information.
Contributing
- Fork it (https://github.com/mbacchi/python-git-secrets/fork)
- Create your feature branch (
git checkout -b feature/fooBar
) - Commit your changes (
git commit -am 'Add some fooBar'
) - Push to the branch (
git push origin feature/fooBar
) - Create a new Pull Request
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file python-git-secrets-0.1.3.tar.gz
.
File metadata
- Download URL: python-git-secrets-0.1.3.tar.gz
- Upload date:
- Size: 5.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/45.2.0 requests-toolbelt/0.9.1 tqdm/4.42.1 CPython/3.7.6
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2753166d8ea37657df20af0bdbd8c47916b6a77bc0cd1eb4b51048331baae37d |
|
MD5 | e9e138a3dcdda3ca6e97d0b8f6d53ad7 |
|
BLAKE2b-256 | 612cfb13659d96f7d23023a7f695df4254d471cc140e7472992d90f8659fbfce |
File details
Details for the file python_git_secrets-0.1.3-py3-none-any.whl
.
File metadata
- Download URL: python_git_secrets-0.1.3-py3-none-any.whl
- Upload date:
- Size: 4.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/45.2.0 requests-toolbelt/0.9.1 tqdm/4.42.1 CPython/3.7.6
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8bab056001f157a9ee7a64b1532b84832d3e4557727fe42f83a415f3cea1b9e2 |
|
MD5 | 6786d17ddb13b289096c13051d574f3c |
|
BLAKE2b-256 | ffac217ae6172ef1d5bee3262c16653861c191356b5320f4a2f1e5e98b90aeca |