Bug 3231 jolokia access should be controlled by aaa 76/28976/9
authorRyan Goulding <ryandgoulding@gmail.com>
Thu, 29 Oct 2015 18:48:59 +0000 (14:48 -0400)
committerGerrit Code Review <gerrit@opendaylight.org>
Tue, 17 Nov 2015 01:06:10 +0000 (01:06 +0000)
Due to unfortunate lack of support, we are going to have to just use
basic authentication from config file for now.  I have committed this
patch to upstream jolokia:
https://github.com/rhuss/jolokia/pull/225
which will unlock power for us to use AAA.  However, this won't be
available until a new release is cut on Jolokia's end.

The only options for jolokia-osgi bundle for authentication are basic
file authn (which is implemented in this proposed changeset) and JAAS.
ODL's JAAS is unencrypted and generally disregarded, so basic file
authN was chosen.  By default, the credentials are admin/admin.

Change-Id: I35770bcf13b3cb32e59685e9bbf0ef47d73d132f
Signed-off-by: Ryan Goulding <ryandgoulding@gmail.com>
features/extras/pom.xml
features/extras/src/main/features/features.xml
opendaylight/commons/jolokia/pom.xml [new file with mode: 0644]
opendaylight/commons/jolokia/src/main/resources/org.jolokia.osgi.cfg [new file with mode: 0644]
pom.xml

index 563f128..9fbe2df 100644 (file)
@@ -19,8 +19,8 @@
     <version>1.6.0-SNAPSHOT</version>
     <packaging>jar</packaging>
     <properties>
     <version>1.6.0-SNAPSHOT</version>
     <packaging>jar</packaging>
     <properties>
-        <jolokia-bridge.version>0.2.0-SNAPSHOT</jolokia-bridge.version>
-        <jolokia.version>1.1.4</jolokia.version>
+        <jolokia.version>1.3.1</jolokia.version>
+        <odl-jolokia-osgi.version>0.3.0-SNAPSHOT</odl-jolokia-osgi.version>
     </properties>
 
     <dependencies>
     </properties>
 
     <dependencies>
             <artifactId>jolokia-osgi</artifactId>
             <version>${jolokia.version}</version>
         </dependency>
             <artifactId>jolokia-osgi</artifactId>
             <version>${jolokia.version}</version>
         </dependency>
+        <dependency>
+            <groupId>org.opendaylight.controller</groupId>
+            <artifactId>odl-jolokia-osgi</artifactId>
+            <version>${odl-jolokia-osgi.version}</version>
+            <type>cfg</type>
+            <classifier>configuration</classifier>
+        </dependency>
     </dependencies>
 
     <scm>
     </dependencies>
 
     <scm>
index d83b378..99111e7 100644 (file)
@@ -19,6 +19,7 @@
         <feature version="${project.version}">odl-jolokia</feature>
     </feature>
     <feature name="odl-jolokia" version="${project.version}" description="Jolokia JMX/HTTP bridge">
         <feature version="${project.version}">odl-jolokia</feature>
     </feature>
     <feature name="odl-jolokia" version="${project.version}" description="Jolokia JMX/HTTP bridge">
+        <configfile finalname="/etc/org.jolokia.osgi.cfg">mvn:org.opendaylight.controller/odl-jolokia-osgi/{{VERSION}}/cfg/configuration</configfile>
         <feature>http</feature>
         <bundle>mvn:org.jolokia/jolokia-osgi/{{VERSION}}</bundle>
     </feature>
         <feature>http</feature>
         <bundle>mvn:org.jolokia/jolokia-osgi/{{VERSION}}</bundle>
     </feature>
diff --git a/opendaylight/commons/jolokia/pom.xml b/opendaylight/commons/jolokia/pom.xml
new file mode 100644 (file)
index 0000000..e1132dc
--- /dev/null
@@ -0,0 +1,47 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+  <modelVersion>4.0.0</modelVersion>
+  <parent>
+    <groupId>org.opendaylight.controller</groupId>
+    <artifactId>commons.opendaylight</artifactId>
+    <version>1.6.0-SNAPSHOT</version>
+    <relativePath>../opendaylight</relativePath>
+  </parent>
+
+  <artifactId>odl-jolokia-osgi</artifactId>
+  <version>0.3.0-SNAPSHOT</version>
+  <packaging>jar</packaging>
+
+  <build>
+    <plugins>
+      <plugin>
+        <groupId>org.codehaus.mojo</groupId>
+        <artifactId>build-helper-maven-plugin</artifactId>
+        <executions>
+          <execution>
+            <id>attach-artifacts</id>
+            <phase>package</phase>
+            <goals>
+              <goal>attach-artifact</goal>
+            </goals>
+            <configuration>
+              <artifacts>
+                <artifact>
+                  <file>${project.build.directory}/classes/org.jolokia.osgi.cfg</file>
+                  <type>cfg</type>
+                  <classifier>configuration</classifier>
+                </artifact>
+              </artifacts>
+            </configuration>
+          </execution>
+        </executions>
+      </plugin>
+    </plugins>
+  </build>
+  <scm>
+    <connection>scm:git:http://git.opendaylight.org/gerrit/controller.git</connection>
+    <developerConnection>scm:git:ssh://git.opendaylight.org:29418/controller.git</developerConnection>
+    <tag>HEAD</tag>
+    <url>https://wiki.opendaylight.org/view/OpenDaylight_Controller:Main</url>
+  </scm>
+</project>
diff --git a/opendaylight/commons/jolokia/src/main/resources/org.jolokia.osgi.cfg b/opendaylight/commons/jolokia/src/main/resources/org.jolokia.osgi.cfg
new file mode 100644 (file)
index 0000000..fdad9e9
--- /dev/null
@@ -0,0 +1,4 @@
+#ODL Default Jolokia Configuration File
+org.jolokia.authMode=basic
+org.jolokia.user=admin
+org.jolokia.password=admin
diff --git a/pom.xml b/pom.xml
index 9ea0abd..67ae2e9 100644 (file)
--- a/pom.xml
+++ b/pom.xml
@@ -33,6 +33,7 @@
     <module>opendaylight/commons/liblldp</module>
     <module>opendaylight/commons/enunciate-parent</module>
     <module>benchmark</module>
     <module>opendaylight/commons/liblldp</module>
     <module>opendaylight/commons/enunciate-parent</module>
     <module>benchmark</module>
+    <module>opendaylight/commons/jolokia</module>
 
     <!-- Karaf Distribution -->
     <module>karaf</module>
 
     <!-- Karaf Distribution -->
     <module>karaf</module>

©2013 OpenDaylight, A Linux Foundation Collaborative Project. All Rights Reserved.
OpenDaylight is a registered trademark of The OpenDaylight Project, Inc.
Linux Foundation and OpenDaylight are registered trademarks of the Linux Foundation.
Linux is a registered trademark of Linus Torvalds.