jackrabbit-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From alexparvule...@apache.org
Subject svn commit: r1614837 - in /jackrabbit/branches/2.8: ./ jackrabbit-core/src/main/java/org/apache/jackrabbit/core/security/authentication/token/ jackrabbit-core/src/test/java/org/apache/jackrabbit/core/security/authentication/token/
Date Thu, 31 Jul 2014 09:07:11 GMT
Author: alexparvulescu
Date: Thu Jul 31 09:07:11 2014
New Revision: 1614837

URL: http://svn.apache.org/r1614837
Log:
JCR-3796 TokenProvider.createToken is case sensitive
 merged rev 1609712 


Added:
    jackrabbit/branches/2.8/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/security/authentication/token/CompatTokenProviderTest.java
      - copied unchanged from r1609712, jackrabbit/trunk/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/security/authentication/token/CompatTokenProviderTest.java
Modified:
    jackrabbit/branches/2.8/   (props changed)
    jackrabbit/branches/2.8/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/security/authentication/token/TokenProvider.java
    jackrabbit/branches/2.8/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/security/authentication/token/TestAll.java
    jackrabbit/branches/2.8/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/security/authentication/token/TokenProviderTest.java

Propchange: jackrabbit/branches/2.8/
------------------------------------------------------------------------------
  Merged /jackrabbit/trunk:r1609712

Modified: jackrabbit/branches/2.8/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/security/authentication/token/TokenProvider.java
URL: http://svn.apache.org/viewvc/jackrabbit/branches/2.8/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/security/authentication/token/TokenProvider.java?rev=1614837&r1=1614836&r2=1614837&view=diff
==============================================================================
--- jackrabbit/branches/2.8/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/security/authentication/token/TokenProvider.java
(original)
+++ jackrabbit/branches/2.8/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/security/authentication/token/TokenProvider.java
Thu Jul 31 09:07:11 2014
@@ -116,7 +116,7 @@ public class TokenProvider extends Prote
      */
     public TokenInfo createToken(User user, SimpleCredentials sc) throws RepositoryException
{
         TokenInfo tokenInfo = null;
-        if (sc != null && user != null && user.getID().equals(sc.getUserID()))
{
+        if (sc != null && user != null && user.getID().equalsIgnoreCase(sc.getUserID()))
{
             String[] attrNames = sc.getAttributeNames();
             Map<String, String> attributes = new HashMap<String, String>(attrNames.length);
             for (String attrName : sc.getAttributeNames()) {

Modified: jackrabbit/branches/2.8/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/security/authentication/token/TestAll.java
URL: http://svn.apache.org/viewvc/jackrabbit/branches/2.8/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/security/authentication/token/TestAll.java?rev=1614837&r1=1614836&r2=1614837&view=diff
==============================================================================
--- jackrabbit/branches/2.8/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/security/authentication/token/TestAll.java
(original)
+++ jackrabbit/branches/2.8/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/security/authentication/token/TestAll.java
Thu Jul 31 09:07:11 2014
@@ -36,6 +36,7 @@ public class TestAll extends TestCase {
         suite.addTestSuite(TokenBasedAuthenticationTest.class);
         suite.addTestSuite(TokenBasedLoginTest.class);
         suite.addTestSuite(TokenProviderTest.class);
+        suite.addTestSuite(CompatTokenProviderTest.class);
 
         return suite;
     }

Modified: jackrabbit/branches/2.8/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/security/authentication/token/TokenProviderTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/branches/2.8/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/security/authentication/token/TokenProviderTest.java?rev=1614837&r1=1614836&r2=1614837&view=diff
==============================================================================
--- jackrabbit/branches/2.8/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/security/authentication/token/TokenProviderTest.java
(original)
+++ jackrabbit/branches/2.8/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/security/authentication/token/TokenProviderTest.java
Thu Jul 31 09:07:11 2014
@@ -90,6 +90,12 @@ public class TokenProviderTest extends A
         assertTokenInfo(info);
     }
 
+    public void testCreateTokenIsCaseInsensitive() throws Exception {
+        String upperCaseUserId = userId.toUpperCase();
+        TokenInfo info = tokenProvider.createToken(testuser, new SimpleCredentials(upperCaseUserId,
new char[0]));
+        assertTokenInfo(info);
+    }
+
     public void testTokenNode() throws Exception {
         Map<String, String> privateAttributes = new HashMap<String, String>();
         privateAttributes.put(".token_exp", "value");



Mime
View raw message