m-khvoinitsky / workflow-templater

Template engine for (currently) Jira and Email. Uses yaml and jinja2. It helps you create multiple (possibly cross-liked) jira issues and emails from a template.
MIT License
6 stars 3 forks source link

Added check for Jira Cloud URL & changed auth header to Basic #5

Closed benzo-elastic closed 1 year ago

benzo-elastic commented 1 year ago

Attempting to use this for Jira Cloud I noticed that the Bearer token header wasn't working & looking further it looks like only using the Basic header of the user/api token in base64 would do what was needed

https://developer.atlassian.com/cloud/jira/platform/basic-auth-for-rest-apis/

I'm unable to test this against a non Cloud install with the Bearer token, but the changes I've made here should fall through. Not sure if there is a better way to check for Jira cloud than the domain suffix, but it works & was quick :)

m-khvoinitsky commented 1 year ago

While it may work differently for access tokens, I never used regular basic authentication (base64'd username:password) because in case of our corporate Jira instance each request was EXTREMELY slow probably because Jira have to go to LDAP server for each request. Just wanted to tell you to double check if that's not the case for access tokens.