Skip to content

Commit 58db16d

Browse files
ArtificialOwlbackportbot[bot]
authored andcommitted
fix(ocm): fully disable signed request on config
Signed-off-by: Maxence Lange <[email protected]> [skip ci]
1 parent 861ec0e commit 58db16d

File tree

1 file changed

+10
-8
lines changed

1 file changed

+10
-8
lines changed

apps/cloud_federation_api/lib/Controller/RequestHandlerController.php

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -366,14 +366,16 @@ public function receiveNotification($notificationType, $resourceType, $providerI
366366
);
367367
}
368368

369-
try {
370-
// if request is signed and well signed, no exception are thrown
371-
// if request is not signed and host is known for not supporting signed request, no exception are thrown
372-
$signedRequest = $this->getSignedRequest();
373-
$this->confirmNotificationIdentity($signedRequest, $resourceType, $notification);
374-
} catch (IncomingRequestException $e) {
375-
$this->logger->warning('incoming request exception', ['exception' => $e]);
376-
return new JSONResponse(['message' => $e->getMessage(), 'validationErrors' => []], Http::STATUS_BAD_REQUEST);
369+
if (!$this->appConfig->getValueBool('core', OCMSignatoryManager::APPCONFIG_SIGN_DISABLED, lazy: true)) {
370+
try {
371+
// if request is signed and well signed, no exception are thrown
372+
// if request is not signed and host is known for not supporting signed request, no exception are thrown
373+
$signedRequest = $this->getSignedRequest();
374+
$this->confirmNotificationIdentity($signedRequest, $resourceType, $notification);
375+
} catch (IncomingRequestException $e) {
376+
$this->logger->warning('incoming request exception', ['exception' => $e]);
377+
return new JSONResponse(['message' => $e->getMessage(), 'validationErrors' => []], Http::STATUS_BAD_REQUEST);
378+
}
377379
}
378380

379381
try {

0 commit comments

Comments
 (0)