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

Add a way to allow unencrypted stored data #46

Open
tonysm opened this issue Mar 2, 2024 · 0 comments
Open

Add a way to allow unencrypted stored data #46

tonysm opened this issue Mar 2, 2024 · 0 comments

Comments

@tonysm
Copy link
Owner

tonysm commented Mar 2, 2024

This might be useful when migrating data that was initially unencrypted.

My current thinking is something like:

Post::query()->each(function ($post) {
    $post->withoutRichTextDecryptionOnRead(function () use ($post {
        $post->update(['content' => $post->content?->toTrixHtml()]);
    });
});

But it could also look like this:

protected $richTextAttributes = [
    'content' => ['encrypted' => true, 'allow_unencrypted_data' => true],
];

The idea is that we allow the decryption to fail when reading the data when that context is set. This way, we allow encrypting existing data that's currently not encrypted at rest.

@tonysm tonysm changed the title Add a way to bypass decryption (on read) Add a way to allow unencrypted stored data Mar 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant