mirror of
https://github.com/github/codeql.git
synced 2026-04-27 09:45:15 +02:00
feat: Add initial tests for AWS Lambda support
This commit is contained in:
committed by
Michael Nebel
parent
78a3749601
commit
2f5cb1ab29
27
csharp/ql/test/library-tests/frameworks/Aws/lambda.cs
Normal file
27
csharp/ql/test/library-tests/frameworks/Aws/lambda.cs
Normal file
@@ -0,0 +1,27 @@
|
||||
using System.Net;
|
||||
using System.Collections.Generic;
|
||||
|
||||
using Amazon.Lambda.Core;
|
||||
using Amazon.Lambda.APIGatewayEvents;
|
||||
|
||||
|
||||
namespace LambdaTests {
|
||||
public class Functions {
|
||||
public APIGatewayProxyResponse Get(APIGatewayHttpApiV2ProxyRequest request, ILambdaContext context) {
|
||||
string body = request.Body; // source
|
||||
string cookie = request.Cookies[0]; // source
|
||||
|
||||
string rawpath = request.RawPath; // source
|
||||
string rawquery = request.RawQueryString; // source
|
||||
request.PathParameters.TryGetValue("x", out var pathparameter); // source
|
||||
|
||||
string header = request.Headers["test"]; // source
|
||||
request.Headers.TryGetValue("test", out var header2); // source
|
||||
|
||||
|
||||
return new APIGatewayProxyResponse {
|
||||
StatusCode = 200
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
4
csharp/ql/test/library-tests/frameworks/Aws/lambda.ql
Normal file
4
csharp/ql/test/library-tests/frameworks/Aws/lambda.ql
Normal file
@@ -0,0 +1,4 @@
|
||||
import csharp
|
||||
import semmle.code.csharp.dataflow.ExternalFlow
|
||||
|
||||
query predicate awsRemoteSources(DataFlow::ExprNode node) { sourceNode(node, "remote") }
|
||||
1
csharp/ql/test/library-tests/frameworks/Aws/options
Normal file
1
csharp/ql/test/library-tests/frameworks/Aws/options
Normal file
@@ -0,0 +1 @@
|
||||
semmle-extractor-options: --load-sources-from-project:${testdir}/../../../resources/stubs/Amazon.Lambda/2.1.0/Amazon.Lambda.csproj
|
||||
Reference in New Issue
Block a user