zyppcli 0.2.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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: zyppcli
3
- Version: 0.2.0
3
+ Version: 0.2.1
4
4
  Summary: Internal CLI for Zypp
5
5
  Requires-Python: >=3.12
6
6
  Requires-Dist: azure-identity>=1.17.0
@@ -42,6 +42,12 @@ zypp keyvault list --subscription <subscription-id>
42
42
 
43
43
  Lists all accessible Key Vaults in the given Azure subscription.
44
44
 
45
+ To filter by name (case-insensitive substring match):
46
+
47
+ ```bash
48
+ zypp keyvault list --subscription <subscription-id> --name dev
49
+ ```
50
+
45
51
  ### Load secrets from Azure Key Vault
46
52
 
47
53
  ```bash
@@ -32,6 +32,12 @@ zypp keyvault list --subscription <subscription-id>
32
32
 
33
33
  Lists all accessible Key Vaults in the given Azure subscription.
34
34
 
35
+ To filter by name (case-insensitive substring match):
36
+
37
+ ```bash
38
+ zypp keyvault list --subscription <subscription-id> --name dev
39
+ ```
40
+
35
41
  ### Load secrets from Azure Key Vault
36
42
 
37
43
  ```bash
@@ -4,7 +4,7 @@ build-backend = "hatchling.build"
4
4
 
5
5
  [project]
6
6
  name = "zyppcli"
7
- version = "0.2.0"
7
+ version = "0.2.1"
8
8
  description = "Internal CLI for Zypp"
9
9
  readme = "README.md"
10
10
  requires-python = ">=3.12"
@@ -16,6 +16,7 @@ def register(subparsers: argparse._SubParsersAction) -> None:
16
16
 
17
17
  list_parser = keyvault_subparsers.add_parser("list", help="List all accessible Key Vaults")
18
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)")
19
20
 
20
21
  load_parser = keyvault_subparsers.add_parser("load", help="Load secrets as shell export statements")
21
22
  load_parser.add_argument("--vault", required=True, help="Name of the Azure Key Vault")
@@ -24,7 +25,7 @@ def register(subparsers: argparse._SubParsersAction) -> None:
24
25
  def run(args: argparse.Namespace) -> None:
25
26
  """Execute the specified 'keyvault' command."""
26
27
  if args.keyvault_command == "list":
27
- _list(args.subscription)
28
+ _list(args.subscription, name_filter=args.name)
28
29
  elif args.keyvault_command == "load":
29
30
  _load(args.vault)
30
31
  else:
@@ -32,12 +33,14 @@ def run(args: argparse.Namespace) -> None:
32
33
  sys.exit(1)
33
34
 
34
35
 
35
- def _list(subscription_id: str) -> None:
36
+ def _list(subscription_id: str, name_filter: str | None = None) -> None:
36
37
  """List all accessible Key Vaults in the subscription."""
37
38
  try:
38
39
  credential = DefaultAzureCredential(exclude_environment_credential=True)
39
40
  client = KeyVaultManagementClient(credential=credential, subscription_id=subscription_id)
40
41
  for vault in client.vaults.list_by_subscription():
42
+ if name_filter and name_filter.lower() not in vault.name.lower():
43
+ continue
41
44
  print(vault.name)
42
45
  except Exception as e:
43
46
  logger.exception("Failed to list Key Vaults: %s", e)
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes