directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From vte...@apache.org
Subject svn commit: r109671 - in incubator/directory/janus/trunk/core: api/src/java/org/apache/janus/authentication impl/src/java/org/apache/janus/authentication/realm impl/src/test/org/apache/janus/authentication/realm
Date Fri, 03 Dec 2004 13:24:11 GMT
Author: vtence
Date: Fri Dec  3 05:24:09 2004
New Revision: 109671

URL: http://svn.apache.org/viewcvs?view=rev&rev=109671
Log:
Extracted concept of Credentials Selector from JDBC module - both sequential authentication
(match) and direct authentication (selection) now supported
Added:
   incubator/directory/janus/trunk/core/impl/src/java/org/apache/janus/authentication/realm/ExpressionBuilder.java
      - copied unchanged from r109586, incubator/directory/janus/trunk/jdbc/src/java/org/apache/janus/authentication/realm/ExpressionBuilder.java
   incubator/directory/janus/trunk/core/impl/src/java/org/apache/janus/authentication/realm/SameCredentialsBuilder.java
      - copied unchanged from r109512, incubator/directory/janus/trunk/jdbc/src/java/org/apache/janus/authentication/realm/SameCredentialsBuilder.java
   incubator/directory/janus/trunk/core/impl/src/java/org/apache/janus/authentication/realm/Selector.java
      - copied unchanged from r109586, incubator/directory/janus/trunk/jdbc/src/java/org/apache/janus/authentication/realm/Selector.java
   incubator/directory/janus/trunk/core/impl/src/java/org/apache/janus/authentication/realm/SelectorBuilder.java
      - copied unchanged from r109512, incubator/directory/janus/trunk/jdbc/src/java/org/apache/janus/authentication/realm/SelectorBuilder.java
Modified:
   incubator/directory/janus/trunk/core/api/src/java/org/apache/janus/authentication/Credential.java
   incubator/directory/janus/trunk/core/impl/src/java/org/apache/janus/authentication/realm/AuthenticationMethod.java
   incubator/directory/janus/trunk/core/impl/src/java/org/apache/janus/authentication/realm/DefaultRealm.java
   incubator/directory/janus/trunk/core/impl/src/java/org/apache/janus/authentication/realm/PasswordCredential.java
   incubator/directory/janus/trunk/core/impl/src/java/org/apache/janus/authentication/realm/UsernameCredential.java
   incubator/directory/janus/trunk/core/impl/src/java/org/apache/janus/authentication/realm/UsernamePasswordAuthentication.java
   incubator/directory/janus/trunk/core/impl/src/test/org/apache/janus/authentication/realm/UsernamePasswordAuthenticationTest.java

Modified: incubator/directory/janus/trunk/core/api/src/java/org/apache/janus/authentication/Credential.java
Url: http://svn.apache.org/viewcvs/incubator/directory/janus/trunk/core/api/src/java/org/apache/janus/authentication/Credential.java?view=diff&rev=109671&p1=incubator/directory/janus/trunk/core/api/src/java/org/apache/janus/authentication/Credential.java&r1=109670&p2=incubator/directory/janus/trunk/core/api/src/java/org/apache/janus/authentication/Credential.java&r2=109671
==============================================================================
--- incubator/directory/janus/trunk/core/api/src/java/org/apache/janus/authentication/Credential.java
(original)
+++ incubator/directory/janus/trunk/core/api/src/java/org/apache/janus/authentication/Credential.java
Fri Dec  3 05:24:09 2004
@@ -19,4 +19,6 @@
 public interface Credential
 {
     Object getValue();
+
+    void setValue( Object value );
 }

