Commit Graph

58 Commits

Author SHA1 Message Date
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
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
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
f1ed1ce93a Add BearerTokenAuthenticationInterceptor for client 2025-01-07 09:14:59 +00:00
Dave Syer
f3b0ac11e6 Add BasicAuthenticationInterceptor for client 2025-01-07 09:14:59 +00:00
Dave Syer
abcf83e8cc Make Spring Security work in a Tomcat app 2025-01-07 09:14:59 +00:00
Chris Bono
c936d6a876 Move NamedChannel model to core module (#89)
This commit introduces the NamedChannelRegistry which allows
moving the NamedChannel model to the core package and decouples
it from the client properties.
2025-01-06 21:19:07 -06:00
Chris Bono
81990f0fd6 Use channel factory API w/o customizer in tests 2025-01-03 22:04:28 +00:00
Chris Bono
b08e11ad39 Improve channel factory API
This commit improves the GrpcChannelFactory createChannel API by
introducing `ChannelBuilderOptions` that can be specified during
channel creation.

Additionally, concrete Netty channel factory implementations have
been added as well as adding type to the GrpcChannelBuilderCustomizer
which helps match customizers to channel factories.
2025-01-03 22:04:28 +00:00
Chris Bono
5c0ca7056c Add client interceptors to channel factory
This commit adds support for global and channel-specific client
interceptors.

Resolves #52

Signed-off-by: Chris Bono <chris.bono@gmail.com>
2024-12-01 21:01:08 +00:00
Chris Bono
62499c8be2 Rename client configurer to customizer
This commit renames the GrpcChannelConfigurer to GrpcChannelBuilderCustomizer
to more accurately represent its purpose and for consistency with the
server-side terminology.

Additionally, a new `What's new?` doc is added to list breaking changes between
versions.

See #52

Signed-off-by: Chris Bono <chris.bono@gmail.com>
2024-12-01 17:57:41 +00:00
Chris Bono
17b8e9204c Move bean lookup utils into common package
This commit moves the `ApplicationContextBeanLookupUtils` into the
'internal' package and opens up its method to public visibility so
that it can be shared amongst framework components.

See #52

Signed-off-by: Chris Bono <chris.bono@gmail.com>
2024-12-01 17:57:41 +00:00
Dave Syer
7f4cac0381 Back to snapshots 2024-11-28 15:37:42 +00:00
Dave Syer
b273d8e83a Bump to 0.2.0 2024-11-28 14:30:09 +00:00
Dave Syer
c239cfe970 Add sample and integration test 2024-11-21 15:24:44 +00:00
Dave Syer
0dc3249251 Allow GrpcServerFactory to return null 2024-11-19 08:41:13 +00:00
Chris Bono
8eb623e82d Add server interceptor blending
This commit implements the `@GprcService(blendWithGlobalInterceptors)`
feature. This allows global and per-service server interceptors to be
combined into a single list and then finally sorted (i.e. blended).

Signed-off-by: Chris Bono <chris.bono@gmail.com>
2024-11-18 06:55:49 +00:00
Chris Bono
e3d58cf988 Move some components into core module
This commit moves several components into the core module
from the autoconfiguration module. Anything that exists
in the AC module will ultimately end up in Spring Boot
project assuming we move into Spring Boot in the future.

Signed-off-by: Chris Bono <chris.bono@gmail.com>
2024-11-15 07:49:54 +00:00
Andrey Litvitski
50e2db6d8a Update JavaDocs for grpc-client classes 2024-11-10 13:45:28 +00:00
Chris Bono
daf8e046c3 Adds checkstyles to project
This commit configures in the Puppycrawl checkstyle with the Spring JavaFormat.

To avoid the intrusive nature of such a change, the spring-grpc-core module is
the only one to have the checkstyles applied. I will handle the other modules as
time permits.

Signed-off-by: Chris Bono <chris.bono@gmail.com>
2024-11-07 08:07:48 +00:00
Dave Syer
c56784fd7b Remove netty-specific credentials factory in client
See also #10
2024-11-05 15:39:30 +00:00
Dave Syer
158e779f61 Unused imports 2024-11-05 15:28:03 +00:00
Dave Syer
8491d2641b Remove netty specific channel factories 2024-11-05 13:51:32 +00:00
Dave Syer
05e6240672 Support for mTLS in client
Fixes #10
2024-11-05 12:28:22 +00:00
Dave Syer
148e1d1e23 Add client auth enum to ssl configuration 2024-11-05 07:34:42 +00:00
Chris Bono
9cf0227354 Add GrpcServiceDiscoverer to prepare for interceptors
This commit re-introduces the service discoverer concept from the
gRPC ecosystem. We previously removed it but realized that the
abstraction is helpful to provide fully configured service
definitions with features like server interceptors. The next
commit will take advantage of this commit to add interceptors.

See #4

Signed-off-by: Chris Bono <chris.bono@gmail.com>
2024-11-04 08:45:23 +00:00
Dave Syer
8bab3cd081 Revert to snapshots 2024-10-25 12:35:52 +01:00
Dave Syer
2d2e0d8b8e Ready for 0.1.0 2024-10-25 12:20:47 +01:00
Chris Bono
40fed814b9 Exclude older protobuf lib from grpc lib
This commit excludes the older protobuf libs
`protobuf-java` and `proto-google-common-protos` from the
`grpc-protobuf` lib and then explicitly adds back in the
dependencies at the desired version in the root pom.xml
2024-10-21 08:30:40 +01:00
Chris Bono
f31d6ad6f7 Remove dependency on javax.annotation
This commit removes the directy dependency that was required
by the protoc compiler for our samples. The Maven and Gradle
now support an option to use an internal annotation which then
allows us to remove the deprecated javax.annotation dependency.

Background here: https://github.com/grpc/grpc-java/pull/10927
2024-10-20 21:09:13 +01:00
Chris Bono
c856f71159 Clean up dependencies and versions
This commit does the following:

- Update various dependencies to latest patch versions
- Remove unused dependencies
- Remove unused version properties
- Remove Spring Boot references in all modules except autoconfigure
  and samples
2024-10-20 21:09:13 +01:00
Dave Syer
3cb6ce3912 Move code around so factory gets address not port 2024-10-19 07:52:50 +01:00
Dave Syer
b92fd43664 Add support for client connection negotiation
The serverside SSL was working, but the clients were not able to
connect because they all had insecure call credentials. This change
adds a NegotiationType enum for configuring the client, and an
integration test that uses it (implicitly).

Also move some logic around. The netty-specific channel factories
weren't doing any work. This makes them do something, so more
classpath-dependent logic can go into them.
2024-10-14 10:46:53 +01:00
Chris Bono
42cdd2feda Rename BaseGrpcServerFactory to DefaultGrpcServerFactory 2024-10-04 11:16:48 -05:00
Chris Bono
9f59120988 Delete unused server factory/helpers 2024-10-04 11:02:42 -05:00
Chris Bono
11c658bfba Use explicit server factory impls
This commit breaks the DefaultGrpcServerFactory into concrete
implementations which helps with type-safety of different builders.

Also, an aggregate customizers helper is added to allow the
server builder customizers to be type specific and properly
applied as such.

Tests were also enhanced to cover newly added components.
2024-10-02 13:54:03 +01:00
Dave Syer
8ce86686c4 Another docs change 2024-10-01 08:50:22 +01:00
Dave Syer
acfa3f641a Also replace in poms and docs metadata 2024-10-01 08:49:16 +01:00
Chris Bono
e7fa5709e2 Rename configurer to customizer
This commit renames GrpcServerConfigurer to ServerBuilderCustomizer.
2024-09-26 08:36:39 +01:00
Chris Bono
5bc8a8c3a2 Revert ApplicationEventPublisherAware 2024-09-24 16:12:12 +01:00
Chris Bono
bb60c8fcaa Simplify server auto-configuration
This simplifies the server-side auto-configuration as follows:

- delete svc discover abstraction (use ObjectProvider for now)
- use single AC class
2024-09-24 16:12:12 +01:00
Dave Syer
f38a16fee9 Add support for external client (channel) config
Fixes #11
2024-09-16 13:25:29 +01:00
Dave Syer
9c20aa0ea0 Distinguish between available and epollable 2024-09-16 11:46:49 +01:00
Dave Syer
1bdcee5930 Add path parameter to GrpcChannelConfigurer 2024-09-12 12:28:44 +01:00
Dave Syer
cf0e396fcd Support for non-default address spring.grpc.server 2024-09-10 14:01:01 +01:00
Dave Syer
777180db30 Add support for unix domain sockets 2024-09-09 15:41:24 +01:00
Dave Syer
2249f6e2b3 Support for @LocalGrpcPort in @Lazy beans 2024-09-09 13:26:05 +01:00