chg: [internal] Ingest key just for protected events

pull/8394/head
Jakub Onderka 2022-05-20 23:00:31 +02:00
parent 197544e5c6
commit b4571b0502
2 changed files with 2 additions and 2 deletions

View File

@ -1665,7 +1665,7 @@ class EventsController extends AppController
$this->set('mayModify', $this->__canModifyEvent($event));
$this->set('mayPublish', $this->__canPublishEvent($event));
try {
$instanceKey = $this->Event->CryptographicKey->ingestInstanceKey();
$instanceKey = $event['Event']['protected'] ? $this->Event->CryptographicKey->ingestInstanceKey() : null;
} catch (Exception $e) {
$instanceKey = null;
}

View File

@ -1,5 +1,4 @@
<?php
$keys = Hash::extract($data, $field['path']);
$event = Hash::extract($data, $field['event_path']);
if ($event['protected']) {
echo sprintf(
@ -26,6 +25,7 @@
)
);
$foundInstanceKey = false;
$keys = Hash::extract($data, $field['path']);
foreach ($keys as $key) {
$isInstanceKey = $key['fingerprint'] === $field['instanceFingerprint'];
if ($isInstanceKey) {