zyppcli 0.1.0__tar.gz → 0.2.0__tar.gz

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.
zyppcli-0.2.0/PKG-INFO ADDED
@@ -0,0 +1,66 @@
1
+ Metadata-Version: 2.4
2
+ Name: zyppcli
3
+ Version: 0.2.0
4
+ Summary: Internal CLI for Zypp
5
+ Requires-Python: >=3.12
6
+ Requires-Dist: azure-identity>=1.17.0
7
+ Requires-Dist: azure-keyvault-secrets>=4.8.0
8
+ Requires-Dist: azure-mgmt-keyvault>=10.0.0
9
+ Description-Content-Type: text/markdown
10
+
11
+ # Zypp CLI
12
+
13
+ Internal CLI for Zypp. Replaces `.env` files by loading secrets directly from Azure Key Vault into your shell environment.
14
+
15
+ ## Installation
16
+
17
+ ```bash
18
+ uv tool install zyppcli
19
+ ```
20
+
21
+ To upgrade to the latest version:
22
+
23
+ ```bash
24
+ uv tool install zyppcli --upgrade
25
+ ```
26
+
27
+ ## Prerequisites
28
+
29
+ You need to be authenticated with Azure:
30
+
31
+ ```bash
32
+ az login
33
+ ```
34
+
35
+ ## Usage
36
+
37
+ ### List Key Vaults
38
+
39
+ ```bash
40
+ zypp keyvault list --subscription <subscription-id>
41
+ ```
42
+
43
+ Lists all accessible Key Vaults in the given Azure subscription.
44
+
45
+ ### Load secrets from Azure Key Vault
46
+
47
+ ```bash
48
+ eval $(zypp keyvault load --vault <vault-name>)
49
+ ```
50
+
51
+ This fetches all enabled secrets from the specified vault and exports them as environment variables. Secret names are transformed: hyphens become underscores and the name is uppercased (e.g. `db-password` becomes `DB_PASSWORD`).
52
+
53
+ Without `eval`, the command only prints the export statements without setting them:
54
+
55
+ ```bash
56
+ zypp keyvault load --vault <vault-name>
57
+ # Output:
58
+ # export DB_PASSWORD='...'
59
+ # export SQL_DB='...'
60
+ ```
61
+
62
+ ### Version
63
+
64
+ ```bash
65
+ zypp --version
66
+ ```
@@ -0,0 +1,56 @@
1
+ # Zypp CLI
2
+
3
+ Internal CLI for Zypp. Replaces `.env` files by loading secrets directly from Azure Key Vault into your shell environment.
4
+
5
+ ## Installation
6
+
7
+ ```bash
8
+ uv tool install zyppcli
9
+ ```
10
+
11
+ To upgrade to the latest version:
12
+
13
+ ```bash
14
+ uv tool install zyppcli --upgrade
15
+ ```
16
+
17
+ ## Prerequisites
18
+
19
+ You need to be authenticated with Azure:
20
+
21
+ ```bash
22
+ az login
23
+ ```
24
+
25
+ ## Usage
26
+
27
+ ### List Key Vaults
28
+
29
+ ```bash
30
+ zypp keyvault list --subscription <subscription-id>
31
+ ```
32
+
33
+ Lists all accessible Key Vaults in the given Azure subscription.
34
+
35
+ ### Load secrets from Azure Key Vault
36
+
37
+ ```bash
38
+ eval $(zypp keyvault load --vault <vault-name>)
39
+ ```
40
+
41
+ This fetches all enabled secrets from the specified vault and exports them as environment variables. Secret names are transformed: hyphens become underscores and the name is uppercased (e.g. `db-password` becomes `DB_PASSWORD`).
42
+
43
+ Without `eval`, the command only prints the export statements without setting them:
44
+
45
+ ```bash
46
+ zypp keyvault load --vault <vault-name>
47
+ # Output:
48
+ # export DB_PASSWORD='...'
49
+ # export SQL_DB='...'
50
+ ```
51
+
52
+ ### Version
53
+
54
+ ```bash
55
+ zypp --version
56
+ ```
@@ -4,13 +4,14 @@ build-backend = "hatchling.build"
4
4
 
