[java-identity-provider] branch master updated: Make PRC creation more robust.

Scott Cantor cantor.2 at osu.edu
Fri Nov 1 12:29:27 EDT 2019


This is an automated email from the git hooks/post-receive script.

scantor pushed a commit to branch master
in repository java-identity-provider.

View the commit online:
http://git.shibboleth.net/view/?p=java-identity-provider.git;a=commit;h=d3b6a0230d67e5a987055e90e5f7dbe256340509

The following commit(s) were added to refs/heads/master by this push:
       new  d3b6a02   Make PRC creation more robust.
d3b6a02 is described below

commit d3b6a0230d67e5a987055e90e5f7dbe256340509
Author: Scott Cantor <cantor.2 at osu.edu>
AuthorDate: Fri Nov 1 12:29:24 2019 -0400

    Make PRC creation more robust.
---
 .../impl/InitializeProxyProfileRequestContext.java | 24 +++++++++++++++++++---
 1 file changed, 21 insertions(+), 3 deletions(-)

diff --git a/idp-authn-impl/src/main/java/net/shibboleth/idp/authn/proxy/impl/InitializeProxyProfileRequestContext.java b/idp-authn-impl/src/main/java/net/shibboleth/idp/authn/proxy/impl/InitializeProxyProfileRequestContext.java
index 3ecc156..3116719 100644
--- a/idp-authn-impl/src/main/java/net/shibboleth/idp/authn/proxy/impl/InitializeProxyProfileRequestContext.java
+++ b/idp-authn-impl/src/main/java/net/shibboleth/idp/authn/proxy/impl/InitializeProxyProfileRequestContext.java
@@ -65,9 +65,7 @@ public final class InitializeProxyProfileRequestContext extends AbstractProfileA
     public InitializeProxyProfileRequestContext() {
         
         // Defaults to PRC -> AuthenticationContext -> PRC
-        profileRequestContextCreationStrategy = input ->
-            (ProfileRequestContext) input.getSubcontext(AuthenticationContext.class).addSubcontext(
-                    new ProfileRequestContext(), true);
+        profileRequestContextCreationStrategy = new DefaultPRCCreationStrategy();
     }
     
     /**
@@ -136,4 +134,24 @@ public final class InitializeProxyProfileRequestContext extends AbstractProfileA
         prc.setBrowserProfile(browserProfile);
     }
     
+    /**
+     * Default strategy that nests the new PRC below the AC.
+     */
+    private class DefaultPRCCreationStrategy implements Function<ProfileRequestContext,ProfileRequestContext> {
+
+        /** {@inheritDoc} */
+        @Nullable public ProfileRequestContext apply(@Nullable final ProfileRequestContext input) {
+            
+            if (input != null) {
+                final AuthenticationContext ac = input.getSubcontext(AuthenticationContext.class);
+                if (ac != null) {
+                    return (ProfileRequestContext) ac.addSubcontext(new ProfileRequestContext(), true);
+                }
+            }
+            
+            return null;
+        }
+        
+    }
+    
 }
\ No newline at end of file

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the commits mailing list