Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update to ASP.NET Core 9 #423

Draft
wants to merge 11 commits into
base: main
Choose a base branch
from
2 changes: 1 addition & 1 deletion .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"type": "coreclr",
"request": "launch",
"preLaunchTask": "build",
"program": "${workspaceFolder}/src/SignInWithApple/bin/Debug/net8.0/MartinCostello.SignInWithApple.dll",
"program": "${workspaceFolder}/src/SignInWithApple/bin/Debug/net9.0/MartinCostello.SignInWithApple.dll",
"args": [],
"cwd": "${workspaceFolder}/src/SignInWithApple",
"stopAtEntry": false,
Expand Down
2 changes: 1 addition & 1 deletion .vsconfig
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"components": [
"Microsoft.VisualStudio.Component.CoreEditor",
"Microsoft.VisualStudio.Workload.CoreEditor",
"Microsoft.NetCore.Component.Runtime.8.0",
"Microsoft.NetCore.Component.Runtime.9.0",
"Microsoft.NetCore.Component.SDK",
"Microsoft.VisualStudio.Component.Roslyn.Compiler",
"Microsoft.VisualStudio.Component.Roslyn.LanguageServices",
Expand Down
2 changes: 1 addition & 1 deletion Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<Company>Martin Costello</Company>
<Copyright>Martin Costello (c) $([System.DateTime]::Now.ToString(yyyy))</Copyright>
<ImplicitUsings>enable</ImplicitUsings>
<LangVersion>latest</LangVersion>
<LangVersion>preview</LangVersion>
<PackageLicenseExpression>Apache-2.0</PackageLicenseExpression>
<RepositoryType>git</RepositoryType>
<RepositoryUrl>https://github.com/martincostello/SignInWithAppleSample.git</RepositoryUrl>
Expand Down
4 changes: 4 additions & 0 deletions NuGet.config
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,13 @@
<configuration>
<packageSources>
<clear />
<add key="aspnet-contrib" value="https://www.myget.org/F/aspnet-contrib/api/v3/index.json" />
<add key="NuGet" value="https://api.nuget.org/v3/index.json" />
</packageSources>
<packageSourceMapping>
<packageSource key="aspnet-contrib">
<package pattern="AspNet.Security.OAuth.Apple" />
</packageSource>
<packageSource key="NuGet">
<package pattern="*" />
</packageSource>
Expand Down
4 changes: 0 additions & 4 deletions build.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,6 @@ param(
[Parameter(Mandatory = $false)][string] $Runtime = ""
)

if ($null -eq $env:MSBUILDTERMINALLOGGER) {
$env:MSBUILDTERMINALLOGGER = "auto"
}

$solutionPath = $PSScriptRoot
$sdkFile = Join-Path $solutionPath "global.json"

Expand Down
2 changes: 1 addition & 1 deletion global.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"sdk": {
"version": "8.0.302",
"version": "9.0.100-preview.5.24307.3",
"allowPrerelease": false
}
}
36 changes: 17 additions & 19 deletions src/SignInWithApple/SecurityHeadersMiddleware.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,25 +9,23 @@ internal sealed class SecurityHeadersMiddleware(RequestDelegate next)
{
private static readonly string ContentSecurityPolicy = string.Join(
';',
[
"default-src 'self'",
"script-src 'self' cdnjs.cloudflare.com",
"script-src-elem 'self' cdnjs.cloudflare.com",
"style-src 'self' cdnjs.cloudflare.com use.fontawesome.com",
"style-src-elem 'self' cdnjs.cloudflare.com",
"img-src 'self' data:",
"font-src 'self' cdnjs.cloudflare.com",
"connect-src 'self'",
"media-src 'none'",
"object-src 'none'",
"child-src 'none'",
"frame-ancestors 'none'",
"form-action 'self' appleid.apple.com",
"block-all-mixed-content",
"base-uri 'self'",
"manifest-src 'self'",
"upgrade-insecure-requests",
]);
"default-src 'self'",
"script-src 'self' cdnjs.cloudflare.com",
"script-src-elem 'self' cdnjs.cloudflare.com",
"style-src 'self' cdnjs.cloudflare.com use.fontawesome.com",
"style-src-elem 'self' cdnjs.cloudflare.com",
"img-src 'self' data:",
"font-src 'self' cdnjs.cloudflare.com",
"connect-src 'self'",
"media-src 'none'",
"object-src 'none'",
"child-src 'none'",
"frame-ancestors 'none'",
"form-action 'self' appleid.apple.com",
"block-all-mixed-content",
"base-uri 'self'",
"manifest-src 'self'",
"upgrade-insecure-requests");

public Task Invoke(HttpContext context)
{
Expand Down
8 changes: 4 additions & 4 deletions src/SignInWithApple/SignInWithApple.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,15 @@
<PreserveCompilationContext>true</PreserveCompilationContext>
<PublishSelfContained>true</PublishSelfContained>
<RootNamespace>MartinCostello.SignInWithApple</RootNamespace>
<TargetFramework>net8.0</TargetFramework>
<TargetFramework>net9.0</TargetFramework>
<UserSecretsId>MartinCostello.SignInWithApple</UserSecretsId>
<VersionPrefix>3.0.0</VersionPrefix>
<VersionPrefix>4.0.0</VersionPrefix>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="AspNet.Security.OAuth.Apple" Version="8.1.0" />
<PackageReference Include="AspNet.Security.OAuth.Apple" Version="9.0.0-preview.5.24311.76" />
<PackageReference Include="Azure.Extensions.AspNetCore.Configuration.Secrets" Version="1.3.1" />
<PackageReference Include="Azure.Identity" Version="1.12.0" />
<PackageReference Include="Microsoft.AspNetCore.AzureAppServices.HostingStartup" Version="8.0.6" />
<PackageReference Include="Microsoft.AspNetCore.AzureAppServices.HostingStartup" Version="9.0.0-preview.5.24306.11" />
<PackageReference Include="Microsoft.IdentityModel.Protocols.OpenIdConnect" Version="7.6.2" />
</ItemGroup>
<ItemGroup>
Expand Down
2 changes: 1 addition & 1 deletion tests/SignInWithApple.Tests/SignInWithApple.Tests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<PreserveCompilationContext>true</PreserveCompilationContext>
<RootNamespace>MartinCostello.SignInWithApple</RootNamespace>
<Summary>$(Description)</Summary>
<TargetFramework>net8.0</TargetFramework>
<TargetFramework>net9.0</TargetFramework>
</PropertyGroup>
<ItemGroup>
<Content Include="test.p8;xunit.runner.json" CopyToOutputDirectory="PreserveNewest" />
Expand Down