-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into SHIBUI-525
- Loading branch information
Showing
283 changed files
with
3,625 additions
and
2,795 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
22 changes: 22 additions & 0 deletions
22
.../java/edu/internet2/tier/shibboleth/admin/ui/domain/filters/RequiredValidUntilFilter.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
package edu.internet2.tier.shibboleth.admin.ui.domain.filters; | ||
|
||
import lombok.EqualsAndHashCode; | ||
import lombok.Getter; | ||
import lombok.Setter; | ||
import lombok.ToString; | ||
|
||
import javax.persistence.Entity; | ||
|
||
@Entity | ||
@EqualsAndHashCode(callSuper = true) | ||
@Getter | ||
@Setter | ||
@ToString | ||
public class RequiredValidUntilFilter extends MetadataFilter { | ||
|
||
public RequiredValidUntilFilter() { | ||
type = "RequiredValidUntil"; | ||
} | ||
|
||
private String maxValidityInterval; | ||
} |
69 changes: 69 additions & 0 deletions
69
...test/groovy/edu/internet2/tier/shibboleth/admin/ui/configuration/TestConfiguration.groovy
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
package edu.internet2.tier.shibboleth.admin.ui.configuration | ||
|
||
import edu.internet2.tier.shibboleth.admin.ui.opensaml.OpenSamlObjects | ||
import edu.internet2.tier.shibboleth.admin.ui.repository.MetadataResolverRepository | ||
import net.shibboleth.ext.spring.resource.ResourceHelper | ||
import net.shibboleth.utilities.java.support.component.ComponentInitializationException | ||
import org.apache.lucene.document.Document | ||
import org.apache.lucene.document.Field | ||
import org.apache.lucene.document.StringField | ||
import org.apache.lucene.document.TextField | ||
import org.apache.lucene.index.IndexWriter | ||
import org.opensaml.saml.metadata.resolver.ChainingMetadataResolver | ||
import org.opensaml.saml.metadata.resolver.MetadataResolver | ||
import org.opensaml.saml.metadata.resolver.impl.ResourceBackedMetadataResolver | ||
import org.springframework.context.annotation.Bean | ||
import org.springframework.context.annotation.Configuration | ||
import org.springframework.core.io.ClassPathResource | ||
|
||
@Configuration | ||
class TestConfiguration { | ||
final OpenSamlObjects openSamlObjects | ||
final IndexWriter indexWriter | ||
final MetadataResolverRepository metadataResolverRepository | ||
|
||
TestConfiguration(final OpenSamlObjects openSamlObjects, final IndexWriter indexWriter, final MetadataResolverRepository metadataResolverRepository) { | ||
this.openSamlObjects =openSamlObjects | ||
this.indexWriter = indexWriter | ||
this.metadataResolverRepository = metadataResolverRepository | ||
} | ||
|
||
@Bean | ||
MetadataResolver metadataResolver() { | ||
ChainingMetadataResolver metadataResolver = new ChainingMetadataResolver() | ||
metadataResolver.setId("chain") | ||
|
||
def shortIncommon = new ResourceBackedMetadataResolver(ResourceHelper.of(new ClassPathResource('/metadata/incommon-short.xml'))){ | ||
@Override | ||
protected void initMetadataResolver() throws ComponentInitializationException { | ||
super.initMetadataResolver() | ||
|
||
for (String entityId: this.getBackingStore().getIndexedDescriptors().keySet()) { | ||
Document document = new Document(); | ||
document.add(new StringField("id", entityId, Field.Store.YES)); | ||
document.add(new TextField("content", entityId, Field.Store.YES)); // TODO: change entityId to be content of entity descriptor block | ||
try { | ||
indexWriter.addDocument(document); | ||
} catch (IOException e) { | ||
logger.error(e.getMessage(), e); | ||
} | ||
} | ||
try { | ||
indexWriter.commit() | ||
} catch (IOException e) { | ||
throw new ComponentInitializationException(e) | ||
} | ||
} | ||
}.with { | ||
it.id = 'test' | ||
TestConfiguration p = owner | ||
it.parserPool = p.openSamlObjects.parserPool | ||
it.initialize() | ||
it | ||
} | ||
|
||
metadataResolver.resolvers = [shortIncommon] | ||
metadataResolver.initialize() | ||
return metadataResolver | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.