diff --git a/README.md b/README.md index 2d0aaf2..870430e 100644 --- a/README.md +++ b/README.md @@ -302,7 +302,7 @@ Then configure the request validation: A couple of notes about the configuration: - `Twilio:RequestValidation:AuthToken` falls back on `Twilio:AuthToken`. You only need to configure one of them. -- `AllowLocal` will skip validation when the HTTP request originated from localhost. +- `AllowLocal` will skip validation when the HTTP request originated from localhost. ⚠️ Only use this during development, as this will make your application vulnerable to Server-Side Request Forgery. - Use `BaseUrlOverride` in case your app is behind a reverse proxy or a tunnel like ngrok. The path of the current request will be appended to the `BaseUrlOverride` for request validation. You can also manually configure the request validation: diff --git a/src/Twilio.AspNet.Core/Twilio.AspNet.Core.csproj b/src/Twilio.AspNet.Core/Twilio.AspNet.Core.csproj index 80d5a98..096627f 100644 --- a/src/Twilio.AspNet.Core/Twilio.AspNet.Core.csproj +++ b/src/Twilio.AspNet.Core/Twilio.AspNet.Core.csproj @@ -1,6 +1,6 @@  - netstandard2.0;net5.0;net6.0;net7.0 + net6.0;net7.0 Library 0.0.0-alpha Twilio.AspNet.Core @@ -21,45 +21,31 @@ true true snupkg - $([MSBuild]::IsTargetFrameworkCompatible($(TargetFramework), 'netstandard2.0')) - $([MSBuild]::IsTargetFrameworkCompatible($(TargetFramework), 'net5.0')) - $([MSBuild]::IsTargetFrameworkCompatible($(TargetFramework), 'net6.0')) $([MSBuild]::IsTargetFrameworkCompatible($(TargetFramework), 'net7.0')) true - + + + + + + all runtime; build; native; contentfiles; analyzers; buildtransitive + <_Parameter1>Twilio.AspNet.Core.UnitTests - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/src/Twilio.AspNet.Mvc.UnitTests/Twilio.AspNet.Mvc.UnitTests.csproj b/src/Twilio.AspNet.Mvc.UnitTests/Twilio.AspNet.Mvc.UnitTests.csproj index fbfef2a..ae889b3 100644 --- a/src/Twilio.AspNet.Mvc.UnitTests/Twilio.AspNet.Mvc.UnitTests.csproj +++ b/src/Twilio.AspNet.Mvc.UnitTests/Twilio.AspNet.Mvc.UnitTests.csproj @@ -1,49 +1,46 @@  - - Library - net471 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - all - runtime; build; native; contentfiles; analyzers; buildtransitive - - - all - runtime; build; native; contentfiles; analyzers; buildtransitive - - + + Library + net471 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + all + runtime; build; native; contentfiles; analyzers; buildtransitive + + + all + runtime; build; native; contentfiles; analyzers; buildtransitive + + \ No newline at end of file diff --git a/src/Twilio.AspNet.Mvc.UnitTests/app.config b/src/Twilio.AspNet.Mvc.UnitTests/app.config index faf17fc..dc12e25 100644 --- a/src/Twilio.AspNet.Mvc.UnitTests/app.config +++ b/src/Twilio.AspNet.Mvc.UnitTests/app.config @@ -2,18 +2,6 @@ - - - - - - - - - - - - \ No newline at end of file diff --git a/src/Twilio.AspNet.Mvc/RequestValidationHelper.cs b/src/Twilio.AspNet.Mvc/RequestValidationHelper.cs index 5ded448..577bf5a 100644 --- a/src/Twilio.AspNet.Mvc/RequestValidationHelper.cs +++ b/src/Twilio.AspNet.Mvc/RequestValidationHelper.cs @@ -5,11 +5,11 @@ namespace Twilio.AspNet.Mvc { - /// - /// Class used to validate incoming requests from Twilio using 'Request Validation' as described - /// in the Security section of the Twilio TwiML API documentation. - /// - public static class RequestValidationHelper + /// + /// Class used to validate incoming requests from Twilio using 'Request Validation' as described + /// in the Security section of the Twilio TwiML API documentation. + /// + public static class RequestValidationHelper { /// /// Performs request validation using the current HTTP context passed in manually or from @@ -21,10 +21,8 @@ public static class RequestValidationHelper /// Skip validation for local requests. /// ⚠️ Only use this during development, as this will make your application vulnerable to Server-Side Request Forgery. /// - public static bool IsValidRequest(HttpContextBase context, string authToken, bool allowLocal = false) - { - return IsValidRequest(context, authToken, null, allowLocal); - } + public static bool IsValidRequest(HttpContextBase context, string authToken, bool allowLocal = false) + => IsValidRequest(context, authToken, null, allowLocal); /// /// Performs request validation using the current HTTP context passed in manually or from diff --git a/src/Twilio.AspNet.Mvc/Twilio.AspNet.Mvc.csproj b/src/Twilio.AspNet.Mvc/Twilio.AspNet.Mvc.csproj index be89545..d025e4b 100644 --- a/src/Twilio.AspNet.Mvc/Twilio.AspNet.Mvc.csproj +++ b/src/Twilio.AspNet.Mvc/Twilio.AspNet.Mvc.csproj @@ -1,69 +1,68 @@ - - Library - net462 - 0.0.0-alpha - Twilio.AspNet.Mvc - 0.0.0-alpha - Twilio Labs - Twilio helper library for ASP.NET MVC on .NET Framework. - false - Refer to the changelog at https://github.com/twilio-labs/twilio-aspnet/blob/main/CHANGELOG.md - Copyright 2022 (c) Twilio, Inc. All rights reserved. - twilio;twiml;sms;voice;telephony;phone;aspnet - Apache-2.0 - https://github.com/twilio-labs/twilio-aspnet - https://github.com/twilio-labs/twilio-aspnet.git - https://s3.amazonaws.com/com.twilio.prod.twilio-docs/images/twilio-icon-64x64.png - icon.png - README.md - true - true - true - snupkg - - - true - - - - - - ..\..\..\..\..\..\..\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.7.1\System.Configuration.dll - - - - - - - - - - - - - - - - - - - - - - - all - runtime; build; native; contentfiles; analyzers; buildtransitive - - - - all - - - - - <_Parameter1>Twilio.AspNet.Mvc.UnitTests - - + + Library + net462 + 0.0.0-alpha + Twilio.AspNet.Mvc + 0.0.0-alpha + Twilio Labs + Twilio helper library for ASP.NET MVC on .NET Framework. + false + Refer to the changelog at https://github.com/twilio-labs/twilio-aspnet/blob/main/CHANGELOG.md + Copyright 2022 (c) Twilio, Inc. All rights reserved. + twilio;twiml;sms;voice;telephony;phone;aspnet + Apache-2.0 + https://github.com/twilio-labs/twilio-aspnet + https://github.com/twilio-labs/twilio-aspnet.git + https://s3.amazonaws.com/com.twilio.prod.twilio-docs/images/twilio-icon-64x64.png + icon.png + README.md + true + true + true + snupkg + + + true + + + + + + ..\..\..\..\..\..\..\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.7.1\System.Configuration.dll + + + + + + + + + + + + + + + + + + + + + + all + runtime; build; native; contentfiles; analyzers; buildtransitive + + + + all + + + + + <_Parameter1>Twilio.AspNet.Mvc.UnitTests + + diff --git a/src/Twilio.AspNet.Mvc/TwilioConfiguration.cs b/src/Twilio.AspNet.Mvc/TwilioConfiguration.cs index 729820f..af4b365 100644 --- a/src/Twilio.AspNet.Mvc/TwilioConfiguration.cs +++ b/src/Twilio.AspNet.Mvc/TwilioConfiguration.cs @@ -30,9 +30,7 @@ public class TwilioSectionGroup : ConfigurationSectionGroup { [ConfigurationProperty("requestValidation", IsRequired = false)] - public RequestValidationConfigurationSection RequestValidation - { - get { return (RequestValidationConfigurationSection)Sections["requestValidation"]; } - } + public RequestValidationConfigurationSection RequestValidation + => (RequestValidationConfigurationSection)Sections["requestValidation"]; } } \ No newline at end of file diff --git a/src/Twilio.AspNet.Mvc/app.config b/src/Twilio.AspNet.Mvc/app.config deleted file mode 100644 index 96312d1..0000000 --- a/src/Twilio.AspNet.Mvc/app.config +++ /dev/null @@ -1,11 +0,0 @@ - - - - - - - - - - - diff --git a/src/testapps/AspNetFramework/App_Start/FilterConfig.cs b/src/testapps/AspNetFramework/App_Start/FilterConfig.cs index f9f3c2b..e65e360 100644 --- a/src/testapps/AspNetFramework/App_Start/FilterConfig.cs +++ b/src/testapps/AspNetFramework/App_Start/FilterConfig.cs @@ -1,5 +1,4 @@ -using System.Web; -using System.Web.Mvc; +using System.Web.Mvc; namespace AspNetFramework { diff --git a/src/testapps/AspNetFramework/App_Start/RouteConfig.cs b/src/testapps/AspNetFramework/App_Start/RouteConfig.cs index 6ca073b..2d55696 100644 --- a/src/testapps/AspNetFramework/App_Start/RouteConfig.cs +++ b/src/testapps/AspNetFramework/App_Start/RouteConfig.cs @@ -1,8 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Web; -using System.Web.Mvc; +using System.Web.Mvc; using System.Web.Routing; namespace AspNetFramework diff --git a/src/testapps/AspNetFramework/AspNetFramework.csproj b/src/testapps/AspNetFramework/AspNetFramework.csproj index ac52856..59a622a 100644 --- a/src/testapps/AspNetFramework/AspNetFramework.csproj +++ b/src/testapps/AspNetFramework/AspNetFramework.csproj @@ -1,6 +1,5 @@  - Debug @@ -45,90 +44,108 @@ 4 + + ..\packages\Microsoft.Bcl.AsyncInterfaces.7.0.0\lib\net462\Microsoft.Bcl.AsyncInterfaces.dll + + + ..\packages\Microsoft.CodeDom.Providers.DotNetCompilerPlatform.3.6.0\lib\net45\Microsoft.CodeDom.Providers.DotNetCompilerPlatform.dll + - - ..\packages\Microsoft.IdentityModel.Logging.1.1.2\lib\net451\Microsoft.IdentityModel.Logging.dll + + ..\packages\Microsoft.IdentityModel.Abstractions.6.26.0\lib\net472\Microsoft.IdentityModel.Abstractions.dll + + + ..\packages\Microsoft.IdentityModel.JsonWebTokens.6.26.0\lib\net472\Microsoft.IdentityModel.JsonWebTokens.dll + + + ..\packages\Microsoft.IdentityModel.Logging.6.26.0\lib\net472\Microsoft.IdentityModel.Logging.dll - - ..\packages\Microsoft.IdentityModel.Tokens.5.1.2\lib\net451\Microsoft.IdentityModel.Tokens.dll + + ..\packages\Microsoft.IdentityModel.Tokens.6.26.0\lib\net472\Microsoft.IdentityModel.Tokens.dll + + + ..\packages\Microsoft.Web.Infrastructure.2.0.0\lib\net40\Microsoft.Web.Infrastructure.dll + + + ..\packages\Newtonsoft.Json.13.0.2\lib\net45\Newtonsoft.Json.dll + + ..\packages\System.Buffers.4.5.1\lib\net461\System.Buffers.dll + - - ..\packages\System.IdentityModel.Tokens.Jwt.5.1.2\lib\net451\System.IdentityModel.Tokens.Jwt.dll + + ..\packages\System.IdentityModel.Tokens.Jwt.6.26.0\lib\net472\System.IdentityModel.Tokens.Jwt.dll + + + ..\packages\System.Memory.4.5.5\lib\net461\System.Memory.dll + + + ..\packages\System.Numerics.Vectors.4.5.0\lib\net46\System.Numerics.Vectors.dll + + + ..\packages\System.Runtime.CompilerServices.Unsafe.6.0.0\lib\net461\System.Runtime.CompilerServices.Unsafe.dll + + + ..\packages\System.Text.Encodings.Web.7.0.0\lib\net462\System.Text.Encodings.Web.dll + + + ..\packages\System.Text.Json.7.0.1\lib\net462\System.Text.Json.dll + + + ..\packages\System.Threading.Tasks.Extensions.4.5.4\lib\net461\System.Threading.Tasks.Extensions.dll + + + ..\packages\System.ValueTuple.4.5.0\lib\net47\System.ValueTuple.dll + - - - - - - - - - - - True - ..\packages\Microsoft.Web.Infrastructure.1.0.0.0\lib\net40\Microsoft.Web.Infrastructure.dll - - - - - - True - ..\packages\Microsoft.AspNet.WebPages.3.2.7\lib\net45\System.Web.Helpers.dll + ..\packages\Microsoft.AspNet.WebPages.3.2.9\lib\net45\System.Web.Helpers.dll - - True - ..\packages\Microsoft.AspNet.Mvc.5.2.7\lib\net45\System.Web.Mvc.dll - - - ..\packages\Microsoft.AspNet.Web.Optimization.1.1.3\lib\net40\System.Web.Optimization.dll + + ..\packages\Microsoft.AspNet.Mvc.5.2.9\lib\net45\System.Web.Mvc.dll - True - ..\packages\Microsoft.AspNet.Razor.3.2.7\lib\net45\System.Web.Razor.dll + ..\packages\Microsoft.AspNet.Razor.3.2.9\lib\net45\System.Web.Razor.dll - True - ..\packages\Microsoft.AspNet.WebPages.3.2.7\lib\net45\System.Web.WebPages.dll + ..\packages\Microsoft.AspNet.WebPages.3.2.9\lib\net45\System.Web.WebPages.dll - True - ..\packages\Microsoft.AspNet.WebPages.3.2.7\lib\net45\System.Web.WebPages.Deployment.dll + ..\packages\Microsoft.AspNet.WebPages.3.2.9\lib\net45\System.Web.WebPages.Deployment.dll - True - ..\packages\Microsoft.AspNet.WebPages.3.2.7\lib\net45\System.Web.WebPages.Razor.dll + ..\packages\Microsoft.AspNet.WebPages.3.2.9\lib\net45\System.Web.WebPages.Razor.dll - - ..\packages\Newtonsoft.Json.12.0.2\lib\net45\Newtonsoft.Json.dll + + + + + + + + + + - - ..\packages\Twilio.6.2.0\lib\net451\Twilio.dll + - - True - ..\packages\WebGrease.1.6.0\lib\WebGrease.dll + + ..\packages\Twilio.6.2.2\lib\net451\Twilio.dll True ..\packages\Antlr.3.5.0.2\lib\Antlr3.Runtime.dll - - - ..\packages\Microsoft.CodeDom.Providers.DotNetCompilerPlatform.2.0.1\lib\net45\Microsoft.CodeDom.Providers.DotNetCompilerPlatform.dll - - @@ -186,11 +203,12 @@ + This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}. - + - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/testapps/AspNetFramework/packages.config b/src/testapps/AspNetFramework/packages.config index 3e38bd3..c63e555 100644 --- a/src/testapps/AspNetFramework/packages.config +++ b/src/testapps/AspNetFramework/packages.config @@ -1,21 +1,26 @@  - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file