1515from platform_api_python_client import UserVaultType
1616
1717
18- def get_vault_items (
19- vault_type : Optional [UserVaultType ] = None ,
20- search_query : Optional [str ] = None ,
21- ):
18+ def get_vault_items (vault_type : Optional [UserVaultType ] = None , search_query : Optional [str ] = None ):
2219 """Retrieve items from user's vault."""
2320 with get_centml_client () as client :
2421 response = client ._api .get_all_user_vault_items_endpoint_user_vault_get (
25- type = vault_type ,
26- search_query = search_query ,
22+ type = vault_type , search_query = search_query
2723 )
2824 return response .results
2925
@@ -65,18 +61,8 @@ def display_vault_items(items, show_values: bool = False):
6561 type = click .Choice ([t .value for t in UserVaultType ], case_sensitive = False ),
6662 help = "Filter by vault type (env_vars, ssh_keys, bearer_tokens, access_tokens, certificates)" ,
6763)
68- @click .option (
69- "--search" ,
70- "search_query" ,
71- type = str ,
72- help = "Search query to filter items by key" ,
73- )
74- @click .option (
75- "--show-values" ,
76- is_flag = True ,
77- default = False ,
78- help = "Show vault item values" ,
79- )
64+ @click .option ("--search" , "search_query" , type = str , help = "Search query to filter items by key" )
65+ @click .option ("--show-values" , is_flag = True , default = False , help = "Show vault item values" )
8066def main (vault_type : Optional [str ], search_query : Optional [str ], show_values : bool ):
8167 """Retrieve all items from user's vault (secrets).
8268
@@ -99,10 +85,7 @@ def main(vault_type: Optional[str], search_query: Optional[str], show_values: bo
9985 """
10086 type_enum = UserVaultType (vault_type ) if vault_type else None
10187
102- items = get_vault_items (
103- vault_type = type_enum ,
104- search_query = search_query ,
105- )
88+ items = get_vault_items (vault_type = type_enum , search_query = search_query )
10689
10790 display_vault_items (items , show_values = show_values )
10891
0 commit comments