You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@isis.apache.org by da...@apache.org on 2016/11/29 17:46:11 UTC

[1/4] isis git commit: ISIS-1543: obfuscate passwords if logged

Repository: isis
Updated Branches:
  refs/heads/master 9bec8018e -> ad6b299cc


ISIS-1543: obfuscate passwords if logged


Project: http://git-wip-us.apache.org/repos/asf/isis/repo
Commit: http://git-wip-us.apache.org/repos/asf/isis/commit/39e64c9a
Tree: http://git-wip-us.apache.org/repos/asf/isis/tree/39e64c9a
Diff: http://git-wip-us.apache.org/repos/asf/isis/diff/39e64c9a

Branch: refs/heads/master
Commit: 39e64c9a2d9e94964323801993eb16ba3c45c254
Parents: 506babf
Author: Dan Haywood <da...@haywood-associates.co.uk>
Authored: Tue Nov 29 17:42:54 2016 +0000
Committer: Dan Haywood <da...@haywood-associates.co.uk>
Committed: Tue Nov 29 17:42:54 2016 +0000

----------------------------------------------------------------------
 .../config/IsisConfigurationDefault.java        | 20 +++++++++----
 .../IsisConfigurationDefault_safe_Test.java     | 31 ++++++++++++++++++++
 2 files changed, 46 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/isis/blob/39e64c9a/core/metamodel/src/main/java/org/apache/isis/core/commons/config/IsisConfigurationDefault.java
----------------------------------------------------------------------
diff --git a/core/metamodel/src/main/java/org/apache/isis/core/commons/config/IsisConfigurationDefault.java b/core/metamodel/src/main/java/org/apache/isis/core/commons/config/IsisConfigurationDefault.java
index eab0876..f36bce2 100644
--- a/core/metamodel/src/main/java/org/apache/isis/core/commons/config/IsisConfigurationDefault.java
+++ b/core/metamodel/src/main/java/org/apache/isis/core/commons/config/IsisConfigurationDefault.java
@@ -28,6 +28,7 @@ import java.util.Map;
 import java.util.Properties;
 import java.util.StringTokenizer;
 
+import com.google.common.base.Strings;
 import com.google.common.collect.Lists;
 import com.google.common.collect.Maps;
 
