Skip to content

Add coarse grained conditional autoconfiguration guards #112

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

Merged
merged 2 commits into from
Feb 24, 2025

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

Verified

This commit was signed with the committer’s verified signature.
JoshuaKGoldberg Josh Goldberg ✨
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>

Verified

This commit was signed with the committer’s verified signature.
JoshuaKGoldberg Josh Goldberg ✨
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
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.

None yet

2 participants