grpc-ecosystem / grpc-spring

Spring Boot starter module for gRPC framework.
https://grpc-ecosystem.github.io/grpc-spring/
Apache License 2.0
3.43k stars 809 forks source link

Add an interceptor to support AuthenticationManagerResolver #1034

Open mehrabisajad opened 5 months ago

mehrabisajad commented 5 months ago

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:

ST-DDT commented 5 months ago

Nice suggestion, I'm currently quite busy so I might be slow to respond.

ST-DDT commented 5 months ago

We moved some files. Could you please fix the merge conflicts?

mehrabisajad commented 3 months ago

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?

mehrabisajad commented 3 months ago

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.

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 GrpcServerSecurityAutoConfiguration Conditions, if GrpcAuthenticationReader is not registered, I think it will probably encounter error. So all the configuration depends on GrpcAuthenticationReader.

If you have any other situation to consider, please let me know.