Remove some unnecessary code
This commit is contained in:
@@ -10,12 +10,10 @@ import org.springframework.grpc.server.GlobalServerInterceptor;
|
||||
import org.springframework.grpc.server.security.AuthenticationProcessInterceptor;
|
||||
import org.springframework.grpc.server.security.GrpcSecurity;
|
||||
import org.springframework.security.config.annotation.authentication.configuration.AuthenticationConfiguration;
|
||||
import org.springframework.security.config.annotation.method.configuration.EnableMethodSecurity;
|
||||
|
||||
import io.grpc.Metadata;
|
||||
|
||||
@SpringBootApplication
|
||||
@EnableMethodSecurity
|
||||
@Import(AuthenticationConfiguration.class)
|
||||
public class GrpcServerApplication {
|
||||
|
||||
|
||||
@@ -15,7 +15,6 @@ public class GrpcServerService extends SimpleGrpc.SimpleImplBase {
|
||||
private static Log log = LogFactory.getLog(GrpcServerService.class);
|
||||
|
||||
@Override
|
||||
// @PreAuthorize("hasAuthority('ROLE_USER')")
|
||||
public void sayHello(HelloRequest req, StreamObserver<HelloReply> responseObserver) {
|
||||
log.info("Hello " + req.getName());
|
||||
if (req.getName().startsWith("error")) {
|
||||
@@ -27,7 +26,6 @@ public class GrpcServerService extends SimpleGrpc.SimpleImplBase {
|
||||
}
|
||||
|
||||
@Override
|
||||
// @PreAuthorize("hasAuthority('ROLE_ADMIN')")
|
||||
public void streamHello(HelloRequest req, StreamObserver<HelloReply> responseObserver) {
|
||||
log.info("Hello " + req.getName());
|
||||
int count = 0;
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
package org.springframework.grpc.sample;
|
||||
|
||||
import java.util.Arrays;
|
||||
|
||||
import org.apache.coyote.UpgradeProtocol;
|
||||
import org.apache.coyote.http2.Http2Protocol;
|
||||
import org.springframework.boot.SpringApplication;
|
||||
@@ -9,8 +7,6 @@ import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||
import org.springframework.boot.web.embedded.tomcat.TomcatConnectorCustomizer;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
|
||||
import io.netty.handler.ssl.ApplicationProtocolConfig.Protocol;
|
||||
|
||||
@SpringBootApplication
|
||||
public class GrpcServerApplication {
|
||||
|
||||
|
||||
Reference in New Issue
Block a user