[java-identity-provider COMMIT] in /trunk/idp-attribute-resolver-impl/src: main/java/net/shibboleth/idp/attribute/res...
noreply at shibboleth.net
noreply at shibboleth.net
Tue Mar 15 11:25:48 EDT 2016
Author: rdw
Date: Tue Mar 15 11:25:48 2016
New Revision: 8154
URL: http://svn.shibboleth.net/view/java-identity-provider?rev=8154&view=rev
Log:
IDP-926 add PrincipalDerivedAttributeDefinition
https://issues.shibboleth.net/jira/browse/IDP-926
Add the mechanics to iterate over all Principals, offering them
up to an engine to generate AttributeValue results. Collect these
Values into the resulting Attribute.
Add an example engine to extra the values from the (specifically
named) IdPAttribute inside a IdPAttributePrincipal.
Test.
Added:
trunk/idp-attribute-resolver-impl/src/main/java/net/shibboleth/idp/attribute/resolver/ad/impl/IdPAttributePrincipalValueEngine.java (with props)
trunk/idp-attribute-resolver-impl/src/main/java/net/shibboleth/idp/attribute/resolver/ad/impl/PrincipalDerivedAttributeDefinition.java (with props)
trunk/idp-attribute-resolver-impl/src/test/java/net/shibboleth/idp/attribute/resolver/ad/impl/PrincipalDerivedAttributeDefinitionTest.java (with props)
Modified:
trunk/idp-attribute-resolver-impl/src/test/java/net/shibboleth/idp/attribute/resolver/ad/impl/ScriptedAttributeTest.java
trunk/idp-attribute-resolver-impl/src/test/resources/logback-test.xml
Modified: trunk/idp-attribute-resolver-impl/src/test/java/net/shibboleth/idp/attribute/resolver/ad/impl/ScriptedAttributeTest.java
URL: http://svn.shibboleth.net/view/java-identity-provider/trunk/idp-attribute-resolver-impl/src/test/java/net/shibboleth/idp/attribute/resolver/ad/impl/ScriptedAttributeTest.java?rev=8154&r1=8153&r2=8154&view=diff
==============================================================================
--- trunk/idp-attribute-resolver-impl/src/test/java/net/shibboleth/idp/attribute/resolver/ad/impl/ScriptedAttributeTest.java (original)
+++ trunk/idp-attribute-resolver-impl/src/test/java/net/shibboleth/idp/attribute/resolver/ad/impl/ScriptedAttributeTest.java Tue Mar 15 11:25:48 2016
@@ -78,19 +78,19 @@
private static Logger log = LoggerFactory.getLogger(ScriptedAttributeTest.class);
- private String fileNameToPath(String fileName, boolean isV8Capable) {
+ private String fileNameToPath(final String fileName, final boolean isV8Capable) {
if (isV8() && !isV8Capable) {
return "/net/shibboleth/idp/attribute/resolver/impl/ad/jdk8/" + fileName;
}
return "/net/shibboleth/idp/attribute/resolver/impl/ad/" + fileName;
}
- private String getScript(String fileName, boolean isV8Capable) throws IOException {
+ private String getScript(final String fileName, final boolean isV8Capable) throws IOException {
return StringSupport.inputStreamToString(getClass().getResourceAsStream(fileNameToPath(fileName, isV8Capable)),
null);
}
- private String getScript(String fileName) throws IOException {
+ private String getScript(final String fileName) throws IOException {
return getScript(fileName, true);
}
@@ -282,7 +282,7 @@
Assert.assertEquals(results.iterator().next(), attributeValue, "Scripted result contains known value");
}
- private ScriptedAttributeDefinition buildTest(String failingScript, boolean v8Safe) throws ScriptException,
+ private ScriptedAttributeDefinition buildTest(final String failingScript, final boolean v8Safe) throws ScriptException,
IOException, ComponentInitializationException {
final ScriptedAttributeDefinition attr = new ScriptedAttributeDefinition();
@@ -290,7 +290,7 @@
try {
attr.initialize();
Assert.fail("No script defined");
- } catch (ComponentInitializationException ex) {
+ } catch (final ComponentInitializationException ex) {
// OK
}
@@ -300,14 +300,14 @@
return attr;
}
- private void failureTest(String failingScript, String failingMessage, boolean v8Safe) throws ScriptException,
+ private void failureTest(final String failingScript, final String failingMessage, final boolean v8Safe) throws ScriptException,
IOException, ComponentInitializationException {
try {
buildTest(failingScript, v8Safe).resolve(generateContext());
Assert.fail("Script: '" + failingScript + "' should have thrown an exception: " + failingMessage);
- } catch (ResolutionException ex) {
+ } catch (final ResolutionException ex) {
log.trace("Successful exception", ex);
- } catch (RuntimeException ex) {
+ } catch (final RuntimeException ex) {
if (isV8() && (ex.getCause() instanceof ResolutionException)) {
// nashhorn wraps exceptions
log.trace("Successful exception", ex);
@@ -435,9 +435,9 @@
attr.setValues(values);
- AttributeResolutionContext resolutionContext =
+ final AttributeResolutionContext resolutionContext =
ResolverTestSupport.buildResolutionContext(ResolverTestSupport.buildDataConnector("connector1", attr));
- ResolverPluginDependency depend = new ResolverPluginDependency("connector1");
[... 110 lines stripped ...]
More information about the commits
mailing list