new stateless firewall to prevent new sessions for API calls (#3602)

This commit is contained in:
Kevin Papst
2022-10-28 15:13:40 +02:00
committed by GitHub
parent 78749ad3b4
commit 0461539f4b
6 changed files with 228 additions and 4 deletions

View File

@@ -36,10 +36,13 @@ class TokenAuthenticatorTest extends TestCase
self::assertFalse($sut->supports($request));
$request = new Request([], [], [], [], [], ['REQUEST_URI' => '/api/fooo']);
self::assertTrue($sut->supports($request));
self::assertFalse($sut->supports($request));
$request = new Request([], [], [], [], [], ['REQUEST_URI' => '/api/fooo', 'HTTP_X-AUTH-SESSION' => true]);
self::assertFalse($sut->supports($request));
$request = new Request([], [], [], [], [], ['REQUEST_URI' => '/api/fooo', 'HTTP_X-AUTH-USER' => 'foo', 'HTTP_X-AUTH-TOKEN' => 'bar']);
self::assertTrue($sut->supports($request));
}
public function testGetCredentials()