Skip to content

Commit cf03238

Browse files
authored
Merge branch 'main' into 1959-list-sort
2 parents 2e4bbdb + b3fb01d commit cf03238

22 files changed

Lines changed: 238 additions & 29 deletions

File tree

.github/PULL_REQUEST_TEMPLATE/pull_request_template.md renamed to .github/pull_request_template.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,4 +21,4 @@
2121
**Additional Description:**
2222
<!-- Briefly describe how AI was used -->
2323

24-
[ ] No AI Used
24+
- [ ] No AI Used

.github/workflows/build.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,8 @@ jobs:
4242
jq 'reduce inputs as $i (.; .source_files += $i.source_files)' target/coveralls.json coverage/coveralls.json > coveralls.json
4343
4444
- name: "Send to Coveralls"
45+
if: github.event_name != 'pull_request'
46+
continue-on-error: true
4547
uses: MikeEdgar/github-action@raw_coverage_file
4648
with:
4749
github-token: ${{ secrets.github_token }}

pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@
4848
<dependency>
4949
<groupId>org.apache.tomcat.embed</groupId>
5050
<artifactId>tomcat-embed-core</artifactId>
51-
<version>9.0.117</version>
51+
<version>9.0.118</version>
5252
</dependency>
5353

5454
<dependency>

