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

upgrade packages net 8 #708

Merged
merged 2 commits into from
Nov 19, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions src/applications/Mixcore/mixcore.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk.Web">

<PropertyGroup>
<TargetFramework>net7.0</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
<RootNamespace>Mixcore</RootNamespace>
<UserSecretsId>18e7166c-3aa3-4569-98f0-d319f894743d</UserSecretsId>
<ServerGarbageCollection>false</ServerGarbageCollection>
Expand Down Expand Up @@ -52,11 +52,11 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.AspNetCore.Mvc.Razor.RuntimeCompilation" Version="7.0.9" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Design" Version="7.0.9">
<PackageReference Include="Microsoft.AspNetCore.Mvc.Razor.RuntimeCompilation" Version="8.0.0" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Design" Version="8.0.0">
<PrivateAssets>all</PrivateAssets>
</PackageReference>
<PackageReference Include="Microsoft.EntityFrameworkCore.Tools" Version="7.0.9">
<PackageReference Include="Microsoft.EntityFrameworkCore.Tools" Version="8.0.0">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
Expand Down
2 changes: 1 addition & 1 deletion src/applications/mixcore.gateway/mixcore.gateway.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk.Web">

<PropertyGroup>
<TargetFramework>net7.0</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
<Nullable>enable</Nullable>
<ImplicitUsings>enable</ImplicitUsings>
<RootNamespace>Mixcore.Gateway</RootNamespace>
Expand Down
4 changes: 2 additions & 2 deletions src/modules/mix.account/mix.account.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk.Web">

<PropertyGroup>
<TargetFramework>net7.0</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
<RootNamespace>Mix.Account</RootNamespace>
<ImplicitUsings>enable</ImplicitUsings>
</PropertyGroup>
Expand Down Expand Up @@ -52,7 +52,7 @@

<ItemGroup>
<PackageReference Include="Grpc.AspNetCore" Version="2.55.0" />
<PackageReference Include="Microsoft.AspNetCore.Identity.UI" Version="7.0.9" />
<PackageReference Include="Microsoft.AspNetCore.Identity.UI" Version="8.0.0" />
</ItemGroup>

</Project>
2 changes: 1 addition & 1 deletion src/modules/mix.common/mix.common.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk.Web">

<PropertyGroup>
<TargetFramework>net7.0</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
<RootNamespace>Mix.Common</RootNamespace>
<ImplicitUsings>enable</ImplicitUsings>
</PropertyGroup>
Expand Down
2 changes: 1 addition & 1 deletion src/modules/mix.grpc/mix.grpc.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk.Web">

<PropertyGroup>
<TargetFramework>net7.0</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
<RootNamespace>Mix.Grpc</RootNamespace>
</PropertyGroup>

Expand Down
2 changes: 1 addition & 1 deletion src/modules/mix.log/mix.log.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk.Web">

<PropertyGroup>
<TargetFramework>net7.0</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<RootNamespace>Mix.Log</RootNamespace>
</PropertyGroup>
Expand Down
2 changes: 1 addition & 1 deletion src/modules/mix.messenger/mix.messenger.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk.Web">

<PropertyGroup>
<TargetFramework>net7.0</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
<RootNamespace>Mix.Messenger</RootNamespace>
</PropertyGroup>

Expand Down
2 changes: 1 addition & 1 deletion src/modules/mix.portal/mix.portal.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk.Web">

