aboutsummaryrefslogtreecommitdiffstats
path: root/tests/lib/AppFramework
Commit message (Collapse)AuthorAgeFilesLines
* Do not use file as template parameterRoeland Jago Douma2018-08-091-1/+1
| | | | | | | | Using file will overwrite the $file parameter in the template base. Leading to trying to include a file that is the exception message. Which will of course fail. Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
* Fix direct access to authen pageRoeland Jago Douma2018-06-201-0/+2
| | | | Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
* Add AuthPublicShareControllerTestRoeland Jago Douma2018-06-201-0/+157
| | | | Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
* Add PublicShareControllerTestsRoeland Jago Douma2018-06-201-0/+102
| | | | Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
* Add PublicShareMiddlewareTestRoeland Jago Douma2018-06-201-0/+287
| | | | Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
* Move caching logic to responseRoeland Jago Douma2018-06-041-2/+12
| | | | | | | | | | This avoids having to do it at all the places we want cached responses. We can't inject the ITimeFactor without breaking public API. However we can perfectly overwrite the service (resulting in the same testable effect). Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
* Merge pull request #8593 from eneiluj/masterMorris Jobke2018-03-081-10/+78
|\ | | | | Allow public page access to apps with group restrictions
| * Add testsRoeland Jago Douma2018-03-081-10/+78
| | | | | | | | Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
* | Remove testcaseRoeland Jago Douma2018-03-051-1/+0
|/ | | | | | | Since a token now always requires a string we don't need to test for null Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
* Add test for PublicTemplateResponseJulius Härtl2018-02-271-0/+84
| | | | Signed-off-by: Julius Härtl <jus@bitgrid.net>
* Merge pull request #8541 from nextcloud/translate-permission-error-pageMorris Jobke2018-02-261-7/+7
|\ | | | | Provide translated error message for permission error
| * Provide translated error message for permission errorMorris Jobke2018-02-261-7/+7
| | | | | | | | Signed-off-by: Morris Jobke <hey@morrisjobke.de>
* | Fix proper typesRoeland Jago Douma2018-02-221-1/+1
|/ | | | Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
* Fix testsRoeland Jago Douma2018-02-212-12/+18
| | | | Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
* Update testsRoeland Jago Douma2018-01-291-8/+20
| | | | Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
* Fix risky tests without assertionsJoas Schilling2018-01-253-4/+7
| | | | Signed-off-by: Joas Schilling <coding@schilljs.com>
* Fix "Undefined method setExpectedException()"Joas Schilling2018-01-246-24/+25
| | | | Signed-off-by: Joas Schilling <coding@schilljs.com>
* Properly log the full exception instead of only the messageMorris Jobke2018-01-231-4/+2
| | | | Signed-off-by: Morris Jobke <hey@morrisjobke.de>
* Remove not needed 3rdparty app disabling during upgrade for PHP 5.xMorris Jobke2018-01-191-1/+0
| | | | Signed-off-by: Morris Jobke <hey@morrisjobke.de>
* Remove deprecated core APIJoas Schilling2018-01-152-24/+3
| | | | Signed-off-by: Joas Schilling <coding@schilljs.com>
* Move passwordconfirmation to its own midlewareRoeland Jago Douma2018-01-022-10/+130
| | | | | | Add tests Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
* disable password confirmation with SSOBjoern Schiessle2018-01-021-1/+10
| | | | Signed-off-by: Bjoern Schiessle <bjoern@schiessle.org>
* allow 'Nextcloud' in the user agent string of AndroidBjoern Schiessle2017-12-121-0/+14
| | | | Signed-off-by: Bjoern Schiessle <bjoern@schiessle.org>
* Merge pull request #6921 from nextcloud/appmanager-securitymiddlewareRoeland Jago Douma2017-10-241-1/+9
|\ | | | | Use proper DI for security middleware for app enabled check
| * Use proper DI for security middleware for app enabled checkMorris Jobke2017-10-241-1/+9
| | | | | | | | Signed-off-by: Morris Jobke <hey@morrisjobke.de>
* | Use ::class in test mocksMorris Jobke2017-10-248-17/+24
|/ | | | Signed-off-by: Morris Jobke <hey@morrisjobke.de>
* Handle SameSiteCookie check for index.php in AppFramework MiddlewareRoeland Jago Douma2017-09-242-2/+145
| | | | Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
* Add CSP frame-ancestors supportThomas Citharel2017-09-151-0/+41
| | | | | | Didn't set the @since annotation yet. Signed-off-by: Thomas Citharel <tcit@tcit.fr>
* Remove explicit type hints for ControllerLukas Reschke2017-08-011-4/+4
| | | | | | This is public API and breaks the middlewares of existing apps. Since this also requires maintaining two different code paths for 12 and 13 I'm at the moment voting for reverting this change. Signed-off-by: Lukas Reschke <lukas@statuscode.ch>
* Merge pull request #5907 from nextcloud/add-metadata-to-throttle-callMorris Jobke2017-08-012-0/+9
|\ | | | | Add metadata to \OCP\AppFramework\Http\Response::throttle
| * Add metadata to \OCP\AppFramework\Http\Response::throttleLukas Reschke2017-07-272-0/+9
| | | | | | | | | | | | Fixes https://github.com/nextcloud/server/issues/5891 Signed-off-by: Lukas Reschke <lukas@statuscode.ch>
* | Fix testsRoeland Jago Douma2017-07-313-61/+66
| | | | | | | | Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
* | Fix middleware implementations signaturesRoeland Jago Douma2017-07-311-4/+5
|/ | | | Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
* Remove deprecated Controller FunctionsRoeland Jago Douma2017-07-201-69/+0
| | | | Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
* Make BruteForceProtection annotation more cleverLukas Reschke2017-04-133-75/+196
| | | | | | | | This makes the new `@BruteForceProtection` annotation more clever and moves the relevant code into it's own middleware. Basically you can now set `@BruteForceProtection(action=$key)` as annotation and that will make the controller bruteforce protected. However, the difference to before is that you need to call `$responmse->throttle()` to increase the counter. Before the counter was increased every time which leads to all kind of unexpected problems. Signed-off-by: Lukas Reschke <lukas@statuscode.ch>
* Add tests for multiple parametersLukas Reschke2017-04-131-5/+19
| | | | Signed-off-by: Lukas Reschke <lukas@statuscode.ch>
* Move to dedicated MiddleWareLukas Reschke2017-04-132-40/+287
| | | | Signed-off-by: Lukas Reschke <lukas@statuscode.ch>
* Add support for ratelimiting via annotationsLukas Reschke2017-04-131-4/+40
| | | | | | | | | | | | | This allows adding rate limiting via annotations to controllers, as one example: ``` @UserRateThrottle(limit=5, period=100) @AnonRateThrottle(limit=1, period=100) ``` Would mean that logged-in users can access the page 5 times within 100 seconds, and anonymous users 1 time within 100 seconds. If only an AnonRateThrottle is specified that one will also be applied to logged-in users. Signed-off-by: Lukas Reschke <lukas@statuscode.ch>
* Don't try to parse empty body if there is no bodyRoeland Jago Douma2017-04-041-1/+4
| | | | | | | | | | | | Fixes #3890 If we do a put request without a body the current code still tries to read the body. This patch makes sure that we do not try to read the body if the content length is 0. See RFC 2616 Section 4.3 Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
* Fix unit testsMorris Jobke2017-03-285-111/+111
| | | | Signed-off-by: Morris Jobke <hey@morrisjobke.de>
* Add DI intergration testsRoeland Jago Douma2017-03-211-0/+136
| | | | | | | | | * Moved some interface definitions to Server.php (more to come) * Build/Query only for existing classes in the AppContainer * Build/Query only for classes of the App in the AppContainer * Offload other stuff to the servercontainer Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
* Extend DI testsRoeland Jago Douma2017-03-211-5/+14
| | | | Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
* Adjust tests to include base-uriLukas Reschke2017-03-162-2/+2
| | | | Signed-off-by: Lukas Reschke <lukas@statuscode.ch>
* Add base-uri to CSP policyLukas Reschke2017-03-163-109/+109
| | | | | | As per https://twitter.com/we1x/status/842032709543333890 a nice security hardening Signed-off-by: Lukas Reschke <lukas@statuscode.ch>
* add test for skipping cookie checks for ocsRobin Appelman2017-03-101-0/+25
| | | | Signed-off-by: Robin Appelman <robin@icewind.nl>
* oc_token should be nc_tokenChristoph Wurst2017-02-021-1/+1
| | | | Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
* add some unit testsBjoern Schiessle2017-01-182-1/+85
| | | | Signed-off-by: Bjoern Schiessle <bjoern@schiessle.org>
* fix controller testChristoph Wurst2017-01-101-1/+1
| | | | Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
* fix data response test expected cache headersChristoph Wurst2017-01-101-1/+1
| | | | Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
* set 'no-store' cache header if we do not want FF to cacheChristoph Wurst2017-01-091-1/+1
| | | | Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>