You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by GitBox <gi...@apache.org> on 2022/06/02 01:45:24 UTC
[GitHub] [arrow] kou commented on a diff in pull request #13283: ARROW-16708: [Dev] Replace basic auth with token auth for JIRA
kou commented on code in PR #13283:
URL: https://github.com/apache/arrow/pull/13283#discussion_r887428273
##########
dev/merge_arrow_pr.py:
##########
@@ -492,37 +491,30 @@ def load_configuration():
def get_credentials(cmd):
- username, password = None, None
+ token = None
config = load_configuration()
if "jira" in config.sections():
- username = config["jira"].get("username")
- password = config["jira"].get("password")
+ token = config["jira"].get("token")
# Fallback to environment variables
- if not username:
- username = os.environ.get("APACHE_JIRA_USERNAME")
-
- if not password:
- password = os.environ.get("APACHE_JIRA_PASSWORD")
+ if not token:
+ token = os.environ.get("APACHE_JIRA_TOKEN")
# Fallback to user tty prompt
- if not username:
- username = cmd.prompt("Env APACHE_JIRA_USERNAME not set, "
- "please enter your JIRA username:")
-
- if not password:
- password = cmd.getpass("Env APACHE_JIRA_PASSWORD not set, "
- "please enter your JIRA password:")
+ if not token:
+ token = cmd.prompt("Env APACHE_JIRA_TOKEN not set, "
+ "please enter your JIRA PAT:")
- return (username, password)
+ return token
def connect_jira(cmd):
try:
return jira.client.JIRA(options={'server': JIRA_API_BASE},
- basic_auth=get_credentials(cmd))
+ token_auth=get_credentials(cmd))
except jira.exceptions.JIRAError as e:
+ # token auth should not cause a captcha
Review Comment:
Could you remove the `except`?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org