src/main/java/org/tdl/vireo/auth/service/VireoUserCredentialsService.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ public synchronized User updateUserByCredentials(Credentials credentials) {
9494
} else {
9595
boolean isUserUpdated = false;
9696

97-
if (StringUtils.isNotEmpty(shibNetid) && (user.getNetid() == null || !user.getNetid().equals(shibNetid))) {
97+
if (StringUtils.isNotEmpty(shibNetid) && (user.getNetid() == null || (user.getNetid().trim().length() < 1) || !user.getNetid().equals(shibNetid))) {
9898
user.setNetid(shibNetid);
9999
isUserUpdated = true;
100100
}

src/main/java/org/tdl/vireo/config/AppWebSecurityConfig.java

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,16 @@
22

33
import static org.springframework.security.config.http.SessionCreationPolicy.STATELESS;
44

5+
import java.nio.charset.StandardCharsets;
6+
import java.util.regex.Pattern;
7+
8+
import org.springframework.context.annotation.Bean;
59
import org.springframework.context.annotation.Configuration;
610
import org.springframework.security.config.annotation.method.configuration.EnableGlobalMethodSecurity;
711
import org.springframework.security.config.annotation.web.builders.HttpSecurity;
812
import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity;
13+
import org.springframework.security.web.firewall.HttpFirewall;
14+
import org.springframework.security.web.firewall.StrictHttpFirewall;
915
import org.tdl.vireo.auth.service.VireoUserDetailsService;
1016
import org.tdl.vireo.model.Role;
1117
import org.tdl.vireo.model.User;
@@ -18,6 +24,17 @@
1824
@EnableGlobalMethodSecurity(prePostEnabled = true, securedEnabled = true)
1925
public class AppWebSecurityConfig extends AuthWebSecurityConfig<User, UserRepo, VireoUserDetailsService> {
2026

27+
@Bean
28+
public HttpFirewall httpFirewall() {
29+
StrictHttpFirewall firewall = new StrictHttpFirewall();
30+
Pattern allowed = Pattern.compile("[\\p{IsAssigned}&&[^\\p{IsControl}]]*");
31+
firewall.setAllowedHeaderValues(header -> {
32+
String parsed = new String(header.getBytes(StandardCharsets.ISO_8859_1), StandardCharsets.UTF_8);
33+
return allowed.matcher(parsed).matches();
34+
});
35+
return firewall;
36+
}
37+
2138
@Override
2239
protected void configure(HttpSecurity http) throws Exception {
2340
// @formatter:off

src/main/java/org/tdl/vireo/controller/SubmissionController.java

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -193,6 +193,9 @@ public class SubmissionController {
193193
@Value("${app.documentType.rename:}")
194194
private String documentTypesToRename;
195195

196+
@Value("${app.secondaryDelimiter:|}")
197+
private String secondaryDelimiter;
198+
196199
@RequestMapping("/all")
197200
@PreAuthorize("hasRole('ADMIN')")
198201
public ApiResponse getAll() {
@@ -597,7 +600,7 @@ private void processBatchExport(
597600

598601
// Stream data rows
599602
for (Submission submission : submissions) {
600-
ExportPackage exportPackage = packagerUtility.packageExport(packager, submission, columns);
603+
ExportPackage exportPackage = packagerUtility.packageExport(packager, submission, columns, secondaryDelimiter);
601604
if (exportPackage.isMap()) {
602605
Map<String, String> rowData = (Map<String, String>) exportPackage.getPayload();
603606
Row row = worksheet.createRow(rowCount++);
@@ -1101,7 +1104,7 @@ public ApiResponse removeFile(@WeaverUser User user, @PathVariable Long submissi
11011104
if (user.getRole().equals(Role.ROLE_STUDENT) && documentType.equals("_doctype_license")) {
11021105
apiResponse = new ApiResponse(ERROR, "You are not allowed to delete license files!");
11031106
} else {
1104-
if (user.getRole().equals(Role.ROLE_ADMIN) || user.getRole().equals(Role.ROLE_MANAGER) || uri.contains(String.valueOf(hash))) {
1107+
if (user.getRole().equals(Role.ROLE_ADMIN) || user.getRole().equals(Role.ROLE_MANAGER) || user.getRole().equals(Role.ROLE_REVIEWER) || uri.contains(String.valueOf(hash))) {
11051108
String fileName = "";
11061109
String fileSize = "file not found";
11071110
if (assetService.assetFileExists(uri)) {

src/main/java/org/tdl/vireo/model/CustomActionDefinition.java

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,15 @@ public CustomActionDefinition(String label, Boolean isStudentVisible) {
3434
isStudentVisible(isStudentVisible);
3535
}
3636

37+
/**
38+
* @return the position
39+
*/
40+
@Override
41+
@JsonView(Views.SubmissionList.class)
42+
public Long getPosition() {
43+
return super.getPosition();
44+
}
45+
3746
/**
3847
* @return the label
3948
*/

src/main/java/org/tdl/vireo/model/export/enums/MarcXML21Key.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ public enum MarcXML21Key {
1010
MAJOR,
1111
DEPOSIT_URL,
1212
ABSTRACT,
13+
SUBJECT_FIELD_VALUES,
1314
KEYWORD_FIELD_VALUES,
1415
DEPARTMENT,
1516
COMMITTEE_CHAIR_FIELD_VALUES,

src/main/java/org/tdl/vireo/model/formatter/MarcXML21Formatter.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,9 @@ public void populateContext(Context context, Submission submission) {
6666
case KEYWORD_FIELD_VALUES:
6767
context.setVariable(key.name(), submissionHelperUtility.getKeywordFieldValues());
6868
break;
69+
case SUBJECT_FIELD_VALUES:
70+
context.setVariable(key.name(), submissionHelperUtility.getSubjectFieldValues());
71+
break;
6972
case DEPARTMENT:
7073
context.setVariable(key.name(), submissionHelperUtility.getDepartment());
7174
break;

src/main/java/org/tdl/vireo/model/inheritance/HeritableRepoImpl.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ public void removeFromWorkflowStep(Organization requestingOrganization, Workflow
3838
// if requesting organization originates the workflow step or the workflow step is overrideable,
3939
if (pendingWorkflowStep.getOriginatingOrganization().getId().equals(requestingOrganization.getId()) || pendingWorkflowStep.getOverrideable()) {
4040
// ... and if also that workflow step originates the heritableModel or the heritableModel is overrideable,
41-
if (heritableModelToRemove.getOriginatingWorkflowStep().getId().equals(heritableModelToRemove.getId()) || heritableModelToRemove.getOverrideable()) {
41+
if(heritableModelToRemove.getOriginatingWorkflowStep() != null && heritableModelToRemove.getOriginatingWorkflowStep().getId().equals(pendingWorkflowStep.getId())){
4242
// ...then the update is permissible.
4343

4444
// if requesting organization is not the workflow step's orignating organization,

0 commit comments

Comments
 (0)