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
[stable13] Don't perform CSRF check on OCS routes with Bearer auth #8099
Conversation
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.
Review time! we can merge 13.0.1 stuff! |
* @param bool $exception | ||
*/ | ||
public function testCsrfOcsController(Controller $controller, $hasOcsApiHeader, $exception) { | ||
public function testCsrfOcsController(Controller $controller, bool $hasOcsApiHeader, bool $hasBearerAuth, bool $exception) { |
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.
No, this breaks because stable13 needs to be testable on 5.6
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.
Argument 2 passed to Test\AppFramework\Middleware\Security\SecurityMiddlewareTest::testCsrfOcsController() must be an instance of Test\AppFramework\Middleware\Security\bool, boolean given
$this->request | ||
->method('getHeader') | ||
->with('OCS-APIREQUEST') | ||
->willReturn($hasOcsApiHeader ? 'true' : null); | ||
->will(self::returnCallback(function ($header) use ($hasOcsApiHeader, $hasBearerAuth) { |
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.
willReturnMap ? ;)
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.
That doesn't have a default I think
Codecov Report
@@ Coverage Diff @@
## stable13 #8099 +/- ##
==============================================
+ Coverage 51.23% 51.23% +<.01%
- Complexity 24990 24991 +1
==============================================
Files 1608 1608
Lines 95106 95109 +3
Branches 1376 1376
==============================================
+ Hits 48730 48733 +3
Misses 46376 46376
|
Fixes #5694 Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
Relevant tests pass |
Backport of #7873