Author: cziegeler Date: Mon Oct 13 06:11:58 2014 New Revision: 1631287 URL: http://svn.apache.org/r1631287 Log: SLING-3991 - Support Password Change Upon Expiry Via SimpleCredentials Attribute. Remove compile dependency to latest api
Modified: sling/trunk/bundles/jcr/resource/pom.xml sling/trunk/bundles/jcr/resource/src/main/java/org/apache/sling/jcr/resource/internal/helper/jcr/JcrResourceProviderFactory.java Modified: sling/trunk/bundles/jcr/resource/pom.xml URL: http://svn.apache.org/viewvc/sling/trunk/bundles/jcr/resource/pom.xml?rev=1631287&r1=1631286&r2=1631287&view=diff ============================================================================== --- sling/trunk/bundles/jcr/resource/pom.xml (original) +++ sling/trunk/bundles/jcr/resource/pom.xml Mon Oct 13 06:11:58 2014 @@ -143,7 +143,7 @@ <dependency> <groupId>org.apache.sling</groupId> <artifactId>org.apache.sling.api</artifactId> - <version>2.8.1-SNAPSHOT</version> + <version>2.8.0</version> <scope>provided</scope> </dependency> <dependency> Modified: sling/trunk/bundles/jcr/resource/src/main/java/org/apache/sling/jcr/resource/internal/helper/jcr/JcrResourceProviderFactory.java URL: http://svn.apache.org/viewvc/sling/trunk/bundles/jcr/resource/src/main/java/org/apache/sling/jcr/resource/internal/helper/jcr/JcrResourceProviderFactory.java?rev=1631287&r1=1631286&r2=1631287&view=diff ============================================================================== --- sling/trunk/bundles/jcr/resource/src/main/java/org/apache/sling/jcr/resource/internal/helper/jcr/JcrResourceProviderFactory.java (original) +++ sling/trunk/bundles/jcr/resource/src/main/java/org/apache/sling/jcr/resource/internal/helper/jcr/JcrResourceProviderFactory.java Mon Oct 13 06:11:58 2014 @@ -79,6 +79,11 @@ import org.slf4j.LoggerFactory; }) public class JcrResourceProviderFactory implements ResourceProviderFactory { + /** TODO - this is a copy from ResourceResolverFactory to avoid a dependency to the new 2.8.2 API just for this constants. + * This should be replaced once we update. + */ + private static final String NEW_PASSWORD = "user.newpassword"; + /** Logger */ private final Logger log = LoggerFactory.getLogger(getClass()); @@ -437,8 +442,8 @@ public class JcrResourceProviderFactory } if (creds instanceof SimpleCredentials - && authenticationInfo.get(ResourceResolverFactory.NEW_PASSWORD) instanceof String) { - ((SimpleCredentials) creds).setAttribute(ResourceResolverFactory.NEW_PASSWORD, authenticationInfo.get(ResourceResolverFactory.NEW_PASSWORD)); + && authenticationInfo.get(NEW_PASSWORD) instanceof String) { + ((SimpleCredentials) creds).setAttribute(NEW_PASSWORD, authenticationInfo.get(NEW_PASSWORD)); } return creds;