Skip to content

Commit

Permalink
address review comments
Browse files Browse the repository at this point in the history
  • Loading branch information
tobias-lippert committed Feb 9, 2025
1 parent 53e1d6a commit dfd05f9
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -127,16 +127,16 @@ private boolean checkFiles(SAML2Properties.RelyingPartyProperties config) {
return true;
}

private static X509Certificate readPublicCert(String file) throws IOException, CertificateException {
try (InputStream inStream = Files.newInputStream(Path.of(file))) {
private static X509Certificate readPublicCert(String filepath) throws IOException, CertificateException {
try (InputStream inStream = Files.newInputStream(Path.of(filepath))) {
CertificateFactory cf = CertificateFactory.getInstance("X.509");
return (X509Certificate) cf.generateCertificate(inStream);
}
}

private RSAPrivateKey readPrivateKey(String file) throws IOException {
private RSAPrivateKey readPrivateKey(String filepath) throws IOException {
// Read PKCS#8 File!
try (var keyReader = Files.newBufferedReader(Path.of(file), StandardCharsets.UTF_8); var pemParser = new PEMParser(keyReader)) {
try (var keyReader = Files.newBufferedReader(Path.of(filepath), StandardCharsets.UTF_8); var pemParser = new PEMParser(keyReader)) {
JcaPEMKeyConverter converter = new JcaPEMKeyConverter();
PrivateKeyInfo privateKeyInfo = PrivateKeyInfo.getInstance(pemParser.readObject());
return (RSAPrivateKey) converter.getPrivateKey(privateKeyInfo);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -392,8 +392,8 @@ public ResponseEntity<Resource> exportSubmissions(@PathVariable long exerciseId,
authCheckService.checkHasAtLeastRoleInCourseElseThrow(Role.INSTRUCTOR, modelingExercise.getCourseViaExerciseGroupOrCourseMember(), null);
}

Path zipFile = modelingSubmissionExportService.exportStudentSubmissionsElseThrow(exerciseId, submissionExportOptions);
return ResponseUtil.ok(zipFile);
Path zipFilePath = modelingSubmissionExportService.exportStudentSubmissionsElseThrow(exerciseId, submissionExportOptions);
return ResponseUtil.ok(zipFilePath);
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -560,8 +560,8 @@ public ResponseEntity<Resource> exportSubmissions(@PathVariable long exerciseId,
authCheckService.checkHasAtLeastRoleInCourseElseThrow(Role.INSTRUCTOR, textExercise.getCourseViaExerciseGroupOrCourseMember(), null);
}

Path zipFile = textSubmissionExportService.exportStudentSubmissionsElseThrow(exerciseId, submissionExportOptions);
return ResponseUtil.ok(zipFile);
Path zipFilePath = textSubmissionExportService.exportStudentSubmissionsElseThrow(exerciseId, submissionExportOptions);
return ResponseUtil.ok(zipFilePath);
}

/**
Expand Down

0 comments on commit dfd05f9

Please sign in to comment.