Skip to content

Comments

Add coarse grained conditional autoconfiguration guards#112

Merged
dsyer merged 2 commits intospring-projects:mainfrom
onobc:GH-90-guard-starters-2
Feb 24, 2025
Merged

Add coarse grained conditional autoconfiguration guards#112
dsyer merged 2 commits intospring-projects:mainfrom
onobc:GH-90-guard-starters-2

Conversation

@onobc
Copy link
Contributor

@onobc onobc commented Feb 18, 2025

This adds the following:

  • coarse-grained conditional guard that will disable the client autoconfiguration if spring.grpc.client.enabled is set to false or the io.grpc:grpc-stub module is not on the classpath.

  • coarse-grained conditional guard that will disable the server autoconfiguration if spring.grpc.server.enabled is set to false or the BindableService class is not available on the classpath.

@onobc onobc added this to the 0.4.0 milestone Feb 18, 2025
@onobc onobc added the enhancement New feature or request label Feb 18, 2025
@onobc onobc changed the title Add ConditionalOnGrpcClientEnabled flag Add coarse grained conditional autoconfiguration guards Feb 19, 2025
This adds a coarse-grained conditional guard that will disable the
client autoconfiguration if `spring.grpc.client.enabled` is set to
false or the `io.grpc:grpc-stub` module is not on the classpath.

Signed-off-by: Chris Bono <chris.bono@gmail.com>
This adds a coarse-grained conditional guard that will disable the
server autoconfiguration if `spring.grpc.server.enabled` is set to
false or `BindableService` class is not available on the classpath.

Signed-off-by: Chris Bono <chris.bono@gmail.com>
@onobc onobc force-pushed the GH-90-guard-starters-2 branch from 9ec84d1 to bf0b372 Compare February 19, 2025 00:11
*
* @author Chris Bono
*/
class GrpcSecurityAutoConfigurationTests {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Used this as an opportunity to add some basic security autoconfig tests.

*
* @author Chris Bono
*/
class GrpcExceptionHandlerAutoConfigurationTests {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Used this as an opportunity to add some basic exception handler autoconfig tests.

@dsyer dsyer merged commit b04b6ca into spring-projects:main Feb 24, 2025
2 checks passed
@onobc onobc deleted the GH-90-guard-starters-2 branch May 13, 2025 15:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants