You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@brooklyn.apache.org by he...@apache.org on 2017/09/13 17:02:16 UTC
[1/3] brooklyn-library git commit: use external config provider for
demo passwords
Repository: brooklyn-library
Updated Branches:
refs/heads/master b4f1eaf1f -> 798ef11d9
use external config provider for demo passwords
Project: http://git-wip-us.apache.org/repos/asf/brooklyn-library/repo
Commit: http://git-wip-us.apache.org/repos/asf/brooklyn-library/commit/a4a7de9e
Tree: http://git-wip-us.apache.org/repos/asf/brooklyn-library/tree/a4a7de9e
Diff: http://git-wip-us.apache.org/repos/asf/brooklyn-library/diff/a4a7de9e
Branch: refs/heads/master
Commit: a4a7de9e4c28a69d7021f51ed7f8a081b96067f2
Parents: e6eb89a
Author: Alex Heneveld <al...@cloudsoftcorp.com>
Authored: Fri Sep 8 14:15:47 2017 +0100
Committer: Alex Heneveld <al...@cloudsoftcorp.com>
Committed: Fri Sep 8 14:16:33 2017 +0100
----------------------------------------------------------------------
.../main/resources/visitors-creation-script.sql | 18 +++++++++++-------
.../qa/camp/JavaWebAppsIntegrationTest.java | 10 +++++-----
.../java-web-app-and-db-with-function.yaml | 5 ++++-
.../resources/java-web-app-and-db-with-policy.bom | 5 ++++-
.../java-web-app-and-db-with-policy.yaml | 5 ++++-
5 files changed, 28 insertions(+), 15 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/brooklyn-library/blob/a4a7de9e/examples/simple-web-cluster/src/main/resources/visitors-creation-script.sql
----------------------------------------------------------------------
diff --git a/examples/simple-web-cluster/src/main/resources/visitors-creation-script.sql b/examples/simple-web-cluster/src/main/resources/visitors-creation-script.sql
index 2422f8f..304c060 100644
--- a/examples/simple-web-cluster/src/main/resources/visitors-creation-script.sql
+++ b/examples/simple-web-cluster/src/main/resources/visitors-creation-script.sql
@@ -19,18 +19,22 @@
create database visitors;
use visitors;
-# not necessary to create user if we grant (and not supported in some dialects)
-# create user 'brooklyn' identified by 'br00k11n';
-
-grant usage on *.* to 'brooklyn'@'%' identified by 'br00k11n';
-
-# ''@localhost is sometimes set up, overriding brooklyn@'%', so do a second explicit grant
-grant usage on *.* to 'brooklyn'@'localhost' identified by 'br00k11n';
+# the below will create user (and note create user not supported in some dialects)
+grant usage on *.* to 'brooklyn'@'%' identified by '${config["creation.script.password"]}';
grant all privileges on visitors.* to 'brooklyn'@'%';
+# useful if sockets work also
+grant all privileges on visitors.* to 'brooklyn'@'localhost';
+
+# drop the anonymous users eg ''@'localhost' and sometimes other local hostnames
+# (necessary for same-host access as these are more restrictive rules that trump the wildcard above)
+delete from mysql.user where User='';
flush privileges;
+
+# and now the table for visitors
+
CREATE TABLE MESSAGES (
id BIGINT NOT NULL AUTO_INCREMENT,
NAME VARCHAR(30) NOT NULL,
http://git-wip-us.apache.org/repos/asf/brooklyn-library/blob/a4a7de9e/qa/src/test/java/org/apache/brooklyn/qa/camp/JavaWebAppsIntegrationTest.java
----------------------------------------------------------------------
diff --git a/qa/src/test/java/org/apache/brooklyn/qa/camp/JavaWebAppsIntegrationTest.java b/qa/src/test/java/org/apache/brooklyn/qa/camp/JavaWebAppsIntegrationTest.java
index e83b244..b3738ac 100644
--- a/qa/src/test/java/org/apache/brooklyn/qa/camp/JavaWebAppsIntegrationTest.java
+++ b/qa/src/test/java/org/apache/brooklyn/qa/camp/JavaWebAppsIntegrationTest.java
@@ -100,7 +100,7 @@ public class JavaWebAppsIntegrationTest {
Assert.assertEquals(app.getDisplayName(), "sample-single-jboss");
// locations set on AT in this yaml
- Assert.assertEquals(app.getLocations().size(), 1);
+ Asserts.assertSize(app.getLocations(), 1);
Set<Task<?>> tasks = BrooklynTaskTags.getTasksInEntityContext(brooklynMgmt.getExecutionManager(), app);
log.info("Waiting on "+tasks.size()+" task(s)");
@@ -147,8 +147,8 @@ public class JavaWebAppsIntegrationTest {
final Entity app = brooklynMgmt.getEntityManager().getEntity(assembly.getId());
log.info("App - "+app);
- // locations set on individual services here
- Assert.assertEquals(app.getLocations().size(), 0);
+ // locations set on root node
+ Asserts.assertSize(app.getLocations(), 1);
Iterator<ResolvableLink<PlatformComponent>> pcs = assembly.getPlatformComponents().links().iterator();
PlatformComponent pc1 = pcs.next().resolve();
@@ -208,8 +208,8 @@ public class JavaWebAppsIntegrationTest {
final Entity app = brooklynMgmt.getEntityManager().getEntity(assembly.getId());
log.info("App - "+app);
- // locations set on individual services here
- Assert.assertEquals(app.getLocations().size(), 0);
+ // locations set on root node
+ Asserts.assertSize(app.getLocations(), 1);
Set<Task<?>> tasks = BrooklynTaskTags.getTasksInEntityContext(brooklynMgmt.getExecutionManager(), app);
log.info("Waiting on "+tasks.size()+" task(s)");
http://git-wip-us.apache.org/repos/asf/brooklyn-library/blob/a4a7de9e/qa/src/test/resources/java-web-app-and-db-with-function.yaml
----------------------------------------------------------------------
diff --git a/qa/src/test/resources/java-web-app-and-db-with-function.yaml b/qa/src/test/resources/java-web-app-and-db-with-function.yaml
index 5f4f643..08cc6bd 100644
--- a/qa/src/test/resources/java-web-app-and-db-with-function.yaml
+++ b/qa/src/test/resources/java-web-app-and-db-with-function.yaml
@@ -27,9 +27,12 @@ services:
proxy.http.port: 9210+
java.sysprops:
brooklyn.example.db.url: $brooklyn:formatString("jdbc:%s%s?user=%s&password=%s",
- component("db").attributeWhenReady("datastore.url"), "visitors", "brooklyn", "br00k11n")
+ component("db").attributeWhenReady("datastore.url"), "visitors", "brooklyn",
+ $brooklyn:external("brooklyn-demo-sample", "hidden-brooklyn-password"))
- type: org.apache.brooklyn.entity.database.mysql.MySqlNode
id: db
name: My DB
creationScriptUrl: classpath://visitors-creation-script.sql
+ brooklyn.config:
+ creation.script.password: $brooklyn:external("brooklyn-demo-sample", "hidden-brooklyn-password")
http://git-wip-us.apache.org/repos/asf/brooklyn-library/blob/a4a7de9e/qa/src/test/resources/java-web-app-and-db-with-policy.bom
----------------------------------------------------------------------
diff --git a/qa/src/test/resources/java-web-app-and-db-with-policy.bom b/qa/src/test/resources/java-web-app-and-db-with-policy.bom
index fa43e70..9841738 100644
--- a/qa/src/test/resources/java-web-app-and-db-with-policy.bom
+++ b/qa/src/test/resources/java-web-app-and-db-with-policy.bom
@@ -36,7 +36,8 @@ brooklyn.catalog:
http://repo1.maven.org/maven2/org/apache/brooklyn/example/brooklyn-example-hello-world-sql-webapp/0.9.0/brooklyn-example-hello-world-sql-webapp-0.9.0.war
java.sysprops:
brooklyn.example.db.url: $brooklyn:formatString("jdbc:%s%s?user=%s&password=%s",
- component("db").attributeWhenReady("datastore.url"), "visitors", "brooklyn", "br00k11n")
+ component("db").attributeWhenReady("datastore.url"), "visitors", "brooklyn",
+ $brooklyn:external("brooklyn-demo-sample", "hidden-brooklyn-password"))
brooklyn.policies:
- type: org.apache.brooklyn.policy.autoscaling.AutoScalerPolicy
@@ -52,3 +53,5 @@ brooklyn.catalog:
name: My DB
creationScriptUrl:
https://raw.githubusercontent.com/apache/brooklyn-library/master/examples/simple-web-cluster/src/main/resources/visitors-creation-script.sql
+ brooklyn.config:
+ creation.script.password: $brooklyn:external("brooklyn-demo-sample", "hidden-brooklyn-password")
http://git-wip-us.apache.org/repos/asf/brooklyn-library/blob/a4a7de9e/qa/src/test/resources/java-web-app-and-db-with-policy.yaml
----------------------------------------------------------------------
diff --git a/qa/src/test/resources/java-web-app-and-db-with-policy.yaml b/qa/src/test/resources/java-web-app-and-db-with-policy.yaml
index 58d6121..1ea9005 100644
--- a/qa/src/test/resources/java-web-app-and-db-with-policy.yaml
+++ b/qa/src/test/resources/java-web-app-and-db-with-policy.yaml
@@ -26,7 +26,8 @@ services:
proxy.http.port: 9210+
java.sysprops:
brooklyn.example.db.url: $brooklyn:formatString("jdbc:%s%s?user=%s&password=%s",
- component("db").attributeWhenReady("datastore.url"), "visitors", "brooklyn", "br00k11n")
+ component("db").attributeWhenReady("datastore.url"), "visitors", "brooklyn",
+ $brooklyn:external("brooklyn-demo-sample", "hidden-brooklyn-password"))
brooklyn.policies:
- type: org.apache.brooklyn.policy.autoscaling.AutoScalerPolicy
@@ -42,4 +43,6 @@ services:
name: My DB
creationScriptUrl: classpath://visitors-creation-script.sql
# or https://raw.githubusercontent.com/apache/brooklyn-library/master/examples/simple-web-cluster/src/main/resources/visitors-creation-script.sql
+ brooklyn.config:
+ creation.script.password: $brooklyn:external("brooklyn-demo-sample", "hidden-brooklyn-password")
\ No newline at end of file
[2/3] brooklyn-library git commit: include default password in sql
for backwards compatibility
Posted by he...@apache.org.
include default password in sql for backwards compatibility
Project: http://git-wip-us.apache.org/repos/asf/brooklyn-library/repo
Commit: http://git-wip-us.apache.org/repos/asf/brooklyn-library/commit/e1be8f8a
Tree: http://git-wip-us.apache.org/repos/asf/brooklyn-library/tree/e1be8f8a
Diff: http://git-wip-us.apache.org/repos/asf/brooklyn-library/diff/e1be8f8a
Branch: refs/heads/master
Commit: e1be8f8ae40a19190972e71183ad4324f8f9b898
Parents: a4a7de9
Author: Alex Heneveld <al...@cloudsoftcorp.com>
Authored: Wed Sep 13 17:59:19 2017 +0100
Committer: Alex Heneveld <al...@cloudsoftcorp.com>
Committed: Wed Sep 13 17:59:19 2017 +0100
----------------------------------------------------------------------
.../src/main/resources/visitors-creation-script.sql | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/brooklyn-library/blob/e1be8f8a/examples/simple-web-cluster/src/main/resources/visitors-creation-script.sql
----------------------------------------------------------------------
diff --git a/examples/simple-web-cluster/src/main/resources/visitors-creation-script.sql b/examples/simple-web-cluster/src/main/resources/visitors-creation-script.sql
index 304c060..1640d1b 100644
--- a/examples/simple-web-cluster/src/main/resources/visitors-creation-script.sql
+++ b/examples/simple-web-cluster/src/main/resources/visitors-creation-script.sql
@@ -21,7 +21,9 @@ use visitors;
# the below will create user (and note create user not supported in some dialects)
-grant usage on *.* to 'brooklyn'@'%' identified by '${config["creation.script.password"]}';
+# default password specified for compatibility with older blueprints that don't provide config;
+# if your blueprint sets the password it can be removed here
+grant usage on *.* to 'brooklyn'@'%' identified by '${config["creation.script.password"]!"br00k11n"}';
grant all privileges on visitors.* to 'brooklyn'@'%';
# useful if sockets work also
grant all privileges on visitors.* to 'brooklyn'@'localhost';
[3/3] brooklyn-library git commit: This closes #124
Posted by he...@apache.org.
This closes #124
Project: http://git-wip-us.apache.org/repos/asf/brooklyn-library/repo
Commit: http://git-wip-us.apache.org/repos/asf/brooklyn-library/commit/798ef11d
Tree: http://git-wip-us.apache.org/repos/asf/brooklyn-library/tree/798ef11d
Diff: http://git-wip-us.apache.org/repos/asf/brooklyn-library/diff/798ef11d
Branch: refs/heads/master
Commit: 798ef11d9dea3647ee792ea3d05fcc3a9060c1a2
Parents: b4f1eaf e1be8f8
Author: Alex Heneveld <al...@cloudsoftcorp.com>
Authored: Wed Sep 13 18:01:42 2017 +0100
Committer: Alex Heneveld <al...@cloudsoftcorp.com>
Committed: Wed Sep 13 18:01:42 2017 +0100
----------------------------------------------------------------------
.../main/resources/visitors-creation-script.sql | 20 +++++++++++++-------
.../qa/camp/JavaWebAppsIntegrationTest.java | 10 +++++-----
.../java-web-app-and-db-with-function.yaml | 5 ++++-
.../java-web-app-and-db-with-policy.bom | 5 ++++-
.../java-web-app-and-db-with-policy.yaml | 5 ++++-
5 files changed, 30 insertions(+), 15 deletions(-)
----------------------------------------------------------------------