Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -840,6 +840,9 @@ class WorkflowResource extends LazyLogging {
.where(WORKFLOW.WID.eq(wid))
.and(WORKFLOW.IS_PUBLIC.isTrue)
.fetchOne()
if (workflow == null) {
throw new NotFoundException(s"Public workflow with id $wid not found")
Comment thread
carloea2 marked this conversation as resolved.
Comment thread
carloea2 marked this conversation as resolved.
}
WorkflowWithPrivilege(
workflow.getName,
workflow.getDescription,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1027,6 +1027,12 @@ class WorkflowResourceSpec
assertThrows[ForbiddenException](workflowResource.makePublic(wid, sessionUser2))
}

"WorkflowResource.retrievePublicWorkflow" should "hide private and missing workflows" in {
val wid = seedWorkflow(sessionUser1, "private-wf").workflow.getWid
assertThrows[NotFoundException](workflowResource.retrievePublicWorkflow(wid))
assertThrows[NotFoundException](workflowResource.retrievePublicWorkflow(wid + 100000))
}

"WorkflowResource.searchWorkflowByOperator" should "return only workflows whose content contains the operator" in {
val wid = seedWorkflow(
sessionUser1,
Expand Down
Loading