Skip to content

Commit d783ca8

Browse files
author
Alexander Furer
committed
release 4.2.2
1 parent 4bf2678 commit d783ca8

File tree

5 files changed

+17
-5
lines changed

5 files changed

+17
-5
lines changed

README.adoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ repositories {
3131
3232
}
3333
dependencies {
34-
compile 'io.github.lognet:grpc-spring-boot-starter:4.2.1'
34+
compile 'io.github.lognet:grpc-spring-boot-starter:4.2.2'
3535
}
3636
3737

ReleaseNotes.adoc

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
== Version 4.2.2
2+
* Fixes https://github.com/LogNet/grpc-spring-boot-starter/issues/162[162]
3+
14
== Version 4.2.1
25

36
* Configure bind address and other netty settings (fixes https://github.com/LogNet/grpc-spring-boot-starter/issues/82[82])

gradle.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ grpcVersion=1.33.0
22
springBootVersion=2.3.4.RELEASE
33
springCloudVersion=Hoxton.SR6
44

5-
version=4.2.2-SNAPSHOT
5+
version=4.2.2
66
group=io.github.lognet
77
description=Spring Boot starter for Google RPC.
88
gitHubUrl=https\://github.com/LogNet/grpc-spring-boot-starter

grpc-spring-boot-starter-demo/src/test/java/org/lognet/springboot/grpc/auth/DefaultAuthConfigTest.java

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33

44
import com.google.protobuf.Empty;
5+
import io.grpc.examples.GreeterGrpc;
56
import io.grpc.examples.SecuredGreeterGrpc;
67
import org.junit.Test;
78
import org.junit.runner.RunWith;
@@ -44,4 +45,14 @@ public void securedServiceTest() {
4445
assertTrue(String.format("Reply should contain name '%s'",USER_NAME),reply.contains(USER_NAME));
4546

4647
}
48+
@Test
49+
public void securedServiceMethodTest() {
50+
51+
final GreeterGrpc.GreeterBlockingStub securedFutureStub = GreeterGrpc.newBlockingStub(getChannel(true));
52+
53+
final String reply = securedFutureStub.sayAuthHello(Empty.getDefaultInstance()).getMessage();
54+
assertNotNull("Reply should not be null",reply);
55+
assertTrue(String.format("Reply should contain name '%s'",USER_NAME),reply.contains(USER_NAME));
56+
57+
}
4758
}

grpc-spring-boot-starter/src/main/java/org/lognet/springboot/grpc/security/GrpcServiceAuthorizationConfigurer.java

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,7 @@
1818
import java.util.Arrays;
1919
import java.util.Collection;
2020
import java.util.Collections;
21-
import java.util.Comparator;
2221
import java.util.List;
23-
import java.util.Objects;
2422
import java.util.Optional;
2523
import java.util.stream.Collectors;
2624
import java.util.stream.Stream;
@@ -139,7 +137,7 @@ private void processSecuredAnnotation() {
139137
// method level security
140138
for (ServerMethodDefinition<?, ?> methodDefinition : serverServiceDefinition.getMethods()) {
141139
Stream.of(service.getClass().getMethods()) // get method from methodDefinition
142-
.filter(m -> 0 == Objects.compare(methodDefinition.getMethodDescriptor().getBareMethodName(), m.getName(), Comparator.naturalOrder()))
140+
.filter(m -> m.getName().equalsIgnoreCase(methodDefinition.getMethodDescriptor().getBareMethodName()))
143141
.findFirst()
144142
.flatMap(m -> Optional.ofNullable(AnnotationUtils.findAnnotation(m, Secured.class)))
145143
.ifPresent(secured -> new AuthorizedMethod(methodDefinition.getMethodDescriptor()).hasAnyAuthority(secured.value()));

0 commit comments

Comments
 (0)