Skip to content

Load Jira token from flag or environment - #420

Open
SebTardif wants to merge 1 commit into
xlab-uiuc:mainfrom
SebTardif:fix/remove-hardcoded-jira-token
Open

SebTardif wants to merge 1 commit into
xlab-uiuc:mainfrom
SebTardif:fix/remove-hardcoded-jira-token

Conversation

@SebTardif

Copy link
Copy Markdown

Load the Jira API token from --jira-token or JIRA_TOKEN instead of a hardcoded value.

Problem

scripts/process_bugs_info.py is a research helper that talks to Percona Jira. It constructed JIRA(..., token_auth=...) with a token baked into the source. Anyone with a clone of this repo can read that value from current main and from git history.

Private vulnerability reporting is not enabled on this repository, so this change is a public cleanup. Please rotate the old Jira token even if the script is unused.

Change

  • Resolve the token from --jira-token or the JIRA_TOKEN environment variable.
  • Exit with a clear error if neither is set.
  • Move PyGithub and jira imports under if __name__ == "__main__" so the helper can be imported in tests.

The token value is not repeated here.

Validation

pytest acto/utils/test_process_bugs_info.py

  • Fails on unfixed source (token_auth='...' still present).
  • Passes after the change: no quoted token_auth literal; CLI wins over env; missing token raises SystemExit.

Origin

The hardcoded token_auth has been in bdaf5662 (2023-02-03, Tyler Gu) and later commits.

scripts/process_bugs_info.py no longer embeds a Jira API token.
Pass --jira-token or set JIRA_TOKEN.

Signed-off-by: Sebastien Tardif <sebtardif@ncf.ca>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant