Skip to content

Commit da50003

Browse files
HTTP Binding: add "maxResponseBodySize" metadata option (#3040)
Signed-off-by: ItalyPaleAle <43508+ItalyPaleAle@users.noreply.github.com> Signed-off-by: Bernd Verst <github@bernd.dev> Co-authored-by: Bernd Verst <github@bernd.dev>
1 parent 80a1641 commit da50003

File tree

12 files changed

+330
-65
lines changed

12 files changed

+330
-65
lines changed

.build-tools/go.mod

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,14 +14,17 @@ require (
1414

1515
require (
1616
github.com/dapr/kit v0.11.4-0.20230807225040-b6b141aa3e32 // indirect
17+
github.com/gogo/protobuf v1.3.2 // indirect
1718
github.com/iancoleman/orderedmap v0.0.0-20190318233801-ac98e3ecb4b0 // indirect
1819
github.com/inconshreveable/mousetrap v1.0.1 // indirect
1920
github.com/mitchellh/mapstructure v1.5.1-0.20220423185008-bf980b35cac4 // indirect
2021
github.com/spf13/cast v1.5.1 // indirect
2122
github.com/spf13/pflag v1.0.5 // indirect
2223
github.com/xeipuuv/gojsonpointer v0.0.0-20190905194746-02993c407bfb // indirect
2324
github.com/xeipuuv/gojsonreference v0.0.0-20180127040603-bd5ef7bd5415 // indirect
25+
gopkg.in/inf.v0 v0.9.1 // indirect
2426
gopkg.in/yaml.v2 v2.4.0 // indirect
27+
k8s.io/apimachinery v0.26.3 // indirect
2528
)
2629

2730
replace github.com/dapr/components-contrib => ../

.build-tools/go.sum

Lines changed: 38 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,17 +5,23 @@ github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSs
55
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
66
github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc h1:U9qPSI2PIWSS1VwoXQT9A3Wy9MM3WgvqSxFWenqJduM=
77
github.com/frankban/quicktest v1.14.4 h1:g2rn0vABPOOXmZUj+vbmUp0lPoXEMuhTpIluN0XL9UY=
8+
github.com/gogo/protobuf v1.3.2 h1:Ov1cvc58UF3b5XjBnZv7+opcTcQFZebYjWzi34vdm4Q=
9+
github.com/gogo/protobuf v1.3.2/go.mod h1:P1XiOD3dCwIKUDQYPy72D8LYyHL2YPYrpS2s69NZV8Q=
810
github.com/google/go-cmp v0.5.9 h1:O2Tfq5qg4qc4AmwVlvv0oLiVAGB7enBSJ2x2DqQFi38=
11+
github.com/google/gofuzz v1.2.0 h1:xRy4A+RhZaiKjJ1bPfwQ8sedCA+YS2YcCHW6ec7JMi0=
912
github.com/iancoleman/orderedmap v0.0.0-20190318233801-ac98e3ecb4b0 h1:i462o439ZjprVSFSZLZxcsoAe592sZB1rci2Z8j4wdk=
1013
github.com/iancoleman/orderedmap v0.0.0-20190318233801-ac98e3ecb4b0/go.mod h1:N0Wam8K1arqPXNWjMo21EXnBPOPp36vB07FNRdD2geA=
1114
github.com/inconshreveable/mousetrap v1.0.1 h1:U3uMjPSQEBMNp1lFxmllqCPM6P5u/Xq7Pgzkat/bFNc=
1215
github.com/inconshreveable/mousetrap v1.0.1/go.mod h1:vpF70FUmC8bwa3OWnCshd2FqLfsEA9PFc4w1p2J65bw=
1316
github.com/invopop/jsonschema v0.6.0 h1:8e+xY8ZEn8gDHUYylSlLHy22P+SLeIRIHv3nM3hCbmY=
1417
github.com/invopop/jsonschema v0.6.0/go.mod h1:O9uiLokuu0+MGFlyiaqtWxwqJm41/+8Nj0lD7A36YH0=
18+
github.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI2bnpBCr8=
19+
github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck=
1520
github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE=
1621
github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY=
1722
github.com/mitchellh/mapstructure v1.5.1-0.20220423185008-bf980b35cac4 h1:BpfhmLKZf+SjVanKKhCgf3bg+511DmU9eDQTen7LLbY=
1823
github.com/mitchellh/mapstructure v1.5.1-0.20220423185008-bf980b35cac4/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo=
24+
github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e h1:fD57ERR4JtEqsWbfPhv4DMiApHyliiK5xCTNVSPiaAs=
1925
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
2026
github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 h1:Jamvg5psRIccs7FGNTlIRMkT8wgtp5eCXdBlqhYGL6U=
2127
github.com/rogpeppe/go-internal v1.9.0 h1:73kH8U+JUqXU8lRuOHeVHaa/SZPifC7BkcraZVejAe8=
@@ -37,13 +43,44 @@ github.com/xeipuuv/gojsonreference v0.0.0-20180127040603-bd5ef7bd5415 h1:EzJWgHo
3743
github.com/xeipuuv/gojsonreference v0.0.0-20180127040603-bd5ef7bd5415/go.mod h1:GwrjFmJcFw6At/Gs6z4yjiIwzuJ1/+UwLxMQDVQXShQ=
3844
github.com/xeipuuv/gojsonschema v1.2.1-0.20201027075954-b076d39a02e5 h1:ImnGIsrcG8vwbovhYvvSY8fagVV6QhCWSWXfzwGDLVs=
3945
github.com/xeipuuv/gojsonschema v1.2.1-0.20201027075954-b076d39a02e5/go.mod h1:anYRn/JVcOK2ZgGU+IjEV4nwlhoK5sQluxsYJ78Id3Y=
46+
github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=
47+
github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=
48+
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
49+
golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
50+
golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
4051
golang.org/x/exp v0.0.0-20230801115018-d63ba01acd4b h1:r+vk0EmXNmekl0S0BascoeeoHk/L7wmaW2QF90K+kYI=
4152
golang.org/x/exp v0.0.0-20230801115018-d63ba01acd4b/go.mod h1:FXUEEKJgO7OQYeo8N01OfiKP8RXMtf6e8aTskBGqWdc=
42-
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM=
53+
golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
54+
golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
55+
golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
56+
golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
57+
golang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
58+
golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU=
59+
golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
60+
golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
61+
golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
62+
golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
63+
golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
64+
golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
65+
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
66+
golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
67+
golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
68+
golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
69+
golang.org/x/tools v0.0.0-20200619180055-7c47624df98f/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE=
70+
golang.org/x/tools v0.0.0-20210106214847-113979e3529a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA=
71+
golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
72+
golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
73+
golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
74+
golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
4375
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
76+
gopkg.in/check.v1 v1.0.0-20200227125254-8fa46927fb4f h1:BLraFXnmrev5lT+xlilqcH8XK9/i0At2xKjWk4p6zsU=
77+
gopkg.in/inf.v0 v0.9.1 h1:73M5CoZyi3ZLMOyDlQh031Cx6N9NDJ2Vvfl76EDAgDc=
78+
gopkg.in/inf.v0 v0.9.1/go.mod h1:cWUDdTG/fYaXco+Dcufb5Vnc6Gp2YChqWtbxRZE0mXw=
4479
gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY=
4580
gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ=
4681
gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
4782
gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
83+
k8s.io/apimachinery v0.26.3 h1:dQx6PNETJ7nODU3XPtrwkfuubs6w7sX0M8n61zHIV/k=
84+
k8s.io/apimachinery v0.26.3/go.mod h1:ats7nN1LExKHvJ9TmwootT00Yz05MuYqPXEXaVeOy5I=
4885
sigs.k8s.io/yaml v1.3.0 h1:a2VclLzOGrwOHDiV8EfBGhvjHvP46CtW5j6POvhYGGo=
4986
sigs.k8s.io/yaml v1.3.0/go.mod h1:GeOyir5tyXNByN85N/dRIT9es5UQNerPYEKK56eTBm8=

.build-tools/pkg/metadataschema/schema.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ type ComponentMetadata struct {
2020
// Version of the component metadata schema.
2121
SchemaVersion string `json:"schemaVersion" yaml:"schemaVersion" jsonschema:"enum=v1"`
2222
// Component type, of one of the allowed values.
23-
Type string `json:"type" yaml:"type" jsonschema:"enum=bindings,enum=state,enum=secretstores,enum=pubsub,enum=workflows,enum=configuration,enum=lock,enum=middleware"`
23+
Type string `json:"type" yaml:"type" jsonschema:"enum=bindings,enum=state,enum=secretstores,enum=pubsub,enum=workflows,enum=configuration,enum=lock,enum=middleware,enum=crypto"`
2424
// Name of the component (without the inital type, e.g. "http" instead of "bindings.http").
2525
Name string `json:"name" yaml:"name"`
2626
// Version of the component, with the leading "v", e.g. "v1".
@@ -86,7 +86,7 @@ type Metadata struct {
8686
Sensitive bool `json:"sensitive,omitempty" yaml:"sensitive,omitempty"`
8787
// Type of the property.
8888
// If this is empty, it's interpreted as "string".
89-
Type string `json:"type,omitempty" yaml:"type,omitempty" jsonschema:"enum=string,enum=number,enum=bool,enum=duration"`
89+
Type string `json:"type,omitempty" yaml:"type,omitempty" jsonschema:"enum=string,enum=number,enum=bool,enum=duration,enum=bytesize"`
9090
// Default value for the property.
9191
// If it's a string, don't forget to add quotes.
9292
Default string `json:"default,omitempty" yaml:"default,omitempty"`

bindings/http/http.go

Lines changed: 38 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -41,11 +41,12 @@ const (
4141
MTLSClientCert = "MTLSClientCert"
4242
MTLSClientKey = "MTLSClientKey"
4343

44-
TraceparentHeaderKey = "traceparent"
45-
TracestateHeaderKey = "tracestate"
46-
TraceMetadataKey = "traceHeaders"
47-
securityToken = "securityToken"
48-
securityTokenHeader = "securityTokenHeader"
44+
TraceparentHeaderKey = "traceparent"
45+
TracestateHeaderKey = "tracestate"
46+
TraceMetadataKey = "traceHeaders"
47+
securityToken = "securityToken"
48+
securityTokenHeader = "securityTokenHeader"
49+
defaultMaxResponseBodySizeBytes = 100 << 20 // 100 MB
4950
)
5051

5152
// HTTPSource is a binding for an http url endpoint invocation
@@ -67,17 +68,29 @@ type httpMetadata struct {
6768
SecurityToken string `mapstructure:"securityToken"`
6869
SecurityTokenHeader string `mapstructure:"securityTokenHeader"`
6970
ResponseTimeout *time.Duration `mapstructure:"responseTimeout"`
71+
// Maximum response to read from HTTP response bodies.
72+
// This can either be an integer which is interpreted in bytes, or a string with an added unit such as Mi.
73+
// A value <= 0 means no limit.
74+
// Default: 100MB
75+
MaxResponseBodySize metadata.ByteSize `mapstructure:"maxResponseBodySize"`
76+
77+
maxResponseBodySizeBytes int64
7078
}
7179

7280
// NewHTTP returns a new HTTPSource.
7381
func NewHTTP(logger logger.Logger) bindings.OutputBinding {
74-
return &HTTPSource{logger: logger}
82+
return &HTTPSource{
83+
logger: logger,
84+
}
7585
}
7686

7787
// Init performs metadata parsing.
7888
func (h *HTTPSource) Init(_ context.Context, meta bindings.Metadata) error {
79-
var err error
80-
if err = metadata.DecodeMetadata(meta.Properties, &h.metadata); err != nil {
89+
h.metadata = httpMetadata{
90+
MaxResponseBodySize: metadata.NewByteSize(defaultMaxResponseBodySizeBytes),
91+
}
92+
err := metadata.DecodeMetadata(meta.Properties, &h.metadata)
93+
if err != nil {
8194
return err
8295
}
8396

@@ -98,6 +111,11 @@ func (h *HTTPSource) Init(_ context.Context, meta bindings.Metadata) error {
98111
}
99112
}
100113

114+
h.metadata.maxResponseBodySizeBytes, err = h.metadata.MaxResponseBodySize.GetBytes()
115+
if err != nil {
116+
return fmt.Errorf("invalid value for maxResponseBodySize: %w", err)
117+
}
118+
101119
// See guidance on proper HTTP client settings here:
102120
// https://medium.com/@nate510/don-t-use-go-s-default-http-client-4804cb19f779
103121
dialer := &net.Dialer{
@@ -226,7 +244,7 @@ func (h *HTTPSource) Invoke(parentCtx context.Context, req *bindings.InvokeReque
226244

227245
if req.Metadata == nil {
228246
// Prevent things below from failing if req.Metadata is nil.
229-
req.Metadata = make(map[string]string)
247+
req.Metadata = make(map[string]string, 0)
230248
}
231249

232250
if req.Metadata["path"] != "" {
@@ -306,11 +324,20 @@ func (h *HTTPSource) Invoke(parentCtx context.Context, req *bindings.InvokeReque
306324
if err != nil {
307325
return nil, err
308326
}
309-
defer resp.Body.Close()
327+
defer func() {
328+
// Drain before closing
329+
_, _ = io.Copy(io.Discard, resp.Body)
330+
resp.Body.Close()
331+
}()
332+
333+
var respBody io.Reader = resp.Body
334+
if h.metadata.maxResponseBodySizeBytes > 0 {
335+
respBody = io.LimitReader(resp.Body, h.metadata.maxResponseBodySizeBytes)
336+
}
310337

311338
// Read the response body. For empty responses (e.g. 204 No Content)
312339
// `b` will be an empty slice.
313-
b, err := io.ReadAll(resp.Body)
340+
b, err := io.ReadAll(respBody)
314341
if err != nil {
315342
return nil, err
316343
}

bindings/http/http_test.go

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,7 @@ func (tc TestCase) ToInvokeRequest() bindings.InvokeRequest {
6868
}
6969

7070
requestMetadata["X-Status-Code"] = strconv.Itoa(tc.statusCode)
71+
requestMetadata["path"] = tc.path
7172

7273
return bindings.InvokeRequest{
7374
Data: []byte(tc.input),
@@ -83,6 +84,14 @@ type HTTPHandler struct {
8384

8485
func (h *HTTPHandler) ServeHTTP(w http.ResponseWriter, req *http.Request) {
8586
h.Path = req.URL.Path
87+
if strings.TrimPrefix(h.Path, "/") == "large" {
88+
// Write 5KB
89+
for i := 0; i < 1<<10; i++ {
90+
fmt.Fprint(w, "12345")
91+
}
92+
return
93+
}
94+
8695
h.Headers = make(map[string]string)
8796
for headerKey, headerValue := range req.Header {
8897
h.Headers[headerKey] = headerValue[0]
@@ -728,3 +737,27 @@ func verifyTimeoutBehavior(t *testing.T, hs bindings.OutputBinding, handler *HTT
728737
})
729738
}
730739
}
740+
741+
func TestMaxBodySizeHonored(t *testing.T) {
742+
handler := NewHTTPHandler()
743+
s := httptest.NewServer(handler)
744+
defer s.Close()
745+
746+
hs, err := InitBinding(s, map[string]string{"maxResponseBodySize": "1Ki"})
747+
require.NoError(t, err)
748+
749+
tc := TestCase{
750+
input: "GET",
751+
operation: "get",
752+
path: "/large",
753+
err: "context deadline exceeded",
754+
statusCode: 200,
755+
}
756+
757+
req := tc.ToInvokeRequest()
758+
response, err := hs.Invoke(context.Background(), &req)
759+
require.NoError(t, err)
760+
761+
// Should have only read 1KB
762+
assert.Len(t, response.Data, 1<<10)
763+
}

bindings/http/metadata.yaml

Lines changed: 16 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ binding:
2525
- name: patch
2626
description: "Sometimes used to update a subset of fields of a record"
2727
- name: delete
28-
description: "Delete a data/record"
28+
description: "Delete data/record"
2929
- name: options
3030
description: "Requests for information about the communication options available (not commonly used)"
3131
- name: trace
@@ -37,51 +37,41 @@ metadata:
3737
description: "The base URL of the HTTP endpoint to invoke"
3838
example: '"http://host:port/path", "http://myservice:8000/customer"'
3939
# If omitted, uses the same values as "<root>.binding"
40-
binding:
41-
output: true
4240
- name: responseTimeout
4341
required: false
4442
description: "The duration after which HTTP requests should be canceled."
4543
example: '"10s", "5m"'
46-
binding:
47-
output: true
44+
- name: maxResponseBodySize
45+
required: false
46+
description: "Max amount of data to read from the response body, as a resource quantity. A value <= 0 means no limit."
47+
type: bytesize
48+
default: '"100Mi"'
49+
example: '"100" (as bytes), "1k", "10Ki", "1M", "1G"'
4850
- name: MTLSRootCA
4951
required: false
50-
description: "Path to root ca certificate or pem encoded string"
51-
example: "ca.pem"
52-
binding:
53-
output: true
52+
description: "CA certificate: either a PEM-encoded string, or a path to a certificate on disk"
53+
example: '"/path/to/ca.pem"'
5454
- name: MTLSClientCert
5555
required: false
56-
description: "Path to client certificate or pem encoded string"
57-
example: "client.pem"
58-
binding:
59-
output: true
56+
description: "Client certificate for mTLS: either a PEM-encoded string, or a path to a certificate on disk"
57+
example: '"/path/to/client.pem"'
6058
- name: MTLSClientKey
6159
required: false
62-
description: "Path to client private key or pem encoded string"
63-
example: "client.key"
64-
binding:
65-
output: true
60+
description: "Client key for mTLS: either a PEM-encoded string, or a path to a certificate on disk"
61+
example: '"/path/to/client.key"'
6662
- name: MTLSRenegotiation
6763
required: false
6864
description: "Set TLS renegotiation setting"
6965
allowedValues:
7066
- "RenegotiateNever"
7167
- "RenegotiateOnceAsClient"
7268
- "RenegotiateFreelyAsClient"
73-
example: "RenegotiateOnceAsClient"
74-
binding:
75-
output: true
69+
example: '"RenegotiateOnceAsClient"'
7670
- name: securityToken
7771
required: false
7872
description: "The security token to include on an outgoing HTTP request as a header"
79-
example: "this-value-is-preferably-injected-from-a-secret-store"
80-
binding:
81-
output: true
73+
example: '"this-value-is-preferably-injected-from-a-secret-store"'
8274
- name: securityTokenHeader
8375
required: false
8476
description: "The header name on an outgoing HTTP request for a security token"
85-
example: "X-Security-Token"
86-
binding:
87-
output: true
77+
example: '"X-Security-Token"'

component-metadata-schema.json

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,8 @@
117117
"string",
118118
"number",
119119
"bool",
120-
"duration"
120+
"duration",
121+
"bytesize"
121122
],
122123
"description": "Type of the property.\nIf this is empty, it's interpreted as \"string\"."
123124
},
@@ -211,7 +212,8 @@
211212
"workflows",
212213
"configuration",
213214
"lock",
214-
"middleware"
215+
"middleware",
216+
"crypto"
215217
],
216218
"description": "Component type, of one of the allowed values."
217219
},

0 commit comments

Comments
 (0)