Skip to content

Jira: Add support for authentication through access token #856

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Sep 18, 2021

Conversation

piwai
Copy link
Contributor

@piwai piwai commented Sep 13, 2021

Jira Server v8.14 introduces authentication through a Personnal access token, which is different from the existing cloud authentication.
It works through a simple "Authorization: Bearer " header.

This PR add support for this authentication mechanism.
Tested on Jira server v8.14.1

@piwai
Copy link
Contributor Author

piwai commented Sep 13, 2021

@gonchik could you please review when you have a moment? Thanks

@piwai piwai force-pushed the master branch 2 times, most recently from 178818a to b9f1f6f Compare September 14, 2021 19:48
@piwai
Copy link
Contributor Author

piwai commented Sep 14, 2021

I fixed the error during the build of the doc, if someone can please run the workflow again

@piwai
Copy link
Contributor Author

piwai commented Sep 15, 2021

ok, actually there was another error due to the unit tests, fixed as well (one unit test failed because I added the "token" parameter in the middle of the list and the crowd initializer didn't name them when calling rest_client init, so I moved it at the end)
Hopefully should be ok now

@piwai
Copy link
Contributor Author

piwai commented Sep 16, 2021

@gonchik not sure if you need to approve the github workflow again...

@gonchik
Copy link
Member

gonchik commented Sep 18, 2021

@piwai could you try to review via black linter please?

@codecov-commenter
Copy link

Codecov Report

Merging #856 (0076904) into master (694d799) will decrease coverage by 0.00%.
The diff coverage is 25.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #856      +/-   ##
==========================================
- Coverage   36.08%   36.07%   -0.01%     
==========================================
  Files          32       32              
  Lines        6169     6173       +4     
  Branches      894      895       +1     
==========================================
+ Hits         2226     2227       +1     
- Misses       3836     3838       +2     
- Partials      107      108       +1     
Impacted Files Coverage Δ
atlassian/rest_client.py 68.70% <25.00%> (-1.23%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 694d799...0076904. Read the comment docs.

@piwai
Copy link
Contributor Author

piwai commented Sep 18, 2021

@piwai could you try to review via black linter please?

There was a last error after i fixed the unit test, but i fixed it. Now the build is green and the log says:
black run-test-pre: PYTHONHASHSEED='465001394' black run-test: commands[0] | black --check --diff atlassian/ examples/ tests/ All done! ✨ 🍰 ✨ 199 files would be left unchanged.
So i guess it's ok?

@gonchik gonchik merged commit ec8635c into atlassian-api:master Sep 18, 2021
@gonchik
Copy link
Member

gonchik commented Sep 18, 2021

Thanks :)

@piwai
Copy link
Contributor Author

piwai commented Sep 18, 2021

Thanks :)

Thanks to you! One last thing, is it possible to bump version and release on Pypi so I can apply the update without installing from github?

@Gabuardi
Copy link

Hey! First of all, thank you for this PR -- I'm using this package for a Jira Server integration and this made the things a lot easier but I noticed this part of the documentation about the access token is not in the documentation already

@gonchik
Copy link
Member

gonchik commented Sep 23, 2021

@Gabuardi let me double check it please?

jnhyperion added a commit to jnhyperion/atlassian-python-api that referenced this pull request Dec 3, 2021
…ython-api

* 'master' of https://github.com/atlassian-api/atlassian-python-api: (43 commits)
  Fix delete watchers (atlassian-api#889)
  Add function for getting watchers (atlassian-api#890)
  Add functionality to delete a watcher from an issue (atlassian-api#884)
  [Jira] Implement jira.update_version (atlassian-api#878)
  Bitbucket Cloud: Support for pull request tasks (atlassian-api#874)
  [Bitbucket] Fix pagination for cloud requests **FIX BLACK** (atlassian-api#872)
  [Bitbucket] get_users - addition for start and limit (atlassian-api#868)
  Develop (atlassian-api#870)
  Crowd: add additional functions (atlassian-api#865)
  Bump version
  Fix missing data when using pullRequests.each() (atlassian-api#861)
  Added parameters to projects get request (atlassian-api#859)
  Bump version with new parameter of token
  Jira: Add support for authentication through access token (atlassian-api#856)
  change: allow editor=v1 as a parameter of the create_page function (atlassian-api#857)
  Update rest_client.py (atlassian-api#854)
  Bump version of fork method
  Removing redundant double check for simpler code to read (atlassian-api#853)
  Fix up the docs to include the functions definitions for forking repositories (atlassian-api#852)
  [Bitbucket] Adding ability to fork a repo to a different project (atlassian-api#843)
  ...

# Conflicts:
#	atlassian/jira.py
gonchik pushed a commit that referenced this pull request Sep 3, 2022
* Jira: Add support for authentication through access token

* Fix: update black style error
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.

4 participants