You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: CHANGELOG.md
+6Lines changed: 6 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,3 +1,9 @@
1
+
## 2.11.0
2
+
3
+
ENHANCEMENTS:
4
+
5
+
- Add `response_base64` and `sensitive_response_base64` computed attributes to the `terracurl_request` data source for lossless binary response download via RFC 4648 base64 encoding. Closes #62.
Copy file name to clipboardExpand all lines: docs/data-sources/request.md
+4-2Lines changed: 4 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -44,8 +44,10 @@ TerraCurl request data source
44
44
45
45
-`id` (String) Example identifier
46
46
-`request_url_string` (String) Request URL includes parameters if request specified
47
-
-`response` (String) JSON response received from request. Empty when `response_sensitive` is `true`; use `sensitive_response` instead.
48
-
-`sensitive_response` (String, Sensitive) JSON response received from request, marked as sensitive so it is not displayed in plan output. Populated only when `response_sensitive` is `true`.
47
+
-`response` (String) JSON response received from request. Empty when `response_sensitive` is `true`; use `sensitive_response` instead. For binary responses, use `response_base64` instead.
48
+
-`response_base64` (String) Response body encoded as base64 (standard) as defined in RFC 4648. Use this for binary content. Empty when `response_sensitive` is `true`; use `sensitive_response_base64` instead.
49
+
-`sensitive_response` (String, Sensitive) JSON response received from request, marked as sensitive so it is not displayed in plan output. Populated only when `response_sensitive` is `true`. For binary responses, use `sensitive_response_base64` instead.
50
+
-`sensitive_response_base64` (String, Sensitive) Response body encoded as base64 (standard) as defined in RFC 4648, marked as sensitive. Populated only when `response_sensitive` is `true`.
49
51
-`status_code` (String) Response status code received from request
Copy file name to clipboardExpand all lines: docs/guides/file_and_multipart_bodies.md
+6Lines changed: 6 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -170,6 +170,12 @@ Write-only string bodies (`*_request_body_wo`) remain available for inline secre
170
170
171
171
See the [Destroy Response Templating guide](destroy_templating) for placeholder syntax.
172
172
173
+
## Binary response bodies (data source)
174
+
175
+
To download binary files without UTF-8 corruption, use the data source computed attributes `response_base64` and `sensitive_response_base64`. These encode the raw response bytes with RFC 4648 standard base64. Decode in Terraform with `base64decode()` (for example when writing to disk with `local_file`).
176
+
177
+
See [`examples/data-sources/binary_response_example`](../../examples/data-sources/binary_response_example/data-source.tf).
178
+
173
179
## Limitations
174
180
175
181
- File contents are loaded fully into memory at request time (same as embedding bytes in configuration).
MarkdownDescription: "JSON response received from request. Empty when `response_sensitive` is `true`; use `sensitive_response` instead.",
144
+
MarkdownDescription: "JSON response received from request. Empty when `response_sensitive` is `true`; use `sensitive_response` instead. For binary responses, use `response_base64` instead.",
143
145
},
144
146
"sensitive_response": schema.StringAttribute{
145
147
Computed: true,
146
148
Sensitive: true,
147
-
MarkdownDescription: "JSON response received from request, marked as sensitive so it is not displayed in plan output. Populated only when `response_sensitive` is `true`.",
149
+
MarkdownDescription: "JSON response received from request, marked as sensitive so it is not displayed in plan output. Populated only when `response_sensitive` is `true`. For binary responses, use `sensitive_response_base64` instead.",
150
+
},
151
+
"response_base64": schema.StringAttribute{
152
+
Computed: true,
153
+
MarkdownDescription: "Response body encoded as base64 (standard) as defined in RFC 4648. Use this for binary content. Empty when `response_sensitive` is `true`; use `sensitive_response_base64` instead.",
MarkdownDescription: "Response body encoded as base64 (standard) as defined in RFC 4648, marked as sensitive. Populated only when `response_sensitive` is `true`.",
Copy file name to clipboardExpand all lines: templates/guides/file_and_multipart_bodies.md.tmpl
+6Lines changed: 6 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -170,6 +170,12 @@ Write-only string bodies (`*_request_body_wo`) remain available for inline secre
170
170
171
171
See the [Destroy Response Templating guide](destroy_templating) for placeholder syntax.
172
172
173
+
## Binary response bodies (data source)
174
+
175
+
To download binary files without UTF-8 corruption, use the data source computed attributes `response_base64`and`sensitive_response_base64`. These encode the raw response bytes with RFC 4648 standard base64. Decode in Terraform with`base64decode()` (for example when writing to disk with`local_file`).
176
+
177
+
See [`examples/data-sources/binary_response_example`](../../examples/data-sources/binary_response_example/data-source.tf).
178
+
173
179
## Limitations
174
180
175
181
- File contents are loaded fully into memory at request time (same as embedding bytes in configuration).
0 commit comments