Commit Graph

31 Commits (master)

Author SHA1 Message Date
John Molakvoæ 91227c908b
Merge branch 'master' into refactor/OC-Server-getHTTPClientService
Signed-off-by: John Molakvoæ <skjnldsv@users.noreply.github.com>
2 days ago
Andy Scherzinger 1f7e2ba599
chore: Add SPDX header
Signed-off-by: Andy Scherzinger <info@andy-scherzinger.de>
3 weeks ago
Andrew Summers f461c79c58 Refactor `OC\Server::getAppFetcher`
Signed-off-by: Andrew Summers <18727110+summersab@users.noreply.github.com>
3 months ago
Côme Chilliet e24007b530
Remove deprecated at matcher in tests/lib/InstallerTest.php
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
9 months ago
Andrew Summers 4536029589
Refactor `OC\Server::getHTTPClientService`
Signed-off-by: Andrew Summers <18727110+summersab@users.noreply.github.com>
9 months ago
Christoph Wurst cf6e2fa1b7
chore: Drop \OC_App::getAppVersion
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
1 year ago
Côme Chilliet 6a1510f8ee
Remove some more at matchers in tests/lib
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
2 years ago
Joas Schilling df47445c01
Fix unit tests
Signed-off-by: Joas Schilling <coding@schilljs.com>
3 years ago
Roeland Jago Douma 9b58a027e3
Allow installing/updating of apps again
The Guzzle API changed. We shall now use sink

Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
3 years ago
Christoph Wurst d9015a8c94
Format code to a single space around binary operators
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
4 years ago
Morris Jobke 234b510652
Change PHPDoc type hint from PHPUnit_Framework_MockObject_MockObject to \PHPUnit\Framework\MockObject\MockObject
Signed-off-by: Morris Jobke <hey@morrisjobke.de>
4 years ago
Christoph Wurst caff1023ea
Format control structures, classes, methods and function
To continue this formatting madness, here's a tiny patch that adds
unified formatting for control structures like if and loops as well as
classes, their methods and anonymous functions. This basically forces
the constructs to start on the same line. This is not exactly what PSR2
wants, but I think we can have a few exceptions with "our" style. The
starting of braces on the same line is pracrically standard for our
code.

This also removes and empty lines from method/function bodies at the
beginning and end.

Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
4 years ago
Christoph Wurst 41b5e5923a
Use exactly one empty line after the namespace declaration
For PSR2

Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
4 years ago
Christoph Wurst 74936c49ea
Remove unused imports
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
4 years ago
Arthur Schiwon d06ef07a97
disable timeout on app install via cli
Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
4 years ago
Joas Schilling 827f3228a3
Adjust unit test for #19017
Signed-off-by: Joas Schilling <coding@schilljs.com>
4 years ago
Roeland Jago Douma 3a7cf40aaa
Mode to modern phpunit
Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
5 years ago
Roeland Jago Douma c007ca624f
Make phpunit8 compatible
Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
5 years ago
Morris Jobke c804baaec5
Update CRL to contain revoked files_external_dropbox, passman & payback
* see https://github.com/nextcloud/app-certificate-requests/pull/221
* see https://github.com/nextcloud/app-certificate-requests/pull/219#issuecomment-463577509

Signed-off-by: Morris Jobke <hey@morrisjobke.de>
5 years ago
Morris Jobke 514de5dfa1
Use isInstalled of AppManger instead of reimplement it
Signed-off-by: Morris Jobke <hey@morrisjobke.de>
6 years ago
Morris Jobke 54c227b6c4
Use cached app list
Followup to #7264

Signed-off-by: Morris Jobke <hey@morrisjobke.de>
7 years ago
Morris Jobke df61d43529
Make isUpdateAvailable non-static
Signed-off-by: Morris Jobke <hey@morrisjobke.de>
7 years ago
Morris Jobke 0e2f00ec59
Get the Installer via DI
Signed-off-by: Morris Jobke <hey@morrisjobke.de>
7 years ago
Joas Schilling 0bff4f3f07 Fix the installer tests
Signed-off-by: Joas Schilling <coding@schilljs.com>
7 years ago
Lukas Reschke 3f9aaac4a2
Adjust tests
Signed-off-by: Lukas Reschke <lukas@statuscode.ch>
7 years ago
Lukas Reschke 32bf8ec826
Don't use cached informations for app version
When installing an app from the appstore the `\OC_App::getAppVersion` code is triggered twice:

- First when the downloader tries to compare the current version to the new version on the appstore to check if there is a newer version. This protects against downgrade attacks and is implemented in `\OC\Installer::downloadApp`.
- Second, when the app is actually installed the current version is written to the database. (`\OC\Installer::installApp`)

This fails however when the version is actually cached. Because in step 1 the cached version will be set to "0" and then be reused in the second step.

While this is probably not the cleanest version I assume this is an approach that is least invasive. Feedback and suggestions welcome :)

Signed-off-by: Lukas Reschke <lukas@statuscode.ch>
8 years ago
Lukas Reschke 7cb0df28e2
Prevent downgrade attacks for apps
We should verify the app versions when installing a new update, otherwise this could result in downgrade attacks when an attacker just copies the old signature.

Plus it prevents the case that in case of a bug in the appstore actually an older version gets installed.

Signed-off-by: Lukas Reschke <lukas@statuscode.ch>
8 years ago
Lukas Reschke 0eeef26a8e
Add tests for installer method
Signed-off-by: Lukas Reschke <lukas@statuscode.ch>
8 years ago
Lukas Reschke 8acb54aa0b
Add update support
Signed-off-by: Lukas Reschke <lukas@statuscode.ch>
8 years ago
Lukas Reschke 8d83e239f3
Fix tests
Signed-off-by: Lukas Reschke <lukas@statuscode.ch>
8 years ago
Thomas Müller e049953d1a
OC_Installer -> \OC\Installer 8 years ago