Skip to content

Commit f8e5f5d

Browse files
committed
Merge remote-tracking branch 'origin/main' into leo.romanovsky/ffe-evp-flagevaluation-enable-java-clean
# Conflicts: # tests/ffe/test_flag_eval_evp.py
2 parents 923dc46 + b76eee5 commit f8e5f5d

30 files changed

Lines changed: 1928 additions & 2706 deletions

File tree

docs/understand/weblogs/end-to-end_weblog.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -225,6 +225,20 @@ if the request to `internal_server` is a failure, it must return a json body wit
225225
- `status` the status code of the `internal_server` response if available or a null value
226226
- `error` a string describing the error, for debug purposes
227227

228+
### GET /external_request/body_limit/{failure_reason}
229+
### POST /external_request/body_limit/{failure_reason}
230+
### TRACE /external_request/body_limit/{failure_reason}
231+
### PUT /external_request/body_limit/{failure_reason}
232+
233+
Same behavior as `/external_request`, but the downstream call targets `http://internal_server:8089/downstream_response/{failure_reason}`.
234+
235+
Supported `{failure_reason}` values (defined in `internal_server`):
236+
- `invalid_content_type`
237+
- `content_length_missing`
238+
- `content_length_too_big`
239+
240+
Unknown values must return HTTP 404 with a json error body.
241+
228242
### GET /external_request/redirect
229243

230244
This endpoint tests HTTP redirect chains with downstream requests, using the fastapi application in `/utils/build/docker/internal_server/app.py`

manifests/cpp_nginx.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -435,7 +435,9 @@ manifest:
435435
tests/test_profiling.py::Test_Profile::test_process_tags: missing_feature
436436
tests/test_profiling.py::Test_Profile::test_process_tags_svc: missing_feature
437437
tests/test_protobuf.py: missing_feature
438-
tests/test_resource_renaming.py: missing_feature
438+
tests/test_resource_renaming.py: '>=1.20.0' # TODO: a lower version might be supported
439+
tests/test_resource_renaming.py::Test_Resource_Renaming_HTTP_Endpoint_Tag::test_http_endpoint_edge_cases: missing_feature
440+
tests/test_resource_renaming.py::Test_Resource_Renaming_Stats_Aggregation_Keys: missing_feature
439441
tests/test_rum_injection.py: irrelevant (RUM injection only supported for Java)
440442
tests/test_sampling_rate_capping.py::Test_SamplingRateCappedIncrease: missing_feature
441443
tests/test_sampling_rates.py::Test_SampleRateFunction: v1.0.0 # real version unknown

manifests/dotnet.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -238,6 +238,9 @@ manifest:
238238
tests/appsec/rasp/test_api10.py::Test_API10_request_headers: missing_feature
239239
tests/appsec/rasp/test_api10.py::Test_API10_request_method: missing_feature
240240
tests/appsec/rasp/test_api10.py::Test_API10_response_body: missing_feature
241+
tests/appsec/rasp/test_api10.py::Test_API10_response_body_ignored_content_length_missing: missing_feature
242+
tests/appsec/rasp/test_api10.py::Test_API10_response_body_ignored_content_length_too_big: missing_feature
243+
tests/appsec/rasp/test_api10.py::Test_API10_response_body_ignored_content_type: missing_feature
241244
tests/appsec/rasp/test_api10.py::Test_API10_response_headers: missing_feature
242245
tests/appsec/rasp/test_api10.py::Test_API10_response_status: missing_feature
243246
tests/appsec/rasp/test_api10.py::Test_API10_without_downstream_body_analysis_using_max: missing_feature

