Skip to content

Commit

Permalink
Fixed caching behavior in JwtTokenResolverImpl, no cache for errors (#90
Browse files Browse the repository at this point in the history
)

* Fixed  caching behavior in JwtTokenResolverImpl, no  cache for  errors

* Fixed tests (updated testcontainers)
  • Loading branch information
artem-v authored Feb 24, 2021
1 parent 12fe5a8 commit fa7a4a9
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 2 deletions.
11 changes: 10 additions & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,9 @@
<hamcrest.version>1.3</hamcrest.version>
<junit-jupiter.version>5.4.2</junit-jupiter.version>
<vault-java-driver.version>5.0.0</vault-java-driver.version>
<testcontainers.version>1.14.0</testcontainers.version>
<testcontainers.version>1.15.1</testcontainers.version>
<!-- TODO: remove explicit version of `jna` once testcontainers fixes dependencies conflict -->
<jna.version>5.5.0</jna.version>
</properties>

<dependencyManagement>
Expand Down Expand Up @@ -90,6 +92,13 @@
<type>pom</type>
<scope>import</scope>
</dependency>
<!-- TestContainers -->
<dependency>
<groupId>net.java.dev.jna</groupId>
<artifactId>jna</artifactId>
<version>${jna.version}</version>
<scope>test</scope>
</dependency>
</dependencies>
</dependencyManagement>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,10 @@ private Mono<Key> findKey(String kid, AtomicReference<Mono<Key>> computedValueHo
(kid1) -> {
Mono<Key> result =
computedValueHolder.updateAndGet(
mono -> Mono.defer(() -> keyProvider.findKey(kid)).cache());
mono ->
Mono.defer(() -> keyProvider.findKey(kid1))
.cache()
.doOnError(ex -> keyResolutions.remove(kid1)));
scheduleCleanup(kid, computedValueHolder);
return result;
});
Expand Down

0 comments on commit fa7a4a9

Please sign in to comment.