Skip to content

Commit

Permalink
feat: added support for binary HTTP template bodies. Fixes #6888 (#8087)
Browse files Browse the repository at this point in the history
Signed-off-by: Rohan Kumar <[email protected]>
  • Loading branch information
rohankmr414 authored Jun 28, 2022
1 parent 443155d commit 1ccc120
Show file tree
Hide file tree
Showing 28 changed files with 1,546 additions and 720 deletions.
16 changes: 15 additions & 1 deletion api/jsonschema/schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -5802,6 +5802,10 @@
"description": "Body is content of the HTTP Request",
"type": "string"
},
"bodyFrom": {
"$ref": "#/definitions/io.argoproj.workflow.v1alpha1.HTTPBodySource",
"description": "BodyFrom is content of the HTTP Request as Bytes"
},
"headers": {
"description": "Headers are an optional list of headers to send with HTTP requests",
"items": {
Expand All @@ -5810,7 +5814,7 @@
"type": "array"
},
"insecureSkipVerify": {
"description": "insecureSkipVerify is a bool when if set to true will skip TLS verification for the HTTP client",
"description": "InsecureSkipVerify is a bool when if set to true will skip TLS verification for the HTTP client",
"type": "boolean"
},
"method": {
Expand Down Expand Up @@ -5873,6 +5877,16 @@
},
"type": "object"
},
"io.argoproj.workflow.v1alpha1.HTTPBodySource": {
"description": "HTTPBodySource contains the source of the HTTP body.",
"properties": {
"bytes": {
"format": "byte",
"type": "string"
}
},
"type": "object"
},
"io.argoproj.workflow.v1alpha1.HTTPHeader": {
"properties": {
"name": {
Expand Down
16 changes: 15 additions & 1 deletion api/openapi-spec/swagger.json
Original file line number Diff line number Diff line change
Expand Up @@ -10247,6 +10247,10 @@
"description": "Body is content of the HTTP Request",
"type": "string"
},
"bodyFrom": {
"description": "BodyFrom is content of the HTTP Request as Bytes",
"$ref": "#/definitions/io.argoproj.workflow.v1alpha1.HTTPBodySource"
},
"headers": {
"description": "Headers are an optional list of headers to send with HTTP requests",
"type": "array",
Expand All @@ -10255,7 +10259,7 @@
}
},
"insecureSkipVerify": {
"description": "insecureSkipVerify is a bool when if set to true will skip TLS verification for the HTTP client",
"description": "InsecureSkipVerify is a bool when if set to true will skip TLS verification for the HTTP client",
"type": "boolean"
},
"method": {
Expand Down Expand Up @@ -10314,6 +10318,16 @@
}
}
},
"io.argoproj.workflow.v1alpha1.HTTPBodySource": {
"description": "HTTPBodySource contains the source of the HTTP body.",
"type": "object",
"properties": {
"bytes": {
"type": "string",
"format": "byte"
}
}
},
"io.argoproj.workflow.v1alpha1.HTTPHeader": {
"type": "object",
"required": [
Expand Down
18 changes: 17 additions & 1 deletion docs/executor_swagger.md
Original file line number Diff line number Diff line change
Expand Up @@ -1764,8 +1764,9 @@ It must be set if keytab is used. | |
| Name | Type | Go type | Required | Default | Description | Example |
|------|------|---------|:--------:| ------- |-------------|---------|
| body | string| `string` | | | Body is content of the HTTP Request | |
| bodyFrom | [HTTPBodySource](#http-body-source)| `HTTPBodySource` | | | | |
| headers | [HTTPHeaders](#http-headers)| `HTTPHeaders` | | | | |
| insecureSkipVerify | boolean| `bool` | | | insecureSkipVerify is a bool when if set to true will skip TLS verification for the HTTP client | |
| insecureSkipVerify | boolean| `bool` | | | InsecureSkipVerify is a bool when if set to true will skip TLS verification for the HTTP client | |
| method | string| `string` | | | Method is HTTP methods for HTTP Request | |
| successCondition | string| `string` | | | SuccessCondition is an expression if evaluated to true is considered successful | |
| timeoutSeconds | int64 (formatted integer)| `int64` | | | TimeoutSeconds is request timeout for HTTP Request. Default is 30 seconds | |
Expand Down Expand Up @@ -1810,6 +1811,21 @@ It must be set if keytab is used. | |



### <span id="http-body-source"></span> HTTPBodySource






**Properties**

| Name | Type | Go type | Required | Default | Description | Example |
|------|------|---------|:--------:| ------- |-------------|---------|
| bytes | []uint8 (formatted integer)| `[]uint8` | | | | |



### <span id="http-get-action"></span> HTTPGetAction


Expand Down
12 changes: 11 additions & 1 deletion docs/fields.md
Original file line number Diff line number Diff line change
Expand Up @@ -2508,8 +2508,9 @@ _No description available_
| Field Name | Field Type | Description |
|:----------:|:----------:|---------------|
|`body`|`string`|Body is content of the HTTP Request|
|`bodyFrom`|[`HTTPBodySource`](#httpbodysource)|BodyFrom is content of the HTTP Request as Bytes|
|`headers`|`Array<`[`HTTPHeader`](#httpheader)`>`|Headers are an optional list of headers to send with HTTP requests|
|`insecureSkipVerify`|`boolean`|insecureSkipVerify is a bool when if set to true will skip TLS verification for the HTTP client|
|`insecureSkipVerify`|`boolean`|InsecureSkipVerify is a bool when if set to true will skip TLS verification for the HTTP client|
|`method`|`string`|Method is HTTP methods for HTTP Request|
|`successCondition`|`string`|SuccessCondition is an expression if evaluated to true is considered successful|
|`timeoutSeconds`|`integer`|TimeoutSeconds is request timeout for HTTP Request. Default is 30 seconds|
Expand Down Expand Up @@ -3869,6 +3870,15 @@ _No description available_
|:----------:|:----------:|---------------|
|`expression`|`string`|Expression defines an expr expression to apply|

## HTTPBodySource

HTTPBodySource contains the source of the HTTP body.

### Fields
| Field Name | Field Type | Description |
|:----------:|:----------:|---------------|
|`bytes`|`byte`|_No description available_|

## HTTPHeader

_No description available_
Expand Down
12 changes: 12 additions & 0 deletions manifests/base/crds/full/argoproj.io_clusterworkflowtemplates.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5336,6 +5336,12 @@ spec:
properties:
body:
type: string
bodyFrom:
properties:
bytes:
format: byte
type: string
type: object
headers:
items:
properties:
Expand Down Expand Up @@ -13153,6 +13159,12 @@ spec:
properties:
body:
type: string
bodyFrom:
properties:
bytes:
format: byte
type: string
type: object
headers:
items:
properties:
Expand Down
12 changes: 12 additions & 0 deletions manifests/base/crds/full/argoproj.io_cronworkflows.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5357,6 +5357,12 @@ spec:
properties:
body:
type: string
bodyFrom:
properties:
bytes:
format: byte
type: string
type: object
headers:
items:
properties:
Expand Down Expand Up @@ -13174,6 +13180,12 @@ spec:
properties:
body:
type: string
bodyFrom:
properties:
bytes:
format: byte
type: string
type: object
headers:
items:
properties:
Expand Down
30 changes: 30 additions & 0 deletions manifests/base/crds/full/argoproj.io_workflows.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5350,6 +5350,12 @@ spec:
properties:
body:
type: string
bodyFrom:
properties:
bytes:
format: byte
type: string
type: object
headers:
items:
properties:
Expand Down Expand Up @@ -13167,6 +13173,12 @@ spec:
properties:
body:
type: string
bodyFrom:
properties:
bytes:
format: byte
type: string
type: object
headers:
items:
properties:
Expand Down Expand Up @@ -24413,6 +24425,12 @@ spec:
properties:
body:
type: string
bodyFrom:
properties:
bytes:
format: byte
type: string
type: object
headers:
items:
properties:
Expand Down Expand Up @@ -33965,6 +33983,12 @@ spec:
properties:
body:
type: string
bodyFrom:
properties:
bytes:
format: byte
type: string
type: object
headers:
items:
properties:
Expand Down Expand Up @@ -41782,6 +41806,12 @@ spec:
properties:
body:
type: string
bodyFrom:
properties:
bytes:
format: byte
type: string
type: object
headers:
items:
properties:
Expand Down
6 changes: 6 additions & 0 deletions manifests/base/crds/full/argoproj.io_workflowtasksets.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3603,6 +3603,12 @@ spec:
properties:
body:
type: string
bodyFrom:
properties:
bytes:
format: byte
type: string
type: object
headers:
items:
properties:
Expand Down
12 changes: 12 additions & 0 deletions manifests/base/crds/full/argoproj.io_workflowtemplates.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5335,6 +5335,12 @@ spec:
properties:
body:
type: string
bodyFrom:
properties:
bytes:
format: byte
type: string
type: object
headers:
items:
properties:
Expand Down Expand Up @@ -13152,6 +13158,12 @@ spec:
properties:
body:
type: string
bodyFrom:
properties:
bytes:
format: byte
type: string
type: object
headers:
items:
properties:
Expand Down
1 change: 1 addition & 0 deletions pkg/apis/api-rules/violation_exceptions.list
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ API rule violation: list_type_missing,github.com/argoproj/argo-workflows/v3/pkg/
API rule violation: list_type_missing,github.com/argoproj/argo-workflows/v3/pkg/apis/workflow/v1alpha1,GitArtifact,Fetch
API rule violation: list_type_missing,github.com/argoproj/argo-workflows/v3/pkg/apis/workflow/v1alpha1,HDFSConfig,Addresses
API rule violation: list_type_missing,github.com/argoproj/argo-workflows/v3/pkg/apis/workflow/v1alpha1,HTTPArtifact,Headers
API rule violation: list_type_missing,github.com/argoproj/argo-workflows/v3/pkg/apis/workflow/v1alpha1,HTTPBodySource,Bytes
API rule violation: list_type_missing,github.com/argoproj/argo-workflows/v3/pkg/apis/workflow/v1alpha1,Histogram,Buckets
API rule violation: list_type_missing,github.com/argoproj/argo-workflows/v3/pkg/apis/workflow/v1alpha1,Inputs,Parameters
API rule violation: list_type_missing,github.com/argoproj/argo-workflows/v3/pkg/apis/workflow/v1alpha1,LabelKeys,Items
Expand Down
Loading

0 comments on commit 1ccc120

Please sign in to comment.