jvmtech / anonymizer
在 Neos CMS NodeTypes 和 Neos Flow Domain Models 中匿名化属性值
1.1.3
2024-06-20 04:54 UTC
Requires
- neos/neos: >=8.0 <9.0 || dev-master
README
在 Neos CMS NodeTypes 和 Neos Flow Domain Models 中匿名化属性值。
安装
composer require jvmtech/anonymizer
支持的属性类型
- 文本
- 日期时间
- 资产
- text/csv
- image/gif
- image/jpeg
- video/mp4
- application/pdf
- image/png
- image/svg+xml
- text/plain
- video/webm
- application/zip
- application/vnd.oasis.opendocument.text
- application/vnd.openxmlformats-officedocument.wordprocessingml.document
- application/vnd.openxmlformats-officedocument.presentationml.presentation
- application/vnd.openxmlformats-officedocument.spreadsheetml.sheet
- 可通过配置扩展...
配置
JvMTECH:
Anonymizer:
nodeTypes:
'Your.Vendor:Your.NodeType':
properties:
name:
anonymize: true
email:
shuffle: true
video:
anonymize: true
domainModels:
'Your\Vendor\Domain\Repository\YourModelRepository':
dateTimeFilter: # optional
propertyName: 'creationDateTime'
olderThan: -90 # days
# olderThan: '2023-01-01 00:00:00' # or by date
properties:
name:
anonymize: true
email:
shuffle: true
video:
anonymize: true
示例用法 "删除 90 天前的用户数据"
- 添加一个 "Your\Vendor\Domain\Repository\YourModelRepository" 配置,包含
dateTimeFilter.propertyName: 'creationDateTime'
和dateTimeFilter.olderThan: -90
,以及匹配的属性设置 - 每月运行一次匿名化命令
./flow anonymize:domainmodels --only "Your\Vendor\Domain\Repository\YourModelRepository" --force
示例用法 "为本地开发创建干净数据"
- 添加一个 "Your.Vendor:Your.NodeType" 配置,包含匹配的属性设置
- 克隆生产项目容器
- 运行匿名化命令
./flow anonymize:nodetypes --force
和./flow anonymize:domainmodels --force
- 删除所有不需要的资产
./flow media:removeunused --assume-yes
- 执行您需要做的更具体的事情
- 现在使干净的容器或数据转储对您的团队可访问
愿望列表
- 按日期时间过滤以处理旧数据的自动匿名化
- 定义特定类型范围的选项
- 例如,日期时间:"从初始值随机加减 6 个月"
- 例如,数字:"介于 100 和 1000 之间的随机数"
- 定义自定义匿名化方法的选项
- 资产的像素化,而不仅仅是替换
- 欢迎其他有用的 PR 和想法!
由 jvmtech.ch 提供