Skip to content

Commit

Permalink
Merge branch 'master' of github.com:dotenv-org/python-dotenv-vault
Browse files Browse the repository at this point in the history
  • Loading branch information
motdotla committed May 4, 2023
2 parents a3c6244 + 50f413b commit 455eb30
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 6 deletions.
2 changes: 1 addition & 1 deletion src/dotenv_vault/__version__.py
Original file line number Diff line number Diff line change
@@ -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__ = "[email protected]"
__license__ = "MIT"
3 changes: 1 addition & 2 deletions src/dotenv_vault/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down Expand Up @@ -152,4 +152,3 @@ def _key_rotation(keys: list[dict]) -> str:
except InvalidTag:
continue
raise DotEnvVaultError('INVALID_DOTENV_KEY: Key must be valid.')

5 changes: 2 additions & 3 deletions src/dotenv_vault/test_vault.py
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand All @@ -57,4 +57,3 @@ def test_vault_parsing(self):
os.unsetenv("DOTENV_KEY")
if old_dotenv_key:
os.environ["DOTENV_KEY"] = old_dotenv_key

0 comments on commit 455eb30

Please sign in to comment.