AtlassianPS / JiraPS

PowerShell module to interact with Atlassian JIRA
https://AtlassianPS.org/module/JiraPS
MIT License
321 stars 131 forks source link

Improve `New-JiraSession`/`Invoke-JiraMethod` behavior with PATs #507

Open hmmwhatsthisdo opened 3 months ago

hmmwhatsthisdo commented 3 months ago

Context

Jira API authentication appears to be largely PAT-based now (both for cloud and on-prem instances).

The current state of New-JiraSession and Invoke-JiraMethod support PATs via -Headers or -Credential, but:

Supporting bearer token auth natively would provide a more consistent experience.

Description

Improving PAT handling could look something like the following:

Additional Information

The one risk here is that Get-JiraSession now leaks the token we used to authenticate with in plain text. A couple of possible mitigations exist for this: