How do I sign my JWT requests for the REST interface?

First of all, if someone has come here trying to find out how to generate JWT for zephyr api in python, there’s already code for this (though I think it might not be as complete as the Atlassian-jwt code above)

If you’re trying to get the code here How do I sign my JWT requests for the REST interface? - #6 by jhazelwood to work(you probably don’t need to, because of the above link, but anyway).

access_key = <redacted>

secret_key = <redacted>

account_id = <redacted>

# note where base url ends and resource uri begins
base_url = 'https://prod-api.zephyr4jiracloud.com/connect/'

resource_uri = 'public/rest/api/1.0/cycles/search'

# note you will have to get your own versionId and projectId, 
# if you are using the web go to an extant test cycle and examine the urls
query_string = 'expand=executionSummaries&projectId=10026&versionId=10035'

request_url = resource_uri + '?' + query_string

canonical_method = 'GET'

my_url = base_url + request_url

# note this is not included in the above example but things didn't work if I removed it
headers = {'Content-type': 'text/plain',
           'Zapiaccesskey': access_key}

resp = requests.get(my_url, headers=headers, auth=outgoing_authenticator(base_url, secret_key, access_key))
print(resp.text)