Browse Source

Add Volo.Abp.Gdpr.Abstractions.csproj

pull/12353/head
Engincan VESKE 4 years ago
parent
commit
e48efa412e
  1. 7
      framework/Volo.Abp.sln
  2. 3
      framework/src/Volo.Abp.Gdpr.Abstractions/FodyWeavers.xml
  3. 30
      framework/src/Volo.Abp.Gdpr.Abstractions/FodyWeavers.xsd
  4. 15
      framework/src/Volo.Abp.Gdpr.Abstractions/Volo.Abp.Gdpr.Abstractions.csproj
  5. 9
      framework/src/Volo.Abp.Gdpr.Abstractions/Volo/Abp/Gdpr/AbpGdprAbstractionsModule.cs
  6. 10
      framework/src/Volo.Abp.Gdpr.Abstractions/Volo/Abp/Gdpr/GdprDataInfo.cs
  7. 9
      framework/src/Volo.Abp.Gdpr.Abstractions/Volo/Abp/Gdpr/GdprUserDataDeleteRequestedEto.cs
  8. 13
      framework/src/Volo.Abp.Gdpr.Abstractions/Volo/Abp/Gdpr/GdprUserDataPreparedEto.cs
  9. 8
      framework/src/Volo.Abp.Gdpr.Abstractions/Volo/Abp/Gdpr/GdprUserDataProviderBase.cs
  10. 8
      framework/src/Volo.Abp.Gdpr.Abstractions/Volo/Abp/Gdpr/GdprUserDataProviderContext.cs
  11. 41
      framework/src/Volo.Abp.Gdpr.Abstractions/Volo/Abp/Gdpr/GdprUserDataRequestEventHandler.cs
  12. 11
      framework/src/Volo.Abp.Gdpr.Abstractions/Volo/Abp/Gdpr/GdprUserDataRequestedEto.cs
  13. 8
      framework/src/Volo.Abp.Gdpr.Abstractions/Volo/Abp/Gdpr/IGdprUserDataProvider.cs

7
framework/Volo.Abp.sln

@ -403,6 +403,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Volo.Abp.DistributedLocking
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Volo.Abp.BackgroundWorkers.Hangfire", "src\Volo.Abp.BackgroundWorkers.Hangfire\Volo.Abp.BackgroundWorkers.Hangfire.csproj", "{E5FCE710-C5A3-4F94-B9C9-BD1E99252BFB}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Volo.Abp.Gdpr.Abstractions", "src\Volo.Abp.Gdpr.Abstractions\Volo.Abp.Gdpr.Abstractions.csproj", "{3683340D-92F5-4B14-B77B-34A163333309}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
@ -1201,6 +1203,10 @@ Global
{E5FCE710-C5A3-4F94-B9C9-BD1E99252BFB}.Debug|Any CPU.Build.0 = Debug|Any CPU
{E5FCE710-C5A3-4F94-B9C9-BD1E99252BFB}.Release|Any CPU.ActiveCfg = Release|Any CPU
{E5FCE710-C5A3-4F94-B9C9-BD1E99252BFB}.Release|Any CPU.Build.0 = Release|Any CPU
{3683340D-92F5-4B14-B77B-34A163333309}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{3683340D-92F5-4B14-B77B-34A163333309}.Debug|Any CPU.Build.0 = Debug|Any CPU
{3683340D-92F5-4B14-B77B-34A163333309}.Release|Any CPU.ActiveCfg = Release|Any CPU
{3683340D-92F5-4B14-B77B-34A163333309}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
@ -1404,6 +1410,7 @@ Global
{CA805B77-D50C-431F-B3CB-1111C9C6E807} = {5DF0E140-0513-4D0D-BE2E-3D4D85CD70E6}
{C4F54FB5-C828-414D-BA03-E8E7A10C784D} = {447C8A77-E5F0-4538-8687-7383196D04EA}
{E5FCE710-C5A3-4F94-B9C9-BD1E99252BFB} = {5DF0E140-0513-4D0D-BE2E-3D4D85CD70E6}
{3683340D-92F5-4B14-B77B-34A163333309} = {5DF0E140-0513-4D0D-BE2E-3D4D85CD70E6}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {BB97ECF4-9A84-433F-A80B-2A3285BDD1D5}

3
framework/src/Volo.Abp.Gdpr.Abstractions/FodyWeavers.xml

@ -0,0 +1,3 @@
<Weavers xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="FodyWeavers.xsd">
<ConfigureAwait />
</Weavers>

30
framework/src/Volo.Abp.Gdpr.Abstractions/FodyWeavers.xsd

@ -0,0 +1,30 @@
<?xml version="1.0" encoding="utf-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
<!-- This file was generated by Fody. Manual changes to this file will be lost when your project is rebuilt. -->
<xs:element name="Weavers">
<xs:complexType>
<xs:all>
<xs:element name="ConfigureAwait" minOccurs="0" maxOccurs="1">
<xs:complexType>
<xs:attribute name="ContinueOnCapturedContext" type="xs:boolean" />
</xs:complexType>
</xs:element>
</xs:all>
<xs:attribute name="VerifyAssembly" type="xs:boolean">
<xs:annotation>
<xs:documentation>'true' to run assembly verification (PEVerify) on the target assembly after all weavers have been executed.</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="VerifyIgnoreCodes" type="xs:string">
<xs:annotation>
<xs:documentation>A comma-separated list of error codes that can be safely ignored in assembly verification.</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="GenerateXsd" type="xs:boolean">
<xs:annotation>
<xs:documentation>'false' to turn off automatic generation of the XML Schema file.</xs:documentation>
</xs:annotation>
</xs:attribute>
</xs:complexType>
</xs:element>
</xs:schema>

