You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@karaf.apache.org by gn...@apache.org on 2014/05/27 08:49:19 UTC
git commit: [KARAF-342] Merge webconsole branding package with
webconsole
Repository: karaf
Updated Branches:
refs/heads/master b4f8ee6f5 -> d100637fb
[KARAF-342] Merge webconsole branding package with webconsole
Project: http://git-wip-us.apache.org/repos/asf/karaf/repo
Commit: http://git-wip-us.apache.org/repos/asf/karaf/commit/d100637f
Tree: http://git-wip-us.apache.org/repos/asf/karaf/tree/d100637f
Diff: http://git-wip-us.apache.org/repos/asf/karaf/diff/d100637f
Branch: refs/heads/master
Commit: d100637fbb06d3d3a7bbb7c7c762fd0cceec43a3
Parents: b4f8ee6
Author: Guillaume Nodet <gn...@gmail.com>
Authored: Tue May 27 08:49:09 2014 +0200
Committer: Guillaume Nodet <gn...@gmail.com>
Committed: Tue May 27 08:49:09 2014 +0200
----------------------------------------------------------------------
assemblies/features/standard/pom.xml | 5 -
.../standard/src/main/feature/feature.xml | 1 -
pom.xml | 5 -
webconsole/branding/NOTICE | 71 ------
webconsole/branding/pom.xml | 99 --------
.../karaf/webconsole/JaasSecurityProvider.java | 213 ----------------
.../resources/META-INF/webconsole.properties | 38 ---
.../resources/OSGI-INF/blueprint/webconsole.xml | 46 ----
.../src/main/resources/OSGI-INF/bundle.info | 18 --
.../OSGI-INF/metatype/metatype.properties | 28 ---
.../resources/OSGI-INF/metatype/metatype.xml | 27 ---
.../main/resources/res/karaf/imgs/favicon.ico | Bin 1455 -> 0 bytes
.../src/main/resources/res/karaf/imgs/logo.png | Bin 20682 -> 0 bytes
.../main/resources/res/karaf/ui/webconsole.css | 193 ---------------
.../internal/JaasSecurityProvider.java | 240 +++++++++++++++++++
.../internal/KarafOsgiManagerActivator.java | 19 ++
.../resources/META-INF/webconsole.properties | 38 +++
.../OSGI-INF/metatype/metatype.properties | 28 +++
.../resources/OSGI-INF/metatype/metatype.xml | 27 +++
.../src/main/resources/res/karaf/imgs/logo.png | Bin 0 -> 20682 bytes
.../main/resources/res/karaf/ui/webconsole.css | 193 +++++++++++++++
webconsole/pom.xml | 1 -
22 files changed, 545 insertions(+), 745 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/karaf/blob/d100637f/assemblies/features/standard/pom.xml
----------------------------------------------------------------------
diff --git a/assemblies/features/standard/pom.xml b/assemblies/features/standard/pom.xml
index bad1015..0474f4d 100644
--- a/assemblies/features/standard/pom.xml
+++ b/assemblies/features/standard/pom.xml
@@ -311,11 +311,6 @@
</dependency>
<dependency>
<groupId>org.apache.karaf.webconsole</groupId>
- <artifactId>org.apache.karaf.webconsole.branding</artifactId>
- <scope>provided</scope>
- </dependency>
- <dependency>
- <groupId>org.apache.karaf.webconsole</groupId>
<artifactId>org.apache.karaf.webconsole.console</artifactId>
<scope>provided</scope>
</dependency>
http://git-wip-us.apache.org/repos/asf/karaf/blob/d100637f/assemblies/features/standard/src/main/feature/feature.xml
----------------------------------------------------------------------
diff --git a/assemblies/features/standard/src/main/feature/feature.xml b/assemblies/features/standard/src/main/feature/feature.xml
index 9f68409..b60c9e3 100644
--- a/assemblies/features/standard/src/main/feature/feature.xml
+++ b/assemblies/features/standard/src/main/feature/feature.xml
@@ -192,7 +192,6 @@
<feature>http</feature>
<feature>aries-blueprint</feature>
<bundle start-level="30">mvn:org.apache.felix/org.apache.felix.metatype/${felix.metatype.version}</bundle>
- <bundle start-level="30">mvn:org.apache.karaf.webconsole/org.apache.karaf.webconsole.branding/${project.version}</bundle>
<bundle start-level="30">mvn:org.apache.karaf.webconsole/org.apache.karaf.webconsole.console/${project.version}</bundle>
<bundle start-level="30">mvn:org.apache.karaf.webconsole/org.apache.karaf.webconsole.features/${project.version}</bundle>
<bundle start-level="30">mvn:org.apache.karaf.webconsole/org.apache.karaf.webconsole.gogo/${project.version}</bundle>
http://git-wip-us.apache.org/repos/asf/karaf/blob/d100637f/pom.xml
----------------------------------------------------------------------
diff --git a/pom.xml b/pom.xml
index 850c193..fe89cb4 100644
--- a/pom.xml
+++ b/pom.xml
@@ -641,11 +641,6 @@
</dependency>
<dependency>
<groupId>org.apache.karaf.webconsole</groupId>
- <artifactId>org.apache.karaf.webconsole.branding</artifactId>
- <version>${project.version}</version>
- </dependency>
- <dependency>
- <groupId>org.apache.karaf.webconsole</groupId>
<artifactId>org.apache.karaf.webconsole.console</artifactId>
<version>${project.version}</version>
</dependency>
http://git-wip-us.apache.org/repos/asf/karaf/blob/d100637f/webconsole/branding/NOTICE
----------------------------------------------------------------------
diff --git a/webconsole/branding/NOTICE b/webconsole/branding/NOTICE
deleted file mode 100644
index b70f1f9..0000000
--- a/webconsole/branding/NOTICE
+++ /dev/null
@@ -1,71 +0,0 @@
-Apache Karaf
-Copyright 2010-2014 The Apache Software Foundation
-
-
-I. Included Software
-
-This product includes software developed at
-The Apache Software Foundation (http://www.apache.org/).
-Licensed under the Apache License 2.0.
-
-This product uses software developed at
-The OSGi Alliance (http://www.osgi.org/).
-Copyright (c) OSGi Alliance (2000, 2010).
-Licensed under the Apache License 2.0.
-
-This product includes software developed at
-OW2 (http://www.ow2.org/).
-Licensed under the BSD License.
-
-This product includes software developed at
-OPS4J (http://www.ops4j.org/).
-Licensed under the Apache License 2.0.
-
-This product includes software developed at
-Eclipse Foundation (http://www.eclipse.org/).
-Licensed under the EPL.
-
-This product includes software written by
-Antony Lesuisse.
-Licensed under Public Domain.
-
-
-II. Used Software
-
-This product uses software developed at
-FUSE Source (http://www.fusesource.org/).
-Licensed under the Apache License 2.0.
-
-This product uses software developed at
-AOP Alliance (http://aopalliance.sourceforge.net/).
-Licensed under the Public Domain.
-
-This product uses software developed at
-Tanuki Software (http://www.tanukisoftware.com/).
-Licensed under the Apache License 2.0.
-
-This product uses software developed at
-Jasypt (http://jasypt.sourceforge.net/).
-Licensed under the Apache License 2.0.
-
-This product uses software developed at
-JLine (http://jline.sourceforge.net).
-Licensed under the BSD License.
-
-This product uses software developed at
-SLF4J (http://www.slf4j.org/).
-Licensed under the MIT License.
-
-This product uses software developed at
-SpringSource (http://www.springsource.org/).
-Licensed under the Apache License 2.0.
-
-This product includes software from http://www.json.org.
-Copyright (c) 2002 JSON.org
-
-
-III. License Summary
-- Apache License 2.0
-- BSD License
-- EPL License
-- MIT License
http://git-wip-us.apache.org/repos/asf/karaf/blob/d100637f/webconsole/branding/pom.xml
----------------------------------------------------------------------
diff --git a/webconsole/branding/pom.xml b/webconsole/branding/pom.xml
deleted file mode 100644
index 5ec04c6..0000000
--- a/webconsole/branding/pom.xml
+++ /dev/null
@@ -1,99 +0,0 @@
-<?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">
-
- <!--
-
- Licensed to the Apache Software Foundation (ASF) under one or more
- contributor license agreements. See the NOTICE file distributed with
- this work for additional information regarding copyright ownership.
- The ASF licenses this file to You under the Apache License, Version 2.0
- (the "License"); you may not use this file except in compliance with
- the License. You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
- -->
-
- <modelVersion>4.0.0</modelVersion>
-
- <parent>
- <groupId>org.apache.karaf.webconsole</groupId>
- <artifactId>webconsole</artifactId>
- <version>4.0.0-SNAPSHOT</version>
- <relativePath>../pom.xml</relativePath>
- </parent>
-
- <artifactId>org.apache.karaf.webconsole.branding</artifactId>
- <packaging>bundle</packaging>
- <name>Apache Karaf :: Web Console :: Branding</name>
- <description>This bundle provides Karaf branding for the Felix web console.</description>
-
- <properties>
- <appendedResourcesDirectory>${basedir}/../../etc/appended-resources</appendedResourcesDirectory>
- </properties>
-
- <dependencies>
- <dependency>
- <groupId>org.apache.karaf.webconsole</groupId>
- <artifactId>org.apache.karaf.webconsole.console</artifactId>
- </dependency>
- <dependency>
- <groupId>org.apache.felix</groupId>
- <artifactId>org.apache.felix.webconsole</artifactId>
- <scope>provided</scope>
- </dependency>
- <dependency>
- <groupId>org.slf4j</groupId>
- <artifactId>slf4j-api</artifactId>
- <scope>provided</scope>
- </dependency>
- </dependencies>
-
- <build>
- <resources>
- <resource>
- <directory>${project.basedir}/src/main/resources</directory>
- <includes>
- <include>**/*</include>
- </includes>
- </resource>
- <resource>
- <directory>${project.basedir}/src/main/resources</directory>
- <filtering>true</filtering>
- <includes>
- <include>**/*.info</include>
- </includes>
- </resource>
- </resources>
- <plugins>
- <plugin>
- <groupId>org.apache.felix</groupId>
- <artifactId>maven-bundle-plugin</artifactId>
- <version>${felix.plugin.version}</version>
- <extensions>true</extensions>
- <configuration>
- <instructions>
- <Bundle-DocURL>http://felix.apache.org/site/apache-karaf.html</Bundle-DocURL>
- <Fragment-Host>org.apache.karaf.webconsole.console;bundle-version="[4,5)"</Fragment-Host>
- <Export-Package>!*</Export-Package>
- <Import-Package>
- javax.servlet;version=2.4,
- javax.servlet.http;version=2.4,
- !org.apache.felix.webconsole*,
- org.apache.aries.blueprint,
- org.osgi.service.blueprint.container,
- org.osgi.service.blueprint.reflect,
- *
- </Import-Package>
- </instructions>
- </configuration>
- </plugin>
- </plugins>
- </build>
-
-</project>
http://git-wip-us.apache.org/repos/asf/karaf/blob/d100637f/webconsole/branding/src/main/java/org/apache/karaf/webconsole/JaasSecurityProvider.java
----------------------------------------------------------------------
diff --git a/webconsole/branding/src/main/java/org/apache/karaf/webconsole/JaasSecurityProvider.java b/webconsole/branding/src/main/java/org/apache/karaf/webconsole/JaasSecurityProvider.java
deleted file mode 100644
index ee8e30c..0000000
--- a/webconsole/branding/src/main/java/org/apache/karaf/webconsole/JaasSecurityProvider.java
+++ /dev/null
@@ -1,213 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.karaf.webconsole;
-
-import java.io.IOException;
-import java.io.UnsupportedEncodingException;
-import java.security.GeneralSecurityException;
-import java.security.Principal;
-import javax.security.auth.Subject;
-import javax.security.auth.callback.Callback;
-import javax.security.auth.callback.CallbackHandler;
-import javax.security.auth.callback.NameCallback;
-import javax.security.auth.callback.PasswordCallback;
-import javax.security.auth.callback.UnsupportedCallbackException;
-import javax.security.auth.login.AccountException;
-import javax.security.auth.login.FailedLoginException;
-import javax.security.auth.login.LoginContext;
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-
-import org.apache.felix.webconsole.WebConsoleSecurityProvider2;
-import org.apache.felix.webconsole.internal.KarafOsgiManager;
-import org.apache.felix.webconsole.internal.servlet.Base64;
-import org.osgi.service.http.HttpContext;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-public class JaasSecurityProvider implements WebConsoleSecurityProvider2 {
-
- private static final Logger LOG = LoggerFactory.getLogger(JaasSecurityProvider.class);
-
- private static final String HEADER_WWW_AUTHENTICATE = "WWW-Authenticate";
-
- private static final String HEADER_AUTHORIZATION = "Authorization";
-
- private static final String AUTHENTICATION_SCHEME_BASIC = "Basic";
-
- private String realm;
- private String role;
-
- public String getRealm() {
- return realm;
- }
-
- public void setRealm(String realm) {
- this.realm = realm;
- }
-
- public String getRole() {
- return role;
- }
-
- public void setRole(String role) {
- this.role = role;
- }
-
- public Object authenticate(final String username, final String password) {
- return doAuthenticate( username, password );
- }
-
- public Subject doAuthenticate(final String username, final String password) {
- try {
- Subject subject = new Subject();
- LoginContext loginContext = new LoginContext(realm, subject, new CallbackHandler() {
- public void handle(Callback[] callbacks) throws IOException, UnsupportedCallbackException {
- for (int i = 0; i < callbacks.length; i++) {
- if (callbacks[i] instanceof NameCallback) {
- ((NameCallback) callbacks[i]).setName(username);
- } else if (callbacks[i] instanceof PasswordCallback) {
- ((PasswordCallback) callbacks[i]).setPassword(password.toCharArray());
- } else {
- throw new UnsupportedCallbackException(callbacks[i]);
- }
- }
- }
- });
- loginContext.login();
- if (role != null && role.length() > 0) {
- String clazz = "org.apache.karaf.jaas.boot.principal.RolePrincipal";
- String name = role;
- int idx = role.indexOf(':');
- if (idx > 0) {
- clazz = role.substring(0, idx);
- name = role.substring(idx + 1);
- }
- boolean found = false;
- for (Principal p : subject.getPrincipals()) {
- if (p.getClass().getName().equals(clazz)
- && p.getName().equals(name)) {
- found = true;
- break;
- }
- }
- if (!found) {
- throw new FailedLoginException("User does not have the required role " + role);
- }
- }
- return subject;
- } catch (FailedLoginException e) {
- LOG.debug("Login failed", e);
- return null;
- } catch (AccountException e) {
- LOG.warn("Account failure", e);
- return null;
- } catch (GeneralSecurityException e) {
- LOG.error("General Security Exception", e);
- return null;
- }
- }
-
- public boolean authorize(Object o, String s) {
- return true;
- }
-
- public boolean authenticate( HttpServletRequest request, HttpServletResponse response )
- {
- // Return immediately if the header is missing
- String authHeader = request.getHeader( HEADER_AUTHORIZATION );
- if ( authHeader != null && authHeader.length() > 0 )
- {
-
- // Get the authType (Basic, Digest) and authInfo (user/password)
- // from the header
- authHeader = authHeader.trim();
- int blank = authHeader.indexOf( ' ' );
- if ( blank > 0 )
- {
- String authType = authHeader.substring( 0, blank );
- String authInfo = authHeader.substring( blank ).trim();
-
- // Check whether authorization type matches
- if ( authType.equalsIgnoreCase( AUTHENTICATION_SCHEME_BASIC ) )
- {
- try
- {
- String srcString = base64Decode( authInfo );
- int i = srcString.indexOf( ':' );
- String username = srcString.substring( 0, i );
- String password = srcString.substring( i + 1 );
-
- // authenticate
- Subject subject = doAuthenticate( username, password );
- if ( subject != null )
- {
- // as per the spec, set attributes
- request.setAttribute( HttpContext.AUTHENTICATION_TYPE, HttpServletRequest.BASIC_AUTH );
- request.setAttribute( HttpContext.REMOTE_USER, username );
-
- // set web console user attribute
- request.setAttribute( WebConsoleSecurityProvider2.USER_ATTRIBUTE, username );
-
- // set the JAAS subject
- request.setAttribute( KarafOsgiManager.SUBJECT_RUN_AS, subject );
-
- // succeed
- return true;
- }
- }
- catch ( Exception e )
- {
- // Ignore
- }
- }
- }
- }
-
- // request authentication
- try
- {
- response.setHeader( HEADER_WWW_AUTHENTICATE, AUTHENTICATION_SCHEME_BASIC + " realm=\"" + this.realm + "\"" );
- response.setStatus( HttpServletResponse.SC_UNAUTHORIZED );
- response.setContentLength( 0 );
- response.flushBuffer();
- }
- catch ( IOException ioe )
- {
- // failed sending the response ... cannot do anything about it
- }
-
- // inform HttpService that authentication failed
- return false;
- }
-
-
- private static String base64Decode( String srcString )
- {
- byte[] transformed = Base64.decodeBase64(srcString);
- try
- {
- return new String( transformed, "ISO-8859-1" );
- }
- catch ( UnsupportedEncodingException uee )
- {
- return new String( transformed );
- }
- }
-
-
-}
http://git-wip-us.apache.org/repos/asf/karaf/blob/d100637f/webconsole/branding/src/main/resources/META-INF/webconsole.properties
----------------------------------------------------------------------
diff --git a/webconsole/branding/src/main/resources/META-INF/webconsole.properties b/webconsole/branding/src/main/resources/META-INF/webconsole.properties
deleted file mode 100644
index afdb30e..0000000
--- a/webconsole/branding/src/main/resources/META-INF/webconsole.properties
+++ /dev/null
@@ -1,38 +0,0 @@
-#
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements. See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership. The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License. You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied. See the License for the
-# specific language governing permissions and limitations
-# under the License.
-#
-
-
-#
-# This file contains branding properties to overwrite the default
-# branding of the Apache Felix Web Console when deployed in an
-# Apache Karaf application.
-
-
-webconsole.brand.name = Apache Karaf Web Console
-
-webconsole.product.name = Apache Karaf
-webconsole.product.url = http://karaf.apache.org/
-webconsole.product.image = /res/karaf/imgs/logo.png
-
-webconsole.vendor.name = The Apache Software Foundation
-webconsole.vendor.url = http://www.apache.org
-webconsole.vendor.image = /res/karaf/imgs/logo.png
-
-webconsole.favicon = /res/karaf/imgs/favicon.ico
-webconsole.stylesheet = /res/karaf/ui/webconsole.css
http://git-wip-us.apache.org/repos/asf/karaf/blob/d100637f/webconsole/branding/src/main/resources/OSGI-INF/blueprint/webconsole.xml
----------------------------------------------------------------------
diff --git a/webconsole/branding/src/main/resources/OSGI-INF/blueprint/webconsole.xml b/webconsole/branding/src/main/resources/OSGI-INF/blueprint/webconsole.xml
deleted file mode 100644
index cf5abad..0000000
--- a/webconsole/branding/src/main/resources/OSGI-INF/blueprint/webconsole.xml
+++ /dev/null
@@ -1,46 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
-
- Licensed to the Apache Software Foundation (ASF) under one or more
- contributor license agreements. See the NOTICE file distributed with
- this work for additional information regarding copyright ownership.
- The ASF licenses this file to You under the Apache License, Version 2.0
- (the "License"); you may not use this file except in compliance with
- the License. You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
-
--->
-<blueprint xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0"
- xmlns:cm="http://aries.apache.org/blueprint/xmlns/blueprint-cm/v1.0.0"
- xmlns:ext="http://aries.apache.org/blueprint/xmlns/blueprint-ext/v1.0.0"
- default-activation="lazy">
-
- <ext:property-placeholder placeholder-prefix="$[" placeholder-suffix="]">
- <ext:default-properties>
- <ext:property name="karaf.admin.role" value="admin" />
- </ext:default-properties>
- </ext:property-placeholder>
-
-
- <cm:property-placeholder persistent-id="org.apache.karaf.webconsole">
- <cm:default-properties>
- <cm:property name="realm" value="karaf"/>
- <cm:property name="role" value="$[karaf.admin.role]"/>
- </cm:default-properties>
- </cm:property-placeholder>
-
- <bean id="securityProvider" class="org.apache.karaf.webconsole.JaasSecurityProvider">
- <property name="realm" value="${realm}"/>
- <property name="role" value="${role}"/>
- </bean>
-
- <service auto-export="interfaces" ref="securityProvider" />
-
-</blueprint>
http://git-wip-us.apache.org/repos/asf/karaf/blob/d100637f/webconsole/branding/src/main/resources/OSGI-INF/bundle.info
----------------------------------------------------------------------
diff --git a/webconsole/branding/src/main/resources/OSGI-INF/bundle.info b/webconsole/branding/src/main/resources/OSGI-INF/bundle.info
deleted file mode 100644
index 2782609..0000000
--- a/webconsole/branding/src/main/resources/OSGI-INF/bundle.info
+++ /dev/null
@@ -1,18 +0,0 @@
-h1. Synopsis
-
-${project.name}
-
-${project.description}
-
-Maven URL:
-[mvn:${project.groupId}/${project.artifactId}/${project.version}]
-
-h1. Description
-
-Apache Karaf branding for the Apache Felix Web Console. This fragment attaches to the
-org.apache.felix.webconsole bundle to provide branding through the
-/META-INF/webconsole.properties.
-
-h1. See also
-
-Web console - section in the Karaf User Guide
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/karaf/blob/d100637f/webconsole/branding/src/main/resources/OSGI-INF/metatype/metatype.properties
----------------------------------------------------------------------
diff --git a/webconsole/branding/src/main/resources/OSGI-INF/metatype/metatype.properties b/webconsole/branding/src/main/resources/OSGI-INF/metatype/metatype.properties
deleted file mode 100644
index f2fddfb..0000000
--- a/webconsole/branding/src/main/resources/OSGI-INF/metatype/metatype.properties
+++ /dev/null
@@ -1,28 +0,0 @@
-#
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements. See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership. The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License. You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied. See the License for the
-# specific language governing permissions and limitations
-# under the License.
-#
-
-#
-# This file contains localization strings for configuration labels and
-# descriptions as used in the metatype.xml descriptor
-
-webconsole.name = Apache Karaf WebConsole
-webconsole.description = Configuration of Apache Karaf WebConsole
-
-realm.name = Realm
-realm.description = The JAAS realm name to use for authentication
http://git-wip-us.apache.org/repos/asf/karaf/blob/d100637f/webconsole/branding/src/main/resources/OSGI-INF/metatype/metatype.xml
----------------------------------------------------------------------
diff --git a/webconsole/branding/src/main/resources/OSGI-INF/metatype/metatype.xml b/webconsole/branding/src/main/resources/OSGI-INF/metatype/metatype.xml
deleted file mode 100644
index f6abcfd..0000000
--- a/webconsole/branding/src/main/resources/OSGI-INF/metatype/metatype.xml
+++ /dev/null
@@ -1,27 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
-
- Licensed to the Apache Software Foundation (ASF) under one or more
- contributor license agreements. See the NOTICE file distributed with
- this work for additional information regarding copyright ownership.
- The ASF licenses this file to You under the Apache License, Version 2.0
- (the "License"); you may not use this file except in compliance with
- the License. You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
-
--->
-<metatype:MetaData xmlns:metatype="http://www.osgi.org/xmlns/metatype/v1.0.0" localization="OSGI-INF/metatype/metatype">
- <OCD id="org.apache.karaf.webconsole" name="%webconsole.name" description="%webconsole.description">
- <AD id="realm" type="String" default="karaf" name="%realm.name" description="%realm.description"/>
- </OCD>
- <Designate pid="org.apache.karaf.webconsole">
- <Object ocdref="org.apache.karaf.webconsole"/>
- </Designate>
-</metatype:MetaData>
http://git-wip-us.apache.org/repos/asf/karaf/blob/d100637f/webconsole/branding/src/main/resources/res/karaf/imgs/favicon.ico
----------------------------------------------------------------------
diff --git a/webconsole/branding/src/main/resources/res/karaf/imgs/favicon.ico b/webconsole/branding/src/main/resources/res/karaf/imgs/favicon.ico
deleted file mode 100644
index cb02612..0000000
Binary files a/webconsole/branding/src/main/resources/res/karaf/imgs/favicon.ico and /dev/null differ
http://git-wip-us.apache.org/repos/asf/karaf/blob/d100637f/webconsole/branding/src/main/resources/res/karaf/imgs/logo.png
----------------------------------------------------------------------
diff --git a/webconsole/branding/src/main/resources/res/karaf/imgs/logo.png b/webconsole/branding/src/main/resources/res/karaf/imgs/logo.png
deleted file mode 100644
index 066ab86..0000000
Binary files a/webconsole/branding/src/main/resources/res/karaf/imgs/logo.png and /dev/null differ
http://git-wip-us.apache.org/repos/asf/karaf/blob/d100637f/webconsole/branding/src/main/resources/res/karaf/ui/webconsole.css
----------------------------------------------------------------------
diff --git a/webconsole/branding/src/main/resources/res/karaf/ui/webconsole.css b/webconsole/branding/src/main/resources/res/karaf/ui/webconsole.css
deleted file mode 100644
index 03fa9dd..0000000
--- a/webconsole/branding/src/main/resources/res/karaf/ui/webconsole.css
+++ /dev/null
@@ -1,193 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-/*
- * The webconsole.css is the main CSS which sets up the following parts
- *
- * div main -> outermost div just inside body
- * div lead -> the page lead with title and logo
- * div technav -> the top navigation
- * div content -> the div surrounding the content being rendered by
- * the plugin in the renderContent (or service) method
- *
- * See also http://felix.apache.org/site/branding-the-web-console.html
- */
-#main {
- width: 90% !important;
- margin-left: 5%;
-}
-#main img { border: none }
-
-
-/* LOGO & BRANDING */
-#lead {
- padding-top: 10px;
- margin: 0;
- height: 73px; /* must be the same as logo (#lead p) height */
-}
-#lead h1 { /* This contains the page title */
- font-size: 26px;
- font-weight: bold;
- float: left;
-}
-#lead p { /* This contains the logo */
- float: right;
- height: 73px; /* must be the same as #lead height */
-}
-#lead p img { /* This is the logo */
- height: 63px; /* must be #lead.height - #lead.padding-top */
-}
-
-
-/* TOP NAVIGATION */
-#technav {
- font-size: 10px;
- line-height: 21px;
- padding: 0;
- margin: 0;
-}
-#technav div {
- display: inline;
- padding: .2em 1em;
- white-space: nowrap;
-}
-
-/* New Category Based Navigation Tree (FELIX-3769) */
-#navmenu {
- width: auto;
-}
-
-#navmenu li.ui-menu-item {
- width: auto;
-}
-
-#navmenu li.navMenuItem-0 {
- display: inline-block;
-}
-
-/* Don't display caret on top-level menu (FELIX-3841) */
-#navmenu li.navMenuItem-0 > a > span {
- display: none;
-}
-
-/* CENTRAL CONTENT AREA STYLING */
-#content, .ui-widget, .ui-widget input, .ui-widget select, .ui-widget textarea, .ui-widget button { font-size: 8pt }
-
-
-/* used in some plugins - showing ID (long) element in tables */
-.col_Id {
- width: 5em;
-}
-
-/* styling button groups like in the bundles & log plugins */
-.buttonGroup {
- text-align: right;
- padding: .5em 1em .5em 0;
- vertical-align: middle;
-}
-.buttonGroup select {
- display: inline;
- float: none;
- margin: 0;
-}
-
-/* The following styles are not complete. They usually apply only padding,
- * margin... mostly *WHERE* the elements are visualised. Visual styling like
- * colors and fonts are applied automatically by a JavaScript that borrows
- * the visual element styles from the JQuery UI theme
- */
-
-/* input box, checkbox & buttons styling */
-.inputText, input.text, input.password, input.file, textarea, select {
- color: #184054;
- background-color: #f0f0f0;
-}
-.inputText, input.text, input.password, textarea {
- border: 1px solid #999999;
- border-bottom: 1px solid #cccccc;
- border-right: 1px solid #cccccc;
-}
-
-/* tables styling - must be in synch with tablesorter CSS */
-td, th { vertical-align: top }
-table.nicetable {
- width: 100%;
- text-align: left;
-}
-table.nicetable th, table.nicetable td {
- border-bottom: 1px solid #cccccc;
- text-align: left;
- padding: .2em;
- padding-left: .8em;
-}
-
-/* tablesorter styling */
-tr .header {
- background-image: url(../lib/bg.gif) !important;
- background-repeat: no-repeat !important;
- background-position: center right !important;
- cursor: pointer !important;
-}
-tr .headerSortUp {
- background-image: url(../lib/asc.gif) !important;
-}
-tr .headerSortDown {
- background-image: url(../lib/desc.gif) !important;
-}
-
-/* status line */
-.statline {
- margin-top: .5em !important;
- margin-bottom: .5em !important;
- padding: .2em;
-}
-
-/* zebra tables */
-.even {
- /* default background unmodified from JQuery UI Theme */
-}
-
-.odd {
- /* overwrite background from JQuery UI Theme */
- background: none !important;
-}
-
-/*
- * Common UI style to define button icons like in bundles plugin. The HTML markup is:
- * <ul class="icons ui-widget">
- * <li class="dynhover" title="tooltip comes here"><span class="ui-icon ui-icon-refresh"> </span></li>
- * </ul>
- */
-ul.icons {
- margin: 0;
- padding: 0
-}
-ul.icons span.ui-icon {
- float: left;
- margin: 0 1px
-}
-ul.icons li {
- margin: 1px;
- position: relative;
- padding: 1px 0;
- cursor: pointer;
- float: left;
- list-style: none
-}
-/* language selection element */
-#langSelect { position: absolute; top: 5px; right: 5px }
-#langSelect img { display: block; padding: 2px 0 }
http://git-wip-us.apache.org/repos/asf/karaf/blob/d100637f/webconsole/console/src/main/java/org/apache/felix/webconsole/internal/JaasSecurityProvider.java
----------------------------------------------------------------------
diff --git a/webconsole/console/src/main/java/org/apache/felix/webconsole/internal/JaasSecurityProvider.java b/webconsole/console/src/main/java/org/apache/felix/webconsole/internal/JaasSecurityProvider.java
new file mode 100644
index 0000000..56509d5
--- /dev/null
+++ b/webconsole/console/src/main/java/org/apache/felix/webconsole/internal/JaasSecurityProvider.java
@@ -0,0 +1,240 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.felix.webconsole.internal;
+
+import java.io.IOException;
+import java.io.UnsupportedEncodingException;
+import java.security.GeneralSecurityException;
+import java.security.Principal;
+import java.util.Dictionary;
+import java.util.Hashtable;
+
+import javax.security.auth.Subject;
+import javax.security.auth.callback.Callback;
+import javax.security.auth.callback.CallbackHandler;
+import javax.security.auth.callback.NameCallback;
+import javax.security.auth.callback.PasswordCallback;
+import javax.security.auth.callback.UnsupportedCallbackException;
+import javax.security.auth.login.AccountException;
+import javax.security.auth.login.FailedLoginException;
+import javax.security.auth.login.LoginContext;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+
+import org.apache.felix.webconsole.WebConsoleSecurityProvider2;
+import org.apache.felix.webconsole.internal.servlet.Base64;
+import org.osgi.service.cm.ConfigurationException;
+import org.osgi.service.cm.ManagedService;
+import org.osgi.service.http.HttpContext;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+public class JaasSecurityProvider implements WebConsoleSecurityProvider2, ManagedService {
+
+ private static final Logger LOG = LoggerFactory.getLogger(JaasSecurityProvider.class);
+
+ private static final String HEADER_WWW_AUTHENTICATE = "WWW-Authenticate";
+
+ private static final String HEADER_AUTHORIZATION = "Authorization";
+
+ private static final String AUTHENTICATION_SCHEME_BASIC = "Basic";
+
+ private String realm;
+ private String role;
+
+ public JaasSecurityProvider() {
+ updated(null);
+ }
+
+ public String getRealm() {
+ return realm;
+ }
+
+ public void setRealm(String realm) {
+ this.realm = realm;
+ }
+
+ public String getRole() {
+ return role;
+ }
+
+ public void setRole(String role) {
+ this.role = role;
+ }
+
+ public Object authenticate(final String username, final String password) {
+ return doAuthenticate( username, password );
+ }
+
+ @Override
+ public void updated(Dictionary<String, ?> properties) {
+ if (properties == null) {
+ properties = new Hashtable<>();
+ }
+ realm = getString(properties, "realm", "karaf");
+ role = getString(properties, "role", System.getProperty("karaf.admin.role", "admin"));
+ }
+
+ private String getString(Dictionary<String, ?> properties, String key, String def) {
+ if (properties != null) {
+ Object val = properties.get(key);
+ if (val != null) {
+ return val.toString();
+ }
+ }
+ return def;
+ }
+
+ public Subject doAuthenticate(final String username, final String password) {
+ try {
+ Subject subject = new Subject();
+ LoginContext loginContext = new LoginContext(realm, subject, new CallbackHandler() {
+ public void handle(Callback[] callbacks) throws IOException, UnsupportedCallbackException {
+ for (int i = 0; i < callbacks.length; i++) {
+ if (callbacks[i] instanceof NameCallback) {
+ ((NameCallback) callbacks[i]).setName(username);
+ } else if (callbacks[i] instanceof PasswordCallback) {
+ ((PasswordCallback) callbacks[i]).setPassword(password.toCharArray());
+ } else {
+ throw new UnsupportedCallbackException(callbacks[i]);
+ }
+ }
+ }
+ });
+ loginContext.login();
+ if (role != null && role.length() > 0) {
+ String clazz = "org.apache.karaf.jaas.boot.principal.RolePrincipal";
+ String name = role;
+ int idx = role.indexOf(':');
+ if (idx > 0) {
+ clazz = role.substring(0, idx);
+ name = role.substring(idx + 1);
+ }
+ boolean found = false;
+ for (Principal p : subject.getPrincipals()) {
+ if (p.getClass().getName().equals(clazz)
+ && p.getName().equals(name)) {
+ found = true;
+ break;
+ }
+ }
+ if (!found) {
+ throw new FailedLoginException("User does not have the required role " + role);
+ }
+ }
+ return subject;
+ } catch (FailedLoginException e) {
+ LOG.debug("Login failed", e);
+ return null;
+ } catch (AccountException e) {
+ LOG.warn("Account failure", e);
+ return null;
+ } catch (GeneralSecurityException e) {
+ LOG.error("General Security Exception", e);
+ return null;
+ }
+ }
+
+ public boolean authorize(Object o, String s) {
+ return true;
+ }
+
+ public boolean authenticate( HttpServletRequest request, HttpServletResponse response )
+ {
+ // Return immediately if the header is missing
+ String authHeader = request.getHeader( HEADER_AUTHORIZATION );
+ if ( authHeader != null && authHeader.length() > 0 )
+ {
+
+ // Get the authType (Basic, Digest) and authInfo (user/password)
+ // from the header
+ authHeader = authHeader.trim();
+ int blank = authHeader.indexOf( ' ' );
+ if ( blank > 0 )
+ {
+ String authType = authHeader.substring( 0, blank );
+ String authInfo = authHeader.substring( blank ).trim();
+
+ // Check whether authorization type matches
+ if ( authType.equalsIgnoreCase( AUTHENTICATION_SCHEME_BASIC ) )
+ {
+ try
+ {
+ String srcString = base64Decode( authInfo );
+ int i = srcString.indexOf( ':' );
+ String username = srcString.substring( 0, i );
+ String password = srcString.substring( i + 1 );
+
+ // authenticate
+ Subject subject = doAuthenticate( username, password );
+ if ( subject != null )
+ {
+ // as per the spec, set attributes
+ request.setAttribute( HttpContext.AUTHENTICATION_TYPE, HttpServletRequest.BASIC_AUTH );
+ request.setAttribute( HttpContext.REMOTE_USER, username );
+
+ // set web console user attribute
+ request.setAttribute( WebConsoleSecurityProvider2.USER_ATTRIBUTE, username );
+
+ // set the JAAS subject
+ request.setAttribute( KarafOsgiManager.SUBJECT_RUN_AS, subject );
+
+ // succeed
+ return true;
+ }
+ }
+ catch ( Exception e )
+ {
+ // Ignore
+ }
+ }
+ }
+ }
+
+ // request authentication
+ try
+ {
+ response.setHeader( HEADER_WWW_AUTHENTICATE, AUTHENTICATION_SCHEME_BASIC + " realm=\"" + this.realm + "\"" );
+ response.setStatus( HttpServletResponse.SC_UNAUTHORIZED );
+ response.setContentLength( 0 );
+ response.flushBuffer();
+ }
+ catch ( IOException ioe )
+ {
+ // failed sending the response ... cannot do anything about it
+ }
+
+ // inform HttpService that authentication failed
+ return false;
+ }
+
+
+ private static String base64Decode( String srcString )
+ {
+ byte[] transformed = Base64.decodeBase64(srcString);
+ try
+ {
+ return new String( transformed, "ISO-8859-1" );
+ }
+ catch ( UnsupportedEncodingException uee )
+ {
+ return new String( transformed );
+ }
+ }
+
+
+}
http://git-wip-us.apache.org/repos/asf/karaf/blob/d100637f/webconsole/console/src/main/java/org/apache/felix/webconsole/internal/KarafOsgiManagerActivator.java
----------------------------------------------------------------------
diff --git a/webconsole/console/src/main/java/org/apache/felix/webconsole/internal/KarafOsgiManagerActivator.java b/webconsole/console/src/main/java/org/apache/felix/webconsole/internal/KarafOsgiManagerActivator.java
index 2d4b49e..8d1d6e9 100644
--- a/webconsole/console/src/main/java/org/apache/felix/webconsole/internal/KarafOsgiManagerActivator.java
+++ b/webconsole/console/src/main/java/org/apache/felix/webconsole/internal/KarafOsgiManagerActivator.java
@@ -19,8 +19,15 @@
package org.apache.felix.webconsole.internal;
+import java.util.Hashtable;
+
+import org.apache.felix.webconsole.WebConsoleSecurityProvider;
+import org.apache.felix.webconsole.WebConsoleSecurityProvider2;
import org.osgi.framework.BundleActivator;
import org.osgi.framework.BundleContext;
+import org.osgi.framework.Constants;
+import org.osgi.framework.ServiceRegistration;
+import org.osgi.service.cm.ManagedService;
/**
@@ -30,6 +37,7 @@ import org.osgi.framework.BundleContext;
public class KarafOsgiManagerActivator implements BundleActivator
{
+ private ServiceRegistration registration;
private KarafOsgiManager osgiManager;
@@ -38,6 +46,13 @@ public class KarafOsgiManagerActivator implements BundleActivator
*/
public void start( BundleContext bundleContext )
{
+ Hashtable<String, String> props = new Hashtable<>();
+ props.put(Constants.SERVICE_PID, "org.apache.karaf.webconsole");
+ registration = bundleContext.registerService(
+ new String[] {WebConsoleSecurityProvider.class.getName(), WebConsoleSecurityProvider2.class.getName(), ManagedService.class.getName() },
+ new JaasSecurityProvider(),
+ props
+ );
osgiManager = new KarafOsgiManager( bundleContext );
}
@@ -51,6 +66,10 @@ public class KarafOsgiManagerActivator implements BundleActivator
{
osgiManager.dispose();
}
+ if ( registration != null )
+ {
+ registration.unregister();
+ }
}
}
http://git-wip-us.apache.org/repos/asf/karaf/blob/d100637f/webconsole/console/src/main/resources/META-INF/webconsole.properties
----------------------------------------------------------------------
diff --git a/webconsole/console/src/main/resources/META-INF/webconsole.properties b/webconsole/console/src/main/resources/META-INF/webconsole.properties
new file mode 100644
index 0000000..afdb30e
--- /dev/null
+++ b/webconsole/console/src/main/resources/META-INF/webconsole.properties
@@ -0,0 +1,38 @@
+#
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations
+# under the License.
+#
+
+
+#
+# This file contains branding properties to overwrite the default
+# branding of the Apache Felix Web Console when deployed in an
+# Apache Karaf application.
+
+
+webconsole.brand.name = Apache Karaf Web Console
+
+webconsole.product.name = Apache Karaf
+webconsole.product.url = http://karaf.apache.org/
+webconsole.product.image = /res/karaf/imgs/logo.png
+
+webconsole.vendor.name = The Apache Software Foundation
+webconsole.vendor.url = http://www.apache.org
+webconsole.vendor.image = /res/karaf/imgs/logo.png
+
+webconsole.favicon = /res/karaf/imgs/favicon.ico
+webconsole.stylesheet = /res/karaf/ui/webconsole.css
http://git-wip-us.apache.org/repos/asf/karaf/blob/d100637f/webconsole/console/src/main/resources/OSGI-INF/metatype/metatype.properties
----------------------------------------------------------------------
diff --git a/webconsole/console/src/main/resources/OSGI-INF/metatype/metatype.properties b/webconsole/console/src/main/resources/OSGI-INF/metatype/metatype.properties
new file mode 100644
index 0000000..f2fddfb
--- /dev/null
+++ b/webconsole/console/src/main/resources/OSGI-INF/metatype/metatype.properties
@@ -0,0 +1,28 @@
+#
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations
+# under the License.
+#
+
+#
+# This file contains localization strings for configuration labels and
+# descriptions as used in the metatype.xml descriptor
+
+webconsole.name = Apache Karaf WebConsole
+webconsole.description = Configuration of Apache Karaf WebConsole
+
+realm.name = Realm
+realm.description = The JAAS realm name to use for authentication
http://git-wip-us.apache.org/repos/asf/karaf/blob/d100637f/webconsole/console/src/main/resources/OSGI-INF/metatype/metatype.xml
----------------------------------------------------------------------
diff --git a/webconsole/console/src/main/resources/OSGI-INF/metatype/metatype.xml b/webconsole/console/src/main/resources/OSGI-INF/metatype/metatype.xml
new file mode 100644
index 0000000..f6abcfd
--- /dev/null
+++ b/webconsole/console/src/main/resources/OSGI-INF/metatype/metatype.xml
@@ -0,0 +1,27 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements. See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+
+-->
+<metatype:MetaData xmlns:metatype="http://www.osgi.org/xmlns/metatype/v1.0.0" localization="OSGI-INF/metatype/metatype">
+ <OCD id="org.apache.karaf.webconsole" name="%webconsole.name" description="%webconsole.description">
+ <AD id="realm" type="String" default="karaf" name="%realm.name" description="%realm.description"/>
+ </OCD>
+ <Designate pid="org.apache.karaf.webconsole">
+ <Object ocdref="org.apache.karaf.webconsole"/>
+ </Designate>
+</metatype:MetaData>
http://git-wip-us.apache.org/repos/asf/karaf/blob/d100637f/webconsole/console/src/main/resources/res/karaf/imgs/logo.png
----------------------------------------------------------------------
diff --git a/webconsole/console/src/main/resources/res/karaf/imgs/logo.png b/webconsole/console/src/main/resources/res/karaf/imgs/logo.png
new file mode 100644
index 0000000..066ab86
Binary files /dev/null and b/webconsole/console/src/main/resources/res/karaf/imgs/logo.png differ
http://git-wip-us.apache.org/repos/asf/karaf/blob/d100637f/webconsole/console/src/main/resources/res/karaf/ui/webconsole.css
----------------------------------------------------------------------
diff --git a/webconsole/console/src/main/resources/res/karaf/ui/webconsole.css b/webconsole/console/src/main/resources/res/karaf/ui/webconsole.css
new file mode 100644
index 0000000..03fa9dd
--- /dev/null
+++ b/webconsole/console/src/main/resources/res/karaf/ui/webconsole.css
@@ -0,0 +1,193 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/*
+ * The webconsole.css is the main CSS which sets up the following parts
+ *
+ * div main -> outermost div just inside body
+ * div lead -> the page lead with title and logo
+ * div technav -> the top navigation
+ * div content -> the div surrounding the content being rendered by
+ * the plugin in the renderContent (or service) method
+ *
+ * See also http://felix.apache.org/site/branding-the-web-console.html
+ */
+#main {
+ width: 90% !important;
+ margin-left: 5%;
+}
+#main img { border: none }
+
+
+/* LOGO & BRANDING */
+#lead {
+ padding-top: 10px;
+ margin: 0;
+ height: 73px; /* must be the same as logo (#lead p) height */
+}
+#lead h1 { /* This contains the page title */
+ font-size: 26px;
+ font-weight: bold;
+ float: left;
+}
+#lead p { /* This contains the logo */
+ float: right;
+ height: 73px; /* must be the same as #lead height */
+}
+#lead p img { /* This is the logo */
+ height: 63px; /* must be #lead.height - #lead.padding-top */
+}
+
+
+/* TOP NAVIGATION */
+#technav {
+ font-size: 10px;
+ line-height: 21px;
+ padding: 0;
+ margin: 0;
+}
+#technav div {
+ display: inline;
+ padding: .2em 1em;
+ white-space: nowrap;
+}
+
+/* New Category Based Navigation Tree (FELIX-3769) */
+#navmenu {
+ width: auto;
+}
+
+#navmenu li.ui-menu-item {
+ width: auto;
+}
+
+#navmenu li.navMenuItem-0 {
+ display: inline-block;
+}
+
+/* Don't display caret on top-level menu (FELIX-3841) */
+#navmenu li.navMenuItem-0 > a > span {
+ display: none;
+}
+
+/* CENTRAL CONTENT AREA STYLING */
+#content, .ui-widget, .ui-widget input, .ui-widget select, .ui-widget textarea, .ui-widget button { font-size: 8pt }
+
+
+/* used in some plugins - showing ID (long) element in tables */
+.col_Id {
+ width: 5em;
+}
+
+/* styling button groups like in the bundles & log plugins */
+.buttonGroup {
+ text-align: right;
+ padding: .5em 1em .5em 0;
+ vertical-align: middle;
+}
+.buttonGroup select {
+ display: inline;
+ float: none;
+ margin: 0;
+}
+
+/* The following styles are not complete. They usually apply only padding,
+ * margin... mostly *WHERE* the elements are visualised. Visual styling like
+ * colors and fonts are applied automatically by a JavaScript that borrows
+ * the visual element styles from the JQuery UI theme
+ */
+
+/* input box, checkbox & buttons styling */
+.inputText, input.text, input.password, input.file, textarea, select {
+ color: #184054;
+ background-color: #f0f0f0;
+}
+.inputText, input.text, input.password, textarea {
+ border: 1px solid #999999;
+ border-bottom: 1px solid #cccccc;
+ border-right: 1px solid #cccccc;
+}
+
+/* tables styling - must be in synch with tablesorter CSS */
+td, th { vertical-align: top }
+table.nicetable {
+ width: 100%;
+ text-align: left;
+}
+table.nicetable th, table.nicetable td {
+ border-bottom: 1px solid #cccccc;
+ text-align: left;
+ padding: .2em;
+ padding-left: .8em;
+}
+
+/* tablesorter styling */
+tr .header {
+ background-image: url(../lib/bg.gif) !important;
+ background-repeat: no-repeat !important;
+ background-position: center right !important;
+ cursor: pointer !important;
+}
+tr .headerSortUp {
+ background-image: url(../lib/asc.gif) !important;
+}
+tr .headerSortDown {
+ background-image: url(../lib/desc.gif) !important;
+}
+
+/* status line */
+.statline {
+ margin-top: .5em !important;
+ margin-bottom: .5em !important;
+ padding: .2em;
+}
+
+/* zebra tables */
+.even {
+ /* default background unmodified from JQuery UI Theme */
+}
+
+.odd {
+ /* overwrite background from JQuery UI Theme */
+ background: none !important;
+}
+
+/*
+ * Common UI style to define button icons like in bundles plugin. The HTML markup is:
+ * <ul class="icons ui-widget">
+ * <li class="dynhover" title="tooltip comes here"><span class="ui-icon ui-icon-refresh"> </span></li>
+ * </ul>
+ */
+ul.icons {
+ margin: 0;
+ padding: 0
+}
+ul.icons span.ui-icon {
+ float: left;
+ margin: 0 1px
+}
+ul.icons li {
+ margin: 1px;
+ position: relative;
+ padding: 1px 0;
+ cursor: pointer;
+ float: left;
+ list-style: none
+}
+/* language selection element */
+#langSelect { position: absolute; top: 5px; right: 5px }
+#langSelect img { display: block; padding: 2px 0 }
http://git-wip-us.apache.org/repos/asf/karaf/blob/d100637f/webconsole/pom.xml
----------------------------------------------------------------------
diff --git a/webconsole/pom.xml b/webconsole/pom.xml
index 89e92af..9c4c2e2 100644
--- a/webconsole/pom.xml
+++ b/webconsole/pom.xml
@@ -35,7 +35,6 @@
<modules>
<module>console</module>
- <module>branding</module>
<module>features</module>
<module>gogo</module>
<module>http</module>