diff --git a/web-admin-app/src/main/java/edu/unc/lib/boxc/web/admin/controllers/processing/ChompbPreIngestService.java b/web-admin-app/src/main/java/edu/unc/lib/boxc/web/admin/controllers/processing/ChompbPreIngestService.java index b67dd921dc..e3cb974816 100644 --- a/web-admin-app/src/main/java/edu/unc/lib/boxc/web/admin/controllers/processing/ChompbPreIngestService.java +++ b/web-admin-app/src/main/java/edu/unc/lib/boxc/web/admin/controllers/processing/ChompbPreIngestService.java @@ -21,6 +21,7 @@ public class ChompbPreIngestService { private GlobalPermissionEvaluator globalPermissionEvaluator; private Path baseProjectsPath; + private String serviceKeyPath; private static final Set VALID_FILENAMES = Set.of("data.json", "data.csv"); /** @@ -41,6 +42,7 @@ public String startCropping(AgentPrincipals agent, String projectName, String em return executeChompbCommand("chompb", "process_source_files", "--action", "velocicroptor", "-w", baseProjectsPath.resolve(projectName).toAbsolutePath().toString(), + "-k", serviceKeyPath, "--user", agent.getUsername(), "--email", email); } @@ -124,4 +126,8 @@ public void setGlobalPermissionEvaluator(GlobalPermissionEvaluator globalPermiss public void setBaseProjectsPath(Path baseProjectsPath) { this.baseProjectsPath = baseProjectsPath; } + + public void setServiceKeyPath(String serviceKeyPath) { + this.serviceKeyPath = serviceKeyPath; + } } diff --git a/web-admin-app/src/main/webapp/WEB-INF/service-context.xml b/web-admin-app/src/main/webapp/WEB-INF/service-context.xml index 6dfacf0247..b026a47be5 100644 --- a/web-admin-app/src/main/webapp/WEB-INF/service-context.xml +++ b/web-admin-app/src/main/webapp/WEB-INF/service-context.xml @@ -75,6 +75,7 @@ + diff --git a/web-admin-app/src/test/java/edu/unc/lib/boxc/web/admin/controllers/processing/ChompbPreIngestServiceTest.java b/web-admin-app/src/test/java/edu/unc/lib/boxc/web/admin/controllers/processing/ChompbPreIngestServiceTest.java index a1ff34ad30..639dfdc78e 100644 --- a/web-admin-app/src/test/java/edu/unc/lib/boxc/web/admin/controllers/processing/ChompbPreIngestServiceTest.java +++ b/web-admin-app/src/test/java/edu/unc/lib/boxc/web/admin/controllers/processing/ChompbPreIngestServiceTest.java @@ -54,6 +54,7 @@ public void setup() { closeable = openMocks(this); service = new ChompbPreIngestService(); service.setBaseProjectsPath(tmpFolder); + service.setServiceKeyPath("/path/to/key"); service.setGlobalPermissionEvaluator(globalPermissionEvaluator); when(agentPrincipals.getPrincipals()).thenReturn(new AccessGroupSetImpl("group")); when(globalPermissionEvaluator.hasGlobalPermission(any(AccessGroupSet.class), eq(Permission.ingest))).thenReturn(true);