/* * Copyright OpenSearch Contributors * SPDX-License-Identifier: Apache-2.0 */ package org.opensearch.dataprepper.plugins; import org.opensearch.dataprepper.armeria.authentication.GrpcAuthenticationProvider; import org.opensearch.dataprepper.model.annotations.DataPrepperPlugin; import io.grpc.Metadata; import io.grpc.ServerCall; import io.grpc.ServerCallHandler; import io.grpc.ServerInterceptor; /** * The plugin to use for unauthenticated access to Armeria servers. It * disables authentication on endpoints. * * @since 1.2 */ @DataPrepperPlugin(name = GrpcAuthenticationProvider.UNAUTHENTICATED_PLUGIN_NAME, pluginType = GrpcAuthenticationProvider.class) public class UnauthenticatedGrpcAuthenticationProvider implements GrpcAuthenticationProvider { @Override public ServerInterceptor getAuthenticationInterceptor() { return new ServerInterceptor() { @Override public ServerCall.Listener interceptCall(ServerCall call, Metadata headers, ServerCallHandler next) { return next.startCall(call, headers); } }; } }