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

GDPR #404

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft

GDPR #404

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
10 changes: 8 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@
"packages/PdoEventSourcing/src",
"packages/PdoEventSourcing/src"
],
"Ecotone\\GDPR\\": "packages/GDPR/src",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

DataProtection as package name sounds good :)

"Ecotone\\JMSConverter\\": "packages/JmsConverter/src",
"Ecotone\\Redis\\": "packages/Redis/src",
"Ecotone\\Sqs\\": "packages/Sqs/src",
Expand Down Expand Up @@ -84,6 +85,9 @@
"packages/EventSourcing/tests",
"packages/PdoEventSourcing/tests"
],
"Test\\Ecotone\\GDPR\\": [
"packages/GDPR/tests"
],
"Test\\Ecotone\\JMSConverter\\": [
"packages/JmsConverter/tests"
],
Expand All @@ -107,6 +111,8 @@
}
},
"require": {
"ext-amqp": "*",
"ext-openssl": "*",
"php": "^8.0",
"doctrine/dbal": "^2.12.0|^3.0",
"doctrine/persistence": "^2.5",
Expand All @@ -116,7 +122,6 @@
"enqueue/sqs": "^0.10.15",
"enqueue/dsn": "^0.10.4",
"enqueue/enqueue": "^0.10.0",
"ext-amqp": "*",
"laminas/laminas-code": "^4",
"jms/serializer": "^3.17",
"laravel/framework": "^9.5.2|^10.0|^11.0",
Expand All @@ -131,7 +136,8 @@
"wikimedia/composer-merge-plugin": "^2.1",
"php-di/php-di": "^7.0.1",
"open-telemetry/sdk": "^1.0.0",
"psr/container": "^1.1.1|^2.0.1"
"psr/container": "^1.1.1|^2.0.1",
"defuse/php-encryption": "^2.4"
},
"require-dev": {
"behat/behat": "^3.10",
Expand Down
7 changes: 7 additions & 0 deletions packages/Ecotone/src/Messaging/Config/ModuleClassList.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@
use Ecotone\Dbal\ObjectManager\ObjectManagerModule;
use Ecotone\Dbal\Recoverability\DbalDeadLetterModule;
use Ecotone\EventSourcing\Config\EventSourcingModule;
use Ecotone\GDPR\Config\ForgettablePayloadModule;
use Ecotone\GDPR\Config\PersonalDataModule;
use Ecotone\JMSConverter\Configuration\JMSConverterConfigurationModule;
use Ecotone\JMSConverter\Configuration\JMSDefaultSerialization;
use Ecotone\Laravel\Config\LaravelConnectionModule;
Expand Down Expand Up @@ -157,4 +159,9 @@ class ModuleClassList
public const SYMFONY_MODULES = [
SymfonyConnectionModule::class,
];

public const GDPR_MODULES = [
PersonalDataModule::class,
ForgettablePayloadModule::class,
];
}
3 changes: 3 additions & 0 deletions packages/Ecotone/src/Messaging/Config/ModulePackageList.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ final class ModulePackageList
public const TRACING_PACKAGE = 'tracing';
public const LARAVEL_PACKAGE = 'laravel';
public const SYMFONY_PACKAGE = 'symfony';
public const GDPR_PACKAGE = 'gdpr';
public const TEST_PACKAGE = 'test';

public static function getModuleClassesForPackage(string $packageName): array
Expand All @@ -37,6 +38,7 @@ public static function getModuleClassesForPackage(string $packageName): array
ModulePackageList::TEST_PACKAGE => ModuleClassList::TEST_MODULES,
ModulePackageList::LARAVEL_PACKAGE => ModuleClassList::LARAVEL_MODULES,
ModulePackageList::SYMFONY_PACKAGE => ModuleClassList::SYMFONY_MODULES,
ModulePackageList::GDPR_PACKAGE => ModuleClassList::GDPR_MODULES,
default => throw ConfigurationException::create(sprintf('Given unknown package name %s. Available packages name are: %s', $packageName, implode(',', self::allPackages())))
};
}
Expand All @@ -58,6 +60,7 @@ public static function allPackages(): array
self::TRACING_PACKAGE,
self::LARAVEL_PACKAGE,
self::SYMFONY_PACKAGE,
self::GDPR_PACKAGE,
];
}

Expand Down
7 changes: 7 additions & 0 deletions packages/GDPR/.gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
tests/ export-ignore
.coveralls.yml export-ignore
.gitattributes export-ignore
.gitignore export-ignore
behat.yaml export-ignore
phpstan.neon export-ignore
phpunit.xml export-ignore
9 changes: 9 additions & 0 deletions packages/GDPR/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
.idea/
vendor/
bin/
tests/coverage
!tests/coverage/.gitkeep
file
.phpunit.result.cache
composer.lock
phpunit.xml
21 changes: 21 additions & 0 deletions packages/GDPR/LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
Copyright (c) 2024 Dariusz Gafka <[email protected]>

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.

**Scope of the License**

Apache-2.0 Licence applies to non Enterprise Functionalities of the Ecotone Framework.
Functionalities of the Ecotone Framework referred to as Enterprise functionalities, are not covered under the Apache-2.0 license. These functionalities are provided under a separate Enterprise License.
For details on the Enterprise License, please write to [email protected].
50 changes: 50 additions & 0 deletions packages/GDPR/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
# This is Read Only Repository
To contribute make use of [Ecotone-Dev repository](https://github.com/ecotoneframework/ecotone-dev).

<p align="left"><a href="https://ecotone.tech" target="_blank">
<img src="https://github.com/ecotoneframework/ecotone-dev/blob/main/ecotone_small.png?raw=true">
</a></p>

![Github Actions](https://github.com/ecotoneFramework/ecotone-dev/actions/workflows/split-testing.yml/badge.svg)
[![Latest Stable Version](https://poser.pugx.org/ecotone/ecotone/v/stable)](https://packagist.org/packages/ecotone/ecotone)
[![License](https://poser.pugx.org/ecotone/ecotone/license)](https://packagist.org/packages/ecotone/ecotone)
[![Total Downloads](https://img.shields.io/packagist/dt/ecotone/ecotone)](https://packagist.org/packages/ecotone/ecotone)
[![PHP Version Require](https://img.shields.io/packagist/dependency-v/ecotone/ecotone/php.svg)](https://packagist.org/packages/ecotone/ecotone)

`Ecotone Framework` is a `Service Bus` which enables `Message-Driven` architecture in `PHP`.
Based on resilient Message-Driven principles provides support for building applications that follows `Domain-Driven Design` (DDD), `Command Query Responsibility Segregation` (CQRS) and `Event Sourcing` (ES).

> The term "Ecotone", in ecology means transition area between ecosystems, such as forest and grassland.
The Ecotone Framework functions as transition area between your components, modules and services. It glues things together, yet respects the boundaries of each area.

> Ecotone can be used with [Symfony](https://docs.ecotone.tech/modules/symfony-ddd-cqrs-event-sourcing) and [Laravel](https://docs.ecotone.tech/modules/laravel-ddd-cqrs-event-sourcing) frameworks.

## Getting started

The quickstart [page](https://docs.ecotone.tech/quick-start) of the
[reference guide](https://docs.ecotone.tech) provides a starting point for using Ecotone.
Read more on the [Ecotone's Blog](https://blog.ecotone.tech).

## Feature requests and issue reporting

Use [issue tracking system](https://github.com/ecotoneframework/ecotone-dev/issues) for new feature request and bugs.
Please verify that it's not already reported by someone else.

## Contact

If you want to talk or ask question about Ecotone

- [**Twitter**](https://twitter.com/EcotonePHP)
- **[email protected]**
- [**Community Channel**](https://discord.gg/CctGMcrYnV)

## Support Ecotone

If you want to help building and improving Ecotone consider becoming a sponsor:

- [Sponsor Ecotone](https://github.com/sponsors/dgafka)
- [Contribute to Ecotone](https://github.com/ecotoneframework/ecotone-dev).

## Tags

PHP DDD CQRS Event Sourcing Symfony Laravel Service Bus
90 changes: 90 additions & 0 deletions packages/GDPR/composer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
{
"name": "ecotone/gdpr",
"license": [
"Apache-2.0",
"proprietary"
],
"homepage": "https://docs.ecotone.tech/",
"forum": "https://discord.gg/CctGMcrYnV",
"type": "library",
"minimum-stability": "dev",
"prefer-stable": true,
"authors": [
{
"name": "Dariusz Gafka",
"email": "[email protected]"
},
{
"name": "Piotr Zając",
"email": "[email protected]"
}
],
"keywords": [
"ecotone",
"GDPR",
"personal data",
"encryption",
"event sourcing"
],
"description": "Extends Ecotone with encryption of personal data in recorded events",
"autoload": {
"psr-4": {
"Ecotone\\GDPR\\": "src"
}
},
"autoload-dev": {
"psr-4": {
"Test\\Ecotone\\GDPR\\": [
"tests"
]
}
},
"require": {
"ext-openssl": "*",
"defuse/php-encryption": "^2.4",
"ecotone/pdo-event-sourcing": "~1.235.1"
},
"require-dev": {
"phpunit/phpunit": "^9.6",
"phpstan/phpstan": "^1.8",
"wikimedia/composer-merge-plugin": "^2.1"
},
"scripts": {
"tests:phpstan": "vendor/bin/phpstan",
"tests:phpunit": "vendor/bin/phpunit",
"tests:ci": [
"@tests:phpstan",
"@tests:phpunit"
]
},
"extra": {
"branch-alias": {
"dev-main": "1.235.1-dev"
},
"ecotone": {
"repository": "gdpr"
},
"merge-plugin": {
"include": [
"../local_packages.json"
]
},
"license-info": {
"Apache-2.0": {
"name": "Apache License 2.0",
"url": "https://github.com/ecotoneframework/ecotone-dev/blob/main/LICENSE",
"description": "Allows to use non Enterprise features of Ecotone. For more information please write to [email protected]"
},
"proprietary": {
"name": "Enterprise License",
"description": "Allows to use Enterprise features of Ecotone. For more information please write to [email protected]"
}
},
"release-time": "2024-10-26 14:55:13"
},
"config": {
"allow-plugins": {
"wikimedia/composer-merge-plugin": true
}
}
}
4 changes: 4 additions & 0 deletions packages/GDPR/phpstan.neon
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
parameters:
level: 1
paths:
- src
20 changes: 20 additions & 0 deletions packages/GDPR/phpunit.xml.dist
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
<?xml version="1.0" encoding="UTF-8"?>
<phpunit
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/9.5/phpunit.xsd"
backupGlobals="true"
>
<coverage processUncoveredFiles="true">
<include>
<directory suffix=".php">./src</directory>
</include>
<report>
<text outputFile="php://stdout" showOnlySummary="true" />
</report>
</coverage>
<testsuites>
<testsuite name="Unit Tests">
<directory>tests</directory>
</testsuite>
</testsuites>
</phpunit>
10 changes: 10 additions & 0 deletions packages/GDPR/src/Attribute/PersonalData.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<?php

declare(strict_types=1);

namespace Ecotone\GDPR\Attribute;

#[\Attribute(\Attribute::TARGET_PROPERTY)]
final class PersonalData
{
}
49 changes: 49 additions & 0 deletions packages/GDPR/src/Config/ForgettablePayloadModule.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
<?php

declare(strict_types=1);

namespace Ecotone\GDPR\Config;

use Ecotone\AnnotationFinder\AnnotationFinder;
use Ecotone\EventSourcing\EventStore;
use Ecotone\GDPR\ForgettablePayload\ForgettablePayloadConfiguration;
use Ecotone\Messaging\Attribute\ModuleAnnotation;
use Ecotone\Messaging\Config\Annotation\ModuleConfiguration\ExtensionObjectResolver;
use Ecotone\Messaging\Config\Annotation\ModuleConfiguration\NoExternalConfigurationModule;
use Ecotone\Messaging\Config\Configuration;
use Ecotone\Messaging\Config\ModulePackageList;
use Ecotone\Messaging\Config\ModuleReferenceSearchService;
use Ecotone\Messaging\Handler\InterfaceToCallRegistry;

/**
* licence Apache-2.0
*/
#[ModuleAnnotation]
final class ForgettablePayloadModule extends NoExternalConfigurationModule
{
public static function create(AnnotationFinder $annotationRegistrationService, InterfaceToCallRegistry $interfaceToCallRegistry): static
{
return new self();
}

public function prepare(
Configuration $messagingConfiguration,
array $extensionObjects,
ModuleReferenceSearchService $moduleReferenceSearchService,
InterfaceToCallRegistry $interfaceToCallRegistry
): void {
if (! ExtensionObjectResolver::contains(ForgettablePayloadConfiguration::class, $extensionObjects)) {
return;
}
}

public function canHandle($extensionObject): bool
{
return $extensionObject instanceof ForgettablePayloadConfiguration;
}

public function getModulePackageName(): string
{
return ModulePackageList::GDPR_PACKAGE;
}
}
Loading
Loading