-
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.
initial commit, no working state
- Loading branch information
Showing
10 changed files
with
533 additions
and
14 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
59 changes: 59 additions & 0 deletions
59
...java/edu/internet2/tier/shibboleth/admin/ui/domain/filters/algorithm/AlgorithmFilter.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,59 @@ | ||
| package edu.internet2.tier.shibboleth.admin.ui.domain.filters.algorithm; | ||
|
|
||
| import edu.internet2.tier.shibboleth.admin.ui.domain.AbstractXMLObject; | ||
| import edu.internet2.tier.shibboleth.admin.ui.domain.filters.MetadataFilter; | ||
| import edu.internet2.tier.shibboleth.admin.ui.domain.filters.SignatureValidationFilter; | ||
| import lombok.EqualsAndHashCode; | ||
| import lombok.Getter; | ||
| import lombok.Setter; | ||
| import lombok.ToString; | ||
| import org.hibernate.envers.Audited; | ||
| import org.opensaml.core.xml.ElementExtensibleXMLObject; | ||
| import org.opensaml.core.xml.XMLObject; | ||
|
|
||
| import javax.annotation.Nonnull; | ||
| import javax.persistence.CascadeType; | ||
| import javax.persistence.ElementCollection; | ||
| import javax.persistence.Entity; | ||
| import javax.persistence.OneToMany; | ||
| import javax.persistence.OrderColumn; | ||
| import javax.xml.namespace.QName; | ||
| import java.util.ArrayList; | ||
| import java.util.List; | ||
| import java.util.stream.Collectors; | ||
|
|
||
| /** | ||
| * Following the pattern of AbstractElementExtensibleXMLObject - this XML type can hold a couple of different types of XML objects | ||
| */ | ||
| @Entity | ||
| @Audited | ||
| @Getter | ||
| @Setter | ||
| @ToString | ||
| @EqualsAndHashCode(callSuper = true) | ||
| public class AlgorithmFilter extends MetadataFilter { | ||
| @OneToMany(cascade = CascadeType.ALL) | ||
| @OrderColumn | ||
| private List<AbstractXMLObject> unknownXMLObjects = new ArrayList<>(); | ||
|
|
||
| public void addUnknownXMLObject(AbstractXMLObject xmlObject) { | ||
| this.unknownXMLObjects.add(xmlObject); | ||
| } | ||
|
|
||
| @Nonnull | ||
| public List<XMLObject> getUnknownXMLObjects() { | ||
| return (List<XMLObject>) (List<? extends XMLObject>) this.unknownXMLObjects; | ||
| } | ||
|
|
||
| private AlgorithmFilter updateConcreteFilterTypeData(AlgorithmFilter filterToBeUpdated) { | ||
| for (XMLObject o : getUnknownXMLObjects()) { | ||
| filterToBeUpdated.addUnknownXMLObject((AbstractXMLObject) o); | ||
| } | ||
| return filterToBeUpdated; | ||
| } | ||
|
|
||
| @Override | ||
| public MetadataFilter updateConcreteFilterTypeData(MetadataFilter filterToBeUpdated) { | ||
| return updateConcreteFilterTypeData((AlgorithmFilter) filterToBeUpdated); | ||
| } | ||
| } |
24 changes: 24 additions & 0 deletions
24
...src/main/java/edu/internet2/tier/shibboleth/admin/ui/domain/filters/algorithm/Entity.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,24 @@ | ||
| package edu.internet2.tier.shibboleth.admin.ui.domain.filters.algorithm; | ||
|
|
||
| import edu.internet2.tier.shibboleth.admin.ui.domain.AbstractXMLObject; | ||
|
|
||
| import javax.annotation.Nullable; | ||
|
|
||
| public class Entity extends AbstractXMLObject implements org.opensaml.core.xml.schema.XSString { | ||
| private String uri; | ||
|
|
||
| private Entity(){ | ||
| setElementLocalName("Entity"); | ||
| } | ||
|
|
||
| @Nullable | ||
| @Override | ||
| public String getValue() { | ||
| return this.uri; | ||
| } | ||
|
|
||
| @Override | ||
| public void setValue(@Nullable String newValue) { | ||
| this.uri = newValue; | ||
| } | ||
| } |
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
12 changes: 12 additions & 0 deletions
12
...t2/tier/shibboleth/admin/ui/opensaml/config/JPAXMLObjectProviderInitializerForTest.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,12 @@ | ||
| package edu.internet2.tier.shibboleth.admin.ui.opensaml.config | ||
|
|
||
| import org.opensaml.core.xml.config.AbstractXMLObjectProviderInitializer | ||
|
|
||
| class JPAXMLObjectProviderInitializerForTest extends AbstractXMLObjectProviderInitializer { | ||
| @Override | ||
| protected String[] getConfigResources() { | ||
| return new String[]{ | ||
| "/jpa-saml2-metadata-config.xml", | ||
| } | ||
| } | ||
| } |
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
1 change: 1 addition & 0 deletions
1
backend/src/test/resources/META-INF/services/org.opensaml.core.config.Initializer
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 @@ | ||
| edu.internet2.tier.shibboleth.admin.ui.opensaml.config.JPAXMLObjectProviderInitializerForTest |
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,7 @@ | ||
| <MetadataProvider id='ShibbolethMetadata' xmlns='urn:mace:shibboleth:2.0:metadata' xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xsi:type='ChainingMetadataProvider' 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'> | ||
| <MetadataFilter xsi:type='Algorithm'> | ||
| <md:EncryptionMethod Algorithm="http://www.w3.org/2001/04/xmlenc#aes128-cbc" /> | ||
| <Entity>https://broken.example.org/sp</Entity> | ||
| <Entity>https://also-broken.example.org/sp</Entity> | ||
| </MetadataFilter> | ||
| </MetadataProvider> |
Oops, something went wrong.