Skip to content

Commit

Permalink
[NOJIRA]
Browse files Browse the repository at this point in the history
If attributes object is null, don't try to set anything.
Fixed some more unit test stuff. Ugh.
  • Loading branch information
Bill Smith committed Aug 30, 2018
1 parent 457fe6c commit 208f227
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 31 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -82,31 +82,33 @@ public static void updateOpenSamlMetadataResolverFromReloadableMetadataResolverA
ParserPool parserPool) {
AbstractReloadingMetadataResolver reloadingMetadataResolver = (AbstractReloadingMetadataResolver) metadataResolver;

if (attributes.getExpirationWarningThreshold() != null) {
reloadingMetadataResolver.setExpirationWarningThreshold(toMillis(attributes.getExpirationWarningThreshold()));
}
if (attributes.getMaxRefreshDelay() != null) {
reloadingMetadataResolver.setMaxRefreshDelay(toMillis(attributes.getMaxRefreshDelay()));
}
if (attributes.getMinRefreshDelay() != null) {
reloadingMetadataResolver.setMinRefreshDelay(toMillis(attributes.getMinRefreshDelay()));
}

if (attributes.getResolveViaPredicatesOnly() != null) {
reloadingMetadataResolver.setResolveViaPredicatesOnly(attributes.getResolveViaPredicatesOnly());
}

if (attributes.getRefreshDelayFactor() != null) {
reloadingMetadataResolver.setRefreshDelayFactor(attributes.getRefreshDelayFactor().floatValue());
}

//TODO: This takes a set of MetadataIndex's. We've got an IndexesRef. How to convert?
// reloadingMetadataResolver.setIndexes(); attributes.getIndexesRef();

//TODO: This takes a ParserPool. We've got a ParserPoolRef in attributes.getParserPoolRef(). Should we use it for anything?
reloadingMetadataResolver.setParserPool(parserPool);

//TODO: Where does this get used in OpenSAML land?
// attributes.getTaskTimerRef();
if (attributes != null) {
if (attributes.getExpirationWarningThreshold() != null) {
reloadingMetadataResolver.setExpirationWarningThreshold(toMillis(attributes.getExpirationWarningThreshold()));
}
if (attributes.getMaxRefreshDelay() != null) {
reloadingMetadataResolver.setMaxRefreshDelay(toMillis(attributes.getMaxRefreshDelay()));
}
if (attributes.getMinRefreshDelay() != null) {
reloadingMetadataResolver.setMinRefreshDelay(toMillis(attributes.getMinRefreshDelay()));
}

if (attributes.getResolveViaPredicatesOnly() != null) {
reloadingMetadataResolver.setResolveViaPredicatesOnly(attributes.getResolveViaPredicatesOnly());
}

if (attributes.getRefreshDelayFactor() != null) {
reloadingMetadataResolver.setRefreshDelayFactor(attributes.getRefreshDelayFactor().floatValue());
}

//TODO: This takes a set of MetadataIndex's. We've got an IndexesRef. How to convert?
// reloadingMetadataResolver.setIndexes(); attributes.getIndexesRef();

//TODO: Where does this get used in OpenSAML land?
// attributes.getTaskTimerRef();
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -443,12 +443,9 @@ class TestObjectGenerator {
new FilesystemMetadataResolver().with {
it.name = 'FilesystemMetadata'
it.xmlId = 'FilesystemMetadata'
it.metadataFile = 'metadata.xml'
it.metadataFile = 'metadata/metadata.xml'

it.reloadableMetadataResolverAttributes = new ReloadableMetadataResolverAttributes().with {
it.minRefreshDelay = 'PT5M'
it.maxRefreshDelay = 'PT1H'
it.refreshDelayFactor = 0.75
it
}
it
Expand Down
5 changes: 1 addition & 4 deletions backend/src/test/resources/conf/520.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,6 @@
xsi:schemaLocation="urn:mace:shibboleth:2.0:metadata http://shibboleth.net/schema/idp/shibboleth-metadata.xsd urn:mace:shibboleth:2.0:resource http://shibboleth.net/schema/idp/shibboleth-resource.xsd urn:mace:shibboleth:2.0:security http://shibboleth.net/schema/idp/shibboleth-security.xsd urn:oasis:names:tc:SAML:2.0:metadata http://docs.oasis-open.org/security/saml/v2.0/saml-schema-metadata-2.0.xsd urn:oasis:names:tc:SAML:2.0:assertion http://docs.oasis-open.org/security/saml/v2.0/saml-schema-assertion-2.0.xsd"
xsi:type="ChainingMetadataProvider">
<MetadataProvider id="FilesystemMetadata"
maxRefreshDelay="PT1H"
metadataFile="metadata.xml"
minRefreshDelay="PT5M"
refreshDelayFactor="0.75"
metadataFile="metadata/metadata.xml"
xsi:type="FilesystemMetadataProvider"/>
</MetadataProvider>

0 comments on commit 208f227

Please sign in to comment.