Skip to content

Commit

Permalink
Fixed whitespace issues
Browse files Browse the repository at this point in the history
  • Loading branch information
cody-constine-ttd committed Nov 6, 2024
1 parent 8542e89 commit 2da9647
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -54,12 +54,12 @@ protected String getDecryptedContent(String encryptedContent) throws Exception {
String encryptedPayload = json.getString("encrypted_payload");
Map<Integer, S3Key> s3Keys = s3KeyProvider.getAll();
S3Key decryptionKey = null;
for (S3Key key : s3Keys.values()) {
if (key.getId() == keyId) {
decryptionKey = key;
break;
}
for (S3Key key : s3Keys.values()) {
if (key.getId() == keyId) {
decryptionKey = key;
break;
}
}

if (decryptionKey == null) {
throw new IllegalStateException("No matching S3 key found for decryption for key ID: " + keyId);
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/com/uid2/shared/store/ScopedStoreReader.java
Original file line number Diff line number Diff line change
Expand Up @@ -86,4 +86,4 @@ public long loadContent(JsonObject metadata, String dataType) throws Exception {
String path = clientKeysMetadata.getString("location");
return loadContent(path);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
import com.uid2.shared.store.scope.StoreScope;
import com.uid2.shared.model.S3Key;
import io.vertx.core.json.JsonObject;

import java.util.Set;
import java.util.HashSet;
import java.util.Map;
Expand All @@ -16,8 +17,10 @@
import java.util.Collection;
import java.util.Comparator;
import java.util.stream.Collectors;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import java.time.Instant;

public class RotatingS3KeyProvider implements StoreReader<Map<Integer, S3Key>> {
Expand Down Expand Up @@ -90,7 +93,7 @@ public List<S3Key> getKeys(int siteId) {
public Collection<S3Key> getKeysForSite(Integer siteId) {
Map<Integer, S3Key> allKeys = getAll();
return allKeys.values().stream()
.filter(key -> key.getSiteId()==(siteId))
.filter(key -> key.getSiteId() == (siteId))
.collect(Collectors.toList());
}

Expand All @@ -106,4 +109,4 @@ public S3Key getEncryptionKeyForSite(Integer siteId) {
.max(Comparator.comparingLong(S3Key::getCreated))
.orElseThrow(() -> new IllegalStateException("No active keys found for site ID: " + siteId));
}
}
}

0 comments on commit 2da9647

Please sign in to comment.