Commit Graph

225 Commits

Author SHA1 Message Date
Dave Syer
ebf9caa44d Add config property for http2 by default 2025-03-03 09:26:06 +00:00
Dave Syer
3047c27f9c Add (temporarily) some native image metadata
Still waiting for
https://github.com/oracle/graalvm-reachability-metadata/pull/593
2025-03-03 09:13:28 +00:00
Dave Syer
d32f13e6ed Match dependencies in gradle build 2025-03-03 08:51:03 +00:00
Dave Syer
244f87e8fe Fix some gradle builds 2025-02-25 18:05:41 +00:00
Dave Syer
babe00025d Remove some unnecessary code 2025-02-25 18:02:55 +00:00
Dave Syer
6853d2dad4 There may be more than one security configuration
In an app with servlets *and* a native gRPC server for instance,
the global AuthenticationManagerBuilder (the @Bean) should be
treated as a parent for the one used by GrpcSecurity. It's the
same in HttpSecurity. Slightly more complicated than necessary
when there is only native gRPC security, but at least it now
works, and makes it easier to introduce multiple GrpcSecurity
instances in future if necessary (like with HttpSecurity it
could be a prototype).
2025-02-24 16:23:43 +00:00
Dave Syer
dee423953f Add condition to guard security servlet config 2025-02-24 14:04:33 +00:00
Chris Bono
b04b6ca1ac Add ConditionalOnGrpcServerEnabled flag
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>
2025-02-24 12:42:06 +00:00
Chris Bono
2790a8a027 Add ConditionalOnGrpcClientEnabled flag
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>
2025-02-24 12:42:06 +00:00
Andrey Litvitski
1b782256b1 Update to Boot 3.4.3
Signed-off-by: Andrey Litvitski <andrey1010102008@gmail.com>
2025-02-24 12:39:35 +00:00
Chris Bono
581e841550 Update docs README w/ steps on generating config props
Signed-off-by: Chris Bono <chris.bono@gmail.com>
2025-02-21 13:10:11 -06:00
Andrey Litvitski
fbae1c9cb6 Generate config props during doc phase (#110)
Signed-off-by: Andrey Litvitski <andrey1010102008@gmail.com>
2025-02-21 13:09:12 -06:00
Andrey Litvitski
8d20f4a6d9 Fix typo in pom.xml in core module
Signed-off-by: Andrey Litvitski <andrey1010102008@gmail.com>
2025-02-15 11:20:59 -06:00
Chris Bono
c3b7d77e41 Update description for servlet server config prop
Signed-off-by: Chris Bono <chris.bono@gmail.com>
2025-02-12 10:09:45 -06:00
Chris Bono
ba4427b1ae Update whats-new.adoc with fine-grained starters
Signed-off-by: Chris Bono <chris.bono@gmail.com>
2025-02-12 10:09:45 -06:00
Chris Bono
225c523490 Make Tomcat samples use new servlet server starter
Signed-off-by: Chris Bono <chris.bono@gmail.com>
2025-02-12 10:09:45 -06:00
Chris Bono
8f249148ed Add Netty server starter module
This adds a new starter module (`spring-grpc-server-spring-boot-starter`)
for gRPC Netty server and updates the current coarse-grained starter
(`spring-grpc-spring-boot-starter`) to include the newly added server
and client starter modules.

Signed-off-by: Chris Bono <chris.bono@gmail.com>
2025-02-12 10:09:45 -06:00
Chris Bono
7e01d36af3 Revert previous change in Netty shaded sample
The build.gradle previous use of `replacedBy` is consistent w/ what is already in the ref guide.

Signed-off-by: Chris Bono <chris.bono@gmail.com>
2025-02-12 10:09:45 -06:00
Chris Bono
b65c03d1c5 Fix pom.xml indentation issues from previous commits
Signed-off-by: Chris Bono <chris.bono@gmail.com>
2025-02-12 10:09:45 -06:00
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