Skip to content
Merged
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
9 changes: 9 additions & 0 deletions .generator/schemas/v2/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -128711,6 +128711,9 @@ components:
runAsUserMode:
$ref: "#/components/schemas/WorkflowRunAsUserMode"
readOnly: true
sensitivePrivileges:
description: Whether the workflow requires sensitive privileges to run. Only the workflow owner can update this field. This allows it to run actions that use [Execution Policies](https://docs.datadoghq.com/actions/private_actions/execution_policies/).
type: boolean
spec:
$ref: "#/components/schemas/Spec"
tags:
Expand Down Expand Up @@ -128791,6 +128794,9 @@ components:
runAsUserMode:
$ref: "#/components/schemas/WorkflowRunAsUserMode"
readOnly: true
sensitivePrivileges:
description: Whether the workflow requires sensitive privileges to run. Only the workflow owner can update this field. This allows it to run actions that use [Execution Policies](https://docs.datadoghq.com/actions/private_actions/execution_policies/).
type: boolean
spec:
$ref: "#/components/schemas/Spec"
tags:
Expand Down Expand Up @@ -128912,6 +128918,9 @@ components:
runAsUserMode:
$ref: "#/components/schemas/WorkflowRunAsUserMode"
readOnly: true
sensitivePrivileges:
description: Whether the workflow requires sensitive privileges to run. Only the workflow owner can update this field. This allows it to run actions that use [Execution Policies](https://docs.datadoghq.com/actions/private_actions/execution_policies/).
type: boolean
spec:
$ref: "#/components/schemas/Spec"
nullable: true
Expand Down
1 change: 1 addition & 0 deletions examples/v2/workflow-automation/CreateWorkflow.java
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ public static void main(String[] args) {
.runAs(
new WorkflowRunAs(
new WorkflowRunAsOwner().type(WorkflowRunAsOwnerType.OWNER)))
.sensitivePrivileges(true)
.spec(
new Spec()
.connectionEnvs(
Expand Down
1 change: 1 addition & 0 deletions examples/v2/workflow-automation/UpdateWorkflow.java
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ public static void main(String[] args) {
.runAs(
new WorkflowRunAs(
new WorkflowRunAsOwner().type(WorkflowRunAsOwnerType.OWNER)))
.sensitivePrivileges(false)
.spec(
new Spec()
.connectionEnvs(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
WorkflowDataAttributes.JSON_PROPERTY_PUBLISHED,
WorkflowDataAttributes.JSON_PROPERTY_RUN_AS,
WorkflowDataAttributes.JSON_PROPERTY_RUN_AS_USER_MODE,
WorkflowDataAttributes.JSON_PROPERTY_SENSITIVE_PRIVILEGES,
WorkflowDataAttributes.JSON_PROPERTY_SPEC,
WorkflowDataAttributes.JSON_PROPERTY_TAGS,
WorkflowDataAttributes.JSON_PROPERTY_UPDATED_AT,
Expand Down Expand Up @@ -55,6 +56,9 @@ public class WorkflowDataAttributes {
public static final String JSON_PROPERTY_RUN_AS_USER_MODE = "runAsUserMode";
private WorkflowRunAsUserMode runAsUserMode;

public static final String JSON_PROPERTY_SENSITIVE_PRIVILEGES = "sensitivePrivileges";
private Boolean sensitivePrivileges;

public static final String JSON_PROPERTY_SPEC = "spec";
private Spec spec;

Expand Down Expand Up @@ -204,6 +208,30 @@ public void setRunAsUserMode(WorkflowRunAsUserMode runAsUserMode) {
this.runAsUserMode = runAsUserMode;
}

public WorkflowDataAttributes sensitivePrivileges(Boolean sensitivePrivileges) {
this.sensitivePrivileges = sensitivePrivileges;
return this;
}

/**
* Whether the workflow requires sensitive privileges to run. Only the workflow owner can update
* this field. This allows it to run actions that use <a
* href="https://docs.datadoghq.com/actions/private_actions/execution_policies/">Execution
* Policies</a>.
*
* @return sensitivePrivileges
*/
@jakarta.annotation.Nullable
@JsonProperty(JSON_PROPERTY_SENSITIVE_PRIVILEGES)
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
public Boolean getSensitivePrivileges() {
return sensitivePrivileges;
}

public void setSensitivePrivileges(Boolean sensitivePrivileges) {
this.sensitivePrivileges = sensitivePrivileges;
}

public WorkflowDataAttributes spec(Spec spec) {
this.spec = spec;
this.unparsed |= spec.unparsed;
Expand Down Expand Up @@ -353,6 +381,7 @@ public boolean equals(Object o) {
&& Objects.equals(this.published, workflowDataAttributes.published)
&& Objects.equals(this.runAs, workflowDataAttributes.runAs)
&& Objects.equals(this.runAsUserMode, workflowDataAttributes.runAsUserMode)
&& Objects.equals(this.sensitivePrivileges, workflowDataAttributes.sensitivePrivileges)
&& Objects.equals(this.spec, workflowDataAttributes.spec)
&& Objects.equals(this.tags, workflowDataAttributes.tags)
&& Objects.equals(this.updatedAt, workflowDataAttributes.updatedAt)
Expand All @@ -369,6 +398,7 @@ public int hashCode() {
published,
runAs,
runAsUserMode,
sensitivePrivileges,
spec,
tags,
updatedAt,
Expand All @@ -386,6 +416,9 @@ public String toString() {
sb.append(" published: ").append(toIndentedString(published)).append("\n");
sb.append(" runAs: ").append(toIndentedString(runAs)).append("\n");
sb.append(" runAsUserMode: ").append(toIndentedString(runAsUserMode)).append("\n");
sb.append(" sensitivePrivileges: ")
.append(toIndentedString(sensitivePrivileges))
.append("\n");
sb.append(" spec: ").append(toIndentedString(spec)).append("\n");
sb.append(" tags: ").append(toIndentedString(tags)).append("\n");
sb.append(" updatedAt: ").append(toIndentedString(updatedAt)).append("\n");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
WorkflowDataUpdateAttributes.JSON_PROPERTY_PUBLISHED,
WorkflowDataUpdateAttributes.JSON_PROPERTY_RUN_AS,
WorkflowDataUpdateAttributes.JSON_PROPERTY_RUN_AS_USER_MODE,
WorkflowDataUpdateAttributes.JSON_PROPERTY_SENSITIVE_PRIVILEGES,
WorkflowDataUpdateAttributes.JSON_PROPERTY_SPEC,
WorkflowDataUpdateAttributes.JSON_PROPERTY_TAGS,
WorkflowDataUpdateAttributes.JSON_PROPERTY_UPDATED_AT,
Expand Down Expand Up @@ -54,6 +55,9 @@ public class WorkflowDataUpdateAttributes {
public static final String JSON_PROPERTY_RUN_AS_USER_MODE = "runAsUserMode";
private WorkflowRunAsUserMode runAsUserMode;

public static final String JSON_PROPERTY_SENSITIVE_PRIVILEGES = "sensitivePrivileges";
private Boolean sensitivePrivileges;

public static final String JSON_PROPERTY_SPEC = "spec";
private Spec spec;

Expand Down Expand Up @@ -193,6 +197,30 @@ public void setRunAsUserMode(WorkflowRunAsUserMode runAsUserMode) {
this.runAsUserMode = runAsUserMode;
}

public WorkflowDataUpdateAttributes sensitivePrivileges(Boolean sensitivePrivileges) {
this.sensitivePrivileges = sensitivePrivileges;
return this;
}

/**
* Whether the workflow requires sensitive privileges to run. Only the workflow owner can update
* this field. This allows it to run actions that use <a
* href="https://docs.datadoghq.com/actions/private_actions/execution_policies/">Execution
* Policies</a>.
*
* @return sensitivePrivileges
*/
@jakarta.annotation.Nullable
@JsonProperty(JSON_PROPERTY_SENSITIVE_PRIVILEGES)
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
public Boolean getSensitivePrivileges() {
return sensitivePrivileges;
}

public void setSensitivePrivileges(Boolean sensitivePrivileges) {
this.sensitivePrivileges = sensitivePrivileges;
}

public WorkflowDataUpdateAttributes spec(Spec spec) {
this.spec = spec;
this.unparsed |= spec.unparsed;
Expand Down Expand Up @@ -343,6 +371,8 @@ public boolean equals(Object o) {
&& Objects.equals(this.published, workflowDataUpdateAttributes.published)
&& Objects.equals(this.runAs, workflowDataUpdateAttributes.runAs)
&& Objects.equals(this.runAsUserMode, workflowDataUpdateAttributes.runAsUserMode)
&& Objects.equals(
this.sensitivePrivileges, workflowDataUpdateAttributes.sensitivePrivileges)
&& Objects.equals(this.spec, workflowDataUpdateAttributes.spec)
&& Objects.equals(this.tags, workflowDataUpdateAttributes.tags)
&& Objects.equals(this.updatedAt, workflowDataUpdateAttributes.updatedAt)
Expand All @@ -360,6 +390,7 @@ public int hashCode() {
published,
runAs,
runAsUserMode,
sensitivePrivileges,
spec,
tags,
updatedAt,
Expand All @@ -377,6 +408,9 @@ public String toString() {
sb.append(" published: ").append(toIndentedString(published)).append("\n");
sb.append(" runAs: ").append(toIndentedString(runAs)).append("\n");
sb.append(" runAsUserMode: ").append(toIndentedString(runAsUserMode)).append("\n");
sb.append(" sensitivePrivileges: ")
.append(toIndentedString(sensitivePrivileges))
.append("\n");
sb.append(" spec: ").append(toIndentedString(spec)).append("\n");
sb.append(" tags: ").append(toIndentedString(tags)).append("\n");
sb.append(" updatedAt: ").append(toIndentedString(updatedAt)).append("\n");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
WorkflowListItemAttributes.JSON_PROPERTY_NAME,
WorkflowListItemAttributes.JSON_PROPERTY_PUBLISHED,
WorkflowListItemAttributes.JSON_PROPERTY_RUN_AS_USER_MODE,
WorkflowListItemAttributes.JSON_PROPERTY_SENSITIVE_PRIVILEGES,
WorkflowListItemAttributes.JSON_PROPERTY_SPEC,
WorkflowListItemAttributes.JSON_PROPERTY_TAGS,
WorkflowListItemAttributes.JSON_PROPERTY_UPDATED_AT
Expand All @@ -50,6 +51,9 @@ public class WorkflowListItemAttributes {
public static final String JSON_PROPERTY_RUN_AS_USER_MODE = "runAsUserMode";
private WorkflowRunAsUserMode runAsUserMode;

public static final String JSON_PROPERTY_SENSITIVE_PRIVILEGES = "sensitivePrivileges";
private Boolean sensitivePrivileges;

public static final String JSON_PROPERTY_SPEC = "spec";
private Spec spec;

Expand Down Expand Up @@ -167,6 +171,30 @@ public void setRunAsUserMode(WorkflowRunAsUserMode runAsUserMode) {
this.runAsUserMode = runAsUserMode;
}

public WorkflowListItemAttributes sensitivePrivileges(Boolean sensitivePrivileges) {
this.sensitivePrivileges = sensitivePrivileges;
return this;
}

/**
* Whether the workflow requires sensitive privileges to run. Only the workflow owner can update
* this field. This allows it to run actions that use <a
* href="https://docs.datadoghq.com/actions/private_actions/execution_policies/">Execution
* Policies</a>.
*
* @return sensitivePrivileges
*/
@jakarta.annotation.Nullable
@JsonProperty(JSON_PROPERTY_SENSITIVE_PRIVILEGES)
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
public Boolean getSensitivePrivileges() {
return sensitivePrivileges;
}

public void setSensitivePrivileges(Boolean sensitivePrivileges) {
this.sensitivePrivileges = sensitivePrivileges;
}

public WorkflowListItemAttributes spec(Spec spec) {
this.spec = spec;
this.unparsed |= spec.unparsed;
Expand Down Expand Up @@ -294,6 +322,7 @@ public boolean equals(Object o) {
&& Objects.equals(this.name, workflowListItemAttributes.name)
&& Objects.equals(this.published, workflowListItemAttributes.published)
&& Objects.equals(this.runAsUserMode, workflowListItemAttributes.runAsUserMode)
&& Objects.equals(this.sensitivePrivileges, workflowListItemAttributes.sensitivePrivileges)
&& Objects.equals(this.spec, workflowListItemAttributes.spec)
&& Objects.equals(this.tags, workflowListItemAttributes.tags)
&& Objects.equals(this.updatedAt, workflowListItemAttributes.updatedAt)
Expand All @@ -309,6 +338,7 @@ public int hashCode() {
name,
published,
runAsUserMode,
sensitivePrivileges,
spec,
tags,
updatedAt,
Expand All @@ -324,6 +354,9 @@ public String toString() {
sb.append(" name: ").append(toIndentedString(name)).append("\n");
sb.append(" published: ").append(toIndentedString(published)).append("\n");
sb.append(" runAsUserMode: ").append(toIndentedString(runAsUserMode)).append("\n");
sb.append(" sensitivePrivileges: ")
.append(toIndentedString(sensitivePrivileges))
.append("\n");
sb.append(" spec: ").append(toIndentedString(spec)).append("\n");
sb.append(" tags: ").append(toIndentedString(tags)).append("\n");
sb.append(" updatedAt: ").append(toIndentedString(updatedAt)).append("\n");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,10 +47,11 @@ Feature: Workflow Automation
@team:DataDog/workflow-automation-dev
Scenario: Create a Workflow returns "Successfully created a workflow." response
Given new "CreateWorkflow" request
And body with value {"data": {"attributes": {"description": "A sample workflow.", "name": "Example Workflow", "published": true, "runAs": {"type": "owner"}, "spec": {"connectionEnvs": [{"connections": [{"connectionId": "e1e64943-c7c5-4487-aece-25aaec7d3aad", "label": "INTEGRATION_DATADOG"}], "env": "default"}], "inputSchema": {"parameters": [{"defaultValue": "default", "name": "input", "type": "STRING"}]}, "outputSchema": {"parameters": [{"name": "output", "type": "ARRAY_OBJECT", "value": "outputValue"}]}, "steps": [{"actionId": "com.datadoghq.dd.monitor.listMonitors", "connectionLabel": "INTEGRATION_DATADOG", "name": "Step1", "outboundEdges": [{"branchName": "main", "nextStepName": "Step2"}], "parameters": [{"name": "tags", "value": "service:monitoring"}]}, {"actionId": "com.datadoghq.core.noop", "name": "Step2"}], "triggers": [{"monitorTrigger": {"rateLimit": {"count": 1, "interval": "3600s"}}, "startStepNames": ["Step1"]}, {"startStepNames": ["Step1"], "githubWebhookTrigger": {}}]}, "tags": ["team:infra", "service:monitoring", "foo:bar"]}, "type": "workflows"}}
And body with value {"data": {"attributes": {"description": "A sample workflow.", "name": "Example Workflow", "published": true, "runAs": {"type": "owner"}, "sensitivePrivileges": true, "spec": {"connectionEnvs": [{"connections": [{"connectionId": "e1e64943-c7c5-4487-aece-25aaec7d3aad", "label": "INTEGRATION_DATADOG"}], "env": "default"}], "inputSchema": {"parameters": [{"defaultValue": "default", "name": "input", "type": "STRING"}]}, "outputSchema": {"parameters": [{"name": "output", "type": "ARRAY_OBJECT", "value": "outputValue"}]}, "steps": [{"actionId": "com.datadoghq.dd.monitor.listMonitors", "connectionLabel": "INTEGRATION_DATADOG", "name": "Step1", "outboundEdges": [{"branchName": "main", "nextStepName": "Step2"}], "parameters": [{"name": "tags", "value": "service:monitoring"}]}, {"actionId": "com.datadoghq.core.noop", "name": "Step2"}], "triggers": [{"monitorTrigger": {"rateLimit": {"count": 1, "interval": "3600s"}}, "startStepNames": ["Step1"]}, {"startStepNames": ["Step1"], "githubWebhookTrigger": {}}]}, "tags": ["team:infra", "service:monitoring", "foo:bar"]}, "type": "workflows"}}
When the request is sent
Then the response status is 201 Successfully created a workflow.
And the response "data.attributes.runAsUserMode" is equal to "owner"
And the response "data.attributes.sensitivePrivileges" is equal to true

@team:DataDog/workflow-automation-dev
Scenario: Delete an existing Workflow returns "Not found" response
Expand Down Expand Up @@ -189,7 +190,8 @@ Feature: Workflow Automation
Given there is a valid "workflow" in the system
And new "UpdateWorkflow" request
And request contains "workflow_id" parameter from "workflow.data.id"
And body with value {"data": {"attributes": {"description": "A sample workflow.", "name": "Example Workflow", "published": true, "runAs": {"type": "owner"}, "spec": {"connectionEnvs": [{"connections": [{"connectionId": "e1e64943-c7c5-4487-aece-25aaec7d3aad", "label": "INTEGRATION_DATADOG"}], "env": "default"}], "inputSchema": {"parameters": [{"defaultValue": "default", "name": "input", "type": "STRING"}]}, "outputSchema": {"parameters": [{"name": "output", "type": "ARRAY_OBJECT", "value": "outputValue"}]}, "steps": [{"actionId": "com.datadoghq.dd.monitor.listMonitors", "connectionLabel": "INTEGRATION_DATADOG", "name": "Step1", "outboundEdges": [{"branchName": "main", "nextStepName": "Step2"}], "parameters": [{"name": "tags", "value": "service:monitoring"}]}, {"actionId": "com.datadoghq.core.noop", "name": "Step2"}], "triggers": [{"monitorTrigger": {"rateLimit": {"count": 1, "interval": "3600s"}}, "startStepNames": ["Step1"]}, {"startStepNames": ["Step1"], "githubWebhookTrigger": {}}]}, "tags": ["team:infra", "service:monitoring", "foo:bar"]}, "id": "22222222-2222-2222-2222-222222222222", "type": "workflows"}}
And body with value {"data": {"attributes": {"description": "A sample workflow.", "name": "Example Workflow", "published": true, "runAs": {"type": "owner"}, "sensitivePrivileges": false, "spec": {"connectionEnvs": [{"connections": [{"connectionId": "e1e64943-c7c5-4487-aece-25aaec7d3aad", "label": "INTEGRATION_DATADOG"}], "env": "default"}], "inputSchema": {"parameters": [{"defaultValue": "default", "name": "input", "type": "STRING"}]}, "outputSchema": {"parameters": [{"name": "output", "type": "ARRAY_OBJECT", "value": "outputValue"}]}, "steps": [{"actionId": "com.datadoghq.dd.monitor.listMonitors", "connectionLabel": "INTEGRATION_DATADOG", "name": "Step1", "outboundEdges": [{"branchName": "main", "nextStepName": "Step2"}], "parameters": [{"name": "tags", "value": "service:monitoring"}]}, {"actionId": "com.datadoghq.core.noop", "name": "Step2"}], "triggers": [{"monitorTrigger": {"rateLimit": {"count": 1, "interval": "3600s"}}, "startStepNames": ["Step1"]}, {"startStepNames": ["Step1"], "githubWebhookTrigger": {}}]}, "tags": ["team:infra", "service:monitoring", "foo:bar"]}, "id": "22222222-2222-2222-2222-222222222222", "type": "workflows"}}
When the request is sent
Then the response status is 200 Successfully updated a workflow.
And the response "data.attributes.runAsUserMode" is equal to "owner"
And the response "data.attributes.sensitivePrivileges" is equal to false
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
"runAs": {
"type": "owner"
},
"sensitivePrivileges": true,
"spec": {
"connectionEnvs": [
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
"runAs": {
"type": "owner"
},
"sensitivePrivileges": false,
"spec": {
"connectionEnvs": [
{
Expand Down
Loading
Loading