5
5
  [project]
6
6
  name = "zyppcli"
7
- version = "0.1.0"
7
+ version = "0.2.0"
8
8
  description = "Internal CLI for Zypp"
9
9
  readme = "README.md"
10
10
  requires-python = ">=3.12"
11
11
  dependencies = [
12
12
  "azure-identity>=1.17.0",
13
13
  "azure-keyvault-secrets>=4.8.0",
14
+ "azure-mgmt-keyvault>=10.0.0",
14
15
  ]
15
16
 
16
17
  [project.scripts]
@@ -45,6 +45,32 @@ wheels = [
45
45
  { url = "https://files.pythonhosted.org/packages/26/94/7c902e966b28e7cb5080a8e0dd6bffc22ba44bc907f09c4c633d2b7c4f6a/azure_keyvault_secrets-4.10.0-py3-none-any.whl", hash = "sha256:9dbde256077a4ee1a847646671580692e3f9bea36bcfc189c3cf2b9a94eb38b9", size = 125237, upload-time = "2025-06-16T22:52:22.489Z" },
46
46
  ]
47
47
 
48
+ [[package]]
49
+ name = "azure-mgmt-core"
50
+ version = "1.6.0"
51
+ source = { registry = "https://pypi.org/simple" }
52
+ dependencies = [
53
+ { name = "azure-core" },
54
+ ]
55
+ sdist = { url = "https://files.pythonhosted.org/packages/3e/99/fa9e7551313d8c7099c89ebf3b03cd31beb12e1b498d575aa19bb59a5d04/azure_mgmt_core-1.6.0.tar.gz", hash = "sha256:b26232af857b021e61d813d9f4ae530465255cb10b3dde945ad3743f7a58e79c", size = 30818, upload-time = "2025-07-03T02:02:24.093Z" }
56
+ wheels = [
57
+ { url = "https://files.pythonhosted.org/packages/a0/26/c79f962fd3172b577b6f38685724de58b6b4337a51d3aad316a43a4558c6/azure_mgmt_core-1.6.0-py3-none-any.whl", hash = "sha256:0460d11e85c408b71c727ee1981f74432bc641bb25dfcf1bb4e90a49e776dbc4", size = 29310, upload-time = "2025-07-03T02:02:25.203Z" },
58
+ ]
59
+
60
+ [[package]]
61
+ name = "azure-mgmt-keyvault"
62
+ version = "13.0.0"
63
+ source = { registry = "https://pypi.org/simple" }
64
+ dependencies = [
65
+ { name = "azure-mgmt-core" },
66
+ { name = "isodate" },
67
+ { name = "typing-extensions" },
68
+ ]
69
+ sdist = { url = "https://files.pythonhosted.org/packages/39/44/d453a7a125cb44f6443808f11c820a4c3f88d0af2c5b8d9adaf490ed064e/azure_mgmt_keyvault-13.0.0.tar.gz", hash = "sha256:56c12904e6d9ac49f886483e50e3f635d8bf43a489eb32fa7b4832f323d396c7", size = 102260, upload-time = "2025-12-11T10:14:41.609Z" }
70
+ wheels = [
71
+ { url = "https://files.pythonhosted.org/packages/00/e4/f11ae6caa523834be04a1d52dee11c79f8838e6752f95af3bcfd4f979713/azure_mgmt_keyvault-13.0.0-py3-none-any.whl", hash = "sha256:02c5ca1b428fa7a2c393c6891b7436ad529a7ad22d378eba0b9a26291da67a0d", size = 102054, upload-time = "2025-12-11T10:14:43.064Z" },
72
+ ]
73
+
48
74
  [[package]]
49
75
  name = "certifi"
50
76
  version = "2026.2.25"
@@ -328,12 +354,14 @@ source = { editable = "." }
328
354
  dependencies = [
329
355
  { name = "azure-identity" },
330
356
  { name = "azure-keyvault-secrets" },
357
+ { name = "azure-mgmt-keyvault" },
331
358
  ]
