Skip to content

Commit

Permalink
Remove AbstractSubject
Browse files Browse the repository at this point in the history
Signed-off-by: Craig Perkins <[email protected]>
  • Loading branch information
cwperks committed Aug 16, 2024
1 parent 0a26f26 commit 94a5f2c
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 30 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@

package org.opensearch.identity.shiro;

import org.opensearch.identity.AbstractSubject;
import org.opensearch.identity.Subject;
import org.opensearch.identity.tokens.AuthToken;

Expand All @@ -20,7 +19,7 @@
*
* @opensearch.experimental
*/
public class ShiroSubject extends AbstractSubject {
public class ShiroSubject implements Subject {
private final ShiroTokenManager authTokenHandler;
private final org.apache.shiro.subject.Subject shiroSubject;

Expand Down
23 changes: 0 additions & 23 deletions server/src/main/java/org/opensearch/identity/AbstractSubject.java

This file was deleted.

4 changes: 3 additions & 1 deletion server/src/main/java/org/opensearch/identity/Subject.java
Original file line number Diff line number Diff line change
Expand Up @@ -34,5 +34,7 @@ public interface Subject {
/**
* runAs allows the caller to run a callable function as this subject
*/
void runAs(Callable<Void> callable) throws Exception;
default void runAs(Callable<Void> callable) throws Exception {
callable.call();
};
}
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,15 @@
package org.opensearch.identity.noop;

import org.opensearch.common.util.concurrent.ThreadContext;
import org.opensearch.identity.AbstractSubject;
import org.opensearch.identity.NamedPrincipal;
import org.opensearch.identity.Subject;
import org.opensearch.identity.tokens.AuthToken;
import org.opensearch.threadpool.ThreadPool;

import java.security.Principal;
import java.util.concurrent.Callable;

public class NoopPluginSubject extends AbstractSubject {
public class NoopPluginSubject implements Subject {
private final ThreadPool threadPool;

public NoopPluginSubject(ThreadPool threadPool) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@

package org.opensearch.identity.noop;

import org.opensearch.identity.AbstractSubject;
import org.opensearch.identity.NamedPrincipal;
import org.opensearch.identity.Subject;
import org.opensearch.identity.tokens.AuthToken;
Expand All @@ -23,7 +22,7 @@
*
* @opensearch.internal
*/
public class NoopSubject extends AbstractSubject {
public class NoopSubject implements Subject {

public NoopSubject() {
super();
Expand Down

0 comments on commit 94a5f2c

Please sign in to comment.