@@ -151,7 +152,7 @@ public class IsisConfigurationDefault implements ConfigurationServiceInternal {
      */
     private void addPerPolicy(final String key, final String value, final ContainsPolicy policy) {
         if (value == null) {
-            LOG.debug("ignoring " + key + " as value is null");
+            LOG.debug("ignoring {} as value is null", key);
             return;
         }
         if (key == null) {
@@ -160,21 +161,30 @@ public class IsisConfigurationDefault implements ConfigurationServiceInternal {
         if (properties.containsKey(key)) {
             switch (policy) {
             case IGNORE:
-                LOG.info("ignoring " + key + "=" + value + " as value already set (with " + properties.get(key) + ")" );
+                LOG.info("ignoring {}={} as value already set (with {})", key, value, properties.get(key));
                 break;
             case OVERWRITE:
-                LOG.info("overwriting " + key + "=" + value + " (previous value was " + properties.get(key) + ")" );
+                LOG.info("overwriting {}={} (previous value was {})", key, value, properties.get(key));
                 properties.put(key, value);
                 break;
             case EXCEPTION:
-                throw new IllegalStateException("Configuration already has a key " + key + ", value of " + properties.get(key) );
+                throw new IllegalStateException(String.format(
+                        "Configuration already has a key {}, value of {}%s, value of %s", key, properties.get(key)));
             }
         } else {
-            LOG.info("adding " + key + "=" + value);
+            LOG.info("adding {} = {}", key , safe(key, value));
             properties.put(key, value);
         }
     }
 
+    static String safe(final String key, final String value) {
+        return Strings.isNullOrEmpty(key)
+                ? value
+                : (key.toLowerCase().contains("password")
+                        ? "*******"
+                        : value);
+    }
+
     @Override
     public IsisConfiguration createSubset(final String prefix) {
         final IsisConfigurationDefault subset = new IsisConfigurationDefault(resourceStreamSource);

http://git-wip-us.apache.org/repos/asf/isis/blob/39e64c9a/core/metamodel/src/test/java/org/apache/isis/core/commons/config/IsisConfigurationDefault_safe_Test.java
----------------------------------------------------------------------
diff --git a/core/metamodel/src/test/java/org/apache/isis/core/commons/config/IsisConfigurationDefault_safe_Test.java b/core/metamodel/src/test/java/org/apache/isis/core/commons/config/IsisConfigurationDefault_safe_Test.java
new file mode 100644
index 0000000..14b1f02
--- /dev/null
+++ b/core/metamodel/src/test/java/org/apache/isis/core/commons/config/IsisConfigurationDefault_safe_Test.java
@@ -0,0 +1,31 @@
+package org.apache.isis.core.commons.config;
+
+import org.junit.Test;
+
+import static org.hamcrest.Matchers.equalTo;
+import static org.hamcrest.Matchers.is;
+import static org.junit.Assert.assertThat;
+
+public class IsisConfigurationDefault_safe_Test {
+
+    @Test
+    public void not_a_password() throws Exception {
+        assertThat(IsisConfigurationDefault.safe("foo", "bar"), is(equalTo("bar")));
+    }
+
+    @Test
+    public void a_password() throws Exception {
+        assertThat(IsisConfigurationDefault.safe("xyz.password.abc", "bar"), is(equalTo("*******")));
+    }
+
+    @Test
+    public void a_PassWord() throws Exception {
+        assertThat(IsisConfigurationDefault.safe("xyz.PassWord.abc", "bar"), is(equalTo("*******")));
+    }
+
+    @Test
+    public void is_null() throws Exception {
+        assertThat(IsisConfigurationDefault.safe(null, "bar"), is(equalTo("bar")));
+    }
+
+}
\ No newline at end of file


[4/4] isis git commit: Merge branch 'maint-1.13.2'

Posted by da...@apache.org.
Merge branch 'maint-1.13.2'


Project: http://git-wip-us.apache.org/repos/asf/isis/repo
Commit: http://git-wip-us.apache.org/repos/asf/isis/commit/ad6b299c
Tree: http://git-wip-us.apache.org/repos/asf/isis/tree/ad6b299c
Diff: http://git-wip-us.apache.org/repos/asf/isis/diff/ad6b299c

Branch: refs/heads/master
Commit: ad6b299cca73d47ba69459adba1a4c18c8b44307
Parents: 9bec801 c7af9fa
Author: Dan Haywood <da...@haywood-associates.co.uk>
Authored: Tue Nov 29 17:44:18 2016 +0000
Committer: Dan Haywood <da...@haywood-associates.co.uk>
Committed: Tue Nov 29 17:44:18 2016 +0000

----------------------------------------------------------------------
 .../config/IsisConfigurationDefault.java        | 20 +++++++++----
 .../IsisConfigurationDefault_safe_Test.java     | 31 ++++++++++++++++++++
 .../src/main/webapp/WEB-INF/isis.properties     |  2 +-
 .../src/main/webapp/WEB-INF/isis.properties     |  2 +-
 4 files changed, 48 insertions(+), 7 deletions(-)
----------------------------------------------------------------------



[3/4] isis git commit: ISIS-1538: recreating simpleapp archetype

Posted by da...@apache.org.
ISIS-1538: recreating simpleapp archetype


Project: http://git-wip-us.apache.org/repos/asf/isis/repo
Commit: http://git-wip-us.apache.org/repos/asf/isis/commit/c7af9fa3
Tree: http://git-wip-us.apache.org/repos/asf/isis/tree/c7af9fa3
Diff: http://git-wip-us.apache.org/repos/asf/isis/diff/c7af9fa3

Branch: refs/heads/master
Commit: c7af9fa320c792d9df4ca51a9e52f7f4051f36ce
Parents: c0c7d7b
Author: Dan Haywood <da...@haywood-associates.co.uk>
Authored: Tue Nov 29 17:43:36 2016 +0000
Committer: Dan Haywood <da...@haywood-associates.co.uk>
Committed: Tue Nov 29 17:43:36 2016 +0000

----------------------------------------------------------------------
 .../resources/archetype-resources/application/translations.pot     | 2 +-
 .../resources/archetype-resources/module-simple/translations.pot   | 2 +-
 .../webapp/src/main/webapp/WEB-INF/isis.properties                 | 2 +-
 .../src/test/resources/projects/basic/archetype.properties         | 2 +-
 4 files changed, 4 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/isis/blob/c7af9fa3/example/archetype/simpleapp/src/main/resources/archetype-resources/application/translations.pot
----------------------------------------------------------------------
diff --git a/example/archetype/simpleapp/src/main/resources/archetype-resources/application/translations.pot b/example/archetype/simpleapp/src/main/resources/archetype-resources/application/translations.pot
index 4b9de22..680928d 100644
--- a/example/archetype/simpleapp/src/main/resources/archetype-resources/application/translations.pot
+++ b/example/archetype/simpleapp/src/main/resources/archetype-resources/application/translations.pot
@@ -23,7 +23,7 @@
 msgid ""
 msgstr ""
 "Project-Id-Version: \n"
-"POT-Creation-Date: 2016-11-29 17:02:03+\n"
+"POT-Creation-Date: 2016-11-29 17:20:33+\n"
 "MIME-Version: 1.0\n"
 "Content-Type: text/plain; charset=UTF-8\n"
 "Content-Transfer-Encoding: 8bit\n"

http://git-wip-us.apache.org/repos/asf/isis/blob/c7af9fa3/example/archetype/simpleapp/src/main/resources/archetype-resources/module-simple/translations.pot
----------------------------------------------------------------------
diff --git a/example/archetype/simpleapp/src/main/resources/archetype-resources/module-simple/translations.pot b/example/archetype/simpleapp/src/main/resources/archetype-resources/module-simple/translations.pot
index 0dd372f..93cf153 100644
--- a/example/archetype/simpleapp/src/main/resources/archetype-resources/module-simple/translations.pot
+++ b/example/archetype/simpleapp/src/main/resources/archetype-resources/module-simple/translations.pot
@@ -23,7 +23,7 @@
 msgid ""
 msgstr ""
 "Project-Id-Version: \n"
-"POT-Creation-Date: 2016-11-29 17:01:58+\n"
+"POT-Creation-Date: 2016-11-29 17:20:27+\n"
 "MIME-Version: 1.0\n"
 "Content-Type: text/plain; charset=UTF-8\n"
 "Content-Transfer-Encoding: 8bit\n"

http://git-wip-us.apache.org/repos/asf/isis/blob/c7af9fa3/example/archetype/simpleapp/src/main/resources/archetype-resources/webapp/src/main/webapp/WEB-INF/isis.properties
----------------------------------------------------------------------
diff --git a/example/archetype/simpleapp/src/main/resources/archetype-resources/webapp/src/main/webapp/WEB-INF/isis.properties b/example/archetype/simpleapp/src/main/resources/archetype-resources/webapp/src/main/webapp/WEB-INF/isis.properties
index 612ef74..1393841 100644
--- a/example/archetype/simpleapp/src/main/resources/archetype-resources/webapp/src/main/webapp/WEB-INF/isis.properties
+++ b/example/archetype/simpleapp/src/main/resources/archetype-resources/webapp/src/main/webapp/WEB-INF/isis.properties
@@ -155,7 +155,7 @@ ${symbol_pound}
 ${symbol_pound} required by EmailServiceDefault
 ${symbol_pound}
 ${symbol_pound}isis.service.email.sender.address=some.valid@email.address
-${symbol_pound}isis.service.email.sender.password=the.password.for-isis.notification.email.sender.address
+${symbol_pound}isis.service.email.sender.password=the.password.for-isis.service.email.sender.address
 
 
 ${symbol_pound}

http://git-wip-us.apache.org/repos/asf/isis/blob/c7af9fa3/example/archetype/simpleapp/src/test/resources/projects/basic/archetype.properties
----------------------------------------------------------------------
diff --git a/example/archetype/simpleapp/src/test/resources/projects/basic/archetype.properties b/example/archetype/simpleapp/src/test/resources/projects/basic/archetype.properties
index ba5c1dd..193772e 100644
--- a/example/archetype/simpleapp/src/test/resources/projects/basic/archetype.properties
+++ b/example/archetype/simpleapp/src/test/resources/projects/basic/archetype.properties
@@ -1,4 +1,4 @@
-#Tue Nov 29 17:02:34 GMT 2016
+#Tue Nov 29 17:43:32 GMT 2016
 package=it.pkg
 version=0.1-SNAPSHOT
 groupId=archetype.it


[2/4] isis git commit: ISIS-1538: tiny fix to logging.properties in simpleapp application

Posted by da...@apache.org.
ISIS-1538: tiny fix to logging.properties in simpleapp application


Project: http://git-wip-us.apache.org/repos/asf/isis/repo
Commit: http://git-wip-us.apache.org/repos/asf/isis/commit/c0c7d7b4
Tree: http://git-wip-us.apache.org/repos/asf/isis/tree/c0c7d7b4
Diff: http://git-wip-us.apache.org/repos/asf/isis/diff/c0c7d7b4

Branch: refs/heads/master
Commit: c0c7d7b47efe39821ef68b80d4a893f49b5e0d71
Parents: 39e64c9
Author: Dan Haywood <da...@haywood-associates.co.uk>
Authored: Tue Nov 29 17:43:14 2016 +0000
Committer: Dan Haywood <da...@haywood-associates.co.uk>
Committed: Tue Nov 29 17:43:14 2016 +0000

----------------------------------------------------------------------
 .../simpleapp/webapp/src/main/webapp/WEB-INF/isis.properties       | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/isis/blob/c0c7d7b4/example/application/simpleapp/webapp/src/main/webapp/WEB-INF/isis.properties
----------------------------------------------------------------------
diff --git a/example/application/simpleapp/webapp/src/main/webapp/WEB-INF/isis.properties b/example/application/simpleapp/webapp/src/main/webapp/WEB-INF/isis.properties
index 5bcdd78..ffc07cc 100644
--- a/example/application/simpleapp/webapp/src/main/webapp/WEB-INF/isis.properties
+++ b/example/application/simpleapp/webapp/src/main/webapp/WEB-INF/isis.properties
@@ -152,7 +152,7 @@ isis.reflector.facet.domainObjectAnnotation.removingLifecycleEvent.postForDefaul
 # required by EmailServiceDefault
 #
 #isis.service.email.sender.address=some.valid@email.address
-#isis.service.email.sender.password=the.password.for-isis.notification.email.sender.address
+#isis.service.email.sender.password=the.password.for-isis.service.email.sender.address
 
 
 #