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

Allow multiple sensitive data in one object #58

Open
DanielBadura opened this issue Oct 20, 2024 · 0 comments
Open

Allow multiple sensitive data in one object #58

DanielBadura opened this issue Oct 20, 2024 · 0 comments
Labels
enhancement New feature or request

Comments

@DanielBadura
Copy link
Member

There are situations where an object has mutliple sources of personal data. Let's take a transaction as an example:

class Transaction
{
    public function __construct(
        public TransactionId $transactionId,
        public UserId $senderId,
        #[PersonalData(fallback: 'anon')]
        public string $senderName,
        public UserId $receiverId,
        #[PersonalData(fallback: 'anon')]
        public string $receiverName,
    ) {}
}

Right now, we cannot support to only anonymize only the sender or receiver due to the limitation of only having one DataSubjectId. I thought about adding an identifier to DataSubjectId which could be referenced by PersonalData. This could look like this:

class Transaction
{
    public function __construct(
        public TransactionId $transactionId,
        #[DataSubjectId('sender')]
        public UserId $senderId,
        #[PersonalData(fallback: 'anon', identifier: 'sender')]
        public string $senderName,
        #[DataSubjectId('receiver')]
        public UserId $receiverId,
        #[PersonalData(fallback: 'anon', identifier: 'receiver')]
        public string $receiverName,
    ) {}
}

The attribute changes can be done BC free, not sure about the metadata implementations. But first, we should clarify if this case is valid.

@DanielBadura DanielBadura added the enhancement New feature or request label Oct 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant