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

Environment variable for cryptfile password key #32

Open
martinrm77 opened this issue Nov 29, 2023 · 3 comments
Open

Environment variable for cryptfile password key #32

martinrm77 opened this issue Nov 29, 2023 · 3 comments

Comments

@martinrm77
Copy link

I am trying to use your fantastic keyring module in automation, but it lacks a scriptet method to give it a password key for the cryptfile, it keeps using a console prompt.
I can find the code to use an environment variable in the main branch, but when does it get pushed to a new version 3.10 and to pypi?
Please?

Then I can use it in scripts and with the ansible keyring_info module..

@Y3NK
Copy link

Y3NK commented Dec 13, 2023

Is it what you are looking after ?

from getpass import getpass
from os import getenv
from keyrings.cryptfile.cryptfile import CryptFileKeyring
import keyring
kr = CryptFileKeyring()
kr.keyring_key = getenv("MY_VAR_ENV_NAME") or getpass()

@martinrm77
Copy link
Author

No, I am looking for the functionality already in main, version 1.4.1., that takes the cryptfile password from an environment variable. I just wish it was published to pypi, so I can use it as painless as other python modules.

@shakefu
Copy link

shakefu commented Jan 31, 2024

@frispete - it looks like the 1.3.9 tag was a bad release - the code referenced by that tag is 2+ years old despite it being tagged in 2023. The environment variable KEYRING_CRYPTFILE_PATH present on main and added Nov 13, 2023 is not in that release. It only references the keyring.platform_.data_root().

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