sling-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cziege...@apache.org
Subject svn commit: r1767718 - in /sling/trunk/bundles/extensions/webconsolesecurityprovider: ./ src/main/java/org/apache/sling/extensions/webconsolesecurityprovider/internal/ src/main/resources/ src/main/resources/OSGI-INF/ src/main/resources/OSGI-INF/metatype/
Date Wed, 02 Nov 2016 16:27:15 GMT
Author: cziegeler
Date: Wed Nov  2 16:27:15 2016
New Revision: 1767718

URL: http://svn.apache.org/viewvc?rev=1767718&view=rev
Log:
SLING-6234 : Web Console Security Provider should supprt logout

Added:
    sling/trunk/bundles/extensions/webconsolesecurityprovider/src/main/resources/
    sling/trunk/bundles/extensions/webconsolesecurityprovider/src/main/resources/OSGI-INF/
    sling/trunk/bundles/extensions/webconsolesecurityprovider/src/main/resources/OSGI-INF/metatype/
    sling/trunk/bundles/extensions/webconsolesecurityprovider/src/main/resources/OSGI-INF/metatype/org.apache.sling.extensions.webconsolesecurityprovider.internal.SlingWebConsoleSecurityProvider.properties
  (with props)
    sling/trunk/bundles/extensions/webconsolesecurityprovider/src/main/resources/OSGI-INF/metatype/org.apache.sling.extensions.webconsolesecurityprovider.internal.SlingWebConsoleSecurityProvider.xml
  (with props)
Modified:
    sling/trunk/bundles/extensions/webconsolesecurityprovider/pom.xml
    sling/trunk/bundles/extensions/webconsolesecurityprovider/src/main/java/org/apache/sling/extensions/webconsolesecurityprovider/internal/SlingWebConsoleSecurityProvider.java
    sling/trunk/bundles/extensions/webconsolesecurityprovider/src/main/java/org/apache/sling/extensions/webconsolesecurityprovider/internal/SlingWebConsoleSecurityProvider2.java

Modified: sling/trunk/bundles/extensions/webconsolesecurityprovider/pom.xml
URL: http://svn.apache.org/viewvc/sling/trunk/bundles/extensions/webconsolesecurityprovider/pom.xml?rev=1767718&r1=1767717&r2=1767718&view=diff
==============================================================================
--- sling/trunk/bundles/extensions/webconsolesecurityprovider/pom.xml (original)
+++ sling/trunk/bundles/extensions/webconsolesecurityprovider/pom.xml Wed Nov  2 16:27:15
2016
@@ -21,7 +21,7 @@
     <parent>
         <artifactId>sling</artifactId>
         <groupId>org.apache.sling</groupId>
-        <version>26</version>
+        <version>29</version>
         <relativePath />
     </parent>
 
@@ -50,10 +50,6 @@
         <plugins>
             <plugin>
                 <groupId>org.apache.felix</groupId>
-                <artifactId>maven-scr-plugin</artifactId>
-            </plugin>
-            <plugin>
-                <groupId>org.apache.felix</groupId>
                 <artifactId>maven-bundle-plugin</artifactId>
                 <extensions>true</extensions>
                 <configuration>
@@ -75,11 +71,6 @@
                     </instructions>                
                 </configuration>
             </plugin>
-        </plugins>
-    </build>
-
-    <reporting>
-        <plugins>
             <plugin>
                 <groupId>org.apache.maven.plugins</groupId>
                 <artifactId>maven-javadoc-plugin</artifactId>
@@ -88,21 +79,23 @@
                 </configuration>
             </plugin>
         </plugins>
-    </reporting>
+    </build>
 
     <dependencies>
         <dependency>
             <groupId>org.osgi</groupId>
-            <artifactId>org.osgi.core</artifactId>
+            <artifactId>osgi.core</artifactId>
         </dependency>
         <dependency>
             <groupId>org.osgi</groupId>
-            <artifactId>org.osgi.compendium</artifactId>
+            <artifactId>org.osgi.service.cm</artifactId>
+            <version>1.5.0</version>
+            <scope>provided</scope>
         </dependency>
         <dependency>
             <groupId>org.apache.felix</groupId>
             <artifactId>org.apache.felix.webconsole</artifactId>
-            <version>4.2.0</version>
+            <version>4.2.10</version>
             <scope>provided</scope>
         </dependency>
         <dependency>
@@ -125,7 +118,7 @@
         </dependency>
         <dependency>
             <groupId>javax.servlet</groupId>
