Skip to content

Commit

Permalink
Merged develop into feature/shibui-2269
Browse files Browse the repository at this point in the history
  • Loading branch information
chasegawa committed Jul 18, 2022
2 parents 2f33071 + 00a57f6 commit 4caeca0
Show file tree
Hide file tree
Showing 51 changed files with 602 additions and 113 deletions.
7 changes: 4 additions & 3 deletions backend/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -171,9 +171,10 @@ dependencies {
runtimeOnly 'org.glassfish.jaxb:jaxb-runtime:2.3.0'

compile "com.h2database:h2"
runtimeOnly 'org.postgresql:postgresql:42.3.4'
runtimeOnly 'org.mariadb.jdbc:mariadb-java-client:3.0.4'
runtimeOnly 'mysql:mysql-connector-java:8.0.29'
runtimeOnly "org.postgresql:postgresql:${project.'postgresVersion'}"
runtimeOnly "org.mariadb.jdbc:mariadb-java-client:${project.'mariadbVersion'}"
runtimeOnly "mysql:mysql-connector-java:${project.'mysqlVersion'}"
runtimeOnly "com.microsoft.sqlserver:mssql-jdbc:${project.'sqlserverVersion'}"

//Swagger 3
implementation 'org.springdoc:springdoc-openapi-ui:1.6.8'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ import edu.internet2.tier.shibboleth.admin.ui.domain.resolvers.LocalDynamicMetad
import edu.internet2.tier.shibboleth.admin.ui.domain.resolvers.ReloadableMetadataResolverAttributes
import edu.internet2.tier.shibboleth.admin.ui.domain.resolvers.ResourceBackedMetadataResolver
import edu.internet2.tier.shibboleth.admin.ui.domain.resolvers.TemplateScheme
import edu.internet2.tier.shibboleth.admin.ui.opensaml.OpenSamlObjects
import edu.internet2.tier.shibboleth.admin.ui.repository.MetadataResolverRepository
import org.springframework.beans.factory.annotation.Autowired
import org.springframework.boot.autoconfigure.domain.EntityScan
Expand Down Expand Up @@ -269,7 +268,7 @@ class MetadataResolverEnversVersioningTests extends Specification {
when:
ResourceBackedMetadataResolver resolver = new ResourceBackedMetadataResolver(name: 'rbmr').with {
it.reloadableMetadataResolverAttributes = new ReloadableMetadataResolverAttributes(taskTimerRef: 'taskTimerRef')
it.classpathMetadataResource = new ClasspathMetadataResource(file: 'metadata.xml')
it.classpathMetadataResource = new ClasspathMetadataResource(fileResource: 'metadata.xml')
it
}

Expand All @@ -283,15 +282,15 @@ class MetadataResolverEnversVersioningTests extends Specification {
resolverHistory.size() == 1
getTargetEntityForRevisionIndex(resolverHistory, 0).name == 'rbmr'
getTargetEntityForRevisionIndex(resolverHistory, 0).reloadableMetadataResolverAttributes.taskTimerRef == 'taskTimerRef'
getTargetEntityForRevisionIndex(resolverHistory, 0).classpathMetadataResource.file == 'metadata.xml'
getTargetEntityForRevisionIndex(resolverHistory, 0).classpathMetadataResource.fileResource == 'metadata.xml'
getRevisionEntityForRevisionIndex(resolverHistory, 0).principalUserName == 'anonymousUser'
getRevisionEntityForRevisionIndex(resolverHistory, 0).timestamp > 0L
getModifiedEntityNames(resolverHistory, 0).sort() == expectedModifiedPersistentEntities.sort()

when:
resolver.name = 'rbmrUPDATED'
resolver.reloadableMetadataResolverAttributes.taskTimerRef = 'taskTimerRefUPDATED'
resolver.classpathMetadataResource.file = 'metadataUPDATED.xml'
resolver.classpathMetadataResource.fileResource = 'metadataUPDATED.xml'

resolverHistory = updateAndGetRevisionHistoryOfMetadataResolver(resolver,
metadataResolverRepository,
Expand All @@ -303,16 +302,16 @@ class MetadataResolverEnversVersioningTests extends Specification {
resolverHistory.size() == 2
getTargetEntityForRevisionIndex(resolverHistory, 1).name == 'rbmrUPDATED'
getTargetEntityForRevisionIndex(resolverHistory, 1).reloadableMetadataResolverAttributes.taskTimerRef == 'taskTimerRefUPDATED'
getTargetEntityForRevisionIndex(resolverHistory, 1).classpathMetadataResource.file == 'metadataUPDATED.xml'
getTargetEntityForRevisionIndex(resolverHistory, 1).classpathMetadataResource.fileResource == 'metadataUPDATED.xml'
getRevisionEntityForRevisionIndex(resolverHistory, 1).principalUserName == 'anonymousUser'
getRevisionEntityForRevisionIndex(resolverHistory, 1).timestamp > 0L
getModifiedEntityNames(resolverHistory, 1).sort() == expectedModifiedPersistentEntities.sort()

//Check the original revision is intact
getTargetEntityForRevisionIndex(resolverHistory, 0).name == 'rbmr'
getTargetEntityForRevisionIndex(resolverHistory, 0).reloadableMetadataResolverAttributes.taskTimerRef == 'taskTimerRef'
getTargetEntityForRevisionIndex(resolverHistory, 0).classpathMetadataResource.file == 'metadata.xml'
getTargetEntityForRevisionIndex(resolverHistory, 0).classpathMetadataResource.fileResource == 'metadata.xml'
getRevisionEntityForRevisionIndex(resolverHistory, 0).principalUserName == 'anonymousUser'
getRevisionEntityForRevisionIndex(resolverHistory, 0).timestamp > 0L
}
}
}
2 changes: 1 addition & 1 deletion backend/src/integration/resources/SHIBUI-1281.side
Original file line number Diff line number Diff line change
Expand Up @@ -1974,7 +1974,7 @@
["xpath=//metadata-configuration[@id='configuration']/div/section[9]/div/div[2]/object-property/array-property/div/div[5]/div/span", "xpath:idRelative"],
["xpath=//div/div[5]/div/span", "xpath:position"]
],
"value": "True"
"value": "true"
}, {
"id": "1406d7e4-907d-4359-8de8-a40206f0993e",
"comment": "",
Expand Down
4 changes: 2 additions & 2 deletions backend/src/integration/resources/SHIBUI-1333.side
Original file line number Diff line number Diff line change
Expand Up @@ -1956,7 +1956,7 @@
["xpath=//metadata-configuration[@id='configuration']/div/section[9]/div/div[2]/object-property/array-property/div/div[5]/div/span", "xpath:idRelative"],
["xpath=//div/div[5]/div/span", "xpath:position"]
],
"value": "True"
"value": "true"
}, {
"id": "1406d7e4-907d-4359-8de8-a40206f0993e",
"comment": "",
Expand Down Expand Up @@ -2253,7 +2253,7 @@
["xpath=//metadata-configuration[@id='configuration']/div/section[8]/div/div[2]/object-property/array-property/div/div/div[3]/div/span", "xpath:idRelative"],
["xpath=//section[8]/div/div[2]/object-property/array-property/div/div/div[3]/div/span", "xpath:position"]
],
"value": "True"
"value": "true"
},{
"id": "4ec2c493-85e4-403b-9b09-031c5728f498",
"comment": "",
Expand Down
4 changes: 2 additions & 2 deletions backend/src/integration/resources/SHIBUI-1334-1.side
Original file line number Diff line number Diff line change
Expand Up @@ -1966,7 +1966,7 @@
["xpath=//metadata-configuration[@id='configuration']/div/section[9]/div/div[2]/object-property/array-property/div/div[5]/div/span", "xpath:idRelative"],
["xpath=//div/div[5]/div/span", "xpath:position"]
],
"value": "True"
"value": "true"
}, {
"id": "a1050ebe-55c5-4eac-8d12-615f3ff1cd72",
"comment": "",
Expand Down Expand Up @@ -2281,7 +2281,7 @@
["xpath=//metadata-configuration[@id='configuration']/div/section[8]/div/div[2]/object-property/array-property/div/div/div[3]/div/span", "xpath:idRelative"],
["xpath=//section[8]/div/div[2]/object-property/array-property/div/div/div[3]/div/span", "xpath:position"]
],
"value": "True"
"value": "true"
}, {
"id": "2c46cdcd-d5a5-47fe-aa7b-0120fd2fcfc9",
"comment": "",
Expand Down
8 changes: 4 additions & 4 deletions backend/src/integration/resources/SHIBUI-1385-1.side
Original file line number Diff line number Diff line change
Expand Up @@ -1995,9 +1995,9 @@
["css=.d-flex:nth-child(1) > .py-2 > span", "css:finder"],
["xpath=//div[@id='root']/div/main/div/section/div[2]/div[3]/div/section[9]/div/div[2]/div[2]/div/div/span", "xpath:idRelative"],
["xpath=//section[9]/div/div[2]/div[2]/div/div/span", "xpath:position"],
["xpath=//span[contains(.,'True')]", "xpath:innerText"]
["xpath=//span[contains(.,'true')]", "xpath:innerText"]
],
"value": "True"
"value": "true"
}, {
"id": "1406d7e4-907d-4359-8de8-a40206f0993e",
"comment": "",
Expand Down Expand Up @@ -2291,9 +2291,9 @@
["css=.d-flex:nth-child(1) > .py-2 > span", "css:finder"],
["xpath=//div[@id='root']/div/main/div/section/div/div/section[8]/div/div[2]/div[2]/div/div/span", "xpath:idRelative"],
["xpath=//section[8]/div/div[2]/div[2]/div/div/span", "xpath:position"],
["xpath=//span[contains(.,'True')]", "xpath:innerText"]
["xpath=//span[contains(.,'true')]", "xpath:innerText"]
],
"value": "True"
"value": "true"
}, {
"id": "2c46cdcd-d5a5-47fe-aa7b-0120fd2fcfc9",
"comment": "",
Expand Down
4 changes: 2 additions & 2 deletions backend/src/integration/resources/SHIBUI-1407-1.side
Original file line number Diff line number Diff line change
Expand Up @@ -2013,7 +2013,7 @@
["xpath=//div[@id='root']/div/main/div/section/div[2]/div[3]/div/section[9]/div/div[2]/div[2]/div[2]/div", "xpath:idRelative"],
["xpath=//section[9]/div/div[2]/div[2]/div[2]/div", "xpath:position"]
],
"value": "True"
"value": "true"
}, {
"id": "1406d7e4-907d-4359-8de8-a40206f0993e",
"comment": "",
Expand Down Expand Up @@ -2289,7 +2289,7 @@
["xpath=//div[@id='root']/div/main/div/section/div/div/section[8]/div/div[2]/div[2]/div[3]/div", "xpath:idRelative"],
["xpath=//section[8]/div/div[2]/div[2]/div[3]/div", "xpath:position"]
],
"value": "True"
"value": "true"
}, {
"id": "2c46cdcd-d5a5-47fe-aa7b-0120fd2fcfc9",
"comment": "",
Expand Down
2 changes: 1 addition & 1 deletion backend/src/integration/resources/SHIBUI-1521.side
Original file line number Diff line number Diff line change
Expand Up @@ -1808,7 +1808,7 @@
["xpath=//metadata-configuration[@id='configuration']/div/section[9]/div/div[2]/object-property/array-property/div/div[5]/div/span", "xpath:idRelative"],
["xpath=//div/div[5]/div/span", "xpath:position"]
],
"value": "True"
"value": "true"
}, {
"id": "1406d7e4-907d-4359-8de8-a40206f0993e",
"comment": "",
Expand Down
20 changes: 10 additions & 10 deletions backend/src/integration/resources/SHIBUI-1744-2.side
Original file line number Diff line number Diff line change
Expand Up @@ -547,9 +547,9 @@
["css=.d-flex:nth-child(3) > .py-2 > span", "css:finder"],
["xpath=//div[@id='root']/div/main/div/section/div[2]/div[3]/div/section[9]/div/div[2]/div[2]/div[3]/div/span", "xpath:idRelative"],
["xpath=//div[2]/div[3]/div/span", "xpath:position"],
["xpath=//span[contains(.,'True')]", "xpath:innerText"]
["xpath=//span[contains(.,'true')]", "xpath:innerText"]
],
"value": "True"
"value": "true"
}, {
"id": "bfc6ef5f-aaf7-4945-bbc1-d89e95b8d3ac",
"comment": "",
Expand All @@ -560,7 +560,7 @@
["xpath=//div[@id='root']/div/main/div/section/div[2]/div[3]/div/section[9]/div/div[2]/div[2]/div[4]/div/span", "xpath:idRelative"],
["xpath=//div[2]/div[4]/div/span", "xpath:position"]
],
"value": "True"
"value": "true"
}, {
"id": "5225f1db-7bdc-432e-a422-c6684b9e8416",
"comment": "",
Expand All @@ -571,7 +571,7 @@
["xpath=//div[@id='root']/div/main/div/section/div[2]/div[3]/div/section[9]/div/div[2]/div[2]/div[5]/div/span", "xpath:idRelative"],
["xpath=//div[2]/div[5]/div/span", "xpath:position"]
],
"value": "True"
"value": "true"
}, {
"id": "2a14e2d4-31f1-4ae8-b977-b6edd94de02c",
"comment": "",
Expand Down Expand Up @@ -614,9 +614,9 @@
["css=.d-flex:nth-child(4) > .py-2 > span", "css:finder"],
["xpath=//div[@id='root']/div/main/div/section/div/div/section[8]/div/div[2]/div[2]/div[4]/div/span", "xpath:idRelative"],
["xpath=//div[2]/div[4]/div/span", "xpath:position"],
["xpath=//span[contains(.,'True')]", "xpath:innerText"]
["xpath=//span[contains(.,'true')]", "xpath:innerText"]
],
"value": "True"
"value": "true"
}, {
"id": "09fa0157-7e1a-4886-969e-fe9519974923",
"comment": "",
Expand All @@ -626,9 +626,9 @@
["css=.d-flex:nth-child(4) > .py-2 > span", "css:finder"],
["xpath=//div[@id='root']/div/main/div/section/div/div/section[8]/div/div[2]/div[2]/div[4]/div/span", "xpath:idRelative"],
["xpath=//div[2]/div[4]/div/span", "xpath:position"],
["xpath=//span[contains(.,'True')]", "xpath:innerText"]
["xpath=//span[contains(.,'true')]", "xpath:innerText"]
],
"value": "True"
"value": "true"
}, {
"id": "95dd6769-d8b6-4c1e-a799-fb4c083a1b43",
"comment": "",
Expand All @@ -638,9 +638,9 @@
["css=.d-flex:nth-child(4) > .py-2 > span", "css:finder"],
["xpath=//div[@id='root']/div/main/div/section/div/div/section[8]/div/div[2]/div[2]/div[4]/div/span", "xpath:idRelative"],
["xpath=//div[2]/div[4]/div/span", "xpath:position"],
["xpath=//span[contains(.,'True')]", "xpath:innerText"]
["xpath=//span[contains(.,'true')]", "xpath:innerText"]
],
"value": "True"
"value": "true"
},{
"id": "4ec2c493-85e4-403b-9b09-031c5728f498",
"comment": "",
Expand Down
8 changes: 4 additions & 4 deletions backend/src/integration/resources/SHIBUI-1744-3.side
Original file line number Diff line number Diff line change
Expand Up @@ -652,9 +652,9 @@
["css=.d-flex:nth-child(3) > .py-2 > span", "css:finder"],
["xpath=//div[@id='filters']/ul/li/div[2]/section[3]/div/div[2]/div[2]/div[3]/div/span", "xpath:idRelative"],
["xpath=//section[3]/div/div[2]/div[2]/div[3]/div/span", "xpath:position"],
["xpath=//span[contains(.,'True')]", "xpath:innerText"]
["xpath=//span[contains(.,'true')]", "xpath:innerText"]
],
"value": "True"
"value": "true"
}, {
"id": "64723648-aef5-4c50-8605-74c5992ac628",
"comment": "",
Expand All @@ -665,7 +665,7 @@
["xpath=//div[@id='filters']/ul/li/div[2]/section[3]/div/div[2]/div[2]/div[4]/div/span", "xpath:idRelative"],
["xpath=//section[3]/div/div[2]/div[2]/div[4]/div/span", "xpath:position"]
],
"value": "True"
"value": "true"
}, {
"id": "509ee76e-7d39-453e-a5cc-cf7b3975b476",
"comment": "",
Expand All @@ -676,7 +676,7 @@
["xpath=//div[@id='filters']/ul/li/div[2]/section[3]/div/div[2]/div[2]/div[5]/div/span", "xpath:idRelative"],
["xpath=//section[3]/div/div[2]/div[2]/div[5]/div/span", "xpath:position"]
],
"value": "True"
"value": "true"
},{
"id": "4ec2c493-85e4-403b-9b09-031c5728f498",
"comment": "",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -426,7 +426,7 @@ class JPAMetadataResolverServiceImpl implements MetadataResolverService {
MetadataResource(
'xmlns:resource': 'urn:mace:shibboleth:2.0:resource',
'xsi:type': 'resource:ClasspathResource',
'file': resolver.classpathMetadataResource.file)
'file': resolver.classpathMetadataResource.fileResource)
}

