You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@sling.apache.org by ol...@apache.org on 2019/12/12 16:51:07 UTC

[sling-org-apache-sling-commons-crypto] branch master updated (57a163c -> f22ce8e)

This is an automated email from the ASF dual-hosted git repository.

olli pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-commons-crypto.git.


    from 57a163c  SLING-8884 Provide a file-based password provider
     new 0d680cc  SLING-8883 Provide a simple crypto API
     new d56ce8a  SLING-8885 Provide an extensible crypto implementation based on Jasypt
     new f22ce8e  SLING-8884 Provide a file-based password provider

The 3 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 .../apache/sling/commons/crypto/CryptoService.java | 10 +++++++-
 .../FilePasswordProviderConfiguration.java         |  5 ++--
 .../JasyptStandardPBEStringCryptoService.java      |  4 ++--
 ...tandardPBEStringCryptoServiceConfiguration.java | 28 +++++++++++++---------
 4 files changed, 31 insertions(+), 16 deletions(-)


[sling-org-apache-sling-commons-crypto] 03/03: SLING-8884 Provide a file-based password provider

Posted by ol...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

olli pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-commons-crypto.git

commit f22ce8ee678855950267da3fa441befdabaa6713
Author: Oliver Lietz <ol...@apache.org>
AuthorDate: Thu Dec 12 16:27:22 2019 +0100

    SLING-8884 Provide a file-based password provider
    
    Mark names configuration property as not required and remove default
---
 .../commons/crypto/internal/FilePasswordProviderConfiguration.java   | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/src/main/java/org/apache/sling/commons/crypto/internal/FilePasswordProviderConfiguration.java b/src/main/java/org/apache/sling/commons/crypto/internal/FilePasswordProviderConfiguration.java
index f7e6643..cefdfbe 100644
--- a/src/main/java/org/apache/sling/commons/crypto/internal/FilePasswordProviderConfiguration.java
+++ b/src/main/java/org/apache/sling/commons/crypto/internal/FilePasswordProviderConfiguration.java
@@ -29,9 +29,10 @@ import org.osgi.service.metatype.annotations.ObjectClassDefinition;
 
     @AttributeDefinition(
         name = "Names",
-        description = "names of this service"
+        description = "names of this service",
+        required = false
     )
