[java-identity-provider COMMIT] in /trunk/idp-attribute-resolver-api/src: main/java/net/shibboleth/idp/attribute/reso...
noreply at shibboleth.net
noreply at shibboleth.net
Fri Feb 22 05:53:21 EST 2013
Author: rdw
Date: Fri Feb 22 05:53:21 2013
New Revision: 4282
URL: http://svn.shibboleth.net/view/java-identity-provider?rev=4282&view=rev
Log:
https://issues.shibboleth.net/jira/browse/IDP-255 Add Principal, AttributeIssuerID, AttributeRecipientID to the context. Also tests
Modified:
trunk/idp-attribute-resolver-api/src/main/java/net/shibboleth/idp/attribute/resolver/AttributeResolutionContext.java
trunk/idp-attribute-resolver-api/src/test/java/net/shibboleth/idp/attribute/resolver/AttributeResolutionContextTest.java
Modified: trunk/idp-attribute-resolver-api/src/main/java/net/shibboleth/idp/attribute/resolver/AttributeResolutionContext.java
URL: http://svn.shibboleth.net/view/java-identity-provider/trunk/idp-attribute-resolver-api/src/main/java/net/shibboleth/idp/attribute/resolver/AttributeResolutionContext.java?rev=4282&r1=4281&r2=4282&view=diff
==============================================================================
--- trunk/idp-attribute-resolver-api/src/main/java/net/shibboleth/idp/attribute/resolver/AttributeResolutionContext.java (original)
+++ trunk/idp-attribute-resolver-api/src/main/java/net/shibboleth/idp/attribute/resolver/AttributeResolutionContext.java Fri Feb 22 05:53:21 2013
@@ -57,6 +57,15 @@
/** Data connectors that have been resolved and the resultant attributes. */
private final Map<String, ResolvedDataConnector> resolvedDataConnectors;
+
+ /** The unique principal. This is required by some resolvers and injected during setup. */
+ private String principal;
+
+ /** The local entityID. This is required by some resolvers and injected during setup. */
+ private String attributeIssuerID;
+
+ /** The other entityID. This is required by some resolvers and injected during setup. */
+ private String attributeRecipientID;
/** Constructor. */
public AttributeResolutionContext() {
@@ -70,6 +79,54 @@
resolvedDataConnectors =
MapConstraints.constrainedMap(new HashMap<String, ResolvedDataConnector>(), MapConstraints.notNull());
+ }
+
+ /** Gets the principal associated with this resolution.
+ *
+ * @return the principal associated with this resolution.
+ */
+ @Nullable public String getPrincipal() {
+ return principal;
+ }
+
+ /** Sets the principal associated with this resolution.
+ *
+ * @param value the principal associated with this resolution.
+ */
+ @Nullable public void setPrincipal(@Nullable String value) {
+ principal = value;
+ }
+
+ /** Gets the attribute issuer (me) associated with this resolution.
+ *
+ * @return the attribute issuer associated with this resolution.
+ */
+ @Nullable public String getAttributeIssuerID() {
+ return attributeIssuerID;
+ }
+
+ /** Sets the attribute issuer (me) associated with this resolution.
+ *
+ * @param value the attribute issuer associated with this resolution.
+ */
+ @Nullable public void setAttributeIssuerID(@Nullable String value) {
+ attributeIssuerID = value;
+ }
+
+ /** Gets the attribute recipient (her) associated with this resolution.
+ *
+ * @return the attribute recipient associated with this resolution.
+ */
+ @Nullable public String getAttributeRecipientID() {
+ return attributeRecipientID;
+ }
+
+ /** Sets the attribute recipient (her) associated with this resolution.
+ *
+ * @param value the attribute recipient associated with this resolution.
+ */
+ @Nullable public void setAttributeRecipientID(@Nullable String value) {
+ attributeRecipientID = value;
}
/**
Modified: trunk/idp-attribute-resolver-api/src/test/java/net/shibboleth/idp/attribute/resolver/AttributeResolutionContextTest.java
URL: http://svn.shibboleth.net/view/java-identity-provider/trunk/idp-attribute-resolver-api/src/test/java/net/shibboleth/idp/attribute/resolver/AttributeResolutionContextTest.java?rev=4282&r1=4281&r2=4282&view=diff
==============================================================================
--- trunk/idp-attribute-resolver-api/src/test/java/net/shibboleth/idp/attribute/resolver/AttributeResolutionContextTest.java (original)
+++ trunk/idp-attribute-resolver-api/src/test/java/net/shibboleth/idp/attribute/resolver/AttributeResolutionContextTest.java Fri Feb 22 05:53:21 2013
@@ -43,6 +43,19 @@
Assert.assertTrue(context.getResolvedAttributeDefinitions().isEmpty());
Assert.assertNotNull(context.getResolvedDataConnectors());
Assert.assertTrue(context.getResolvedDataConnectors().isEmpty());
+ }
+
+ @Test public void testInjectedValues() {
+ AttributeResolutionContext context = new AttributeResolutionContext();
+ Assert.assertNull(context.getPrincipal());
+ Assert.assertNull(context.getAttributeIssuerID());
+ Assert.assertNull(context.getAttributeRecipientID());
+ context.setPrincipal("Principal");
+ context.setAttributeIssuerID("AttributeIssuerID");
[... 8 lines stripped ...]
More information about the commits
mailing list