Commit Graph

142 Commits

Author SHA1 Message Date
Dave Syer
2d3ddfca12 Remove redundant annotation 2025-05-08 15:58:42 +01:00
Dave Syer
7911f3f57e Revert to snapshots 2025-04-25 15:55:29 +01:00
Dave Syer
5f7447c9db 0.8.0 release 2025-04-25 15:42:35 +01:00
Dave Syer
eb82d462e9 Rename explicit references to github org 2025-04-23 10:51:55 +01:00
Dave Syer
132fd2c364 Use new class in condition 2025-04-17 15:13:28 +01:00
Dave Syer
3176c7bc50 Revert to snapshots 2025-04-16 08:20:42 +01:00
Dave Syer
c357502aa4 Bump to 0.7.0 2025-04-16 07:39:50 +01:00
Tran Ngoc Nhan
eeb625b452 Remove obsolete code
Signed-off-by: Tran Ngoc Nhan <ngocnhan.tran1996@gmail.com>
2025-04-09 14:41:21 +01:00
Schuyler Metcalf
a99ac62fe9 Fixes issue with maxIncomingMessageSize not being set correctly for clients
Signed-off-by: Schuyler Metcalf <schuyler.metcalf@hey.com>
2025-04-08 13:00:46 +01:00
Dave Syer
61c16aadd8 Revert to snapshots 2025-04-05 10:06:52 +01:00
Dave Syer
495934ab28 Bump to 0.6.0 2025-04-04 17:54:59 +01:00
Dave Syer
07e9e14d26 More care taken with starting netty server in webapp 2025-04-04 15:32:19 +01:00
Dave Syer
a39904ca1c Add a test 2025-04-04 13:49:24 +01:00
Dave Syer
a86db67db9 Add extra defensive condition 2025-04-03 15:43:10 +01:00
Dave Syer
28465263d7 Clarify bundle meaning 2025-04-03 13:30:53 +01:00
Dave Syer
d93ad2b865 Add more detail about disabling the servlet 2025-04-03 13:22:04 +01:00
Dave Syer
a3d7ba643d Split bean registration and creation for stubs
GrpcClientRegistry was responsible for both, which causes lifecycle
issues when users don't follow recommendations. This change
pushes the bean registration firmly down a level into an
ImportBeanDefinitionRegistrar. Also helps with AOT because the AOT
processor only runs the IBDR at build time.
2025-04-03 12:09:23 +01:00
Dave Syer
8b26b8f262 Rename annotation to mirror Spring HTTP interfaces 2025-03-26 08:30:01 +00:00
Dave Syer
55bd93958a Rename client annotations 2025-03-26 08:23:11 +00:00
Dave Syer
582b59a7a6 Add registrar to autoconfig 2025-03-25 07:11:24 +00:00
Dave Syer
e4fa0f83df Check if csrf protection is already disabled
If the user has explicitly disabled CSRF protection in a custom
SecurityFilterChain, we should be able to back off and not try
to disable it just for the gRPC endpoints (accidentally switching
it back on for the other endpoints).

Fixes gh-142
2025-03-24 10:09:43 +00:00
Dave Syer
6198fe04d8 Add reactive version of servlet request matchers 2025-03-18 14:56:06 +00:00
Sergei Batsura
b004ba6559 Added defaultDeadline client property
Signed-off-by: Sergei Batsura <batsura.sa@gmail.com>
[resolves #136]
2025-03-13 12:36:20 +00:00
Dave Syer
fe2509d1ac Revert to snapshots 2025-03-10 10:25:10 +00:00
Dave Syer
630e776158 Bump to 0.5.0 2025-03-10 09:09:29 +00:00
Dave Syer
d8995bb59a Add support for @EnableGrpcClients
Automatic bean definition registration for stubs

Fixes #91
2025-03-07 08:56:30 +00:00
Dave Syer
f580197169 Fix bugs in security autoconfig conditions 2025-03-06 14:52:20 +00:00
Dave Syer
b423429b8f Revert to snapshot 2025-03-03 12:47:03 +00:00
Dave Syer
24f7d20c2f Add some logging when services registered 2025-03-03 10:01:40 +00:00
Dave Syer
28a2c58f78 Bump to 0.4.0
There are some version management issues with 0.3.0 so we
need a release to catch up with changes in Boot.
2025-03-03 09:45:48 +00:00
Dave Syer
ebf9caa44d Add config property for http2 by default 2025-03-03 09:26:06 +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
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
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
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
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
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
cb58f10116 Allow default channel address to be carried through 2025-02-05 13:11:58 +00:00
Dave Syer
c13369e6db Add some oauth2 configuration and sample code 2025-01-28 09:00:48 +00:00
Dave Syer
ff40f5b323 Add authorize requests filters 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
be643c3627 Disable CSRF for Servlet apps by default 2025-01-24 09:06:04 +00:00
Dave Syer
cfe1ca9a57 Add some convenience methods to GrpcServiceDiscoverer 2025-01-16 17:28:29 +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