Skip to content

Commit ec8d56c

Browse files
committed
fixup!
1 parent 3436f63 commit ec8d56c

File tree

2 files changed

+7
-21
lines changed

2 files changed

+7
-21
lines changed

x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/authc/service/ServiceAccountTokenStore.java

Lines changed: 6 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -21,42 +21,28 @@ public interface ServiceAccountTokenStore {
2121
void authenticate(ServiceAccountToken token, ActionListener<StoreAuthenticationResult> listener);
2222

2323
class StoreAuthenticationResult {
24-
public enum Status {
25-
SUCCESS,
26-
CONTINUE,
27-
TERMINATE
28-
}
29-
30-
private final Status status;
3124
private final TokenSource tokenSource;
25+
private final boolean success;
3226

33-
private StoreAuthenticationResult(TokenSource tokenSource, Status status) {
34-
this.status = status;
27+
private StoreAuthenticationResult(TokenSource tokenSource, boolean success) {
3528
this.tokenSource = tokenSource;
29+
this.success = success;
3630
}
3731

3832
public static StoreAuthenticationResult successful(TokenSource tokenSource) {
39-
return new StoreAuthenticationResult(tokenSource, Status.SUCCESS);
40-
}
41-
42-
public static StoreAuthenticationResult terminate(TokenSource tokenSource) {
43-
return new StoreAuthenticationResult(tokenSource, Status.TERMINATE);
33+
return new StoreAuthenticationResult(tokenSource, true);
4434
}
4535

4636
public static StoreAuthenticationResult failed(TokenSource tokenSource) {
47-
return new StoreAuthenticationResult(tokenSource, Status.CONTINUE);
37+
return new StoreAuthenticationResult(tokenSource, false);
4838
}
4939

5040
public static StoreAuthenticationResult fromBooleanResult(TokenSource tokenSource, boolean result) {
5141
return result ? successful(tokenSource) : failed(tokenSource);
5242
}
5343

5444
public boolean isSuccess() {
55-
return status == Status.SUCCESS;
56-
}
57-
58-
public Status getStatus() {
59-
return status;
45+
return success;
6046
}
6147

6248
public TokenSource getTokenSource() {

x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/authc/service/CompositeServiceAccountTokenStore.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ public void authenticate(ServiceAccountToken token, ActionListener<StoreAuthenti
4040
stores,
4141
threadContext,
4242
Function.identity(),
43-
storeAuthenticationResult -> storeAuthenticationResult.getStatus() == StoreAuthenticationResult.Status.CONTINUE
43+
storeAuthenticationResult -> storeAuthenticationResult.isSuccess() == false
4444
);
4545
try {
4646
authenticatingListener.run();

0 commit comments

Comments
 (0)