Skip to content

[JENKINS-48412] Fix authorities retrieval for API Token #92

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

Conversation

Wadeck
Copy link
Contributor

@Wadeck Wadeck commented Dec 6, 2017

  • revealed by #87
  • to reproduce you need to follow the guideline provided by @samrocketman in mentioned PR.
  • does not seem to be a bug impacting user before the PR since some parts of code were not usable (team instead of team.getName())

See JENKINS-48412.

  • JIRA issue is well described
  • Changelog entry appropriate for the audience affected by the change (users or developer, depending on the change). Examples
    * Use the Internal: prefix if the change has no user-visible impact (API, test frameworks, etc.)

@reviewbybees but WIP until merge

@Wadeck Wadeck changed the title [JENKINS-48412] Fix authorities retrieval for API Token [WAITING #87 MERGE] [JENKINS-48412] Fix authorities retrieval for API Token Dec 6, 2017
@samrocketman samrocketman force-pushed the SPEED_UP_API_TOKEN_AUTHORITIES branch from 8c6fdce to 99e3d13 Compare December 7, 2017 05:01
@samrocketman samrocketman changed the title [WAITING #87 MERGE] [JENKINS-48412] Fix authorities retrieval for API Token [JENKINS-48412] Fix authorities retrieval for API Token Dec 7, 2017
@samrocketman
Copy link
Member

I took the liberty of rebasing your change and resolved merge conflicts (there were not real conflicts so I'm not sure why git called it out as such).

Copy link
Member

@samrocketman samrocketman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Summary

Overall, your recommended change here is a huge performance improvement for the github-oauth plugin. You also resolve the issue you set out to solve. I added an extra irrelevant test, it does not block merging this.

Test summary

  • ✅ User pages load faster [SUCCESS]
  • ✅ Jenkins CLI returns authorities via Jenkins API token [SUCCESS]
  • ✅ Call REST API using Jenkins API token [SUCCESS]
  • ❌ Jenkins CLI returns authorities via SSH auth [FAILED] (non-blocking test just for fun)

User pages load faster [SUCCESS]

User pages load really fast now! This is a huge improvement.

http://localhost:8080/user/samrocketman/ used to take a whole minute for me to wait around until the page loaded. Your change does a great job improving the performance on this page specifically.

Jenkins CLI returns authorities via Jenkins API token [SUCCESS]

Jenkins CLI with Jenkins API token was successfully tested.

java -jar jenkins-cli.jar -s http://localhost:8080/ -http -auth samrocketman:2f94a910ad75c684b27885e8e5d7f2c1 -noKeyAuth who-am-i

Call REST API using Jenkins API token [SUCCESS]

The following two API calls succeeded. Both were restricted by GitHub organizations and not directly specifying the user in the project-based matrix authorization strategy.

curl --user samrocketman:2f94a910ad75c684b27885e8e5d7f2c1 http://localhost:8080/user/samrocketman/api/json?pretty=true

curl --user samrocketman:2f94a910ad75c684b27885e8e5d7f2c1 http://localhost:8080/job/test/job/test2/api/json?pretty=true

Jenkins CLI returns authorities via SSH auth [FAILED]

This bug is tracked by JENKINS-48423.

Jenkins CLI with SSH private key was not successfully tested. That doesn't block merging this. It just surfaces a new issue. I filed this new issue under

java -jar jenkins-cli.jar -s http://localhost:8080/ -ssh -user samrocketman who-am-i

@samrocketman samrocketman merged commit 393ada3 into jenkinsci:master Dec 7, 2017
@samrocketman
Copy link
Member

This change also fixes JENKINS-42421.

@Wadeck
Copy link
Contributor Author

Wadeck commented Dec 7, 2017

Thank you @samrocketman, I put as resolved also the JENKINS-48412.

@Wadeck Wadeck deleted the SPEED_UP_API_TOKEN_AUTHORITIES branch December 7, 2017 08:12
@Wadeck
Copy link
Contributor Author

Wadeck commented Dec 7, 2017

@samrocketman to be completely accurate, it's the #87 that solve the JENKINS-42421 ;-)

Thank you a lot for the amount of time you spend on open-source project like this one 👍

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.

2 participants