childNodes()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ public class CustomEntityAttributeDefinition implements IRelyingPartyOverridePro
@ElementCollection
@CollectionTable(name = "custom_entity_attr_list_items", joinColumns = @JoinColumn(name = "name"))
@Fetch(FetchMode.JOIN)
@Column(name = "value", nullable = false)
@Column(name = "item_value", nullable = false)
Set<String> customAttrListDefinitions = new HashSet<>();

@Column(name = "default_value", nullable = true)
Expand Down Expand Up @@ -114,4 +114,4 @@ public void setName(String name) {
public void updateExamplesList() {
examples = customAttrListDefinitions;
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import org.hibernate.envers.Audited;

import javax.annotation.Nullable;
import javax.persistence.Column;
import javax.persistence.MappedSuperclass;

@MappedSuperclass
Expand All @@ -11,6 +12,7 @@ public class LocalizedName extends AbstractXMLObject implements org.opensaml.sam

private String xMLLang;

@Column(name = "name_value")
private String value;

@Nullable
Expand All @@ -34,4 +36,4 @@ public String getValue() {
public void setValue(@Nullable String value) {
this.value = value;
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ public class OrganizationURL extends AbstractXMLObject implements org.opensaml.s

private String xMLLang;

@Column(name="value")
@Column(name="uri_value")
private String uri;

@Nullable
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package edu.internet2.tier.shibboleth.admin.ui.domain;

import lombok.EqualsAndHashCode;
import org.hibernate.annotations.Type;
import org.hibernate.envers.Audited;

import javax.annotation.Nullable;
Expand All @@ -14,6 +15,7 @@
public class X509Certificate extends AbstractXMLObject implements org.opensaml.xmlsec.signature.X509Certificate {
@Column(name = "x509CertificateValue")
@Lob
@Type(type = "org.hibernate.type.TextType")
private String value;

@Nullable
Expand All @@ -26,4 +28,4 @@ public String getValue() {
public void setValue(@Nullable String value) {
this.value = value;
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ public class EntityAttributesFilterTarget extends AbstractAuditable implements I

@ElementCollection (fetch = FetchType.EAGER)
@OrderColumn
@Column(length = 760)
@Column(length = 760, name="target_value")
private List<String> value;

public EntityAttributesFilterTargetType getEntityAttributesFilterTargetType() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
import org.hibernate.envers.AuditOverride;
import org.hibernate.envers.Audited;

import javax.persistence.Column;
import javax.persistence.ElementCollection;
import javax.persistence.Entity;
import javax.persistence.OrderColumn;
Expand All @@ -27,6 +28,7 @@ public class NameIdFormatFilterTarget extends AbstractAuditable implements IFilt

@ElementCollection
@OrderColumn
@Column(name="target_value")
private List<String> value;

public NameIdFormatFilterTargetType getNameIdFormatFilterTargetType() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,6 @@
@Setter
@EqualsAndHashCode
public class ClasspathMetadataResource {

private String file;
}
// renamed from "file" to work with SQLServer
private String fileResource;
}
Loading

0 comments on commit 4caeca0

Please sign in to comment.