qpid-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rob...@apache.org
Subject svn commit: r1377723 - /qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/security/auth/AuthenticationResult.java
Date Mon, 27 Aug 2012 15:56:24 GMT
Author: robbie
Date: Mon Aug 27 15:56:23 2012
New Revision: 1377723

URL: http://svn.apache.org/viewvc?rev=1377723&view=rev
Log:
QPID-4237: added convenience method to AuthenticatedResult to facilitate implementation of
third party authentication managers.

Applied patch from Philip Harvey <phil@philharveyonline.com>

Modified:
    qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/security/auth/AuthenticationResult.java

Modified: qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/security/auth/AuthenticationResult.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/security/auth/AuthenticationResult.java?rev=1377723&r1=1377722&r2=1377723&view=diff
==============================================================================
--- qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/security/auth/AuthenticationResult.java
(original)
+++ qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/security/auth/AuthenticationResult.java
Mon Aug 27 15:56:23 2012
@@ -64,6 +64,7 @@ public class AuthenticationResult
     private final byte[] _challenge;
     private final Exception _cause;
     private final Set<Principal> _principals = new HashSet<Principal>();
+    private final Principal _mainPrincipal;
 
     public AuthenticationResult(final AuthenticationStatus status)
     {
@@ -81,6 +82,7 @@ public class AuthenticationResult
         _principals.addAll(otherPrincipals);
         _principals.remove(mainPrincipal);
         _principals.add(specialQpidAuthenticatedPrincipal);
+        _mainPrincipal = mainPrincipal;
 
         _status = AuthenticationStatus.SUCCESS;
         _challenge = null;
@@ -92,6 +94,7 @@ public class AuthenticationResult
         _challenge = challenge;
         _status = status;
         _cause = null;
+        _mainPrincipal = null;
     }
 
     public AuthenticationResult(final AuthenticationStatus error, final Exception cause)
@@ -99,6 +102,7 @@ public class AuthenticationResult
         _status = error;
         _challenge = null;
         _cause = cause;
+        _mainPrincipal = null;
     }
 
     public AuthenticationResult(final byte[] challenge, final AuthenticationStatus status,
final Exception cause)
@@ -108,9 +112,10 @@ public class AuthenticationResult
             throw new IllegalArgumentException("Successful authentication requires at least
one principal");
         }
 
-        this._status = status;
-        this._challenge = challenge;
-        this._cause = cause;
+        _status = status;
+        _challenge = challenge;
+        _cause = cause;
+        _mainPrincipal = null;
     }
 
     public Exception getCause()
@@ -132,4 +137,9 @@ public class AuthenticationResult
     {
         return _principals;
     }
+
+    public Principal getMainPrincipal()
+    {
+        return _mainPrincipal;
+    }
 }



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@qpid.apache.org
For additional commands, e-mail: commits-help@qpid.apache.org


Mime
View raw message