Skip to content

Commit bcf7ea0

Browse files
committed
Add SBS message logging
1 parent 579a412 commit bcf7ea0

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

library/EngineBlock/Corto/Filter/Command/SRAMInterruptFilter.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,8 @@ public function getResponse()
3939

4040
public function execute(): void
4141
{
42+
$log = EngineBlock_ApplicationSingleton::getLog();
43+
4244
if (!$this->getFeatureConfiguration()->isEnabled('eb.feature_enable_sram_interrupt')) {
4345
return;
4446
}
@@ -53,13 +55,14 @@ public function execute(): void
5355
$interruptResponse = $this->getSbsClient()->authz($request);
5456

5557
if ($interruptResponse->msg === 'interrupt') {
58+
$log->notice("SBS: " . $interruptResponse->message);
5659
$this->_response->setSRAMInterruptNonce($interruptResponse->nonce);
5760
} elseif ($interruptResponse->msg === 'authorized' && !empty($interruptResponse->attributes)) {
5861
$this->_responseAttributes = $this->getSbsAttributeMerger()->mergeAttributes($this->_responseAttributes, $interruptResponse->attributes);
5962
} else {
6063
throw new InvalidSbsResponseException(sprintf('Invalid SBS response received: %s', $interruptResponse->msg));
6164
}
62-
}catch (Throwable $e){
65+
} catch (Throwable $e){
6366
throw new EngineBlock_Exception_SbsCheckFailed('The SBS server could not be queried: ' . $e->getMessage());
6467
}
6568
}

src/OpenConext/EngineBlockBundle/Sbs/AuthzResponse.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@ public static function fromData(array $jsonData) : AuthzResponse
5858
$response = new self;
5959
$response->msg = $jsonData['msg'];
6060
$response->nonce = $jsonData['nonce'] ?? null;
61+
$response->message = $jsonData['message'] ?? null;
6162

6263
if (is_array($jsonData['attributes'])) {
6364
$response->attributes = $jsonData['attributes'];

0 commit comments

Comments
 (0)