-
-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
feat(encryption): Migrate from hooks to events #48560
base: master
Are you sure you want to change the base?
Conversation
7b456c7
to
fc22188
Compare
Getting there, only one more failure. For some reason it’s not the same one locally and in the CI 🤷 |
1d2e3f4
to
f392a55
Compare
efb5812
to
4a3def9
Compare
Signed-off-by: Côme Chilliet <[email protected]>
…ffects It was clearing the hooks with the same results before Signed-off-by: Côme Chilliet <[email protected]>
…ects Adapt tests a bit to make them pass with Encryption wrapper registered Signed-off-by: Côme Chilliet <[email protected]>
Signed-off-by: Côme Chilliet <[email protected]>
…ith encryption registered Signed-off-by: Côme Chilliet <[email protected]>
Signed-off-by: Côme Chilliet <[email protected]>
…ems in files_versions tests Signed-off-by: Côme Chilliet <[email protected]>
Signed-off-by: Côme Chilliet <[email protected]>
Signed-off-by: Côme Chilliet <[email protected]>
Signed-off-by: Côme Chilliet <[email protected]>
Signed-off-by: Côme Chilliet <[email protected]>
…tions Signed-off-by: Côme Chilliet <[email protected]>
…n wrapper is present Signed-off-by: Côme Chilliet <[email protected]>
Signed-off-by: Côme Chilliet <[email protected]>
314010a
to
14b8770
Compare
d47a006
to
bfbc787
Compare
@@ -521,15 +522,31 @@ | |||
// - remove $this->copyBetweenStorage | |||
|
|||
if (!$sourceStorage->isDeletable($sourceInternalPath)) { | |||
echo "[DEBUG] $sourceInternalPath $targetInternalPath not deletable " . __FILE__ . ':' . __LINE__ . "\n"; |
Check failure
Code scanning / Psalm
TaintedHtml Error
@@ -521,15 +522,31 @@ | |||
// - remove $this->copyBetweenStorage | |||
|
|||
if (!$sourceStorage->isDeletable($sourceInternalPath)) { | |||
echo "[DEBUG] $sourceInternalPath $targetInternalPath not deletable " . __FILE__ . ':' . __LINE__ . "\n"; |
Check failure
Code scanning / Psalm
TaintedTextWithQuotes Error
return false; | ||
} | ||
|
||
$result = $this->copyBetweenStorage($sourceStorage, $sourceInternalPath, $targetInternalPath, $preserveMtime, true); | ||
echo "[DEBUG] $sourceInternalPath $targetInternalPath copy:$result " . __FILE__ . ':' . __LINE__ . "\n"; |
Check failure
Code scanning / Psalm
TaintedHtml Error
return false; | ||
} | ||
|
||
$result = $this->copyBetweenStorage($sourceStorage, $sourceInternalPath, $targetInternalPath, $preserveMtime, true); | ||
echo "[DEBUG] $sourceInternalPath $targetInternalPath copy:$result " . __FILE__ . ':' . __LINE__ . "\n"; |
Check failure
Code scanning / Psalm
TaintedTextWithQuotes Error
$result = $sourceStorage->rmdir($sourceInternalPath); | ||
} else { | ||
$result = $sourceStorage->unlink($sourceInternalPath); | ||
echo "[DEBUG] $sourceInternalPath $targetInternalPath copy success " . __FILE__ . ':' . __LINE__ . "\n"; |
Check failure
Code scanning / Psalm
TaintedHtml Error
$result = $sourceStorage->rmdir($sourceInternalPath); | ||
} else { | ||
$result = $sourceStorage->unlink($sourceInternalPath); | ||
echo "[DEBUG] $sourceInternalPath $targetInternalPath copy success " . __FILE__ . ':' . __LINE__ . "\n"; |
Check failure
Code scanning / Psalm
TaintedTextWithQuotes Error
@@ -609,10 +626,12 @@ | |||
bool $preserveMtime, | |||
bool $isRename, | |||
): bool { | |||
echo "[DEBUG] $sourceInternalPath $targetInternalPath $isRename " . __FILE__ . ':' . __LINE__ . "\n"; |
Check failure
Code scanning / Psalm
TaintedHtml Error
@@ -609,10 +626,12 @@ | |||
bool $preserveMtime, | |||
bool $isRename, | |||
): bool { | |||
echo "[DEBUG] $sourceInternalPath $targetInternalPath $isRename " . __FILE__ . ':' . __LINE__ . "\n"; |
Check failure
Code scanning / Psalm
TaintedTextWithQuotes Error
// for versions we have nothing to do, because versions should always use the | ||
// key from the original file. Just create a 1:1 copy and done | ||
if ($this->isVersion($targetInternalPath) || | ||
$this->isVersion($sourceInternalPath)) { | ||
echo "[DEBUG] $sourceInternalPath $targetInternalPath $isRename " . __FILE__ . ':' . __LINE__ . "\n"; |
Check failure
Code scanning / Psalm
TaintedHtml Error
// for versions we have nothing to do, because versions should always use the | ||
// key from the original file. Just create a 1:1 copy and done | ||
if ($this->isVersion($targetInternalPath) || | ||
$this->isVersion($sourceInternalPath)) { | ||
echo "[DEBUG] $sourceInternalPath $targetInternalPath $isRename " . __FILE__ . ':' . __LINE__ . "\n"; |
Check failure
Code scanning / Psalm
TaintedTextWithQuotes Error
Signed-off-by: Côme Chilliet <[email protected]>
bfbc787
to
f299305
Compare
@@ -176,13 +176,17 @@ | |||
} | |||
|
|||
public function unlink(string $path): bool { | |||
echo "[DEBUG] unlink($path) " . __FILE__ . ':' . __LINE__ . "\n"; |
Check failure
Code scanning / Psalm
TaintedHtml Error
@@ -176,13 +176,17 @@ | |||
} | |||
|
|||
public function unlink(string $path): bool { | |||
echo "[DEBUG] unlink($path) " . __FILE__ . ':' . __LINE__ . "\n"; |
Check failure
Code scanning / Psalm
TaintedTextWithQuotes Error
@@ -168,8 +169,11 @@ | |||
} | |||
|
|||
public function unlink(string $path): bool { | |||
echo "[DEBUG] unlink($path) " . __FILE__ . ':' . __LINE__ . "\n"; |
Check failure
Code scanning / Psalm
TaintedHtml Error
@@ -168,8 +169,11 @@ | |||
} | |||
|
|||
public function unlink(string $path): bool { | |||
echo "[DEBUG] unlink($path) " . __FILE__ . ':' . __LINE__ . "\n"; |
Check failure
Code scanning / Psalm
TaintedTextWithQuotes Error
$fullPath = $this->getFullPath($path); | ||
echo "[DEBUG] unlink($fullPath) " . __FILE__ . ':' . __LINE__ . "\n"; |
Check failure
Code scanning / Psalm
TaintedHtml Error
$fullPath = $this->getFullPath($path); | ||
echo "[DEBUG] unlink($fullPath) " . __FILE__ . ':' . __LINE__ . "\n"; |
Check failure
Code scanning / Psalm
TaintedTextWithQuotes Error
if ($this->util->isExcluded($fullPath)) { | ||
echo "[DEBUG] excluded $fullPath " . __FILE__ . ':' . __LINE__ . "\n"; |
Check failure
Code scanning / Psalm
TaintedHtml Error
if ($this->util->isExcluded($fullPath)) { | ||
echo "[DEBUG] excluded $fullPath " . __FILE__ . ':' . __LINE__ . "\n"; |
Check failure
Code scanning / Psalm
TaintedTextWithQuotes Error
*/ | ||
public function postShared($params) { | ||
public function postShared(string $nodeType, int $nodeId): void { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
since you're touching the params anyway, might as well pass a FileInfo
or Node
here to save having to query the filecache again in the body.
(same for the other post...
methods below)
Part of #32128
Summary
This is not half as clean as I would’ve liked, because original code is convoluted.
The owner thing in the event listener is ugly and probably incorrect but it was there before in HookManager class.
Checklist