[java-identity-provider COMMIT] in /trunk: idp-authn-api/src/main/java/net/shibboleth/idp/authn/AbstractValidationAct...

noreply at shibboleth.net noreply at shibboleth.net
Wed Oct 30 12:15:05 EDT 2013


Author: scantor
Date: Wed Oct 30 12:15:05 2013
New Revision: 4907

URL: http://svn.shibboleth.net/view/java-identity-provider?rev=4907&view=rev
Log:
Implement "memory" for the Principal that satisfied a requester's custom specifications.

Added:
    trunk/idp-authn-api/src/main/java/net/shibboleth/idp/authn/PrincipalEvalPredicate.java   (with props)
Modified:
    trunk/idp-authn-api/src/main/java/net/shibboleth/idp/authn/AbstractValidationAction.java
    trunk/idp-authn-api/src/main/java/net/shibboleth/idp/authn/PrincipalEvalPredicateFactory.java
    trunk/idp-authn-api/src/main/java/net/shibboleth/idp/authn/context/RequestedPrincipalContext.java
    trunk/idp-authn-impl/src/main/java/net/shibboleth/idp/authn/impl/ExactPrincipalEvalPredicateFactory.java
    trunk/idp-authn-impl/src/main/java/net/shibboleth/idp/authn/impl/InexactPrincipalEvalPredicateFactory.java
    trunk/idp-authn-impl/src/main/java/net/shibboleth/idp/authn/impl/SelectAuthenticationFlow.java
    trunk/idp-authn-impl/src/test/java/net/shibboleth/idp/authn/impl/SelectAuthenticationFlowTest.java

Modified: trunk/idp-authn-api/src/main/java/net/shibboleth/idp/authn/AbstractValidationAction.java
URL: http://svn.shibboleth.net/view/java-identity-provider/trunk/idp-authn-api/src/main/java/net/shibboleth/idp/authn/AbstractValidationAction.java?rev=4907&r1=4906&r2=4907&view=diff
==============================================================================
--- trunk/idp-authn-api/src/main/java/net/shibboleth/idp/authn/AbstractValidationAction.java (original)
+++ trunk/idp-authn-api/src/main/java/net/shibboleth/idp/authn/AbstractValidationAction.java Wed Oct 30 12:15:05 2013
@@ -263,9 +263,11 @@
                         authenticationContext.getPrincipalEvalPredicateFactoryRegistry().lookup(
                                 p.getClass(), rpCtx.getOperator());
                 if (factory != null) {
-                    if (factory.getPredicate(p).apply(this)) {
+                    PrincipalEvalPredicate predicate = factory.getPredicate(p);
+                    if (predicate.apply(this)) {
                         log.debug("{} Compatible with principal type '{}' and operator '{}'", getLogPrefix(),
                                 p.getClass(), rpCtx.getOperator());
+                        rpCtx.setMatchingPrincipal(predicate.getMatchingPrincipal());
                         return true;
                     } else {
                         log.debug("{} Not compatible with principal type '{}' and operator '{}'", getLogPrefix(),

Modified: trunk/idp-authn-api/src/main/java/net/shibboleth/idp/authn/PrincipalEvalPredicateFactory.java
URL: http://svn.shibboleth.net/view/java-identity-provider/trunk/idp-authn-api/src/main/java/net/shibboleth/idp/authn/PrincipalEvalPredicateFactory.java?rev=4907&r1=4906&r2=4907&view=diff
==============================================================================
--- trunk/idp-authn-api/src/main/java/net/shibboleth/idp/authn/PrincipalEvalPredicateFactory.java (original)
+++ trunk/idp-authn-api/src/main/java/net/shibboleth/idp/authn/PrincipalEvalPredicateFactory.java Wed Oct 30 12:15:05 2013
@@ -21,16 +21,14 @@
 
 import javax.annotation.Nonnull;
 
-import com.google.common.base.Predicate;
-
 /**
- * Generates a {@link Predicate} to evaluate a {@link Principal} that represents a requested
- * form of authentication.
+ * Generates a {@link Predicate} to evaluate a {@link PrincipalSupportingComponent}
+ * against a requested form of authentication expressed in terms of a {@link Principal}.
  * 
- * <p>The predicate is constructed around a {@link PrincipalSupportingComponent}
- * to compare in an implementation-specific manner against the candidate principal.
- * A given factory produces predicates that implement a particular set of matching
- * rules. Factories are accessed via a {@link PrincipalEvalPredicateFactoryRegistry}.
+ * <p>The predicate is constructed around a {@link Principal} to compare in an
+ * implementation-specific manner against the candidate component. A given factory
+ * produces predicates that implement a particular set of matching rules.
+ * Factories are accessed via a {@link PrincipalEvalPredicateFactoryRegistry}.</p>
  */
 public interface PrincipalEvalPredicateFactory {
 
@@ -43,5 +41,5 @@
      * 
      * @return a {@link Predicate} implementing custom matching rules
      */
-    @Nonnull public Predicate<PrincipalSupportingComponent> getPredicate(@Nonnull final Principal candidate);
+    @Nonnull public PrincipalEvalPredicate getPredicate(@Nonnull final Principal candidate);
 }

Modified: trunk/idp-authn-api/src/main/java/net/shibboleth/idp/authn/context/RequestedPrincipalContext.java
URL: http://svn.shibboleth.net/view/java-identity-provider/trunk/idp-authn-api/src/main/java/net/shibboleth/idp/authn/context/RequestedPrincipalContext.java?rev=4907&r1=4906&r2=4907&view=diff
==============================================================================
--- trunk/idp-authn-api/src/main/java/net/shibboleth/idp/authn/context/RequestedPrincipalContext.java (original)

[... 308 lines stripped ...]


More information about the commits mailing list