Skip to content

Commit 2f5cb1a

Browse files
GeekMashermichaelnebel
authored andcommitted
feat: Add initial tests for AWS Lambda support
1 parent 78a3749 commit 2f5cb1a

File tree

3 files changed

+32
-0
lines changed

3 files changed

+32
-0
lines changed
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
using System.Net;
2+
using System.Collections.Generic;
3+
4+
using Amazon.Lambda.Core;
5+
using Amazon.Lambda.APIGatewayEvents;
6+
7+
8+
namespace LambdaTests {
9+
public class Functions {
10+
public APIGatewayProxyResponse Get(APIGatewayHttpApiV2ProxyRequest request, ILambdaContext context) {
11+
string body = request.Body; // source
12+
string cookie = request.Cookies[0]; // source
13+
14+
string rawpath = request.RawPath; // source
15+
string rawquery = request.RawQueryString; // source
16+
request.PathParameters.TryGetValue("x", out var pathparameter); // source
17+
18+
string header = request.Headers["test"]; // source
19+
request.Headers.TryGetValue("test", out var header2); // source
20+
21+
22+
return new APIGatewayProxyResponse {
23+
StatusCode = 200
24+
};
25+
}
26+
}
27+
}
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
import csharp
2+
import semmle.code.csharp.dataflow.ExternalFlow
3+
4+
query predicate awsRemoteSources(DataFlow::ExprNode node) { sourceNode(node, "remote") }
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
semmle-extractor-options: --load-sources-from-project:${testdir}/../../../resources/stubs/Amazon.Lambda/2.1.0/Amazon.Lambda.csproj

0 commit comments

Comments
 (0)