Support encryption of .env file
Maintainer antworten meist innerhalb von 1 Tag
Dieses Issue hat noch niemand übernommen.
Bewertung
- Schwierigkeit
- 5/5
- Geschätzter Aufwand
- Über eine Woche
- Anfängerfreundlichkeit
- 30/100
Rechercherichtung
Start at the load_dotenv entry point and review how the existing stream-based loading path could relate to an encrypted .env input. The issue's example uses PGP decryption and gnupg, so clarify the supported decryption interface and dependency expectations before implementation. Done should allow encrypted credentials to be loaded without requiring a plaintext .env file on disk.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Beschreibung
Working in a high security environment it is sometimes concerning to have a .env file sitting on your machine with plaintext credentials needed for development. It is also cumbersome to regularly recreate the .env file per working session if the credentials are particularly sensitive. One possible solution would be to support pgp encryption of the .env file, so a call to load dotenv would look like:
from dotenv import load_dotenv
load_dotenv(encrypted=True)
Right now I'm using some boilerplate code like this:
from os import getenv
from io import StringIO
from gnupg import GPG
from dotenv import load_dotenv
# encrypted with `gpg -o .env.gpg -e --default-recipient-self .env`
with open("test.env.gpg", "rb") as f:
env_vars = GPG().decrypt_file(f)
if not env_vars.ok:
raise Exception(f"Decryption failed: {env_vars.status}")
load_dotenv(stream=StringIO(env_vars.data.decode()))
foo = getenv("FOO")
print(f"FOO: {foo}")
This way the decrypted credentials will only ever exist in memory and since I use a yubikey to store my private keys, there is no way to access that key and retrieve those credentials without the physical key.
- Vorherrschende Sprache
- Python
- Sterne
- 8.9k
- Forks
- 600
- Ø Merge
- 4 T. 23 Std.
- Gemergte PRs (30 T.)
- 4
Entwicklungsumgebung
- Kein Dockerfile und keine Docker-Compose-Datei
- Keine Pull-Request-Vorlage
- Beitragsleitfaden lesen
Erste Schritte
- Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
- Forken Sie das Repository und arbeiten Sie in einem Branch.
- Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.
Mehr aus theskumar/python-dotenv
-
An empty value ignores ${name:-default}Evtl. vergeben @SashaMIT hat das vor 11 Tagen übernommen. Offen
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 75/100
theskumar/python-dotenv#715 ·
Maintainer antworten meist innerhalb von 1 Tag
-
set_key and unset_key don't fsync before replacing the .env fileEvtl. vergeben @Imkkey hat das vor 10 Tagen übernommen. Offenenhancement
Schwierigkeit 3/5 1-2 Tage Anfängerfreundlichkeit 72/100
theskumar/python-dotenv#713 ·
Maintainer antworten meist innerhalb von 1 Tag
-
Schwierigkeit 5/5 Über eine Woche Anfängerfreundlichkeit 28/100
theskumar/python-dotenv#693 · 1 Kommentar ·
Maintainer antworten meist innerhalb von 1 Tag
-
python-dotenv installation without cli masks python-dotenv cliEvtl. vergeben @gyanu2507 hat das vor 49 Tagen übernommen. Offen
Schwierigkeit 3/5 1-2 Tage Anfängerfreundlichkeit 55/100
theskumar/python-dotenv#683 · 4 Kommentare ·
Maintainer antworten meist innerhalb von 1 Tag
-
Feature Request: Automatically copy `default.env` to `.env`Evtl. vergeben @dradetsky hat das vor 159 Tagen übernommen. Offen
Schwierigkeit 3/5 1-2 Tage Anfängerfreundlichkeit 55/100
theskumar/python-dotenv#644 · 2 Kommentare ·
Maintainer antworten meist innerhalb von 1 Tag
Alle Issues in theskumar/python-dotenv
Ähnliche Issues
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 68/100
KalicoCrew/kalico#1012 ·
Maintainer antworten meist innerhalb von 1 Tag
-
Schwierigkeit 1/5 Unter einer Stunde Anfängerfreundlichkeit 82/100
esphome/esphome.io#7657 ·
Maintainer antworten meist innerhalb von 1 Tag
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 62/100
VNG-Realisatie/gemma-zaken#2658 ·
-
Schwierigkeit 1/5 Unter einer Stunde Anfängerfreundlichkeit 75/100
Maintainer antworten meist innerhalb von 1 Tag
-
comp/gateway comp/plugins duplicate P3 type/bug
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 82/100
NousResearch/hermes-agent#137019 ·
Maintainer antworten meist innerhalb von 1 Tag