You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -805,6 +805,71 @@ public AuthenticationSchemeSelector myCustomSchemeSelector(){
805
805
806
806
<<Client side configuration support>> section explains how to pass custom authorization scheme and claim from GRPC client.
807
807
808
+
=== @PreAuthorize() and @PostAuthorize() support
809
+
Starting from version `4.5.9` you can also use standard `@PreAuthorize` and `@PostAuthorize` annotations on grpc service methods and grpc service types.
810
+
811
+
.Referencing input/output object in expression
812
+
[cols="1,1,2,6"]
813
+
|===
814
+
|Call Type |Input object ref |Output object ref | Sample
public StreamObserver<Person> bidiStream(StreamObserver<Assignment> responseObserver) {
868
+
}
869
+
----
870
+
|===
871
+
872
+
808
873
=== Obtaining Authentication details
809
874
810
875
To obtain `Authentication` object in the implementation of *secured method*, please use below snippet
@@ -902,9 +967,30 @@ Starting from version `3.3.0`, the starter will auto-register the running grpc s
902
967
903
968
The registered service name will be prefixed with `grpc-` ,i.e. `grpc-${spring.application.name}` to not interfere with standard registered web-service name if you choose to run both embedded `Grpc` and `Web` servers. +
904
969
905
-
Setting `spring.cloud.consul.discovery.register-health-check` to true will register GRPC health check service with Consul.
970
+
`ConsulDiscoveryProperties` are bound from configuration properties prefixed by `spring.cloud.consul.discovery` and then the values are overwritten by `grpc.consul.discovery` prefixed properties (if set). This allows you to have separate consul discovery configuration for `rest` and `grpc` services if you choose to expose both from your application.
971
+
972
+
[source,yml]
973
+
----
974
+
spring:
975
+
cloud:
976
+
consul:
977
+
discovery:
978
+
metadata:
979
+
myKey: myValue <1>
980
+
tags:
981
+
- myWebTag <2>
982
+
grpc:
983
+
consul:
984
+
discovery:
985
+
tags:
986
+
- myGrpcTag <3>
987
+
----
988
+
<1> Both `rest` and `grpc` services are registered with metadata `myKey=myValue`
989
+
<2> Rest services are registered with `myWebTag`
990
+
<3> Grpc services are registered with `myGrpcTag`
991
+
992
+
Setting `spring.cloud.consul.discovery.register-health-check` (or `grpc.consul.discovery.register-health-check`) to `true` will register GRPC health check service with Consul.
906
993
907
-
Tags could be set by defining `spring.cloud.consul.discovery.tags` property.
908
994
909
995
There are 4 supported registration modes :
910
996
@@ -915,7 +1001,7 @@ Please note that default implementation https://github.com/grpc/grpc-java/blob/b
915
1001
In this mode the running grpc server is registered as single service with check per each discovered `grpc` service.
916
1002
. `STANDALONE_SERVICES` +
917
1003
In this mode each discovered grpc service is registered as single service with single check. Each registered service is tagged by its own service name.
918
-
. `NOOP` - no grpc services registered. This mode is usefull if you serve both `rest` and `grpc` services in your application, but for some reason, only `rest` services should be registered with Consul.
1004
+
. `NOOP` - no grpc services registered. This mode is useful if you serve both `rest` and `grpc` services in your application, but for some reason, only `rest` services should be registered with Consul.
919
1005
920
1006
[source,yml]
921
1007
.You can control the desired mode from application.properties
- Support separate consul discovery properties for grpc and http services [#250](https://github.com/LogNet/grpc-spring-boot-starter/issues/250)
35
+
- Add metadata to consul service discovery [#249](https://github.com/LogNet/grpc-spring-boot-starter/issues/249)
36
+
- Spring security SPEL expressions support (`@PreAuthorize` and `@PostAuthorize`) [#175](https://github.com/LogNet/grpc-spring-boot-starter/issues/175)
37
+
38
+
## :lady_beetle: Bug Fixes
39
+
40
+
- Circular bean dependency since 4.5.8 [#253](https://github.com/LogNet/grpc-spring-boot-starter/issues/253)
41
+
42
+
## :hammer: Dependency Upgrades
43
+
44
+
- Upgrade spring boot to 2.5.6 [#255](https://github.com/LogNet/grpc-spring-boot-starter/issues/255)
0 commit comments