-
Notifications
You must be signed in to change notification settings - Fork 0
Component object fingerprint value #8
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,15 @@ | ||
| <?php | ||
|
|
||
| namespace Symfony\UX\LiveComponent\Util; | ||
|
|
||
| class FingerprintCalculator | ||
weaverryan marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| { | ||
| public function __construct(private string $secret) | ||
| { | ||
| } | ||
|
|
||
| public function calculateFingerprint(array $data): string | ||
| { | ||
| return base64_encode(hash_hmac('sha256', serialize($data), $this->secret, true)); | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is all internal so we can change later but maybe we should create a In a future PR, will you need to verify the fingerprint?
Owner
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'm going to save for later, but you're right. Related, it's odd to have to pass the There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yeah, a new |
||
| } | ||
| } | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,6 +1,7 @@ | ||
| {{ component('todo_list', { | ||
| items: [ | ||
| { text: 'item 1'}, | ||
| { text: 'item 2'} | ||
| { text: 'milk'}, | ||
| { text: 'cheese'}, | ||
| { text: 'milk'}, | ||
| ] | ||
| }) }} |
Uh oh!
There was an error while loading. Please reload this page.