[java-opensaml] branch main updated: Add slot for a legacy/fallback profile ID.

Scott Cantor cantor.2 at osu.edu
Wed Dec 8 18:39:24 UTC 2021


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

scantor pushed a commit to branch main
in repository java-opensaml.

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

The following commit(s) were added to refs/heads/main by this push:
     new b1aca5db2 Add slot for a legacy/fallback profile ID.
b1aca5db2 is described below

commit b1aca5db2eebef67d0afca176b5abd1bf4e483ec
Author: Scott Cantor <cantor.2 at osu.edu>
AuthorDate: Wed Dec 8 13:39:20 2021 -0500

    Add slot for a legacy/fallback profile ID.
---
 .../profile/context/ProfileRequestContext.java     | 36 +++++++++++++++++++---
 1 file changed, 32 insertions(+), 4 deletions(-)

diff --git a/opensaml-profile-api/src/main/java/org/opensaml/profile/context/ProfileRequestContext.java b/opensaml-profile-api/src/main/java/org/opensaml/profile/context/ProfileRequestContext.java
index d660b5e10..da548ec30 100644
--- a/opensaml-profile-api/src/main/java/org/opensaml/profile/context/ProfileRequestContext.java
+++ b/opensaml-profile-api/src/main/java/org/opensaml/profile/context/ProfileRequestContext.java
@@ -33,16 +33,19 @@ import org.opensaml.messaging.context.InOutOperationContext;
 public final class ProfileRequestContext extends InOutOperationContext {
 
     /** ID under which this context is stored, for example, within maps or sessions. */
-    public static final String BINDING_KEY = "opensamlProfileRequestContext";
+    @Nonnull @NotEmpty public static final String BINDING_KEY = "opensamlProfileRequestContext";
 
     /** Profile ID if not overridden. */
-    public static final String ANONYMOUS_PROFILE_ID = "anonymous";
+    @Nonnull @NotEmpty public static final String ANONYMOUS_PROFILE_ID = "anonymous";
 
     /** Unique identifier for the profile/operation/function of the current request. */
-    private String profileId;
+    @Nonnull @NotEmpty private String profileId;
 
+    /** Legacy profile ID used to migrate a profile to a new value. */
+    @Nullable @NotEmpty private String legacyProfileId;
+    
     /** Logging label for the profile/operation/function . */
-    private String loggingId;
+    @Nonnull @NotEmpty private String loggingId;
     
     /** Whether the current profile request is browser-based. */
     private boolean browserProfile;
@@ -75,6 +78,31 @@ public final class ProfileRequestContext extends InOutOperationContext {
             profileId = trimmedId;
         }
     }
+    
+    /**
+     * Get the legacy ID of the profile used by the current request.
+     * 
+     * <p>This is a migration aid for scenarios in which a profile is migrated to a new ID so that
+     * the original value can be supplied as a fallback. In most cases it will be null.</p>
+     * 
+     * @return legacy profile ID
+     * 
+     * @since 4.2.0
+     */
+    @Nullable @NotEmpty public String getLegacyProfileId() {
+        return legacyProfileId;
+    }
+    
+    /**
+     * Set the legacy ID of the profile used by the current request.
+     * 
+     * @param id legacy profile ID
+     * 
+     * @since 4.2.0
+     */
+    public void setLegacyProfileId(@Nullable final String id) {
+        legacyProfileId = StringSupport.trimOrNull(id);
+    }
 
     /**
      * Get the logging ID of the profile used by the current request.

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


More information about the commits mailing list