Skip to content

Commit cdd1172

Browse files
committed
C#: Use generated stubs in the RequireSSLAspNetCore like tests and update test results with new line numbers.
1 parent a23be5c commit cdd1172

File tree

13 files changed

+16
-24
lines changed

13 files changed

+16
-24
lines changed

csharp/ql/test/experimental/Security Features/CWE-614/RequireSSLAspNetCore/NoPolicy/Program.cs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
// semmle-extractor-options: ${testdir}/../../../../../resources/stubs/Microsoft.AspNetCore.Http.cs ${testdir}/../../../../../resources/stubs/Microsoft.AspNetCore.Mvc.cs
2-
31
public class MyController : Microsoft.AspNetCore.Mvc.Controller
42
{
53
public void CookieDefault()
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
| Program.cs:7:9:7:48 | call to method Append | Cookie attribute 'Secure' is not set to true. |
2-
| Program.cs:12:29:12:73 | object creation of type CookieOptions | Cookie attribute 'Secure' is not set to true. |
1+
| Program.cs:5:9:5:48 | call to method Append | Cookie attribute 'Secure' is not set to true. |
2+
| Program.cs:10:29:10:73 | object creation of type CookieOptions | Cookie attribute 'Secure' is not set to true. |

csharp/ql/test/experimental/Security Features/CWE-614/RequireSSLAspNetCore/UseCookiePolicyAlways/Program.cs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
// semmle-extractor-options: ${testdir}/../../../../../resources/stubs/Microsoft.AspNetCore.CookiePolicy.cs ${testdir}/../../../../../resources/stubs/Microsoft.AspNetCore.Hosting.cs ${testdir}/../../../../../resources/stubs/Microsoft.AspNetCore.Http.cs ${testdir}/../../../../../resources/stubs/Microsoft.AspNetCore.Mvc.cs ${testdir}/../../../../../resources/stubs/Microsoft.AspNetCore.Builder.cs
2-
31
using Microsoft.AspNetCore.Builder;
42
using Microsoft.AspNetCore.Hosting;
53

csharp/ql/test/experimental/Security Features/CWE-614/RequireSSLAspNetCore/UseCookiePolicyCallback/Program.cs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
// semmle-extractor-options: ${testdir}/../../../../../resources/stubs/Microsoft.AspNetCore.Authentication.Cookies.cs ${testdir}/../../../../../resources/stubs/Microsoft.AspNetCore.Authentication.cs ${testdir}/../../../../../resources/stubs/Microsoft.Extensions.DependencyInjection.cs ${testdir}/../../../../../resources/stubs/Microsoft.AspNetCore.CookiePolicy.cs ${testdir}/../../../../../resources/stubs/Microsoft.AspNetCore.Hosting.cs ${testdir}/../../../../../resources/stubs/Microsoft.AspNetCore.Http.cs ${testdir}/../../../../../resources/stubs/Microsoft.AspNetCore.Mvc.cs ${testdir}/../../../../../resources/stubs/Microsoft.AspNetCore.Builder.cs
2-
31
using Microsoft.AspNetCore.Builder;
42
using Microsoft.AspNetCore.Hosting;
53
using Microsoft.Extensions.DependencyInjection;

csharp/ql/test/experimental/Security Features/CWE-614/RequireSSLAspNetCore/UseCookiePolicyNone/Program.cs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
// semmle-extractor-options: ${testdir}/../../../../../resources/stubs/Microsoft.AspNetCore.CookiePolicy.cs ${testdir}/../../../../../resources/stubs/Microsoft.AspNetCore.Hosting.cs ${testdir}/../../../../../resources/stubs/Microsoft.AspNetCore.Http.cs ${testdir}/../../../../../resources/stubs/Microsoft.AspNetCore.Mvc.cs ${testdir}/../../../../../resources/stubs/Microsoft.AspNetCore.Builder.cs
2-
31
using Microsoft.AspNetCore.Builder;
42
using Microsoft.AspNetCore.Hosting;
53

Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
| Program.cs:10:9:10:49 | call to method Append | Cookie attribute 'Secure' is not set to true. |
2-
| Program.cs:15:29:15:73 | object creation of type CookieOptions | Cookie attribute 'Secure' is not set to true. |
1+
| Program.cs:8:9:8:49 | call to method Append | Cookie attribute 'Secure' is not set to true. |
2+
| Program.cs:13:29:13:73 | object creation of type CookieOptions | Cookie attribute 'Secure' is not set to true. |
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
semmle-extractor-options: /nostdlib /noconfig
2+
semmle-extractor-options: --load-sources-from-project:${testdir}/../../../../../resources/stubs/_frameworks/Microsoft.NETCore.App/Microsoft.NETCore.App.csproj
3+
semmle-extractor-options: --load-sources-from-project:${testdir}/../../../../../resources/stubs/_frameworks/Microsoft.AspNetCore.App/Microsoft.AspNetCore.App.csproj

csharp/ql/test/experimental/Security Features/CWE-614/RequireSSLFalseAspNetCore/CookieBuilder/Program.cs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
// semmle-extractor-options: ${testdir}/../../../../../resources/stubs/Microsoft.AspNetCore.Authentication.Cookies.cs ${testdir}/../../../../../resources/stubs/Microsoft.AspNetCore.Authentication.cs ${testdir}/../../../../../resources/stubs/Microsoft.Extensions.DependencyInjection.cs ${testdir}/../../../../../resources/stubs/Microsoft.AspNetCore.CookiePolicy.cs ${testdir}/../../../../../resources/stubs/Microsoft.AspNetCore.Hosting.cs ${testdir}/../../../../../resources/stubs/Microsoft.AspNetCore.Http.cs ${testdir}/../../../../../resources/stubs/Microsoft.AspNetCore.Mvc.cs ${testdir}/../../../../../resources/stubs/Microsoft.AspNetCore.Builder.cs
2-
31
using Microsoft.AspNetCore.Builder;
42
using Microsoft.AspNetCore.Hosting;
53
using Microsoft.Extensions.DependencyInjection;
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
| Program.cs:16:37:16:85 | access to constant None | Cookie attribute 'Secure' is not set to true. |
2-
| Program.cs:21:43:21:91 | access to constant None | Cookie attribute 'Secure' is not set to true. |
1+
| Program.cs:14:37:14:85 | access to constant None | Cookie attribute 'Secure' is not set to true. |
2+
| Program.cs:19:43:19:91 | access to constant None | Cookie attribute 'Secure' is not set to true. |

csharp/ql/test/experimental/Security Features/CWE-614/RequireSSLFalseAspNetCore/NoPolicy/Program.cs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
// semmle-extractor-options: ${testdir}/../../../../../resources/stubs/Microsoft.AspNetCore.Http.cs ${testdir}/../../../../../resources/stubs/Microsoft.AspNetCore.Mvc.cs
2-
31
public class MyController : Microsoft.AspNetCore.Mvc.Controller
42
{
53
public void CookieDelete()

0 commit comments

Comments
 (0)