File tree Expand file tree Collapse file tree 2 files changed +10
-1
lines changed Expand file tree Collapse file tree 2 files changed +10
-1
lines changed Original file line number Diff line number Diff line change 4747from git import Repo # pip install GitPython
4848from github import Github # pip install PyGithub
4949from jira import JIRA # pip install jira
50+ import oauthlib .oauth1
5051
5152if sys .version_info < (3 , 0 , 0 ):
5253 raise RuntimeError ("This script requires Python 3 or higher" )
@@ -425,6 +426,11 @@ def read_jira_oauth_creds(jira_creds_file):
425426 oauth_dict ['consumer_key' ] = creds_match .group (3 )
426427 # Fix the double-backslash created by the decode() call above
427428 oauth_dict ['key_cert' ] = creds_match .group (4 ).replace ("\\ n" , "\n " )
429+ # Use signature algorithm `SIGNATURE_RSA` to override `jira` default of `SIGNATURE_HMAC_SHA1`.
430+ # `jira` 3.5.1 changed the default signature algorithm to `SIGNATURE_HMAC_SHA1`.
431+ # MongoDB Jira servers do not appear to support `SIGNATURE_HMAC_SHA1`. Using `SIGNATURE_HMAC_SHA1` results in `signature_method_rejected`` error.
432+ # See https://github.com/pycontribs/jira/pull/1664
433+ oauth_dict ["signature_method" ] = oauthlib .oauth1 .SIGNATURE_RSA
428434
429435 return oauth_dict
430436
Original file line number Diff line number Diff line change 22Click
33GitPython
44PyGithub
5- jira
5+ # Pin `jira` to apply fix of https://github.com/pycontribs/jira/commit/010223289eb66663aaafb70447397038efb2d40d.
6+ # This avoids the `signature_method_rejected` error described in https://github.com/pycontribs/jira/pull/1643.
7+ # TODO: replace the following line with `jira` once there is a release of `jira` containing the fix.
8+ git+https://github.com/pycontribs/jira.git@010223289eb66663aaafb70447397038efb2d40d
69cryptography
You can’t perform that action at this time.
0 commit comments