cayenne-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From aadamc...@apache.org
Subject svn commit: r1582974 - in /cayenne/main/trunk/cayenne-crypto/src: main/java/org/apache/cayenne/crypto/ main/java/org/apache/cayenne/crypto/transformer/ main/java/org/apache/cayenne/crypto/transformer/value/ test/java/org/apache/cayenne/crypto/unit/
Date Sat, 29 Mar 2014 10:28:49 GMT
Author: aadamchik
Date: Sat Mar 29 10:28:48 2014
New Revision: 1582974

URL: http://svn.apache.org/r1582974
Log:
CAY-1916 cayenne-crypto module that enables data encryption for certain model attributes

moving valueTransformer-related stuff into own package

Added:
    cayenne/main/trunk/cayenne-crypto/src/main/java/org/apache/cayenne/crypto/transformer/value/
    cayenne/main/trunk/cayenne-crypto/src/main/java/org/apache/cayenne/crypto/transformer/value/JceTransformerFactory.java
      - copied, changed from r1582771, cayenne/main/trunk/cayenne-crypto/src/main/java/org/apache/cayenne/crypto/transformer/ValueTransformer.java
    cayenne/main/trunk/cayenne-crypto/src/main/java/org/apache/cayenne/crypto/transformer/value/ValueTransformer.java
      - copied, changed from r1582771, cayenne/main/trunk/cayenne-crypto/src/main/java/org/apache/cayenne/crypto/transformer/ValueTransformer.java
    cayenne/main/trunk/cayenne-crypto/src/main/java/org/apache/cayenne/crypto/transformer/value/ValueTransformerFactory.java
      - copied, changed from r1582771, cayenne/main/trunk/cayenne-crypto/src/main/java/org/apache/cayenne/crypto/transformer/ValueTransformerFactory.java
Removed:
    cayenne/main/trunk/cayenne-crypto/src/main/java/org/apache/cayenne/crypto/transformer/ValueTransformer.java
    cayenne/main/trunk/cayenne-crypto/src/main/java/org/apache/cayenne/crypto/transformer/ValueTransformerFactory.java
Modified:
    cayenne/main/trunk/cayenne-crypto/src/main/java/org/apache/cayenne/crypto/CryptoModuleBuilder.java
    cayenne/main/trunk/cayenne-crypto/src/main/java/org/apache/cayenne/crypto/transformer/DefaultBindingsTransformer.java
    cayenne/main/trunk/cayenne-crypto/src/main/java/org/apache/cayenne/crypto/transformer/DefaultMapTransformer.java
    cayenne/main/trunk/cayenne-crypto/src/main/java/org/apache/cayenne/crypto/transformer/DefaultTransformerFactory.java
    cayenne/main/trunk/cayenne-crypto/src/test/java/org/apache/cayenne/crypto/unit/Rot13TransformerFactory.java

Modified: cayenne/main/trunk/cayenne-crypto/src/main/java/org/apache/cayenne/crypto/CryptoModuleBuilder.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/cayenne-crypto/src/main/java/org/apache/cayenne/crypto/CryptoModuleBuilder.java?rev=1582974&r1=1582973&r2=1582974&view=diff
==============================================================================
--- cayenne/main/trunk/cayenne-crypto/src/main/java/org/apache/cayenne/crypto/CryptoModuleBuilder.java
(original)
+++ cayenne/main/trunk/cayenne-crypto/src/main/java/org/apache/cayenne/crypto/CryptoModuleBuilder.java
Sat Mar 29 10:28:48 2014
@@ -27,7 +27,7 @@ import org.apache.cayenne.crypto.map.Col
 import org.apache.cayenne.crypto.reader.CryptoRowReaderFactoryDecorator;
 import org.apache.cayenne.crypto.transformer.DefaultTransformerFactory;
 import org.apache.cayenne.crypto.transformer.TransformerFactory;
-import org.apache.cayenne.crypto.transformer.ValueTransformerFactory;
+import org.apache.cayenne.crypto.transformer.value.ValueTransformerFactory;
 import org.apache.cayenne.di.Binder;
 import org.apache.cayenne.di.Module;
 

Modified: cayenne/main/trunk/cayenne-crypto/src/main/java/org/apache/cayenne/crypto/transformer/DefaultBindingsTransformer.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/cayenne-crypto/src/main/java/org/apache/cayenne/crypto/transformer/DefaultBindingsTransformer.java?rev=1582974&r1=1582973&r2=1582974&view=diff
==============================================================================
--- cayenne/main/trunk/cayenne-crypto/src/main/java/org/apache/cayenne/crypto/transformer/DefaultBindingsTransformer.java
(original)
+++ cayenne/main/trunk/cayenne-crypto/src/main/java/org/apache/cayenne/crypto/transformer/DefaultBindingsTransformer.java
Sat Mar 29 10:28:48 2014
@@ -21,6 +21,7 @@ package org.apache.cayenne.crypto.transf
 import javax.crypto.Cipher;
 
 import org.apache.cayenne.access.translator.batch.BatchParameterBinding;
