-
-
Notifications
You must be signed in to change notification settings - Fork 4.1k
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
fix(occ): occ integrity:check-app
and Admin panel "rescan" deliver inconsistent results
#49577
base: master
Are you sure you want to change the base?
Conversation
occ integrity:check-app
and Admin panel "rescan" deliver inconsistent resultsocc integrity:check-app
and Admin panel "rescan" deliver inconsistent results
occ integrity:check-app
and Admin panel "rescan" deliver inconsistent resultsocc integrity:check-app
and Admin panel "rescan" deliver inconsistent results
No labels, nothing? @joshtrichards @simonspa @szaimen |
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.
I think the only thing missing that I see (for parity) is an isShipped()
check (shipped apps are always verified; if they're missing a signature file something is wrong so we still want to throw an exception for those). Looks reasonable otherwise.
server/lib/private/IntegrityCheck/Checker.php
Lines 541 to 553 in f9fcc5b
// If an application is shipped a valid signature is required | |
$isShipped = $this->appManager->isShipped($appId); | |
$appNeedsToBeChecked = false; | |
if ($isShipped) { | |
$appNeedsToBeChecked = true; | |
} elseif ($this->fileAccessHelper->file_exists($this->appLocator->getAppPath($appId) . '/appinfo/signature.json')) { | |
// Otherwise only if the application explicitly ships a signature.json file | |
$appNeedsToBeChecked = true; | |
} | |
if ($appNeedsToBeChecked) { | |
$this->verifyAppSignature($appId); | |
} |
I'm mildly tempted to add another return/exit code (3
maybe) so that automated runners can easily detect if things only passed due to a missing signature file, but that opens a can of worms we should probably avoid right now (i.e. auditing the return codes we use across our occ
commands; adding one arbitrarily right now just creates later tech debt... so probably easier to add that code later when/if deemed important I guess).
Hi @ehfd - Thanks for the ping and PR. And sorry for the delay. |
Hmm. I don't currently see any test coverage for the Might be a good opportunity to add some. :) We do have test coverage for the underlying |
…istent results Signed-off-by: Seungmin Kim <8457324+ehfd@users.noreply.github.com>
Signed-off-by: Seungmin Kim <8457324+ehfd@users.noreply.github.com>
Signed-off-by: Seungmin Kim <8457324+ehfd@users.noreply.github.com>
#49577 (review) As for the tests, feel free to modify the branch. Otherwise, new issue and PR for the tests in order to not bloat the PR. |
Co-authored-by: Joas Schilling <213943+nickvergessen@users.noreply.github.com> Signed-off-by: Seungmin Kim <8457324+ehfd@users.noreply.github.com>
Signed-off-by: Seungmin Kim <8457324+ehfd@users.noreply.github.com>
Hello there, We hope that the review process is going smooth and is helpful for you. We want to ensure your pull request is reviewed to your satisfaction. If you have a moment, our community management team would very much appreciate your feedback on your experience with this PR review process. Your feedback is valuable to us as we continuously strive to improve our community developer experience. Please take a moment to complete our short survey by clicking on the following link: https://cloud.nextcloud.com/apps/forms/s/i9Ago4EQRZ7TWxjfmeEpPkf6 Thank you for contributing to Nextcloud and we hope to hear from you soon! (If you believe you should not receive this message, you can add yourself to the blocklist.) |
occ integrity:check-app
and Admin panel "rescan" deliver inconsistent results #17801Summary
This issue fixes the behavior discrepancy between the
occ integrity:check-app
command and the Admin panel "rescan" button.The fix allows
occ integrity:check-app
to gracefully skip the signature check of the app instead of throwing an exception, as instructed in #17801 (comment).TODO
custom_apps
apps (open the dropdown) that do not ship with signatures.bookmarks
is a good example (Add signature to app bookmarks#1941).Checklist
CC @joshtrichards @simonspa @szaimen