Skip to content

Commit

Permalink
do not allow token and password
Browse files Browse the repository at this point in the history
  • Loading branch information
danimtb committed Jan 17, 2024
1 parent be160e9 commit ada2ec3
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
3 changes: 3 additions & 0 deletions extensions/commands/art/cmd_server.py
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,9 @@ def server_add(conan_api: ConanAPI, parser, subparser, *args):

args = parser.parse_args(*args)

if args.password and args.token:
raise ConanException("--password and --token arguments cannot be used at the same time. Please specify either --password OR --token.")

token = None

if not args.user:
Expand Down
2 changes: 2 additions & 0 deletions extensions/commands/art/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -98,4 +98,6 @@ def assert_server_or_url_user_password(args):
if args.url:
if not (args.user and (args.password or args.token)):
raise ConanException("Specify --user and --password/--token to use with the --url flag to contact Artifactory.")
if args.password and args.token:
raise ConanException("--password and --token arguments cannot be used at the same time. Please specify either --password OR --token.")
assert args.server or (args.url and args.user and (args.password or args.token))

0 comments on commit ada2ec3

Please sign in to comment.