pull/11181/head
Andy Wilkinson 7 years ago
parent a454c1c121
commit 22a426fe39

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

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

Loading…
Cancel
Save