From 3d963b72a34517c39683a54a570ef47e29feb8c8 Mon Sep 17 00:00:00 2001 From: Eric Maynard Date: Fri, 21 Mar 2025 10:15:48 -0700 Subject: [PATCH 1/3] fix --- client/python/cli/polaris_cli.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/client/python/cli/polaris_cli.py b/client/python/cli/polaris_cli.py index a19daed81d..f753f821f8 100644 --- a/client/python/cli/polaris_cli.py +++ b/client/python/cli/polaris_cli.py @@ -118,7 +118,7 @@ def _get_client_builder(options): # Validates has_access_token = options.access_token is not None has_client_secret = client_id is not None and client_secret is not None - if has_access_token and has_client_secret: + if options.client_id and options.client_secret: raise Exception(f'Please provide credentials via either {Argument.to_flag_name(Arguments.CLIENT_ID)} &' f' {Argument.to_flag_name(Arguments.CLIENT_SECRET)} or' f' {Argument.to_flag_name(Arguments.ACCESS_TOKEN)}, but not both') From 09eba43d967d60cde776586e447d41fe410af400 Mon Sep 17 00:00:00 2001 From: Eric Maynard Date: Fri, 21 Mar 2025 10:20:51 -0700 Subject: [PATCH 2/3] adjust --- client/python/cli/polaris_cli.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/client/python/cli/polaris_cli.py b/client/python/cli/polaris_cli.py index f753f821f8..2739c302e3 100644 --- a/client/python/cli/polaris_cli.py +++ b/client/python/cli/polaris_cli.py @@ -118,7 +118,7 @@ def _get_client_builder(options): # Validates has_access_token = options.access_token is not None has_client_secret = client_id is not None and client_secret is not None - if options.client_id and options.client_secret: + if has_access_token and (options.client_id or options.client_secret): raise Exception(f'Please provide credentials via either {Argument.to_flag_name(Arguments.CLIENT_ID)} &' f' {Argument.to_flag_name(Arguments.CLIENT_SECRET)} or' f' {Argument.to_flag_name(Arguments.ACCESS_TOKEN)}, but not both') @@ -128,7 +128,6 @@ def _get_client_builder(options): f' {Argument.to_flag_name(Arguments.ACCESS_TOKEN)}.' f' Alternatively, you may set the environment variables {CLIENT_ID_ENV} &' f' {CLIENT_SECRET_ENV}.') - # Authenticate accordingly if options.base_url: if options.host is not None or options.port is not None: raise Exception(f'Please provide either {Argument.to_flag_name(Arguments.BASE_URL)} or' From 48a3e74a34e74ee001bbf4e0cdb4e1261534d980 Mon Sep 17 00:00:00 2001 From: Eric Maynard Date: Fri, 21 Mar 2025 10:21:12 -0700 Subject: [PATCH 3/3] revert --- client/python/cli/polaris_cli.py | 1 + 1 file changed, 1 insertion(+) diff --git a/client/python/cli/polaris_cli.py b/client/python/cli/polaris_cli.py index 2739c302e3..b4d1fd8e41 100644 --- a/client/python/cli/polaris_cli.py +++ b/client/python/cli/polaris_cli.py @@ -128,6 +128,7 @@ def _get_client_builder(options): f' {Argument.to_flag_name(Arguments.ACCESS_TOKEN)}.' f' Alternatively, you may set the environment variables {CLIENT_ID_ENV} &' f' {CLIENT_SECRET_ENV}.') + # Authenticate accordingly if options.base_url: if options.host is not None or options.port is not None: raise Exception(f'Please provide either {Argument.to_flag_name(Arguments.BASE_URL)} or'