332
359
 
333
360
  [package.metadata]
334
361
  requires-dist = [
335
362
  { name = "azure-identity", specifier = ">=1.17.0" },
336
363
  { name = "azure-keyvault-secrets", specifier = ">=4.8.0" },
364
+ { name = "azure-mgmt-keyvault", specifier = ">=10.0.0" },
337
365
  ]
338
366
 
339
367
  [package.metadata.requires-dev]
@@ -9,6 +9,7 @@ from zyppcli.commands import keyvault
9
9
  def main() -> None:
10
10
  """Entry point for the Zypp CLI."""
11
11
  logging.basicConfig(level=logging.INFO, format="%(levelname)s: %(message)s", stream=sys.stderr)
12
+ logging.getLogger("azure").setLevel(logging.WARNING)
12
13
 
13
14
  parser = argparse.ArgumentParser(prog="zypp", description="Zypp CLI")
14
15
  parser.add_argument("--version", action="version", version=f"%(prog)s {__version__}")
@@ -4,6 +4,7 @@ import sys
4
4
 
5
5
  from azure.identity import DefaultAzureCredential
6
6
  from azure.keyvault.secrets import SecretClient
7
+ from azure.mgmt.keyvault import KeyVaultManagementClient
7
8
 
8
9
  logger = logging.getLogger(__name__)
9
10
 
@@ -13,16 +14,34 @@ def register(subparsers: argparse._SubParsersAction) -> None:
13
14
  keyvault_parser = subparsers.add_parser("keyvault", help="Azure Key Vault operations")
14
15
  keyvault_subparsers = keyvault_parser.add_subparsers(dest="keyvault_command")
15
16
 
17
+ list_parser = keyvault_subparsers.add_parser("list", help="List all accessible Key Vaults")
18
+ list_parser.add_argument("--subscription", required=True, help="Azure subscription ID")
19
+
16
20
  load_parser = keyvault_subparsers.add_parser("load", help="Load secrets as shell export statements")
17
21
  load_parser.add_argument("--vault", required=True, help="Name of the Azure Key Vault")
18
22
 
19
23
 
20
24
  def run(args: argparse.Namespace) -> None:
21
25
  """Execute the specified 'keyvault' command."""
22
- if args.keyvault_command == "load":
26
+ if args.keyvault_command == "list":
27
+ _list(args.subscription)
28
+ elif args.keyvault_command == "load":
23
29
  _load(args.vault)
24
30
  else:
25
- logger.error("Usage: zypp keyvault load --vault <name>")
31
+ logger.error("Usage: zypp keyvault {list,load}")
32
+ sys.exit(1)
33
+
34
+
35
+ def _list(subscription_id: str) -> None:
36
+ """List all accessible Key Vaults in the subscription."""
37
+ try:
38
+ credential = DefaultAzureCredential(exclude_environment_credential=True)
39
+ client = KeyVaultManagementClient(credential=credential, subscription_id=subscription_id)
40
+ for vault in client.vaults.list_by_subscription():
41
+ print(vault.name)
42
+ except Exception as e:
43
+ logger.exception("Failed to list Key Vaults: %s", e)
44
+ logger.info("Hint: Make sure you are authenticated via `az login`.")
26
45
  sys.exit(1)
27
46
 
28
47
 
zyppcli-0.1.0/PKG-INFO DELETED
@@ -1,10 +0,0 @@
1
- Metadata-Version: 2.4
2
- Name: zyppcli
3
- Version: 0.1.0
4
- Summary: Internal CLI for Zypp
5
- Requires-Python: >=3.12
6
- Requires-Dist: azure-identity>=1.17.0
7
- Requires-Dist: azure-keyvault-secrets>=4.8.0
8
- Description-Content-Type: text/markdown
9
-
10
- # Zypp CLI
zyppcli-0.1.0/README.md DELETED
@@ -1 +0,0 @@
1
- # Zypp CLI
File without changes
File without changes
File without changes
File without changes