Skip to content

Commit c609ecd

Browse files
imorlandluceosaskvortsov1flarum-botStyleCIBot
authored
chore: move flarum/gdpr into monorepo (#4290)
* first * moved exporting to job, sending email notification on completion, needs scheduled command/cron * prepare for first release * added command and readme * Update for beta 15 (#3) * Rename bokts to blomstras * Update for beta 15 - Translate emails - Register notification type so emails are sent - Use ServiceProvider extender instead of our own - Add ExportSerializer for notifications - Mithril 2 fixes * Request erasure controller (#13) * Update composer meta * Add logo.svg * Create first step deletion request controller, table migration, blueprint, model * Move logic to controller, rename delete to erasure * Update blueprint ref * Line endings * Create blade for confirm with token * Set processedBy as relation * Add placeholder for confirm route * Another line end * Use new classname for controller * Update translation key * Remove dispatcher * Update route name and path * Reguard * Add processedBy model relationship * Add build action * Bundled output for commit c7d6075 [skip ci] * Users can request erasure (#14) * Basic erasure request system * Login user, show alert on erasure request confirmation * Improve confirmation/status UI * Allow cancelling a current erasure request Only the user who made the request can cancel it. They will be notified via email to create a paper record. * Ensure notifications always sent If a user requests, cancels, and immediately requests again, the second request confirmation email won't be sent, as the ID will be the same, so NotificationSyncer will think it's the same notification. By logging the timestamp, we avoid this. * No alert necessary for confirming erasure requests * Apply fixes from StyleCI * Bundled output for commit 3d7d5fe [skip ci] * Admins can act on erasure requests (#15) * Basic erasure request system * Login user, show alert on erasure request confirmation * Improve confirmation/status UI * Allow cancelling a current erasure request Only the user who made the request can cancel it. They will be notified via email to create a paper record. * Ensure notifications always sent If a user requests, cancels, and immediately requests again, the second request confirmation email won't be sent, as the ID will be the same, so NotificationSyncer will think it's the same notification. By logging the timestamp, we avoid this. * Add settings and permissions * Admins can process requests * Apply fixes from StyleCI Co-authored-by: Ian Morland <[email protected]> * Bundled output for commit 246f249 [skip ci] * Fix missing semicolon * Apply fixes from StyleCI * npm audit fix * Update permission translation & key * WIP - Create ErasureJob * Apply fixes from StyleCI * remove commented line * remove nickname * Remove unset * Remove console.log * npm audit fix * Flarum 1.0 * Bundled output for commit bbb1d8d Includes transpiled JS/TS. [skip ci] * WIP - Create ErasureJob * Apply fixes from StyleCI * remove commented line * remove nickname * Remove unset * npm audit fix * Apply fixes from StyleCI * fix readme * wip * Apply fixes from StyleCI * remove log in logic, verify actor vs user * chore: cleaning up and php 8.1 compat * Apply fixes from StyleCI * Bundled output for commit 16f202c Includes transpiled JS/TS. [skip ci] * chore: remove dep for ext-zip, fix zip generation * chore(wip): adding extensibility for anonymization and deletion * Apply fixes from StyleCI * feat: implement delete and anonymize in erase request job * Apply fixes from StyleCI * feat: added events * Apply fixes from StyleCI * feat: add scheduled command for erase requests deletion * Apply fixes from StyleCI * chore: clean up erasure job and create new data types * Apply fixes from StyleCI * chore: simplify query to update ip address * fix: constraint blocks deletion * chore: working towards completion - implement erasure completed email - add export for tokens - add export for user - add ability to ignore user db columns from export * Apply fixes from StyleCI * Update and rename build.yml to frontend.yml * Update package.json * lock * Bundled output for commit 2a60003 Includes transpiled JS/TS, and Typescript declaration files (typings). [skip ci] * fix: two bugs grexxl found, controllers * fix: using addFile instead of string, fixes #18; * chore: repo maintenance (#25) * chore: add workflows * chore: bump js deps, format * chore: as we are using webpack 5, we need a min of core 1.2 * Apply fixes from StyleCI --------- Co-authored-by: StyleCI Bot <[email protected]> * Bundled output for commit d45abeb Includes transpiled JS/TS, and Typescript declaration files (typings). [skip ci] * chore: update package name name in README (#26) * chore: add workflows * chore: bump js deps, format * chore: as we are using webpack 5, we need a min of core 1.2 * Apply fixes from StyleCI * chore: update readme (correct package name) --------- Co-authored-by: StyleCI Bot <[email protected]> * chore: use default settings extender rather than deprecated migration * feat: working data export (#27) * feat: working data export * fix: erase console command not registered #24 * add destory console cmd to schedule * Bundled output for commit a87e2b2 Includes transpiled JS/TS, and Typescript declaration files (typings). [skip ci] * chore: minor translation tweak * feat: data exporter initial tests (#28) * feat: data exporter initial tests * Apply fixes from StyleCI * chore: enable backend testing * use the 2.x test backend, as we are targetting php8+ --------- Co-authored-by: StyleCI Bot <[email protected]> * fix: file already exists 500 error * fix: Email not send after erasure * chore: light cleanup and refactor * Apply fixes from StyleCI * improve user settings UI (#29) * Bundled output for commit 4beddeb Includes transpiled JS/TS, and Typescript declaration files (typings). [skip ci] * chore: typings * Apply fixes from StyleCI * Bundled output for commit 5a4ad04 Includes transpiled JS/TS, and Typescript declaration files (typings). [skip ci] * chore: update extender example, use pretty print in exports * chore: install whilst in beta example * feat: oauth users may request erasure also * Bundled output for commit d5a562d Includes transpiled JS/TS, and Typescript declaration files (typings). [skip ci] * fix: export user uploaded avatar from filesystem * feat: organize posts and tokens in folders * fix: update tokens test to new path * Apply fixes from StyleCI * feat: include discussion title in exported data * allow overloading the constructor * feat: include forum info file in export * Apply fixes from StyleCI * test forum attrs, restrict post exports to commentposts only * Apply fixes from StyleCI * chore: tests for UserData extender * Apply fixes from StyleCI * feat: allow specifying which queue to push gdpr jobs on to * Apply fixes from StyleCI * chore: document specifying queue name * fix: constructor params not passed * Apply fixes from StyleCI * feat: request erasure test * Apply fixes from StyleCI * feat: confirm erasure tests * Apply fixes from StyleCI * chore: prep frontend for refactor * Bundled output for commit 25ee01a Includes transpiled JS/TS, and Typescript declaration files (typings). [skip ci] * feat: display user entered reason during erasure flow * Bundled output for commit 94a2ca0 Includes transpiled JS/TS, and Typescript declaration files (typings). [skip ci] * chore: add erasure tests (#30) * chore: add erasure tests, deletion working erasure still not * Apply fixes from StyleCI * fix: anonymiztion mode * feat: utility function to get the table columns for a model * feat: ensure api does not allow erasure methods which are disabled * Apply fixes from StyleCI --------- Co-authored-by: StyleCI Bot <[email protected]> * dont delete discussion on erasure, let the cascade handle it. Shorten random username * feat: eye-friendly erasure usernames * Apply fixes from StyleCI * fix: show wrong password instead of not authorized * Apply fixes from StyleCI * chore: add test for flarum/nicknames and fof/user-bio anonymization * ensure user groups are removed * Apply fixes from StyleCI * chore: cancel erasure tests * Apply fixes from StyleCI * chore: use constants for status and mode * feat: export data on behalf of user (#31) * chore: use mode constant for default mode * feat: admin may generate exports on behalf of users * Apply fixes from StyleCI * chore: format * add frontend to request export data for others, replace delete user action with gdpr version * Apply fixes from StyleCI * fix: remove route test --------- Co-authored-by: StyleCI Bot <[email protected]> * Bundled output for commit 5f1c189 Includes transpiled JS/TS, and Typescript declaration files (typings). [skip ci] * chore: update readme with latest extender information * fix: anonymous username contained invalid char * use model change functions to ensure events are fired * fix: process erasure in anon mode not working * fix: pass the mode correctly * Apply fixes from StyleCI * Bundled output for commit db550f4 Includes transpiled JS/TS, and Typescript declaration files (typings). [skip ci] * fix: deletion mode via confirmed request * Apply fixes from StyleCI * fix: empty notification remains after export is destroyed * Apply fixes from StyleCI * fix: manual erasure * Apply fixes from StyleCI * Bundled output for commit 1b53d07 Includes transpiled JS/TS, and Typescript declaration files (typings). [skip ci] * fix: console error when downloading export file from alert notification * Bundled output for commit a081768 Includes transpiled JS/TS, and Typescript declaration files (typings). [skip ci] * add foreign key to erasure table * deletion mode disabled by default * show usercard in process erasure modal * Apply fixes from StyleCI * Bundled output for commit 3e3503c Includes transpiled JS/TS, and Typescript declaration files (typings). [skip ci] * feat: show user avatar on data export modal * Bundled output for commit 958f8a1 Includes transpiled JS/TS, and Typescript declaration files (typings). [skip ci] * chore: format * Bundled output for commit ccf1a3f Includes transpiled JS/TS, and Typescript declaration files (typings). [skip ci] * chore: add screenshot to readme * chore: bump core req, use revised extenders * chore: enable phpstan (#32) * chore: enable phpstan * fix: phpstan errors * remove no actor check, as it was never called anyway * store exports with meaningful filename, improve exists test * Apply fixes from StyleCI * fix: use unicode characters rather then encoding them * expand unit test of Type * Apply fixes from StyleCI * fix: process erasure not respecting method settings * chore: DataProcessor unit tests * Apply fixes from StyleCI * Distinguish between erasure modes for final confirmation email * Apply fixes from StyleCI * chore: show conditional extender usage example, add extension requirements * tweak help text for erasure modes * feat: gdpr admin info (#33) * npm audit fix * refactor DataProcessor, create ListDataTypes controller * Apply fixes from StyleCI * format js * ensure Data\User::class is always the last item to be processed * feat: gdpr admin page * Apply fixes from StyleCI --------- Co-authored-by: StyleCI Bot <[email protected]> * Bundled output for commit 2c49695 Includes transpiled JS/TS, and Typescript declaration files (typings). [skip ci] * chore: extract filesystem ops to StorageManager * Apply fixes from StyleCI * feat: translatable action descriptions, zipmanager, refactoring (#34) * feat: translatable action descriptions, zipmanager, refactoring * Apply fixes from StyleCI * return type is now string * feat: allow setting a custom anonymization username * translation * link between the two gdpr pages * chore: list compatible extensions * feat: allow either erasure method (when enabled) for direct user deletion * Apply fixes from StyleCI * ensure invalid modes are handled appropriately * Apply fixes from StyleCI --------- Co-authored-by: StyleCI Bot <[email protected]> * Bundled output for commit ff491a2 Includes transpiled JS/TS, and Typescript declaration files (typings). [skip ci] * beta.19 (#35) * feat: translatable action descriptions, zipmanager, refactoring * Apply fixes from StyleCI * return type is now string * feat: allow setting a custom anonymization username * translation * link between the two gdpr pages * chore: list compatible extensions * feat: allow either erasure method (when enabled) for direct user deletion * Apply fixes from StyleCI * ensure invalid modes are handled appropriately * Apply fixes from StyleCI * wip: user columns management * Apply fixes from StyleCI * add additional extensions to support list * Add ianm/twofactor to supported list * fix: extensions with svg icons do not render their link button * chore: update supported extension list * chore: prettier * include User model in Erased event * feat: mark which users are anonymized, remove most permissions on them * Apply fixes from StyleCI * chore: format * fix: users see export in controls, admin panel allows export for anonimized users * add credit to GlowingBlue * allow 'reservedAbilities' to be extended * Apply fixes from StyleCI * chore: test on php 8.3 * chore: reusable workflow for 1.x --------- Co-authored-by: StyleCI Bot <[email protected]> * Bundled output for commit bcdd85b Includes transpiled JS/TS, and Typescript declaration files (typings). [skip ci] * fix: route conflict with profile-cover and ban-ips (#37) * Bundled output for commit c503221 Includes transpiled JS/TS, and Typescript declaration files (typings). [skip ci] * Update README.md Sponsoring by third parties will not be massive banners inside the readme. * Update README.md This extension was never meant to be part of blomstra, but commercial or the foundation. * chore: refactor to flarum namespace * fix: gate breaks other extensions, fixes #42 * Update README.md * chore(2.0): update dependencies Update dependencies to Flarum 2.0 compatible versions. * chore(2.0): update infrastructure Update the extension infrastructure * chore(2.0): adapt to extending lazy modules Some Flarum modules are now lazy loaded. Extending them requires a different approach. * chore(2.0): misc frontend changes Miscellaneous frontend changes * chore(2.0): misc backend changes Miscellaneous backend changes * chore(2.0): code formatting with prettier Start by formatting your code with Prettier. * chore: conventional naming to help the tool * chore(2.0): JSON:API changes Flarum 2.0 completely changes the JSON:API implementation * chore(2.0): Backend tests + PHPUnit 9 to 11 changes Flarum 2.0 uses PHPUnit 11 and encourages use of model factories for easier cross-database testing. * chore(2.0): `LESS` code changes Many variables have been renamed to light/dark specific names and most are now used as CSS variables instead. * chore: misc fixes & namespace change * fix: conventional view namespace * chore(2.0): notification emails now require both plain text and HTML views You now need to provide both plain text and HTML views for notification emails. * fix: emails * chore: todo * fix: misc compatibility changes * feat: set cancellation data * feat: less chances of guessing files even if deleted after 1 day * chore: component based * fix * fix: cannot replace itself @SychO9 must have been a global str replace that did this, ammended * chore: switch to yarn * chore: move conditional logic to fof/oauth * chore: more types * chore: misc fixes & changes * chore: migrate settings to flarum * chore: update workflow * chore: migrate migrations * chore: use UserList userActionItems * fix: unable to cancel erasure request after confirmation * chore: move user-bio tests to fof/user-bio, update header comment * chore: move modules * docs: fix install command * Apply fixes from StyleCI * chore: no more beta (well technically yes, but..) * fix * chore * Bundled output for commit b7598e9 Includes transpiled JS/TS, and Typescript declaration files (typings). [skip ci] * chore: prepare 2.0.0-beta.1 * chore: housekeeping * Bundled output for commit 2231865 Includes transpiled JS/TS, and Typescript declaration files (typings). [skip ci] * chore: preparations * chore: minor admin frontend cleanup (#60) * chore: remove unused classname This change left aligns the button in the dropdown * fix: add title for adminnav button * chore: increase type safety * chore: rework some admin translations * Ditch `username()` for use in translations * Rename translation keys to better match structure of core * fix: extract text * Bundled output for commit cefe772 Includes transpiled JS/TS, and Typescript declaration files (typings). [skip ci] * fix: type error on delete endpoint (#63) * fix: type error on delete endpoint * Apply fixes from StyleCI * chore: remove php versions * fix: cancel erasure tests * fix: delete user tests * Apply fixes from StyleCI * fix: list datatype tests * fix: process erasure tests * fix: request erasure request tests * Apply fixes from StyleCI --------- Co-authored-by: StyleCI Bot <[email protected]> * chore: move flarum/gdpr into the framework monorepo * Apply fixes from StyleCI * chore: format js * chore: update licence * chore: update tsconfig for monorepo location * chore: more move to framework stuff * fix: typings --------- Co-authored-by: Daniël Klabbers <[email protected]> Co-authored-by: Alexander Skvortsov <[email protected]> Co-authored-by: flarum-bot <[email protected]> Co-authored-by: Ian Morland <[email protected]> Co-authored-by: Alexander Skvortsov <[email protected]> Co-authored-by: Daniel Klabbers <[email protected]> Co-authored-by: Daniël Klabbers <[email protected]> Co-authored-by: StyleCI Bot <[email protected]> Co-authored-by: Sami Mazouz <[email protected]> Co-authored-by: Davide Iadeluca <[email protected]>
1 parent 456b6ba commit c609ecd

File tree

153 files changed

+10071
-1
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

153 files changed

+10071
-1
lines changed

.github/workflows/backend.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,4 @@ jobs:
88
with:
99
enable_backend_testing: true
1010
backend_directory: .
11-
monorepo_tests: "framework/core extensions/akismet extensions/approval extensions/flags extensions/likes extensions/mentions extensions/nicknames extensions/statistics extensions/sticky extensions/subscriptions extensions/suspend extensions/tags extensions/messages php-packages/testing/tests"
11+
monorepo_tests: "framework/core extensions/akismet extensions/approval extensions/flags extensions/likes extensions/mentions extensions/nicknames extensions/statistics extensions/sticky extensions/subscriptions extensions/suspend extensions/tags extensions/messages extensions/gdpr php-packages/testing/tests"

composer.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@
4242
"Flarum\\Approval\\": "extensions/approval/src",
4343
"Flarum\\BBCode\\": "extensions/bbcode/src",
4444
"Flarum\\Flags\\": "extensions/flags/src",
45+
"Flarum\\Gdpr\\": "extensions/gdpr/src",
4546
"Flarum\\Likes\\": "extensions/likes/src",
4647
"Flarum\\Lock\\": "extensions/lock/src",
4748
"Flarum\\Mentions\\": "extensions/mentions/src",
@@ -67,6 +68,7 @@
6768
"Flarum\\Akismet\\Tests\\": "extensions/akismet/tests",
6869
"Flarum\\Approval\\Tests\\": "extensions/approval/tests",
6970
"Flarum\\Flags\\Tests\\": "extensions/flags/tests",
71+
"Flarum\\Gdpr\\Tests\\": "extensions/gdpr/tests",
7072
"Flarum\\Likes\\Tests\\": "extensions/likes/tests",
7173
"Flarum\\Lock\\Tests\\": "extensions/lock/tests",
7274
"Flarum\\Mentions\\Tests\\": "extensions/mentions/tests",
@@ -90,6 +92,7 @@
9092
"flarum/embed": "self.version",
9193
"flarum/emoji": "self.version",
9294
"flarum/flags": "self.version",
95+
"flarum/gdpr": "self.version",
9396
"flarum/lang-english": "self.version",
9497
"flarum/likes": "self.version",
9598
"flarum/lock": "self.version",
@@ -147,6 +150,7 @@
147150
"middlewares/base-path-router": "^2.0.1",
148151
"middlewares/request-handler": "^2.0.2",
149152
"monolog/monolog": "^3.3",
153+
"nelexa/zip": "^4.0.2",
150154
"nesbot/carbon": "^3.0",
151155
"nikic/fast-route": "^1.3",
152156
"psr/http-message": "^1.1",
@@ -188,6 +192,7 @@
188192
"extensions/embed",
189193
"extensions/emoji",
190194
"extensions/flags",
195+
"extensions/gdpr",
191196
"extensions/lang-english",
192197
"extensions/likes",
193198
"extensions/lock",

extensions/gdpr/.editorconfig

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
# EditorConfig helps developers define and maintain consistent
2+
# coding styles between different editors and IDEs
3+
# editorconfig.org
4+
5+
root = true
6+
7+
[*]
8+
end_of_line = lf
9+
charset = utf-8
10+
trim_trailing_whitespace = true
11+
insert_final_newline = true
12+
indent_style = space
13+
indent_size = 2
14+
15+
[*.{diff,md}]
16+
trim_trailing_whitespace = false
17+
18+
[*.{php,xml,json}]
19+
indent_size = 4
20+
21+
[{tsconfig.json,prettierrc.json}]
22+
indent_size = 2
23+
24+
[*.neon]
25+
indent_style = tab
26+
27+
[{install,update}.php]
28+
indent_size = 2

extensions/gdpr/.gitattributes

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
.gitattributes export-ignore
2+
.github export-ignore
3+
.gitignore export-ignore
4+
.gitmodules export-ignore
5+
js/*/src export-ignore
6+
js/*/Gulfile.js
7+
js/*/package.json
8+
js/*/yarn.lock
9+
10+
js/*/dist/*.js -diff

extensions/gdpr/.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
js/node_modules
2+
vendor/
3+
composer.lock
4+
.phpunit.result.cache

extensions/gdpr/LICENSE.md

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
The MIT License (MIT)
2+
3+
Copyright (c) Stichting Flarum (Flarum Foundation)
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

extensions/gdpr/README.md

Lines changed: 113 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,113 @@
1+
# GDPR or PII management
2+
3+
This extension allows users increasing control over their data.
4+
5+
### Requirements
6+
7+
- `flarum/core` - `v2.0` or higher
8+
- `PHP` - `8.2` or higher
9+
10+
### Installation or update
11+
12+
Install manually with composer:
13+
14+
```sh
15+
composer require flarum/gdpr:^2.0.0
16+
```
17+
18+
### Use
19+
20+
All forum users now have a `Personal Data` section within their account settings page:
21+
22+
![image](https://github.com/flarum/gdpr/assets/16573496/4e469956-709f-4ba3-a5fe-d3fcb0401b73)
23+
24+
From here, users may self-service export their data from the forum, or start an erasure request. Erasure requests are queued up for admins/moderators to process. Any unprocessed requests that are still pending after 30 days will be processed automatically using the configured default method (Deletion or Anonymization).
25+
26+
#### Specifying which queue to use
27+
If your forum runs multiple queues, ie `low` and `high`, you may specify which queue jobs for this extension are run on in your skeleton's `extend.php` file:
28+
29+
```php
30+
Blomstra\Gdpr\Jobs\GdprJob::$onQueue = 'low';
31+
32+
return [
33+
... your current extenders,
34+
];
35+
```
36+
37+
### For developers
38+
39+
You can easily register a new Data type, remove an existing Data type, or exclude specific columns from the user table during export by leveraging the `Flarum\Gdpr\Extend\UserData` extender. Ensure that you wrap the GDPR extender in a conditional extend, so that forum owners can choose if they want to enable GDPR functionality or not. This functionality requires `flarum/core` `v2.0` or higher, so that should be set as your extension's minimum requirement.
40+
41+
#### Registering a new Data Type:
42+
43+
Your data type class should implement the `Blomstra\Gdpr\Contracts\DataType`:
44+
```php
45+
<?php
46+
47+
use Blomstra\Gdpr\Extend\UserData;
48+
use Blomstra\Extend;
49+
50+
return [
51+
(new Extend\Conditional())
52+
->whenExtensionEnabled('flarum-gdpr', fn () => [
53+
(new UserData())
54+
->addType(Your\Own\DataType::class),
55+
56+
... other conditional extenders as required ...
57+
]),
58+
];
59+
```
60+
61+
The implementation you create needs a export method, it will receive a ZipArchive resource.
62+
You can use that to add any strings or actual files to the archive. Make sure to properly
63+
name the file and always prefix it with your extension slug (flarum-something-filename).
64+
65+
#### Removing a Data Type:
66+
If for any reason you want to exclude a certain DataType from the export:
67+
```php
68+
use Blomstra\Gdpr\Extend\UserData;
69+
use Blomstra\Extend;
70+
71+
return [
72+
(new Extend\Conditional())
73+
->whenExtensionEnabled('flarum-gdpr', fn () => [
74+
(new UserData())
75+
->removeType(Your\Own\DataType::class),
76+
77+
... other conditional extenders as required ...
78+
]),
79+
];
80+
```
81+
82+
#### Exclude specific columns from the user table during export:
83+
```php
84+
use Blomstra\Gdpr\Extend\UserData;
85+
86+
return [
87+
(new Extend\Conditional())
88+
->whenExtensionEnabled('flarum-gdpr', fn () => [
89+
(new UserData())
90+
->removeUserColumn('column_name') // For a single column
91+
->removeUserColumns(['column1', 'column2']), // For multiple columns
92+
93+
... other conditional extenders as required ...
94+
]),
95+
];
96+
```
97+
### Flarum extensions
98+
99+
These are the known extensions which offer GDPR data integration with this extension. Don't see a required extension listed? Contact the author to request it
100+
101+
- [2FA](https://github.com/imorland/flarum-ext-twofactor), since `2.0`
102+
- [Boring Avatars](https://github.com/imorland/flarum-ext-boring-avatars), since `2.0`
103+
- [FoF Ban IPs](https://github.com/FriendsOfFlarum/ban-ips), since `2.0`
104+
- [FoF Drafts](https://github.com/FriendsOfFlarum/drafts), since `2.0`
105+
- [FoF Follow Tags](https://github.com/FriendsOfFlarum/follow-tags), since `2.0`
106+
- [FoF Terms](https://github.com/FriendsOfFlarum/terms), since `2.0`
107+
- [FoF Upload](https://github.com/FriendsOfFlarum/upload), since `2.0`
108+
- [FoF User Bio](https://github.com/FriendsOfFlarum/user-bio), since `2.0`
109+
- [Follow Users](https://github.com/imorland/follow-users), since `2.0`
110+
111+
### FAQ & Recommendations
112+
113+
- Generating the zip archive can be pushed to queue functionality. This is exceptionally important on larger communities and with more extensions that work with the gdpr extension to allow data exports.

extensions/gdpr/composer.json

Lines changed: 97 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,97 @@
1+
{
2+
"name": "flarum/gdpr",
3+
"description": "Features for GDPR, PII management",
4+
"keywords": [
5+
"extension",
6+
"flarum",
7+
"pii",
8+
"gdpr",
9+
"export"
10+
],
11+
"type": "flarum-extension",
12+
"license": "MIT",
13+
"support": {
14+
"issues": "https://github.com/flarum/framework/issues",
15+
"source": "https://github.com/flarum/gdpr",
16+
"forum": "https://discuss.flarum.org"
17+
},
18+
"homepage": "https://flarum.org",
19+
"funding": [
20+
{
21+
"type": "website",
22+
"url": "https://flarum.org/donate/"
23+
}
24+
],
25+
"require": {
26+
"flarum/core": "^2.0.0-beta.4",
27+
"nelexa/zip": "^4.0.2"
28+
},
29+
"autoload": {
30+
"psr-4": {
31+
"Flarum\\Gdpr\\": "src/"
32+
}
33+
},
34+
"replace": {
35+
"blomstra/gdpr": "*"
36+
},
37+
"extra": {
38+
"branch-alias": {
39+
"dev-main": "2.x-dev"
40+
},
41+
"flarum-extension": {
42+
"title": "GDPR Data Management",
43+
"category": "feature",
44+
"icon": {
45+
"image": "resources/logo.svg",
46+
"backgroundColor": "#EBF1FD",
47+
"color": "#3a98d0",
48+
"backgroundSize": "90%",
49+
"backgroundRepeat": "no-repeat",
50+
"backgroundPosition": "center"
51+
}
52+
},
53+
"flarum-cli": {
54+
"modules": {
55+
"githubActions": true,
56+
"typescript": true,
57+
"backendTesting": true,
58+
"jsCommon": true
59+
}
60+
}
61+
},
62+
"repositories": [
63+
{
64+
"type": "path",
65+
"url": "../../*/*"
66+
}
67+
],
68+
"minimum-stability": "dev",
69+
"prefer-stable": true,
70+
"autoload-dev": {
71+
"psr-4": {
72+
"Flarum\\Gdpr\\Tests\\": "tests/"
73+
}
74+
},
75+
"scripts": {
76+
"test": [
77+
"@test:unit",
78+
"@test:integration"
79+
],
80+
"test:unit": "phpunit -c tests/phpunit.unit.xml",
81+
"test:integration": "phpunit -c tests/phpunit.integration.xml",
82+
"test:setup": "@php tests/integration/setup.php",
83+
"analyse:phpstan": "phpstan analyse",
84+
"clear-cache:phpstan": "phpstan clear-result-cache"
85+
},
86+
"scripts-descriptions": {
87+
"test": "Runs all tests.",
88+
"test:unit": "Runs all unit tests.",
89+
"test:integration": "Runs all integration tests.",
90+
"test:setup": "Sets up a database for use with integration tests. Execute this only once.",
91+
"analyse:phpstan": "Run static analysis"
92+
},
93+
"require-dev": {
94+
"flarum/testing": "^2.0.0-beta",
95+
"flarum/phpstan": "^2.0.0-beta"
96+
}
97+
}

0 commit comments

Comments
 (0)