Modified: incubator/directory/janus/trunk/core/impl/src/java/org/apache/janus/authentication/realm/AuthenticationMethod.java
Url: http://svn.apache.org/viewcvs/incubator/directory/janus/trunk/core/impl/src/java/org/apache/janus/authentication/realm/AuthenticationMethod.java?view=diff&rev=109671&p1=incubator/directory/janus/trunk/core/impl/src/java/org/apache/janus/authentication/realm/AuthenticationMethod.java&r1=109670&p2=incubator/directory/janus/trunk/core/impl/src/java/org/apache/janus/authentication/realm/AuthenticationMethod.java&r2=109671
==============================================================================
--- incubator/directory/janus/trunk/core/impl/src/java/org/apache/janus/authentication/realm/AuthenticationMethod.java
(original)
+++ incubator/directory/janus/trunk/core/impl/src/java/org/apache/janus/authentication/realm/AuthenticationMethod.java
Fri Dec  3 05:24:09 2004
@@ -29,7 +29,9 @@
 
     boolean supports( CredentialSet credentialSet );
 
-    CredentialsMatcher authenticate( CredentialSet credentials );
+    CredentialsMatcher getAuthenticationMatcher( CredentialSet credentials );
 
-    CredentialsMatcher identify( CredentialSet credentials );
+    CredentialsMatcher getIdentificationMatcher( CredentialSet credentials );
+
+    SelectorBuilder getAuthenticationSelector( CredentialSet credentials );
 }

Modified: incubator/directory/janus/trunk/core/impl/src/java/org/apache/janus/authentication/realm/DefaultRealm.java
Url: http://svn.apache.org/viewcvs/incubator/directory/janus/trunk/core/impl/src/java/org/apache/janus/authentication/realm/DefaultRealm.java?view=diff&rev=109671&p1=incubator/directory/janus/trunk/core/impl/src/java/org/apache/janus/authentication/realm/DefaultRealm.java&r1=109670&p2=incubator/directory/janus/trunk/core/impl/src/java/org/apache/janus/authentication/realm/DefaultRealm.java&r2=109671
==============================================================================
--- incubator/directory/janus/trunk/core/impl/src/java/org/apache/janus/authentication/realm/DefaultRealm.java
(original)
+++ incubator/directory/janus/trunk/core/impl/src/java/org/apache/janus/authentication/realm/DefaultRealm.java
Fri Dec  3 05:24:09 2004
@@ -63,13 +63,13 @@
 
     private CredentialSet findAuthenticatedMatch( CredentialSet creds )
     {
-        CredentialsMatcher criterion = m_authenticationMethod.authenticate( creds );
+        CredentialsMatcher criterion = m_authenticationMethod.getAuthenticationMatcher( creds
);
         return search( criterion );
     }
 
     private CredentialSet findIdentifiedMatch( CredentialSet creds )
     {
-        CredentialsMatcher criterion = m_authenticationMethod.identify( creds );
+        CredentialsMatcher criterion = m_authenticationMethod.getIdentificationMatcher( creds
);
         return search( criterion );
     }
 

Copied: incubator/directory/janus/trunk/core/impl/src/java/org/apache/janus/authentication/realm/ExpressionBuilder.java
(from r109586, incubator/directory/janus/trunk/jdbc/src/java/org/apache/janus/authentication/realm/ExpressionBuilder.java)
Url: http://svn.apache.org/viewcvs/incubator/directory/janus/trunk/core/impl/src/java/org/apache/janus/authentication/realm/ExpressionBuilder.java?view=diff&rev=109671&p1=incubator/directory/janus/trunk/jdbc/src/java/org/apache/janus/authentication/realm/ExpressionBuilder.java&r1=109586&p2=incubator/directory/janus/trunk/core/impl/src/java/org/apache/janus/authentication/realm/ExpressionBuilder.java&r2=109671
==============================================================================

