diff --git a/secret_loader/__init__.py b/secret_loader/__init__.py index a9f91db..6ace620 100644 --- a/secret_loader/__init__.py +++ b/secret_loader/__init__.py @@ -20,7 +20,7 @@ Secret loading order: 3. [Pass: the standard unix password manager](https://www.passwordstore.org/). Most suited for personal usage; very unsuited for server environments. Requires `pass` installed - locally, and configuration of the `PASS_FOLDER` through one of the above + locally, and configuration of the `PASS_STORE_SUBFOLDER` through one of the above methods. 4. Vault instance if configured. Suited for production environments. """ @@ -42,7 +42,7 @@ ENV_KEY_VAULT_URL = 'VAULT_URL' ENV_KEY_VAULT_TOKEN = 'VAULT_TOKEN' ENV_KEY_VAULT_MOUNT_POINT = 'VAULT_MOUNT_POINT' -ENV_KEY_PASS_FOLDER = 'PASS_FOLDER' +ENV_KEY_PASS_FOLDER = 'PASS_STORE_SUBFOLDER' class SecretLoader: """ @@ -111,9 +111,9 @@ class SecretLoader: return None cmd = ['pass', 'show', f'{self.pass_folder}/{env_key.lower()}'] - process = subprocess.run(cmd, capture_output = True, check = True) - print(process) - + process = subprocess.run(cmd, capture_output = True) + if process.returncode: + return None return process.stdout.decode('utf8') def _load_or_none_vault(self, env_key: str) -> str | None: