Skip to content

Commit

Permalink
fix: SKFP-1025 Add logs (#296)
Browse files Browse the repository at this point in the history
  • Loading branch information
celinepelletier authored Jun 13, 2024
1 parent 148625f commit fb54f6e
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/main/java/io/kidsfirst/core/service/AwsKmsService.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import com.amazonaws.services.kms.AWSKMS;
import com.amazonaws.services.kms.AWSKMSAsyncClient;
import com.amazonaws.services.kms.model.AWSKMSException;
import com.amazonaws.services.kms.model.DecryptRequest;
import com.amazonaws.services.kms.model.EncryptRequest;
import lombok.extern.slf4j.Slf4j;
Expand Down Expand Up @@ -45,6 +46,9 @@ public Mono<String> encrypt(String original) {
// Shouldn't be reachable, handle anyways
log.error(e.getMessage(), e);
return null;
} catch (AWSKMSException e) {
log.error("AWSKMSException occurs when encrypting [{}] with message {}", original, e.getMessage());
return null;
}
}).subscribeOn(Schedulers.boundedElastic());

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import com.fasterxml.jackson.databind.ObjectMapper;
import io.kidsfirst.config.AllFences;
import io.kidsfirst.core.model.Acl;
import lombok.extern.slf4j.Slf4j;
import lombok.val;
import org.springframework.cloud.gateway.route.builder.GatewayFilterSpec;
import org.springframework.http.MediaType;
Expand All @@ -13,6 +14,7 @@
import java.util.Collections;
import java.util.Objects;

@Slf4j
public class FenceAclGatewaySpecUtil {

private final static ObjectMapper objectMapper = new ObjectMapper();
Expand All @@ -32,6 +34,8 @@ public static GatewayFilterSpec filterAcl(GatewayFilterSpec f, AllFences.Fence f
} catch (JsonProcessingException e) {
throw new IllegalStateException("Impossible to parse json", e);
}
} else {
log.error("Error when retrieving ACLs for fence {} with status {}", fence.getName(), serverWebExchange.getResponse().getStatusCode());
}
return Mono.just(Objects.requireNonNullElse(s, ""));
}
Expand Down

0 comments on commit fb54f6e

Please sign in to comment.