Modified: incubator/directory/janus/trunk/core/impl/src/java/org/apache/janus/authentication/realm/PasswordCredential.java
Url: http://svn.apache.org/viewcvs/incubator/directory/janus/trunk/core/impl/src/java/org/apache/janus/authentication/realm/PasswordCredential.java?view=diff&rev=109671&p1=incubator/directory/janus/trunk/core/impl/src/java/org/apache/janus/authentication/realm/PasswordCredential.java&r1=109670&p2=incubator/directory/janus/trunk/core/impl/src/java/org/apache/janus/authentication/realm/PasswordCredential.java&r2=109671
==============================================================================
--- incubator/directory/janus/trunk/core/impl/src/java/org/apache/janus/authentication/realm/PasswordCredential.java
(original)
+++ incubator/directory/janus/trunk/core/impl/src/java/org/apache/janus/authentication/realm/PasswordCredential.java
Fri Dec  3 05:24:09 2004
@@ -23,7 +23,11 @@
  */
 public class PasswordCredential implements Credential
 {
-    private final String m_password;
+    private String m_password;
+
+    public PasswordCredential()
+    {
+    }
 
     public PasswordCredential( String password )
     {
@@ -33,6 +37,11 @@
     public Object getValue()
     {
         return m_password;
+    }
+
+    public void setValue( Object value )
+    {
+        m_password = (String) value;
     }
 
     public boolean equals( Object o )

Copied: incubator/directory/janus/trunk/core/impl/src/java/org/apache/janus/authentication/realm/SameCredentialsBuilder.java
(from r109512, incubator/directory/janus/trunk/jdbc/src/java/org/apache/janus/authentication/realm/SameCredentialsBuilder.java)
Url: http://svn.apache.org/viewcvs/incubator/directory/janus/trunk/core/impl/src/java/org/apache/janus/authentication/realm/SameCredentialsBuilder.java?view=diff&rev=109671&p1=incubator/directory/janus/trunk/jdbc/src/java/org/apache/janus/authentication/realm/SameCredentialsBuilder.java&r1=109512&p2=incubator/directory/janus/trunk/core/impl/src/java/org/apache/janus/authentication/realm/SameCredentialsBuilder.java&r2=109671
==============================================================================

Copied: incubator/directory/janus/trunk/core/impl/src/java/org/apache/janus/authentication/realm/Selector.java
(from r109586, incubator/directory/janus/trunk/jdbc/src/java/org/apache/janus/authentication/realm/Selector.java)
Url: http://svn.apache.org/viewcvs/incubator/directory/janus/trunk/core/impl/src/java/org/apache/janus/authentication/realm/Selector.java?view=diff&rev=109671&p1=incubator/directory/janus/trunk/jdbc/src/java/org/apache/janus/authentication/realm/Selector.java&r1=109586&p2=incubator/directory/janus/trunk/core/impl/src/java/org/apache/janus/authentication/realm/Selector.java&r2=109671
==============================================================================

Copied: incubator/directory/janus/trunk/core/impl/src/java/org/apache/janus/authentication/realm/SelectorBuilder.java
(from r109512, incubator/directory/janus/trunk/jdbc/src/java/org/apache/janus/authentication/realm/SelectorBuilder.java)
Url: http://svn.apache.org/viewcvs/incubator/directory/janus/trunk/core/impl/src/java/org/apache/janus/authentication/realm/SelectorBuilder.java?view=diff&rev=109671&p1=incubator/directory/janus/trunk/jdbc/src/java/org/apache/janus/authentication/realm/SelectorBuilder.java&r1=109512&p2=incubator/directory/janus/trunk/core/impl/src/java/org/apache/janus/authentication/realm/SelectorBuilder.java&r2=109671
==============================================================================

Modified: incubator/directory/janus/trunk/core/impl/src/java/org/apache/janus/authentication/realm/UsernameCredential.java
Url: http://svn.apache.org/viewcvs/incubator/directory/janus/trunk/core/impl/src/java/org/apache/janus/authentication/realm/UsernameCredential.java?view=diff&rev=109671&p1=incubator/directory/janus/trunk/core/impl/src/java/org/apache/janus/authentication/realm/UsernameCredential.java&r1=109670&p2=incubator/directory/janus/trunk/core/impl/src/java/org/apache/janus/authentication/realm/UsernameCredential.java&r2=109671
==============================================================================
--- incubator/directory/janus/trunk/core/impl/src/java/org/apache/janus/authentication/realm/UsernameCredential.java
(original)
+++ incubator/directory/janus/trunk/core/impl/src/java/org/apache/janus/authentication/realm/UsernameCredential.java
Fri Dec  3 05:24:09 2004
@@ -23,7 +23,11 @@
  */
 public class UsernameCredential implements Credential
 {
-    private final String m_username;
+    private String m_username;
+
+    public UsernameCredential()
+    {
+    }
 
     public UsernameCredential( String name )
     {
@@ -38,6 +42,11 @@
     public String getUsername()
     {
         return m_username;
+    }
+
+    public void setValue( Object value )
+    {
+        m_username = (String) value;
     }
 
     public boolean equals( Object o )

Modified: incubator/directory/janus/trunk/core/impl/src/java/org/apache/janus/authentication/realm/UsernamePasswordAuthentication.java
Url: http://svn.apache.org/viewcvs/incubator/directory/janus/trunk/core/impl/src/java/org/apache/janus/authentication/realm/UsernamePasswordAuthentication.java?view=diff&rev=109671&p1=incubator/directory/janus/trunk/core/impl/src/java/org/apache/janus/authentication/realm/UsernamePasswordAuthentication.java&r1=109670&p2=incubator/directory/janus/trunk/core/impl/src/java/org/apache/janus/authentication/realm/UsernamePasswordAuthentication.java&r2=109671
==============================================================================
--- incubator/directory/janus/trunk/core/impl/src/java/org/apache/janus/authentication/realm/UsernamePasswordAuthentication.java
(original)
+++ incubator/directory/janus/trunk/core/impl/src/java/org/apache/janus/authentication/realm/UsernamePasswordAuthentication.java
Fri Dec  3 05:24:09 2004
@@ -46,14 +46,19 @@
         return true;
     }
 
-    public CredentialsMatcher authenticate( CredentialSet credentials )
+    public CredentialsMatcher getAuthenticationMatcher( CredentialSet credentials )
     {
         return new EqualMatcher( credentials );
     }
 
-    public CredentialsMatcher identify( CredentialSet credentials )
+    public CredentialsMatcher getIdentificationMatcher( CredentialSet credentials )
     {
         return new ContainsCredentialsMatcher( credentials.getCredentials( UsernameCredential.class
) );
+    }
+
+    public SelectorBuilder getAuthenticationSelector( CredentialSet credentials )
+    {
+        return new SameCredentialsBuilder( credentials );
     }
 
 }

Modified: incubator/directory/janus/trunk/core/impl/src/test/org/apache/janus/authentication/realm/UsernamePasswordAuthenticationTest.java
Url: http://svn.apache.org/viewcvs/incubator/directory/janus/trunk/core/impl/src/test/org/apache/janus/authentication/realm/UsernamePasswordAuthenticationTest.java?view=diff&rev=109671&p1=incubator/directory/janus/trunk/core/impl/src/test/org/apache/janus/authentication/realm/UsernamePasswordAuthenticationTest.java&r1=109670&p2=incubator/directory/janus/trunk/core/impl/src/test/org/apache/janus/authentication/realm/UsernamePasswordAuthenticationTest.java&r2=109671
==============================================================================
--- incubator/directory/janus/trunk/core/impl/src/test/org/apache/janus/authentication/realm/UsernamePasswordAuthenticationTest.java
(original)
+++ incubator/directory/janus/trunk/core/impl/src/test/org/apache/janus/authentication/realm/UsernamePasswordAuthenticationTest.java
Fri Dec  3 05:24:09 2004
@@ -75,8 +75,8 @@
 
     public void testCredentialsMatchIfEqual()
     {
-        assertTrue( "Equal sets of credentials do not match", m_auth.authenticate( validCredentials()
).matches( validCredentials() ) );
-        assertFalse( "Different sets of credentials were matched", m_auth.authenticate( extraCredentials()
).matches( validCredentials() ) );
+        assertTrue( "Equal sets of credentials do not match", m_auth.getAuthenticationMatcher(
validCredentials() ).matches( validCredentials() ) );
+        assertFalse( "Different sets of credentials were matched", m_auth.getAuthenticationMatcher(
extraCredentials() ).matches( validCredentials() ) );
     }
 
     public void testPrincipalsCreatedAreUsernamePrincipals()

Mime
View raw message