1717from scim2_cli .search import search_cli
1818from scim2_cli .test import test_cli
1919from scim2_cli .utils import DOC_URL
20+ from scim2_cli .utils import HeaderType
2021
2122from .utils import split_headers
2223
@@ -40,16 +41,22 @@ def _is_pydantic_model(model: Any) -> TypeGuard[type[BaseModel]]:
4041
4142
4243@click .group (cls = make_rst_to_ansi_formatter (DOC_URL , group = True ))
43- @click .option ("--url" , help = "The SCIM server endpoint." )
44+ @click .option ("--url" , help = "The SCIM server endpoint." , envvar = "SCIM_CLI_URL" )
4445@click .option (
45- "-h" , "--headers" , multiple = True , help = "Header to pass in the HTTP requests."
46+ "-h" ,
47+ "--headers" ,
48+ multiple = True ,
49+ type = HeaderType (),
50+ help = "Header to pass in the HTTP requests." ,
51+ envvar = "SCIM_CLI_HEADERS" ,
4652)
4753@click .pass_context
4854def cli (ctx , url : str , headers : list [str ]):
4955 """SCIM application development CLI."""
5056 ctx .ensure_object (dict )
5157 ctx .obj ["URL" ] = url
52- client = Client (base_url = ctx .obj ["URL" ], headers = split_headers (headers ))
58+ headers_dict = split_headers (headers )
59+ client = Client (base_url = ctx .obj ["URL" ], headers = headers_dict )
5360 ctx .obj ["client" ] = SyncSCIMClient (client , resource_models = (User , Group ))
5461 ctx .obj ["client" ].register_naive_resource_types ()
5562 ctx .obj ["resource_models" ] = {
0 commit comments