[java-shib-profile] branch main updated: Deprecate responderId property in favor of issuer.
Scott Cantor
cantor.2 at osu.edu
Thu Mar 2 16:42:56 UTC 2023
This is an automated email from the git hooks/post-receive script.
scantor pushed a commit to branch main
in repository java-shib-profile.
View the commit online:
http://git.shibboleth.net/view/?p=java-shib-profile.git;a=commit;h=c509b77ae8654a775738c60e9c3ad554524bc8dc
The following commit(s) were added to refs/heads/main by this push:
new c509b77 Deprecate responderId property in favor of issuer.
c509b77 is described below
commit c509b77ae8654a775738c60e9c3ad554524bc8dc
Author: Scott Cantor <cantor.2 at osu.edu>
AuthorDate: Thu Mar 2 11:42:53 2023 -0500
Deprecate responderId property in favor of issuer.
---
...okupFunction.java => IssuerLookupFunction.java} | 6 +-
.../relyingparty/RelyingPartyConfiguration.java | 67 ++++++++++++++++------
.../impl/CriteriaSelfEntityIDResolver.java | 2 +-
3 files changed, 55 insertions(+), 20 deletions(-)
diff --git a/shib-profile-api/src/main/java/net/shibboleth/profile/context/navigate/ResponderIdLookupFunction.java b/shib-profile-api/src/main/java/net/shibboleth/profile/context/navigate/IssuerLookupFunction.java
similarity index 92%
rename from shib-profile-api/src/main/java/net/shibboleth/profile/context/navigate/ResponderIdLookupFunction.java
rename to shib-profile-api/src/main/java/net/shibboleth/profile/context/navigate/IssuerLookupFunction.java
index d35739e..ddf3024 100644
--- a/shib-profile-api/src/main/java/net/shibboleth/profile/context/navigate/ResponderIdLookupFunction.java
+++ b/shib-profile-api/src/main/java/net/shibboleth/profile/context/navigate/IssuerLookupFunction.java
@@ -27,7 +27,7 @@ import net.shibboleth.profile.relyingparty.RelyingPartyConfiguration;
import org.opensaml.profile.context.ProfileRequestContext;
/**
- * A function that returns {@link net.shibboleth.profile.relyingparty.RelyingPartyConfiguration#getResponderId}() if
+ * A function that returns {@link net.shibboleth.profile.relyingparty.RelyingPartyConfiguration#getIssuer}() if
* available from a {@link RelyingPartyContext} obtained via a lookup function, by default a child of the
* {@link ProfileRequestContext}.
*
@@ -36,7 +36,7 @@ import org.opensaml.profile.context.ProfileRequestContext;
*
* <p>If a specific setting is unavailable, a null value is returned.</p>
*/
-public class ResponderIdLookupFunction extends AbstractRelyingPartyLookupFunction<String> {
+public class IssuerLookupFunction extends AbstractRelyingPartyLookupFunction<String> {
/** {@inheritDoc} */
@Nullable public String apply(@Nullable final ProfileRequestContext input) {
@@ -53,7 +53,7 @@ public class ResponderIdLookupFunction extends AbstractRelyingPartyLookupFunctio
final RelyingPartyConfiguration rpConfig = rpc.getConfiguration();
if (rpConfig != null) {
- return rpConfig.getResponderId(input);
+ return rpConfig.getIssuer(input);
}
}
}
diff --git a/shib-profile-api/src/main/java/net/shibboleth/profile/relyingparty/RelyingPartyConfiguration.java b/shib-profile-api/src/main/java/net/shibboleth/profile/relyingparty/RelyingPartyConfiguration.java
index 6ce80dc..311c255 100644
--- a/shib-profile-api/src/main/java/net/shibboleth/profile/relyingparty/RelyingPartyConfiguration.java
+++ b/shib-profile-api/src/main/java/net/shibboleth/profile/relyingparty/RelyingPartyConfiguration.java
@@ -40,6 +40,8 @@ import net.shibboleth.shared.component.IdentifiedComponent;
import net.shibboleth.shared.logic.Constraint;
import net.shibboleth.shared.logic.FunctionSupport;
import net.shibboleth.shared.logic.PredicateSupport;
+import net.shibboleth.shared.primitive.DeprecationSupport;
+import net.shibboleth.shared.primitive.DeprecationSupport.ObjectType;
import net.shibboleth.shared.primitive.StringSupport;
/**
@@ -53,8 +55,8 @@ import net.shibboleth.shared.primitive.StringSupport;
public class RelyingPartyConfiguration extends AbstractIdentifiableInitializableComponent implements
IdentifiedComponent, Predicate<ProfileRequestContext> {
- /** Lookup function to supply <code>responderId</code> property. */
- @Nonnull private Function<ProfileRequestContext,String> responderIdLookupStrategy;
+ /** Lookup function to supply issuer. */
+ @Nonnull private Function<ProfileRequestContext,String> issuerLookupStrategy;
/** Controls whether detailed information about errors should be exposed. */
@Nonnull private Predicate<ProfileRequestContext> detailedErrorsPredicate;
@@ -69,44 +71,77 @@ public class RelyingPartyConfiguration extends AbstractIdentifiableInitializable
/** Constructor. */
public RelyingPartyConfiguration() {
activationCondition = PredicateSupport.alwaysTrue();
- responderIdLookupStrategy = FunctionSupport.constant(null);
+ issuerLookupStrategy = FunctionSupport.constant(null);
detailedErrorsPredicate = PredicateSupport.alwaysFalse();
profileConfigurationsLookupStrategy = FunctionSupport.constant(null);
}
/**
- * Get the self-referential ID to use when responding to requests.
+ * Get the name to use when issuing messages to peers.
+ *
+ * <p>In SAML this is an "entityID", in other protocols it may have other labels.</p>
*
* @param profileRequestContext current profile request context
*
- * @return ID to use when responding
+ * @return name to use when issuing messages
+ *
+ * @since 5.0.0
*/
- @Nullable @NotEmpty public String getResponderId(@Nullable final ProfileRequestContext profileRequestContext) {
- return responderIdLookupStrategy.apply(profileRequestContext);
+ @Nullable @NotEmpty public String getIssuer(@Nullable final ProfileRequestContext profileRequestContext) {
+ return issuerLookupStrategy.apply(profileRequestContext);
}
/**
- * Set the self-referential ID to use when responding to messages.
+ * Set the name to use when issuing messages to peers.
+ *
+ * @param issuer name to set
*
- * @param responder ID to use when responding to messages
+ * @since 5.0.0
*/
- public void setResponderId(@Nonnull @NotEmpty final String responder) {
+ public void setIssuer(@Nullable @NotEmpty final String issuer) {
checkSetterPreconditions();
- final String id =
- Constraint.isNotNull(StringSupport.trimOrNull(responder), "ResponderId cannot be null or empty");
- responderIdLookupStrategy = FunctionSupport.constant(id);
+ issuerLookupStrategy = FunctionSupport.constant(issuer);
}
/**
- * Set a lookup strategy for the <code>responderId</code> property.
+ * Set a lookup strategy for the name to use when issuing messages to peers.
*
* @param strategy lookup strategy
+ *
+ * @since 5.0.0
*/
- public void setResponderIdLookupStrategy(@Nonnull final Function<ProfileRequestContext,String> strategy) {
+ public void setIssuerLookupStrategy(@Nonnull final Function<ProfileRequestContext,String> strategy) {
checkSetterPreconditions();
- responderIdLookupStrategy = Constraint.isNotNull(strategy, "Lookup strategy cannot be null");
+ issuerLookupStrategy = Constraint.isNotNull(strategy, "Lookup strategy cannot be null");
}
+ /**
+ * Legacy property setter for issuer.
+ *
+ * @param issuer the issuer to set
+ *
+ * @deprecated
+ */
+ @Deprecated(since="5.0.0", forRemoval=true)
+ public void setResponderId(@Nullable @NotEmpty final String issuer) {
+ DeprecationSupport.warn(ObjectType.METHOD, "setResponderId", "relying-party.xml", "setIssuer");
+ setIssuer(issuer);
+ }
+
+ /**
+ * Set a lookup strategy for the issuer property.
+ *
+ * @param strategy lookup strategy
+ *
+ * @deprecated
+ */
+ @Deprecated(since="5.0.0", forRemoval=true)
+ public void setResponderIdLookupStrategy(@Nonnull final Function<ProfileRequestContext,String> strategy) {
+ DeprecationSupport.warn(ObjectType.METHOD, "setResponderIdLookupStrategy", "relying-party.xml",
+ "setIssuerLookupStrategy");
+ setIssuerLookupStrategy(strategy);
+ }
+
/**
* Get whether detailed information about errors should be exposed.
*
diff --git a/shib-profile-impl/src/main/java/net/shibboleth/profile/relyingparty/impl/CriteriaSelfEntityIDResolver.java b/shib-profile-impl/src/main/java/net/shibboleth/profile/relyingparty/impl/CriteriaSelfEntityIDResolver.java
index a2f379e..18bc311 100644
--- a/shib-profile-impl/src/main/java/net/shibboleth/profile/relyingparty/impl/CriteriaSelfEntityIDResolver.java
+++ b/shib-profile-impl/src/main/java/net/shibboleth/profile/relyingparty/impl/CriteriaSelfEntityIDResolver.java
@@ -125,7 +125,7 @@ public class CriteriaSelfEntityIDResolver extends AbstractIdentifiedInitializabl
rpcResolver.getServiceableComponent()) {
final RelyingPartyConfiguration rpc = resolver.getComponent().resolveSingle(prcSet);
if (rpc != null) {
- return rpc.getResponderId(prc);
+ return rpc.getIssuer(prc);
} else {
log.error("RelyingPartyConfigurationResolver returned null configuration");
}
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.
More information about the commits
mailing list