Skip to content

Commit

Permalink
Upgrade to .NET 8 (#74)
Browse files Browse the repository at this point in the history
  • Loading branch information
Tyrrrz authored Nov 16, 2023
1 parent 24661e9 commit 298df55
Show file tree
Hide file tree
Showing 47 changed files with 157 additions and 40 deletions.
11 changes: 0 additions & 11 deletions Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -2,25 +2,14 @@

<PropertyGroup>
<Version>2.0.0-beta4</Version>
<CurrentPreviewTfm>net8.0</CurrentPreviewTfm>
<!--<IncludePreview>true</IncludePreview>-->
<IncludePreview Condition="'$(IncludePreview)' == ''">false</IncludePreview>
</PropertyGroup>

<PropertyGroup>
<LangVersion>latest</LangVersion>
<Nullable>enable</Nullable>
<ImplicitUsings>enable</ImplicitUsings>
<WarningsAsErrors>nullable</WarningsAsErrors>
<CheckEolTargetFramework>false</CheckEolTargetFramework>
<IsPackable>false</IsPackable>
</PropertyGroup>

<ItemGroup>
<!--
The .NET Framework target doesn't seem to like this implicit using so we
have to bring it in for each file, so might as well remove it for .NET targets too.
-->
<Using Remove="System.Net.Http" />
</ItemGroup>
</Project>
1 change: 1 addition & 0 deletions Passwordless.sln
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution
README.md = README.md
LICENSE = LICENSE
favicon.png = favicon.png
global.json = global.json
EndProjectSection
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Passwordless.AspNetCore", "src\Passwordless.AspNetCore\Passwordless.AspNetCore.csproj", "{7AEFC619-81DC-45FD-B805-D31FC64AD566}"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
using Microsoft.Extensions.DependencyInjection;

namespace Passwordless.AspNetIdentity.Example.DataContext;

public static class DataContextBootstrap
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using Microsoft.EntityFrameworkCore.Migrations;
using System;
using Microsoft.EntityFrameworkCore.Migrations;

#nullable disable

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
using System.ComponentModel.DataAnnotations;
using System;
using System.ComponentModel.DataAnnotations;
using System.Threading;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.Mvc.RazorPages;
using Microsoft.Extensions.Logging;

namespace Passwordless.AspNetIdentity.Example.Pages.Account;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
using System.ComponentModel.DataAnnotations;
using System;
using System.ComponentModel.DataAnnotations;
using System.Threading;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.Mvc.RazorPages;
using Microsoft.Extensions.Logging;
using Passwordless.AspNetIdentity.Example.Validation;

namespace Passwordless.AspNetIdentity.Example.Pages.Account;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
using System.Security.Claims;
using System;
using System.Security.Claims;
using Microsoft.AspNetCore.Mvc.RazorPages;
using Microsoft.Extensions.Logging;

namespace Passwordless.AspNetIdentity.Example.Pages.Authorized;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
using System.Diagnostics;
using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.Mvc.RazorPages;
using Microsoft.Extensions.Logging;

namespace Passwordless.AspNetIdentity.Example.Pages;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using Microsoft.AspNetCore.Mvc.RazorPages;
using Microsoft.Extensions.Logging;

namespace Passwordless.AspNetIdentity.Example.Pages;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using Microsoft.AspNetCore.Mvc.RazorPages;
using Microsoft.Extensions.Logging;

namespace Passwordless.AspNetIdentity.Example.Pages;

Expand Down
3 changes: 3 additions & 0 deletions examples/Passwordless.AspNetIdentity.Example/Program.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.Identity;
using Microsoft.EntityFrameworkCore;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Hosting;
using Passwordless.AspNetCore;
using Passwordless.AspNetIdentity.Example.DataContext;

Expand Down
5 changes: 4 additions & 1 deletion examples/Passwordless.Example/PasswordlessController.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
using Microsoft.AspNetCore.Mvc;
using System;
using System.Collections.Generic;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Mvc;

namespace Passwordless.Example;

Expand Down
3 changes: 3 additions & 0 deletions examples/Passwordless.Example/Program.cs
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
using Microsoft.AspNetCore.Hosting;
using Microsoft.Extensions.Hosting;

namespace Passwordless.Example;

public class Program
Expand Down
6 changes: 6 additions & 0 deletions examples/Passwordless.Example/Startup.cs
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.Hosting;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Hosting;

namespace Passwordless.Example;

public class Startup
Expand Down
6 changes: 6 additions & 0 deletions global.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"sdk": {
"version": "8.0.100",
"rollForward": "latestMinor"
}
}
3 changes: 2 additions & 1 deletion src/Passwordless.AspNetCore/IdentityBuilderExtensions.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using System.Diagnostics.CodeAnalysis;
using System;
using System.Diagnostics.CodeAnalysis;
using Microsoft.AspNetCore.Identity;
using Microsoft.AspNetCore.Routing;
using Microsoft.Extensions.Configuration;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
using System;
using System.Security.Claims;
using System.Threading;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Routing;
Expand Down
2 changes: 2 additions & 0 deletions src/Passwordless.AspNetCore/PasswordlessRegisterOptions.cs
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
using System;

namespace Passwordless.AspNetCore;

/// <summary>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
using System.Threading;
using System.Threading.Tasks;

namespace Passwordless.AspNetCore.Services;

public interface ICustomizeRegisterOptions
Expand Down
3 changes: 3 additions & 0 deletions src/Passwordless.AspNetCore/Services/IPasswordlessService.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
using System.Collections.Generic;
using System.Security.Claims;
using System.Threading;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Http;

namespace Passwordless.AspNetCore.Services;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
using System.Threading;
using System.Threading.Tasks;

