toru-vault 0.1.2__py3-none-any.whl → 0.1.4__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
toru_vault/vault.py CHANGED
@@ -530,3 +530,46 @@ def get(project_id=None, refresh=False, use_keyring=True):
530
530
 
531
531
  # Create the lazy dictionary with keyring getter/setter/deleter
532
532
  return LazySecretsDict(secret_keys, _keyring_getter, _keyring_setter, _keyring_deleter)
533
+
534
+
535
+ def get_all(refresh=False, use_keyring=True):
536
+ """
537
+ Return a combined dictionary of secrets from all projects that user has access to
538
+
539
+ Args:
540
+ refresh (bool, optional): Force refresh the secrets cache
541
+ use_keyring (bool, optional): Whether to use system keyring (True) or in-memory encryption (False)
542
+
543
+ Returns:
544
+ dict: Dictionary of secrets with their names as keys, using lazy loading
545
+ """
546
+ # Initialize the client
547
+ client = _initialize_client()
548
+ if not client:
549
+ logging.error("Failed to initialize Bitwarden client")
550
+ return {}
551
+
552
+ # Get organization ID
553
+ organization_id = _get_from_keyring_or_env("ORGANIZATION_ID", "ORGANIZATION_ID")
554
+ if not organization_id:
555
+ logging.error("Organization ID not found in keyring or environment variables")
556
+ return {}
557
+
558
+ try:
559
+ # Get all projects
560
+ projects = client.projects_api.get_projects(organization_id)
561
+ if not projects or not projects.data:
562
+ logging.warning("No projects found in the organization")
563
+ return {}
564
+
565
+ # Create a combined dictionary with all secrets
566
+ all_secrets = {}
567
+ for project in projects.data:
568
+ project_secrets = get(project.id, refresh=refresh, use_keyring=use_keyring)
569
+ # Update the combined dictionary (note: this will overwrite duplicate keys)
570
+ all_secrets.update(project_secrets)
571
+
572
+ return all_secrets
573
+ except Exception as e:
574
+ logging.error(f"Error retrieving projects: {str(e)}")
575
+ return {}
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: toru-vault
3
- Version: 0.1.2
3
+ Version: 0.1.4
4
4
  Summary: ToruVault: A simple Python package for managing Bitwarden secrets
5
5
  Author: Toru AI
6
6
  Author-email: ToruAI <mpaszynski@toruai.com>
@@ -15,13 +15,13 @@ Description-Content-Type: text/markdown
15
15
  License-File: LICENSE
16
16
  Requires-Dist: bitwarden-sdk
17
17
  Requires-Dist: cryptography>=36.0.0
18
+ Provides-Extra: keyring
19
+ Requires-Dist: keyring>=23.0.0; extra == "keyring"
18
20
  Dynamic: author
19
21
  Dynamic: license-file
20
22
  Dynamic: requires-python
21
23
 