<PropertyGroup>
<TargetFramework>net7.0</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
<RootNamespace>Mix.Portal</RootNamespace>
<ImplicitUsings>enable</ImplicitUsings>
</PropertyGroup>
Expand Down
4 changes: 2 additions & 2 deletions src/modules/mix.scheduler/Domain/Jobs/KeepPoolAliveJob.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,11 @@ public KeepPoolAliveJob(

public override async Task ExecuteHandler(IJobExecutionContext context)
{
string domain = context.Trigger.JobDataMap.GetString("domain");
if (!string.IsNullOrEmpty(domain))
if (context.Trigger.JobDataMap.ContainsKey("domain"))
{
try
{
string domain = context.Trigger.JobDataMap.GetString("domain");
var now = DateTime.UtcNow;
var ping = await _httpService.GetStringAsync($"{domain.TrimEnd('/')}");

Expand Down
2 changes: 1 addition & 1 deletion src/modules/mix.scheduler/mix.scheduler.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk.Web">

<PropertyGroup>
<TargetFramework>net7.0</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
<RootNamespace>Mix.Scheduler</RootNamespace>
</PropertyGroup>

Expand Down
2 changes: 1 addition & 1 deletion src/modules/mix.storage/mix.storage.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk.Web">

<PropertyGroup>
<TargetFramework>net7.0</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
<Nullable>enable</Nullable>
<ImplicitUsings>enable</ImplicitUsings>
<RootNamespace>Mix.Storage</RootNamespace>
Expand Down
2 changes: 1 addition & 1 deletion src/modules/mix.tenancy/mix.tenancy.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk.Web">

<PropertyGroup>
<TargetFramework>net7.0</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
<RootNamespace>Mix.Tenancy</RootNamespace>
<UserSecretsId>ce99c40c-2b2e-4835-bb26-5d431ba630f8</UserSecretsId>
<ImplicitUsings>enable</ImplicitUsings>
Expand Down
2 changes: 1 addition & 1 deletion src/platform/core/mix.mixdb.event/mix.mixdb.event.csproj
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>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<RootNamespace>Mix.Mixdb.Event</RootNamespace>
Expand Down
2 changes: 1 addition & 1 deletion src/platform/mix.communicator/mix.communicator.csproj
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>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<RootNamespace>Mix.Communicator</RootNamespace>
Expand Down
2 changes: 1 addition & 1 deletion src/platform/mix.constant/mix.constant.csproj
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>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<RootNamespace>Mix.Constant</RootNamespace>
Expand Down
10 changes: 5 additions & 5 deletions src/platform/mix.database/mix.database.csproj
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>
<RootNamespace>Mix.Database</RootNamespace>
</PropertyGroup>

Expand All @@ -16,10 +16,10 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="Microsoft.AspNetCore.Identity.EntityFrameworkCore" Version="7.0.9" />
<PackageReference Include="Microsoft.EntityFrameworkCore.DynamicLinq" Version="7.3.3" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Proxies" Version="7.0.9" />
<PackageReference Include="Pomelo.EntityFrameworkCore.MySql.Json.Microsoft" Version="7.0.0" />
<PackageReference Include="Microsoft.AspNetCore.Identity.EntityFrameworkCore" Version="8.0.0" />
<PackageReference Include="Microsoft.EntityFrameworkCore.DynamicLinq" Version="7.3.5" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Proxies" Version="8.0.0" />
<PackageReference Include="Pomelo.EntityFrameworkCore.MySql.Json.Microsoft" Version="8.0.0-beta.1" />

</ItemGroup>

Expand Down
21 changes: 10 additions & 11 deletions src/platform/mix.identity/mix.identity.csproj
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>
<RootNamespace>Mix.Identity</RootNamespace>
<AssemblyName>mix.identity</AssemblyName>
</PropertyGroup>
Expand All @@ -13,17 +13,16 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="IdentityModel.AspNetCore" Version="4.3.0" />
<PackageReference Include="Microsoft.AspNetCore.Authentication.Core" Version="2.2.0" />
<PackageReference Include="Microsoft.AspNetCore.Authentication.Facebook" Version="7.0.9" />
<PackageReference Include="Microsoft.AspNetCore.Authentication.Google" Version="7.0.9" />
<PackageReference Include="Microsoft.AspNetCore.Authentication.JwtBearer" Version="7.0.9" />
<PackageReference Include="Microsoft.AspNetCore.Authentication.MicrosoftAccount" Version="7.0.9" />
<PackageReference Include="Microsoft.AspNetCore.Authentication.Twitter" Version="7.0.9" />
<PackageReference Include="Microsoft.AspNetCore.Authorization" Version="7.0.9" />
<PackageReference Include="Microsoft.Extensions.Configuration.FileExtensions" Version="7.0.0" />
<PackageReference Include="Microsoft.Extensions.Configuration.Json" Version="7.0.0" />
<PackageReference Include="Microsoft.Identity.Web" Version="2.13.1" />
<PackageReference Include="Microsoft.AspNetCore.Authentication.Facebook" Version="8.0.0" />
<PackageReference Include="Microsoft.AspNetCore.Authentication.Google" Version="8.0.0" />
<PackageReference Include="Microsoft.AspNetCore.Authentication.JwtBearer" Version="8.0.0" />
<PackageReference Include="Microsoft.AspNetCore.Authentication.MicrosoftAccount" Version="8.0.0" />
<PackageReference Include="Microsoft.AspNetCore.Authentication.Twitter" Version="8.0.0" />
<PackageReference Include="Microsoft.AspNetCore.Authorization" Version="8.0.0" />
<PackageReference Include="Microsoft.Extensions.Configuration.FileExtensions" Version="8.0.0" />
<PackageReference Include="Microsoft.Extensions.Configuration.Json" Version="8.0.0" />
<PackageReference Include="Microsoft.Identity.Web" Version="2.15.3" />
</ItemGroup>

<ItemGroup>
Expand Down
6 changes: 5 additions & 1 deletion src/platform/mix.library/Services/MixIdentityService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -250,6 +250,10 @@ public async Task<JObject> GetOrCreateUserData(MixUser user, CancellationToken c
{
try
{
if (GlobalConfig.IsInit)
{
return new JObject();
}
var u = await MixDbDataService.GetSingleByParent(MixDatabaseNames.SYSTEM_USER_DATA, MixContentType.User, user.Id, true);
if (u == null && !GlobalConfig.IsInit)
{
Expand Down Expand Up @@ -357,7 +361,7 @@ public virtual async Task<JObject> ExternalLogin(RegisterExternalBindingModel mo
else
{
string userName = model.UserName ?? model.Email ?? model.PhoneNumber;

if (!string.IsNullOrEmpty(userName))
{
user = await UserManager.FindByNameAsync(userName);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
// The mixcore Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.

using IdentityModel.Client;
using Microsoft.AspNetCore.Authentication.JwtBearer;
using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.Identity;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,7 @@ public static IServiceCollection AddMixServices(this IServiceCollection services
services.AddMixCache(configuration);
services.CustomValidationResponse();
services.AddHttpClient();
services.AddLogging();

services.AddHttpLogging(opt => opt.CombineLogs = true);
services.ApplyMigrations(globalConfig);

services.AddQueues(executingAssembly, configuration);
Expand Down
6 changes: 3 additions & 3 deletions src/platform/mix.library/mix.library.csproj
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>
<RootNamespace>Mix.Lib</RootNamespace>
<ImplicitUsings>enable</ImplicitUsings>
<GenerateDocumentationFile>true</GenerateDocumentationFile>
Expand Down Expand Up @@ -78,9 +78,9 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="ClosedXML" Version="0.102.0" />
<PackageReference Include="ClosedXML" Version="0.104.0-preview2" />
<PackageReference Include="CommandLineParser" Version="2.9.1" />
<PackageReference Include="Microsoft.AspNetCore.Mvc.NewtonsoftJson" Version="7.0.9" />
<PackageReference Include="Microsoft.AspNetCore.Mvc.NewtonsoftJson" Version="8.0.0" />
<PackageReference Include="Microsoft.IO.RecyclableMemoryStream" Version="2.3.2" />
<PackageReference Include="Swashbuckle.AspNetCore" Version="6.5.0" />
<PackageReference Include="Swashbuckle.AspNetCore.Swagger" Version="6.5.0" />
Expand Down
2 changes: 1 addition & 1 deletion src/platform/mix.log/mix.log.lib.csproj
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>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<RootNamespace>Mix.Log.Lib</RootNamespace>
Expand Down
10 changes: 5 additions & 5 deletions src/platform/mix.mixdb/mix.mixdb.csproj
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net7.0</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<RootNamespace>Mix.Mixdb</RootNamespace>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="GraphQL.Server.Ui.Playground" Version="7.5.0" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Design" Version="7.0.9">
<PackageReference Include="GraphQL.Server.Ui.Playground" Version="7.6.0" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Design" Version="8.0.0">
<PrivateAssets>all</PrivateAssets>
</PackageReference>
<PackageReference Include="Microsoft.EntityFrameworkCore.Proxies" Version="7.0.9" />
<PackageReference Include="Microsoft.VisualStudio.Web.CodeGeneration.EntityFrameworkCore" Version="7.0.8" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Proxies" Version="8.0.0" />
<PackageReference Include="Microsoft.VisualStudio.Web.CodeGeneration.EntityFrameworkCore" Version="8.0.0" />
</ItemGroup>

<ItemGroup>
Expand Down
27 changes: 0 additions & 27 deletions src/platform/mix.oauth/Services/TokenIntrospectionService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,6 @@ public async Task<TokenIntrospectionResponse> IntrospectTokenAsync(TokenIntrospe
tokenValidationParameters.ValidateIssuer = true;
tokenValidationParameters.ValidIssuer = _optionsMonitor.IDPUri;
tokenValidationParameters.ValidateAudience = true;
tokenValidationParameters.AudienceValidator = ValidateAudienceHandler(jwtSecurityToken.Audiences, jwtSecurityToken,
tokenValidationParameters, validationResult.Client, tokenIntrospectionRequest.Token);

try
{
Expand Down Expand Up @@ -100,30 +98,5 @@ public async Task<TokenIntrospectionResponse> IntrospectTokenAsync(TokenIntrospe
return response;
}

private AudienceValidator ValidateAudienceHandler(IEnumerable<string> audiences, SecurityToken securityToken,
TokenValidationParameters validationParameters, Client client, string token)
{
Func<IEnumerable<string>, SecurityToken, TokenValidationParameters, bool> handler = (audiences, securityToken, validationParameters) =>
{
// Check the Token the Back Store.
var tokenInDb = _dbContext.OAuthTokens.FirstOrDefault(x => x.Token == token);
if (tokenInDb == null)
return false;

if (tokenInDb.Revoked)
return false;

return true;
};
return new AudienceValidator(handler);
}

private IList<Claim> ParseClaims(JwtSecurityToken tokenContent)
{
var claims = tokenContent.Claims.ToList();

// claims.Add(new Claim(ClaimTypes.Name, tokenContent.Actor));
return claims;
}
}
}
Loading