manifests/golang.yml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -214,6 +214,9 @@ manifest:
214214
tests/appsec/rasp/test_api10.py::Test_API10_request_headers: v2.7.0-dev
215215
tests/appsec/rasp/test_api10.py::Test_API10_request_method: v2.4.0
216216
tests/appsec/rasp/test_api10.py::Test_API10_response_body: v2.7.0-dev
217+
tests/appsec/rasp/test_api10.py::Test_API10_response_body_ignored_content_length_missing: missing_feature
218+
tests/appsec/rasp/test_api10.py::Test_API10_response_body_ignored_content_length_too_big: missing_feature
219+
tests/appsec/rasp/test_api10.py::Test_API10_response_body_ignored_content_type: missing_feature
217220
tests/appsec/rasp/test_api10.py::Test_API10_response_headers: v2.4.0
218221
tests/appsec/rasp/test_api10.py::Test_API10_response_status: v2.4.0
219222
tests/appsec/rasp/test_api10.py::Test_API10_without_downstream_body_analysis_using_max: v2.4.0
@@ -886,7 +889,7 @@ manifest:
886889
tests/ffe/test_dynamic_evaluation.py::Test_FFE_RC_Unavailable: v2.4.0
887890
tests/ffe/test_dynamic_evaluation.py::Test_FFE_Unknown_Operator_Tolerance::test_unknown_operator_errors: bug (FFL-2182)
888891
tests/ffe/test_exposures.py: v2.6.0-dev # Easy win for chi, echo, gin, net-http, net-http-orchestrion, uds-echo and version 2.5.0
889-
tests/ffe/test_flag_eval_evp.py: missing_feature (FFL-2446)
892+
tests/ffe/test_flag_eval_evp.py: v2.10.0-dev
890893
tests/ffe/test_flag_eval_metrics.py: v2.8.0
891894
tests/ffe/test_flag_eval_metrics.py::Test_FFE_Eval_Metric_Parse_Error_Invalid_Regex: irrelevant (Go validates regex at config load time)
892895
tests/ffe/test_flag_eval_metrics.py::Test_FFE_Eval_Nested_Attributes_Ignored: irrelevant (FFL-1980)
@@ -1156,7 +1159,7 @@ manifest:
11561159
tests/parametric/test_headers_tracestate_dd.py::Test_Headers_Tracestate_DD::test_headers_tracestate_dd_propagate_propagatedtags: "missing_feature (\"False Bug: header[3,6]: can't guarantee the order of strings in the tracestate since they came from the map. BUG: header[4,5]: w3cTraceID shouldn't be present\")"
11571160
tests/parametric/test_library_tracestats.py::Test_Library_Tracestats::test_payload_metadata_TS012:
11581161
- declaration: missing_feature (CSS v1.2.0 - dd-trace-go does not set payload-level RuntimeID; stats.go PayloadAggregationKey omits it)
1159-
component_version: <2.9.0
1162+
component_version: '<=2.10.0-dev'
11601163
tests/parametric/test_library_tracestats.py::Test_Library_Tracestats::test_relative_error_TS008: missing_feature (relative error test is broken)
11611164
tests/parametric/test_llm_observability/: incomplete_test_app
11621165
tests/parametric/test_otel_api_interoperability.py: missing_feature

manifests/java.yml

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1205,6 +1205,9 @@ manifest:
12051205
- weblog_declaration:
12061206
"*": missing_feature
12071207
vertx3: v1.60.1 # TODO: a lower version might be supported
1208+
tests/appsec/rasp/test_api10.py::Test_API10_response_body_ignored_content_length_missing: missing_feature
1209+
tests/appsec/rasp/test_api10.py::Test_API10_response_body_ignored_content_length_too_big: missing_feature
1210+
tests/appsec/rasp/test_api10.py::Test_API10_response_body_ignored_content_type: missing_feature
12081211
tests/appsec/rasp/test_api10.py::Test_API10_response_headers:
12091212
- weblog_declaration:
12101213
"*": missing_feature
@@ -1927,10 +1930,10 @@ manifest:
19271930
"*": v1.62.0-SNAPSHOT
19281931
spring-boot: v1.61.0-SNAPSHOT
19291932
uds-spring-boot: v1.61.0-SNAPSHOT
1930-
spring-boot-jetty: missing_feature (no instrumentation for Jetty)
1933+
spring-boot-jetty: v1.64.0-SNAPSHOT
19311934
spring-boot-payara: v1.63.0-SNAPSHOT
1932-
vertx3: missing_feature (no instrumentation for Vert.x async multipart)
1933-
vertx4: missing_feature (no instrumentation for Vert.x async multipart)
1935+
vertx3: v1.64.0-SNAPSHOT
1936+
vertx4: v1.64.0-SNAPSHOT
19341937
spring-boot-3-native: irrelevant (GraalVM. Tracing support only)
19351938
tests/appsec/test_blocking_addresses.py::Test_Blocking_request_body_files_content:
19361939
- weblog_declaration:

manifests/nodejs.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,7 @@ refs:
9797
- &ref_5_104_0 '>=5.104.0'
9898
- &ref_5_106_0 '>=5.106.0'
9999
- &ref_5_107_0 '>=5.107.0'
100+
- &ref_5_109_0 '>=5.109.0'
100101
- &ref_5_110_0 '>=5.110.0'
101102
- &ref_6_0_0 '>=6.0.0-pre'
102103
manifest:
@@ -706,6 +707,9 @@ manifest:
706707
tests/appsec/rasp/test_api10.py::Test_API10_request_headers: *ref_5_87_0
707708
tests/appsec/rasp/test_api10.py::Test_API10_request_method: *ref_5_87_0
708709
tests/appsec/rasp/test_api10.py::Test_API10_response_body: *ref_5_87_0
710+
tests/appsec/rasp/test_api10.py::Test_API10_response_body_ignored_content_length_missing: *ref_5_109_0
711+
tests/appsec/rasp/test_api10.py::Test_API10_response_body_ignored_content_length_too_big: *ref_5_109_0
712+
tests/appsec/rasp/test_api10.py::Test_API10_response_body_ignored_content_type: *ref_5_109_0
709713
tests/appsec/rasp/test_api10.py::Test_API10_response_headers: *ref_5_87_0
710714
tests/appsec/rasp/test_api10.py::Test_API10_response_status: *ref_5_87_0
711715
tests/appsec/rasp/test_api10.py::Test_API10_without_downstream_body_analysis_using_max: *ref_5_87_0

manifests/php.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -227,6 +227,9 @@ manifest:
227227
tests/appsec/rasp/test_api10.py::Test_API10_request_headers: missing_feature
228228
tests/appsec/rasp/test_api10.py::Test_API10_request_method: missing_feature
229229
tests/appsec/rasp/test_api10.py::Test_API10_response_body: missing_feature
230+
tests/appsec/rasp/test_api10.py::Test_API10_response_body_ignored_content_length_missing: missing_feature
231+
tests/appsec/rasp/test_api10.py::Test_API10_response_body_ignored_content_length_too_big: missing_feature
232+
tests/appsec/rasp/test_api10.py::Test_API10_response_body_ignored_content_type: missing_feature
230233
tests/appsec/rasp/test_api10.py::Test_API10_response_headers: missing_feature
231234
tests/appsec/rasp/test_api10.py::Test_API10_response_status: missing_feature
232235
tests/appsec/rasp/test_api10.py::Test_API10_without_downstream_body_analysis_using_max: missing_feature

manifests/python.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -586,6 +586,9 @@ manifest:
586586
fastapi: v3.15.0.dev (with requests support)
587587
*django: v4.3.0-dev0 (with httpx support)
588588
tests/appsec/rasp/test_api10.py::Test_API10_response_body: v4.5.0-rc1
589+
tests/appsec/rasp/test_api10.py::Test_API10_response_body_ignored_content_length_missing: missing_feature
590+
tests/appsec/rasp/test_api10.py::Test_API10_response_body_ignored_content_length_too_big: missing_feature
591+
tests/appsec/rasp/test_api10.py::Test_API10_response_body_ignored_content_type: missing_feature
589592
tests/appsec/rasp/test_api10.py::Test_API10_response_headers:
590593
- weblog_declaration:
591594
"*": v3.14.0.rc

