Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion client/python/cli/polaris_cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 has_access_token and (options.client_id or options.client_secret):
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not a blocker: i'm OK even both are configured. We could let it takes token first, if not found, then try to find client id and secrets. Only failed when neither is available.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think that the tool should magically prefer the access-token even if client-id/secret are explicitly specified. That's clearly an ambiguity.
The logic here is fine.

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')
Expand Down