You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@accumulo.apache.org by GitBox <gi...@apache.org> on 2021/09/02 20:46:54 UTC

[GitHub] [accumulo] milleruntime commented on a change in pull request #2224: Versioned Properties - refactored to address PR comments

milleruntime commented on a change in pull request #2224:
URL: https://github.com/apache/accumulo/pull/2224#discussion_r701383398



##########
File path: server/base/src/test/java/org/apache/accumulo/server/conf/codec/VersionedPropEncryptCodec.java
##########
@@ -0,0 +1,240 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.accumulo.server.conf.codec;
+
+import static org.apache.accumulo.server.conf.codec.EncodingOptions.EXPERIMENTAL_CIPHER_ENCODING_1_0;
+
+import java.io.ByteArrayOutputStream;
+import java.io.DataInputStream;
+import java.io.DataOutputStream;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.OutputStream;
+import java.security.InvalidAlgorithmParameterException;
+import java.security.InvalidKeyException;
+import java.security.NoSuchAlgorithmException;
+import java.security.SecureRandom;
+import java.security.spec.InvalidKeySpecException;
+import java.security.spec.KeySpec;
+import java.util.Map;
+import java.util.zip.GZIPInputStream;
+import java.util.zip.GZIPOutputStream;
+
+import javax.crypto.Cipher;
+import javax.crypto.CipherInputStream;
+import javax.crypto.CipherOutputStream;
+import javax.crypto.NoSuchPaddingException;
+import javax.crypto.SecretKey;
+import javax.crypto.SecretKeyFactory;
+import javax.crypto.spec.GCMParameterSpec;
+import javax.crypto.spec.PBEKeySpec;
+import javax.crypto.spec.SecretKeySpec;
+
+/**
+ * EXPERIMENTAL - demonstrates using an alternate encoding scheme. The sample is completely
+ * functional, however, certain elements such as password / key handling may not be suitable for
+ * production. The encoding version is EXPERIMENTAL_CIPHER_ENCODING_1_0.
+ * <p>
+ * This codec uses AES algorithm in GCM mode for encryption to encode the property map that is
+ * stored in the external store.
+ */
+public class VersionedPropEncryptCodec extends VersionedPropCodec {

Review comment:
       Could make the `@Experimental` annotation public and use it here. It is currently only used by `Property` keys but I don't see why we couldn't use it elsewhere in places like here.
   
   Also, I noticed this class is in the Test package. I am not sure that was intentional or not. If you put it in Test because its experimental, maybe using the annotation would make you feel better about putting it with the other codecs.




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@accumulo.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org