zyppcli 0.1.0__tar.gz → 0.2.1__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.1/PKG-INFO +72 -0
- zyppcli-0.2.1/README.md +62 -0
- {zyppcli-0.1.0 → zyppcli-0.2.1}/pyproject.toml +2 -1
- {zyppcli-0.1.0 → zyppcli-0.2.1}/uv.lock +28 -0
- {zyppcli-0.1.0 → zyppcli-0.2.1}/zyppcli/__main__.py +1 -0
- {zyppcli-0.1.0 → zyppcli-0.2.1}/zyppcli/commands/keyvault.py +24 -2
- zyppcli-0.1.0/PKG-INFO +0 -10
- zyppcli-0.1.0/README.md +0 -1
- {zyppcli-0.1.0 → zyppcli-0.2.1}/.github/workflows/ci.yaml +0 -0
- {zyppcli-0.1.0 → zyppcli-0.2.1}/.github/workflows/publish.yaml +0 -0
- {zyppcli-0.1.0 → zyppcli-0.2.1}/.gitignore +0 -0
- {zyppcli-0.1.0 → zyppcli-0.2.1}/.pre-commit-config.yaml +0 -0
- {zyppcli-0.1.0 → zyppcli-0.2.1}/plans/zyppcli-plan.md +0 -0
- {zyppcli-0.1.0 → zyppcli-0.2.1}/zyppcli/__init__.py +0 -0
- {zyppcli-0.1.0 → zyppcli-0.2.1}/zyppcli/commands/__init__.py +0 -0
zyppcli-0.2.1/PKG-INFO
ADDED
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: zyppcli
|
|
3
|
+
Version: 0.2.1
|
|
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
|
+
To filter by name (case-insensitive substring match):
|
|
46
|
+
|
|
47
|
+
```bash
|
|
48
|
+
zypp keyvault list --subscription <subscription-id> --name dev
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
### Load secrets from Azure Key Vault
|
|
52
|
+
|
|
53
|
+
```bash
|
|
54
|
+
eval $(zypp keyvault load --vault <vault-name>)
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
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`).
|
|
58
|
+
|
|
59
|
+
Without `eval`, the command only prints the export statements without setting them:
|
|
60
|
+
|
|
61
|
+
```bash
|
|
62
|
+
zypp keyvault load --vault <vault-name>
|
|
63
|
+
# Output:
|
|
64
|
+
# export DB_PASSWORD='...'
|
|
65
|
+
# export SQL_DB='...'
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
### Version
|
|
69
|
+
|
|
70
|
+
```bash
|
|
71
|
+
zypp --version
|
|
72
|
+
```
|
zyppcli-0.2.1/README.md
ADDED
|
@@ -0,0 +1,62 @@
|
|
|
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
|
+
To filter by name (case-insensitive substring match):
|
|
36
|
+
|
|
37
|
+
```bash
|
|
38
|
+
zypp keyvault list --subscription <subscription-id> --name dev
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
### Load secrets from Azure Key Vault
|
|
42
|
+
|
|
43
|
+
```bash
|
|
44
|
+
eval $(zypp keyvault load --vault <vault-name>)
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
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`).
|
|
48
|
+
|
|
49
|
+
Without `eval`, the command only prints the export statements without setting them:
|
|
50
|
+
|
|
51
|
+
```bash
|
|
52
|
+
zypp keyvault load --vault <vault-name>
|
|
53
|
+
# Output:
|
|
54
|
+
# export DB_PASSWORD='...'
|
|
55
|
+
# export SQL_DB='...'
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
### Version
|
|
59
|
+
|
|
60
|
+
```bash
|
|
61
|
+
zypp --version
|
|
62
|
+
```
|
|
@@ -4,13 +4,14 @@ build-backend = "hatchling.build"
|
|
|
4
4
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "zyppcli"
|
|
7
|
-
version = "0.1
|
|
7
|
+
version = "0.2.1"
|
|
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,37 @@ 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
|
+
list_parser.add_argument("--name", help="Filter vaults whose name contains this value (case-insensitive)")
|
|
20
|
+
|
|
16
21
|
load_parser = keyvault_subparsers.add_parser("load", help="Load secrets as shell export statements")
|
|
17
22
|
load_parser.add_argument("--vault", required=True, help="Name of the Azure Key Vault")
|
|
18
23
|
|
|
19
24
|
|
|
20
25
|
def run(args: argparse.Namespace) -> None:
|
|
21
26
|
"""Execute the specified 'keyvault' command."""
|
|
22
|
-
if args.keyvault_command == "
|
|
27
|
+
if args.keyvault_command == "list":
|
|
28
|
+
_list(args.subscription, name_filter=args.name)
|
|
29
|
+
elif args.keyvault_command == "load":
|
|
23
30
|
_load(args.vault)
|
|
24
31
|
else:
|
|
25
|
-
logger.error("Usage: zypp keyvault load
|
|
32
|
+
logger.error("Usage: zypp keyvault {list,load}")
|
|
33
|
+
sys.exit(1)
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
def _list(subscription_id: str, name_filter: str | None = None) -> None:
|
|
37
|
+
"""List all accessible Key Vaults in the subscription."""
|
|
38
|
+
try:
|
|
39
|
+
credential = DefaultAzureCredential(exclude_environment_credential=True)
|
|
40
|
+
client = KeyVaultManagementClient(credential=credential, subscription_id=subscription_id)
|
|
41
|
+
for vault in client.vaults.list_by_subscription():
|
|
42
|
+
if name_filter and name_filter.lower() not in vault.name.lower():
|
|
43
|
+
continue
|
|
44
|
+
print(vault.name)
|
|
45
|
+
except Exception as e:
|
|
46
|
+
logger.exception("Failed to list Key Vaults: %s", e)
|
|
47
|
+
logger.info("Hint: Make sure you are authenticated via `az login`.")
|
|
26
48
|
sys.exit(1)
|
|
27
49
|
|
|
28
50
|
|
zyppcli-0.1.0/PKG-INFO
DELETED
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
|
|
File without changes
|
|
File without changes
|
|
File without changes
|