-            <artifactId>servlet-api</artifactId>
+            <artifactId>javax.servlet-api</artifactId>
         </dependency>
         <dependency>
             <groupId>javax.jcr</groupId>
@@ -138,10 +131,6 @@
             <scope>provided</scope>
         </dependency>
         <dependency>
-            <groupId>org.apache.felix</groupId>
-            <artifactId>org.apache.felix.scr.annotations</artifactId>
-        </dependency>
-        <dependency>
             <groupId>org.slf4j</groupId>
             <artifactId>slf4j-api</artifactId>
         </dependency>

Modified: sling/trunk/bundles/extensions/webconsolesecurityprovider/src/main/java/org/apache/sling/extensions/webconsolesecurityprovider/internal/SlingWebConsoleSecurityProvider.java
URL: http://svn.apache.org/viewvc/sling/trunk/bundles/extensions/webconsolesecurityprovider/src/main/java/org/apache/sling/extensions/webconsolesecurityprovider/internal/SlingWebConsoleSecurityProvider.java?rev=1767718&r1=1767717&r2=1767718&view=diff
==============================================================================
--- sling/trunk/bundles/extensions/webconsolesecurityprovider/src/main/java/org/apache/sling/extensions/webconsolesecurityprovider/internal/SlingWebConsoleSecurityProvider.java
(original)
+++ sling/trunk/bundles/extensions/webconsolesecurityprovider/src/main/java/org/apache/sling/extensions/webconsolesecurityprovider/internal/SlingWebConsoleSecurityProvider.java
Wed Nov  2 16:27:15 2016
@@ -26,9 +26,6 @@ import javax.jcr.Repository;
 import javax.jcr.Session;
 import javax.jcr.SimpleCredentials;
 
-import org.apache.felix.scr.annotations.Component;
-import org.apache.felix.scr.annotations.Properties;
-import org.apache.felix.scr.annotations.Property;
 import org.apache.jackrabbit.api.JackrabbitSession;
 import org.apache.jackrabbit.api.security.user.Authorizable;
 import org.apache.jackrabbit.api.security.user.Group;
@@ -47,27 +44,6 @@ import org.apache.jackrabbit.api.securit
  * only registered as a security provider service once such a JCR Repository is
  * available.
  */