namespace Passwordless.AspNetCore.Services.Implementations;

internal sealed class NoopCustomizeRegisterOptions : ICustomizeRegisterOptions
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Security.Claims;
using System.Threading;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Authentication;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Identity;
Expand Down
3 changes: 2 additions & 1 deletion src/Passwordless/Base64Url.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using System.Buffers;
using System;
using System.Buffers;
using System.Buffers.Text;

namespace Passwordless;
Expand Down
1 change: 1 addition & 0 deletions src/Passwordless/Helpers/Base64UrlConverter.cs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
using System;
using System.Text.Json;
using System.Text.Json.Serialization;

Expand Down
3 changes: 3 additions & 0 deletions src/Passwordless/Helpers/Extensions/HttpExtensions.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
using System.IO;
using System.Net;
using System.Net.Http;
using System.Threading.Tasks;

namespace Passwordless.Helpers.Extensions;

Expand Down
1 change: 1 addition & 0 deletions src/Passwordless/Helpers/PasswordlessSerializerContext.cs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
using System.Collections.Generic;
using System.Text.Json;
using System.Text.Json.Serialization;
using Passwordless.Models;
Expand Down
5 changes: 4 additions & 1 deletion src/Passwordless/IPasswordlessClient.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
using Passwordless.Models;
using System.Collections.Generic;
using System.Threading;
using System.Threading.Tasks;
using Passwordless.Models;

namespace Passwordless;

Expand Down
4 changes: 3 additions & 1 deletion src/Passwordless/Models/Credential.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
namespace Passwordless;
using System;

namespace Passwordless;

/// <summary>
/// The passkey credential stored by Passwordless
Expand Down
2 changes: 2 additions & 0 deletions src/Passwordless/Models/ListResponse.cs
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
using System.Collections.Generic;

namespace Passwordless.Models;

internal class ListResponse<T>
Expand Down
3 changes: 3 additions & 0 deletions src/Passwordless/Models/PasswordlessUserSummary.cs
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
using System;
using System.Collections.Generic;

namespace Passwordless;

public class PasswordlessUserSummary
Expand Down
5 changes: 4 additions & 1 deletion src/Passwordless/Models/RegisterOptions.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
namespace Passwordless;
using System;
using System.Collections.Generic;

namespace Passwordless;

/// <summary>
///
Expand Down
4 changes: 4 additions & 0 deletions src/Passwordless/Models/SetAliasRequest.cs
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
using System;
using System.Collections.Generic;
using System.Linq;

namespace Passwordless.Models;

public class SetAliasRequest
Expand Down
4 changes: 3 additions & 1 deletion src/Passwordless/Models/VerifiedUser.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
namespace Passwordless;
using System;

namespace Passwordless;

public class VerifiedUser
{
Expand Down
2 changes: 0 additions & 2 deletions src/Passwordless/Passwordless.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,7 @@

<PropertyGroup>
<TargetFrameworks>net462;net6.0;net7.0;netstandard2.0</TargetFrameworks>
<TargetFrameworks Condition="'$(IncludePreview)' == 'true'">$(TargetFrameworks);$(CurrentPreviewTfm)</TargetFrameworks>
<IsPackable>true</IsPackable>
<PublishAot Condition="'$(TargetFrameworkIdentifier)' == '.NETCoreApp' AND $([MSBuild]::VersionGreaterThanOrEquals($(TargetFrameworkVersion), '8.0'))">true</PublishAot>
</PropertyGroup>

<!-- Packaging-related properties -->
Expand Down
2 changes: 2 additions & 0 deletions src/Passwordless/PasswordlessApiException.cs
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
using System.Collections.Generic;
using System.Net.Http;
using System.Text.Json;
using System.Text.Json.Serialization;

Expand Down
5 changes: 5 additions & 0 deletions src/Passwordless/PasswordlessClient.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Net.Http;
using System.Net.Http.Json;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
using Passwordless.Helpers;
using Passwordless.Models;
using JsonContext = Passwordless.Helpers.PasswordlessSerializerContext;
Expand Down
4 changes: 4 additions & 0 deletions src/Passwordless/PasswordlessHttpHandler.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
using System;
using System.Net.Http;
using System.Net.Http.Json;
using System.Threading;
using System.Threading.Tasks;
using Passwordless.Helpers;
using Passwordless.Helpers.Extensions;

Expand Down
1 change: 1 addition & 0 deletions src/Passwordless/ServiceCollectionExtensions.cs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
using System;
using Microsoft.Extensions.Options;
using Passwordless;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net7.0</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
</PropertyGroup>

<ItemGroup>
Expand Down
2 changes: 2 additions & 0 deletions tests/Passwordless.AspNetCore.Tests/RegistrationTests.cs
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
using System.Collections.Generic;
using Microsoft.AspNetCore.Identity;
using Microsoft.AspNetCore.Identity.EntityFrameworkCore;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Options;
using Passwordless.AspNetCore.Services;
using Xunit;

namespace Passwordless.AspNetCore.Tests;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Security.Claims;
using System.Threading;
using System.Threading.Tasks;
using AutoFixture;
using Microsoft.AspNetCore.Authentication;
using Microsoft.AspNetCore.Http;
Expand All @@ -10,6 +15,7 @@
using Passwordless.AspNetCore.Services;
using Passwordless.AspNetCore.Services.Implementations;
using Passwordless.Models;
using Xunit;

namespace Passwordless.AspNetCore.Tests.Services;

Expand Down
1 change: 0 additions & 1 deletion tests/Passwordless.AspNetCore.Tests/Usings.cs

This file was deleted.

Loading

0 comments on commit 298df55

Please sign in to comment.