Skip to content
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

Migrate from Acegi compatibility layer to Spring Security 6.x #285

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

basil
Copy link
Member

@basil basil commented Jan 17, 2025

This plugin continues to work on 2.479.x LTS, but only through a number of old compatibility layers. This is inefficient, and we cannot keep supporting these compatibility layers forever. This PR migrates away from the compatibility layers to the latest Spring Security 6.x and Jenkins APIs.

Testing done

mvn clean verify

Submitter checklist

  • Make sure you are opening from a topic/feature/bugfix branch (right side) and not your main branch!
  • Ensure that the pull request title represents the desired changelog entry
  • Please describe what you did
  • Link to relevant issues in GitHub or Jira
  • Link to relevant pull requests, esp. upstream and downstream changes
  • Ensure you have provided tests - that demonstrates feature works or fixes the issue

@basil basil added the internal label Jan 17, 2025
@basil basil requested a review from a team as a code owner January 17, 2025 17:50
@basil
Copy link
Member Author

basil commented Jan 17, 2025

@samrocketman Are you interested in testing this on a real Jenkins/GitHub installation?

Comment on lines -39 to -52
@Override
public GrantedAuthority[] getAuthorities() {
if (!hasGrantedAuthorities) {
try {
GHUser user = authenticationToken.loadUser(getUsername());
if(user != null) {
setAuthorities(authenticationToken.getAuthorities());
}
} catch (IOException e) {
throw new RuntimeException(e);
}
}
return super.getAuthorities();
}
Copy link
Member Author

Choose a reason for hiding this comment

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

In Spring Security 6.x, the parent class is immutable, so pushing this logic up to the caller.

@samrocketman
Copy link
Member

@samrocketman Are you interested in testing this on a real Jenkins/GitHub installation?

Sure, there are a few ways I can test this. I’ll report back next week with some testing in AWS and locally on my machine.

@basil
Copy link
Member Author

basil commented Feb 18, 2025

Hi @samrocketman, any luck testing this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants