Browse Source

Remove invalid items

pull/259/head
cKey 5 years ago
parent
commit
c7c94e5a6a
  1. 45
      aspnet-core/LINGYUN.MicroService.All.sln
  2. 31
      aspnet-core/modules/common/LINGYUN.Abp.Rules.NRules/AbpNRulesModule.cs
  3. 22
      aspnet-core/modules/common/LINGYUN.Abp.Rules.NRules/LINGYUN.Abp.Rules.NRules.csproj
  4. 14
      aspnet-core/modules/common/LINGYUN.Abp.Rules.NRules/LINGYUN/Abp/Rules/AbpNRulesOptions.cs
  5. 44
      aspnet-core/modules/common/LINGYUN.Abp.Rules.NRules/LINGYUN/Abp/Rules/AbpRuleRepository.cs
  6. 20
      aspnet-core/modules/common/LINGYUN.Abp.Rules.NRules/LINGYUN/Abp/Rules/DependencyResolver.cs
  7. 20
      aspnet-core/modules/common/LINGYUN.Abp.Rules.NRules/LINGYUN/Abp/Rules/INRulesRepository.cs
  8. 60
      aspnet-core/modules/common/LINGYUN.Abp.Rules.NRules/LINGYUN/Abp/Rules/NRulesEntityRuleContributor.cs
  9. 24
      aspnet-core/modules/common/LINGYUN.Abp.Rules.NRules/LINGYUN/Abp/Rules/RuleActivator.cs
  10. 55
      aspnet-core/modules/common/LINGYUN.Abp.Rules.NRules/Microsoft/Extensions/DependencyInjection/NRulesServiceCollectionExtensions.cs
  11. 15
      aspnet-core/modules/common/LINGYUN.Abp.Rules.NRules/NRules/RuleRepositoryExtensions.cs
  12. 14
      aspnet-core/modules/common/LINGYUN.Abp.Rules/LINGYUN.Abp.Rules.csproj
  13. 16
      aspnet-core/modules/common/LINGYUN.Abp.Rules/LINGYUN/Abp/Rules/AbpRulesModule.cs
  14. 48
      aspnet-core/modules/common/LINGYUN.Abp.Rules/LINGYUN/Abp/Rules/EntityChangedRulesInterceptor.cs
  15. 28
      aspnet-core/modules/common/LINGYUN.Abp.Rules/LINGYUN/Abp/Rules/EntityChangedRulesInterceptorRegistrar.cs
  16. 18
      aspnet-core/modules/common/LINGYUN.Abp.Rules/LINGYUN/Abp/Rules/EntityRuleContext.cs
  17. 8
      aspnet-core/modules/common/LINGYUN.Abp.Rules/LINGYUN/Abp/Rules/ErrorType.cs
  18. 7
      aspnet-core/modules/common/LINGYUN.Abp.Rules/LINGYUN/Abp/Rules/ExpressionType.cs
  19. 9
      aspnet-core/modules/common/LINGYUN.Abp.Rules/LINGYUN/Abp/Rules/IEntityRuleContributor.cs
  20. 6
      aspnet-core/modules/common/LINGYUN.Abp.Rules/LINGYUN/Abp/Rules/INeedRule.cs
  21. 11
      aspnet-core/modules/common/LINGYUN.Abp.Rules/LINGYUN/Abp/Rules/IRuleFinder.cs
  22. 13
      aspnet-core/modules/common/LINGYUN.Abp.Rules/LINGYUN/Abp/Rules/NullEntityRuleContributor.cs
  23. 15
      aspnet-core/modules/common/LINGYUN.Abp.Rules/LINGYUN/Abp/Rules/NullRuleFinder.cs
  24. 90
      aspnet-core/modules/common/LINGYUN.Abp.Rules/LINGYUN/Abp/Rules/Rule.cs
  25. 53
      aspnet-core/modules/common/LINGYUN.Abp.Rules/LINGYUN/Abp/Rules/RuleGroup.cs
  26. 35
      aspnet-core/modules/common/LINGYUN.Abp.Rules/LINGYUN/Abp/Rules/RuleNameAttribute.cs
  27. 45
      aspnet-core/modules/common/LINGYUN.Abp.Rules/LINGYUN/Abp/Rules/RuleParam.cs
  28. 7
      aspnet-core/modules/common/LINGYUN.Abp.Rules/README.md
  29. 20
      aspnet-core/modules/dapr/LINGYUN.Abp.Dapr.Actors.IdentityModel.Web/LINGYUN.Abp.Dapr.Actors.IdentityModel.Web.csproj
  30. 6
      aspnet-core/modules/dapr/LINGYUN.Abp.Dapr.Actors.IdentityModel.Web/LINGYUN.Abp.Dapr.Actors.IdentityModel.Web.csproj.user
  31. 10
      aspnet-core/modules/dapr/LINGYUN.Abp.Dapr.Actors.IdentityModel.Web/LINGYUN/Abp/Dapr/Actors/IdentityModel/Web/AbpDaprActorsIdentityModelWebModule.cs
  32. 51
      aspnet-core/modules/dapr/LINGYUN.Abp.Dapr.Actors.IdentityModel.Web/LINGYUN/Abp/Dapr/Actors/IdentityModel/Web/HttpContextIdentityModelDaprActorProxyAuthenticator.cs
  33. 27
      aspnet-core/modules/dapr/LINGYUN.Abp.Dapr.Actors.IdentityModel.Web/Properties/launchSettings.json
  34. 19
      aspnet-core/modules/dapr/LINGYUN.Abp.Dapr.Actors.IdentityModel.Web/README.md
  35. 18
      aspnet-core/modules/dapr/LINGYUN.Abp.Dapr.Actors.IdentityModel/LINGYUN.Abp.Dapr.Actors.IdentityModel.csproj
  36. 54
      aspnet-core/modules/dapr/LINGYUN.Abp.Dapr.Actors.IdentityModel/LINGYUN/Abp/Dapr/Actors/DaprActorConfigurationExtensions.cs
  37. 13
      aspnet-core/modules/dapr/LINGYUN.Abp.Dapr.Actors.IdentityModel/LINGYUN/Abp/Dapr/Actors/IdentityModel/AbpDaprActorsIdentityModelModule.cs
  38. 66
      aspnet-core/modules/dapr/LINGYUN.Abp.Dapr.Actors.IdentityModel/LINGYUN/Abp/Dapr/Actors/IdentityModel/IdentityModelDaprActorProxyAuthenticator.cs
  39. 19
      aspnet-core/modules/dapr/LINGYUN.Abp.Dapr.Actors.IdentityModel/README.md
  40. 2
      aspnet-core/modules/localization/LINGYUN.Abp.Localization.Xml/LINGYUN/Abp/Localization/Xml/XmlLocalizationFile.cs
  41. 1
      aspnet-core/tests/LINGYUN.Abp.Localization.Json.Tests/LINGYUN.Abp.Localization.Json.Tests.csproj

