[CONF] Apache Sling Status Report December 2013
Status Report December 2013 Page edited by Bertrand Delacretaz Changes (3) ... Amit Gupta, Chetan Mehrotra Last PMC member addition was Mike Mueller, September 2010. Releases * Apache Sling Resource-Based Discovery Service 1.0.2 (December 3rd, 2013) ... * Apache Sling Commons Log 3.0.2 (September 12th, 2013) Documentation Documentation and infrastructure * Website has moved to Apache CMS ... Full Content December Board Report (not submitted yet) Apache Sling is an OSGI-based scriptable web framework that uses a Java Content Repository, such as Apache Jackrabbit, to store and manage content. There are no issues which require board attention at the moment. Community Good activity level overall, contributions from different people continue. 2 new committers: Amit Gupta, Chetan Mehrotra Last PMC member addition was Mike Mueller, September 2010. Releases Apache Sling Resource-Based Discovery Service 1.0.2 (December 3rd, 2013) Apache Sling Testing Utilities 2.0.16 (November 27th, 2013) Apache Sling Web Console Security Provider 1.1.0 (October 28th, 2013) Apache Sling Event 3.3.0, Apache Sling Commons Scheduler 2.4.2, Apache Sling Commons Threads 3.2.0, Apache Sling Health Check Core 1.0.6, Apache Sling Health Check JMX 1.0.6, Apache Sling JMX Resource Provider 0.6.0 (October 24th, 2013) Apache Sling Engine 2.2.10 (October 12th, 2013) Apache Sling Auth Core 1.1.4, Apache Sling Commons Scheduler 2.4.0, Apache Sling Resource Inventory 0.5.0, Apache Sling JMX Resource Provider 0.5.0 (October 7th, 2013) Apache Sling Health Check Tools: org.apache.sling.hc.core-1.0.4,org.apache.sling.hc.it-1.0.4,org.apache.sling.hc.jmx-1.0.4,org.apache.sling.hc.samples-1.0.4,org.apache.sling.hc.support-1.0.4,org.apache.sling.hc.webconsole-1.0.4,org.apache.sling.junit.healthcheck-1.0.6 (September 30th, 2013) Apache Sling Commons Log 3.0.2 (September 12th, 2013) Documentation and infrastructure Website has moved to Apache CMS Dist folder has moved to svn Project Branding is tracked in SLING-2696. Stop watching space | Change email notification preferences View Online | View Changes | Add Comment
svn commit: r1549565 - /sling/whiteboard/bdelacretaz/request-context/src/main/java/org/apache/sling/requestcontext/api/SlingRequestContext.java
Author: bdelacretaz Date: Mon Dec 9 12:50:49 2013 New Revision: 1549565 URL: http://svn.apache.org/r1549565 Log: Note problem with nested requests Modified: sling/whiteboard/bdelacretaz/request-context/src/main/java/org/apache/sling/requestcontext/api/SlingRequestContext.java Modified: sling/whiteboard/bdelacretaz/request-context/src/main/java/org/apache/sling/requestcontext/api/SlingRequestContext.java URL: http://svn.apache.org/viewvc/sling/whiteboard/bdelacretaz/request-context/src/main/java/org/apache/sling/requestcontext/api/SlingRequestContext.java?rev=1549565r1=1549564r2=1549565view=diff == --- sling/whiteboard/bdelacretaz/request-context/src/main/java/org/apache/sling/requestcontext/api/SlingRequestContext.java (original) +++ sling/whiteboard/bdelacretaz/request-context/src/main/java/org/apache/sling/requestcontext/api/SlingRequestContext.java Mon Dec 9 12:50:49 2013 @@ -46,6 +46,11 @@ public class SlingRequestContext extends public SlingRequestContext(SlingHttpServletRequest request) { this.request = request; + +// TODO with this we'll have a single request context +// shared between the main requests and the ones that +// are caused by including other content in it. Using +// a stack of request contexts should fix that. request.setAttribute(this.getClass().getName(), this); put(USER_MAP_NAME, new HashMapString, Object()); @@ -102,4 +107,4 @@ public class SlingRequestContext extends public boolean isReadyOnly() { return readOnly; } -} \ No newline at end of file +}
svn commit: r1549566 - in /sling/trunk/bundles/resourceresolver/src/test/java/org/apache/sling/resourceresolver/impl: IgnoredResourcesTest.java ResourceDecorationTest.java ResourceDecoratorReturnsNull
Author: bdelacretaz Date: Mon Dec 9 13:19:11 2013 New Revision: 1549566 URL: http://svn.apache.org/r1549566 Log: SLING-3269 - expose cases where ResourceDecorator returning null is not handled as specified Added: sling/trunk/bundles/resourceresolver/src/test/java/org/apache/sling/resourceresolver/impl/ResourceDecoratorReturnsNullTest.java - copied, changed from r1549565, sling/trunk/bundles/resourceresolver/src/test/java/org/apache/sling/resourceresolver/impl/IgnoredResourcesTest.java Removed: sling/trunk/bundles/resourceresolver/src/test/java/org/apache/sling/resourceresolver/impl/IgnoredResourcesTest.java Modified: sling/trunk/bundles/resourceresolver/src/test/java/org/apache/sling/resourceresolver/impl/ResourceDecorationTest.java Modified: sling/trunk/bundles/resourceresolver/src/test/java/org/apache/sling/resourceresolver/impl/ResourceDecorationTest.java URL: http://svn.apache.org/viewvc/sling/trunk/bundles/resourceresolver/src/test/java/org/apache/sling/resourceresolver/impl/ResourceDecorationTest.java?rev=1549566r1=1549565r2=1549566view=diff == --- sling/trunk/bundles/resourceresolver/src/test/java/org/apache/sling/resourceresolver/impl/ResourceDecorationTest.java (original) +++ sling/trunk/bundles/resourceresolver/src/test/java/org/apache/sling/resourceresolver/impl/ResourceDecorationTest.java Mon Dec 9 13:19:11 2013 @@ -18,6 +18,7 @@ */ package org.apache.sling.resourceresolver.impl; +import static org.junit.Assert.assertNull; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertNotNull; import static org.junit.Assert.assertTrue; @@ -59,13 +60,25 @@ public class ResourceDecorationTest exte } @Test -public void rootIsDecorated() { +public void resolveRootIsDecorated() { final Resource r = resolver.resolve((String)null); assertDecorated(r); assertExistent(r, true); } @Test +public void getRootIsDecorated() { +final Resource r = resolver.getResource(/); +assertDecorated(r); +assertExistent(r, true); +} + +@Test +public void getNonExistingIsNull() { +assertNull(resolver.getResource(/non-existing/something)); +} + +@Test public void existentIsDecorated() { final Resource r = resolver.resolve(/tmp/C); assertDecorated(r); Copied: sling/trunk/bundles/resourceresolver/src/test/java/org/apache/sling/resourceresolver/impl/ResourceDecoratorReturnsNullTest.java (from r1549565, sling/trunk/bundles/resourceresolver/src/test/java/org/apache/sling/resourceresolver/impl/IgnoredResourcesTest.java) URL: http://svn.apache.org/viewvc/sling/trunk/bundles/resourceresolver/src/test/java/org/apache/sling/resourceresolver/impl/ResourceDecoratorReturnsNullTest.java?p2=sling/trunk/bundles/resourceresolver/src/test/java/org/apache/sling/resourceresolver/impl/ResourceDecoratorReturnsNullTest.javap1=sling/trunk/bundles/resourceresolver/src/test/java/org/apache/sling/resourceresolver/impl/IgnoredResourcesTest.javar1=1549565r2=1549566rev=1549566view=diff == --- sling/trunk/bundles/resourceresolver/src/test/java/org/apache/sling/resourceresolver/impl/IgnoredResourcesTest.java (original) +++ sling/trunk/bundles/resourceresolver/src/test/java/org/apache/sling/resourceresolver/impl/ResourceDecoratorReturnsNullTest.java Mon Dec 9 13:19:11 2013 @@ -34,19 +34,20 @@ import org.apache.sling.api.resource.Res import org.junit.Before; import org.junit.Test; -/** Verify that resources are ignored when ResourceDecorator returns null */ -public class IgnoredResourcesTest extends ResourceDecoratorTestBase { +/** Verify what happens when ResourceDecorator returns null */ +public class ResourceDecoratorReturnsNullTest extends ResourceDecoratorTestBase { -private SetString pathsToIgnore = new HashSetString(); +private SetString pathsThatReturnNull = new HashSetString(); -/** Return null for ignored resources, will cause our - * test ResourceDecorator to return null */ +/** Return null for resources that have a path in pathsThatReturnNull. + * Will cause our test ResourceDecorator to return null for these resources + */ protected Resource wrapResourceForTest(Resource r) { -return isIgnored(r) ? null : r; +return isReturnNull(r) ? null : r; } -private boolean isIgnored(Resource r) { -return pathsToIgnore.contains(r.getPath()); +private boolean isReturnNull(Resource r) { +return pathsThatReturnNull.contains(r.getPath()); } private void assertResources(IteratorResource it, String ...paths) { @@ -57,7 +58,7 @@ public class IgnoredResourcesTest extend final Resource r = it.next(); // TODO should not get any null
svn commit: r1549567 [5/5] - in /sling/trunk/contrib/extensions/replication: ./ src/main/java/org/apache/sling/replication/agent/ src/main/java/org/apache/sling/replication/agent/impl/ src/main/java/o
Added: sling/trunk/contrib/extensions/replication/src/test/java/org/apache/sling/replication/transport/authentication/impl/NopTransportAuthenticationProviderTest.java URL: http://svn.apache.org/viewvc/sling/trunk/contrib/extensions/replication/src/test/java/org/apache/sling/replication/transport/authentication/impl/NopTransportAuthenticationProviderTest.java?rev=1549567view=auto == --- sling/trunk/contrib/extensions/replication/src/test/java/org/apache/sling/replication/transport/authentication/impl/NopTransportAuthenticationProviderTest.java (added) +++ sling/trunk/contrib/extensions/replication/src/test/java/org/apache/sling/replication/transport/authentication/impl/NopTransportAuthenticationProviderTest.java Mon Dec 9 13:37:48 2013 @@ -0,0 +1,65 @@ +/* + * 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.sling.replication.transport.authentication.impl; + +import org.apache.http.client.fluent.Executor; +import org.apache.sling.replication.communication.ReplicationEndpoint; +import org.apache.sling.replication.transport.authentication.TransportAuthenticationContext; +import org.junit.Test; + +import static org.junit.Assert.assertEquals; + +/** + * Testcase for {@link NopTransportAuthenticationProvider} + */ +public class NopTransportAuthenticationProviderTest { + +@Test +public void testAuthenticationWithNullAuthenticableAndContext() throws Exception { +NopTransportAuthenticationProvider authenticationHandler = new NopTransportAuthenticationProvider(); +Object authenticable = null; +TransportAuthenticationContext context = null; +assertEquals(authenticable, authenticationHandler.authenticate(authenticable, context)); +} + +@Test +public void testAuthenticationWithAuthenticableAndNullContext() throws Exception { +NopTransportAuthenticationProvider authenticationHandler = new NopTransportAuthenticationProvider(); +Executor authenticable = Executor.newInstance(); +TransportAuthenticationContext context = null; +assertEquals(authenticable, authenticationHandler.authenticate(authenticable, context)); +} + +@Test +public void testAuthenticationWithAuthenticableAndEmptyContext() throws Exception { +NopTransportAuthenticationProvider authenticationHandler = new NopTransportAuthenticationProvider(); +Executor authenticable = Executor.newInstance(); +TransportAuthenticationContext context = new TransportAuthenticationContext(); +assertEquals(authenticable, authenticationHandler.authenticate(authenticable, context)); +} + +@Test +public void testAuthenticationWithAuthenticableAndCorrectContext() throws Exception { +NopTransportAuthenticationProvider authenticationHandler = new NopTransportAuthenticationProvider(); +Executor authenticable = Executor.newInstance(); +TransportAuthenticationContext context = new TransportAuthenticationContext(); +context.addAttribute(endpoint, new ReplicationEndpoint(http://www.apache.org;)); +assertEquals(authenticable, authenticationHandler.authenticate(authenticable, context)); +} +} Added: sling/trunk/contrib/extensions/replication/src/test/java/org/apache/sling/replication/transport/authentication/impl/UserCredentialsTransportAuthenticationProviderTest.java URL: http://svn.apache.org/viewvc/sling/trunk/contrib/extensions/replication/src/test/java/org/apache/sling/replication/transport/authentication/impl/UserCredentialsTransportAuthenticationProviderTest.java?rev=1549567view=auto == --- sling/trunk/contrib/extensions/replication/src/test/java/org/apache/sling/replication/transport/authentication/impl/UserCredentialsTransportAuthenticationProviderTest.java (added) +++ sling/trunk/contrib/extensions/replication/src/test/java/org/apache/sling/replication/transport/authentication/impl/UserCredentialsTransportAuthenticationProviderTest.java Mon Dec 9 13:37:48 2013 @@ -0,0 +1,84 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or
svn commit: r1549707 - in /sling/trunk/bundles/jcr/resource/src/main/java/org/apache/sling/jcr/resource: JcrPropertyMap.java internal/JcrModifiableValueMap.java
Author: cziegeler Date: Mon Dec 9 23:35:26 2013 New Revision: 1549707 URL: http://svn.apache.org/r1549707 Log: SLING-3249 : Cache not properly used in JcrPropertyMap Modified: sling/trunk/bundles/jcr/resource/src/main/java/org/apache/sling/jcr/resource/JcrPropertyMap.java sling/trunk/bundles/jcr/resource/src/main/java/org/apache/sling/jcr/resource/internal/JcrModifiableValueMap.java Modified: sling/trunk/bundles/jcr/resource/src/main/java/org/apache/sling/jcr/resource/JcrPropertyMap.java URL: http://svn.apache.org/viewvc/sling/trunk/bundles/jcr/resource/src/main/java/org/apache/sling/jcr/resource/JcrPropertyMap.java?rev=1549707r1=1549706r2=1549707view=diff == --- sling/trunk/bundles/jcr/resource/src/main/java/org/apache/sling/jcr/resource/JcrPropertyMap.java (original) +++ sling/trunk/bundles/jcr/resource/src/main/java/org/apache/sling/jcr/resource/JcrPropertyMap.java Mon Dec 9 23:35:26 2013 @@ -336,9 +336,10 @@ public class JcrPropertyMap return null; } -// if the node has been completely read we can directly return -if ( fullyRead ) { -return cache.get(name); +// check cache +JcrPropertyMapCacheEntry cachedValued = cache.get(name); +if ( fullyRead || cachedValued != null ) { +return cachedValued; } try { Modified: sling/trunk/bundles/jcr/resource/src/main/java/org/apache/sling/jcr/resource/internal/JcrModifiableValueMap.java URL: http://svn.apache.org/viewvc/sling/trunk/bundles/jcr/resource/src/main/java/org/apache/sling/jcr/resource/internal/JcrModifiableValueMap.java?rev=1549707r1=1549706r2=1549707view=diff == --- sling/trunk/bundles/jcr/resource/src/main/java/org/apache/sling/jcr/resource/internal/JcrModifiableValueMap.java (original) +++ sling/trunk/bundles/jcr/resource/src/main/java/org/apache/sling/jcr/resource/internal/JcrModifiableValueMap.java Mon Dec 9 23:35:26 2013 @@ -327,9 +327,10 @@ public final class JcrModifiableValueMap return null; } -// if the node has been completely read we can directly return -if ( fullyRead ) { -return cache.get(name); +// check cache +JcrPropertyMapCacheEntry cachedValued = cache.get(name); +if ( fullyRead || cachedValued != null ) { +return cachedValued; } try {
[CONF] Apache Sling Status Report December 2013
Status Report December 2013 Page edited by Carsten Ziegeler Changes (1) {excerpt}December Board Report (not submitted yet){excerpt} (submitted 10-DEC-2013){excerpt} Apache Sling is an OSGI-based scriptable web framework that uses a Java Content Repository, such as Apache Jackrabbit, to store and manage content. ... Full Content December Board Report (submitted 10-DEC-2013) Apache Sling is an OSGI-based scriptable web framework that uses a Java Content Repository, such as Apache Jackrabbit, to store and manage content. There are no issues which require board attention at the moment. Community Good activity level overall, contributions from different people continue. 2 new committers: Amit Gupta, Chetan Mehrotra Last PMC member addition was Mike Mueller, September 2010. Releases Apache Sling Resource-Based Discovery Service 1.0.2 (December 3rd, 2013) Apache Sling Testing Utilities 2.0.16 (November 27th, 2013) Apache Sling Web Console Security Provider 1.1.0 (October 28th, 2013) Apache Sling Event 3.3.0, Apache Sling Commons Scheduler 2.4.2, Apache Sling Commons Threads 3.2.0, Apache Sling Health Check Core 1.0.6, Apache Sling Health Check JMX 1.0.6, Apache Sling JMX Resource Provider 0.6.0 (October 24th, 2013) Apache Sling Engine 2.2.10 (October 12th, 2013) Apache Sling Auth Core 1.1.4, Apache Sling Commons Scheduler 2.4.0, Apache Sling Resource Inventory 0.5.0, Apache Sling JMX Resource Provider 0.5.0 (October 7th, 2013) Apache Sling Health Check Tools: org.apache.sling.hc.core-1.0.4,org.apache.sling.hc.it-1.0.4,org.apache.sling.hc.jmx-1.0.4,org.apache.sling.hc.samples-1.0.4,org.apache.sling.hc.support-1.0.4,org.apache.sling.hc.webconsole-1.0.4,org.apache.sling.junit.healthcheck-1.0.6 (September 30th, 2013) Apache Sling Commons Log 3.0.2 (September 12th, 2013) Documentation and infrastructure Website has moved to Apache CMS Dist folder has moved to svn Project Branding is tracked in SLING-2696. Stop watching space | Change email notification preferences View Online | View Changes | Add Comment
svn commit: r1549720 - /sling/trunk/tooling/maven/maven-jspc-plugin/pom.xml
Author: cziegeler Date: Tue Dec 10 00:38:46 2013 New Revision: 1549720 URL: http://svn.apache.org/r1549720 Log: [maven-release-plugin] prepare release maven-jspc-plugin-2.0.8 Modified: sling/trunk/tooling/maven/maven-jspc-plugin/pom.xml Modified: sling/trunk/tooling/maven/maven-jspc-plugin/pom.xml URL: http://svn.apache.org/viewvc/sling/trunk/tooling/maven/maven-jspc-plugin/pom.xml?rev=1549720r1=1549719r2=1549720view=diff == --- sling/trunk/tooling/maven/maven-jspc-plugin/pom.xml (original) +++ sling/trunk/tooling/maven/maven-jspc-plugin/pom.xml Tue Dec 10 00:38:46 2013 @@ -29,7 +29,7 @@ groupIdorg.apache.sling/groupId artifactIdmaven-jspc-plugin/artifactId -version2.0.7-SNAPSHOT/version +version2.0.8/version packagingmaven-plugin/packaging nameApache Sling Maven Plugin for Compiling JSP Sources into Bundles/name @@ -38,9 +38,9 @@ /description scm - connectionscm:svn:http://svn.apache.org/repos/asf/sling/trunk/tooling/maven/maven-jspc-plugin/connection - developerConnectionscm:svn:https://svn.apache.org/repos/asf/sling/trunk/tooling/maven/maven-jspc-plugin/developerConnection - urlhttp://svn.apache.org/viewvc/sling/trunk/tooling/maven/maven-jspc-plugin/url + connectionscm:svn:http://svn.apache.org/repos/asf/sling/tags/maven-jspc-plugin-2.0.8/connection + developerConnectionscm:svn:https://svn.apache.org/repos/asf/sling/tags/maven-jspc-plugin-2.0.8/developerConnection + urlhttp://svn.apache.org/viewvc/sling/tags/maven-jspc-plugin-2.0.8/url /scm reporting
svn commit: r1549722 - /sling/trunk/tooling/maven/maven-jspc-plugin/pom.xml
Author: cziegeler Date: Tue Dec 10 00:38:53 2013 New Revision: 1549722 URL: http://svn.apache.org/r1549722 Log: [maven-release-plugin] prepare for next development iteration Modified: sling/trunk/tooling/maven/maven-jspc-plugin/pom.xml Modified: sling/trunk/tooling/maven/maven-jspc-plugin/pom.xml URL: http://svn.apache.org/viewvc/sling/trunk/tooling/maven/maven-jspc-plugin/pom.xml?rev=1549722r1=1549721r2=1549722view=diff == --- sling/trunk/tooling/maven/maven-jspc-plugin/pom.xml (original) +++ sling/trunk/tooling/maven/maven-jspc-plugin/pom.xml Tue Dec 10 00:38:53 2013 @@ -29,7 +29,7 @@ groupIdorg.apache.sling/groupId artifactIdmaven-jspc-plugin/artifactId -version2.0.8/version +version2.0.9-SNAPSHOT/version packagingmaven-plugin/packaging nameApache Sling Maven Plugin for Compiling JSP Sources into Bundles/name @@ -38,9 +38,9 @@ /description scm - connectionscm:svn:http://svn.apache.org/repos/asf/sling/tags/maven-jspc-plugin-2.0.8/connection - developerConnectionscm:svn:https://svn.apache.org/repos/asf/sling/tags/maven-jspc-plugin-2.0.8/developerConnection - urlhttp://svn.apache.org/viewvc/sling/tags/maven-jspc-plugin-2.0.8/url + connectionscm:svn:http://svn.apache.org/repos/asf/sling/trunk/tooling/maven/maven-jspc-plugin/connection + developerConnectionscm:svn:https://svn.apache.org/repos/asf/sling/trunk/tooling/maven/maven-jspc-plugin/developerConnection + urlhttp://svn.apache.org/viewvc/sling/trunk/tooling/maven/maven-jspc-plugin/url /scm reporting
svn commit: r1549721 - /sling/tags/maven-jspc-plugin-2.0.8/
Author: cziegeler Date: Tue Dec 10 00:38:50 2013 New Revision: 1549721 URL: http://svn.apache.org/r1549721 Log: [maven-release-plugin] copy for tag maven-jspc-plugin-2.0.8 Added: sling/tags/maven-jspc-plugin-2.0.8/ - copied from r1549720, sling/trunk/tooling/maven/maven-jspc-plugin/
Nexus: Staging Completed.
Description:JSPC PluginDetails:The following artifacts have been staged to the org.apache.sling-032 (u:cziegeler, a:119.225.143.2) repository.archetype-catalog.xmlmaven-jspc-plugin-2.0.8.pom.ascmaven-jspc-plugin-2.0.8-sources.jarmaven-jspc-plugin-2.0.8-sources.jar.ascmaven-jspc-plugin-2.0.8-javadoc.jarmaven-jspc-plugin-2.0.8.pommaven-jspc-plugin-2.0.8-javadoc.jar.ascmaven-jspc-plugin-2.0.8.jarmaven-jspc-plugin-2.0.8-source-release.zip.ascmaven-jspc-plugin-2.0.8.jar.ascmaven-jspc-plugin-2.0.8-source-release.zip
svn commit: r1549754 - in /sling/trunk/bundles/extensions/webconsolesecurityprovider: ./ src/main/java/org/apache/sling/extensions/webconsolesecurityprovider/internal/
Author: cziegeler Date: Tue Dec 10 04:07:10 2013 New Revision: 1549754 URL: http://svn.apache.org/r1549754 Log: SLING-3271 : Make Sling imports dynamic Modified: sling/trunk/bundles/extensions/webconsolesecurityprovider/pom.xml sling/trunk/bundles/extensions/webconsolesecurityprovider/src/main/java/org/apache/sling/extensions/webconsolesecurityprovider/internal/ServicesListener.java 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=1549754r1=1549753r2=1549754view=diff == --- sling/trunk/bundles/extensions/webconsolesecurityprovider/pom.xml (original) +++ sling/trunk/bundles/extensions/webconsolesecurityprovider/pom.xml Tue Dec 10 04:07:10 2013 @@ -61,6 +61,15 @@ Bundle-Activator org.apache.sling.extensions.webconsolesecurityprovider.internal.Activator /Bundle-Activator +Import-Package +!org.apache.sling.auth.core, +!org.apache.sling.api.resource, +* +/Import-Package +DynamicImport-Package +org.apache.sling.api.resource;version=[2.3,3), +org.apache.sling.auth.core;version=[1.0,2) +/DynamicImport-Package /instructions /configuration /plugin Modified: sling/trunk/bundles/extensions/webconsolesecurityprovider/src/main/java/org/apache/sling/extensions/webconsolesecurityprovider/internal/ServicesListener.java URL: http://svn.apache.org/viewvc/sling/trunk/bundles/extensions/webconsolesecurityprovider/src/main/java/org/apache/sling/extensions/webconsolesecurityprovider/internal/ServicesListener.java?rev=1549754r1=1549753r2=1549754view=diff == --- sling/trunk/bundles/extensions/webconsolesecurityprovider/src/main/java/org/apache/sling/extensions/webconsolesecurityprovider/internal/ServicesListener.java (original) +++ sling/trunk/bundles/extensions/webconsolesecurityprovider/src/main/java/org/apache/sling/extensions/webconsolesecurityprovider/internal/ServicesListener.java Tue Dec 10 04:07:10 2013 @@ -41,6 +41,9 @@ import org.osgi.service.cm.ManagedServic */ public class ServicesListener { +private static final String AUTH_SUPPORT_CLASS = AuthenticationSupport.class.getName(); +private static final String REPO_CLASS = Repository.class.getName(); + /** The bundle context. */ private final BundleContext bundleContext; @@ -50,10 +53,6 @@ public class ServicesListener { /** The listener for the authentication support. */ private final Listener authSupportListener; -private final SlingWebConsoleSecurityProvider provider = new SlingWebConsoleSecurityProvider(); - -private final SlingWebConsoleSecurityProvider2 provider2 = new SlingWebConsoleSecurityProvider2(); - private enum State { NONE, PROVIDER, @@ -69,14 +68,13 @@ public class ServicesListener { /** The registration for the provider2 */ private ServiceRegistration provider2Reg; - /** * Start listeners */ public ServicesListener(final BundleContext bundleContext) { this.bundleContext = bundleContext; -this.authSupportListener = new Listener(AuthenticationSupport.class.getName()); -this.repositoryListener = new Listener(Repository.class.getName()); +this.authSupportListener = new Listener(AUTH_SUPPORT_CLASS); +this.repositoryListener = new Listener(REPO_CLASS); this.authSupportListener.start(); this.repositoryListener.start(); } @@ -86,8 +84,8 @@ public class ServicesListener { */ public synchronized void notifyChange() { // check if all services are available -final AuthenticationSupport authSupport = (AuthenticationSupport)this.authSupportListener.getService(); -final Repository repository = (Repository)this.repositoryListener.getService(); +final Object authSupport = this.authSupportListener.getService(); +final Object repository = this.repositoryListener.getService(); if ( registrationState == State.NONE ) { if ( authSupport != null ) { registerProvider2(authSupport); @@ -101,8 +99,6
svn commit: r1549756 - /sling/trunk/contrib/commons/compiler/pom.xml
Author: cziegeler Date: Tue Dec 10 04:37:07 2013 New Revision: 1549756 URL: http://svn.apache.org/r1549756 Log: Add explicitely dependency to OSGi core to avoid framework import of [1.7,2) Modified: sling/trunk/contrib/commons/compiler/pom.xml Modified: sling/trunk/contrib/commons/compiler/pom.xml URL: http://svn.apache.org/viewvc/sling/trunk/contrib/commons/compiler/pom.xml?rev=1549756r1=1549755r2=1549756view=diff == --- sling/trunk/contrib/commons/compiler/pom.xml (original) +++ sling/trunk/contrib/commons/compiler/pom.xml Tue Dec 10 04:37:07 2013 @@ -88,6 +88,10 @@ dependencies dependency +groupIdorg.osgi/groupId +artifactIdorg.osgi.core/artifactId +/dependency +dependency groupIdorg.apache.felix/groupId artifactIdorg.apache.felix.scr.annotations/artifactId /dependency
svn commit: r1549757 - in /sling/trunk/bundles/extensions/webconsolesecurityprovider: ./ src/main/java/org/apache/sling/extensions/webconsolesecurityprovider/internal/
Author: cziegeler Date: Tue Dec 10 04:40:48 2013 New Revision: 1549757 URL: http://svn.apache.org/r1549757 Log: SLING-3272 : Only register security provider 2 if startup is finished Modified: sling/trunk/bundles/extensions/webconsolesecurityprovider/pom.xml sling/trunk/bundles/extensions/webconsolesecurityprovider/src/main/java/org/apache/sling/extensions/webconsolesecurityprovider/internal/Activator.java sling/trunk/bundles/extensions/webconsolesecurityprovider/src/main/java/org/apache/sling/extensions/webconsolesecurityprovider/internal/ServicesListener.java Modified: sling/trunk/bundles/extensions/webconsolesecurityprovider/pom.xml URL: http://svn.apache.org/viewvc/sling/trunk/bundles/extensions/webconsolesecurityprovider/pom.xml?rev=1549757r1=1549756r2=1549757view=diff == --- sling/trunk/bundles/extensions/webconsolesecurityprovider/pom.xml (original) +++ sling/trunk/bundles/extensions/webconsolesecurityprovider/pom.xml Tue Dec 10 04:40:48 2013 @@ -116,6 +116,12 @@ scopeprovided/scope /dependency dependency +groupIdorg.apache.sling/groupId +artifactIdorg.apache.sling.launchpad.api/artifactId +version1.1.0/version +scopeprovided/scope +/dependency +dependency groupIdjavax.servlet/groupId artifactIdservlet-api/artifactId /dependency Modified: sling/trunk/bundles/extensions/webconsolesecurityprovider/src/main/java/org/apache/sling/extensions/webconsolesecurityprovider/internal/Activator.java URL: http://svn.apache.org/viewvc/sling/trunk/bundles/extensions/webconsolesecurityprovider/src/main/java/org/apache/sling/extensions/webconsolesecurityprovider/internal/Activator.java?rev=1549757r1=1549756r2=1549757view=diff == --- sling/trunk/bundles/extensions/webconsolesecurityprovider/src/main/java/org/apache/sling/extensions/webconsolesecurityprovider/internal/Activator.java (original) +++ sling/trunk/bundles/extensions/webconsolesecurityprovider/src/main/java/org/apache/sling/extensions/webconsolesecurityprovider/internal/Activator.java Tue Dec 10 04:40:48 2013 @@ -16,24 +16,33 @@ */ package org.apache.sling.extensions.webconsolesecurityprovider.internal; +import org.apache.sling.launchpad.api.StartupListener; import org.osgi.framework.BundleActivator; import org.osgi.framework.BundleContext; +import org.osgi.framework.ServiceRegistration; public class Activator implements BundleActivator { private ServicesListener listener; +private ServiceRegistration registration; + /** * @see org.osgi.framework.BundleActivator#start(org.osgi.framework.BundleContext) */ public void start(final BundleContext context) throws Exception { listener = new ServicesListener(context); +registration = context.registerService(StartupListener.class.getName(), listener, null); } /** * @see org.osgi.framework.BundleActivator#stop(org.osgi.framework.BundleContext) */ public void stop(final BundleContext context) throws Exception { +if ( registration != null ) { +registration.unregister(); +registration = null; +} if ( listener != null ) { listener.deactivate(); listener = null; Modified: sling/trunk/bundles/extensions/webconsolesecurityprovider/src/main/java/org/apache/sling/extensions/webconsolesecurityprovider/internal/ServicesListener.java URL: http://svn.apache.org/viewvc/sling/trunk/bundles/extensions/webconsolesecurityprovider/src/main/java/org/apache/sling/extensions/webconsolesecurityprovider/internal/ServicesListener.java?rev=1549757r1=1549756r2=1549757view=diff == --- sling/trunk/bundles/extensions/webconsolesecurityprovider/src/main/java/org/apache/sling/extensions/webconsolesecurityprovider/internal/ServicesListener.java (original) +++ sling/trunk/bundles/extensions/webconsolesecurityprovider/src/main/java/org/apache/sling/extensions/webconsolesecurityprovider/internal/ServicesListener.java Tue Dec 10 04:40:48 2013 @@ -21,11 +21,14 @@ package org.apache.sling.extensions.webc import java.util.Dictionary; import java.util.Hashtable; +import java.util.concurrent.atomic.AtomicBoolean; import javax.jcr.Repository; import org.apache.felix.webconsole.WebConsoleSecurityProvider; import org.apache.sling.auth.core.AuthenticationSupport; +import org.apache.sling.launchpad.api.StartupListener; +import org.apache.sling.launchpad.api.StartupMode; import org.osgi.framework.BundleContext; import org.osgi.framework.Constants; import org.osgi.framework.InvalidSyntaxException; @@ -39,7 +42,7 @@ import org.osgi.service.cm.ManagedServic * The codeServicesListener/code listens for
svn commit: r1549759 - in /sling/trunk/bundles/extensions/webconsolesecurityprovider/src/main/java/org/apache/sling/extensions/webconsolesecurityprovider/internal: ServicesListener.java SlingWebConsol
Author: cziegeler Date: Tue Dec 10 05:23:38 2013 New Revision: 1549759 URL: http://svn.apache.org/r1549759 Log: SLING-3273 : Switch to login page if user is not allowed to access the web console Modified: sling/trunk/bundles/extensions/webconsolesecurityprovider/src/main/java/org/apache/sling/extensions/webconsolesecurityprovider/internal/ServicesListener.java sling/trunk/bundles/extensions/webconsolesecurityprovider/src/main/java/org/apache/sling/extensions/webconsolesecurityprovider/internal/SlingWebConsoleSecurityProvider2.java Modified: sling/trunk/bundles/extensions/webconsolesecurityprovider/src/main/java/org/apache/sling/extensions/webconsolesecurityprovider/internal/ServicesListener.java URL: http://svn.apache.org/viewvc/sling/trunk/bundles/extensions/webconsolesecurityprovider/src/main/java/org/apache/sling/extensions/webconsolesecurityprovider/internal/ServicesListener.java?rev=1549759r1=1549758r2=1549759view=diff == --- sling/trunk/bundles/extensions/webconsolesecurityprovider/src/main/java/org/apache/sling/extensions/webconsolesecurityprovider/internal/ServicesListener.java (original) +++ sling/trunk/bundles/extensions/webconsolesecurityprovider/src/main/java/org/apache/sling/extensions/webconsolesecurityprovider/internal/ServicesListener.java Tue Dec 10 05:23:38 2013 @@ -26,6 +26,7 @@ import java.util.concurrent.atomic.Atomi import javax.jcr.Repository; import org.apache.felix.webconsole.WebConsoleSecurityProvider; +import org.apache.sling.api.auth.Authenticator; import org.apache.sling.auth.core.AuthenticationSupport; import org.apache.sling.launchpad.api.StartupListener; import org.apache.sling.launchpad.api.StartupMode; @@ -45,6 +46,7 @@ import org.osgi.service.cm.ManagedServic public class ServicesListener implements StartupListener { private static final String AUTH_SUPPORT_CLASS = AuthenticationSupport.class.getName(); +private static final String AUTHENTICATOR_CLASS = Authenticator.class.getName(); private static final String REPO_CLASS = Repository.class.getName(); /** The bundle context. */ @@ -56,6 +58,9 @@ public class ServicesListener implements /** The listener for the authentication support. */ private final Listener authSupportListener; +/** The listener for the authenticator. */ +private final Listener authListener; + private enum State { NONE, PROVIDER, @@ -81,8 +86,10 @@ public class ServicesListener implements this.bundleContext = bundleContext; this.authSupportListener = new Listener(AUTH_SUPPORT_CLASS); this.repositoryListener = new Listener(REPO_CLASS); +this.authListener = new Listener(AUTHENTICATOR_CLASS); this.authSupportListener.start(); this.repositoryListener.start(); +this.authListener.start(); } /** @@ -106,7 +113,7 @@ public class ServicesListener implements /** * @see org.apache.sling.launchpad.api.StartupListener#startupProgress(float) */ -public void startupProgress(float arg0) { +public void startupProgress(final float progress) { // nothing to do } @@ -116,16 +123,18 @@ public class ServicesListener implements public synchronized void notifyChange() { // check if all services are available final Object authSupport = this.startupFinished.get() ? this.authSupportListener.getService() : null; +final Object authenticator = this.startupFinished.get() ? this.authListener.getService() : null; +final boolean hasAuthServices = authSupport != null authenticator != null; final Object repository = this.repositoryListener.getService(); if ( registrationState == State.NONE ) { -if ( authSupport != null ) { -registerProvider2(authSupport); +if ( hasAuthServices ) { +registerProvider2(authSupport, authenticator); } else if ( repository != null ) { registerProvider(repository); } } else if ( registrationState == State.PROVIDER ) { -if ( authSupport != null ) { -registerProvider2(authSupport); +if ( hasAuthServices ) { +registerProvider2(authSupport, authenticator); unregisterProvider(); } else if ( repository == null ) { unregisterProvider(); @@ -157,13 +166,14 @@ public class ServicesListener implements } } -private void registerProvider2(final Object authSupport) { +private void registerProvider2(final Object authSupport, final Object authenticator) { final DictionaryString, Object props = new HashtableString, Object(); props.put(Constants.SERVICE_PID, SlingWebConsoleSecurityProvider.class.getName()); props.put(Constants.SERVICE_DESCRIPTION, Apache Sling Web Console
svn commit: r1549760 - /sling/trunk/bundles/extensions/webconsolesecurityprovider/pom.xml
Author: cziegeler Date: Tue Dec 10 05:24:52 2013 New Revision: 1549760 URL: http://svn.apache.org/r1549760 Log: SLING-3273 : Switch to login page if user is not allowed to access the web console Modified: sling/trunk/bundles/extensions/webconsolesecurityprovider/pom.xml Modified: sling/trunk/bundles/extensions/webconsolesecurityprovider/pom.xml URL: http://svn.apache.org/viewvc/sling/trunk/bundles/extensions/webconsolesecurityprovider/pom.xml?rev=1549760r1=1549759r2=1549760view=diff == --- sling/trunk/bundles/extensions/webconsolesecurityprovider/pom.xml (original) +++ sling/trunk/bundles/extensions/webconsolesecurityprovider/pom.xml Tue Dec 10 05:24:52 2013 @@ -63,10 +63,12 @@ /Bundle-Activator Import-Package !org.apache.sling.auth.core, +!org.apache.sling.api.auth, !org.apache.sling.api.resource, * /Import-Package DynamicImport-Package +org.apache.sling.api.auth;version=[1.0,2), org.apache.sling.api.resource;version=[2.3,3), org.apache.sling.auth.core;version=[1.0,2) /DynamicImport-Package
svn commit: r1549762 - /sling/trunk/bundles/extensions/webconsolesecurityprovider/src/main/java/org/apache/sling/extensions/webconsolesecurityprovider/internal/SlingWebConsoleSecurityProvider2.java
Author: cziegeler Date: Tue Dec 10 05:37:09 2013 New Revision: 1549762 URL: http://svn.apache.org/r1549762 Log: SLING-3273 : Switch to login page if user is not allowed to access the web console Modified: sling/trunk/bundles/extensions/webconsolesecurityprovider/src/main/java/org/apache/sling/extensions/webconsolesecurityprovider/internal/SlingWebConsoleSecurityProvider2.java 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=1549762r1=1549761r2=1549762view=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 Tue Dec 10 05:37:09 2013 @@ -51,12 +51,6 @@ public class SlingWebConsoleSecurityProv extends AbstractWebConsoleSecurityProvider implements WebConsoleSecurityProvider2 { -private static final String HEADER_WWW_AUTHENTICATE = WWW-Authenticate; - -private static final String AUTHENTICATION_SCHEME_BASIC = Basic; - -private static final String DEFAULT_REALM = OSGi Management Console; //$NON-NLS-1$ - private final AuthenticationSupport authentiationSupport; private final Authenticator authenticator;
svn commit: r1549763 - /sling/trunk/bundles/auth/core/src/main/java/org/apache/sling/auth/core/impl/AuthenticatorWebConsolePlugin.java
Author: cziegeler Date: Tue Dec 10 05:48:02 2013 New Revision: 1549763 URL: http://svn.apache.org/r1549763 Log: SLING-3271 : Properly xml escape web console output Modified: sling/trunk/bundles/auth/core/src/main/java/org/apache/sling/auth/core/impl/AuthenticatorWebConsolePlugin.java Modified: sling/trunk/bundles/auth/core/src/main/java/org/apache/sling/auth/core/impl/AuthenticatorWebConsolePlugin.java URL: http://svn.apache.org/viewvc/sling/trunk/bundles/auth/core/src/main/java/org/apache/sling/auth/core/impl/AuthenticatorWebConsolePlugin.java?rev=1549763r1=1549762r2=1549763view=diff == --- sling/trunk/bundles/auth/core/src/main/java/org/apache/sling/auth/core/impl/AuthenticatorWebConsolePlugin.java (original) +++ sling/trunk/bundles/auth/core/src/main/java/org/apache/sling/auth/core/impl/AuthenticatorWebConsolePlugin.java Tue Dec 10 05:48:02 2013 @@ -28,6 +28,8 @@ import javax.servlet.http.HttpServlet; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; +import org.apache.sling.api.request.ResponseUtil; + @SuppressWarnings(serial) public class AuthenticatorWebConsolePlugin extends HttpServlet { @@ -76,7 +78,7 @@ public class AuthenticatorWebConsolePlug pw.println(/table); } -private void printAuthenticationHandler(PrintWriter pw) { +private void printAuthenticationHandler(final PrintWriter pw) { pw.println(tr); pw.println(th class='content container' colspan='3'Registered Authentication Handler/td); pw.println(/tr); @@ -86,18 +88,18 @@ public class AuthenticatorWebConsolePlug pw.println(/tr); final MapString, ListString handlerMap = slingAuthenticator.getAuthenticationHandler(); -for (Map.EntryString, ListString handler : handlerMap.entrySet()) { +for (final Map.EntryString, ListString handler : handlerMap.entrySet()) { final String path = handler.getKey(); -for (String name : handler.getValue()) { +for (final String name : handler.getValue()) { pw.println(tr class='content'); -pw.println(td class='content' + path + /td); -pw.println(td class='content' colspan='2' + name + /td); +pw.printf(td class='content'%s/td%n, ResponseUtil.escapeXml(path)); +pw.printf(td class='content' colspan='2'%s/td%n, ResponseUtil.escapeXml(name)); pw.println(/tr); } } } -private void printAuthenticationRequirements(PrintWriter pw) { +private void printAuthenticationRequirements(final PrintWriter pw) { pw.println(tr); pw.println(th class='content container' colspan='3'Authentication Requirement Configuration/td); pw.println(/tr); @@ -108,19 +110,18 @@ public class AuthenticatorWebConsolePlug pw.println(/tr); final ListAuthenticationRequirementHolder holderList = slingAuthenticator.getAuthenticationRequirements(); -for (AuthenticationRequirementHolder req : holderList) { +for (final AuthenticationRequirementHolder req : holderList) { pw.println(tr class='content'); -pw.println(td class='content' + req.fullPath + /td); -pw.println(td class='content' -+ (req.requiresAuthentication() ? Yes : No) + /td); -pw.println(td class='content' + req.getProvider() + /td); +pw.printf(td class='content'%s/td%n, ResponseUtil.escapeXml(req.fullPath)); +pw.printf(td class='content'%s/td%n, (req.requiresAuthentication() ? Yes : No)); +pw.printf(td class='content'%s/td%n, ResponseUtil.escapeXml(req.getProvider())); pw.println(/tr); } } -private void printAuthenticationConfiguration(PrintWriter pw) { +private void printAuthenticationConfiguration(final PrintWriter pw) { final String anonUser = slingAuthenticator.getAnonUserName(); final String sudoCookie = slingAuthenticator.getSudoCookieName(); final String sudoParam = slingAuthenticator.getSudoParameterName(); @@ -131,15 +132,15 @@ public class AuthenticatorWebConsolePlug pw.println(/tr); pw.println(tr); pw.println(td class='content'Impersonation Cookie/td); -pw.printf(td class='content' colspan='2'%s/td%n, sudoCookie); +pw.printf(td class='content' colspan='2'%s/td%n, ResponseUtil.escapeXml(sudoCookie)); pw.println(/tr); pw.println(tr); pw.println(td class='content'Impersonation Parameter/td); -pw.printf(td class='content' colspan='2'%s/td%n, sudoParam); +pw.printf(td class='content' colspan='2'%s/td%n, ResponseUtil.escapeXml(sudoParam)); pw.println(/tr); pw.println(tr); pw.println(td class='content'Anonymous User Name/td); -pw.printf(td
svn commit: r1549772 - /sling/trunk/bundles/api/src/main/java/org/apache/sling/api/request/ResponseUtil.java
Author: cziegeler Date: Tue Dec 10 07:19:59 2013 New Revision: 1549772 URL: http://svn.apache.org/r1549772 Log: 3276 : Escape quotes and double quotes when escaping for XML Modified: sling/trunk/bundles/api/src/main/java/org/apache/sling/api/request/ResponseUtil.java Modified: sling/trunk/bundles/api/src/main/java/org/apache/sling/api/request/ResponseUtil.java URL: http://svn.apache.org/viewvc/sling/trunk/bundles/api/src/main/java/org/apache/sling/api/request/ResponseUtil.java?rev=1549772r1=1549771r2=1549772view=diff == --- sling/trunk/bundles/api/src/main/java/org/apache/sling/api/request/ResponseUtil.java (original) +++ sling/trunk/bundles/api/src/main/java/org/apache/sling/api/request/ResponseUtil.java Tue Dec 10 07:19:59 2013 @@ -68,6 +68,10 @@ public class ResponseUtil { target.write(lt;); } else if(c == '') { target.write(gt;); +} else if(c == '') { +target.write(quot;); +} else if(c == '\'') { +target.write(apos;); } else { target.write(c); } @@ -85,8 +89,8 @@ public class ResponseUtil { } /** Escape xml text */ -public static String escapeXml(String input) { -if(input == null) { +public static String escapeXml(final String input) { +if (input == null) { return null; } @@ -99,6 +103,10 @@ public class ResponseUtil { b.append(lt;); } else if(c == '') { b.append(gt;); +} else if(c == '') { +b.append(quot;); +} else if(c == '\'') { +b.append(apos;); } else { b.append(c); }