22
- <p align="center">
23
- <img src="img/logo.svg" alt="ToruVault Logo" width="300"/>
24
- </p>
24
+ ![ToruVault Logo](https://toruai.com/toruai-logo.png)
25
25
 
26
26
  # ToruVault
27
27
 
@@ -51,21 +51,27 @@ A simple Python package for managing Bitwarden secrets with enhanced security.
51
51
  # Install UV if you don't have it already
52
52
  curl -LsSf https://astral.sh/uv/install.sh | sh
53
53
 
54
- # Install toru-vault package
54
+ # Install toru-vault package (basic installation)
55
55
  uv pip install toru-vault
56
56
 
57
+ # Or install with keyring support (recommended for secure storage)
58
+ uv pip install toru-vault[keyring]
59
+
57
60
  # Or install in a virtual environment (recommended)
58
61
  uv venv create -p python3.10 .venv
59
62
  source .venv/bin/activate # On Windows: .venv\Scripts\activate
60
- uv pip install toru-vault
63
+ uv pip install toru-vault[keyring]
61
64
  ```
62
65
 
63
-
64
- This will automatically install all required dependencies:
66
+ This will install all required dependencies:
65
67
  - bitwarden-sdk - For interfacing with Bitwarden API
66
- - keyring - For secure credential storage
67
68
  - cryptography - For encryption/decryption operations
68
69
 
70
+ And when installed with the keyring option:
71
+ - keyring - For secure credential storage using OS keyring
72
+
73
+ > **Note:** Keyring is now optional but recommended. Without keyring, some features like `toru-vault init` won't work, and you'll need to use the `use_keyring=False` parameter with the `get()` function to use in-memory encryption instead of the system keyring.
74
+
69
75
  ### From Source with UV
70
76
 
71
77
  ```bash
@@ -0,0 +1,11 @@
1
+ toru_vault/__init__.py,sha256=Co9SSa9gFFTME0YcMzA1vEqJxs045-0kYfdP9GxGasU,177
2
+ toru_vault/__main__.py,sha256=C7_IR95L9yMpwx_Nj31lQDnA9q9bo56j7lk1s6aoL9I,6729
3
+ toru_vault/lazy_dict.py,sha256=OZVD-VYQHFRzMw1dOPXpagnddAJNNCZKtcdmTiio4lk,3232
4
+ toru_vault/py.typed,sha256=AbpHGcgLb-kRsJGnwFEktk7uzpZOCcBY74-YBdrKVGs,1
5
+ toru_vault/vault.py,sha256=Mrkhf2AXoEIwMNj4N8psO-sga1E_XtHhKiTm_haS_nE,20551
6
+ toru_vault-0.1.4.dist-info/licenses/LICENSE,sha256=TbuuchABSutbmmaI1M232F22GsaI88_hwEvto5w_Ux4,1063
7
+ toru_vault-0.1.4.dist-info/METADATA,sha256=JDfnAJi-KJDJgyQH9flVQff6abGa8eCRmF5ezzxfyAM,8159
8
+ toru_vault-0.1.4.dist-info/WHEEL,sha256=Nw36Djuh_5VDukK0H78QzOX-_FQEo6V37m3nkm96gtU,91
9
+ toru_vault-0.1.4.dist-info/entry_points.txt,sha256=dfqkbNftpmAv0iKzVgdkjymkCfj3TwzUrQm2PO7Xgxs,56
10
+ toru_vault-0.1.4.dist-info/top_level.txt,sha256=c9ulQ18kKs3HbkI5oeoLmnFTknjC0rY1BwsNLJKDua8,11
11
+ toru_vault-0.1.4.dist-info/RECORD,,
@@ -1,11 +0,0 @@
1
- toru_vault/__init__.py,sha256=Co9SSa9gFFTME0YcMzA1vEqJxs045-0kYfdP9GxGasU,177
2
- toru_vault/__main__.py,sha256=C7_IR95L9yMpwx_Nj31lQDnA9q9bo56j7lk1s6aoL9I,6729
3
- toru_vault/lazy_dict.py,sha256=OZVD-VYQHFRzMw1dOPXpagnddAJNNCZKtcdmTiio4lk,3232
4
- toru_vault/py.typed,sha256=AbpHGcgLb-kRsJGnwFEktk7uzpZOCcBY74-YBdrKVGs,1
5
- toru_vault/vault.py,sha256=RLJanRaVnOb4SCvKjJiZJYlUX2QBHRzqpI-Z_vp32Jk,18981
6
- toru_vault-0.1.2.dist-info/licenses/LICENSE,sha256=TbuuchABSutbmmaI1M232F22GsaI88_hwEvto5w_Ux4,1063
7
- toru_vault-0.1.2.dist-info/METADATA,sha256=PjjMbtMSXK2etqyMFVTTVA9GJtUXTGQTchioAaUYrQI,7673
8
- toru_vault-0.1.2.dist-info/WHEEL,sha256=Nw36Djuh_5VDukK0H78QzOX-_FQEo6V37m3nkm96gtU,91
9
- toru_vault-0.1.2.dist-info/entry_points.txt,sha256=dfqkbNftpmAv0iKzVgdkjymkCfj3TwzUrQm2PO7Xgxs,56
10
- toru_vault-0.1.2.dist-info/top_level.txt,sha256=c9ulQ18kKs3HbkI5oeoLmnFTknjC0rY1BwsNLJKDua8,11
11
- toru_vault-0.1.2.dist-info/RECORD,,