-
Notifications
You must be signed in to change notification settings - Fork 837
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add an interceptor to support AuthenticationManagerResolver #1034
base: master
Are you sure you want to change the base?
Add an interceptor to support AuthenticationManagerResolver #1034
Conversation
...nfigure/src/main/java/net/devh/boot/grpc/server/security/interceptors/GrpcServerRequest.java
Outdated
Show resolved
Hide resolved
...nfigure/src/main/java/net/devh/boot/grpc/server/security/interceptors/GrpcServerRequest.java
Outdated
Show resolved
Hide resolved
...nfigure/src/main/java/net/devh/boot/grpc/server/security/interceptors/GrpcServerRequest.java
Outdated
Show resolved
Hide resolved
...h/boot/grpc/server/security/interceptors/ManagerResolverAuthenticatingServerInterceptor.java
Outdated
Show resolved
Hide resolved
...h/boot/grpc/server/security/interceptors/ManagerResolverAuthenticatingServerInterceptor.java
Outdated
Show resolved
Hide resolved
Nice suggestion, I'm currently quite busy so I might be slow to respond. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please add a test that checks whether this works as expected.
...net/devh/boot/grpc/server/security/interceptors/AbstractAuthenticatingServerInterceptor.java
Outdated
Show resolved
Hide resolved
...net/devh/boot/grpc/server/security/interceptors/AbstractAuthenticatingServerInterceptor.java
Outdated
Show resolved
Hide resolved
.../net/devh/boot/grpc/server/security/interceptors/DefaultAuthenticatingServerInterceptor.java
Outdated
Show resolved
Hide resolved
.../net/devh/boot/grpc/server/security/interceptors/DefaultAuthenticatingServerInterceptor.java
Outdated
Show resolved
Hide resolved
...nfigure/src/main/java/net/devh/boot/grpc/server/security/interceptors/GrpcServerRequest.java
Outdated
Show resolved
Hide resolved
...h/boot/grpc/server/security/interceptors/ManagerResolverAuthenticatingServerInterceptor.java
Outdated
Show resolved
Hide resolved
...h/boot/grpc/server/security/interceptors/ManagerResolverAuthenticatingServerInterceptor.java
Outdated
Show resolved
Hide resolved
...h/boot/grpc/server/autoconfigure/GrpcServerSecurityWithManagerResolverAutoConfiguration.java
Outdated
Show resolved
Hide resolved
...net/devh/boot/grpc/server/security/interceptors/AbstractAuthenticatingServerInterceptor.java
Outdated
Show resolved
Hide resolved
...net/devh/boot/grpc/server/security/interceptors/AbstractAuthenticatingServerInterceptor.java
Outdated
Show resolved
Hide resolved
...h/boot/grpc/server/autoconfigure/GrpcServerSecurityWithManagerResolverAutoConfiguration.java
Outdated
Show resolved
Hide resolved
...nfigure/src/main/java/net/devh/boot/grpc/server/security/interceptors/GrpcServerRequest.java
Outdated
Show resolved
Hide resolved
...ava/net/devh/boot/grpc/test/config/WithBasicAuthAndManagerResolverSecurityConfiguration.java
Outdated
Show resolved
Hide resolved
We moved some files. Could you please fix the merge conflicts? |
# Conflicts: # grpc-server-spring-boot-starter/src/main/java/net/devh/boot/grpc/server/security/interceptors/AbstractAuthenticatingServerInterceptor.java # grpc-server-spring-boot-starter/src/main/java/net/devh/boot/grpc/server/security/interceptors/GrpcServerRequest.java # grpc-server-spring-boot-starter/src/main/java/net/devh/boot/grpc/server/security/interceptors/ManagerResolverAuthenticatingServerInterceptor.java
Great, I've fixed the merge conflicts that arose due to the file movements. I've carefully reviewed the changes and believe everything is now in sync. I've pushed the changes to the branch. Could you please take a look at the latest version and let me know if you have any further questions or require additional modifications? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Implementation wise looks good to me, but I have no time to check the security/config side effects.
...h/boot/grpc/server/security/interceptors/ManagerResolverAuthenticatingServerInterceptor.java
Outdated
Show resolved
Hide resolved
…pc/server/security/interceptors/ManagerResolverAuthenticatingServerInterceptor.java
...h/boot/grpc/server/security/interceptors/ManagerResolverAuthenticatingServerInterceptor.java
Show resolved
Hide resolved
…pc/server/security/interceptors/ManagerResolverAuthenticatingServerInterceptor.java
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I haven't tested this myself and I'm unsure about the change in condition regarding when the security config is enabled.
Other than that, it looks good to me.
...h/boot/grpc/server/security/interceptors/ManagerResolverAuthenticatingServerInterceptor.java
Outdated
Show resolved
Hide resolved
.../net/devh/boot/grpc/server/security/interceptors/DefaultAuthenticatingServerInterceptor.java
Outdated
Show resolved
Hide resolved
If on of the interceptors condition met, then it will be registered. On the other hand if both conditions met then the first one will be registered according to the priority. According to existing If you have any other situation to consider, please let me know. |
This proposal introduces the
AuthenticationManagerResolver<GrpcServerRequest>
to Spring's gRPC authentication framework. This provides a flexible mechanism for implementing dynamic authentication based on your specific needs.The Problem:
The Solution: