Skip to content

Commit 0bd11ab

Browse files
author
Anirav Kareddy
committed
added modifyMaterials() method to RawKeyring since common functionality between sub-classes AES + RSA Keyrings
1 parent 7db7d6b commit 0bd11ab

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/main/java/software/amazon/encryption/s3/materials/RawKeyring.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,13 +20,17 @@ public MaterialsDescription materialsDescription() {
2020
public boolean reEncryptInstructionFile() {
2121
return _reEncryptInstructionFile;
2222
}
23+
public EncryptionMaterials modifyMaterials(EncryptionMaterials materials) {
24+
warnIfEncryptionContextIsPresent(materials);
25+
26+
return materials;
27+
}
2328
public void warnIfEncryptionContextIsPresent(EncryptionMaterials materials) {
2429
materials.s3Request().overrideConfiguration()
2530
.flatMap(overrideConfiguration ->
2631
overrideConfiguration.executionAttributes()
2732
.getOptionalAttribute(S3EncryptionClient.ENCRYPTION_CONTEXT))
2833
.ifPresent(ctx -> LogFactory.getLog(getClass()).warn("Usage of Encryption Context provides no security benefit in " + getClass().getSimpleName()));
29-
3034
}
3135
public static abstract class Builder<KeyringT extends RawKeyring, BuilderT extends Builder<KeyringT, BuilderT>>
3236
extends S3Keyring.Builder<KeyringT, BuilderT> {

0 commit comments

Comments
 (0)