Gitpass is an extension of the Python standard library's getpass, designed for keeping passwords out of your git repository and caching them so you don't have to repeat yourself.
Do you have a password, credentials or other information that you don't want to commit to your git repository? Use gitpass as a quick, easy, and insecure way to prevent a password from appearing on your git repository, while only having to enter it once.
WARNING: Passwords are saved in hidden text files at the base directory of your git repository. Although they are obfuscated, they are not encrpyted and keep in mind they are vulnerable to other users of your computer.
pip install gitpass
import gitpass aws_pwd = gitpass.gitpass('AWS Password')
The first time you use this in your git repository, it will:
- Prompt you for a password in the terminal
- Create a file called
.__aws_passwordthat contains your password in base64 encoding
The next time you use the password, it will not prompt you again for your password.
gitpass.gitpass(prompt, passfile=None, force_prompt=False)
passfile: the name of the file to store the password. If this is not specified, a default filename will be created from the prompt (lowercased and with whitespace removed)
force_prompt: if True, it forces the user to enter the password again, ignoring whatever is in the file