Skip to content

Commit

Permalink
[SHIBUI-469]
Browse files Browse the repository at this point in the history
Hijack the incommon metadata resolver refresh
  • Loading branch information
Jj! committed May 2, 2018
1 parent 061dada commit 5ac7c14
Showing 1 changed file with 11 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import edu.internet2.tier.shibboleth.admin.ui.repository.MetadataResolverRepository;
import net.shibboleth.utilities.java.support.component.ComponentInitializationException;
import net.shibboleth.utilities.java.support.resolver.ResolverException;
import org.apache.http.HttpResponse;
import org.apache.http.impl.client.HttpClients;
import org.apache.lucene.document.Document;
import org.apache.lucene.document.Field;
Expand All @@ -13,6 +14,7 @@
import org.joda.time.DateTime;
import org.opensaml.saml.metadata.resolver.ChainingMetadataResolver;
import org.opensaml.saml.metadata.resolver.MetadataResolver;
import org.opensaml.saml.metadata.resolver.filter.MetadataFilterChain;
import org.opensaml.saml.metadata.resolver.impl.FileBackedHTTPMetadataResolver;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
Expand Down Expand Up @@ -71,16 +73,25 @@ protected void initMetadataResolver() throws ComponentInitializationException {
}
}

// TODO: this is probably not the best way to do this
@Nullable
@Override
public DateTime getLastRefresh() {
return null;
}

// TODO: this is probably not the best way to do this
@Override
protected void processConditionalRetrievalHeaders(HttpResponse response) {
// let's do nothing 'cause we want to allow a refresh
}
};
incommonMR.setId("incommonmd");
incommonMR.setParserPool(openSamlObjects.getParserPool());
incommonMR.setMetadataFilter(new MetadataFilterChain());
incommonMR.initialize();


resolvers.add(incommonMR);

if (!metadataResolverRepository.findAll().iterator().hasNext()) {
Expand Down

0 comments on commit 5ac7c14

Please sign in to comment.