Skip to content

Commit

Permalink
move plaintext manager changes to another pr
Browse files Browse the repository at this point in the history
  • Loading branch information
ggershinsky committed Sep 20, 2023
1 parent ce09126 commit 436a29a
Showing 1 changed file with 4 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,29 +18,26 @@
*/
package org.apache.iceberg.encryption;

import java.nio.ByteBuffer;
import org.apache.iceberg.io.InputFile;
import org.apache.iceberg.io.OutputFile;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

public class PlaintextEncryptionManager implements EncryptionManager {
private static final EncryptionManager INSTANCE = new PlaintextEncryptionManager();
private static final Logger LOG = LoggerFactory.getLogger(PlaintextEncryptionManager.class);

public static EncryptionManager instance() {
return INSTANCE;
}

@Override
public InputFile decrypt(EncryptedInputFile encrypted) {
if (encrypted.keyMetadata().buffer() != null) {
LOG.warn("File encryption key metadata is present, but no encryption has been configured.");
LOG.warn(
"File encryption key metadata is present, but currently using PlaintextEncryptionManager.");
}
return encrypted.encryptedInputFile();
}

@Override
public EncryptedOutputFile encrypt(OutputFile rawOutput) {
return EncryptedFiles.encryptedOutput(rawOutput, EncryptionKeyMetadata.empty());
return EncryptedFiles.encryptedOutput(rawOutput, (ByteBuffer) null);
}
}

0 comments on commit 436a29a

Please sign in to comment.