This commit is contained in:
Andy Wilkinson 2017-11-28 10:50:05 +00:00
parent a454c1c121
commit 22a426fe39
2 changed files with 6 additions and 8 deletions

View File

@ -74,14 +74,13 @@ class ReactiveTokenValidator {
return Mono.just(this.cachedTokenKeys)
.filter((tokenKeys) -> tokenKeys.containsKey(keyId))
.switchIfEmpty(this.securityService.fetchTokenKeys()
.doOnSuccess(fetchedTokenKeys -> {
.doOnSuccess((fetchedTokenKeys) -> {
this.cachedTokenKeys.clear();
this.cachedTokenKeys.putAll(fetchedTokenKeys);
})
.filter((tokenKeys) -> tokenKeys.containsKey(keyId))
.switchIfEmpty((Mono.error(
new CloudFoundryAuthorizationException(Reason.INVALID_KEY_ID,
"Key Id present in token header does not match")))))
}).filter((tokenKeys) -> tokenKeys.containsKey(keyId))
.switchIfEmpty((Mono.error(new CloudFoundryAuthorizationException(
Reason.INVALID_KEY_ID,
"Key Id present in token header does not match")))))
.filter((tokenKeys) -> hasValidSignature(token, tokenKeys.get(keyId)))
.switchIfEmpty(Mono.error(new CloudFoundryAuthorizationException(
Reason.INVALID_SIGNATURE, "RSA Signature did not match content")))

View File

@ -19,7 +19,6 @@ package org.springframework.boot.autoconfigure.data.cassandra;
import com.datastax.driver.core.Cluster;
import com.datastax.driver.core.Session;
import reactor.core.publisher.Flux;
import reactor.core.scheduler.Schedulers;
import org.springframework.boot.autoconfigure.AutoConfigureAfter;
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
@ -52,7 +51,7 @@ public class CassandraReactiveDataAutoConfiguration {
@Bean
@ConditionalOnMissingBean(ReactiveSession.class)
public ReactiveSession reactiveCassandraSession(Session session) {
return new DefaultBridgedReactiveSession(session, Schedulers.elastic());
return new DefaultBridgedReactiveSession(session);
}
@Bean