Commit Graph

306 Commits

Author SHA1 Message Date
Chris Bono
4c1ee098f9 Add servlet server starter module
This adds a starter module that includes the Spring gRPC server
starter and the required dependencies ((`spring-boot-starter-web`
and `jakarta-grpc-servlet`) to use the servlet container as a
gRPC server.

Signed-off-by: Chris Bono <chris.bono@gmail.com>
2025-02-12 10:09:45 -06:00
Chris Bono
2bd167e985 Add client starter module
This adds a starter module that includes the Spring gRPC
core module and the grpc-stub dependency.

Also, makes the `grpc-stub` dependency optional in Spring
gRPC core module.

Signed-off-by: Chris Bono <chris.bono@gmail.com>
2025-02-12 10:09:45 -06:00
Chris Bono
98d744fd6b Remove opinion on Netty from core module
Currently the spring-grpc-core imposes an opinion on Netty.
The core module should not have an opinion, but rather the
starter enforces the opinion.

Also, makes spring-grpc-core optional in the autconfigure
module as the autoconfigure will eventually be moved into
Spring Boot and at that time everything is optional.

Signed-off-by: Chris Bono <chris.bono@gmail.com>
2025-02-12 10:09:45 -06:00
Chris Bono
06adbaa26d Add explicit io.grpc:grpc-core dependency
Signed-off-by: Chris Bono <chris.bono@gmail.com>
2025-02-12 10:09:45 -06:00
Chris Bono
f398c85ac0 Rename security csrf property to include 'server'
This renames the `spring.grpc.security.csrf.enabled` property
to `spring.grpc.server.security.csrf.enabled` to signal that
it is a server configuration property.

Signed-off-by: Chris Bono <chris.bono@gmail.com>
2025-02-12 06:23:40 +00:00
Chris Bono
7743a58e80 [CI] Update upload-artifacts to v4
Signed-off-by: Chris Bono <chris.bono@gmail.com>
2025-02-12 06:23:40 +00:00
Chris Bono
52751046f3 Remove conditional guard for spring.grpc.server.reactive.enabled
This removes the `@ConditionalOnProperty` guard that was in place to force a
native gRPC server to be used when the running application is a Reactive
based web application. This is not needed because a Reactive based web
application can not be used as Servlet gRPC server.

Signed-off-by: Chris Bono <chris.bono@gmail.com>
2025-02-12 06:23:40 +00:00
Chris Bono
9a970cafa5 Adds missing config props metadata
This adds the following entries to additional-spring-configuration-metadata.json:

- `spring.grpc.security.csrf.enabled`
- `spring.grpc.server.servlet.enabled`

They are not present in first class `@ConfigurationProperties` so need to be
manually added.

Signed-off-by: Chris Bono <chris.bono@gmail.com>
2025-02-12 06:23:40 +00:00
Dave Syer
49cb7eacdc Tidy up TODOs 2025-02-10 09:21:10 +00:00
Dave Syer
1b09b7b23c Shutdown channel in tests
Fixes #47
2025-02-07 12:31:48 +00:00
Dave Syer
d6c0298ae0 Prevent call from proceeding if it fails in onReady() 2025-02-07 11:13:20 +00:00
Dave Syer
7389498744 Avoid race condition with call closed twice 2025-02-07 09:54:39 +00:00
Dave Syer
cb58f10116 Allow default channel address to be carried through 2025-02-05 13:11:58 +00:00
Dave Syer
f8354a61cb Update to Boot 3.4.2 2025-02-04 09:45:11 +00:00
Dave Syer
7003b13f23 Correct getting started guide 2025-01-31 11:10:16 +00:00
Dave Syer
ba91758dac Mention annotation as well 2025-01-29 17:08:17 +00:00
Andrey Litvitski
ae8acc52cd Fix documentation on testing server application 2025-01-28 13:37:47 +00:00
Dave Syer
c13369e6db Add some oauth2 configuration and sample code 2025-01-28 09:00:48 +00:00
Dave Syer
fe207e5c72 Simplify test (no need for custom extractor) 2025-01-28 08:57:56 +00:00
Dave Syer
6cf4a74384 Reorganize interceptor 2025-01-28 08:57:56 +00:00
Dave Syer
5433d422c0 Add support for events and anonymous 2025-01-28 08:57:56 +00:00
Dave Syer
ff40f5b323 Add authorize requests filters 2025-01-28 08:57:56 +00:00
Dave Syer
aa8d680c3f Add GrpcSecurity 2025-01-28 08:57:56 +00:00
Бацура Сергей Александрович
aa809aaf8a Fixed typo in GrpcClientProperties
Signed-off-by: Sergei Batsura <batsura.sa@gmail.com>
2025-01-27 10:17:45 -06:00
Dave Syer
3ac7569d5c Add authorizeRequests() example 2025-01-24 13:10:20 +00:00
Dave Syer
be643c3627 Disable CSRF for Servlet apps by default 2025-01-24 09:06:04 +00:00
Dave Syer
758ddba92e Harmonize dependency versions 2025-01-23 13:53:53 +00:00
Dave Syer
cdd6ce9a95 Catch exceptions in interceptors as well 2025-01-23 13:39:10 +00:00
Dave Syer
1a734c10cb Missing dependency from Gradle sample 2025-01-22 14:59:15 +00:00
Dave Syer
d43823c575 Wrists slapped 2025-01-22 07:59:59 +00:00
Dave Syer
8219e26c1e Make sample run OOTB with 2 ports 2025-01-22 07:55:44 +00:00
Dave Syer
c7b1ed3684 Make Tomcat sample work with grpcurl 2025-01-22 07:55:44 +00:00
Chris Bono
495d14b48d Fix getting-started.adoc steps
Updates the fix-getting-started.adoc section of the reference
guide to remove the requirement of the "web" and "graalvm"
dependencies as the former requires other information besides
dependencies to work properly and the latter is just complication
that is not needed for a simple quick start.

See #97
2025-01-21 06:18:45 +00:00
Dave Syer
8d863acc42 Add reactive test 2025-01-20 08:46:33 +00:00
Dave Syer
24b9e42a6f Add Gradle build for new sample 2025-01-17 14:31:30 +00:00
Dave Syer
4dd2158a90 Add reactive sample 2025-01-17 14:10:35 +00:00
Dave Syer
cfe1ca9a57 Add some convenience methods to GrpcServiceDiscoverer 2025-01-16 17:28:29 +00:00
Dave Syer
ec190ae74d Change indents 2025-01-16 09:34:35 +00:00
Dave Syer
4779cae338 Add note on local.grpc.port 2025-01-15 09:20:44 +00:00
Dave Syer
4efd23aa4e Revert to snapshots and add whats new 2025-01-15 09:07:25 +00:00
Dave Syer
406532e44e Bump to 0.3.0 for release 2025-01-15 08:46:48 +00:00
Dave Syer
40820b4a45 Add DCO config 2025-01-15 07:08:56 +00:00
Dave Syer
71355e6ff6 Allow StatusException to set its own headers 2025-01-13 10:35:28 +00:00
Chris Bono
87e26c378e Move named channel back into autoconfigure module
This commit moves the channel config ("NamedChannel") back to
autoconfigure module as the effort to move to core turns out to
be more trouble than it is worth at this time.

Fixes #92
2025-01-13 08:18:11 +00:00
Chris Bono
5ef993fe19 Add graceful shutdown of channels
This commit provides graceful shutdown of all channels
created by the channel factory.

Resolves #12

Co-authored-by: Andrey Litvitski <andrey1010102008@gmail.com>
2025-01-13 08:16:38 +00:00
Chris Bono
fc1de937a8 Polish "Update broken code examples in docs"
This continues the effort of the previous commit to update
broken code examples.
2025-01-12 12:14:51 -06:00
Dumildes Paulo
b861d9301b Update broken code example in docs
This commit updates a broken code example in the docs.
The breakage was introduced in commit b08e11a.
2025-01-12 12:08:04 -06:00
Dave Syer
1559843b43 Exception handler interceptor is ordered correctly
The exception handler interceptor has to be called first so that
it can handle exceptions thrown by other interceptors. Tests up
to now didn't assert that (they focused on exceptions thrown
in services).
2025-01-11 08:45:09 +00:00
Dave Syer
6dc5d85509 Wrist slapped 2025-01-08 09:53:45 +00:00
Dave Syer
4c4bcb4643 Add some docs on security configuration 2025-01-08 09:50:56 +00:00