From dd3822a46beb2fca4767708b0936e30de5b9398e Mon Sep 17 00:00:00 2001 From: Matt Hope Date: Sat, 14 Nov 2020 13:53:00 +0000 Subject: [PATCH] [Feature] - Updated to net5.0 (#172) * Updated to net5.0 * Fixed build. * Updated github actions. * fixed build. * Updated lgtm config. --- .github/workflows/build.yml | 21 +++++---------- .github/workflows/release.yml | 21 +++++---------- lgtm.yml | 2 +- src/SIO.Domain/SIO.Domain.csproj | 2 +- src/SIO.Identity/Login/LoginController.cs | 4 +-- src/SIO.Identity/SIO.Identity.csproj | 10 +++---- .../ServiceCollectionExtensions.cs | 1 - .../SIO.Infrastructure.csproj | 4 +-- src/SIO.Migrations/SIO.Migrations.csproj | 8 +++--- .../SIO.Domain.Tests/SIO.Domain.Tests.csproj | 11 +++++--- .../MockIdentityServerInteraction.cs | 10 +++++++ .../SIO.Identity.Tests.csproj | 27 ++++++++++--------- .../SIO.Infrastructure.Tests.csproj | 11 +++++--- .../SIO.Migrations.Tests.csproj | 11 +++++--- 14 files changed, 73 insertions(+), 70 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 57b25a4..29543fb 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -11,11 +11,11 @@ jobs: steps: - uses: actions/checkout@v2 - # Install .NET Core - - name: Setup .NET Core + # Install .NET + - name: Setup .NET uses: actions/setup-dotnet@v1 with: - dotnet-version: 3.1.101 + dotnet-version: 5.0.100 # Restore projects - name: Restore projects @@ -25,15 +25,6 @@ jobs: - name: Build projects run: dotnet build --configuration Release --no-restore - # Test SIO.Domain.Tests - - name: Test SIO.Domain.Tests - run: dotnet test tests/SIO.Domain.Tests/SIO.Domain.Tests.csproj --configuration Release --no-restore --no-build --verbosity normal -- xunit.parallelizeAssembly=true - # Test SIO.Identity.Tests - - name: Test SIO.Identity.Tests - run: dotnet test tests/SIO.Identity.Tests/SIO.Identity.Tests.csproj --configuration Release --no-restore --no-build --verbosity normal -- xunit.parallelizeAssembly=true - # Test SIO.Infrastructure.Tests - - name: Test SIO.Infrastructure.Tests - run: dotnet test tests/SIO.Infrastructure.Tests/SIO.Infrastructure.Tests.csproj --configuration Release --no-restore --no-build --verbosity normal -- xunit.parallelizeAssembly=true - # Test SIO.Migrations.Tests - - name: Test SIO.Migrations.Tests - run: dotnet test tests/SIO.Migrations.Tests/SIO.Migrations.Tests.csproj --configuration Release --no-restore --no-build --verbosity normal -- xunit.parallelizeAssembly=true \ No newline at end of file + # Test projects + - name: Test projects + run: dotnet test SIO-Identity.sln --configuration Release --no-restore --no-build --verbosity normal -- xunit.parallelizeAssembly=true diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index b1374c9..c16eadd 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -8,11 +8,11 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 - # Install .NET Core - - name: Setup .NET Core + # Install .NET + - name: Setup .NET uses: actions/setup-dotnet@v1 with: - dotnet-version: 3.1.101 + dotnet-version: 5.0.100 # Restore projects - name: Restore projects @@ -22,15 +22,6 @@ jobs: - name: Build projects run: dotnet build --configuration Release --no-restore - # Test SIO.Domain.Tests - - name: Test SIO.Domain.Tests - run: dotnet test tests/SIO.Domain.Tests/SIO.Domain.Tests.csproj --configuration Release --no-restore --no-build --verbosity normal -- xunit.parallelizeAssembly=true - # Test SIO.Identity.Tests - - name: Test SIO.Identity.Tests - run: dotnet test tests/SIO.Identity.Tests/SIO.Identity.Tests.csproj --configuration Release --no-restore --no-build --verbosity normal -- xunit.parallelizeAssembly=true - # Test SIO.Infrastructure.Tests - - name: Test SIO.Infrastructure.Tests - run: dotnet test tests/SIO.Infrastructure.Tests/SIO.Infrastructure.Tests.csproj --configuration Release --no-restore --no-build --verbosity normal -- xunit.parallelizeAssembly=true - # Test SIO.Migrations.Tests - - name: Test SIO.Migrations.Tests - run: dotnet test tests/SIO.Migrations.Tests/SIO.Migrations.Tests.csproj --configuration Release --no-restore --no-build --verbosity normal -- xunit.parallelizeAssembly=true \ No newline at end of file + # Test projects + - name: Test projects + run: dotnet test SIO-Identity.sln --configuration Release --no-restore --no-build --verbosity normal -- xunit.parallelizeAssembly=true \ No newline at end of file diff --git a/lgtm.yml b/lgtm.yml index 3beebda..c9aefdf 100644 --- a/lgtm.yml +++ b/lgtm.yml @@ -2,4 +2,4 @@ extraction: csharp: index: dotnet: - version: 3.1.301 \ No newline at end of file + version: 5.0.100 \ No newline at end of file diff --git a/src/SIO.Domain/SIO.Domain.csproj b/src/SIO.Domain/SIO.Domain.csproj index cf0d82f..956151a 100644 --- a/src/SIO.Domain/SIO.Domain.csproj +++ b/src/SIO.Domain/SIO.Domain.csproj @@ -1,7 +1,7 @@  - netcoreapp3.1 + net5.0 diff --git a/src/SIO.Identity/Login/LoginController.cs b/src/SIO.Identity/Login/LoginController.cs index 76e1092..ff7a536 100644 --- a/src/SIO.Identity/Login/LoginController.cs +++ b/src/SIO.Identity/Login/LoginController.cs @@ -146,9 +146,9 @@ private async Task BuildResponseAsync(string returnUrl) var providers = schemes.Where(scheme => !string.IsNullOrWhiteSpace(scheme.DisplayName)) .Select(scheme => new ExternalProvider(scheme.DisplayName, scheme.Name)); - if (context?.ClientId != null) + if (context?.Client?.ClientId != null) { - var client = await _clientStore.FindEnabledClientByIdAsync(context.ClientId); + var client = await _clientStore.FindEnabledClientByIdAsync(context.Client.ClientId); if (client != null) { diff --git a/src/SIO.Identity/SIO.Identity.csproj b/src/SIO.Identity/SIO.Identity.csproj index a695e06..9b5611c 100644 --- a/src/SIO.Identity/SIO.Identity.csproj +++ b/src/SIO.Identity/SIO.Identity.csproj @@ -1,17 +1,17 @@  - netcoreapp3.1 + net5.0 InProcess 869b8ac0-3c1c-45a1-b4a6-3fd4c386514e - + - - - + + + diff --git a/src/SIO.Identity/ServiceCollectionExtensions.cs b/src/SIO.Identity/ServiceCollectionExtensions.cs index f09fefc..5aee9cb 100644 --- a/src/SIO.Identity/ServiceCollectionExtensions.cs +++ b/src/SIO.Identity/ServiceCollectionExtensions.cs @@ -58,7 +58,6 @@ public static IServiceCollection AddSIOIdentity(this IServiceCollection services options.UserInteraction.ErrorUrl = "/error"; options.UserInteraction.ConsentUrl = "/consent"; options.Cors.CorsPaths.Add("/v1/client"); - options.PublicOrigin = configuration.GetValue("Identity:Authority"); }) .AddConfigurationStore(options => { diff --git a/src/SIO.Infrastructure/SIO.Infrastructure.csproj b/src/SIO.Infrastructure/SIO.Infrastructure.csproj index 8e14376..7e0fb34 100644 --- a/src/SIO.Infrastructure/SIO.Infrastructure.csproj +++ b/src/SIO.Infrastructure/SIO.Infrastructure.csproj @@ -1,7 +1,7 @@ - + - netcoreapp3.1 + net5.0 diff --git a/src/SIO.Migrations/SIO.Migrations.csproj b/src/SIO.Migrations/SIO.Migrations.csproj index 52d37ab..7472c2e 100644 --- a/src/SIO.Migrations/SIO.Migrations.csproj +++ b/src/SIO.Migrations/SIO.Migrations.csproj @@ -1,14 +1,14 @@  - netcoreapp3.1 + net5.0 - + - - + + diff --git a/tests/SIO.Domain.Tests/SIO.Domain.Tests.csproj b/tests/SIO.Domain.Tests/SIO.Domain.Tests.csproj index 7f9b2eb..d577138 100644 --- a/tests/SIO.Domain.Tests/SIO.Domain.Tests.csproj +++ b/tests/SIO.Domain.Tests/SIO.Domain.Tests.csproj @@ -1,19 +1,22 @@ - + - netcoreapp3.1 + net5.0 false - + all runtime; build; native; contentfiles; analyzers; buildtransitive - + + all + runtime; build; native; contentfiles; analyzers; buildtransitive + diff --git a/tests/SIO.Identity.Tests/MockIdentityServerInteraction.cs b/tests/SIO.Identity.Tests/MockIdentityServerInteraction.cs index 0fe66bd..4811848 100644 --- a/tests/SIO.Identity.Tests/MockIdentityServerInteraction.cs +++ b/tests/SIO.Identity.Tests/MockIdentityServerInteraction.cs @@ -17,11 +17,21 @@ public Task CreateLogoutContextAsync() return Task.FromResult("MockLogoutId"); } + public Task DenyAuthorizationAsync(AuthorizationRequest request, AuthorizationError error, string errorDescription = null) + { + throw new NotImplementedException(); + } + public Task> GetAllUserConsentsAsync() { throw new NotImplementedException(); } + public Task> GetAllUserGrantsAsync() + { + throw new NotImplementedException(); + } + public Task GetAuthorizationContextAsync(string returnUrl) { if (HasAuthorizationContext) diff --git a/tests/SIO.Identity.Tests/SIO.Identity.Tests.csproj b/tests/SIO.Identity.Tests/SIO.Identity.Tests.csproj index 814cfe8..e853ff2 100644 --- a/tests/SIO.Identity.Tests/SIO.Identity.Tests.csproj +++ b/tests/SIO.Identity.Tests/SIO.Identity.Tests.csproj @@ -1,7 +1,7 @@ - + - netcoreapp3.1 + net5.0 false @@ -9,12 +9,12 @@ - - - - - - + + + + + + @@ -24,11 +24,14 @@ all runtime; build; native; contentfiles; analyzers; buildtransitive - - + + all + runtime; build; native; contentfiles; analyzers; buildtransitive + + - - + + diff --git a/tests/SIO.Infrastructure.Tests/SIO.Infrastructure.Tests.csproj b/tests/SIO.Infrastructure.Tests/SIO.Infrastructure.Tests.csproj index caced0e..4cafb39 100644 --- a/tests/SIO.Infrastructure.Tests/SIO.Infrastructure.Tests.csproj +++ b/tests/SIO.Infrastructure.Tests/SIO.Infrastructure.Tests.csproj @@ -1,19 +1,22 @@ - + - netcoreapp3.1 + net5.0 false - + all runtime; build; native; contentfiles; analyzers; buildtransitive - + + all + runtime; build; native; contentfiles; analyzers; buildtransitive + diff --git a/tests/SIO.Migrations.Tests/SIO.Migrations.Tests.csproj b/tests/SIO.Migrations.Tests/SIO.Migrations.Tests.csproj index a0981a0..5e21c86 100644 --- a/tests/SIO.Migrations.Tests/SIO.Migrations.Tests.csproj +++ b/tests/SIO.Migrations.Tests/SIO.Migrations.Tests.csproj @@ -1,19 +1,22 @@ - + - netcoreapp3.1 + net5.0 false - + all runtime; build; native; contentfiles; analyzers; buildtransitive - + + all + runtime; build; native; contentfiles; analyzers; buildtransitive +