Skip to content

Commit

Permalink
Simplify PR, make NoopPluginSubject and introduce IdentityAwarePlugin
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 8f38206 commit 16f4251
Show file tree
Hide file tree
Showing 20 changed files with 179 additions and 477 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,14 @@
import org.apache.shiro.mgt.SecurityManager;
import org.opensearch.common.settings.Settings;
import org.opensearch.identity.Subject;
import org.opensearch.identity.noop.NoopPluginSubject;
import org.opensearch.identity.tokens.TokenManager;
import org.opensearch.plugins.IdentityAwarePlugin;
import org.opensearch.plugins.IdentityPlugin;
import org.opensearch.plugins.Plugin;
import org.opensearch.threadpool.ThreadPool;

import java.util.List;

/**
* Identity implementation with Shiro
Expand Down Expand Up @@ -61,4 +66,14 @@ public Subject getSubject() {
public TokenManager getTokenManager() {
return this.authTokenHandler;
}

@Override
public void initializeIdentityAwarePlugins(List<IdentityAwarePlugin> identityAwarePlugins, ThreadPool threadPool) {
if (identityAwarePlugins != null) {
for (IdentityAwarePlugin plugin : identityAwarePlugins) {
Subject subject = new NoopPluginSubject(threadPool);
plugin.initializePlugin(subject);
}
}
}
}

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

Loading

0 comments on commit 16f4251

Please sign in to comment.