File tree Expand file tree Collapse file tree 3 files changed +2
-6
lines changed
main/java/org/springframework/grpc/sample
test/java/org/springframework/grpc/sample Expand file tree Collapse file tree 3 files changed +2
-6
lines changed Original file line number Diff line number Diff line change 77import org .springframework .context .annotation .Bean ;
88import org .springframework .grpc .server .GlobalServerInterceptor ;
99import org .springframework .grpc .server .security .GrpcSecurity ;
10- import org .springframework .security .config .annotation .authentication .configuration .EnableGlobalAuthentication ;
1110import org .springframework .security .core .userdetails .User ;
1211import org .springframework .security .provisioning .InMemoryUserDetailsManager ;
1312
1413import io .grpc .Metadata ;
1514import io .grpc .ServerInterceptor ;
1615
1716@ SpringBootApplication
18- @ EnableGlobalAuthentication
1917class GrpcServerApplication {
2018
2119 public static final Metadata .Key <String > USER_KEY = Metadata .Key .of ("X-USER" , Metadata .ASCII_STRING_MARSHALLER );
Original file line number Diff line number Diff line change 77import java .util .concurrent .atomic .AtomicReference ;
88
99import org .awaitility .Awaitility ;
10- import org .junit .jupiter .api .Disabled ;
1110import org .junit .jupiter .api .Test ;
1211import org .springframework .beans .factory .annotation .Autowired ;
1312import org .springframework .beans .factory .annotation .Qualifier ;
@@ -55,10 +54,9 @@ void contextLoads() {
5554 }
5655
5756 @ Test
58- @ Disabled ("Code is coming back PERMISSION_DENIED NOT UNAUTHENTICATED" )
5957 void unauthenticated () {
6058 assertThatExceptionOfType (StatusRuntimeException .class )
61- .isThrownBy (() -> basic . streamHello (HelloRequest .newBuilder ().setName ("Alien" ).build ()). next ( ))
59+ .isThrownBy (() -> stub . sayHello (HelloRequest .newBuilder ().setName ("Alien" ).build ()))
6260 .extracting ("status.code" )
6361 .isEqualTo (Code .UNAUTHENTICATED );
6462 }
Original file line number Diff line number Diff line change 2121 <module >grpc-reactive</module >
2222 <module >grpc-secure</module >
2323 <module >grpc-server</module >
24- <!-- <module>grpc-server-kotlin</module> -- >
24+ <module >grpc-server-kotlin</module >
2525 <module >grpc-server-netty-shaded</module >
2626 <module >grpc-tomcat</module >
2727<!-- <module>grpc-tomcat-secure</module>-->
You can’t perform that action at this time.
0 commit comments