diff --git a/.github/workflows/dotnet-core.yml b/.github/workflows/dotnet-core.yml
index c1726c1..bf617fd 100644
--- a/.github/workflows/dotnet-core.yml
+++ b/.github/workflows/dotnet-core.yml
@@ -13,6 +13,16 @@ jobs:
steps:
- uses: actions/checkout@v2
+ - name: Check for secrets leak on the repo
+ run: |
+ git clone https://github.com/awslabs/git-secrets.git target
+ cd target
+ sudo make install
+ echo "Git-secrets installation completed"
+ git secrets --register-aws --global
+ echo "Added aws secret templates"
+ git secrets --scan -r ../
+ echo "Repository scan completed"
- name: Setup .NET Core
uses: actions/setup-dotnet@v1
with:
diff --git a/NuGet.Config b/NuGet.Config
new file mode 100644
index 0000000..3ad3572
--- /dev/null
+++ b/NuGet.Config
@@ -0,0 +1,8 @@
+
+
+
+
+
+
+
+
diff --git a/RecommendationTools/RecommendationBatchUpdater/RecommendationBatchUpdater.csproj b/RecommendationTools/RecommendationBatchUpdater/RecommendationBatchUpdater.csproj
index 540da5f..6135de8 100644
--- a/RecommendationTools/RecommendationBatchUpdater/RecommendationBatchUpdater.csproj
+++ b/RecommendationTools/RecommendationBatchUpdater/RecommendationBatchUpdater.csproj
@@ -1,4 +1,4 @@
-
+
Exe
@@ -6,7 +6,7 @@
-
+
diff --git a/RecommendationTools/RecommendationTools.sln b/RecommendationTools/RecommendationTools.sln
index 6aab883..ade6270 100644
--- a/RecommendationTools/RecommendationTools.sln
+++ b/RecommendationTools/RecommendationTools.sln
@@ -1,10 +1,12 @@
Microsoft Visual Studio Solution File, Format Version 12.00
-# Visual Studio Version 16
-VisualStudioVersion = 16.0.31729.503
+# Visual Studio Version 17
+VisualStudioVersion = 17.0.32126.317
MinimumVisualStudioVersion = 10.0.40219.1
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "RecommendationValidator", "RecommendationValidator\RecommendationValidator.csproj", "{DB3D0373-8483-4CEB-96C1-F1B0966D7483}"
EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "RecommendationBatchUpdater", "RecommendationBatchUpdater\RecommendationBatchUpdater.csproj", "{BAE409F1-F59A-458C-8F94-D4ED943A4E79}"
+Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "RecommendationBatchUpdater", "RecommendationBatchUpdater\RecommendationBatchUpdater.csproj", "{BAE409F1-F59A-458C-8F94-D4ED943A4E79}"
+EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "PostSyncTests", "UnitTests\PostSyncTests.csproj", "{853E9367-AAFE-4CEA-9FAD-867BD09BB978}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
@@ -20,6 +22,10 @@ Global
{BAE409F1-F59A-458C-8F94-D4ED943A4E79}.Debug|Any CPU.Build.0 = Debug|Any CPU
{BAE409F1-F59A-458C-8F94-D4ED943A4E79}.Release|Any CPU.ActiveCfg = Release|Any CPU
{BAE409F1-F59A-458C-8F94-D4ED943A4E79}.Release|Any CPU.Build.0 = Release|Any CPU
+ {853E9367-AAFE-4CEA-9FAD-867BD09BB978}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {853E9367-AAFE-4CEA-9FAD-867BD09BB978}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {853E9367-AAFE-4CEA-9FAD-867BD09BB978}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {853E9367-AAFE-4CEA-9FAD-867BD09BB978}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
diff --git a/RecommendationTools/UnitTests/PostSyncTests.csproj b/RecommendationTools/UnitTests/PostSyncTests.csproj
new file mode 100644
index 0000000..3226ee2
--- /dev/null
+++ b/RecommendationTools/UnitTests/PostSyncTests.csproj
@@ -0,0 +1,18 @@
+
+
+
+ net5.0
+ enable
+
+ false
+
+
+
+
+
+
+
+
+
+
+
diff --git a/RecommendationTools/UnitTests/S3SyncTests.cs b/RecommendationTools/UnitTests/S3SyncTests.cs
new file mode 100644
index 0000000..debc850
--- /dev/null
+++ b/RecommendationTools/UnitTests/S3SyncTests.cs
@@ -0,0 +1,58 @@
+using NUnit.Framework;
+using System;
+using System.IO;
+using System.IO.Compression;
+using System.Linq;
+using System.Net.Http;
+using System.Threading.Tasks;
+
+namespace PostSyncTests
+{
+ ///
+ /// These tests are made to be run automatically after a merge and sync to the public S3 bucket. This is needed
+ /// in order to validate that the public S3 bucket is up to date with the repository and that the sync is working.
+ /// If running these tests in a feature branch with changes to the recommendation files, the tests should fail.
+ ///
+ public class S3SyncTests
+ {
+ private const string S3UrlPrefix = "https://s3.us-west-2.amazonaws.com/aws.portingassistant.dotnet.datastore/recommendationsync/recommendation";
+ private const string TempExtractDir = "masterBranchCode";
+
+ [TearDown]
+ [SetUp]
+ public static void SetupAndTearDown()
+ {
+ if (Directory.Exists(TempExtractDir))
+ {
+ Directory.Delete(TempExtractDir, true);
+ }
+ }
+
+ [Test]
+ public async Task ValidateS3RecommendationContentMatchesRepository()
+ {
+ using var httpClient = new HttpClient();
+ // Use always master branch since that is the only branch that should be in sync with S3
+ var zipBytes = await httpClient.GetByteArrayAsync("https://github.com/aws/porting-assistant-dotnet-datastore/archive/refs/heads/master.zip");
+ await File.WriteAllBytesAsync("github.zip", zipBytes);
+ Directory.CreateDirectory(TempExtractDir);
+ ZipFile.ExtractToDirectory("github.zip", "masterBranchCode");
+ var pathToRepoRecs = $@"{TempExtractDir}\porting-assistant-dotnet-datastore-master\recommendation";
+
+ var allRepoRecs = Directory.EnumerateFiles(pathToRepoRecs).ToList();
+
+ Assert.Multiple(async () =>
+ {
+ foreach(var file in allRepoRecs)
+ {
+ var s3ObjectPath = $"{S3UrlPrefix}/{file.Split('\\').Last()}";
+ var s3Content = await httpClient.GetStringAsync(s3ObjectPath);
+ var localContent = await File.ReadAllTextAsync(file);
+ localContent = localContent.Replace("\r\n", "\n", StringComparison.Ordinal);
+ s3Content = s3Content.Replace("\r\n", "\n", StringComparison.Ordinal);
+ Assert.AreEqual(localContent, s3Content, $"Content didn't match for file {file}");
+ }
+ });
+ }
+ }
+}
\ No newline at end of file
diff --git a/Templates/default.json b/Templates/default.json
index 7742cc9..de28539 100644
--- a/Templates/default.json
+++ b/Templates/default.json
@@ -17,6 +17,10 @@
"Name": "AspNetWebApiFeature",
"ClassName": "AspNetWebApiFeature"
},
+ {
+ "Name": "AspNetWebFormsFeature",
+ "ClassName": "AspNetWebFormsFeature"
+ },
{
"Name": "AspNetCoreMvcFeature",
"ClassName": "AspNetCoreMvcFeature"
diff --git a/Templates/monolithservice/MonolithService.cs b/Templates/monolithservice/MonolithService.cs
index 06d0916..0e7b006 100644
--- a/Templates/monolithservice/MonolithService.cs
+++ b/Templates/monolithservice/MonolithService.cs
@@ -10,7 +10,7 @@
using System.Web.Configuration;
using System.Web.Routing;
-namespace Modernize.Web.Mvc.Controllers
+namespace #NAMESPACEPLACEHOLDER#
{
public static class MonolithService
{
diff --git a/Templates/monolithservice/MonolithServiceCore.cs b/Templates/monolithservice/MonolithServiceCore.cs
new file mode 100644
index 0000000..d2e9f9d
--- /dev/null
+++ b/Templates/monolithservice/MonolithServiceCore.cs
@@ -0,0 +1,136 @@
+/*
+
+using Microsoft.AspNetCore.Http.Extensions;
+using System.Net;
+
+namespace Modernize.Web.Mvc.Controllers
+{
+ public static class MonolithService
+ {
+ //TODO Add Service Host
+ private static string ServiceHost = "";
+
+ //TODO Add Service Port
+ private static string ServicePort = "";
+ private static string ServiceUrl = $"https://{ServiceHost}";
+ private static HttpClientHandler handler = new HttpClientHandler()
+ {
+ AutomaticDecompression = DecompressionMethods.GZip | DecompressionMethods.Deflate
+ };
+ private static HttpClient client = new HttpClient(handler);
+
+
+ public static async Task CreateRequestAsync(HttpRequestMessage httpRequest, Microsoft.AspNetCore.Routing.RouteData routeData)
+ {
+ string? actionName = routeData?.Values["action"]?.ToString();
+ string? controllerName = routeData?.Values["controller"]?.ToString();
+ var httpMessage = GetRequestMessage(httpRequest, controllerName, actionName);
+ return await InvokeRequestAsync(httpMessage);
+ }
+
+ public static string CreateRequest(HttpRequestMessage httpRequest, Microsoft.AspNetCore.Routing.RouteData routeData)
+ {
+ string? actionName = routeData?.Values["action"]?.ToString();
+ string? controllerName = routeData?.Values["controller"]?.ToString();
+ var httpMessage = GetRequestMessage(httpRequest, controllerName, actionName);
+ return InvokeRequest(httpMessage);
+ }
+
+
+ public static async Task CreateRequestAsync(HttpRequest httpRequest, Microsoft.AspNetCore.Routing.RouteData routeData)
+ {
+ string? actionName = routeData?.Values["action"]?.ToString();
+ string? controllerName = routeData?.Values["controller"]?.ToString();
+ var httpMessage = GetRequestMessage(httpRequest, controllerName, actionName);
+ return await InvokeRequestAsync(httpMessage);
+ }
+
+ public static string CreateRequest(HttpRequest httpRequest, Microsoft.AspNetCore.Routing.RouteData routeData)
+ {
+ string? actionName = routeData?.Values["action"]?.ToString();
+ string? controllerName = routeData?.Values["controller"]?.ToString();
+ var httpMessage = GetRequestMessage(httpRequest, controllerName, actionName);
+ return InvokeRequest(httpMessage);
+ }
+
+ private static async Task InvokeRequestAsync(HttpRequestMessage requestMessage)
+ {
+ var result = await client.SendAsync(requestMessage).ConfigureAwait(false);
+ var stringResult = await result.Content.ReadAsStringAsync().ConfigureAwait(false);
+ return stringResult;
+ }
+
+ private static string InvokeRequest(HttpRequestMessage requestMessage)
+ {
+ var result = client.SendAsync(requestMessage).Result;
+ var stringResult = result.Content.ReadAsStringAsync().Result;
+ return stringResult;
+ }
+
+ private static HttpRequestMessage GetRequestMessage(HttpRequestMessage httpRequestMessage, string? controllerName, string? actionName)
+ {
+ var currentUri = httpRequestMessage.RequestUri;
+ var uriBuilder = new UriBuilder($"{ServiceUrl}/{controllerName}/{actionName}")
+ {
+ Host = ServiceHost,
+ Port = int.Parse(ServicePort),
+ Fragment = currentUri?.Fragment,
+ Scheme = currentUri?.Scheme,
+ Path = currentUri?.PathAndQuery
+ };
+
+ var newRequest = httpRequestMessage;
+ newRequest.RequestUri = uriBuilder.Uri;
+ return newRequest;
+ }
+ private static HttpRequestMessage GetRequestMessage(HttpRequest httpRequest, string controllerName, string actionName)
+ {
+ var httpMethod = new HttpMethod(httpRequest.Method);
+ var currentUri = new Uri(httpRequest.GetDisplayUrl());
+ var uriBuilder = new UriBuilder($"{ServiceUrl}/{controllerName}/{actionName}")
+ {
+ Host = ServiceHost,
+ Port = int.Parse(ServicePort),
+ Fragment = currentUri.Fragment,
+ Scheme = currentUri.Scheme,
+ Path = currentUri.PathAndQuery
+ };
+ var requestMessage = new HttpRequestMessage(httpMethod, uriBuilder.Uri);
+ var currentHeaders = httpRequest.Headers.Keys.ToArray();
+
+ if (httpMethod == HttpMethod.Post || httpMethod == HttpMethod.Put)
+ {
+ var streamReader = new StreamReader(httpRequest.Body).ReadToEnd();
+ requestMessage.Content = new StringContent(streamReader);
+ requestMessage.Content.Headers.ContentType = new System.Net.Http.Headers.MediaTypeHeaderValue(httpRequest.ContentType);
+ //requestMessage.Content.Headers.ContentEncoding.Add(httpRequest.ContentEncoding.HeaderName);
+ requestMessage.Content.Headers.ContentLength = httpRequest.ContentLength;
+ }
+ for (int i = 0; i < currentHeaders.Length; i++)
+ {
+ try
+ {
+ if (currentHeaders[i] == "Host")
+ {
+ requestMessage?.Headers.Add(currentHeaders[i], ServiceHost);
+ }
+ else if (currentHeaders[i].StartsWith("Content-"))
+ {
+ requestMessage?.Content?.Headers.TryAddWithoutValidation(currentHeaders[i], httpRequest.Headers[currentHeaders[i]].FirstOrDefault());
+ }
+ else
+ {
+ requestMessage?.Headers.TryAddWithoutValidation(currentHeaders[i], httpRequest.Headers[currentHeaders[i]].FirstOrDefault());
+ }
+ }
+ catch (Exception ex)
+ {
+ }
+ }
+ return requestMessage;
+ }
+ }
+}
+
+
+*/
diff --git a/hooks/commit-msg b/hooks/commit-msg
new file mode 100644
index 0000000..89a0f2e
--- /dev/null
+++ b/hooks/commit-msg
@@ -0,0 +1,2 @@
+#!/usr/bin/env bash
+git secrets --commit_msg_hook -- "$@"
diff --git a/hooks/pre-commit b/hooks/pre-commit
new file mode 100644
index 0000000..f30ae7e
--- /dev/null
+++ b/hooks/pre-commit
@@ -0,0 +1,2 @@
+#!/usr/bin/env bash
+git secrets --pre_commit_hook -- "$@"
diff --git a/hooks/prepare-commit-msg b/hooks/prepare-commit-msg
new file mode 100644
index 0000000..3d6bf42
--- /dev/null
+++ b/hooks/prepare-commit-msg
@@ -0,0 +1,2 @@
+#!/usr/bin/env bash
+git secrets --prepare_commit_msg_hook -- "$@"
diff --git a/recommendation/microsoft.owin.hosting.json b/recommendation/microsoft.owin.hosting.json
index 1580ef7..55dbf25 100644
--- a/recommendation/microsoft.owin.hosting.json
+++ b/recommendation/microsoft.owin.hosting.json
@@ -149,7 +149,10 @@
{
"Name": "AddComment",
"Type": "Method",
- "Value": "Replace Microsoft.Owin.Hosting.WebApp.Start with WebHostBuilder such as: var host = new WebHostBuilder().UseKestrel().UseUrls(URL_HERE).UseStartup().Build(); host.Start(); Start options can be added into the new format as needed.",
+ "Value": {
+ "comment": "Replace Microsoft.Owin.Hosting.WebApp.Start with WebHostBuilder such as: var host = new WebHostBuilder().UseKestrel().UseUrls(URL_HERE).UseStartup().Build(); host.Start(); Start options can be added into the new format as needed.",
+ "dontUseCTAPrefix": ""
+ },
"Description": "Add a comment to explain how to replace WebApp.Start.",
"ActionValidation": {
"Contains": "Replace Microsoft.Owin.Hosting.WebApp.Start with WebHostBuilder such as: var host = new WebHostBuilder().UseKestrel().UseUrls(URL_HERE).UseStartup().Build(); host.Start(); Start options can be added into the new format as needed.",
@@ -205,12 +208,15 @@
{
"Name": "AddComment",
"Type": "Method",
- "Value": "Replace Microsoft.Owin.Hosting.WebApp.Start with WebHostBuilder such as: var host = new WebHostBuilder().UseKestrel().UseUrls(URL_HERE).UseStartup().Build(); host.Start(); UseStartup can contain the TStartup class used before.",
+ "Value": {
+ "comment": "Replace Microsoft.Owin.Hosting.WebApp.Start with WebHostBuilder such as: var host = new WebHostBuilder().UseKestrel().UseUrls(URL_HERE).UseStartup().Build(); host.Start(); UseStartup can contain the TStartup class used before.",
+ "dontUseCTAPrefix": ""
+ },
"Description": "Add a comment to explain how to replace WebApp.Start.",
"ActionValidation": {
- "Contains": "Replace Microsoft.Owin.Hosting.WebApp.Start with WebHostBuilder such as: var host = new WebHostBuilder().UseKestrel().UseUrls(URL_HERE).UseStartup().Build(); host.Start(); UseStartup can contain the TStartup class used before.",
- "NotContains": "",
- "CheckComments": "True"
+ "Contains": "Replace Microsoft.Owin.Hosting.WebApp.Start with WebHostBuilder such as: var host = new WebHostBuilder().UseKestrel().UseUrls(URL_HERE).UseStartup().Build(); host.Start(); UseStartup can contain the TStartup class used before.",
+ "NotContains": "",
+ "CheckComments": "True"
}
}
]
diff --git a/recommendation/microsoft.owin.infrastructure.json b/recommendation/microsoft.owin.infrastructure.json
index c1e86af..f2ee9ad 100644
--- a/recommendation/microsoft.owin.infrastructure.json
+++ b/recommendation/microsoft.owin.infrastructure.json
@@ -117,12 +117,15 @@
{
"Name": "AddComment",
"Type": "Method",
- "Value": "Please replace your parameters as the AddQueryString(string, string) method has been deprecated and you must either use the AddQueryString(string, string, string) method or the AddQueryString(string, System.Collections.Generic.IDictionary) method.",
+ "Value": {
+ "comment": "Please replace your parameters as the AddQueryString(string, string) method has been deprecated and you must either use the AddQueryString(string, string, string) method or the AddQueryString(string, System.Collections.Generic.IDictionary) method.",
+ "dontUseCTAPrefix": ""
+ },
"Description": "Add a comment to explain how to replace the AddQueryString(string, string) invocation.",
"ActionValidation": {
- "Contains": "Please replace your parameters as the AddQueryString(string, string) method has been deprecated and you must either use the AddQueryString(string, string, string) method or the AddQueryString(string, System.Collections.Generic.IDictionary) method.",
- "NotContains": "",
- "CheckComments": "True"
+ "Contains": "Please replace your parameters as the AddQueryString(string, string) method has been deprecated and you must either use the AddQueryString(string, string, string) method or the AddQueryString(string, System.Collections.Generic.IDictionary) method.",
+ "NotContains": "",
+ "CheckComments": "True"
}
},
{
diff --git a/recommendation/microsoft.owin.json b/recommendation/microsoft.owin.json
index 826f7c7..28f45fa 100644
--- a/recommendation/microsoft.owin.json
+++ b/recommendation/microsoft.owin.json
@@ -84,7 +84,55 @@
"ARM32",
"ARM64"
]
+ }
+ ],
+ "Description": "Add a reference to Microsoft.AspNetCore.Owin and remove Microsoft.Owin and Owin.",
+ "Actions": [
+ {
+ "Name": "AddPackage",
+ "Type": "Package",
+ "Value": {
+ "Name": "Microsoft.AspNetCore.Owin",
+ "Version": "5.0.12"
+ },
+ "Description": "Add package Microsoft.AspNetCore.Owin"
+ },
+ {
+ "Name": "AddDirective",
+ "Type": "Using",
+ "Value": "Microsoft.AspNetCore.Owin",
+ "Description": "Add Microsoft.AspNetCore.Owin namespace",
+ "ActionValidation": {
+ "Contains": "using Microsoft.AspNetCore.Owin;",
+ "NotContains": ""
+ }
+ },
+ {
+ "Name": "RemoveDirective",
+ "Type": "Using",
+ "Value": "Microsoft.Owin",
+ "Description": "Remove Microsoft.Owin namespace",
+ "ActionValidation": {
+ "Contains": "",
+ "NotContains": "using Microsoft.Owin;"
+ }
},
+ {
+ "Name": "RemoveDirective",
+ "Type": "Using",
+ "Value": "Owin",
+ "Description": "Remove Owin namespace",
+ "ActionValidation": {
+ "Contains": "",
+ "NotContains": "using Owin;"
+ }
+ }
+ ]
+ },
+ {
+ "Source": "Amazon",
+ "Preferred": "Yes",
+ "TargetFrameworks": [
{
"Name": "net6.0",
"TargetCPU": [
@@ -100,10 +148,7 @@
{
"Name": "AddPackage",
"Type": "Package",
- "Value": {
- "Name": "Microsoft.AspNetCore.Owin",
- "Version": "5.0.12"
- },
+ "Value": "Microsoft.AspNetCore.Owin",
"Description": "Add package Microsoft.AspNetCore.Owin"
},
{
@@ -658,12 +703,15 @@
{
"Name": "AddComment",
"Type": "Method",
- "Value": "Please replace Get with TryGetValue.",
+ "Value": {
+ "comment": "Please replace Get with TryGetValue.",
+ "dontUseCTAPrefix": ""
+ },
"Description": "Add a comment to explain how to replace IOwinContext.Request.Headers.Get with TryGetValue instead.",
"ActionValidation": {
- "Contains": "Please replace Get with TryGetValue.",
- "NotContains": "",
- "CheckComments": "True"
+ "Contains": "Please replace Get with TryGetValue.",
+ "NotContains": "",
+ "CheckComments": "True"
}
}
]
@@ -714,12 +762,15 @@
{
"Name": "AddComment",
"Type": "Method",
- "Value": "Please replace Get with Items. Such as (Casting_Type)context.Items[\"String_To_Search_For\"];",
+ "Value": {
+ "comment": "Please replace Get with Items. Such as (Casting_Type)context.Items[\"String_To_Search_For\"];",
+ "dontUseCTAPrefix": ""
+ },
"Description": "Add a comment to explain how to replace IOwinContext.Get with HttpContext.Items instead.",
"ActionValidation": {
- "Contains": "Please replace Get with Items. Such as (Casting_Type)context.Items[\"String_To_Search_For\"];",
- "NotContains": "",
- "CheckComments": "True"
+ "Contains": "Please replace Get with Items. Such as (Casting_Type)context.Items[\"String_To_Search_For\"];",
+ "NotContains": "",
+ "CheckComments": "True"
}
}
]
@@ -1020,7 +1071,10 @@
{
"Name": "AddComment",
"Type": "ObjectCreation",
- "Value": "This method only takes a single parameter for the value of the new query string or none at all.",
+ "Value": {
+ "comment": "This method only take a single parameter for the value of the new query string or none at all.",
+ "dontUseCTAPrefix": ""
+ },
"Description": "Add a comment to explain how to set the new parameters for QueryString.",
"ActionValidation": {
"Contains": "This method only take a single parameter for the value of the new query string or none at all.",
diff --git a/recommendation/microsoft.owin.security.datahandler.encoder.json b/recommendation/microsoft.owin.security.datahandler.encoder.json
index d938fa0..34b790f 100644
--- a/recommendation/microsoft.owin.security.datahandler.encoder.json
+++ b/recommendation/microsoft.owin.security.datahandler.encoder.json
@@ -107,7 +107,10 @@
{
"Name": "AddComment",
"Type": "Method",
- "Value": "Please replace the ITextEncoder with its appropriate class either Microsoft.AspNetCore.WebUtilities.Base64UrlTextEncoder to encode and decode URLs or System.Text.Encoding for general encoding needs.",
+ "Value": {
+ "comment": "Please replace the ITextEncoder with its appropriate class either Microsoft.AspNetCore.WebUtilities.Base64UrlTextEncoder to encode and decode URLs or System.Text.Encoding for general encoding needs.",
+ "dontUseCTAPrefix": ""
+ },
"Description": "Add a comment to explain how to replace the ITextEncoder.Encode method.",
"ActionValidation": {
"Contains": "Please replace the ITextEncoder with its appropriate class either Microsoft.AspNetCore.WebUtilities.Base64UrlTextEncoder to encode and decode URLs or System.Text.Encoding for general encoding needs.",
@@ -163,7 +166,10 @@
{
"Name": "AddComment",
"Type": "Method",
- "Value": "Please replace the ITextEncoder with its appropriate class either Microsoft.AspNetCore.WebUtilities.Base64UrlTextEncoder to encode and decode URLs or System.Text.Encoding for general encoding needs.",
+ "Value": {
+ "comment": "Please replace the ITextEncoder with its appropriate class either Microsoft.AspNetCore.WebUtilities.Base64UrlTextEncoder to encode and decode URLs or System.Text.Encoding for general encoding needs.",
+ "dontUseCTAPrefix": ""
+ },
"Description": "Add a comment to explain how to replace the ITextEncoder.Decode method.",
"ActionValidation": {
"Contains": "Please replace the ITextEncoder with its appropriate class either Microsoft.AspNetCore.WebUtilities.Base64UrlTextEncoder to encode and decode URLs or System.Text.Encoding for general encoding needs.",
diff --git a/recommendation/microsoft.owin.security.datahandler.json b/recommendation/microsoft.owin.security.datahandler.json
index 708ff23..fb9f72a 100644
--- a/recommendation/microsoft.owin.security.datahandler.json
+++ b/recommendation/microsoft.owin.security.datahandler.json
@@ -117,7 +117,10 @@
{
"Name": "AddComment",
"Type": "Method",
- "Value": "Please replace the ITextEncoder with its appropriate class either Microsoft.AspNetCore.WebUtilities.Base64UrlTextEncoder to encode and decode URLs or System.Text.Encoding for general encoding needs.",
+ "Value": {
+ "comment": "Please replace the ITextEncoder with its appropriate class either Microsoft.AspNetCore.WebUtilities.Base64UrlTextEncoder to encode and decode URLs or System.Text.Encoding for general encoding needs.",
+ "dontUseCTAPrefix": ""
+ },
"Description": "Add a comment to explain how to replace the ITextEncoder.Encode method.",
"ActionValidation": {
"Contains": "Please replace the ITextEncoder with its appropriate class either Microsoft.AspNetCore.WebUtilities.Base64UrlTextEncoder to encode and decode URLs or System.Text.Encoding for general encoding needs.",
@@ -183,7 +186,10 @@
{
"Name": "AddComment",
"Type": "Method",
- "Value": "Please replace the ITextEncoder with its appropriate class either Microsoft.AspNetCore.WebUtilities.Base64UrlTextEncoder to encode and decode URLs or System.Text.Encoding for general encoding needs.",
+ "Value": {
+ "comment": "Please replace the ITextEncoder with its appropriate class either Microsoft.AspNetCore.WebUtilities.Base64UrlTextEncoder to encode and decode URLs or System.Text.Encoding for general encoding needs.",
+ "dontUseCTAPrefix": ""
+ },
"Description": "Add a comment to explain how to replace the ITextEncoder.Decode method.",
"ActionValidation": {
"Contains": "Please replace the ITextEncoder with its appropriate class either Microsoft.AspNetCore.WebUtilities.Base64UrlTextEncoder to encode and decode URLs or System.Text.Encoding for general encoding needs.",
diff --git a/recommendation/microsoft.owin.security.dataprotection.json b/recommendation/microsoft.owin.security.dataprotection.json
index 07e9d9d..4fff9ec 100644
--- a/recommendation/microsoft.owin.security.dataprotection.json
+++ b/recommendation/microsoft.owin.security.dataprotection.json
@@ -175,7 +175,10 @@
{
"Name": "AddComment",
"Type": "ObjectCreation",
- "Value": "DpapiDataProtectionProvider should be replaced with a Dependency injection for the IDataProtectionProvider interface. Please include a parameter with this interface to replace this class.",
+ "Value": {
+ "comment": "DpapiDataProtectionProvider should be replaced with a Dependency injection for the IDataProtectionProvider interface. Please include a parameter with this interface to replace this class.",
+ "dontUseCTAPrefix": ""
+ },
"Description": "Add a comment to explain how to replace DpapiDataProtectionProvider in .net core with IDataProtectionProvider.",
"ActionValidation": {
"Contains": "DpapiDataProtectionProvider should be replaced with a Dependency injection for the IDataProtectionProvider interface. Please include a parameter with this interface to replace this class.",
diff --git a/recommendation/microsoft.owin.security.infrastructure.json b/recommendation/microsoft.owin.security.infrastructure.json
index 849e322..52edb9a 100644
--- a/recommendation/microsoft.owin.security.infrastructure.json
+++ b/recommendation/microsoft.owin.security.infrastructure.json
@@ -247,7 +247,10 @@
{
"Name": "AddComment",
"Type": "Method",
- "Value": "Please add a new parameter as the new method requires Microsoft.AspNetCore.Authentication.AuthenticationTicket to be passed in. The new return type is also a byte[].",
+ "Value": {
+ "comment": "Please add a new parameter as the new method requires Microsoft.AspNetCore.Authentication.AuthenticationTicket to be passed in. The new return type is also a byte[].",
+ "dontUseCTAPrefix": ""
+ },
"Description": "Add a comment to explain how to replace the SerializeTicket invocation.",
"ActionValidation": {
"Contains": "Please add a new parameter as the new method requires Microsoft.AspNetCore.Authentication.AuthenticationTicket to be passed in. The new return type is also a byte[].",
@@ -316,7 +319,10 @@
{
"Name": "AddComment",
"Type": "Method",
- "Value": "Please change the parameter type from string to a byte[]. This is also the data type returned by the TicketSerializer.Serialize method. This new method also returns the actual Microsoft.AspNetCore.Authentication.AuthenticationTicket object serialized with the TicketSerializer.Serialize method.",
+ "Value": {
+ "comment": "Please change the parameter type from string to a byte[]. This is also the data type returned by the TicketSerializer.Serialize method.",
+ "dontUseCTAPrefix": ""
+ },
"Description": "Add a comment to explain how to replace the DeserializeTicket invocation.",
"ActionValidation": {
"Contains": "Please change the parameter type from string to a byte[]. This is also the data type returned by the TicketSerializer.Serialize method.",
@@ -385,7 +391,10 @@
{
"Name": "AddComment",
"Type": "Method",
- "Value": "Please use instead the methods of the TicketSerializer class: WriteIdentity, WriteClaim, Write for AuthenticationTicket or the ReadIdentity, ReadClaim, Read for AuthenticationTicket.",
+ "Value": {
+ "comment": "Please use instead the methods of the TicketSerializer class: WriteIdentity, WriteClaim, Write for AuthenticationTicket or the ReadIdentity, ReadClaim, Read for AuthenticationTicket.",
+ "dontUseCTAPrefix": ""
+ },
"Description": "Add a comment to explain how to replace the SetToken invocation.",
"ActionValidation": {
"Contains": "Please use instead the methods of the TicketSerializer class: WriteIdentity, WriteClaim, Write for AuthenticationTicket or the ReadIdentity, ReadClaim, Read for AuthenticationTicket.",
@@ -441,7 +450,10 @@
{
"Name": "AddComment",
"Type": "Method",
- "Value": "Please use UseAuthentication() in your Configure method in your Startup class and in your ConfigureServices method in your Startup class use AddAuthentication to set all your various options and middleware as needed.",
+ "Value": {
+ "comment": "Please use UseAuthentication() in your Configure method in your Startup class and in your ConfigureServices method in your Startup class use AddAuthentication to set all your various options and middleware as needed.",
+ "dontUseCTAPrefix": ""
+ },
"Description": "Add a comment to explain how to replace the LookupChallenge invocation.",
"ActionValidation": {
"Contains": "Please use UseAuthentication() in your Configure method in your Startup class and in your ConfigureServices method in your Startup class use AddAuthentication to set all your various options and middleware as needed.",
diff --git a/recommendation/microsoft.owin.security.json b/recommendation/microsoft.owin.security.json
index 68216b3..3ce4945 100644
--- a/recommendation/microsoft.owin.security.json
+++ b/recommendation/microsoft.owin.security.json
@@ -267,7 +267,10 @@
{
"Name": "AddComment",
"Type": "Method",
- "Value": "This method does not take a list of string as a parameter, it can only accept a single scheme or no parameters.",
+ "Value": {
+ "comment": "This method does not take a list of string as a parameter, it can only accept a single scheme or no parameters.",
+ "dontUseCTAPrefix": ""
+ },
"Description": "Add a comment to explain how to use the parameters for the ChallengeAsync api.",
"ActionValidation": {
"Contains": "Please use your AuthenticationProperties object with this AuthenticateAsync api.",
@@ -347,7 +350,10 @@
{
"Name": "AddComment",
"Type": "Method",
- "Value": "Please use your AuthenticationProperties object with this ChallengeAsync api if needed. You can also include a scheme.",
+ "Value": {
+ "comment": "Please use your AuthenticationProperties object with this ChallengeAsync api if needed. You can also include a scheme.",
+ "dontUseCTAPrefix": ""
+ },
"Description": "Add a comment to explain how to use the parameters for the ChallengeAsync api.",
"ActionValidation": {
"Contains": "Please use your AuthenticationProperties object with this ChallengeAsync api if needed. You can also include a scheme.",
@@ -437,7 +443,10 @@
{
"Name": "AddComment",
"Type": "Method",
- "Value": "Please use your AuthenticationProperties object with this ChallengeAsync api if needed. You can also include a scheme.",
+ "Value": {
+ "comment": "Please use your AuthenticationProperties object with this ChallengeAsync api if needed. You can also include a scheme.",
+ "dontUseCTAPrefix": ""
+ },
"Description": "Add a comment to explain how to use the parameters for the ChallengeAsync api.",
"ActionValidation": {
"Contains": "Please use your AuthenticationProperties object with this ChallengeAsync api if needed. You can also include a scheme.",
@@ -503,7 +512,10 @@
{
"Name": "AddComment",
"Type": "Method",
- "Value": "This method is now deprecated and most authentication methods can be accessed directly from the HttpContext class through their Microsoft.AspNetCore.Authentication namespace extension.",
+ "Value": {
+ "comment": "This method is now deprecated and most authentication methods can be accessed directly from the HttpContext class through their Microsoft.AspNetCore.Authentication namespace extension.",
+ "dontUseCTAPrefix": ""
+ },
"Description": "Add a comment to explain this method has been deprecated.",
"ActionValidation": {
"Contains": "This method is now deprecated and most authentication methods can be accessed directly from the HttpContext class through their Microsoft.AspNetCore.Authentication namespace extension.",
@@ -582,7 +594,10 @@
{
"Name": "AddComment",
"Type": "Method",
- "Value": "Please use a ClaimsPrincipal object to wrap your list of ClaimsIdentity to pass it to this method as a parameter, you can also include a scheme and an AuthenticationProperties object as well.",
+ "Value": {
+ "comment": "Please use a ClaimsPrincipal object to wrap your list of ClaimsIdentity to pass it to this method as a parameter, you can also include a scheme and an AuthenticationProperties object as well.",
+ "dontUseCTAPrefix": ""
+ },
"Description": "Add a comment to explain how to use the parameters for the SignInAsync api.",
"ActionValidation": {
"Contains": "Please use a ClaimsPrincipal object to wrap your list of ClaimsIdentity to pass it to this method as a parameter, you can also include a scheme and an AuthenticationProperties object as well.",
@@ -671,7 +686,10 @@
{
"Name": "AddComment",
"Type": "Method",
- "Value": "Please use a ClaimsPrincipal object to wrap your list of ClaimsIdentity to pass it to this method as a parameter, you can also include a scheme and an AuthenticationProperties object as well.",
+ "Value": {
+ "comment": "Please use a ClaimsPrincipal object to wrap your list of ClaimsIdentity to pass it to this method as a parameter, you can also include a scheme and an AuthenticationProperties object as well.",
+ "dontUseCTAPrefix": ""
+ },
"Description": "Add a comment to explain how to use the parameters for the SignInAsync api.",
"ActionValidation": {
"Contains": "Please use a ClaimsPrincipal object to wrap your list of ClaimsIdentity to pass it to this method as a parameter, you can also include a scheme and an AuthenticationProperties object as well.",
@@ -761,7 +779,10 @@
{
"Name": "AddComment",
"Type": "Method",
- "Value": "You can only pass in a single scheme as a parameter and you can also include an AuthenticationProperties object as well.",
+ "Value": {
+ "comment": "You can only pass in a single scheme as a parameter and you can also include an AuthenticationProperties object as well.",
+ "dontUseCTAPrefix": ""
+ },
"Description": "Add a comment to explain how to use the parameters for the SignOutAsync api.",
"ActionValidation": {
"Contains": "You can only pass in a single scheme as a parameter and you can also include an AuthenticationProperties object as well.",
@@ -851,7 +872,10 @@
{
"Name": "AddComment",
"Type": "Method",
- "Value": "You can only pass in a single scheme as a parameter and you can also include an AuthenticationProperties object as well.",
+ "Value": {
+ "comment": "You can only pass in a single scheme as a parameter and you can also include an AuthenticationProperties object as well.",
+ "dontUseCTAPrefix": ""
+ },
"Description": "Add a comment to explain how to use the parameters for the SignOutAsync api.",
"ActionValidation": {
"Contains": "You can only pass in a single scheme as a parameter and you can also include an AuthenticationProperties object as well.",
@@ -982,7 +1006,10 @@
{
"Name": "AddComment",
"Type": "ObjectCreation",
- "Value": "Please use a ClaimsPrincipal object to wrap your ClaimsIdentity parameter to pass to this method, you can optionally include an AuthenticationProperties object and must include a scheme.",
+ "Value": {
+ "comment": "Please use a ClaimsPrincipal object to wrap your ClaimsIdentity parameter to pass to this method, you can optionally include an AuthenticationProperties object and must include a scheme.",
+ "dontUseCTAPrefix": ""
+ },
"Description": "Add a comment to explain how to use the parameters for the AuthenticationTicket constructor.",
"ActionValidation": {
"Contains": "Please use a ClaimsPrincipal object to wrap your list of ClaimsIdentity to pass it to this method as a parameter, you can also include an AuthenticationProperties object and a scheme as well.",
@@ -1148,7 +1175,10 @@
{
"Name": "AddComment",
"Type": "Using",
- "Value": "OAuth is now handled by using the public void ConfigureServices(IServiceCollection services) method in the Startup.cs class. The basic process is to use services.AddAuthentication(options => and then set a series of options. We can chain unto that the actual OAuth settings call services.AddOAuth(\"Auth_Service_here_such_as_GitHub_Canvas...\", options =>. Also remember to add a call to IApplicationBuilder.UseAuthentication() in your public void Configure(IApplicationBuilder app, IHostingEnvironment env) method. Please ensure this call comes before setting up your routes.",
+ "Value": {
+ "comment": "OAuth is now handled by using the public void ConfigureServices(IServiceCollection services) method in the Startup.cs class. The basic process is to use services.AddAuthentication(options => and then set a series of options. We can chain unto that the actual OAuth settings call services.AddOAuth(\"Auth_Service_here_such_as_GitHub_Canvas...\", options =>. Also remember to add a call to IApplicationBuilder.UseAuthentication() in your public void Configure(IApplicationBuilder app, IHostingEnvironment env) method. Please ensure this call comes before setting up your routes.",
+ "dontUseCTAPrefix": ""
+ },
"Description": "Add a comment to explain how to setup OAuth in .net core.",
"ActionValidation": {
"Contains": "OAuth is now handled by using the public void ConfigureServices(IServiceCollection services) method in the Startup.cs class. The basic process is to use services.AddAuthentication(options => and then set a series of options. We can chain unto that the actual OAuth settings call services.AddOAuth(\"Auth_Service_here_such_as_GitHub_Canvas...\", options =>. Also remember to add a call to IApplicationBuilder.UseAuthentication() in your public void Configure(IApplicationBuilder app, IHostingEnvironment env) method. Please ensure this call comes before setting up your routes.",
@@ -1269,7 +1299,10 @@
{
"Name": "AddComment",
"Type": "Method",
- "Value": "You must declare a Microsoft.AspNetCore.Identity.SignInManager object and access the GetExternalLoginInfoAsync method to replace this invocation.",
+ "Value": {
+ "comment": "You must declare a Microsoft.AspNetCore.Identity.SignInManager object and access the GetExternalLoginInfoAsync method to replace this invocation.",
+ "dontUseCTAPrefix": ""
+ },
"Description": "Add a comment to explain how to use the SignInManager.GetExternalLoginInfoAsync method to replace the IAuthenticationManager.GetExternalLoginInfo invocation.",
"ActionValidation": {
"Contains": "You must declare a Microsoft.AspNetCore.Identity.SignInManager object and access the GetExternalLoginInfoAsync method to replace this invocation.",
@@ -1325,7 +1358,10 @@
{
"Name": "AddComment",
"Type": "Method",
- "Value": "You must declare a Microsoft.AspNetCore.Identity.SignInManager object and access the GetExternalLoginInfoAsync method to replace this invocation.",
+ "Value": {
+ "comment": "You must declare a Microsoft.AspNetCore.Identity.SignInManager object and access the GetExternalLoginInfoAsync method to replace this invocation.",
+ "dontUseCTAPrefix": ""
+ },
"Description": "Add a comment to explain how to use the SignInManager.GetExternalLoginInfoAsync method to replace the IAuthenticationManager.GetExternalLoginInfoAsync invocation.",
"ActionValidation": {
"Contains": "You must declare a Microsoft.AspNetCore.Identity.SignInManager object and access the GetExternalLoginInfoAsync method to replace this invocation.",
@@ -1381,7 +1417,10 @@
{
"Name": "AddComment",
"Type": "Method",
- "Value": "You must declare a Microsoft.AspNetCore.Identity.SignInManager object and access the GetExternalLoginInfoAsync method to replace this invocation.",
+ "Value": {
+ "comment": "You must declare a Microsoft.AspNetCore.Identity.SignInManager object and access the GetExternalLoginInfoAsync method to replace this invocation.",
+ "dontUseCTAPrefix": ""
+ },
"Description": "Add a comment to explain how to use the SignInManager.GetExternalLoginInfoAsync(string) method to replace the IAuthenticationManager.GetExternalLoginInfoAsync invocation.",
"ActionValidation": {
"Contains": "You must declare a Microsoft.AspNetCore.Identity.SignInManager object and access the GetExternalLoginInfoAsync method to replace this invocation.",
@@ -1437,7 +1476,10 @@
{
"Name": "AddComment",
"Type": "Method",
- "Value": "You must declare a Microsoft.AspNetCore.Identity.SignInManager object and access the GetExternalAuthenticationSchemesAsync method to replace this invocation.",
+ "Value": {
+ "comment": "You must declare a Microsoft.AspNetCore.Identity.SignInManager object and access the GetExternalAuthenticationSchemesAsync method to replace this invocation.",
+ "dontUseCTAPrefix": ""
+ },
"Description": "Add a comment to explain how to use the SignInManager.GetExternalAuthenticationSchemesAsync(string) method to replace the IAuthenticationManager.GetExternalAuthenticationTypes invocation.",
"ActionValidation": {
"Contains": "You must declare a Microsoft.AspNetCore.Identity.SignInManager object and access the GetExternalAuthenticationSchemesAsync method to replace this invocation.",
@@ -1493,7 +1535,10 @@
{
"Name": "AddComment",
"Type": "Method",
- "Value": "You must declare a Microsoft.AspNetCore.Identity.SignInManager object and access the TwoFactorBrowserRemembered(TUser) method to replace this invocation.",
+ "Value": {
+ "comment": "You must declare a Microsoft.AspNetCore.Identity.SignInManager object and access the TwoFactorBrowserRemembered(TUser) method to replace this invocation.",
+ "dontUseCTAPrefix": ""
+ },
"Description": "Add a comment to explain how to use the SignInManager.IsTwoFactorClientRememberedAsync(TUser) method to replace the IAuthenticationManager.TwoFactorBrowserRemembered invocation.",
"ActionValidation": {
"Contains": "You must declare a Microsoft.AspNetCore.Identity.SignInManager object and access the TwoFactorBrowserRemembered(TUser) method to replace this invocation.",
@@ -1549,7 +1594,10 @@
{
"Name": "AddComment",
"Type": "Method",
- "Value": "You must declare a Microsoft.AspNetCore.Identity.SignInManager object and access the TwoFactorBrowserRememberedAsync(TUser) method to replace this invocation.",
+ "Value": {
+ "comment": "You must declare a Microsoft.AspNetCore.Identity.SignInManager object and access the TwoFactorBrowserRememberedAsync(TUser) method to replace this invocation.",
+ "dontUseCTAPrefix": ""
+ },
"Description": "Add a comment to explain how to use the SignInManager.IsTwoFactorClientRememberedAsync(TUser) method to replace the IAuthenticationManager.TwoFactorBrowserRememberedAsync invocation.",
"ActionValidation": {
"Contains": "You must declare a Microsoft.AspNetCore.Identity.SignInManager object and access the TwoFactorBrowserRememberedAsync(TUser) method to replace this invocation.",
diff --git a/recommendation/microsoft.owin.security.notifications.json b/recommendation/microsoft.owin.security.notifications.json
index 7784c6a..fa131c3 100644
--- a/recommendation/microsoft.owin.security.notifications.json
+++ b/recommendation/microsoft.owin.security.notifications.json
@@ -20,16 +20,51 @@
"Preferred": "Yes",
"TargetFrameworks": [
{
- "Name": "net5.0",
+ "Name": "net6.0",
"TargetCPU": [
"x86",
"x64",
"ARM32",
"ARM64"
]
+ }
+ ],
+ "Description": "For .Net 6, add latest Microsoft.AspNetCore.Authentication.OpenIdConnect package version and remove Microsoft.Owin.Security.Notifications directive and add Microsoft.AspNetCore.Authentication.OpenIdConnect directive.",
+ "Actions": [
+ {
+ "Name": "AddDirective",
+ "Type": "Using",
+ "Value": "Microsoft.AspNetCore.Authentication.OpenIdConnect",
+ "Description": "Add Microsoft.AspNetCore.Authentication.OpenIdConnect namespace",
+ "ActionValidation": {
+ "Contains": "using Microsoft.AspNetCore.Authentication.OpenIdConnect;",
+ "NotContains": ""
+ }
},
{
- "Name": "net6.0",
+ "Name": "RemoveDirective",
+ "Type": "Using",
+ "Value": "Microsoft.Owin.Security.Notifications",
+ "Description": "Remove Microsoft.Owin.Security.Notifications namespace",
+ "ActionValidation": {
+ "Contains": "",
+ "NotContains": "using Microsoft.Owin.Security.Notifications;"
+ }
+ },
+ {
+ "Name": "AddPackage",
+ "Type": "Package",
+ "Value": "Microsoft.AspNetCore.Authentication.OpenIdConnect",
+ "Description": "Add package Microsoft.AspNetCore.Authentication.OpenIdConnect."
+ }
+ ]
+ },
+ {
+ "Source": "Amazon",
+ "Preferred": "Yes",
+ "TargetFrameworks": [
+ {
+ "Name": "net5.0",
"TargetCPU": [
"x86",
"x64",
@@ -38,7 +73,7 @@
]
}
],
- "Description": "For .Net 5 and later, add Microsoft.AspNetCore.Authentication.OpenIdConnect package version 5.0.12 and remove Microsoft.Owin.Security.Notifications directive and add Microsoft.AspNetCore.Authentication.OpenIdConnect directive.",
+ "Description": "For .Net 5, add Microsoft.AspNetCore.Authentication.OpenIdConnect package version 5.0.12 and remove Microsoft.Owin.Security.Notifications directive and add Microsoft.AspNetCore.Authentication.OpenIdConnect directive.",
"Actions": [
{
"Name": "AddDirective",
@@ -164,7 +199,10 @@
{
"Name": "AddComment",
"Type": "Method",
- "Value": "Please replace RedirectToIdentityProviderNotification with RedirectContext. The constructor for this new class takes the following parameters: new RedirectContext(HttpContext, AuthenticationScheme, OpenIdConnectOptions, AuthenticationProperties);",
+ "Value": {
+ "comment": "Please replace RedirectToIdentityProviderNotification with RedirectContext. The constructor for this new class takes the following parameters: new RedirectContext(HttpContext, AuthenticationScheme, OpenIdConnectOptions, AuthenticationProperties);",
+ "dontUseCTAPrefix": ""
+ },
"Description": "Add a comment to explain how to replace the RedirectToIdentityProviderNotification class with the RedirectContext class.",
"ActionValidation": {
"Contains": "Please replace RedirectToIdentityProviderNotification with RedirectContext. The constructor for this new class takes the following parameters: new RedirectContext(HttpContext, AuthenticationScheme, OpenIdConnectOptions, AuthenticationProperties);",
@@ -220,7 +258,10 @@
{
"Name": "AddComment",
"Type": "Method",
- "Value": "Please replace BaseNotification with a class from the Microsoft.AspNetCore.Authentication.OpenIdConnect namespace. The MessageReceivedContext class is a good candidate. Its constructor takes the following parameters: new MessageReceivedContext(HttpContext, AuthenticationScheme, OpenIdConnectOptions, AuthenticationProperties);",
+ "Value": {
+ "comment": "Please replace BaseNotification with a class from the Microsoft.AspNetCore.Authentication.OpenIdConnect namespace. The MessageReceivedContext class is a good candidate. Its constructor takes the following parameters: new MessageReceivedContext(HttpContext, AuthenticationScheme, OpenIdConnectOptions, AuthenticationProperties);",
+ "dontUseCTAPrefix": ""
+ },
"Description": "Add a comment to explain how to replace the BaseNotification class.",
"ActionValidation": {
"Contains": "Please replace BaseNotification with a class from the Microsoft.AspNetCore.Authentication.OpenIdConnect namespace. The MessageReceivedContext class is a good candidate. Its constructor takes the following parameters: new MessageReceivedContext(HttpContext, AuthenticationScheme, OpenIdConnectOptions, AuthenticationProperties);",
diff --git a/recommendation/microsoft.owin.security.openidconnect.json b/recommendation/microsoft.owin.security.openidconnect.json
index 66aee8d..ca55034 100644
--- a/recommendation/microsoft.owin.security.openidconnect.json
+++ b/recommendation/microsoft.owin.security.openidconnect.json
@@ -20,16 +20,51 @@
"Preferred": "Yes",
"TargetFrameworks": [
{
- "Name": "net5.0",
+ "Name": "net6.0",
"TargetCPU": [
"x86",
"x64",
"ARM32",
"ARM64"
]
+ }
+ ],
+ "Description": "For .Net 6, add latest Microsoft.AspNetCore.Authentication.OpenIdConnect package version",
+ "Actions": [
+ {
+ "Name": "AddDirective",
+ "Type": "Using",
+ "Value": "Microsoft.AspNetCore.Authentication.OpenIdConnect",
+ "Description": "Add Microsoft.AspNetCore.Authentication.OpenIdConnect namespace",
+ "ActionValidation": {
+ "Contains": "using Microsoft.AspNetCore.Authentication.OpenIdConnect;",
+ "NotContains": ""
+ }
},
{
- "Name": "net6.0",
+ "Name": "RemoveDirective",
+ "Type": "Using",
+ "Value": "Microsoft.Owin.Security.OpenIdConnect",
+ "Description": "Remove Microsoft.Owin.Security.OpenIdConnect namespace",
+ "ActionValidation": {
+ "Contains": "",
+ "NotContains": "using Microsoft.Owin.Security.OpenIdConnect;"
+ }
+ },
+ {
+ "Name": "AddPackage",
+ "Type": "Package",
+ "Value": "Microsoft.AspNetCore.Authentication.OpenIdConnect",
+ "Description": "Add package Microsoft.AspNetCore.Authentication.OpenIdConnect."
+ }
+ ]
+ },
+ {
+ "Source": "Amazon",
+ "Preferred": "Yes",
+ "TargetFrameworks": [
+ {
+ "Name": "net5.0",
"TargetCPU": [
"x86",
"x64",
@@ -38,7 +73,7 @@
]
}
],
- "Description": "For .Net 5 and later, add Microsoft.AspNetCore.Authentication.OpenIdConnect package version 5.0.12",
+ "Description": "For .Net 5, add Microsoft.AspNetCore.Authentication.OpenIdConnect package version 5.0.12",
"Actions": [
{
"Name": "AddDirective",
diff --git a/recommendation/microsoft.owin.staticfiles.json b/recommendation/microsoft.owin.staticfiles.json
index 6e37452..81dd1f6 100644
--- a/recommendation/microsoft.owin.staticfiles.json
+++ b/recommendation/microsoft.owin.staticfiles.json
@@ -176,7 +176,10 @@
{
"Name": "AddComment",
"Type": "ObjectCreation",
- "Value": "For FileServerOptions, if FileSystem was not present before FileProvider was added, please initialize this new value. Using the value from RequestPath with System.IO.Directory.GetCurrentDirectory() as a prefix may be a good starting point.",
+ "Value": {
+ "comment": "For FileServerOptions, if FileSystem was not present before FileProvider was added, please initialize this new value.",
+ "dontUseCTAPrefix": ""
+ },
"Description": "Add a comment to explain how to initialize FileProvider correctly for FileServerOptions.",
"ActionValidation": {
"Contains": "For FileServerOptions, if FileSystem was not present before FileProvider was added, please initialize this new value.",
@@ -259,7 +262,10 @@
{
"Name": "AddComment",
"Type": "ObjectCreation",
- "Value": "For DirectoryBrowserOptions, if FileSystem was not present before FileProvider was added, please initialize this new value. Using the value from RequestPath with System.IO.Directory.GetCurrentDirectory() as a prefix may be a good starting point.",
+ "Value": {
+ "comment": "For DirectoryBrowserOptions, if FileSystem was not present before FileProvider was added, please initialize this new value.",
+ "dontUseCTAPrefix": ""
+ },
"Description": "Add a comment to explain how to initialize FileProvider correctly for DirectoryBrowserOptions.",
"ActionValidation": {
"Contains": "For DirectoryBrowserOptions, if FileSystem was not present before FileProvider was added, please initialize this new value.",
diff --git a/recommendation/owin.json b/recommendation/owin.json
index 55a57b8..3a3d670 100644
--- a/recommendation/owin.json
+++ b/recommendation/owin.json
@@ -147,7 +147,10 @@
{
"Name": "AddComment",
"Type": "Method",
- "Value": "Invoke being the function you wanted to call in your lambda function.",
+ "Value": {
+ "comment": "Invoke being the function you wanted to call in your lambda function.",
+ "dontUseCTAPrefix": ""
+ },
"Description": "Add a comment to explain how to migrate Owin.IAppBuilder.Use(object, params object[]) to UseOwin.",
"ActionValidation": {
"Contains": "Invoke being the function you wanted to call in your lambda function.",
@@ -275,7 +278,10 @@
{
"Name": "AddComment",
"Type": "Method",
- "Value": "Please add a new ConfigureServices method: public void ConfigureServices(IServiceCollection services) { services.AddControllers(); }",
+ "Value": {
+ "comment": "Please add a new ConfigureServices method: public void ConfigureServices(IServiceCollection services) { services.AddControllers(); }",
+ "dontUseCTAPrefix": ""
+ },
"Description": "Add a comment on adding a new configureservices method.",
"ActionValidation": {
"Contains": "Please add a new ConfigureServices method: public void ConfigureServices(IServiceCollection services) { services.AddControllers(); }",
@@ -411,7 +417,10 @@
{
"Name": "AddComment",
"Type": "Method",
- "Value": "Please add a new ConfigureServices method: public void ConfigureServices(IServiceCollection services) { services.AddSignalR(); }",
+ "Value": {
+ "comment": "Please add a new ConfigureServices method: public void ConfigureServices(IServiceCollection services) { services.AddSignalR(); }",
+ "dontUseCTAPrefix": ""
+ },
"Description": "Add a comment on adding a new configureservices method.",
"ActionValidation": {
"Contains": "Please add a new ConfigureServices method: public void ConfigureServices(IServiceCollection services) { services.AddSignalR(); }",
@@ -535,7 +544,10 @@
{
"Name": "AddComment",
"Type": "Method",
- "Value": "Please add a new ConfigureServices method: public void ConfigureServices(IServiceCollection services) { services.AddDirectoryBrowser(); }",
+ "Value": {
+ "comment": "Please add a new ConfigureServices method: public void ConfigureServices(IServiceCollection services) { services.AddDirectoryBrowser(); }",
+ "dontUseCTAPrefix": ""
+ },
"Description": "Add a comment on adding a new configureservices method.",
"ActionValidation": {
"Contains": "Please add a new ConfigureServices method: public void ConfigureServices(IServiceCollection services) { services.AddDirectoryBrowser(); }",
@@ -601,7 +613,10 @@
{
"Name": "AddComment",
"Type": "Method",
- "Value": "Please replace CreatePerOwinContext(System.Func) and add a new ConfigureServices method: public void ConfigureServices(IServiceCollection services) { Register your service here instead of using CreatePerOwinContext }. For example, app.CreatePerOwinContext(ApplicationDbContext.Create); would become: services.AddDbContext(options => options.UseSqlServer(config.GetConnectionString(\"DefaultConnection\"))); ",
+ "Value": {
+ "comment": "Please replace CreatePerOwinContext(System.Func) and add a new ConfigureServices method: public void ConfigureServices(IServiceCollection services) { Register your service here instead of using CreatePerOwinContext }. For example, app.CreatePerOwinContext(ApplicationDbContext.Create); would become: services.AddDbContext(options => options.UseSqlServer(config.GetConnectionString(\"DefaultConnection\"))); ",
+ "dontUseCTAPrefix": ""
+ },
"Description": "Add a comment to explain how to replace CreatePerOwinContext(System.Func) with a service in ConfigureServices method.",
"ActionValidation": {
"Contains": "Please replace CreatePerOwinContext(System.Func) and add a new ConfigureServices method: public void ConfigureServices(IServiceCollection services) { Register your service here instead of using CreatePerOwinContext }.",
@@ -667,7 +682,10 @@
{
"Name": "AddComment",
"Type": "Method",
- "Value": "Please replace CreatePerOwinContext(System.Func, Microsoft.Owin.IOwinContext, T>) and add a new ConfigureServices method: public void ConfigureServices(IServiceCollection services) { Register your service here instead of using CreatePerOwinContext }. For example, app.CreatePerOwinContext(ApplicationDbContext.Create); would become: services.AddDbContext(options => options.UseSqlServer(config.GetConnectionString(\"DefaultConnection\"))); ",
+ "Value": {
+ "comment": "Please replace CreatePerOwinContext(System.Func, Microsoft.Owin.IOwinContext, T>) and add a new ConfigureServices method: public void ConfigureServices(IServiceCollection services) { Register your service here instead of using CreatePerOwinContext }. For example, app.CreatePerOwinContext(ApplicationDbContext.Create); would become: services.AddDbContext(options => options.UseSqlServer(config.GetConnectionString(\"DefaultConnection\"))); ",
+ "dontUseCTAPrefix": ""
+ },
"Description": "Add a comment to explain how to replace CreatePerOwinContext(System.Func, Microsoft.Owin.IOwinContext, T>) with a service in ConfigureServices method.",
"ActionValidation": {
"Contains": "Please replace CreatePerOwinContext(System.Func, Microsoft.Owin.IOwinContext, T>) and add a new ConfigureServices method: public void ConfigureServices(IServiceCollection services) { Register your service here instead of using CreatePerOwinContext }.",
@@ -733,7 +751,10 @@
{
"Name": "AddComment",
"Type": "Method",
- "Value": "Please replace CreatePerOwinContext(System.Func, Microsoft.Owin.IOwinContext, T>, System.Action, T>) and add a new ConfigureServices method: public void ConfigureServices(IServiceCollection services) { Register your service here instead of using CreatePerOwinContext }. For example, app.CreatePerOwinContext(ApplicationDbContext.Create); would become: services.AddDbContext(options => options.UseSqlServer(config.GetConnectionString(\"DefaultConnection\"))); ",
+ "Value": {
+ "comment": "Please replace CreatePerOwinContext(System.Func, Microsoft.Owin.IOwinContext, T>, System.Action, T>) and add a new ConfigureServices method: public void ConfigureServices(IServiceCollection services) { Register your service here instead of using CreatePerOwinContext }. For example, app.CreatePerOwinContext(ApplicationDbContext.Create); would become: services.AddDbContext(options => options.UseSqlServer(config.GetConnectionString(\"DefaultConnection\"))); ",
+ "dontUseCTAPrefix": ""
+ },
"Description": "Add a comment to explain how to replace CreatePerOwinContext(System.Func, Microsoft.Owin.IOwinContext, T>, System.Action, T>) with a service in ConfigureServices method.",
"ActionValidation": {
"Contains": "Please replace CreatePerOwinContext(System.Func, Microsoft.Owin.IOwinContext, T>, System.Action, T>) and add a new ConfigureServices method: public void ConfigureServices(IServiceCollection services) { Register your service here instead of using CreatePerOwinContext }.",
@@ -757,16 +778,79 @@
"Preferred": "Yes",
"TargetFrameworks": [
{
- "Name": "net5.0",
+ "Name": "net6.0",
"TargetCPU": [
"x86",
"x64",
"ARM32",
"ARM64"
]
+ }
+ ],
+ "Description": "Replace the UseOpenIdConnectAuthentication(string, string) with UseAuthentication and add a comment to explain how to add services.AddAuthentication().AddOpenIdConnect().",
+ "Actions": [
+ {
+ "Name": "ReplaceMethodAndParameters",
+ "Type": "Method",
+ "Value": {
+ "oldMethod": "UseOpenIdConnectAuthentication",
+ "newMethod": "UseAuthentication",
+ "newParameters": "()"
+ },
+ "Description": "Replace the OwinMiddleware Next variable with a newly declared one _next.",
+ "ActionValidation": {
+ "Contains": "UseAuthentication()",
+ "NotContains": ""
+ }
},
{
- "Name": "net6.0",
+ "Name": "AddComment",
+ "Type": "Method",
+ "Value": {
+ "comment": "Please add services.AddAuthentication().AddOpenIdConnect(); inside of your public void ConfigureServices(IServiceCollection services) method. You can also optionally add your OpenIdConnectOptions.",
+ "dontUseCTAPrefix": ""
+ },
+ "Description": "Add a comment to explain how to add a reference to services.AddAuthentication().AddOpenIdConnect()",
+ "ActionValidation": {
+ "Contains": "Please add services.AddAuthentication().AddOpenIdConnect(); inside of your public void ConfigureServices(IServiceCollection services) method. You can also optionally add your OpenIdConnectOptions.",
+ "NotContains": "",
+ "CheckComments": "True"
+ }
+ },
+ {
+ "Name": "AddPackage",
+ "Type": "Package",
+ "Value": "Microsoft.AspNetCore.Authentication.OpenIdConnect",
+ "Description": "Add package Microsoft.AspNetCore.Authentication.OpenIdConnect"
+ },
+ {
+ "Name": "AddDirective",
+ "Type": "Using",
+ "Value": "Microsoft.AspNetCore.Authentication.OpenIdConnect",
+ "Description": "Add Microsoft.AspNetCore.Authentication.OpenIdConnect",
+ "ActionValidation": {
+ "Contains": "using Microsoft.AspNetCore.Authentication.OpenIdConnect;",
+ "NotContains": ""
+ }
+ },
+ {
+ "Name": "RemoveDirective",
+ "Type": "Using",
+ "Value": "Microsoft.Owin.Security.OpenIdConnect",
+ "Description": "Remove Microsoft.Owin.Security.OpenIdConnect",
+ "ActionValidation": {
+ "Contains": "",
+ "NotContains": "using Microsoft.Owin.Security.OpenIdConnect;"
+ }
+ }
+ ]
+ },
+ {
+ "Source": "Amazon",
+ "Preferred": "Yes",
+ "TargetFrameworks": [
+ {
+ "Name": "net5.0",
"TargetCPU": [
"x86",
"x64",
@@ -794,7 +878,10 @@
{
"Name": "AddComment",
"Type": "Method",
- "Value": "Please add services.AddAuthentication().AddOpenIdConnect(); inside of your public void ConfigureServices(IServiceCollection services) method. You can also optionally add your OpenIdConnectOptions.",
+ "Value": {
+ "comment": "Please add services.AddAuthentication().AddOpenIdConnect(); inside of your public void ConfigureServices(IServiceCollection services) method. You can also optionally add your OpenIdConnectOptions.",
+ "dontUseCTAPrefix": ""
+ },
"Description": "Add a comment to explain how to add a reference to services.AddAuthentication().AddOpenIdConnect()",
"ActionValidation": {
"Contains": "Please add services.AddAuthentication().AddOpenIdConnect(); inside of your public void ConfigureServices(IServiceCollection services) method. You can also optionally add your OpenIdConnectOptions.",
@@ -866,7 +953,10 @@
{
"Name": "AddComment",
"Type": "Method",
- "Value": "Please add services.AddAuthentication().AddOpenIdConnect(); inside of your public void ConfigureServices(IServiceCollection services) method. You can also optionally add your OpenIdConnectOptions.",
+ "Value": {
+ "comment": "Please add services.AddAuthentication().AddOpenIdConnect(); inside of your public void ConfigureServices(IServiceCollection services) method. You can also optionally add your OpenIdConnectOptions.",
+ "dontUseCTAPrefix": ""
+ },
"Description": "Add a comment to explain how to add a reference to services.AddAuthentication().AddOpenIdConnect()",
"ActionValidation": {
"Contains": "Please add services.AddAuthentication().AddOpenIdConnect(); inside of your public void ConfigureServices(IServiceCollection services) method. You can also optionally add your OpenIdConnectOptions.",
@@ -919,16 +1009,79 @@
"Preferred": "Yes",
"TargetFrameworks": [
{
- "Name": "net5.0",
+ "Name": "net6.0",
"TargetCPU": [
"x86",
"x64",
"ARM32",
"ARM64"
]
+ }
+ ],
+ "Description": "Replace the UseOpenIdConnectAuthentication(string, string) with UseAuthentication and add a comment to explain how to add services.AddAuthentication().AddOpenIdConnect().",
+ "Actions": [
+ {
+ "Name": "ReplaceMethodAndParameters",
+ "Type": "Method",
+ "Value": {
+ "oldMethod": "UseOpenIdConnectAuthentication",
+ "newMethod": "UseAuthentication",
+ "newParameters": "()"
+ },
+ "Description": "Replace the OwinMiddleware Next variable with a newly declared one _next.",
+ "ActionValidation": {
+ "Contains": "UseAuthentication()",
+ "NotContains": ""
+ }
},
{
- "Name": "net6.0",
+ "Name": "AddComment",
+ "Type": "Method",
+ "Value": {
+ "comment": "Please add services.AddAuthentication().AddOpenIdConnect(); inside of your public void ConfigureServices(IServiceCollection services) method. You can also optionally add your OpenIdConnectOptions.",
+ "dontUseCTAPrefix": ""
+ },
+ "Description": "Add a comment to explain how to add a reference to services.AddAuthentication().AddOpenIdConnect()",
+ "ActionValidation": {
+ "Contains": "Please add services.AddAuthentication().AddOpenIdConnect(); inside of your public void ConfigureServices(IServiceCollection services) method. You can also optionally add your OpenIdConnectOptions.",
+ "NotContains": "",
+ "CheckComments": "True"
+ }
+ },
+ {
+ "Name": "AddPackage",
+ "Type": "Package",
+ "Value": "Microsoft.AspNetCore.Authentication.OpenIdConnect",
+ "Description": "Add package Microsoft.AspNetCore.Authentication.OpenIdConnect"
+ },
+ {
+ "Name": "AddDirective",
+ "Type": "Using",
+ "Value": "Microsoft.AspNetCore.Authentication.OpenIdConnect",
+ "Description": "Add Microsoft.AspNetCore.Authentication.OpenIdConnect",
+ "ActionValidation": {
+ "Contains": "using Microsoft.AspNetCore.Authentication.OpenIdConnect;",
+ "NotContains": ""
+ }
+ },
+ {
+ "Name": "RemoveDirective",
+ "Type": "Using",
+ "Value": "Microsoft.Owin.Security.OpenIdConnect",
+ "Description": "Remove Microsoft.Owin.Security.OpenIdConnect",
+ "ActionValidation": {
+ "Contains": "",
+ "NotContains": "using Microsoft.Owin.Security.OpenIdConnect;"
+ }
+ }
+ ]
+ },
+ {
+ "Source": "Amazon",
+ "Preferred": "Yes",
+ "TargetFrameworks": [
+ {
+ "Name": "net5.0",
"TargetCPU": [
"x86",
"x64",
@@ -956,7 +1109,10 @@
{
"Name": "AddComment",
"Type": "Method",
- "Value": "Please add services.AddAuthentication().AddOpenIdConnect(); inside of your public void ConfigureServices(IServiceCollection services) method. You can also optionally add your OpenIdConnectOptions.",
+ "Value": {
+ "comment": "Please add services.AddAuthentication().AddOpenIdConnect(); inside of your public void ConfigureServices(IServiceCollection services) method. You can also optionally add your OpenIdConnectOptions.",
+ "dontUseCTAPrefix": ""
+ },
"Description": "Add a comment to explain how to add a reference to services.AddAuthentication().AddOpenIdConnect()",
"ActionValidation": {
"Contains": "Please add services.AddAuthentication().AddOpenIdConnect(); inside of your public void ConfigureServices(IServiceCollection services) method. You can also optionally add your OpenIdConnectOptions.",
@@ -1028,7 +1184,10 @@
{
"Name": "AddComment",
"Type": "Method",
- "Value": "Please add services.AddAuthentication().AddOpenIdConnect(); inside of your public void ConfigureServices(IServiceCollection services) method. You can also optionally add your OpenIdConnectOptions.",
+ "Value": {
+ "comment": "Please add services.AddAuthentication().AddOpenIdConnect(); inside of your public void ConfigureServices(IServiceCollection services) method. You can also optionally add your OpenIdConnectOptions.",
+ "dontUseCTAPrefix": ""
+ },
"Description": "Add a comment to explain how to add a reference to services.AddAuthentication().AddOpenIdConnect()",
"ActionValidation": {
"Contains": "Please add services.AddAuthentication().AddOpenIdConnect(); inside of your public void ConfigureServices(IServiceCollection services) method. You can also optionally add your OpenIdConnectOptions.",
@@ -1081,16 +1240,55 @@
"Preferred": "Yes",
"TargetFrameworks": [
{
- "Name": "net5.0",
+ "Name": "net6.0",
"TargetCPU": [
"x86",
"x64",
"ARM32",
"ARM64"
]
+ }
+ ],
+ "Description": "For .Net 6, add latest Microsoft.AspNetCore.Authentication.Google package version and add a comment to explain how to add google authentication.",
+ "Actions": [
+ {
+ "Name": "AddComment",
+ "Type": "Method",
+ "Value": {
+ "comment": "Please add IApplicationBuilder.UseAuthentication() in your configure method. Within your public void ConfigureServices(IServiceCollection services) method please add services.AddAuthentication().AddGoogle(options => { IConfigurationSection googleAuthNSection = Configuration.GetSection(\"Authentication:Google\"); options.ClientId = googleAuthNSection[\"ClientId\"]; options.ClientSecret = googleAuthNSection[\"ClientSecret\"]; } );",
+ "dontUseCTAPrefix": ""
+ },
+ "Description": "Add a comment to explain how to add google authentication.",
+ "ActionValidation": {
+ "Contains": "Please add IApplicationBuilder.UseAuthentication() in your configure method. Within your public void ConfigureServices(IServiceCollection services) method please add services.AddAuthentication().AddGoogle(options => { IConfigurationSection googleAuthNSection = Configuration.GetSection(\"Authentication:Google\"); options.ClientId = googleAuthNSection[\"ClientId\"]; options.ClientSecret = googleAuthNSection[\"ClientSecret\"]; } );",
+ "NotContains": "",
+ "CheckComments": "True"
+ }
},
{
- "Name": "net6.0",
+ "Name": "AddPackage",
+ "Type": "Package",
+ "Value": "Microsoft.AspNetCore.Authentication.Google",
+ "Description": "Add package Microsoft.AspNetCore.Authentication.Google"
+ },
+ {
+ "Name": "RemoveDirective",
+ "Type": "Using",
+ "Value": "Microsoft.Owin.Security.Google",
+ "Description": "Remove Microsoft.Owin.Security.Google",
+ "ActionValidation": {
+ "Contains": "",
+ "NotContains": "using Microsoft.Owin.Security.Google;"
+ }
+ }
+ ]
+ },
+ {
+ "Source": "Amazon",
+ "Preferred": "Yes",
+ "TargetFrameworks": [
+ {
+ "Name": "net5.0",
"TargetCPU": [
"x86",
"x64",
@@ -1099,12 +1297,15 @@
]
}
],
- "Description": "For .Net 5 and later, add Microsoft.AspNetCore.Authentication.Google package version 5.0.12 and add a comment to explain how to add google authentication.",
+ "Description": "For .Net 5, add Microsoft.AspNetCore.Authentication.Google package version 5.0.12 and add a comment to explain how to add google authentication.",
"Actions": [
{
"Name": "AddComment",
"Type": "Method",
- "Value": "Please add IApplicationBuilder.UseAuthentication() in your configure method. Within your public void ConfigureServices(IServiceCollection services) method please add services.AddAuthentication().AddGoogle(options => { IConfigurationSection googleAuthNSection = Configuration.GetSection(\"Authentication:Google\"); options.ClientId = googleAuthNSection[\"ClientId\"]; options.ClientSecret = googleAuthNSection[\"ClientSecret\"]; } );",
+ "Value": {
+ "comment": "Please add IApplicationBuilder.UseAuthentication() in your configure method. Within your public void ConfigureServices(IServiceCollection services) method please add services.AddAuthentication().AddGoogle(options => { IConfigurationSection googleAuthNSection = Configuration.GetSection(\"Authentication:Google\"); options.ClientId = googleAuthNSection[\"ClientId\"]; options.ClientSecret = googleAuthNSection[\"ClientSecret\"]; } );",
+ "dontUseCTAPrefix": ""
+ },
"Description": "Add a comment to explain how to add google authentication.",
"ActionValidation": {
"Contains": "Please add IApplicationBuilder.UseAuthentication() in your configure method. Within your public void ConfigureServices(IServiceCollection services) method please add services.AddAuthentication().AddGoogle(options => { IConfigurationSection googleAuthNSection = Configuration.GetSection(\"Authentication:Google\"); options.ClientId = googleAuthNSection[\"ClientId\"]; options.ClientSecret = googleAuthNSection[\"ClientSecret\"]; } );",
@@ -1152,7 +1353,10 @@
{
"Name": "AddComment",
"Type": "Method",
- "Value": "Please add IApplicationBuilder.UseAuthentication() in your configure method. Within your public void ConfigureServices(IServiceCollection services) method please add services.AddAuthentication().AddGoogle(options => { IConfigurationSection googleAuthNSection = Configuration.GetSection(\"Authentication:Google\"); options.ClientId = googleAuthNSection[\"ClientId\"]; options.ClientSecret = googleAuthNSection[\"ClientSecret\"]; } );",
+ "Value": {
+ "comment": "Please add IApplicationBuilder.UseAuthentication() in your configure method. Within your public void ConfigureServices(IServiceCollection services) method please add services.AddAuthentication().AddGoogle(options => { IConfigurationSection googleAuthNSection = Configuration.GetSection(\"Authentication:Google\"); options.ClientId = googleAuthNSection[\"ClientId\"]; options.ClientSecret = googleAuthNSection[\"ClientSecret\"]; } );",
+ "dontUseCTAPrefix": ""
+ },
"Description": "Add a comment to explain how to add google authentication.",
"ActionValidation": {
"Contains": "Please add IApplicationBuilder.UseAuthentication() in your configure method. Within your public void ConfigureServices(IServiceCollection services) method please add services.AddAuthentication().AddGoogle(options => { IConfigurationSection googleAuthNSection = Configuration.GetSection(\"Authentication:Google\"); options.ClientId = googleAuthNSection[\"ClientId\"]; options.ClientSecret = googleAuthNSection[\"ClientSecret\"]; } );",
diff --git a/recommendation/system.data.entity.json b/recommendation/system.data.entity.json
index 9dc2eb1..0c9ffb7 100644
--- a/recommendation/system.data.entity.json
+++ b/recommendation/system.data.entity.json
@@ -56,7 +56,7 @@
]
}
],
- "Description": "Replace System.Data.Entity namespace with Microsoft.EntityFrameworkCore. Also, package Microsoft.EntityFrameworkCore will be added.",
+ "Description": "Add package Microsoft.EntityFrameworkCore. Replace System.Data.Entity namespace with Microsoft.EntityFrameworkCore.",
"Actions": [
{
"Name": "AddPackage",
@@ -88,6 +88,50 @@
}
}
]
+ },
+ {
+ "Source": "Amazon",
+ "Preferred": "Yes",
+ "TargetFrameworks": [
+ {
+ "Name": "net6.0",
+ "TargetCPU": [
+ "x86",
+ "x64",
+ "ARM32",
+ "ARM64"
+ ]
+ }
+ ],
+ "Description": "Add package Microsoft.EntityFrameworkCore. Replace System.Data.Entity namespace with Microsoft.EntityFrameworkCore.",
+ "Actions": [
+ {
+ "Name": "AddPackage",
+ "Type": "Package",
+ "Value": "Microsoft.EntityFrameworkCore",
+ "Description": "Add reference to Microsoft.EntityFrameworkCore."
+ },
+ {
+ "Name": "AddDirective",
+ "Type": "Using",
+ "Value": "Microsoft.EntityFrameworkCore",
+ "Description": "Add Microsoft.EntityFrameworkCore namespace.",
+ "ActionValidation": {
+ "Contains": "using Microsoft.EntityFrameworkCore;",
+ "NotContains": ""
+ }
+ },
+ {
+ "Name": "RemoveDirective",
+ "Type": "Using",
+ "Value": "System.Data.Entity",
+ "Description": "Remove System.Data.Entity namespace.",
+ "ActionValidation": {
+ "Contains": "",
+ "NotContains": "using System.Data.Entity;"
+ }
+ }
+ ]
}
]
},
diff --git a/recommendation/system.linq.dynamic.json b/recommendation/system.linq.dynamic.json
new file mode 100644
index 0000000..5b71f4a
--- /dev/null
+++ b/recommendation/system.linq.dynamic.json
@@ -0,0 +1,82 @@
+{
+ "Name": "System.Linq.Dynamic",
+ "Version": "1.0.0",
+ "Packages": [
+ {
+ "Type": "Nuget"
+ }
+ ],
+ "Recommendations": [
+ {
+ "Type": "Namespace",
+ "Name": "System.Linq.Dynamic",
+ "Value": "System.Linq.Dynamic",
+ "KeyType": "Name",
+ "ContainingType": "",
+ "RecommendedActions": [
+ {
+ "Source": "Amazon",
+ "Preferred": "Yes",
+ "TargetFrameworks": [
+ {
+ "Name": "netcoreapp3.1",
+ "TargetCPU": [
+ "x86",
+ "x64",
+ "ARM32",
+ "ARM64"
+ ]
+ },
+ {
+ "Name": "net5.0",
+ "TargetCPU": [
+ "x86",
+ "x64",
+ "ARM32",
+ "ARM64"
+ ]
+ },
+ {
+ "Name": "net6.0",
+ "TargetCPU": [
+ "x86",
+ "x64",
+ "ARM32",
+ "ARM64"
+ ]
+ }
+ ],
+ "Description": "Add a reference to System.Linq.Dynamic.Core",
+ "Actions": [
+ {
+ "Name": "AddPackage",
+ "Type": "Package",
+ "Value": "System.Linq.Dynamic.Core",
+ "Description": "Add package System.Linq.Dynamic.Core"
+ },
+ {
+ "Name": "AddDirective",
+ "Type": "Using",
+ "Value": "System.Linq.Dynamic.Core",
+ "Description": "Add System.Linq.Dynamic.Core namespace.",
+ "ActionValidation": {
+ "Contains": "using System.Linq.Dynamic.Core;",
+ "NotContains": ""
+ }
+ },
+ {
+ "Name": "RemoveDirective",
+ "Type": "Using",
+ "Value": "System.Linq.Dynamic",
+ "Description": "Remove System.Linq.Dynamic namespace.",
+ "ActionValidation": {
+ "Contains": "",
+ "NotContains": "using System.Linq.Dynamic;"
+ }
+ }
+ ]
+ }
+ ]
+ }
+ ]
+}
\ No newline at end of file
diff --git a/recommendation/system.runtime.caching.json b/recommendation/system.runtime.caching.json
index 3d68a71..017d121 100644
--- a/recommendation/system.runtime.caching.json
+++ b/recommendation/system.runtime.caching.json
@@ -45,7 +45,25 @@
"ARM32",
"ARM64"
]
- },
+ }
+ ],
+ "Description": "Add System.Runtime.Caching package",
+ "Actions": [
+ {
+ "Name": "AddPackage",
+ "Type": "Package",
+ "Value": {
+ "Name": "System.Runtime.Caching",
+ "Version": "5.0.0"
+ },
+ "Description": "Add System.Runtime.Caching package"
+ }
+ ]
+ },
+ {
+ "Source": "Amazon",
+ "Preferred": "Yes",
+ "TargetFrameworks": [
{
"Name": "net6.0",
"TargetCPU": [
@@ -61,10 +79,7 @@
{
"Name": "AddPackage",
"Type": "Package",
- "Value": {
- "Name": "System.Runtime.Caching",
- "Version": "5.0.0"
- },
+ "Value": "System.Runtime.Caching",
"Description": "Add System.Runtime.Caching package"
}
]
diff --git a/recommendation/system.web.http.json b/recommendation/system.web.http.json
index 60c5e71..ae938a5 100644
--- a/recommendation/system.web.http.json
+++ b/recommendation/system.web.http.json
@@ -52,7 +52,10 @@
{
"Name": "AddComment",
"Type": "AttributeList",
- "Value": "RoutePrefix attribute is no longer supported",
+ "Value": {
+ "comment": "RoutePrefix attribute is no longer supported",
+ "dontUseCTAPrefix": ""
+ },
"Description": "RoutePrefix attribute is no longer supported",
"ActionValidation": {
"Contains": "RoutePrefix attribute is no longer supported",
diff --git a/recommendation/system.web.json b/recommendation/system.web.json
index d74a8b5..a02985b 100644
--- a/recommendation/system.web.json
+++ b/recommendation/system.web.json
@@ -62,7 +62,10 @@
{
"Name": "AddComment",
"Type": "Method",
- "Value": "In this context, this is a Controller object",
+ "Value": {
+ "comment": "In this context, this is a Controller object",
+ "dontUseCTAPrefix": ""
+ },
"Description": "Add a comment to explain what \"this\" refers to.",
"ActionValidation": {
"Contains": "In this context, this is a Controller object",
@@ -213,6 +216,320 @@
]
}
]
+ },
+ {
+ "Type": "Class",
+ "Name": "IHttpHandler",
+ "Value": "System.Web.IHttpHandler",
+ "KeyType": "BaseClass",
+ "ContainingType": "",
+ "RecommendedActions": [
+ {
+ "Source": "Amazon",
+ "Preferred": "Yes",
+ "TargetFrameworks": [
+ {
+ "Name": "netcoreapp3.1",
+ "TargetCPU": [ "x86", "x64", "ARM32", "ARM64" ]
+ },
+ {
+ "Name": "net5.0",
+ "TargetCPU": [ "x86", "x64", "ARM32", "ARM64" ]
+ },
+ {
+ "Name": "net6.0",
+ "TargetCPU": [ "x86", "x64", "ARM32", "ARM64" ]
+ }
+ ],
+ "Description": "Remove IHttpHandler in namespace System.Web and replace HttpContext in namespace Microsoft.AspNetCore.Http.",
+ "Actions": [
+ {
+ "Name": "RemoveDirective",
+ "Type": "Using",
+ "Value": "System.Web",
+ "Description": "Remove System.Web namespace.",
+ "ActionValidation": {
+ "Contains": "",
+ "NotContains": "using System.Web;"
+ }
+ },
+ {
+ "Name": "AddDirective",
+ "Type": "Using",
+ "Value": "Microsoft.AspNetCore.Http",
+ "Description": "Add Microsoft.AspNetCore.Http namespace.",
+ "ActionValidation": {
+ "Contains": "using Microsoft.AspNetCore.Http;",
+ "NotContains": ""
+ }
+ },
+ {
+ "Name": "AddDirective",
+ "Type": "Using",
+ "Value": "System.Threading.Tasks",
+ "Description": "Add System.Threading.Tasks namespace",
+ "ActionValidation": {
+ "Contains": "using System.Threading.Tasks;",
+ "NotContains": ""
+ }
+ },
+ {
+ "Name": "RemoveBaseClass",
+ "Type": "Class",
+ "Value": "IHttpHandler",
+ "Description": "Remove the base class IHttpHandler",
+ "ActionValidation": {
+ "Contains": "",
+ "NotContains": ":IHttpHandler"
+ }
+ },
+ {
+ "Name": "AddExpression",
+ "Type": "Class",
+ "Value": "RequestDelegate _next = null;",
+ "Description": "Add a new global variable to replace the OwinMiddleware global abstract variable of Next.",
+ "ActionValidation": {
+ "Contains": "RequestDelegate_next = null;",
+ "NotContains": ""
+ }
+ },
+ {
+ "Name": "CreateConstructor",
+ "Type": "Class",
+ "Value": {
+ "types": "RequestDelegate",
+ "identifiers": "next"
+ },
+ "Description": "Create a new constructor"
+ },
+ {
+ "Name": "ChangeMethodName",
+ "Type": "Class",
+ "Value": {
+ "existingMethodName": "ProcessRequest",
+ "newMethodName": "Invoke"
+ },
+ "Description": "Replace method name",
+ "ActionValidation": {
+ "Contains": "Invoke",
+ "NotContains": ""
+ }
+ },
+ {
+ "Name": "ReplaceMethodModifiers",
+ "Type": "Class",
+ "Value": {
+ "methodName": "Invoke",
+ "modifiers": "public async"
+ },
+ "Description": "Replace all the invoke method modifiers with only public in order to remove the override modifier.",
+ "ActionValidation": {
+ "Contains": "public async",
+ "NotContains": ""
+ }
+ },
+ {
+ "Name": "ChangeMethodToReturnTaskType",
+ "Type": "Class",
+ "Value": "Invoke",
+ "Description": "Replace method return type to Task type",
+ "ActionValidation": {
+ "Contains": "Task",
+ "NotContains": ""
+ }
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "Type": "Class",
+ "Name": "IHttpModule",
+ "Value": "System.Web.IHttpModule",
+ "KeyType": "BaseClass",
+ "ContainingType": "",
+ "RecommendedActions": [
+ {
+ "Source": "Amazon",
+ "Preferred": "Yes",
+ "TargetFrameworks": [
+ {
+ "Name": "netcoreapp3.1",
+ "TargetCPU": [ "x86", "x64", "ARM32", "ARM64" ]
+ },
+ {
+ "Name": "net5.0",
+ "TargetCPU": [ "x86", "x64", "ARM32", "ARM64" ]
+ },
+ {
+ "Name": "net6.0",
+ "TargetCPU": [ "x86", "x64", "ARM32", "ARM64" ]
+ }
+ ],
+ "Description": "Remove IHttpHandler in namespace System.Web and replace HttpContext in namespace Microsoft.AspNetCore.Http.",
+ "Actions": [
+ {
+ "Name": "RemoveDirective",
+ "Type": "Using",
+ "Value": "System.Web",
+ "Description": "Remove System.Web namespace.",
+ "ActionValidation": {
+ "Contains": "",
+ "NotContains": "using System.Web;"
+ }
+ },
+ {
+ "Name": "AddDirective",
+ "Type": "Using",
+ "Value": "Microsoft.AspNetCore.Http",
+ "Description": "Add Microsoft.AspNetCore.Http namespace.",
+ "ActionValidation": {
+ "Contains": "using Microsoft.AspNetCore.Http;",
+ "NotContains": ""
+ }
+ },
+ {
+ "Name": "AddDirective",
+ "Type": "Using",
+ "Value": "System.Threading.Tasks",
+ "Description": "Add System.Threading.Tasks namespace",
+ "ActionValidation": {
+ "Contains": "using System.Threading.Tasks;",
+ "NotContains": ""
+ }
+ },
+ {
+ "Name": "RemoveBaseClass",
+ "Type": "Class",
+ "Value": "IHttpModule",
+ "Description": "Remove the base class IHttpModule",
+ "ActionValidation": {
+ "Contains": "",
+ "NotContains": ":IHttpModule"
+ }
+ },
+ {
+ "Name": "CreateConstructor",
+ "Type": "Class",
+ "Value": {
+ "types": "RequestDelegate",
+ "identifiers": "next"
+ },
+ "Description": "Create a new constructor"
+ },
+ {
+ "Name": "AppendConstructorExpression",
+ "Type": "Class",
+ "Value": "_next = next;",
+ "Description": "Add a new expression in the constructor to initialize the new variable of _next to the next element in the pipeline.",
+ "ActionValidation": {
+ "Contains": "_next = next;",
+ "NotContains": ""
+ }
+ },
+ {
+ "Name": "AddExpression",
+ "Type": "Class",
+ "Value": "RequestDelegate _next = null;",
+ "Description": "Add a new global variable to replace the OwinMiddleware global abstract variable of Next.",
+ "ActionValidation": {
+ "Contains": "RequestDelegate_next = null;",
+ "NotContains": ""
+ }
+ },
+ {
+ "Name": "RemoveMethodParameters",
+ "Type": "Class",
+ "Value": "Application_BeginRequest",
+ "Description": "Remove parameters from the method"
+ },
+ {
+ "Name": "ChangeMethodName",
+ "Type": "Class",
+ "Value": {
+ "existingMethodName": "Application_BeginRequest",
+ "newMethodName": "Invoke"
+ },
+ "Description": "Replace method name.",
+ "ActionValidation": {
+ "Contains": "Invoke",
+ "NotContains": ""
+ }
+ },
+ {
+ "Name": "ReplaceMethodModifiers",
+ "Type": "Class",
+ "Value": {
+ "methodName": "Invoke",
+ "modifiers": "public async"
+ },
+ "Description": "Replace all the invoke method modifiers with only public in order to remove the override modifier.",
+ "ActionValidation": {
+ "Contains": "public async",
+ "NotContains": ""
+ }
+ },
+ {
+ "Name": "AddParametersToMethod",
+ "Type": "Class",
+ "Value": {
+ "methodName": "Invoke",
+ "types": "HttpContext",
+ "identifiers": "context"
+ },
+ "Description": "Adding parameters to the method.",
+ "ActionValidation": {
+ "Contains": "HttpContext",
+ "NotContains": ""
+ }
+ },
+ {
+ "Name": "AddExpressionToMethod",
+ "Type": "Class",
+ "Value": {
+ "methodName": "Invoke",
+ "expression": "await _next.Invoke(context);"
+ },
+ "Description": "Adding expression to the method.",
+ "ActionValidation": {
+ "Contains": "await _next.Invoke(context);",
+ "NotContains": ""
+ }
+ },
+ {
+ "Name": "ChangeMethodToReturnTaskType",
+ "Type": "Class",
+ "Value": "Invoke",
+ "Description": "Replace method return type to Task type",
+ "ActionValidation": {
+ "Contains": "Task",
+ "NotContains": ""
+ }
+ },
+ {
+ "Name": "CommentMethod",
+ "Type": "Class",
+ "Value": {
+ "methodName": "Init",
+ "comment": "This method is used to register events.",
+ "dontUseCTAPrefix": ""
+ },
+ "Description": "Commenting out method which have to be ported manually."
+ },
+ {
+ "Name": "CommentMethod",
+ "Type": "Class",
+ "Value": {
+ "comment": "Create a seperate middleware module with the logic in this method and inject the middleware in the correponding location in request pipeline (startup.cs).",
+ "methodName": "Application_EndRequest",
+ "dontUseCTAPrefix": ""
+ },
+ "Description": "Commenting out method which have to be ported manually."
+ }
+ ]
+ }
+ ]
}
]
-}
\ No newline at end of file
+}
+
diff --git a/recommendation/system.web.mvc.json b/recommendation/system.web.mvc.json
index daed9f1..cc56833 100644
--- a/recommendation/system.web.mvc.json
+++ b/recommendation/system.web.mvc.json
@@ -117,7 +117,10 @@
{
"Name": "AddComment",
"Type": "AttributeList",
- "Value": "This attribute is not available anymore. An alternative is using ViewComponents:\nSample:\n\npublic class SampleViewComponent : ViewComponent\n {\n private readonly InjectedService _injectedService;\n\n public SampleViewComponent (InjectedService injectedService)\n {\n _injectedService = injectedService;\n }\n\n\n public IViewComponentResult Invoke(int parameter)\n {\n var object = _injectedService.SampleFunction(parameter);\n // No name is specified, returns the view SampleView (same name as component)\n return View(object);\n }\n }\n\nThen use this to call the view component from any view:\n\n @await Component.InvokeAsync(\"SampleView\", new { parameter = \"\"})\n\nhttps://docs.microsoft.com/en-us/aspnet/core/mvc/views/view-components?view=aspnetcore-3.1",
+ "Value": {
+ "comment": "This attribute is not available anymore. An alternative is using ViewComponents:\nSample:\n\npublic class SampleViewComponent : ViewComponent\n {\n private readonly InjectedService _injectedService;\n\n public SampleViewComponent (InjectedService injectedService)\n {\n _injectedService = injectedService;\n }\n\n\n public IViewComponentResult Invoke(int parameter)\n {\n var object = _injectedService.SampleFunction(parameter);\n // No name is specified, returns the view SampleView (same name as component)\n return View(object);\n }\n }\n\nThen use this to call the view component from any view:\n\n @await Component.InvokeAsync(\"SampleView\", new { parameter = \"\"})\n\nhttps://docs.microsoft.com/en-us/aspnet/core/mvc/views/view-components?view=aspnetcore-3.1",
+ "dontUseCTAPrefix": ""
+ },
"Description": "ChildActionOnly attribute is not available anymore.",
"ActionValidation": {
"Contains": "ViewComponents:",
@@ -808,7 +811,10 @@
{
"Name": "AddComment",
"Type": "Method",
- "Value": "This method is not supported. Use the startup class to register dependency containers",
+ "Value": {
+ "comment": "This method is not supported. Use the startup class to register dependency containers",
+ "dontUseCTAPrefix": ""
+ },
"Description": "Use the startup class to register dependency containers",
"ActionValidation": {
"Contains": "This method is not supported. Use the startup class to register dependency containers",
@@ -897,7 +903,10 @@
{
"Name": "AddComment",
"Type": "Method",
- "Value": "This updated method might require the parameters to be re-organized",
+ "Value": {
+ "comment": "This updated method might require the parameters to be re-organized",
+ "dontUseCTAPrefix": ""
+ },
"Description": "Add a comment to inform the user to reorganize the parameters",
"ActionValidation": {
"Contains": "This updated method might require the parameters to be re-organized",
@@ -986,7 +995,10 @@
{
"Name": "AddComment",
"Type": "Method",
- "Value": "This updated method might require the parameters to be re-organized",
+ "Value": {
+ "comment": "This updated method might require the parameters to be re-organized",
+ "dontUseCTAPrefix": ""
+ },
"Description": "Add a comment to inform the user to reorganize the parameters",
"ActionValidation": {
"Contains": "This updated method might require the parameters to be re-organized",