[java-identity-provider] branch master updated: IDP-1331 - Support relying party groups in attribute resolver
Scott Cantor
cantor.2 at osu.edu
Tue Sep 11 14:15:41 EDT 2018
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=80a3007e743f0d1406e7f08052bb83dde87b42c1
The following commit(s) were added to refs/heads/master by this push:
new 80a3007 IDP-1331 - Support relying party groups in attribute resolver
80a3007 is described below
commit 80a3007e743f0d1406e7f08052bb83dde87b42c1
Author: Scott Cantor <cantor.2 at osu.edu>
AuthorDate: Tue Sep 11 14:15:39 2018 -0400
IDP-1331 - Support relying party groups in attribute resolver
https://issues.shibboleth.net/jira/browse/IDP-1331
---
.../context/AttributeResolutionContext.java | 46 +++++++++++++++++++++-
.../resolver/impl/ComputedIDDataConnector.java | 7 +++-
.../resolver/impl/StoredIDDataConnector.java | 7 +++-
3 files changed, 54 insertions(+), 6 deletions(-)
diff --git a/idp-attribute-resolver-api/src/main/java/net/shibboleth/idp/attribute/resolver/context/AttributeResolutionContext.java b/idp-attribute-resolver-api/src/main/java/net/shibboleth/idp/attribute/resolver/context/AttributeResolutionContext.java
index a16d876..e28ac27 100644
--- a/idp-attribute-resolver-api/src/main/java/net/shibboleth/idp/attribute/resolver/context/AttributeResolutionContext.java
+++ b/idp-attribute-resolver-api/src/main/java/net/shibboleth/idp/attribute/resolver/context/AttributeResolutionContext.java
@@ -64,6 +64,9 @@ public class AttributeResolutionContext extends BaseContext {
/** The attribute recipient identity. */
@Nullable private String attributeRecipientID;
+ /** The attribute recipient's group identity. */
+ @Nullable private String attributeRecipientGroupID;
+
/** How was the principal Authenticated? */
@Nullable private String principalAuthenticationMethod;
@@ -183,10 +186,44 @@ public class AttributeResolutionContext extends BaseContext {
}
/**
+ * Get the attribute recipient grouping associated with this resolution.
+ *
+ * <p>This is a protocol-independent way to represent an association between the attribute recipient
+ * and some larger group that may be relevant to attribute resolution.</p>
+ *
+ * @return the attribute recipient group associated with this resolution
+ *
+ * @since 3.4.0
+ */
+ @Nullable public String getAttributeRecipientGroupID() {
+ return attributeRecipientGroupID;
+ }
+
+ /**
+ * Set the attribute recipient grouping associated with this resolution.
+ *
+ * @param value the attribute recipient group associated with this resolution
+ *
+ * @return this context
+ *
+ * @since 3.4.0
+ */
+ @Nullable public AttributeResolutionContext setAttributeRecipientGroupID(@Nullable final String value) {
+ attributeRecipientGroupID = value;
+
+ return this;
+ }
+
+ /**
* Set how the principal was authenticated.
*
- * @return Returns the principalAuthenticationMethod.
+ * <p>This is deprecated, as the V3 representation of authentication results is more general.</p>
+ *
+ * @return returns the principalAuthenticationMethod
+ *
+ * @deprecated
*/
+ @Deprecated
@Nullable public String getPrincipalAuthenticationMethod() {
return principalAuthenticationMethod;
}
@@ -194,10 +231,15 @@ public class AttributeResolutionContext extends BaseContext {
/**
* Get how the principal was authenticated.
*
- * @param method The principalAuthenticationMethod to set.
+ * <p>This is deprecated, as the V3 representation of authentication results is more general.</p>
+ *
+ * @param method The principalAuthenticationMethod to set
*
* @return this context
+ *
+ * @deprecated
*/
+ @Deprecated
@Nullable public AttributeResolutionContext setPrincipalAuthenticationMethod(@Nullable final String method) {
principalAuthenticationMethod = method;
diff --git a/idp-saml-impl/src/main/java/net/shibboleth/idp/saml/attribute/resolver/impl/ComputedIDDataConnector.java b/idp-saml-impl/src/main/java/net/shibboleth/idp/saml/attribute/resolver/impl/ComputedIDDataConnector.java
index ec4316f..dbc8768 100644
--- a/idp-saml-impl/src/main/java/net/shibboleth/idp/saml/attribute/resolver/impl/ComputedIDDataConnector.java
+++ b/idp-saml-impl/src/main/java/net/shibboleth/idp/saml/attribute/resolver/impl/ComputedIDDataConnector.java
@@ -212,9 +212,12 @@ public class ComputedIDDataConnector extends AbstractPersistentIdDataConnector {
return null;
}
- final String attributeRecipientID = resolutionContext.getAttributeRecipientID();
+ String attributeRecipientID = resolutionContext.getAttributeRecipientGroupID();
if (Strings.isNullOrEmpty(attributeRecipientID)) {
- log.warn("{} No Attribute Recipient ID located, unable to compute ID", getLogPrefix());
+ attributeRecipientID = resolutionContext.getAttributeRecipientID();
+ }
+ if (Strings.isNullOrEmpty(attributeRecipientID)) {
+ log.warn("{} No Attribute recipient or group ID located, unable to compute ID", getLogPrefix());
return null;
}
diff --git a/idp-saml-impl/src/main/java/net/shibboleth/idp/saml/attribute/resolver/impl/StoredIDDataConnector.java b/idp-saml-impl/src/main/java/net/shibboleth/idp/saml/attribute/resolver/impl/StoredIDDataConnector.java
index 2dd5e49..bb5aa19 100644
--- a/idp-saml-impl/src/main/java/net/shibboleth/idp/saml/attribute/resolver/impl/StoredIDDataConnector.java
+++ b/idp-saml-impl/src/main/java/net/shibboleth/idp/saml/attribute/resolver/impl/StoredIDDataConnector.java
@@ -223,9 +223,12 @@ public class StoredIDDataConnector extends ComputedIDDataConnector {
return null;
}
- final String attributeRecipientID = resolutionContext.getAttributeRecipientID();
+ String attributeRecipientID = resolutionContext.getAttributeRecipientGroupID();
if (Strings.isNullOrEmpty(attributeRecipientID)) {
- log.warn("{} Could not get attribute recipient ID, skipping ID creation", getLogPrefix());
+ attributeRecipientID = resolutionContext.getAttributeRecipientID();
+ }
+ if (Strings.isNullOrEmpty(attributeRecipientID)) {
+ log.warn("{} Could not get attribute recipient or group ID, skipping ID creation", getLogPrefix());
return null;
}
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.
More information about the commits
mailing list