Skip to content

Commit e5bcb87

Browse files
lym953claude
andcommitted
merge: resolve conflict in util.ts — keep env-var overrides, update Python to 3.14 layer
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2 parents 16ab0da + 2882659 commit e5bcb87

19 files changed

Lines changed: 709 additions & 236 deletions

.github/workflows/release-serverless-init.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ jobs:
9595

9696
- name: Build and push
9797
id: docker_build
98-
uses: docker/build-push-action@v6
98+
uses: docker/build-push-action@v7
9999
with:
100100
context: ./scripts
101101
file: ./scripts/${{ matrix.arrays.dockerFile }}
@@ -106,7 +106,7 @@ jobs:
106106

107107
- name: Build and push latest
108108
id: docker_build_latest
109-
uses: docker/build-push-action@v6
109+
uses: docker/build-push-action@v7
110110
if: ${{ github.event.inputs.latestTag == 'yes' }}
111111
with:
112112
context: ./scripts

.github/workflows/serverless-init-vulnerability-scan.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,15 +16,15 @@ jobs:
1616
runs-on: ubuntu-22.04
1717
steps:
1818
- name: Scan latest serverless-init image with trivy
19-
uses: aquasecurity/trivy-action@97e0b3872f55f89b95b2f65b3dbab56962816478 # v0.34.2
19+
uses: aquasecurity/trivy-action@57a97c7e7821a5776cebc9bb87c984fa69cba8f1 # v0.35.0
2020
with:
2121
image-ref: "datadog/serverless-init:latest"
2222
ignore-unfixed: true
2323
exit-code: 1
2424
format: table
2525

2626
- name: Scan latest-alpine serverless-init image with trivy
27-
uses: aquasecurity/trivy-action@97e0b3872f55f89b95b2f65b3dbab56962816478 # v0.34.2
27+
uses: aquasecurity/trivy-action@57a97c7e7821a5776cebc9bb87c984fa69cba8f1 # v0.35.0
2828
with:
2929
image-ref: "datadog/serverless-init:latest-alpine"
3030
ignore-unfixed: true

.github/workflows/vulnerability-scan.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,15 +17,15 @@ jobs:
1717
runs-on: ubuntu-22.04
1818
steps:
1919
- name: Scan latest released image with trivy
20-
uses: aquasecurity/trivy-action@97e0b3872f55f89b95b2f65b3dbab56962816478 # v0.34.2
20+
uses: aquasecurity/trivy-action@57a97c7e7821a5776cebc9bb87c984fa69cba8f1 # v0.35.0
2121
with:
2222
image-ref: "public.ecr.aws/datadog/lambda-extension:latest"
2323
ignore-unfixed: true
2424
exit-code: 1
2525
format: table
2626

2727
- name: Scan latest-alpine released image with trivy
28-
uses: aquasecurity/trivy-action@97e0b3872f55f89b95b2f65b3dbab56962816478 # v0.34.2
28+
uses: aquasecurity/trivy-action@57a97c7e7821a5776cebc9bb87c984fa69cba8f1 # v0.35.0
2929
with:
3030
image-ref: "public.ecr.aws/datadog/lambda-extension:latest-alpine"
3131
ignore-unfixed: true

bottlecap/Cargo.lock

Lines changed: 75 additions & 21 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

