Skip to content

Commit 89471dd

Browse files
committed
Improve javadocs with references to spring-security-web references
1 parent d616e98 commit 89471dd

File tree

3 files changed

+13
-2
lines changed

3 files changed

+13
-2
lines changed

grpc-server-spring-boot-autoconfigure/src/main/java/net/devh/boot/grpc/server/security/authentication/GrpcAuthenticationReader.java

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,12 +26,17 @@
2626

2727
import io.grpc.Metadata;
2828
import io.grpc.ServerCall;
29+
import io.grpc.Status;
2930

3031
/**
3132
* Reads the authentication data from the given {@link ServerCall} and {@link Metadata}. The returned
3233
* {@link Authentication} is not yet validated and needs to be passed to an {@link AuthenticationManager}.
3334
*
3435
* <p>
36+
* This is similar to the {@code org.springframework.security.web.authentication.AuthenticationConverter}.
37+
* </p>
38+
*
39+
* <p>
3540
* <b>Note:</b> The authentication manager needs a corresponding {@link AuthenticationProvider} to actually verify the
3641
* {@link Authentication}.
3742
* </p>
@@ -47,7 +52,9 @@ public interface GrpcAuthenticationReader {
4752
* <p>
4853
* <b>Note:</b> Implementations are free to throw an {@link AuthenticationException} if no credentials could be
4954
* found in the call. If an exception is thrown by an implementation then the authentication attempt should be
50-
* considered as failed and no subsequent {@link GrpcAuthenticationReader}s should be called.
55+
* considered as failed and no subsequent {@link GrpcAuthenticationReader}s should be called. Additionally, the call
56+
* will fail as {@link Status#UNAUTHENTICATED}. If the call instead returns {@code null}, then the call processing
57+
* will proceed unauthenticated.
5158
* </p>
5259
*
5360
* @param call The call to get that send the request.

grpc-server-spring-boot-autoconfigure/src/main/java/net/devh/boot/grpc/server/security/interceptors/DefaultAuthenticatingServerInterceptor.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,10 @@
4747
* authentication to both grpc's {@link Context} and {@link SecurityContextHolder}.
4848
*
4949
* <p>
50+
* This works similar to the {@code org.springframework.security.web.authentication.AuthenticationFilter}.
51+
* </p>
52+
*
53+
* <p>
5054
* <b>Note:</b> This interceptor works similar to
5155
* {@link Contexts#interceptCall(Context, ServerCall, Metadata, ServerCallHandler)}.
5256
* </p>

tests/src/test/java/net/devh/boot/grpc/test/interceptor/DefaultServerInterceptorTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@
4848
ManualSecurityConfiguration.class})
4949
@EnableAutoConfiguration
5050
@DirtiesContext
51-
public class DefaultServerInterceptorTest {
51+
class DefaultServerInterceptorTest {
5252

5353
@Autowired
5454
private ApplicationContext applicationContext;

0 commit comments

Comments
 (0)