Repository: EnMasseProject/enmasse
Pull request #2413 (2019-03-06 12:02:51)

Update keycloak login page field names in system tests
Bump keycloak-connect nodejs library

k-wall: @enmasse-ci run tests testcase=io.enmasse.systemtest.standard.web.FirefoxWebConsoleTest

Patch:
diff --git a/agent/lib/auth_utils.js b/agent/lib/auth_utils.js
index 2787aa88d..ffc1e474d 100644
--- a/agent/lib/auth_utils.js
+++ b/agent/lib/auth_utils.js
@@ -144,6 +144,10 @@ function patch(sessions, kc_idp_hint) {
                 log.info("Modified redirect: %s", target);
             }
 
+            if (!target) {
+                target = "/";
+            }
+            log.info("Sending redirect: %s", target);
             response.statusCode = 302;
             response.setHeader('Location', target);
             response.end();
diff --git a/agent/npm-shrinkwrap.json b/agent/npm-shrinkwrap.json
index b1ce0ff7b..37d1a9863 100644
--- a/agent/npm-shrinkwrap.json
+++ b/agent/npm-shrinkwrap.json
@@ -769,9 +769,9 @@
             "integrity": "sha1-nbe1lJatPzz+8wp1FC0tkwrXJlE="
         },
         "jwk-to-pem": {
-            "version": "1.2.6",
-            "resolved": "https://registry.npmjs.org/jwk-to-pem/-/jwk-to-pem-1.2.6.tgz",
-            "integrity": "sha1-1QfOzkAInFJI4J7GgmaiAwqcYyU=",
+            "version": "2.0.1",
+            "resolved": "https://registry.npmjs.org/jwk-to-pem/-/jwk-to-pem-2.0.1.tgz",
+            "integrity": "sha512-KKu0WuDDjqw2FlRFp9/vk9TMO/KvgpZVKzdhhYcNyy5OwE8dw9lOK5OQTQHIJ7m+HioI/4P44sAtVuDrQ8KQfw==",
             "requires": {
                 "asn1.js": "4.10.1",
                 "elliptic": "6.4.1",
@@ -779,11 +779,11 @@
             }
         },
         "keycloak-connect": {
-            "version": "3.4.3",
-            "resolved": "https://registry.npmjs.org/keycloak-connect/-/keycloak-connect-3.4.3.tgz",
-            "integrity": "sha1-Z3W1mRJdJNUk9uZKXlEv2gBpLE4=",
+            "version": "4.8.3",
+            "resolved": "https://registry.npmjs.org/keycloak-connect/-/keycloak-connect-4.8.3.tgz",
+            "integrity": "sha512-4MRRDmztHl2c1JiyxoZO3aAkqeYQ06gKUXJQ5BjL1RGZuqDs2I8vmSUL+ou4Gm0NamoJa87daT1NBg98ZW1mhw==",
             "requires": {
-                "jwk-to-pem": "1.2.6"
+                "jwk-to-pem": "2.0.1"
             }
         },
         "levn": {
diff --git a/agent/package.json b/agent/package.json
index 8e21ec848..2aebcf293 100644
--- a/agent/package.json
+++ b/agent/package.json
@@ -11,7 +11,7 @@
     "dependencies": {
         "debug": "^3.1.*",
         "rhea": ">=0.2.11",
-        "keycloak-connect": "3.4.3",
+        "keycloak-connect": "4.8.3",
         "ws": "*"
     },
     "devDependencies": {
diff --git a/pom.xml b/pom.xml
index ffc962410..64d516e9f 100644
--- a/pom.xml
+++ b/pom.xml
@@ -62,6 +62,7 @@
         <hamcrest.version>1.3</hamcrest.version>
         <junit.jupiter.version>5.4.0</junit.jupiter.version>
         <junit.platform.runner.version>1.4.0</junit.platform.runner.version>
+        <junit.platform.surefire.provider.version>1.3.2</junit.platform.surefire.provider.version>
         <junit.platform.launcher.version>1.4.0</junit.platform.launcher.version>
         <artemis.version>2.6.4</artemis.version>
         <ngwebdriver.version>1.1.4</ngwebdriver.version>
@@ -843,6 +844,13 @@
                       <vertx.logger-delegate-factory-class-name>io.vertx.core.logging.SLF4JLogDelegateFactory</vertx.logger-delegate-factory-class-name>
                     </systemPropertyVariables>
                 </configuration>
+                <dependencies>
+                  <dependency>
+                    <groupId>org.junit.platform</groupId>
+                    <artifactId>junit-platform-surefire-provider</artifactId>
+                    <version>${junit.platform.surefire.provider.version}</version>
+                  </dependency>
+                </dependencies>
             </plugin>
             <plugin>
                 <groupId>com.mycila</groupId>
diff --git a/templates/enmasse-controller-manager/010-ServiceAccount-enmasse-controller-manager b/templates/enmasse-controller-manager/010-ServiceAccount-enmasse-controller-manager
new file mode 100644
index 000000000..8042ab7f6
--- /dev/null
+++ b/templates/enmasse-controller-manager/010-ServiceAccount-enmasse-controller-manager
@@ -0,0 +1,6 @@
+apiVersion: v1
+kind: ServiceAccount
+metadata:
+  name: enmasse-controller-manager
+  labels:
+    app: enmasse
diff --git a/templates/enmasse-controller-manager/020-Role-enmasse-controller-manager.yaml b/templates/enmasse-controller-manager/020-Role-enmasse-controller-manager.yaml
new file mode 100644
index 000000000..190dbc8ee
--- /dev/null
+++ b/templates/enmasse-controller-manager/020-Role-enmasse-controller-manager.yaml
@@ -0,0 +1,13 @@
+apiVersion: rbac.authorization.k8s.io/v1
+kind: Role
+metadata:
+  labels:
+    app: enmasse
+  name: enmasse.io:enmasse-controller-manager
+rules:
+  - apiGroups: [ "admin.enmasse.io" ]
+    resources: [ "authenticationservice" ]
+    verbs: [ "get", "list", "watch", "update", "create", "patch" ]
+  - apiGroups: [ "iot.enmasse.io" ]
+    resources: [ "iotconfig" ]
+    verbs: [ "get", "list", "watch", "update", "create", "patch" ]
diff --git a/templates/enmasse-controller-manager/030-Deployment-enmasse-controller-manager.yaml b/templates/enmasse-controller-manager/030-Deployment-enmasse-controller-manager.yaml
index 422214b91..e8b8a9da7 100644
--- a/templates/enmasse-controller-manager/030-Deployment-enmasse-controller-manager.yaml
+++ b/templates/enmasse-controller-manager/030-Deployment-enmasse-controller-manager.yaml
@@ -17,6 +17,7 @@ spec:
         app: enmasse
         name: enmasse-controller-manager
     spec:
+      serviceAccountName: enmasse-controller-manager
       containers:
       - name: controller
         image: ${ENMASSE_CONTROLLER_MANAGER_IMAGE}
diff --git a/templates/enmasse-controller-manager/030-RoleBinding-enmasse-controller-manager.yaml b/templates/enmasse-controller-manager/030-RoleBinding-enmasse-controller-manager.yaml
new file mode 100644
index 000000000..26638582b
--- /dev/null
+++ b/templates/enmasse-controller-manager/030-RoleBinding-enmasse-controller-manager.yaml
@@ -0,0 +1,14 @@
+apiVersion: rbac.authorization.k8s.io/v1
+kind: RoleBinding
+metadata:
+  name: enmasse-controller-manager
+  labels:
+    app: enmasse
+roleRef:
+  apiGroup: rbac.authorization.k8s.io
+  kind: Role
+  name: enmasse.io:enmasse-controller-manager
+subjects:
+- kind: ServiceAccount
+  name: enmasse-controller-manager
+  namespace: ${NAMESPACE}


Test patch:
diff --git a/systemtests/pom.xml b/systemtests/pom.xml
index 2ca34b816..24b0d0b8e 100644
--- a/systemtests/pom.xml
+++ b/systemtests/pom.xml
@@ -124,6 +124,13 @@
                         <enmasse.version>${release.version}</enmasse.version>
                     </systemProperties>
                 </configuration>
+                <dependencies>
+                  <dependency>
+                    <groupId>org.junit.platform</groupId>
+                    <artifactId>junit-platform-surefire-provider</artifactId>
+                    <version>${junit.platform.surefire.provider.version}</version>
+                  </dependency>
+                </dependencies>
             </plugin>
             <plugin>
                 <groupId>org.owasp</groupId>
diff --git a/systemtests/src/main/java/io/enmasse/systemtest/selenium/page/OpenshiftLoginWebPage.java b/systemtests/src/main/java/io/enmasse/systemtest/selenium/page/OpenshiftLoginWebPage.java
index c6b79420c..072349cb8 100644
--- a/systemtests/src/main/java/io/enmasse/systemtest/selenium/page/OpenshiftLoginWebPage.java
+++ b/systemtests/src/main/java/io/enmasse/systemtest/selenium/page/OpenshiftLoginWebPage.java
@@ -24,11 +24,11 @@ public class OpenshiftLoginWebPage implements IWebPage {
     }
 
     private WebElement getUsernameTextInput() {
-        return selenium.getDriver().findElement(By.id("inputUsername"));
+        return selenium.getDriver().findElement(By.id("username"));
     }
 
     private WebElement getPasswordTextInput() {
-        return selenium.getDriver().findElement(By.id("inputPassword"));
+        return selenium.getDriver().findElement(By.id("password"));
     }
 
     private WebElement getLoginButton() {