45
aspnet-core/LINGYUN.MicroService.All.sln

@ -230,10 +230,6 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "LINGYUN.Abp.Auditing.Applic
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "LINGYUN.Abp.Auditing.HttpApi", "modules\auditing\LINGYUN.Abp.Auditing.HttpApi\LINGYUN.Abp.Auditing.HttpApi.csproj", "{07E19CA8-671D-4D58-9FED-5FEE9AE01A2F}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "LINGYUN.Abp.Rules", "modules\common\LINGYUN.Abp.Rules\LINGYUN.Abp.Rules.csproj", "{8ACB30CF-2311-4C0A-AE79-92C1A7667353}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "LINGYUN.Abp.Rules.NRules", "modules\common\LINGYUN.Abp.Rules.NRules\LINGYUN.Abp.Rules.NRules.csproj", "{0BA9FF71-C55E-483B-B83A-6B4BD8ABBBB1}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "permission-management", "permission-management", "{CC362C67-6FC1-42B3-A130-8120AA8D790C}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "LINGYUN.Abp.PermissionManagement.Domain", "modules\permissions-management\LINGYUN.Abp.PermissionManagement.Domain\LINGYUN.Abp.PermissionManagement.Domain.csproj", "{B46D6DAF-98C6-441F-9FA5-3CAD7CF27727}"
@ -298,8 +294,6 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "LINGYUN.Abp.Localization.Xm
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "LINGYUN.Abp.Localization.Xml.Tests", "tests\LINGYUN.Abp.Localization.Xml.Tests\LINGYUN.Abp.Localization.Xml.Tests.csproj", "{A061D2B4-B650-4F7F-A6CB-5C8FFFD512ED}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "LINGYUN.Abp.Localization.Json", "modules\localization\LINGYUN.Abp.Localization.Json\LINGYUN.Abp.Localization.Json.csproj", "{EA563F48-A6EF-4886-B607-2A83F7795F1B}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "LINGYUN.Abp.Localization.Json.Tests", "tests\LINGYUN.Abp.Localization.Json.Tests\LINGYUN.Abp.Localization.Json.Tests.csproj", "{EBCF7D88-49E2-413D-A7A6-1A76BC2E8161}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "LINGYUN.Abp.Localization.Dynamic", "modules\common\LINGYUN.Abp.Localization.Dynamic\LINGYUN.Abp.Localization.Dynamic.csproj", "{4A9043FD-24A3-4A4A-956B-9CB71876F415}"
@ -325,6 +319,14 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "localization", "localizatio
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "LINGYUN.Abp.LocalizationManagement.HttpApi.Host", "services\localization\LINGYUN.Abp.LocalizationManagement.HttpApi.Host\LINGYUN.Abp.LocalizationManagement.HttpApi.Host.csproj", "{6FFC14FE-F659-4B23-9746-4B767CE520D2}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "rules", "rules", "{6084D52D-775B-4A39-8CD5-AA2F362B5A61}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "LINGYUN.Abp.Rules", "modules\rules\LINGYUN.Abp.Rules\LINGYUN.Abp.Rules.csproj", "{D60EFB8E-F168-4EF2-8D8F-ED42EB6FB8CF}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "LINGYUN.Abp.Rules.NRules", "modules\rules\LINGYUN.Abp.Rules.NRules\LINGYUN.Abp.Rules.NRules.csproj", "{34BB9810-2983-4E55-A96A-132D32310145}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "LINGYUN.Abp.Rules.RulesEngine", "modules\rules\LINGYUN.Abp.Rules.RulesEngine\LINGYUN.Abp.Rules.RulesEngine.csproj", "{4D83BDA7-2059-41C7-85AE-FEFAD5CD9498}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
@ -695,14 +697,6 @@ Global
{07E19CA8-671D-4D58-9FED-5FEE9AE01A2F}.Debug|Any CPU.Build.0 = Debug|Any CPU
{07E19CA8-671D-4D58-9FED-5FEE9AE01A2F}.Release|Any CPU.ActiveCfg = Release|Any CPU
{07E19CA8-671D-4D58-9FED-5FEE9AE01A2F}.Release|Any CPU.Build.0 = Release|Any CPU
{8ACB30CF-2311-4C0A-AE79-92C1A7667353}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{8ACB30CF-2311-4C0A-AE79-92C1A7667353}.Debug|Any CPU.Build.0 = Debug|Any CPU
{8ACB30CF-2311-4C0A-AE79-92C1A7667353}.Release|Any CPU.ActiveCfg = Release|Any CPU
{8ACB30CF-2311-4C0A-AE79-92C1A7667353}.Release|Any CPU.Build.0 = Release|Any CPU
{0BA9FF71-C55E-483B-B83A-6B4BD8ABBBB1}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{0BA9FF71-C55E-483B-B83A-6B4BD8ABBBB1}.Debug|Any CPU.Build.0 = Debug|Any CPU
{0BA9FF71-C55E-483B-B83A-6B4BD8ABBBB1}.Release|Any CPU.ActiveCfg = Release|Any CPU
{0BA9FF71-C55E-483B-B83A-6B4BD8ABBBB1}.Release|Any CPU.Build.0 = Release|Any CPU
{B46D6DAF-98C6-441F-9FA5-3CAD7CF27727}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{B46D6DAF-98C6-441F-9FA5-3CAD7CF27727}.Debug|Any CPU.Build.0 = Debug|Any CPU
{B46D6DAF-98C6-441F-9FA5-3CAD7CF27727}.Release|Any CPU.ActiveCfg = Release|Any CPU
@ -811,10 +805,6 @@ Global
{A061D2B4-B650-4F7F-A6CB-5C8FFFD512ED}.Debug|Any CPU.Build.0 = Debug|Any CPU
{A061D2B4-B650-4F7F-A6CB-5C8FFFD512ED}.Release|Any CPU.ActiveCfg = Release|Any CPU
{A061D2B4-B650-4F7F-A6CB-5C8FFFD512ED}.Release|Any CPU.Build.0 = Release|Any CPU
{EA563F48-A6EF-4886-B607-2A83F7795F1B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{EA563F48-A6EF-4886-B607-2A83F7795F1B}.Debug|Any CPU.Build.0 = Debug|Any CPU
{EA563F48-A6EF-4886-B607-2A83F7795F1B}.Release|Any CPU.ActiveCfg = Release|Any CPU
{EA563F48-A6EF-4886-B607-2A83F7795F1B}.Release|Any CPU.Build.0 = Release|Any CPU
{EBCF7D88-49E2-413D-A7A6-1A76BC2E8161}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{EBCF7D88-49E2-413D-A7A6-1A76BC2E8161}.Debug|Any CPU.Build.0 = Debug|Any CPU
{EBCF7D88-49E2-413D-A7A6-1A76BC2E8161}.Release|Any CPU.ActiveCfg = Release|Any CPU
@ -851,6 +841,18 @@ Global
{6FFC14FE-F659-4B23-9746-4B767CE520D2}.Debug|Any CPU.Build.0 = Debug|Any CPU
{6FFC14FE-F659-4B23-9746-4B767CE520D2}.Release|Any CPU.ActiveCfg = Release|Any CPU
{6FFC14FE-F659-4B23-9746-4B767CE520D2}.Release|Any CPU.Build.0 = Release|Any CPU
{D60EFB8E-F168-4EF2-8D8F-ED42EB6FB8CF}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{D60EFB8E-F168-4EF2-8D8F-ED42EB6FB8CF}.Debug|Any CPU.Build.0 = Debug|Any CPU
{D60EFB8E-F168-4EF2-8D8F-ED42EB6FB8CF}.Release|Any CPU.ActiveCfg = Release|Any CPU
{D60EFB8E-F168-4EF2-8D8F-ED42EB6FB8CF}.Release|Any CPU.Build.0 = Release|Any CPU
{34BB9810-2983-4E55-A96A-132D32310145}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{34BB9810-2983-4E55-A96A-132D32310145}.Debug|Any CPU.Build.0 = Debug|Any CPU
{34BB9810-2983-4E55-A96A-132D32310145}.Release|Any CPU.ActiveCfg = Release|Any CPU
{34BB9810-2983-4E55-A96A-132D32310145}.Release|Any CPU.Build.0 = Release|Any CPU
{4D83BDA7-2059-41C7-85AE-FEFAD5CD9498}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{4D83BDA7-2059-41C7-85AE-FEFAD5CD9498}.Debug|Any CPU.Build.0 = Debug|Any CPU
{4D83BDA7-2059-41C7-85AE-FEFAD5CD9498}.Release|Any CPU.ActiveCfg = Release|Any CPU
{4D83BDA7-2059-41C7-85AE-FEFAD5CD9498}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
@ -965,8 +967,6 @@ Global
{F40F88F1-CA90-4A79-B772-80E287E25982} = {67DAB2A0-D407-4CAB-8414-AE3D0AC52FC4}
{AC3C8985-73C2-472A-8E76-A0B8786FEC3F} = {67DAB2A0-D407-4CAB-8414-AE3D0AC52FC4}
{07E19CA8-671D-4D58-9FED-5FEE9AE01A2F} = {67DAB2A0-D407-4CAB-8414-AE3D0AC52FC4}
{8ACB30CF-2311-4C0A-AE79-92C1A7667353} = {8AC72641-30D3-4ACF-89FA-808FADC55C2E}
{0BA9FF71-C55E-483B-B83A-6B4BD8ABBBB1} = {8AC72641-30D3-4ACF-89FA-808FADC55C2E}
{CC362C67-6FC1-42B3-A130-8120AA8D790C} = {C5CAD011-DF84-4914-939C-0C029DCEF26F}
{B46D6DAF-98C6-441F-9FA5-3CAD7CF27727} = {CC362C67-6FC1-42B3-A130-8120AA8D790C}
{2D377D3A-70EC-4BB3-9F4C-6C933693DA98} = {52B5D4F7-237B-4E0A-A167-68442164F70A}
@ -999,7 +999,6 @@ Global
{90E88EAC-4291-4406-8D88-EFDF61B11292} = {C5CAD011-DF84-4914-939C-0C029DCEF26F}
{84868710-ECBB-4025-900A-EEB99EC49534} = {90E88EAC-4291-4406-8D88-EFDF61B11292}
{A061D2B4-B650-4F7F-A6CB-5C8FFFD512ED} = {370D7CD5-1E17-4F3D-BBFA-03429F6D4F2F}
{EA563F48-A6EF-4886-B607-2A83F7795F1B} = {90E88EAC-4291-4406-8D88-EFDF61B11292}
{EBCF7D88-49E2-413D-A7A6-1A76BC2E8161} = {370D7CD5-1E17-4F3D-BBFA-03429F6D4F2F}
{4A9043FD-24A3-4A4A-956B-9CB71876F415} = {8AC72641-30D3-4ACF-89FA-808FADC55C2E}
{D3BAA44E-8395-4E8A-AA96-6B463356C537} = {C5CAD011-DF84-4914-939C-0C029DCEF26F}
@ -1011,6 +1010,10 @@ Global
{FBE91498-D83B-4873-A67E-0FB9D1C366F0} = {D3BAA44E-8395-4E8A-AA96-6B463356C537}
{A2EA6B3F-AD1A-4FDA-B12E-F71B20A43A6B} = {672E1170-7B18-474B-85C7-1961BF2A48AE}
{6FFC14FE-F659-4B23-9746-4B767CE520D2} = {A2EA6B3F-AD1A-4FDA-B12E-F71B20A43A6B}
{6084D52D-775B-4A39-8CD5-AA2F362B5A61} = {C5CAD011-DF84-4914-939C-0C029DCEF26F}
{D60EFB8E-F168-4EF2-8D8F-ED42EB6FB8CF} = {6084D52D-775B-4A39-8CD5-AA2F362B5A61}
{34BB9810-2983-4E55-A96A-132D32310145} = {6084D52D-775B-4A39-8CD5-AA2F362B5A61}
{4D83BDA7-2059-41C7-85AE-FEFAD5CD9498} = {6084D52D-775B-4A39-8CD5-AA2F362B5A61}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {C95FDF91-16F2-4A8B-A4BE-0E62D1B66718}

31
aspnet-core/modules/common/LINGYUN.Abp.Rules.NRules/AbpNRulesModule.cs

@ -1,31 +0,0 @@
using Microsoft.Extensions.DependencyInjection;
using System;
using System.Collections.Generic;
using Volo.Abp.Modularity;
using NRule = NRules.Fluent.Dsl.Rule;
namespace LINGYUN.Abp.Rules.NRules
{
[DependsOn(
typeof(AbpRulesModule)
)]
public class AbpNRulesModule : AbpModule
{
private readonly AbpNRulesOptions options = new AbpNRulesOptions();
public override void PreConfigureServices(ServiceConfigurationContext context)
{
context.Services.AddObjectAccessor(options);
context.Services.OnRegistred(ctx =>
{
if (ctx.ImplementationType.IsAssignableTo(typeof(NRule)))
{
options.Rules.AddIfNotContains(ctx.ImplementationType);
}
});
}
public override void ConfigureServices(ServiceConfigurationContext context)
{
context.Services.AddNRules(options);
}
}
}

22
aspnet-core/modules/common/LINGYUN.Abp.Rules.NRules/LINGYUN.Abp.Rules.NRules.csproj

@ -1,22 +0,0 @@
<Project Sdk="Microsoft.NET.Sdk">
<Import Project="..\..\..\common.props" />
<PropertyGroup>
<TargetFramework>netstandard2.0</TargetFramework>
<RootNamespace />
</PropertyGroup>
<ItemGroup>
<PackageReference Include="NRules" Version="0.9.0" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\LINGYUN.Abp.Rules\LINGYUN.Abp.Rules.csproj" />
</ItemGroup>
<ItemGroup>
<Folder Include="LINGYUN\Abp\Rules\NRules\" />
</ItemGroup>
</Project>

14
aspnet-core/modules/common/LINGYUN.Abp.Rules.NRules/LINGYUN/Abp/Rules/AbpNRulesOptions.cs

@ -1,14 +0,0 @@
using Volo.Abp.Collections;
using NRule = NRules.Fluent.Dsl.Rule;
namespace LINGYUN.Abp.Rules
{
public class AbpNRulesOptions
{
public ITypeList<NRule> Rules { get; }
public AbpNRulesOptions()
{
Rules = new TypeList<NRule>();
}
}
}

44
aspnet-core/modules/common/LINGYUN.Abp.Rules.NRules/LINGYUN/Abp/Rules/AbpRuleRepository.cs

@ -1,44 +0,0 @@
using NRules.RuleModel;
using System;
using System.Collections.Generic;
namespace LINGYUN.Abp.Rules
{
public class AbpRuleRepository : INRulesRepository
{
public void Add(IRuleSet ruleSet)
{
throw new NotImplementedException();
}
public IEnumerable<IRuleSet> GetRuleSets()
{
throw new NotImplementedException();
}
public void Remove(string ruleSetName)
{
throw new NotImplementedException();
}
public void Remove(IRuleSet ruleSet)
{
throw new NotImplementedException();
}
public IRuleSet GetRuleSet(string ruleSetName)
{
return new RuleSet(ruleSetName);
}
public IRuleSet GetRuleSet(RuleGroup group)
{
throw new NotImplementedException();
}
public IEnumerable<IRuleSet> GetRuleSets(IEnumerable<RuleGroup> groups)
{
throw new NotImplementedException();
}
}
}

20
aspnet-core/modules/common/LINGYUN.Abp.Rules.NRules/LINGYUN/Abp/Rules/DependencyResolver.cs

@ -1,20 +0,0 @@
using Microsoft.Extensions.DependencyInjection;
using NRules.Extensibility;
using System;
namespace LINGYUN.Abp.Rules
{
public class DependencyResolver : IDependencyResolver
{
protected IServiceProvider ServiceProvider { get; }
public DependencyResolver(IServiceProvider serviceProvider)
{
ServiceProvider = serviceProvider;
}
public virtual object Resolve(IResolutionContext context, Type serviceType)
{
return ServiceProvider.GetRequiredService(serviceType);
}
}
}

20
aspnet-core/modules/common/LINGYUN.Abp.Rules.NRules/LINGYUN/Abp/Rules/INRulesRepository.cs

@ -1,20 +0,0 @@
using NRules.RuleModel;
using System.Collections.Generic;
namespace LINGYUN.Abp.Rules
{
public interface INRulesRepository : IRuleRepository
{
void Add(IRuleSet ruleSet);
void Remove(string ruleSetName);
void Remove(IRuleSet ruleSet);
IRuleSet GetRuleSet(string ruleSetName);
IRuleSet GetRuleSet(RuleGroup group);
IEnumerable<IRuleSet> GetRuleSets(IEnumerable<RuleGroup> groups);
}
}

60
aspnet-core/modules/common/LINGYUN.Abp.Rules.NRules/LINGYUN/Abp/Rules/NRulesEntityRuleContributor.cs

@ -1,60 +0,0 @@
using Microsoft.Extensions.DependencyInjection;
using NRules.RuleModel;
using NRules.RuleModel.Builders;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Linq.Dynamic.Core;
using System.Linq.Expressions;
using System.Threading.Tasks;
using Volo.Abp.DependencyInjection;
namespace LINGYUN.Abp.Rules
{
[Dependency(ServiceLifetime.Transient, ReplaceServices = true)]
[ExposeServices(typeof(IEntityRuleContributor))]
public class NRulesEntityRuleContributor : IEntityRuleContributor
{
protected INRulesRepository Repository { get; }
public Task ApplyAsync(EntityRuleContext context)
{
var entityType = context.Entity.GetType();
var entityRuleName = RuleNameAttribute.GetRuleName(entityType);
IEnumerable<IRuleSet> groupRuleSets = new List<IRuleSet>();
groupRuleSets = Repository.GetRuleSets(context.Groups);
var sessionFactory = Repository.Compile(context.Groups);
var session = sessionFactory.CreateSession();
session.Insert(context.Entity);
session.Fire();
foreach (var groupRuleSet in groupRuleSets)
{
}
foreach (var group in context.Groups)
{
var groupRuleSet = new RuleSet(group.Name);
Repository.GetRuleSet(group.Name);
foreach (var rule in group.Rules)
{
var builder = new RuleBuilder();
builder.Name(rule.Name);
PatternBuilder thisRulePattern = builder.LeftHandSide().Pattern(entityType, entityRuleName);
ParameterExpression thisRuleParameter = thisRulePattern.Declaration.ToParameterExpression();
var ruleCondition = Expression.Lambda(DynamicExpressionParser.ParseLambda(typeof(bool), rule.Expression), thisRuleParameter);
thisRulePattern.Condition(ruleCondition);
}
}
throw new NotImplementedException();
}
}
}

24
aspnet-core/modules/common/LINGYUN.Abp.Rules.NRules/LINGYUN/Abp/Rules/RuleActivator.cs

@ -1,24 +0,0 @@
using Microsoft.Extensions.DependencyInjection;
using NRules.Fluent;
using System;
using System.Collections.Generic;
using Volo.Abp.DependencyInjection;
using NRule = NRules.Fluent.Dsl.Rule;
namespace LINGYUN.Abp.Rules
{
[Dependency(ServiceLifetime.Transient, ReplaceServices = true)]
[ExposeServices(typeof(IRuleActivator))]
public class RuleActivator : IRuleActivator
{
protected IServiceProvider ServiceProvider { get; }
public RuleActivator(IServiceProvider serviceProvider)
{
ServiceProvider = serviceProvider;
}
public virtual IEnumerable<NRule> Activate(Type type)
{
return (IEnumerable<NRule>)ServiceProvider.GetServices(type);
}
}
}

55
aspnet-core/modules/common/LINGYUN.Abp.Rules.NRules/Microsoft/Extensions/DependencyInjection/NRulesServiceCollectionExtensions.cs

@ -1,55 +0,0 @@
using LINGYUN.Abp.Rules;
using NRules;
using NRules.Fluent;
using NRules.RuleModel;
using System;
namespace Microsoft.Extensions.DependencyInjection
{
public static class NRulesServiceCollectionExtensions
{
public static IServiceCollection AddNRules(this IServiceCollection services, AbpNRulesOptions options)
{
services.RegisterRepository();
services.RegisterSessionFactory();
services.RegisterSession();
return services;
}
public static IServiceCollection RegisterRepository(this IServiceCollection services)
{
services.AddSingleton<IRuleActivator, RuleActivator>();
services.AddSingleton<IRuleRepository, AbpRuleRepository>();
services.AddSingleton<INRulesRepository, AbpRuleRepository>();
return services;
}
public static IServiceCollection RegisterSessionFactory(this IServiceCollection services)
{
services.RegisterSessionFactory((provider) => provider.GetRequiredService<IRuleRepository>().Compile());
return services;
}
public static IServiceCollection RegisterSessionFactory(this IServiceCollection services, Func<IServiceProvider, ISessionFactory> compileFunc)
{
services.AddSingleton<IRuleActivator, RuleActivator>();
services.AddSingleton(compileFunc);
return services;
}
public static IServiceCollection RegisterSession(this IServiceCollection services)
{
return services.RegisterSession((provider) => provider.GetRequiredService<ISessionFactory>().CreateSession());
}
public static IServiceCollection RegisterSession(this IServiceCollection services, Func<IServiceProvider, ISession> factoryFunc)
{
return services.AddScoped(factoryFunc);
}
}
}

15
aspnet-core/modules/common/LINGYUN.Abp.Rules.NRules/NRules/RuleRepositoryExtensions.cs

@ -1,15 +0,0 @@
using NRules;
using System.Collections.Generic;
namespace LINGYUN.Abp.Rules
{
public static class RuleRepositoryExtensions
{
public static ISessionFactory Compile(this INRulesRepository repository, IEnumerable<RuleGroup> groups)
{
var compiler = new RuleCompiler();
ISessionFactory factory = compiler.Compile(repository.GetRuleSets(groups));
return factory;
}
}
}

14
aspnet-core/modules/common/LINGYUN.Abp.Rules/LINGYUN.Abp.Rules.csproj

@ -1,14 +0,0 @@
<Project Sdk="Microsoft.NET.Sdk">
<Import Project="..\..\..\common.props" />
<PropertyGroup>
<TargetFramework>netstandard2.0</TargetFramework>
<RootNamespace />
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Volo.Abp.Ddd.Domain" Version="4.3.0" />
</ItemGroup>
</Project>

16
aspnet-core/modules/common/LINGYUN.Abp.Rules/LINGYUN/Abp/Rules/AbpRulesModule.cs

@ -1,16 +0,0 @@
using Microsoft.Extensions.DependencyInjection;
using Volo.Abp.Domain;
using Volo.Abp.Modularity;
namespace LINGYUN.Abp.Rules
{
[DependsOn(
typeof(AbpDddDomainModule))]
public class AbpRulesModule : AbpModule
{
public override void PreConfigureServices(ServiceConfigurationContext context)
{
context.Services.OnRegistred(EntityChangedRulesInterceptorRegistrar.RegisterIfNeeded);
}
}
}

48
aspnet-core/modules/common/LINGYUN.Abp.Rules/LINGYUN/Abp/Rules/EntityChangedRulesInterceptor.cs

@ -1,48 +0,0 @@
using System;
using System.Linq;
using System.Threading.Tasks;
using Volo.Abp.DependencyInjection;
using Volo.Abp.Domain.Entities;
using Volo.Abp.DynamicProxy;
namespace LINGYUN.Abp.Rules
{
public class EntityChangedRulesInterceptor : AbpInterceptor, ITransientDependency
{
protected IRuleFinder RuleFinder { get; }
protected IEntityRuleContributor EntityRuleContributor { get; }
public EntityChangedRulesInterceptor(
IRuleFinder ruleFinder,
IEntityRuleContributor entityRuleContributor)
{
RuleFinder = ruleFinder;
EntityRuleContributor = entityRuleContributor;
}
public override async Task InterceptAsync(IAbpMethodInvocation invocation)
{
var entityObj = invocation.Arguments.First();
// TODO: 针对实体的变更执行一次定义的规则
// IBasicRepository.InsertAsync || IBasicRepository.UpdateAsync || IBasicRepository.DeleteAsync
if (entityObj != null && entityObj is IEntity entity)
{
await ApplyEntityRuleAsync(entity);
}
await invocation.ProceedAsync();
}
protected virtual async Task ApplyEntityRuleAsync(IEntity entity)
{
Type entityType = ProxyHelper.GetUnProxiedType(entity);
// 加载规则列表
var groups = await RuleFinder.GetRuleGroupsAsync(entityType);
if (groups.Any())
{
// 应用规则
await EntityRuleContributor.ApplyAsync(new EntityRuleContext(groups, entity));
}
}
}
}

28
aspnet-core/modules/common/LINGYUN.Abp.Rules/LINGYUN/Abp/Rules/EntityChangedRulesInterceptorRegistrar.cs

@ -1,28 +0,0 @@
using System;
using Volo.Abp.DependencyInjection;
using Volo.Abp.Domain.Repositories;
using Volo.Abp.DynamicProxy;
namespace LINGYUN.Abp.Rules
{
public static class EntityChangedRulesInterceptorRegistrar
{
public static void RegisterIfNeeded(IOnServiceRegistredContext context)
{
if (ShouldIntercept(context.ImplementationType))
{
context.Interceptors.TryAdd<EntityChangedRulesInterceptor>();
}
}
private static bool ShouldIntercept(Type type)
{
// 拦截器的要求
// 1、继承自IBasicRepository的仓储
// 2、继承自INeedRule接口的实体
return !DynamicProxyIgnoreTypes.Contains(type) &&
type.IsAssignableTo(typeof(IBasicRepository<>)) &&
type.GetGenericTypeDefinition().IsAssignableTo(typeof(INeedRule));
}
}
}

18
aspnet-core/modules/common/LINGYUN.Abp.Rules/LINGYUN/Abp/Rules/EntityRuleContext.cs

@ -1,18 +0,0 @@
using System.Collections.Generic;
using Volo.Abp.Domain.Entities;
namespace LINGYUN.Abp.Rules
{
public class EntityRuleContext
{
public List<RuleGroup> Groups { get; }
public IEntity Entity { get; }
public EntityRuleContext(
List<RuleGroup> groups,
IEntity entity)
{
Groups = groups;
Entity = entity;
}
}
}

8
aspnet-core/modules/common/LINGYUN.Abp.Rules/LINGYUN/Abp/Rules/ErrorType.cs

@ -1,8 +0,0 @@
namespace LINGYUN.Abp.Rules
{
public enum ErrorType
{
Warning = 0,
Error = 1
}
}

7
aspnet-core/modules/common/LINGYUN.Abp.Rules/LINGYUN/Abp/Rules/ExpressionType.cs

@ -1,7 +0,0 @@
namespace LINGYUN.Abp.Rules
{
public enum ExpressionType
{
LambdaExpression = 0
}
}

9
aspnet-core/modules/common/LINGYUN.Abp.Rules/LINGYUN/Abp/Rules/IEntityRuleContributor.cs

@ -1,9 +0,0 @@
using System.Threading.Tasks;
namespace LINGYUN.Abp.Rules
{
public interface IEntityRuleContributor
{
Task ApplyAsync(EntityRuleContext context);
}
}

6
aspnet-core/modules/common/LINGYUN.Abp.Rules/LINGYUN/Abp/Rules/INeedRule.cs

@ -1,6 +0,0 @@
namespace LINGYUN.Abp.Rules
{
public interface INeedRule
{
}
}

11
aspnet-core/modules/common/LINGYUN.Abp.Rules/LINGYUN/Abp/Rules/IRuleFinder.cs

@ -1,11 +0,0 @@
using System;
using System.Collections.Generic;
using System.Threading.Tasks;
namespace LINGYUN.Abp.Rules
{
public interface IRuleFinder
{
Task<List<RuleGroup>> GetRuleGroupsAsync(Type entityType);
}
}

13
aspnet-core/modules/common/LINGYUN.Abp.Rules/LINGYUN/Abp/Rules/NullEntityRuleContributor.cs

@ -1,13 +0,0 @@
using System.Threading.Tasks;
using Volo.Abp.DependencyInjection;
namespace LINGYUN.Abp.Rules
{
public class NullEntityRuleContributor : IEntityRuleContributor, ISingletonDependency
{
public Task ApplyAsync(EntityRuleContext context)
{
return Task.CompletedTask;
}
}
}

15
aspnet-core/modules/common/LINGYUN.Abp.Rules/LINGYUN/Abp/Rules/NullRuleFinder.cs

@ -1,15 +0,0 @@
using System;
using System.Collections.Generic;
using System.Threading.Tasks;
using Volo.Abp.DependencyInjection;
namespace LINGYUN.Abp.Rules
{
public class NullRuleFinder : IRuleFinder, ISingletonDependency
{
public Task<List<RuleGroup>> GetRuleGroupsAsync(Type entityType)
{
return Task.FromResult(new List<RuleGroup>());
}
}
}

90
aspnet-core/modules/common/LINGYUN.Abp.Rules/LINGYUN/Abp/Rules/Rule.cs

@ -1,90 +0,0 @@
using JetBrains.Annotations;
using System;
using System.Collections.Generic;
using Volo.Abp;
namespace LINGYUN.Abp.Rules
{
/// <summary>
/// ref: https://github.com/microsoft/RulesEngine/blob/master/src/RulesEngine/RulesEngine/Models/Rule.cs
/// </summary>
public class Rule
{
[NotNull]
public string Name { get; set; }
public string Operator { get; set; }
public string ErrorMessage { get; set; }
public DateTime CreationTime { get; set; }
public ErrorType ErrorType { get; set; }
public ExpressionType? ExpressionType { get; set; }
public List<Rule> Rules { get; set; }
public List<string> InjectRules { get; set; }
public List<RuleParam> Params { get; set; }
public string Expression { get; set; }
public string SuccessEvent { get; set; }
protected Rule() { }
public Rule(
[NotNull] string name,
string operation,
DateTime creationTime,
string expression = null,
string successEvent = null,
ErrorType errorType = ErrorType.Warning,
ExpressionType? expressionType = null)
{
Check.NotNullOrWhiteSpace(name, nameof(name));
Name = name;
Operator = operation;
CreationTime = creationTime;
Expression = expression;
SuccessEvent = successEvent;
ErrorType = errorType;
ExpressionType = expressionType;
Rules = new List<Rule>();
Params = new List<RuleParam>();
InjectRules = new List<string>();
}
public Rule CreateChildren(Rule rule)
{
Rules.Add(rule);
return this;
}
public Rule WithParam(RuleParam param)
{
Params.AddIfNotContains(param);
return this;
}
public Rule InjectRule(string ruleName)
{
InjectRules.AddIfNotContains(ruleName);
return this;
}
public override int GetHashCode()
{
return Name.GetHashCode();
}
public override bool Equals(object obj)
{
if (obj == null)
{
return false;
}
if (obj is Rule rule)
{
return rule.Name.Equals(Name);
}
return false;
}
}
}

53
aspnet-core/modules/common/LINGYUN.Abp.Rules/LINGYUN/Abp/Rules/RuleGroup.cs

@ -1,53 +0,0 @@
using JetBrains.Annotations;
using System.Collections.Generic;
using Volo.Abp;
namespace LINGYUN.Abp.Rules
{
public class RuleGroup
{
[NotNull]
public string Name { get; set; }
public List<string> InjectRules { get; set; }
public List<Rule> Rules { get; }
protected RuleGroup() { }
public RuleGroup(
[NotNull] string name)
{
Check.NotNullOrWhiteSpace(name, nameof(name));
Name = name;
Rules = new List<Rule>();
InjectRules = new List<string>();
}
public RuleGroup WithInjectRule(string ruleName)
{
InjectRules.AddIfNotContains(ruleName);
return this;
}
public RuleGroup WithInjectRule(IEnumerable<string> ruleNames)
{
InjectRules.AddIfNotContains(ruleNames);
return this;
}
public RuleGroup WithRule(Rule rule)
{
Rules.AddIfNotContains(rule);
return this;
}
public RuleGroup WithRule(IEnumerable<Rule> rules)
{
Rules.AddIfNotContains(rules);
return this;
}
}
}

35
aspnet-core/modules/common/LINGYUN.Abp.Rules/LINGYUN/Abp/Rules/RuleNameAttribute.cs

@ -1,35 +0,0 @@
using System;
using System.Reflection;
namespace LINGYUN.Abp.Rules
{
public class RuleNameAttribute : Attribute
{
public string Name { get; }
public RuleNameAttribute(string name)
{
Name = name;
}
public virtual string GetRuleNameForType(Type ruleType)
{
return Name;
}
public static string GetRuleName<TEntity>()
{
return GetRuleName(typeof(TEntity));
}
public static string GetRuleName(Type entityType)
{
var ruleAttribute = entityType.GetSingleAttributeOrNull<RuleNameAttribute>();
if (ruleAttribute != null)
{
return ruleAttribute.GetRuleNameForType(entityType);
}
return entityType.Name.RemovePostFix("Rule").ToKebabCase();
}
}
}

45
aspnet-core/modules/common/LINGYUN.Abp.Rules/LINGYUN/Abp/Rules/RuleParam.cs

@ -1,45 +0,0 @@
using JetBrains.Annotations;
using Volo.Abp;
namespace LINGYUN.Abp.Rules
{
public class RuleParam
{
[NotNull]
public string Name { get; set; }
[NotNull]
public string Expression { get; set; }
protected RuleParam() { }
public RuleParam(
[NotNull] string name,
[NotNull] string expression)
{
Check.NotNullOrWhiteSpace(name, nameof(name));
Check.NotNullOrWhiteSpace(expression, nameof(expression));
Name = name;
Expression = expression;
}
public override int GetHashCode()
{
return Name.GetHashCode();
}
public override bool Equals(object obj)
{
if (obj == null)
{
return false;
}
if (obj is RuleParam param)
{
return param.Name.Equals(Name);
}
return base.Equals(obj);
}
}
}

7
aspnet-core/modules/common/LINGYUN.Abp.Rules/README.md

@ -1,7 +0,0 @@
# LINGYUN.Abp.Rules
规则引擎定义
## 配置使用
待完善

20
aspnet-core/modules/dapr/LINGYUN.Abp.Dapr.Actors.IdentityModel.Web/LINGYUN.Abp.Dapr.Actors.IdentityModel.Web.csproj

@ -1,20 +0,0 @@
<Project Sdk="Microsoft.NET.Sdk.Web">
<Import Project="..\..\..\common.props" />
<PropertyGroup>
<TargetFramework>net5.0</TargetFramework>
<AssetTargetFallback>$(AssetTargetFallback);portable-net45+win8+wp8+wpa81;</AssetTargetFallback>
<GenerateAssemblyConfigurationAttribute>false</GenerateAssemblyConfigurationAttribute>
<GenerateAssemblyCompanyAttribute>false</GenerateAssemblyCompanyAttribute>
<GenerateAssemblyProductAttribute>false</GenerateAssemblyProductAttribute>
<IsPackable>true</IsPackable>
<OutputType>Library</OutputType>
<RootNamespace />
</PropertyGroup>
<ItemGroup>
<ProjectReference Include="..\LINGYUN.Abp.Dapr.Actors.IdentityModel\LINGYUN.Abp.Dapr.Actors.IdentityModel.csproj" />
</ItemGroup>
</Project>

6
aspnet-core/modules/dapr/LINGYUN.Abp.Dapr.Actors.IdentityModel.Web/LINGYUN.Abp.Dapr.Actors.IdentityModel.Web.csproj.user

@ -1,6 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="Current" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<ActiveDebugProfile>IIS Express</ActiveDebugProfile>
</PropertyGroup>
</Project>

10
aspnet-core/modules/dapr/LINGYUN.Abp.Dapr.Actors.IdentityModel.Web/LINGYUN/Abp/Dapr/Actors/IdentityModel/Web/AbpDaprActorsIdentityModelWebModule.cs

@ -1,10 +0,0 @@
using Volo.Abp.Modularity;
namespace LINGYUN.Abp.Dapr.Actors.IdentityModel.Web
{
[DependsOn(
typeof(AbpDaprActorsIdentityModelModule))]
public class AbpDaprActorsIdentityModelWebModule : AbpModule
{
}
}

51
aspnet-core/modules/dapr/LINGYUN.Abp.Dapr.Actors.IdentityModel.Web/LINGYUN/Abp/Dapr/Actors/IdentityModel/Web/HttpContextIdentityModelDaprActorProxyAuthenticator.cs

@ -1,51 +0,0 @@
using LINGYUN.Abp.Dapr.Actors.Authentication;
using Microsoft.AspNetCore.Authentication;
using Microsoft.AspNetCore.Http;
using System.Net.Http.Headers;
using System.Threading.Tasks;
using Volo.Abp.DependencyInjection;
using Volo.Abp.IdentityModel;
namespace LINGYUN.Abp.Dapr.Actors.IdentityModel
{
[Dependency(ReplaceServices = true)]
public class HttpContextIdentityModelDaprActorProxyAuthenticator : IdentityModelDaprActorProxyAuthenticator
{
public IHttpContextAccessor HttpContextAccessor { get; set; }
public HttpContextIdentityModelDaprActorProxyAuthenticator(
IIdentityModelAuthenticationService identityModelAuthenticationService)
: base(identityModelAuthenticationService)
{
}
public override async Task AuthenticateAsync(DaprActorProxyAuthenticateContext context)
{
if (context.RemoteService.GetUseCurrentAccessToken() != false)
{
var accessToken = await GetAccessTokenFromHttpContextOrNullAsync();
if (accessToken != null)
{
context.Handler.PreConfigure(request =>
{
request.Headers.Authorization = new AuthenticationHeaderValue("Bearer", accessToken);
});
return;
}
}
await base.AuthenticateAsync(context);
}
protected virtual async Task<string> GetAccessTokenFromHttpContextOrNullAsync()
{
var httpContext = HttpContextAccessor?.HttpContext;
if (httpContext == null)
{
return null;
}
return await httpContext.GetTokenAsync("access_token");
}
}
}

27
aspnet-core/modules/dapr/LINGYUN.Abp.Dapr.Actors.IdentityModel.Web/Properties/launchSettings.json

@ -1,27 +0,0 @@
{
"iisSettings": {
"windowsAuthentication": false,
"anonymousAuthentication": true,
"iisExpress": {
"applicationUrl": "http://localhost:25348/",
"sslPort": 44377
}
},
"profiles": {
"IIS Express": {
"commandName": "IISExpress",
"launchBrowser": true,
"environmentVariables": {
"ASPNETCORE_ENVIRONMENT": "Development"
}
},
"LINGYUN.Abp.Dapr.Actors.IdentityModel.Web": {
"commandName": "Project",
"launchBrowser": true,
"environmentVariables": {
"ASPNETCORE_ENVIRONMENT": "Development"
},
"applicationUrl": "https://localhost:5001;http://localhost:5000"
}
}
}

19
aspnet-core/modules/dapr/LINGYUN.Abp.Dapr.Actors.IdentityModel.Web/README.md

@ -1,19 +0,0 @@
# LINGYUN.Abp.Dapr.Actors.IdentityModel.Web
Dapr.Actors内部使用Http进行服务间调用,此模块用于获取应用当前状态中的身份令牌并传递到远程Actor服务
## 配置使用
模块按需引用
```csharp
[DependsOn(typeof(AbpDaprActorsIdentityModelWebModule))]
public class YouProjectModule : AbpModule
{
// other
}
```
## 配置项说明
## 其他

18
aspnet-core/modules/dapr/LINGYUN.Abp.Dapr.Actors.IdentityModel/LINGYUN.Abp.Dapr.Actors.IdentityModel.csproj

@ -1,18 +0,0 @@
<Project Sdk="Microsoft.NET.Sdk">
<Import Project="..\..\..\common.props" />
<PropertyGroup>
<TargetFramework>net5.0</TargetFramework>
<RootNamespace />
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Volo.Abp.IdentityModel" Version="4.3.0" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\LINGYUN.Abp.Dapr.Actors\LINGYUN.Abp.Dapr.Actors.csproj" />
</ItemGroup>
</Project>

54
aspnet-core/modules/dapr/LINGYUN.Abp.Dapr.Actors.IdentityModel/LINGYUN/Abp/Dapr/Actors/DaprActorConfigurationExtensions.cs

@ -1,54 +0,0 @@
using JetBrains.Annotations;
using System.Collections.Generic;
using Volo.Abp;
namespace LINGYUN.Abp.Dapr.Actors
{
public static class DaprActorConfigurationExtensions
{
public const string IdentityClientName = "IdentityClient";
public const string UseCurrentAccessTokenName = "UseCurrentAccessToken";
[CanBeNull]
public static string GetIdentityClient([NotNull] this DaprActorConfiguration configuration)
{
Check.NotNullOrEmpty(configuration, nameof(configuration));
return configuration.GetOrDefault(IdentityClientName);
}
public static DaprActorConfiguration SetIdentityClient([NotNull] this DaprActorConfiguration configuration, [CanBeNull] string value)
{
configuration[IdentityClientName] = value;
return configuration;
}
[CanBeNull]
public static bool? GetUseCurrentAccessToken([NotNull] this DaprActorConfiguration configuration)
{
Check.NotNullOrEmpty(configuration, nameof(configuration));
var value = configuration.GetOrDefault(UseCurrentAccessTokenName);
if (value == null)
{
return null;
}
return bool.Parse(value);
}
public static DaprActorConfiguration SetUseCurrentAccessToken([NotNull] this DaprActorConfiguration configuration, [CanBeNull] bool? value)
{
if (value == null)
{
configuration.Remove(UseCurrentAccessTokenName);
}
else
{
configuration[UseCurrentAccessTokenName] = value.Value.ToString().ToLowerInvariant();
}
return configuration;
}
}
}

13
aspnet-core/modules/dapr/LINGYUN.Abp.Dapr.Actors.IdentityModel/LINGYUN/Abp/Dapr/Actors/IdentityModel/AbpDaprActorsIdentityModelModule.cs

@ -1,13 +0,0 @@
using Volo.Abp.IdentityModel;
using Volo.Abp.Modularity;
namespace LINGYUN.Abp.Dapr.Actors.IdentityModel
{
[DependsOn(
typeof(AbpDaprActorsModule),
typeof(AbpIdentityModelModule)
)]
public class AbpDaprActorsIdentityModelModule : AbpModule
{
}
}

66
aspnet-core/modules/dapr/LINGYUN.Abp.Dapr.Actors.IdentityModel/LINGYUN/Abp/Dapr/Actors/IdentityModel/IdentityModelDaprActorProxyAuthenticator.cs

@ -1,66 +0,0 @@
using LINGYUN.Abp.Dapr.Actors.Authentication;
using LINGYUN.Abp.Dapr.Actors.DynamicProxying;
using Microsoft.Extensions.Logging;
using Microsoft.Extensions.Logging.Abstractions;
using System;
using System.Collections.Generic;
using System.Net.Http.Headers;
using System.Threading.Tasks;
using Volo.Abp.DependencyInjection;
using Volo.Abp.IdentityModel;
namespace LINGYUN.Abp.Dapr.Actors.IdentityModel
{
[Dependency(ReplaceServices = true)]
public class IdentityModelDaprActorProxyAuthenticator : IDaprActorProxyAuthenticator, ITransientDependency
{
protected AbpIdentityClientOptions ClientOptions { get; }
protected IIdentityModelAuthenticationService IdentityModelAuthenticationService { get; }
public ILogger<IdentityModelDaprActorProxyAuthenticator> Logger { get; set; }
public IdentityModelDaprActorProxyAuthenticator(
IIdentityModelAuthenticationService identityModelAuthenticationService)
{
IdentityModelAuthenticationService = identityModelAuthenticationService;
Logger = NullLogger<IdentityModelDaprActorProxyAuthenticator>.Instance;
}
public virtual async Task AuthenticateAsync(DaprActorProxyAuthenticateContext context)
{
var identityClientName = context.RemoteService.GetIdentityClient();
var configuration = GetClientConfiguration(identityClientName);
if (configuration == null)
{
Logger.LogWarning($"Could not find {nameof(IdentityClientConfiguration)} for {identityClientName}. Either define a configuration for {identityClientName} or set a default configuration.");
return;
}
var accessToken = await IdentityModelAuthenticationService.GetAccessTokenAsync(configuration);
if (accessToken == null)
{
return;
}
SetAccessToken(context.Handler, accessToken);
}
protected virtual void SetAccessToken(DaprHttpClientHandler handler, string accessToken)
{
handler.PreConfigure(request =>
{
request.Headers.Authorization = new AuthenticationHeaderValue("Bearer", accessToken);
});
}
private IdentityClientConfiguration GetClientConfiguration(string identityClientName = null)
{
if (identityClientName.IsNullOrEmpty())
{
return ClientOptions.IdentityClients.Default;
}
return ClientOptions.IdentityClients.GetOrDefault(identityClientName) ??
ClientOptions.IdentityClients.Default;
}
}
}

19
aspnet-core/modules/dapr/LINGYUN.Abp.Dapr.Actors.IdentityModel/README.md

@ -1,19 +0,0 @@
# LINGYUN.Abp.Dapr.Actors.IdentityModel
Dapr.Actors内部使用Http进行服务间调用,此模块用于传递服务间调用令牌
## 配置使用
模块按需引用
```csharp
[DependsOn(typeof(AbpDaprActorsIdentityModelModule))]
public class YouProjectModule : AbpModule
{
// other
}
```
## 配置项说明
## 其他

2
aspnet-core/modules/localization/LINGYUN.Abp.Localization.Xml/LINGYUN/Abp/Localization/Xml/XmlLocalizationFile.cs

@ -7,7 +7,7 @@ using System.Xml.Serialization;
namespace LINGYUN.Abp.Localization.Xml
{
[Serializable]
[XmlRoot(Namespace = "lingyun.abp", ElementName = "localization")]
[XmlRoot(ElementName = "localization")]
public class XmlLocalizationFile
{
[XmlElement("culture")]

1
aspnet-core/tests/LINGYUN.Abp.Localization.Json.Tests/LINGYUN.Abp.Localization.Json.Tests.csproj

@ -20,7 +20,6 @@
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\modules\localization\LINGYUN.Abp.Localization.Json\LINGYUN.Abp.Localization.Json.csproj" />
<ProjectReference Include="..\LINGYUN.Abp.TestBase\LINGYUN.Abp.TestsBase.csproj" />
</ItemGroup>

Loading…
Cancel
Save