From ada2ec3b587858dad40c159b9fb355b230447aac Mon Sep 17 00:00:00 2001 From: danimtb Date: Wed, 17 Jan 2024 11:55:17 +0100 Subject: [PATCH] do not allow token and password --- extensions/commands/art/cmd_server.py | 3 +++ extensions/commands/art/utils.py | 2 ++ 2 files changed, 5 insertions(+) diff --git a/extensions/commands/art/cmd_server.py b/extensions/commands/art/cmd_server.py index ba50011..2357a58 100644 --- a/extensions/commands/art/cmd_server.py +++ b/extensions/commands/art/cmd_server.py @@ -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: diff --git a/extensions/commands/art/utils.py b/extensions/commands/art/utils.py index c820685..62c37fc 100644 --- a/extensions/commands/art/utils.py +++ b/extensions/commands/art/utils.py @@ -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))