2020use OpenConext \EngineBlock \Service \ProcessingStateHelperInterface ;
2121use OpenConext \EngineBlock \Stepup \StepupGatewayCallOutHelper ;
2222use OpenConext \EngineBlockBundle \Sbs \Dto \EntitlementsRequest ;
23+ use OpenConext \EngineBlockBundle \Sbs \SbsAttributeMerger ;
2324use Symfony \Component \HttpFoundation \Request ;
2425
2526class EngineBlock_Corto_Module_Service_SRAMInterrupt
@@ -45,18 +46,25 @@ class EngineBlock_Corto_Module_Service_SRAMInterrupt
4546 */
4647 private $ _stepupGatewayCallOutHelper ;
4748
49+ /**
50+ * @var SbsAttributeMerger
51+ */
52+ private $ sbsAttributeMerger ;
53+
4854
4955 public function __construct (
5056 EngineBlock_Corto_ProxyServer $ server ,
5157 AuthenticationStateHelperInterface $ stateHelper ,
5258 ProcessingStateHelperInterface $ processingStateHelper ,
53- StepupGatewayCallOutHelper $ stepupGatewayCallOutHelper
59+ StepupGatewayCallOutHelper $ stepupGatewayCallOutHelper ,
60+ SbsAttributeMerger $ sbsAttributeMerger
5461 )
5562 {
5663 $ this ->_server = $ server ;
5764 $ this ->_authenticationStateHelper = $ stateHelper ;
5865 $ this ->_processingStateHelper = $ processingStateHelper ;
5966 $ this ->_stepupGatewayCallOutHelper = $ stepupGatewayCallOutHelper ;
67+ $ this ->sbsAttributeMerger = $ sbsAttributeMerger ;
6068 }
6169
6270 /**
@@ -69,7 +77,6 @@ public function __construct(
6977 */
7078 public function serve ($ serviceName , Request $ httpRequest )
7179 {
72- /** @TODO How to test this class? */
7380 $ application = EngineBlock_ApplicationSingleton::getInstance ();
7481
7582 // Get active request
@@ -90,18 +97,10 @@ public function serve($serviceName, Request $httpRequest)
9097 $ interruptResponse = $ this ->getSbsClient ()->requestEntitlementsFor ($ request );
9198
9299 if (!empty ($ interruptResponse ->attributes )) {
93- /**
94- * @TODO make sure this has test coverage
95- */
96- $ attributes = array_merge_recursive ($ attributes , $ interruptResponse ->attributes );
100+ $ attributes = $ this ->sbsAttributeMerger ->mergeAttributes ($ attributes , $ interruptResponse ->attributes );
97101 $ receivedResponse ->getAssertion ()->setAttributes ($ attributes );
98102 }
99103
100- /**
101- * @JOHAN Waarom zit hier stepup in? Zou dat niet via de 'reguliere' flow afgetrapt moeten worden?
102- * Kunnen we hier \EngineBlock_Corto_Module_Service_AssertionConsumer::serve gebruiken? Code daar wegsplitsen naar een shared service?
103- */
104-
105104 /*
106105 * Continue to Consent/StepUp
107106 */
@@ -135,7 +134,7 @@ public function serve($serviceName, Request $httpRequest)
135134 return ;
136135 }
137136
138- $ log ->info ('Handle Stepup authentication callout ' );
137+ $ this -> _server -> getLogger () ->info ('Handle Stepup authentication callout ' );
139138
140139 // Add Stepup authentication step
141140 $ currentProcessStep = $ this ->_processingStateHelper ->addStep (
0 commit comments