-@Component(ds=false, metatype=true,
-           label="Apache Sling Web Console Security Provider",
-           description="Configuration for the security provider used to verfiy user " +
-                       "credentials and grant access to the Apache Felix Web Console " +
-                       "based on registered JCR Repository users.")
-@Properties({
-    @Property(name = "users", value=AbstractWebConsoleSecurityProvider.PROP_GROUPS_DEFAULT_USER,
cardinality=20,
-              label="User Names",
-              description="Names of users granted full access to the Apache Felix " +
-                          "Web Console. By default this lists the \"admin\" user. A maximum
of 20 users" +
-                          " may be configured. Administrators are encouraged to create a
group whose" +
-                          " members are to be granted access to Web Console instead of allowing
access" +
-                          " to individual users."),
-    @Property(name = "groups", cardinality=20,
-             label="Group Names",
-             description="Names of groups whose members are granted full access to the Apache
Felix " +
-                         "Web Console. The default lists no groups. Administrators are encouraged
to " +
-                         "create a group whose members are to be granted access to the Web
Console." +
-                         " A maximum of 20 groups may be configured. Using groups to control"
+
-                         " access requires a Jackrabbit based repository.")
-})
 public class SlingWebConsoleSecurityProvider extends AbstractWebConsoleSecurityProvider {
 
     private Repository repository;
@@ -105,6 +81,7 @@ public class SlingWebConsoleSecurityProv
      * @throws NullPointerException if <code>userName</code> is
      *             <code>null</code>.
      */
+    @Override
     public Object authenticate(String userName, String password) {
         final Credentials creds = new SimpleCredentials(userName,
             (password == null) ? new char[0] : password.toCharArray());
@@ -167,6 +144,7 @@ public class SlingWebConsoleSecurityProv
      * All users authenticated with the repository and being a member of the
      * authorized groups are granted access for all roles in the Web Console.
      */
+    @Override
     public boolean authorize(Object user, String role) {
         logger.debug("authorize: Grant user {} access for role {}", user, role);
         return true;

Modified: sling/trunk/bundles/extensions/webconsolesecurityprovider/src/main/java/org/apache/sling/extensions/webconsolesecurityprovider/internal/SlingWebConsoleSecurityProvider2.java
URL: http://svn.apache.org/viewvc/sling/trunk/bundles/extensions/webconsolesecurityprovider/src/main/java/org/apache/sling/extensions/webconsolesecurityprovider/internal/SlingWebConsoleSecurityProvider2.java?rev=1767718&r1=1767717&r2=1767718&view=diff
==============================================================================
--- sling/trunk/bundles/extensions/webconsolesecurityprovider/src/main/java/org/apache/sling/extensions/webconsolesecurityprovider/internal/SlingWebConsoleSecurityProvider2.java
(original)
+++ sling/trunk/bundles/extensions/webconsolesecurityprovider/src/main/java/org/apache/sling/extensions/webconsolesecurityprovider/internal/SlingWebConsoleSecurityProvider2.java
Wed Nov  2 16:27:15 2016
@@ -25,7 +25,7 @@ import javax.jcr.Session;
 import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletResponse;
 
-import org.apache.felix.webconsole.WebConsoleSecurityProvider2;
+import org.apache.felix.webconsole.WebConsoleSecurityProvider3;
 import org.apache.jackrabbit.api.JackrabbitSession;
 import org.apache.jackrabbit.api.security.user.Authorizable;
 import org.apache.jackrabbit.api.security.user.Group;
@@ -49,7 +49,7 @@ import org.apache.sling.auth.core.Authen
  */
 public class SlingWebConsoleSecurityProvider2
     extends AbstractWebConsoleSecurityProvider
-    implements WebConsoleSecurityProvider2 {
+    implements WebConsoleSecurityProvider3 {
 
     private final AuthenticationSupport authentiationSupport;
 
@@ -63,6 +63,7 @@ public class SlingWebConsoleSecurityProv
     /**
      * @see org.apache.felix.webconsole.WebConsoleSecurityProvider2#authenticate(javax.servlet.http.HttpServletRequest,
javax.servlet.http.HttpServletResponse)
      */
+    @Override
     public boolean authenticate(final HttpServletRequest request,
             final HttpServletResponse response) {
         if ( this.authentiationSupport.handleSecurity(request, response) ) {
@@ -88,11 +89,17 @@ public class SlingWebConsoleSecurityProv
             }
             if (request.getAuthType() == null) {
                 this.authenticator.login(request, response);
-            }            
+            }
         }
         return false;
     }
 
+    @Override
+    public void logout(HttpServletRequest request, HttpServletResponse response) {
+        this.authenticator.logout(request, response);
+    }
+
+    @Override
     public User authenticate(String userName, String password) {
         return null; // this method is never invoked
     }
@@ -138,6 +145,7 @@ public class SlingWebConsoleSecurityProv
      * All users authenticated with the repository and being a member of the
      * authorized groups are granted access for all roles in the Web Console.
      */
+    @Override
     public boolean authorize(Object user, String role) {
         logger.debug("authorize: Grant user {} access for role {}", user, role);
         return true;

Added: sling/trunk/bundles/extensions/webconsolesecurityprovider/src/main/resources/OSGI-INF/metatype/org.apache.sling.extensions.webconsolesecurityprovider.internal.SlingWebConsoleSecurityProvider.properties
URL: http://svn.apache.org/viewvc/sling/trunk/bundles/extensions/webconsolesecurityprovider/src/main/resources/OSGI-INF/metatype/org.apache.sling.extensions.webconsolesecurityprovider.internal.SlingWebConsoleSecurityProvider.properties?rev=1767718&view=auto
==============================================================================
--- sling/trunk/bundles/extensions/webconsolesecurityprovider/src/main/resources/OSGI-INF/metatype/org.apache.sling.extensions.webconsolesecurityprovider.internal.SlingWebConsoleSecurityProvider.properties
(added)
+++ sling/trunk/bundles/extensions/webconsolesecurityprovider/src/main/resources/OSGI-INF/metatype/org.apache.sling.extensions.webconsolesecurityprovider.internal.SlingWebConsoleSecurityProvider.properties
Wed Nov  2 16:27:15 2016
@@ -0,0 +1,24 @@
+#
+#  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.
+#
+org.apache.sling.extensions.webconsolesecurityprovider.internal.SlingWebConsoleSecurityProvider.users.name=User
Names
+org.apache.sling.extensions.webconsolesecurityprovider.internal.SlingWebConsoleSecurityProvider.users.description=Names
of users granted full access to the Apache Felix Web Console. By default this lists the "admin"
user. A maximum of 20 users may be configured. Administrators are encouraged to create a group
whose members are to be granted access to Web Console instead of allowing access to individual
users.
+org.apache.sling.extensions.webconsolesecurityprovider.internal.SlingWebConsoleSecurityProvider.groups.description=Names
of groups whose members are granted full access to the Apache Felix Web Console. The default
lists no groups. Administrators are encouraged to create a group whose members are to be granted
access to the Web Console. A maximum of 20 groups may be configured. Using groups to control
access requires a Jackrabbit based repository.
+org.apache.sling.extensions.webconsolesecurityprovider.internal.SlingWebConsoleSecurityProvider.groups.name=Group
Names
+org.apache.sling.extensions.webconsolesecurityprovider.internal.SlingWebConsoleSecurityProvider.description=Configuration
for the security provider used to verfiy user credentials and grant access to the Apache Felix
Web Console based on registered JCR Repository users.
+org.apache.sling.extensions.webconsolesecurityprovider.internal.SlingWebConsoleSecurityProvider.name=Apache
Sling Web Console Security Provider

Propchange: sling/trunk/bundles/extensions/webconsolesecurityprovider/src/main/resources/OSGI-INF/metatype/org.apache.sling.extensions.webconsolesecurityprovider.internal.SlingWebConsoleSecurityProvider.properties
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: sling/trunk/bundles/extensions/webconsolesecurityprovider/src/main/resources/OSGI-INF/metatype/org.apache.sling.extensions.webconsolesecurityprovider.internal.SlingWebConsoleSecurityProvider.properties
------------------------------------------------------------------------------
    svn:keywords = Id

Added: sling/trunk/bundles/extensions/webconsolesecurityprovider/src/main/resources/OSGI-INF/metatype/org.apache.sling.extensions.webconsolesecurityprovider.internal.SlingWebConsoleSecurityProvider.xml
URL: http://svn.apache.org/viewvc/sling/trunk/bundles/extensions/webconsolesecurityprovider/src/main/resources/OSGI-INF/metatype/org.apache.sling.extensions.webconsolesecurityprovider.internal.SlingWebConsoleSecurityProvider.xml?rev=1767718&view=auto
==============================================================================
--- sling/trunk/bundles/extensions/webconsolesecurityprovider/src/main/resources/OSGI-INF/metatype/org.apache.sling.extensions.webconsolesecurityprovider.internal.SlingWebConsoleSecurityProvider.xml
(added)
+++ sling/trunk/bundles/extensions/webconsolesecurityprovider/src/main/resources/OSGI-INF/metatype/org.apache.sling.extensions.webconsolesecurityprovider.internal.SlingWebConsoleSecurityProvider.xml
Wed Nov  2 16:27:15 2016
@@ -0,0 +1,26 @@
+<?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/org.apache.sling.extensions.webconsolesecurityprovider.internal.SlingWebConsoleSecurityProvider">
+    <OCD id="org.apache.sling.extensions.webconsolesecurityprovider.internal.SlingWebConsoleSecurityProvider"
name="%org.apache.sling.extensions.webconsolesecurityprovider.internal.SlingWebConsoleSecurityProvider.name"
description="%org.apache.sling.extensions.webconsolesecurityprovider.internal.SlingWebConsoleSecurityProvider.description">
+        <AD id="users" type="String" default="admin" name="%org.apache.sling.extensions.webconsolesecurityprovider.internal.SlingWebConsoleSecurityProvider.users.name"
description="%org.apache.sling.extensions.webconsolesecurityprovider.internal.SlingWebConsoleSecurityProvider.users.description"
cardinality="20"/>
+        <AD id="groups" type="String" name="%org.apache.sling.extensions.webconsolesecurityprovider.internal.SlingWebConsoleSecurityProvider.groups.name"
description="%org.apache.sling.extensions.webconsolesecurityprovider.internal.SlingWebConsoleSecurityProvider.groups.description"
cardinality="20"/>
+    </OCD>
+    <Designate pid="org.apache.sling.extensions.webconsolesecurityprovider.internal.SlingWebConsoleSecurityProvider">
+        <Object ocdref="org.apache.sling.extensions.webconsolesecurityprovider.internal.SlingWebConsoleSecurityProvider"/>
+    </Designate>
+</metatype:MetaData>

Propchange: sling/trunk/bundles/extensions/webconsolesecurityprovider/src/main/resources/OSGI-INF/metatype/org.apache.sling.extensions.webconsolesecurityprovider.internal.SlingWebConsoleSecurityProvider.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: sling/trunk/bundles/extensions/webconsolesecurityprovider/src/main/resources/OSGI-INF/metatype/org.apache.sling.extensions.webconsolesecurityprovider.internal.SlingWebConsoleSecurityProvider.xml
------------------------------------------------------------------------------
    svn:keywords = Id



Mime
View raw message