Extract Lambda event parsing out of LambdaAppSecHandler - #12202
Open
claponcet wants to merge 1 commit into
Open
Conversation
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This comment has been minimized.
This comment has been minimized.
Contributor
🟢 Java Benchmark SLOs — All performance SLOs passed
PR vs. master results
Commit: Load and DaCapo benchmarks can be triggered manually in the GitLab pipeline. Results will appear in the Benchmarking Platform UI after completion. |
Contributor
There was a problem hiding this comment.
More details
Sentinel identity, stream reset, unknown-trigger extraction, trigger propagation, and malformed/oversized response fallbacks remain intact. The relocated package-private symbols have no production callers outside the handler.
🤖 Datadog Autotest · Commit 10834e7 · What is Autotest? · @DataDog review to ask questions · Any feedback? Reach out in #autotest
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What Does This Do
Splits
LambdaAppSecHandler(1211 lines) into three files, with no behaviour change:LambdaEventParser(new) — all payload parsing:parseEvent(event payload and JSON string),parseResponse,parseJsonValue,detectTriggerType, the five per-trigger extractors and their helpers. Holds the Moshi adapters andMAX_EVENT_SIZE. TheLambdaTriggerTypeenum and theLambdaRequestData/LambdaResponseDatavalue types move here as nested types. Contains no AppSec imports.LambdaURIDataAdapter(new) — promoted from a private nested class to a top-level one, unchanged.LambdaAppSecHandler— down to ~400 lines, now only the gateway-callback logic:processRequestStart,processRequestEnd,processResponseData,mergeContexts,processAppSecRequestData,TemporaryRequestContextand the singleCURRENT_TRIGGER_TYPEthread-local.Method bodies are moved verbatim. The parser keeps returning the
LambdaRequestData.EMPTYsentinel (compared by identity inprocessRequestStart) rather thannull, and the generic extractor still returns populated data forUNKNOWNtriggers, so unrecognised events continue to reach the WAF exactly as before.LambdaAppSecHandlerTestis updated only where it names moved symbols —LambdaTriggerType,detectTriggerType, andextractResponseDatawhich is nowparseResponse. No assertions changed.Contributor Checklist
type:and (comp:orinst:) labels in addition to any other useful labelsclose,fix, or any linking keywords when referencing an issueUse
solvesinstead, and assign the PR milestone to the issue🤖 Generated with Claude Code