manifests/ruby.yml

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -393,6 +393,9 @@ manifest:
393393
- weblog_declaration:
394394
"*": v2.29.0
395395
"graphql23": irrelevant
396+
tests/appsec/rasp/test_api10.py::Test_API10_response_body_ignored_content_length_missing: missing_feature
397+
tests/appsec/rasp/test_api10.py::Test_API10_response_body_ignored_content_length_too_big: missing_feature
398+
tests/appsec/rasp/test_api10.py::Test_API10_response_body_ignored_content_type: missing_feature
396399
tests/appsec/rasp/test_api10.py::Test_API10_response_headers:
397400
- weblog_declaration:
398401
"*": v2.27.0-dev
@@ -2302,7 +2305,22 @@ manifest:
23022305
? tests/parametric/test_otel_span_methods.py::Test_Otel_Span_Methods::test_otel_span_strict_reserved_attributes_overrides_analytics_event
23032306
: "irrelevant (\"Ruby tracer decided to always set _dd1.sr.eausr: 1 for truthy analytics.event inputs, else 0\")"
23042307
tests/parametric/test_otel_span_with_baggage.py::Test_Otel_Span_With_Baggage: missing_feature
2305-
tests/parametric/test_otlp_trace_metrics.py: missing_feature
2308+
tests/parametric/test_otlp_trace_metrics.py: '>=2.35.0' # TODO: a lower version might be supported
2309+
tests/parametric/test_otlp_trace_metrics.py::Test_FR01_Enablement_Configuration::test_fr01_1_enabled_explicit: missing_feature
2310+
tests/parametric/test_otlp_trace_metrics.py::Test_FR01_Enablement_Configuration::test_fr01_3_enabled_by_default: missing_feature
2311+
tests/parametric/test_otlp_trace_metrics.py::Test_FR02_Metric_Identity: missing_feature
2312+
tests/parametric/test_otlp_trace_metrics.py::Test_FR02_Mutual_Exclusion: missing_feature
2313+
tests/parametric/test_otlp_trace_metrics.py::Test_FR03_Metric_Shape: missing_feature
2314+
tests/parametric/test_otlp_trace_metrics.py::Test_FR04_Span_Selection: missing_feature
2315+
tests/parametric/test_otlp_trace_metrics.py::Test_FR05_Sampling_Independence: missing_feature
2316+
tests/parametric/test_otlp_trace_metrics.py::Test_FR06_Otel_Resource_Attributes: missing_feature
2317+
tests/parametric/test_otlp_trace_metrics.py::Test_FR06_Otel_Span_Attributes: missing_feature
2318+
tests/parametric/test_otlp_trace_metrics.py::Test_FR07_Otel_Semantics_Mode: missing_feature
2319+
tests/parametric/test_otlp_trace_metrics.py::Test_FR08_Datadog_Attributes: missing_feature
2320+
tests/parametric/test_otlp_trace_metrics.py::Test_FR09_Red_Metric_Derivation: missing_feature
2321+
tests/parametric/test_otlp_trace_metrics.py::Test_FR15_Client_Computed_Stats_Header::test_fr15_1_header_set_when_enabled: missing_feature
2322+
? tests/parametric/test_otlp_trace_metrics.py::Test_FR15_Client_Computed_Stats_Header::test_fr15_3_stats_computed_resource_attr_on_otlp_traces
2323+
: missing_feature
23062324
tests/parametric/test_parametric_endpoints.py::TestRemoteConfigApplyEndpoint: incomplete_test_app (POST /trace/remote-config/apply only implemented in the python parametric app)
23072325
tests/parametric/test_parametric_endpoints.py::Test_Parametric_DDSpan_Set_Resource: incomplete_test_app (set_resource endpoint is not supported)
23082326
tests/parametric/test_parametric_endpoints.py::Test_Parametric_DDTrace_Baggage: missing_feature (baggage is not supported)

tests/appsec/rasp/test_api10.py

Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -339,6 +339,78 @@ def test_api10_res_body(self):
339339
interfaces.library.validate_one_span(self.r, validator=self.validate_absence)
340340