15
framework/src/Volo.Abp.Gdpr.Abstractions/Volo.Abp.Gdpr.Abstractions.csproj

@ -0,0 +1,15 @@
<Project Sdk="Microsoft.NET.Sdk">
<Import Project="..\..\..\configureawait.props" />
<Import Project="..\..\..\common.props" />
<PropertyGroup>
<TargetFramework>netstandard2.0</TargetFramework>
<RootNamespace />
</PropertyGroup>
<ItemGroup>
<ProjectReference Include="..\Volo.Abp.EventBus\Volo.Abp.EventBus.csproj" />
</ItemGroup>
</Project>

9
framework/src/Volo.Abp.Gdpr.Abstractions/Volo/Abp/Gdpr/AbpGdprAbstractionsModule.cs

@ -0,0 +1,9 @@
using Volo.Abp.EventBus;
using Volo.Abp.Modularity;
namespace Volo.Abp.Gdpr;
[DependsOn(typeof(AbpEventBusModule))]
public class AbpGdprAbstractionsModule : AbpModule
{
}

10
framework/src/Volo.Abp.Gdpr.Abstractions/Volo/Abp/Gdpr/GdprDataInfo.cs

@ -0,0 +1,10 @@
using System;
using System.Collections.Generic;
namespace Volo.Abp.Gdpr;
[Serializable]
public class GdprDataInfo : Dictionary<string, string>
{
}

9
framework/src/Volo.Abp.Gdpr.Abstractions/Volo/Abp/Gdpr/GdprUserDataDeleteRequestedEto.cs

@ -0,0 +1,9 @@
using System;
namespace Volo.Abp.Gdpr;
[Serializable]
public class GdprUserDataDeleteRequestedEto
{
public Guid UserId { get; set; }
}

13
framework/src/Volo.Abp.Gdpr.Abstractions/Volo/Abp/Gdpr/GdprUserDataPreparedEto.cs

@ -0,0 +1,13 @@
using System;
namespace Volo.Abp.Gdpr;
[Serializable]
public class GdprUserDataPreparedEto
{
public Guid RequestId { get; set; }
public string Provider { get; set; }
public GdprDataInfo Data { get; set; }
}

8
framework/src/Volo.Abp.Gdpr.Abstractions/Volo/Abp/Gdpr/GdprUserDataProviderBase.cs

@ -0,0 +1,8 @@
using System.Threading.Tasks;
namespace Volo.Abp.Gdpr;
public abstract class GdprUserDataProviderBase : IGdprUserDataProvider
{
public abstract Task<GdprDataInfo> GetAsync(GdprUserDataProviderContext context);
}

8
framework/src/Volo.Abp.Gdpr.Abstractions/Volo/Abp/Gdpr/GdprUserDataProviderContext.cs

@ -0,0 +1,8 @@
using System;
namespace Volo.Abp.Gdpr;
public class GdprUserDataProviderContext
{
public Guid UserId { get; set; }
}

41
framework/src/Volo.Abp.Gdpr.Abstractions/Volo/Abp/Gdpr/GdprUserDataRequestEventHandler.cs

@ -0,0 +1,41 @@
using System.Linq;
using System.Threading.Tasks;
using Microsoft.Extensions.DependencyInjection;
using Volo.Abp.DependencyInjection;
using Volo.Abp.EventBus.Distributed;
namespace Volo.Abp.Gdpr;
public class GdprUserDataRequestEventHandler
: IDistributedEventHandler<GdprUserDataRequestedEto>, ITransientDependency
{
protected IServiceScopeFactory ServiceScopeFactory { get; }
protected IDistributedEventBus EventBus { get; }
public GdprUserDataRequestEventHandler(IServiceScopeFactory serviceScopeFactory, IDistributedEventBus eventBus)
{
ServiceScopeFactory = serviceScopeFactory;
EventBus = eventBus;
}
public async Task HandleEventAsync(GdprUserDataRequestedEto eventData)
{
using (var scope = ServiceScopeFactory.CreateScope())
{
var gdprDataProviders = scope.ServiceProvider.GetServices<IGdprUserDataProvider>().ToList();
foreach (var gdprDataProvider in gdprDataProviders)
{
var gdprDataInfo = await gdprDataProvider.GetAsync(new GdprUserDataProviderContext { UserId = eventData.UserId});
await EventBus.PublishAsync(
new GdprUserDataPreparedEto
{
RequestId = eventData.RequestId,
Data = gdprDataInfo,
Provider = gdprDataProvider.GetType().FullName
});
}
}
}
}

11
framework/src/Volo.Abp.Gdpr.Abstractions/Volo/Abp/Gdpr/GdprUserDataRequestedEto.cs

@ -0,0 +1,11 @@
using System;
namespace Volo.Abp.Gdpr;
[Serializable]
public class GdprUserDataRequestedEto
{
public Guid UserId { get; set; }
public Guid RequestId { get; set; }
}

8
framework/src/Volo.Abp.Gdpr.Abstractions/Volo/Abp/Gdpr/IGdprUserDataProvider.cs

@ -0,0 +1,8 @@
using System.Threading.Tasks;
namespace Volo.Abp.Gdpr;
public interface IGdprUserDataProvider
{
Task<GdprDataInfo> GetAsync(GdprUserDataProviderContext context);
}
Loading…
Cancel
Save