Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Better Lambda web request input parameter validation. #2653

Merged
merged 1 commit into from
Jul 29, 2024

Conversation

tippmar-nr
Copy link
Member

@tippmar-nr tippmar-nr commented Jul 29, 2024

Adds checking for required parameters (Http Method and Path) for Lambda web requests (APIGatewayProxyRequest, APIGatewayHttpApiV2ProxyRequest or ApplicationLoadBalancerRequest).

If either or both are missing, we log a message (Invalid or missing web request parameters. HttpMethod and Path are required for <request type>. Not instrumenting this function invocation.) and return a NoOp Delegate.

Resolves #2652

@tippmar-nr tippmar-nr requested a review from a team as a code owner July 29, 2024 19:51
@tippmar-nr tippmar-nr changed the title fix: Add better Lambda web request input parameter validation. fix: Better Lambda web request input parameter validation. Jul 29, 2024
@codecov-commenter
Copy link

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 80.80%. Comparing base (369dcba) to head (b4df7bb).

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2653      +/-   ##
==========================================
- Coverage   80.81%   80.80%   -0.01%     
==========================================
  Files         459      459              
  Lines       29064    29064              
  Branches     3191     3191              
==========================================
- Hits        23488    23486       -2     
- Misses       4787     4788       +1     
- Partials      789      790       +1     
Flag Coverage Δ
Agent 81.72% <ø> (-0.01%) ⬇️
Profiler 72.59% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

see 1 file with indirect coverage changes

Copy link
Member

@jaffinito jaffinito left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good!

@tippmar-nr tippmar-nr enabled auto-merge (squash) July 29, 2024 20:38
@tippmar-nr tippmar-nr merged commit 810d4af into main Jul 29, 2024
93 checks passed
@tippmar-nr tippmar-nr deleted the fix/lambda-input-validation branch July 29, 2024 20:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Lambda wrapper should handle invalid payload objects for web requests
3 participants