Skip to content

Commit

Permalink
ONECOND-2338-Remove Decoded Auth Token from Response
Browse files Browse the repository at this point in the history
  • Loading branch information
sangeetanadgir committed Oct 14, 2024
1 parent 795ce9e commit 5952cac
Show file tree
Hide file tree
Showing 8 changed files with 540 additions and 22 deletions.

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,7 @@
import com.netflix.conductor.common.metadata.tasks.Task;
import com.netflix.conductor.common.metadata.tasks.TaskDef;
import com.netflix.conductor.common.metadata.tasks.TaskExecLog;
import com.netflix.conductor.common.run.TaskDetails;
import com.netflix.conductor.common.run.Workflow;
import com.netflix.conductor.common.run.WorkflowError;
import com.netflix.conductor.common.run.WorkflowErrorRegistry;
import com.netflix.conductor.common.run.*;
import com.netflix.conductor.core.events.queue.Message;

import java.util.Collections;
Expand Down Expand Up @@ -215,6 +212,8 @@ default List<Task> getPendingSystemTasks(String taskType) {
*/
Workflow getWorkflow(String workflowId, boolean includeTasks);

WorkflowDetails getWorkflowDetails(String workflowId, boolean includeTasks);

/**
*
* @param workflowName Name of the workflow
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
import com.netflix.conductor.common.metadata.workflow.WorkflowDef;
import com.netflix.conductor.common.run.SearchResult;
import com.netflix.conductor.common.run.Workflow;
import com.netflix.conductor.common.run.WorkflowDetails;
import com.netflix.conductor.common.run.WorkflowSummary;
import com.netflix.conductor.core.config.Configuration;
import com.netflix.conductor.core.events.queue.Message;
Expand Down Expand Up @@ -339,6 +340,10 @@ public Workflow getExecutionStatus(String workflowId, boolean includeTasks) {
return edao.getWorkflow(workflowId, includeTasks);
}

public WorkflowDetails getExecutionStatusDetails(String workflowId, boolean includeTasks) {
return edao.getWorkflowDetails(workflowId, includeTasks);
}

public List<String> getRunningWorkflows(String workflowName) {
return edao.getRunningWorkflowIds(workflowName);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,7 @@
import com.netflix.conductor.common.metadata.tasks.Task;
import com.netflix.conductor.common.metadata.tasks.TaskDef;
import com.netflix.conductor.common.metadata.tasks.TaskExecLog;
import com.netflix.conductor.common.run.TaskDetails;
import com.netflix.conductor.common.run.Workflow;
import com.netflix.conductor.common.run.WorkflowError;
import com.netflix.conductor.common.run.WorkflowErrorRegistry;
import com.netflix.conductor.common.run.*;
import com.netflix.conductor.core.config.Configuration;
import com.netflix.conductor.core.events.queue.Message;
import com.netflix.conductor.core.execution.ApplicationException;
Expand Down Expand Up @@ -385,6 +382,11 @@ public Workflow getWorkflow(String workflowId) {
return getWorkflow(workflowId, true);
}

@Override
public WorkflowDetails getWorkflowDetails(String workflowId, boolean includeTasks) {
return null;
}

@Override
public Workflow getWorkflow(String workflowId, boolean includeTasks) {
if (logger.isDebugEnabled())
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,10 @@
import com.netflix.conductor.common.metadata.tasks.Task;
import com.netflix.conductor.common.metadata.tasks.TaskDef;
import com.netflix.conductor.common.metadata.tasks.TaskExecLog;
import com.netflix.conductor.common.run.TaskDetails;
import com.netflix.conductor.common.run.Workflow;
import com.netflix.conductor.common.run.WorkflowError;
import com.netflix.conductor.common.run.*;
import com.netflix.conductor.core.config.Configuration;
import com.netflix.conductor.core.events.queue.Message;
import com.netflix.conductor.core.execution.ApplicationException;
import com.netflix.conductor.common.run.WorkflowErrorRegistry;
import com.netflix.conductor.dao.ExecutionDAO;
import com.netflix.conductor.dao.IndexDAO;
import com.netflix.conductor.dao.MetadataDAO;
Expand Down Expand Up @@ -497,6 +494,11 @@ public Workflow getWorkflow(String workflowId, boolean includeTasks) {
return workflow;
}

@Override
public WorkflowDetails getWorkflowDetails(String workflowId, boolean includeTasks) {
return null;
}

@Override
public List<String> getRunningWorkflowIds(String workflowName) {
if (logger.isDebugEnabled())
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -336,10 +336,10 @@ public List<Workflow> getWorkflows(@PathParam("name") String name, @PathParam("c
@ApiImplicitParams({@ApiImplicitParam(name = "Deluxe-Owf-Context", dataType = "string", paramType = "header"),
@ApiImplicitParam(name = "Platform-Trace-Id", dataType = "string", paramType = "header")})
@Consumes(MediaType.WILDCARD)
public Workflow getExecutionStatus(
public WorkflowDetails getExecutionStatus(
@PathParam("workflowId") String workflowId,
@QueryParam("includeTasks") @DefaultValue("true") boolean includeTasks) throws Exception {
return service.getExecutionStatus(workflowId, includeTasks);
return service.getExecutionStatusDetails(workflowId, includeTasks);
}

@DELETE
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,7 @@
import com.netflix.conductor.common.metadata.tasks.Task;
import com.netflix.conductor.common.metadata.tasks.TaskDef;
import com.netflix.conductor.common.metadata.tasks.TaskExecLog;
import com.netflix.conductor.common.run.TaskDetails;
import com.netflix.conductor.common.run.Workflow;
import com.netflix.conductor.common.run.WorkflowError;
import com.netflix.conductor.common.run.WorkflowErrorRegistry;
import com.netflix.conductor.common.run.*;
import com.netflix.conductor.core.events.queue.Message;
import com.netflix.conductor.core.execution.ApplicationException;
import com.netflix.conductor.dao.ExecutionDAO;
Expand Down Expand Up @@ -323,6 +320,17 @@ public Workflow getWorkflow(String workflowId, boolean includeTasks) {
return workflow;
}

@Override
public WorkflowDetails getWorkflowDetails(String workflowId, boolean includeTasks) {
WorkflowDetails workflow = getWithTransaction(tx -> readWorkflowDetails(tx, workflowId));
if (workflow != null && includeTasks) {
List<Task> tasks = getTasksForWorkflow(workflowId);
tasks.sort(Comparator.comparingLong(Task::getScheduledTime).thenComparingInt(Task::getSeq));
workflow.setTasks(tasks);
}
return workflow;
}

@Override
public List<String> getRunningWorkflowIds(String workflowName) {
Preconditions.checkNotNull(workflowName, "workflowName cannot be null");
Expand Down Expand Up @@ -781,6 +789,13 @@ private Workflow readWorkflow(Connection tx, String workflowId) {
return query(tx, SQL, q -> q.addParameter(workflowId).executeAndFetchFirst(Workflow.class));
}


private WorkflowDetails readWorkflowDetails(Connection tx, String workflowId) {
String SQL = "SELECT json_data FROM workflow WHERE workflow_id = ?";

return query(tx, SQL, q -> q.addParameter(workflowId).executeAndFetchFirst(WorkflowDetails.class));
}

private void removeWorkflow(Connection tx, String workflowId) {
String SQL = "DELETE FROM workflow WHERE workflow_id = ?";

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,7 @@
import com.netflix.conductor.common.metadata.tasks.Task.Status;
import com.netflix.conductor.common.metadata.tasks.TaskDef;
import com.netflix.conductor.common.metadata.tasks.TaskExecLog;
import com.netflix.conductor.common.run.WorkflowError;
import com.netflix.conductor.common.run.WorkflowErrorRegistry;
import com.netflix.conductor.common.run.Workflow;
import com.netflix.conductor.common.run.TaskDetails;
import com.netflix.conductor.common.run.*;
import com.netflix.conductor.core.config.Configuration;
import com.netflix.conductor.core.events.queue.Message;
import com.netflix.conductor.core.execution.ApplicationException;
Expand Down Expand Up @@ -370,6 +367,11 @@ public Workflow getWorkflow(String workflowId, boolean includeTasks) {
return workflow;
}

@Override
public WorkflowDetails getWorkflowDetails(String workflowId, boolean includeTasks) {
return null;
}

@Override
public List<String> getRunningWorkflowIds(String workflowName) {
Preconditions.checkNotNull(workflowName, "workflowName cannot be null");
Expand Down

0 comments on commit 5952cac

Please sign in to comment.