Skip to content

Commit bbb6ce4

Browse files
authored
Merge pull request #200 from basil/acegi
Migrate from Acegi to Spring Security
2 parents 603d058 + b9d36a0 commit bbb6ce4

File tree

3 files changed

+9
-9
lines changed

3 files changed

+9
-9
lines changed

src/main/java/org/jenkinsci/plugins/workflow/steps/AbstractSynchronousNonBlockingStepExecution.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
import edu.umd.cs.findbugs.annotations.NonNull;
77
import jenkins.model.Jenkins;
88
import jenkins.security.NotReallyRoleSensitiveCallable;
9-
import org.acegisecurity.Authentication;
9+
import org.springframework.security.core.Authentication;
1010

1111
/**
1212
* Similar to {@link AbstractSynchronousStepExecution} (it executes synchronously too) but it does not block the CPS VM thread.
@@ -36,12 +36,12 @@ protected AbstractSynchronousNonBlockingStepExecution(StepContext context) {
3636

3737
@Override
3838
public final boolean start() throws Exception {
39-
final Authentication auth = Jenkins.getAuthentication();
39+
final Authentication auth = Jenkins.getAuthentication2();
4040
task = SynchronousNonBlockingStepExecution.getExecutorService().submit(new Runnable() {
4141
@SuppressFBWarnings(value="SE_BAD_FIELD", justification="not serializing anything here")
4242
@Override public void run() {
4343
try {
44-
getContext().onSuccess(ACL.impersonate(auth, new NotReallyRoleSensitiveCallable<T, Exception>() {
44+
getContext().onSuccess(ACL.impersonate2(auth, new NotReallyRoleSensitiveCallable<T, Exception>() {
4545
@Override public T call() throws Exception {
4646
threadName = Thread.currentThread().getName();
4747
return AbstractSynchronousNonBlockingStepExecution.this.run();

src/main/java/org/jenkinsci/plugins/workflow/steps/GeneralNonBlockingStepExecution.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
import java.util.concurrent.Future;
3131
import edu.umd.cs.findbugs.annotations.NonNull;
3232
import jenkins.model.Jenkins;
33-
import org.acegisecurity.Authentication;
33+
import org.springframework.security.core.Authentication;
3434

3535
/**
3636
* Generalization of {@link SynchronousNonBlockingStepExecution} that can be used for {@linkplain StepDescriptor#takesImplicitBlockArgument block-scoped steps}.
@@ -69,11 +69,11 @@ protected final void run(Block block) {
6969
if (stopCause != null) {
7070
return;
7171
}
72-
final Authentication auth = Jenkins.getAuthentication();
72+
final Authentication auth = Jenkins.getAuthentication2();
7373
task = SynchronousNonBlockingStepExecution.getExecutorService().submit(() -> {
7474
threadName = Thread.currentThread().getName();
7575
try {
76-
try (ACLContext acl = ACL.as(auth)) {
76+
try (ACLContext acl = ACL.as2(auth)) {
7777
block.run();
7878
}
7979
} catch (Throwable x) {

src/main/java/org/jenkinsci/plugins/workflow/steps/SynchronousNonBlockingStepExecution.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
import java.util.concurrent.Future;
1111
import edu.umd.cs.findbugs.annotations.NonNull;
1212
import jenkins.model.Jenkins;
13-
import org.acegisecurity.Authentication;
13+
import org.springframework.security.core.Authentication;
1414

1515
/**
1616
* Similar to {@link SynchronousStepExecution} (it executes synchronously too) but it does not block the CPS VM thread.
@@ -38,12 +38,12 @@ protected SynchronousNonBlockingStepExecution(@NonNull StepContext context) {
3838

3939
@Override
4040
public final boolean start() throws Exception {
41-
final Authentication auth = Jenkins.getAuthentication();
41+
final Authentication auth = Jenkins.getAuthentication2();
4242
task = getExecutorService().submit(() -> {
4343
threadName = Thread.currentThread().getName();
4444
try {
4545
T ret;
46-
try (ACLContext acl = ACL.as(auth)) {
46+
try (ACLContext acl = ACL.as2(auth)) {
4747
ret = run();
4848
}
4949
getContext().onSuccess(ret);

0 commit comments

Comments
 (0)