From e67aa5bba6032a70bc0a5674d6da0189a11e7b6c Mon Sep 17 00:00:00 2001 From: Basil Crow Date: Fri, 20 Dec 2024 09:30:24 -0800 Subject: [PATCH] Migrate from Acegi compatibility layer to Spring Security --- .../org/jenkinsci/plugins/workflow/job/WorkflowRun.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/main/java/org/jenkinsci/plugins/workflow/job/WorkflowRun.java b/src/main/java/org/jenkinsci/plugins/workflow/job/WorkflowRun.java index deb05e16..dac494ef 100644 --- a/src/main/java/org/jenkinsci/plugins/workflow/job/WorkflowRun.java +++ b/src/main/java/org/jenkinsci/plugins/workflow/job/WorkflowRun.java @@ -93,7 +93,6 @@ import jenkins.model.queue.AsynchronousExecution; import jenkins.scm.RunWithSCM; import jenkins.util.Timer; -import org.acegisecurity.Authentication; import org.jenkinsci.plugins.workflow.FilePathUtils; import org.jenkinsci.plugins.workflow.actions.TimingAction; import org.jenkinsci.plugins.workflow.flow.BlockableResume; @@ -132,6 +131,7 @@ import org.kohsuke.stapler.WebMethod; import org.kohsuke.stapler.export.Exported; import org.kohsuke.stapler.interceptor.RequirePOST; +import org.springframework.security.core.Authentication; @SuppressWarnings("SynchronizeOnNonFinalField") @SuppressFBWarnings(value={"RC_REF_COMPARISON_BAD_PRACTICE_BOOLEAN"}, @@ -289,10 +289,10 @@ public WorkflowRun(WorkflowJob job, File dir) throws IOException { charset = "UTF-8"; // cannot override getCharset, and various Run methods do not call it anyway BuildListener myListener = getListener(); myListener.started(getCauses()); - Authentication auth = Jenkins.getAuthentication(); - if (!auth.equals(ACL.SYSTEM)) { + Authentication auth = Jenkins.getAuthentication2(); + if (!auth.equals(ACL.SYSTEM2)) { String name = auth.getName(); - if (!auth.equals(Jenkins.ANONYMOUS)) { + if (!auth.equals(Jenkins.ANONYMOUS2)) { User user = User.getById(name, false); if (user != null) { name = ModelHyperlinkNote.encodeTo(user);