From 1e67279062546aecec37a451e19971a1d420b94c Mon Sep 17 00:00:00 2001 From: nsnguyen Date: Wed, 3 May 2023 16:12:41 -0700 Subject: [PATCH 1/2] fix small bug when raising DotEnvVaultError --- src/dotenv_vault/main.py | 3 +-- src/dotenv_vault/test_vault.py | 5 ++--- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/src/dotenv_vault/main.py b/src/dotenv_vault/main.py index d9500bf..0b8c480 100644 --- a/src/dotenv_vault/main.py +++ b/src/dotenv_vault/main.py @@ -112,7 +112,7 @@ def parse_key(dotenv_key): # of the URI, possibly with a prefix. key = uri.password if len(key) < KEY_LENGTH: - raise DotEnvVault('INVALID_DOTENV_KEY: Key part must be 64 characters long (or more)') + raise DotEnvVaultError('INVALID_DOTENV_KEY: Key part must be 64 characters long (or more)') # The environment is provided in the URI's query parameters. params = dict(parse_qsl(uri.query)) @@ -152,4 +152,3 @@ def _key_rotation(keys: list[dict]) -> str: except InvalidTag: continue raise DotEnvVaultError('INVALID_DOTENV_KEY: Key must be valid.') - \ No newline at end of file diff --git a/src/dotenv_vault/test_vault.py b/src/dotenv_vault/test_vault.py index 9f97a94..dae8bbd 100644 --- a/src/dotenv_vault/test_vault.py +++ b/src/dotenv_vault/test_vault.py @@ -43,8 +43,8 @@ def test_key_parsing(self): PARSE_TEST_KEY = "dotenv://:key_0dec82bea24ada79a983dcc11b431e28838eae59a07a8f983247c7ca9027a925@dotenv.local/vault/.env.vault?environment=development" PARSE_TEST_VAULT = """# .env.vault (generated with npx dotenv-vault local build) -DOTENV_VAULT_DEVELOPMENT="H2A2wOUZU+bjKH3kTpeua9iIhtK/q7/VpAn+LLVNnms+CtQ/cwXqiw==" -""" + DOTENV_VAULT_DEVELOPMENT="H2A2wOUZU+bjKH3kTpeua9iIhtK/q7/VpAn+LLVNnms+CtQ/cwXqiw==" + """ def test_vault_parsing(self): old_dotenv_key = os.environ.get("DOTENV_KEY") @@ -57,4 +57,3 @@ def test_vault_parsing(self): os.unsetenv("DOTENV_KEY") if old_dotenv_key: os.environ["DOTENV_KEY"] = old_dotenv_key - \ No newline at end of file From 5f18aed5a36529f303f9caf1c5f5013c3fb6a889 Mon Sep 17 00:00:00 2001 From: nsnguyen Date: Wed, 3 May 2023 16:13:17 -0700 Subject: [PATCH 2/2] bump version to 0.5.1 --- src/dotenv_vault/__version__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/dotenv_vault/__version__.py b/src/dotenv_vault/__version__.py index c16cf99..4ec162c 100644 --- a/src/dotenv_vault/__version__.py +++ b/src/dotenv_vault/__version__.py @@ -1,7 +1,7 @@ __title__ = "python-dotenv-vault" __description__ = "Decrypt .env.vault file." __url__ = "https://github.com/dotenv-org/python-dotenv-vault" -__version__ = "0.5.0" +__version__ = "0.5.1" __author__ = "dotenv" __author_email__ = "mot@dotenv.org" __license__ = "MIT"