bottlecap/Cargo.toml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,13 +44,13 @@ rustls-pemfile = { version = "2.0", default-features = false, features = ["std"]
4444
rustls-pki-types = { version = "1.0", default-features = false }
4545
hyper-rustls = { version = "0.27.7", default-features = false }
4646
rand = { version = "0.8", default-features = false }
47-
prost = { version = "0.13", default-features = false }
48-
tonic-types = { version = "0.13", default-features = false }
47+
prost = { version = "0.14", default-features = false }
48+
tonic-types = { version = "0.14", default-features = false }
4949
zstd = { version = "0.13.3", default-features = false }
5050
futures = { version = "0.3.31", default-features = false }
5151
serde-aux = { version = "4.7", default-features = false }
5252
serde_html_form = { version = "0.2", default-features = false }
53-
opentelemetry-proto = { version = "0.30.0", features = ["trace", "with-serde", "gen-tonic"] }
53+
opentelemetry-proto = { version = "0.31.0", features = ["trace", "with-serde", "gen-tonic"] }
5454
opentelemetry-semantic-conventions = { version = "0.30", features = ["semconv_experimental"] }
5555
# Pinned to <0.8.3: version 0.8.3 upgraded to openssl-probe 0.2.x which scans all cert
5656
# directories and parses ~200 individual cert files on Lambda instead of loading a single

bottlecap/LICENSE-3rdparty.csv

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@ aws-lc-sys,https://github.com/aws/aws-lc-rs,ISC AND (Apache-2.0 OR ISC) AND Open
1212
axum,https://github.com/tokio-rs/axum,MIT,The axum Authors
1313
axum-core,https://github.com/tokio-rs/axum,MIT,The axum-core Authors
1414
base64,https://github.com/marshallpierce/rust-base64,MIT OR Apache-2.0,Marshall Pierce <marshall@mpierce.org>
15+
bit-set,https://github.com/contain-rs/bit-set,Apache-2.0 OR MIT,Alexis Beingessner <a.beingessner@gmail.com>
16+
bit-vec,https://github.com/contain-rs/bit-vec,Apache-2.0 OR MIT,Alexis Beingessner <a.beingessner@gmail.com>
1517
bitflags,https://github.com/bitflags/bitflags,MIT OR Apache-2.0,The Rust Project Developers
1618
block-buffer,https://github.com/RustCrypto/utils,MIT OR Apache-2.0,RustCrypto Developers
1719
buf_redux,https://github.com/abonander/buf_redux,MIT OR Apache-2.0,Austin Bonander <austin.bonander@gmail.com>
@@ -22,6 +24,7 @@ bytes,https://github.com/tokio-rs/bytes,MIT,"Carl Lerche <me@carllerche.com>, Se
2224
cc,https://github.com/rust-lang/cc-rs,MIT OR Apache-2.0,Alex Crichton <alex@alexcrichton.com>
2325
cfg-if,https://github.com/rust-lang/cfg-if,MIT OR Apache-2.0,Alex Crichton <alex@alexcrichton.com>
2426
chrono,https://github.com/chronotope/chrono,MIT OR Apache-2.0,The chrono Authors
27+
const-hex,https://github.com/danipopes/const-hex,MIT OR Apache-2.0,DaniPopes <57450786+DaniPopes@users.noreply.github.com>
2528
const_format,https://github.com/rodrimati1992/const_format_crates,Zlib,rodrimati1992 <rodrimatt1985@gmail.com>
2629
const_format_proc_macros,https://github.com/rodrimati1992/const_format_crates,Zlib,rodrimati1992 <rodrimatt1985@gmail.com>
2730
cookie,https://github.com/SergioBenitez/cookie-rs,MIT OR Apache-2.0,"Sergio Benitez <sb@sergio.bz>, Alex Crichton <alex@alexcrichton.com>"
@@ -144,6 +147,7 @@ powerfmt,https://github.com/jhpratt/powerfmt,MIT OR Apache-2.0,Jacob Pratt <jaco
144147
ppv-lite86,https://github.com/cryptocorrosion/cryptocorrosion,MIT OR Apache-2.0,The CryptoCorrosion Contributors
145148
proc-macro2,https://github.com/dtolnay/proc-macro2,MIT OR Apache-2.0,"David Tolnay <dtolnay@gmail.com>, Alex Crichton <alex@alexcrichton.com>"
146149
proc-macro2-diagnostics,https://github.com/SergioBenitez/proc-macro2-diagnostics,MIT OR Apache-2.0,Sergio Benitez <sb@sergio.bz>
150+
proptest,https://github.com/proptest-rs/proptest,MIT OR Apache-2.0,Jason Lingle
147151
prost,https://github.com/tokio-rs/prost,Apache-2.0,"Dan Burkert <dan@danburkert.com>, Lucio Franco <luciofranco14@gmail.com>, Casper Meijn <casper@meijn.net>, Tokio Contributors <team@tokio.rs>"
148152
prost-derive,https://github.com/tokio-rs/prost,Apache-2.0,"Dan Burkert <dan@danburkert.com>, Lucio Franco <luciofranco14@gmail.com>, Casper Meijn <casper@meijn.net>, Tokio Contributors <team@tokio.rs>"
149153
prost-types,https://github.com/tokio-rs/prost,Apache-2.0,"Dan Burkert <dan@danburkert.com>, Lucio Franco <luciofranco14@gmail.com>, Casper Meijn <casper@meijn.net>, Tokio Contributors <team@tokio.rs>"
@@ -158,6 +162,7 @@ r-efi,https://github.com/r-efi/r-efi,MIT OR Apache-2.0 OR LGPL-2.1-or-later,The
158162
rand,https://github.com/rust-random/rand,MIT OR Apache-2.0,"The Rand Project Developers, The Rust Project Developers"
159163
rand_chacha,https://github.com/rust-random/rand,MIT OR Apache-2.0,"The Rand Project Developers, The Rust Project Developers, The CryptoCorrosion Contributors"
160164
rand_core,https://github.com/rust-random/rand,MIT OR Apache-2.0,"The Rand Project Developers, The Rust Project Developers"
165+
rand_xorshift,https://github.com/rust-random/rngs,MIT OR Apache-2.0,"The Rand Project Developers, The Rust Project Developers"
161166
redox_syscall,https://gitlab.redox-os.org/redox-os/syscall,MIT,Jeremy Soller <jackpot51@gmail.com>
162167
regex,https://github.com/rust-lang/regex,MIT OR Apache-2.0,"The Rust Project Developers, Andrew Gallant <jamslam@gmail.com>"
163168
regex-automata,https://github.com/rust-lang/regex,MIT OR Apache-2.0,"The Rust Project Developers, Andrew Gallant <jamslam@gmail.com>"
@@ -174,6 +179,7 @@ rustls-native-certs,https://github.com/rustls/rustls-native-certs,Apache-2.0 OR
174179
rustls-pemfile,https://github.com/rustls/pemfile,Apache-2.0 OR ISC OR MIT,The rustls-pemfile Authors
175180
rustls-pki-types,https://github.com/rustls/pki-types,MIT OR Apache-2.0,The rustls-pki-types Authors
176181
rustls-webpki,https://github.com/rustls/webpki,ISC,The rustls-webpki Authors
182+
rusty-fork,https://github.com/altsysrq/rusty-fork,MIT OR Apache-2.0,Jason Lingle
177183
ryu,https://github.com/dtolnay/ryu,Apache-2.0 OR BSL-1.0,David Tolnay <dtolnay@gmail.com>
178184
safemem,https://github.com/abonander/safemem,MIT OR Apache-2.0,Austin Bonander <austin.bonander@gmail.com>
179185
schannel,https://github.com/steffengy/schannel-rs,MIT,"Steven Fackler <sfackler@gmail.com>, Steffen Butzer <steffen.butzer@outlook.com>"
@@ -224,6 +230,7 @@ tokio-rustls,https://github.com/rustls/tokio-rustls,MIT OR Apache-2.0,The tokio-
224230
tokio-stream,https://github.com/tokio-rs/tokio,MIT,Tokio Contributors <team@tokio.rs>
225231
tokio-util,https://github.com/tokio-rs/tokio,MIT,Tokio Contributors <team@tokio.rs>
226232
tonic,https://github.com/hyperium/tonic,MIT,Lucio Franco <luciofranco14@gmail.com>
233+
tonic-prost,https://github.com/hyperium/tonic,MIT,Lucio Franco <luciofranco14@gmail.com>
227234
tonic-types,https://github.com/hyperium/tonic,MIT,"Lucio Franco <luciofranco14@gmail.com>, Rafael Lemos <flemos.rafael.dev@gmail.com>"
228235
tower,https://github.com/tower-rs/tower,MIT,Tower Maintainers <team@tower-rs.com>
229236
tower-http,https://github.com/tower-rs/tower-http,MIT,Tower Maintainers <team@tower-rs.com>
@@ -237,6 +244,7 @@ tracing-subscriber,https://github.com/tokio-rs/tracing,MIT,"Eliza Weisman <eliza
237244
try-lock,https://github.com/seanmonstar/try-lock,MIT,Sean McArthur <sean@seanmonstar.com>
238245
twoway,https://github.com/bluss/twoway,MIT OR Apache-2.0,bluss
239246
typenum,https://github.com/paholg/typenum,MIT OR Apache-2.0,"Paho Lurie-Gregg <paho@paholg.com>, Andre Bogus <bogusandre@gmail.com>"
247+
unarray,https://github.com/cameron1024/unarray,MIT OR Apache-2.0,The unarray Authors
240248
uncased,https://github.com/SergioBenitez/uncased,MIT OR Apache-2.0,Sergio Benitez <sb@sergio.bz>
241249
unicase,https://github.com/seanmonstar/unicase,MIT OR Apache-2.0,Sean McArthur <sean@seanmonstar.com>
242250
unicode-ident,https://github.com/dtolnay/unicode-ident,(MIT OR Apache-2.0) AND Unicode-3.0,David Tolnay <dtolnay@gmail.com>
@@ -248,6 +256,7 @@ ustr,https://github.com/anderslanglands/ustr,BSD-2-Clause-Patent,Anders Langland
248256
utf8_iter,https://github.com/hsivonen/utf8_iter,Apache-2.0 OR MIT,Henri Sivonen <hsivonen@hsivonen.fi>
249257
valuable,https://github.com/tokio-rs/valuable,MIT,The valuable Authors
250258
value-bag,https://github.com/sval-rs/value-bag,Apache-2.0 OR MIT,Ashley Mannix <ashleymannix@live.com.au>
259+
wait-timeout,https://github.com/alexcrichton/wait-timeout,MIT OR Apache-2.0,Alex Crichton <alex@alexcrichton.com>
251260
want,https://github.com/seanmonstar/want,MIT,Sean McArthur <sean@seanmonstar.com>
252261
wasi,https://github.com/bytecodealliance/wasi,Apache-2.0 WITH LLVM-exception OR Apache-2.0 OR MIT,The Cranelift Project Developers
253262
wasip2,https://github.com/bytecodealliance/wasi-rs,Apache-2.0 WITH LLVM-exception OR Apache-2.0 OR MIT,The wasip2 Authors

bottlecap/src/http.rs

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ use core::time::Duration;
99
use datadog_fips::reqwest_adapter::create_reqwest_client_builder;
1010
use std::sync::Arc;
1111
use std::{collections::HashMap, error::Error, fs::File, io::BufReader};
12-
use tracing::{debug, error};
12+
use tracing::{debug, error, warn};
1313

1414
#[must_use]
1515
pub fn get_client(config: &Arc<config::Config>) -> reqwest::Client {
@@ -117,6 +117,22 @@ pub async fn extract_request_body(
117117
Ok((parts, bytes))
118118
}
119119

120+
/// Like [`extract_request_body`], but never fails: if buffering the body
121+
/// errors (e.g. an oversized payload exceeding `DefaultBodyLimit`), the body
122+
/// is replaced with empty bytes so that processing can continue with headers
123+
/// only.
124+
pub async fn extract_request_body_or_empty(request: Request) -> (http::request::Parts, Bytes) {
125+
let (parts, body) = request.into_parts();
126+
let bytes = match Bytes::from_request(Request::from_parts(parts.clone(), body), &()).await {
127+
Ok(b) => b,
128+
Err(e) => {
129+
warn!("Failed to buffer request body: {e}. Processing with empty payload.");
130+
Bytes::new()
131+
}
132+
};
133+
(parts, bytes)
134+
}
135+
120136
#[must_use]
121137
pub fn headers_to_map(headers: &HeaderMap) -> HashMap<String, String> {
122138
headers

0 commit comments

Comments
 (0)