-    String[] names() default {"default"};
+    String[] names() default {};
 
     @AttributeDefinition(
         name = "Path",


[sling-org-apache-sling-commons-crypto] 02/03: SLING-8885 Provide an extensible crypto implementation based on Jasypt

Posted by ol...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

olli pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-commons-crypto.git

commit d56ce8ac71a73e08042f3b1de697523b10e52777
Author: Oliver Lietz <ol...@apache.org>
AuthorDate: Thu Dec 12 16:23:05 2019 +0100

    SLING-8885 Provide an extensible crypto implementation based on Jasypt
    
    * Align parameter name to CryptoService interface
    * Mark some configuration properties as not required and remove defaults
---
 .../JasyptStandardPBEStringCryptoService.java      |  4 ++--
 ...tandardPBEStringCryptoServiceConfiguration.java | 28 +++++++++++++---------
 2 files changed, 19 insertions(+), 13 deletions(-)

diff --git a/src/main/java/org/apache/sling/commons/crypto/jasypt/internal/JasyptStandardPBEStringCryptoService.java b/src/main/java/org/apache/sling/commons/crypto/jasypt/internal/JasyptStandardPBEStringCryptoService.java
index c78e385..bd0830d 100644
--- a/src/main/java/org/apache/sling/commons/crypto/jasypt/internal/JasyptStandardPBEStringCryptoService.java
+++ b/src/main/java/org/apache/sling/commons/crypto/jasypt/internal/JasyptStandardPBEStringCryptoService.java
@@ -136,8 +136,8 @@ public class JasyptStandardPBEStringCryptoService implements CryptoService {
     }
 
     @Override
-    public @NotNull String decrypt(@NotNull final String message) {
-        return encryptor.decrypt(message);
+    public @NotNull String decrypt(@NotNull final String ciphertext) {
+        return encryptor.decrypt(ciphertext);
     }
 
 }
diff --git a/src/main/java/org/apache/sling/commons/crypto/jasypt/internal/JasyptStandardPBEStringCryptoServiceConfiguration.java b/src/main/java/org/apache/sling/commons/crypto/jasypt/internal/JasyptStandardPBEStringCryptoServiceConfiguration.java
index 46b5e8b..a1ff1d6 100644
--- a/src/main/java/org/apache/sling/commons/crypto/jasypt/internal/JasyptStandardPBEStringCryptoServiceConfiguration.java
+++ b/src/main/java/org/apache/sling/commons/crypto/jasypt/internal/JasyptStandardPBEStringCryptoServiceConfiguration.java
@@ -34,9 +34,10 @@ import static org.jasypt.encryption.pbe.StandardPBEByteEncryptor.DEFAULT_KEY_OBT
 
     @AttributeDefinition(
         name = "Names",
-        description = "names of this service"
+        description = "names of this service",
+        required = false
     )
-    String[] names() default {"default"};
+    String[] names() default {};
 
     @AttributeDefinition(
         name = "Algorithm",
@@ -52,7 +53,8 @@ import static org.jasypt.encryption.pbe.StandardPBEByteEncryptor.DEFAULT_KEY_OBT
 
     @AttributeDefinition(
         name = "Security Provider Name",
-        description = "name of the Security Provider"
+        description = "name of the Security Provider",
+        required = false
     )
     String securityProviderName();
 
@@ -68,27 +70,31 @@ import static org.jasypt.encryption.pbe.StandardPBEByteEncryptor.DEFAULT_KEY_OBT
 
     @AttributeDefinition(
         name = "Password Provider Target",
-        description = "filter expression to target a Password Provider"
+        description = "filter expression to target a Password Provider",
+        required = false
     )
-    String passwordProvider_target() default "*";
+    String passwordProvider_target();
 
     @AttributeDefinition(
         name = "Security Provider Target",
-        description = "filter expression to target a Security Provider"
+        description = "filter expression to target a Security Provider",
+        required = false
     )
-    String securityProvider_target() default "*";
+    String securityProvider_target();
 
     @AttributeDefinition(
         name = "IV Generator Target",
-        description = "filter expression to target an IV Generator"
+        description = "filter expression to target an IV Generator",
+        required = false
     )
-    String ivGenerator_target() default "*";
+    String ivGenerator_target();
 
     @AttributeDefinition(
         name = "Salt Generator Target",
-        description = "filter expression to target a Salt Generator"
+        description = "filter expression to target a Salt Generator",
+        required = false
     )
-    String saltGenerator_target() default "*";
+    String saltGenerator_target();
 
     String webconsole_configurationFactory_nameHint() default "{names} {algorithm}";
 


[sling-org-apache-sling-commons-crypto] 01/03: SLING-8883 Provide a simple crypto API

Posted by ol...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

olli pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-commons-crypto.git

commit 0d680ccfae43e24c5c9cb5bde108a10de4fab0b4
Author: Oliver Lietz <ol...@apache.org>
AuthorDate: Thu Dec 12 16:11:29 2019 +0100

    SLING-8883 Provide a simple crypto API
    
    * Rename parameter in method decrypt from message to ciphertext
    * Add some javadoc
---
 .../java/org/apache/sling/commons/crypto/CryptoService.java    | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/src/main/java/org/apache/sling/commons/crypto/CryptoService.java b/src/main/java/org/apache/sling/commons/crypto/CryptoService.java
index 017e2ef..aa4b424 100644
--- a/src/main/java/org/apache/sling/commons/crypto/CryptoService.java
+++ b/src/main/java/org/apache/sling/commons/crypto/CryptoService.java
@@ -24,8 +24,16 @@ import org.osgi.annotation.versioning.ProviderType;
 @ProviderType
 public interface CryptoService {
 
+    /**
+     * @param message The message to encrypt
+     * @return The encrypted message, the ciphertext
+     */
     @NotNull String encrypt(@NotNull final String message);
 
-    @NotNull String decrypt(@NotNull final String message);
+    /**
+     * @param ciphertext The encrypted message, the ciphertext to decrypt
+     * @return The decrypted message
+     */
+    @NotNull String decrypt(@NotNull final String ciphertext);
 
 }