341341

342+
class API10ResponseBodyIgnored(API10):
343+
"""Base for downstream response body guard tests."""
344+
345+
TAGS_NOT_EXPECTED = ["_dd.appsec.trace.res_body"]
346+
347+
def validate_ignored(self, span: DataDogLibrarySpan):
348+
if span.get("parent_id") not in (0, None):
349+
return None
350+
351+
if not self.validate_metric(span):
352+
return None
353+
354+
for tag in self.TAGS_NOT_EXPECTED:
355+
assert tag not in span.get("meta", {}), f"Tag {tag} should NOT be present in span's meta"
356+
357+
return True
358+
359+
360+
@rfc("https://docs.google.com/document/d/1gCXU3LvTH9en3Bww0AC2coSJWz1m7HcavZjvMLuDCWg/edit#heading=h.giijrtyn1fdx")
361+
@features.api10
362+
@scenarios.appsec_rasp
363+
class Test_API10_response_body_ignored_content_type(API10ResponseBodyIgnored):
364+
"""Downstream response body ignored when content-type is unsupported."""
365+
366+
TAGS_EXPECTED_METRIC = [
367+
("_dd.appsec.downstream_request.response_body_ignored.content_type_invalid", "1"),
368+
]
369+
370+
def setup_api10_response_body_ignored_content_type(self):
371+
self.r = weblog.get("/external_request/body_limit/invalid_content_type")
372+
373+
def test_api10_response_body_ignored_content_type(self):
374+
assert self.r.status_code == 200
375+
interfaces.library.validate_one_span(self.r, validator=self.validate_ignored)
376+
377+
378+
@rfc("https://docs.google.com/document/d/1gCXU3LvTH9en3Bww0AC2coSJWz1m7HcavZjvMLuDCWg/edit#heading=h.giijrtyn1fdx")
379+
@features.api10
380+
@scenarios.appsec_rasp
381+
class Test_API10_response_body_ignored_content_length_missing(API10ResponseBodyIgnored):
382+
"""Downstream response body ignored when content-length is missing."""
383+
384+
TAGS_EXPECTED_METRIC = [
385+
("_dd.appsec.downstream_request.response_body_ignored.content_length_missing", "1"),
386+
]
387+
388+
def setup_api10_response_body_ignored_content_length_missing(self):
389+
self.r = weblog.get("/external_request/body_limit/content_length_missing")
390+
391+
def test_api10_response_body_ignored_content_length_missing(self):
392+
assert self.r.status_code == 200
393+
interfaces.library.validate_one_span(self.r, validator=self.validate_ignored)
394+
395+
396+
@rfc("https://docs.google.com/document/d/1gCXU3LvTH9en3Bww0AC2coSJWz1m7HcavZjvMLuDCWg/edit#heading=h.giijrtyn1fdx")
397+
@features.api10
398+
@scenarios.appsec_rasp
399+
class Test_API10_response_body_ignored_content_length_too_big(API10ResponseBodyIgnored):
400+
"""Downstream response body ignored when content-length exceeds maxBytes."""
401+
402+
TAGS_EXPECTED_METRIC = [
403+
("_dd.appsec.downstream_request.response_body_ignored.content_length_too_big", "1"),
404+
]
405+
406+
def setup_api10_response_body_ignored_content_length_too_big(self):
407+
self.r = weblog.get("/external_request/body_limit/content_length_too_big")
408+
409+
def test_api10_response_body_ignored_content_length_too_big(self):
410+
assert self.r.status_code == 200
411+
interfaces.library.validate_one_span(self.r, validator=self.validate_ignored)
412+
413+
342414
@rfc("https://docs.google.com/document/d/1gCXU3LvTH9en3Bww0AC2coSJWz1m7HcavZjvMLuDCWg/edit#heading=h.giijrtyn1fdx")
343415
@features.api10
344416
@scenarios.appsec_rasp

0 commit comments

Comments
 (0)