-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add authenticate to IdentityPlugin interface
Signed-off-by: Craig Perkins <cwperx@amazon.com>
- Loading branch information
Showing
25 changed files
with
355 additions
and
164 deletions.
There are no files selected for viewing
80 changes: 80 additions & 0 deletions
80
...ins/identity-shiro/src/main/java/org/opensearch/identity/shiro/DelegatingRestHandler.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,80 @@ | ||
/* | ||
* SPDX-License-Identifier: Apache-2.0 | ||
* | ||
* The OpenSearch Contributors require contributions made to | ||
* this file be licensed under the Apache-2.0 license or a | ||
* compatible open source license. | ||
*/ | ||
|
||
package org.opensearch.identity.shiro; | ||
|
||
import org.opensearch.client.node.NodeClient; | ||
import org.opensearch.rest.RestChannel; | ||
import org.opensearch.rest.RestHandler; | ||
import org.opensearch.rest.RestRequest; | ||
|
||
import java.util.List; | ||
import java.util.Objects; | ||
|
||
/** | ||
* Delegating RestHandler that delegates all implementations to original handler | ||
*/ | ||
public class DelegatingRestHandler implements RestHandler { | ||
|
||
protected final RestHandler delegate; | ||
|
||
public DelegatingRestHandler(RestHandler delegate) { | ||
Objects.requireNonNull(delegate, "RestHandler delegate can not be null"); | ||
this.delegate = delegate; | ||
} | ||
|
||
@Override | ||
public void handleRequest(RestRequest request, RestChannel channel, NodeClient client) throws Exception { | ||
delegate.handleRequest(request, channel, client); | ||
} | ||
|
||
@Override | ||
public boolean canTripCircuitBreaker() { | ||
return delegate.canTripCircuitBreaker(); | ||
} | ||
|
||
@Override | ||
public boolean supportsContentStream() { | ||
return delegate.supportsContentStream(); | ||
} | ||
|
||
@Override | ||
public boolean allowsUnsafeBuffers() { | ||
return delegate.allowsUnsafeBuffers(); | ||
} | ||
|
||
@Override | ||
public List<Route> routes() { | ||
return delegate.routes(); | ||
} | ||
|
||
@Override | ||
public List<DeprecatedRoute> deprecatedRoutes() { | ||
return delegate.deprecatedRoutes(); | ||
} | ||
|
||
@Override | ||
public List<ReplacedRoute> replacedRoutes() { | ||
return delegate.replacedRoutes(); | ||
} | ||
|
||
@Override | ||
public boolean allowSystemIndexAccessByDefault() { | ||
return delegate.allowSystemIndexAccessByDefault(); | ||
} | ||
|
||
@Override | ||
public String toString() { | ||
return delegate.toString(); | ||
} | ||
|
||
@Override | ||
public boolean supportsStreaming() { | ||
return delegate.supportsStreaming(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.