+import org.apache.cayenne.crypto.transformer.value.ValueTransformer;
 
 /**
  * @since 3.2

Modified: cayenne/main/trunk/cayenne-crypto/src/main/java/org/apache/cayenne/crypto/transformer/DefaultMapTransformer.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/cayenne-crypto/src/main/java/org/apache/cayenne/crypto/transformer/DefaultMapTransformer.java?rev=1582974&r1=1582973&r2=1582974&view=diff
==============================================================================
--- cayenne/main/trunk/cayenne-crypto/src/main/java/org/apache/cayenne/crypto/transformer/DefaultMapTransformer.java
(original)
+++ cayenne/main/trunk/cayenne-crypto/src/main/java/org/apache/cayenne/crypto/transformer/DefaultMapTransformer.java
Sat Mar 29 10:28:48 2014
@@ -22,6 +22,11 @@ import java.util.Map;
 
 import javax.crypto.Cipher;
 
+import org.apache.cayenne.crypto.transformer.value.ValueTransformer;
+
+/**
+ * @since 3.2
+ */
 public class DefaultMapTransformer implements MapTransformer {
 
     private String[] keys;

Modified: cayenne/main/trunk/cayenne-crypto/src/main/java/org/apache/cayenne/crypto/transformer/DefaultTransformerFactory.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/cayenne-crypto/src/main/java/org/apache/cayenne/crypto/transformer/DefaultTransformerFactory.java?rev=1582974&r1=1582973&r2=1582974&view=diff
==============================================================================
--- cayenne/main/trunk/cayenne-crypto/src/main/java/org/apache/cayenne/crypto/transformer/DefaultTransformerFactory.java
(original)
+++ cayenne/main/trunk/cayenne-crypto/src/main/java/org/apache/cayenne/crypto/transformer/DefaultTransformerFactory.java
Sat Mar 29 10:28:48 2014
@@ -26,9 +26,14 @@ import org.apache.cayenne.access.jdbc.Co
 import org.apache.cayenne.access.translator.batch.BatchParameterBinding;
 import org.apache.cayenne.crypto.cipher.CipherFactory;
 import org.apache.cayenne.crypto.map.ColumnMapper;
+import org.apache.cayenne.crypto.transformer.value.ValueTransformer;
+import org.apache.cayenne.crypto.transformer.value.ValueTransformerFactory;
 import org.apache.cayenne.di.Inject;
 import org.apache.cayenne.map.DbAttribute;
 
+/**
+ * @since 3.2
+ */
 public class DefaultTransformerFactory implements TransformerFactory {
 
     private CipherFactory cipherFactory;

Copied: cayenne/main/trunk/cayenne-crypto/src/main/java/org/apache/cayenne/crypto/transformer/value/JceTransformerFactory.java
(from r1582771, cayenne/main/trunk/cayenne-crypto/src/main/java/org/apache/cayenne/crypto/transformer/ValueTransformer.java)
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/cayenne-crypto/src/main/java/org/apache/cayenne/crypto/transformer/value/JceTransformerFactory.java?p2=cayenne/main/trunk/cayenne-crypto/src/main/java/org/apache/cayenne/crypto/transformer/value/JceTransformerFactory.java&p1=cayenne/main/trunk/cayenne-crypto/src/main/java/org/apache/cayenne/crypto/transformer/ValueTransformer.java&r1=1582771&r2=1582974&rev=1582974&view=diff
==============================================================================
--- cayenne/main/trunk/cayenne-crypto/src/main/java/org/apache/cayenne/crypto/transformer/ValueTransformer.java
(original)
+++ cayenne/main/trunk/cayenne-crypto/src/main/java/org/apache/cayenne/crypto/transformer/value/JceTransformerFactory.java
Sat Mar 29 10:28:48 2014
@@ -16,16 +16,29 @@
  *  specific language governing permissions and limitations
  *  under the License.
  ****************************************************************/
-package org.apache.cayenne.crypto.transformer;
-
-import javax.crypto.Cipher;
+package org.apache.cayenne.crypto.transformer.value;
 
 /**
- * An encryptor or decryptor of a single value.
+ * A {@link ValueTransformerFactory} that creates encryptors/decryptors that are
+ * taking advantage of the JCE (Java Cryptography Extension) ciphers.
  * 
  * @since 3.2
  */
-public interface ValueTransformer {
+public class JceTransformerFactory implements ValueTransformerFactory {
+
+    public JceTransformerFactory() {
+        // TODO Auto-generated constructor stub
+    }
+
+    @Override
+    public ValueTransformer decryptor(int jdbcType) {
+        // TODO Auto-generated method stub
+        return null;
+    }
+
+    @Override
+    public ValueTransformer encryptor(int jdbcType) {
+        throw new UnsupportedOperationException("TODO");
+    }
 
-    Object transform(Cipher cipher, Object value);
 }

Copied: cayenne/main/trunk/cayenne-crypto/src/main/java/org/apache/cayenne/crypto/transformer/value/ValueTransformer.java
(from r1582771, cayenne/main/trunk/cayenne-crypto/src/main/java/org/apache/cayenne/crypto/transformer/ValueTransformer.java)
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/cayenne-crypto/src/main/java/org/apache/cayenne/crypto/transformer/value/ValueTransformer.java?p2=cayenne/main/trunk/cayenne-crypto/src/main/java/org/apache/cayenne/crypto/transformer/value/ValueTransformer.java&p1=cayenne/main/trunk/cayenne-crypto/src/main/java/org/apache/cayenne/crypto/transformer/ValueTransformer.java&r1=1582771&r2=1582974&rev=1582974&view=diff
==============================================================================
--- cayenne/main/trunk/cayenne-crypto/src/main/java/org/apache/cayenne/crypto/transformer/ValueTransformer.java
(original)
+++ cayenne/main/trunk/cayenne-crypto/src/main/java/org/apache/cayenne/crypto/transformer/value/ValueTransformer.java
Sat Mar 29 10:28:48 2014
@@ -16,7 +16,7 @@
  *  specific language governing permissions and limitations
  *  under the License.
  ****************************************************************/
-package org.apache.cayenne.crypto.transformer;
+package org.apache.cayenne.crypto.transformer.value;
 
 import javax.crypto.Cipher;
 

Copied: cayenne/main/trunk/cayenne-crypto/src/main/java/org/apache/cayenne/crypto/transformer/value/ValueTransformerFactory.java
(from r1582771, cayenne/main/trunk/cayenne-crypto/src/main/java/org/apache/cayenne/crypto/transformer/ValueTransformerFactory.java)
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/cayenne-crypto/src/main/java/org/apache/cayenne/crypto/transformer/value/ValueTransformerFactory.java?p2=cayenne/main/trunk/cayenne-crypto/src/main/java/org/apache/cayenne/crypto/transformer/value/ValueTransformerFactory.java&p1=cayenne/main/trunk/cayenne-crypto/src/main/java/org/apache/cayenne/crypto/transformer/ValueTransformerFactory.java&r1=1582771&r2=1582974&rev=1582974&view=diff
==============================================================================
--- cayenne/main/trunk/cayenne-crypto/src/main/java/org/apache/cayenne/crypto/transformer/ValueTransformerFactory.java
(original)
+++ cayenne/main/trunk/cayenne-crypto/src/main/java/org/apache/cayenne/crypto/transformer/value/ValueTransformerFactory.java
Sat Mar 29 10:28:48 2014
@@ -16,7 +16,7 @@
  *  specific language governing permissions and limitations
  *  under the License.
  ****************************************************************/
-package org.apache.cayenne.crypto.transformer;
+package org.apache.cayenne.crypto.transformer.value;
 
 /**
  * A factory that creates transformers for encryption/decryption of individual

Modified: cayenne/main/trunk/cayenne-crypto/src/test/java/org/apache/cayenne/crypto/unit/Rot13TransformerFactory.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/cayenne-crypto/src/test/java/org/apache/cayenne/crypto/unit/Rot13TransformerFactory.java?rev=1582974&r1=1582973&r2=1582974&view=diff
==============================================================================
--- cayenne/main/trunk/cayenne-crypto/src/test/java/org/apache/cayenne/crypto/unit/Rot13TransformerFactory.java
(original)
+++ cayenne/main/trunk/cayenne-crypto/src/test/java/org/apache/cayenne/crypto/unit/Rot13TransformerFactory.java
Sat Mar 29 10:28:48 2014
@@ -22,8 +22,8 @@ import java.io.UnsupportedEncodingExcept
 
 import javax.crypto.Cipher;
 
-import org.apache.cayenne.crypto.transformer.ValueTransformer;
-import org.apache.cayenne.crypto.transformer.ValueTransformerFactory;
+import org.apache.cayenne.crypto.transformer.value.ValueTransformer;
+import org.apache.cayenne.crypto.transformer.value.ValueTransformerFactory;
 
 public class Rot13TransformerFactory implements ValueTransformerFactory {
 



Mime
View raw message