Remove some unnecessary code

This commit is contained in:
Dave Syer
2025-02-25 18:02:55 +00:00
parent 6853d2dad4
commit babe00025d
3 changed files with 0 additions and 8 deletions

View File

@@ -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 {

View File

@@ -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;

View File

@@ -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 {