feat(helpdesk): enable oauth2 token flow and tenant-scoped cache

This commit is contained in:
2026-04-02 21:46:01 +02:00
parent a37486c0e3
commit 8de67fa882
9 changed files with 267 additions and 21 deletions

View File

@@ -55,4 +55,16 @@ class HelpdeskOAuthTokenServiceTest extends TestCase
$service = new HelpdeskOAuthTokenService($settings, $tokenRepo);
$service->getAccessToken(1);
}
public function testDoesNotQueryCacheForInvalidTenantId(): void
{
$settings = $this->createMock(HelpdeskSettingsGateway::class);
$settings->method('getAuthMode')->willReturn(HelpdeskSettingsGateway::AUTH_MODE_OAUTH2);
$tokenRepo = $this->createMock(HelpdeskTokenRepository::class);
$tokenRepo->expects($this->never())->method('findValidToken');
$service = new HelpdeskOAuthTokenService($settings, $tokenRepo);
$this->assertNull($service->getAccessToken(0));
}
}