|
|
|
|
@ -19,6 +19,7 @@ use OCP\IAppConfig; |
|
|
|
|
use OCP\ICacheFactory; |
|
|
|
|
use OCP\IConfig; |
|
|
|
|
use OCP\IURLGenerator; |
|
|
|
|
use OCP\Security\Signature\Exceptions\IdentityNotFoundException; |
|
|
|
|
use OCP\Security\Signature\ISignatureManager; |
|
|
|
|
use PHPUnit\Framework\MockObject\MockObject; |
|
|
|
|
use Psr\Log\LoggerInterface; |
|
|
|
|
@ -46,6 +47,8 @@ class OCMSignatoryManagerRotationTest extends TestCase { |
|
|
|
|
$this->wireIdentityProofManager(); |
|
|
|
|
|
|
|
|
|
$signatureManager = $this->createMock(ISignatureManager::class); |
|
|
|
|
$signatureManager->method('generateKeyIdFromConfig') |
|
|
|
|
->willThrowException(new IdentityNotFoundException('no configured identity')); |
|
|
|
|
$urlGenerator = $this->createMock(IURLGenerator::class); |
|
|
|
|
$urlGenerator->method('getAbsoluteURL') |
|
|
|
|
->willReturnCallback(static fn (string $path): string => 'https://alice.example' . $path); |
|
|
|
|
@ -188,6 +191,8 @@ class OCMSignatoryManagerRotationTest extends TestCase { |
|
|
|
|
// identity at all; provisioning the first key should fail loudly so |
|
|
|
|
// the admin gets a clear message instead of a corrupt half-state. |
|
|
|
|
$signatureManager = $this->createMock(ISignatureManager::class); |
|
|
|
|
$signatureManager->method('generateKeyIdFromConfig') |
|
|
|
|
->willThrowException(new IdentityNotFoundException('no configured identity')); |
|
|
|
|
$urlGenerator = $this->createMock(IURLGenerator::class); |
|
|
|
|
// getAbsoluteURL() yields no host, so the kid's identity cannot be |
|
|
|
|
// resolved; provisioning must fail loudly rather than corrupt state. |
|
|
|
|
|