Skip to content

Commit

Permalink
Merge bf330f5 into 99afef4
Browse files Browse the repository at this point in the history
  • Loading branch information
MKodde committed Apr 16, 2024
2 parents 99afef4 + bf330f5 commit afc38db
Show file tree
Hide file tree
Showing 6 changed files with 23 additions and 31 deletions.
8 changes: 8 additions & 0 deletions CHANGELOG.md
@@ -1,9 +1,17 @@
# Changelog

# 5.0.4
- Correct a route name with a missing namespace part (self vetting acs) #320

# 5.0.3
- Repair exeption screens
- Fix flash messages

# 5.0.2
- Read flash messages from the correct bag #314
- Simplify exception logical condition, showing the attribute missing error message once again #315
- Multiple updates of Composer/Node dependencies

# 5.0.1
- Removed a piece of dead authentication code #312

Expand Down
10 changes: 0 additions & 10 deletions ci/qa/phpstan-baseline.php
Expand Up @@ -546,11 +546,6 @@
'count' => 2,
'path' => __DIR__ . '/../../src/Surfnet/StepupSelfService/SelfServiceBundle/Controller/SelfVet/SelfVetConsumeController.php',
];
$ignoreErrors[] = [
'message' => '#^Parameter \\#2 \\.\\.\\.\\$values of function sprintf expects bool\\|float\\|int\\|string\\|null, Surfnet\\\\StepupSelfService\\\\SelfServiceBundle\\\\Value\\\\SelfVetRequestId given\\.$#',
'count' => 1,
'path' => __DIR__ . '/../../src/Surfnet/StepupSelfService/SelfServiceBundle/Controller/SelfVet/SelfVetConsumeController.php',
];
$ignoreErrors[] = [
'message' => '#^Property Surfnet\\\\StepupSelfService\\\\SelfServiceBundle\\\\Command\\\\SelfVetCommand\\:\\:\\$authoringLoa \\(string\\) does not accept string\\|null\\.$#',
'count' => 1,
Expand Down Expand Up @@ -886,11 +881,6 @@
'count' => 1,
'path' => __DIR__ . '/../../src/Surfnet/StepupSelfService/SelfServiceBundle/Service/RaLocationService.php',
];
$ignoreErrors[] = [
'message' => '#^Access to an undefined property Surfnet\\\\StepupMiddlewareClientBundle\\\\Identity\\\\Command\\\\SelfVetSecondFactorCommand\\:\\:\\$authoringSecondFactorLoa\\.$#',
'count' => 1,
'path' => __DIR__ . '/../../src/Surfnet/StepupSelfService/SelfServiceBundle/Service/SecondFactorService.php',
];
$ignoreErrors[] = [
'message' => '#^Cannot call method getElements\\(\\) on Surfnet\\\\StepupMiddlewareClientBundle\\\\Identity\\\\Dto\\\\UnverifiedSecondFactorCollection\\|Surfnet\\\\StepupMiddlewareClientBundle\\\\Identity\\\\Dto\\\\VerifiedSecondFactorCollection\\|Surfnet\\\\StepupMiddlewareClientBundle\\\\Identity\\\\Dto\\\\VettedSecondFactorCollection\\|null\\.$#',
'count' => 2,
Expand Down
Expand Up @@ -126,7 +126,7 @@ public function consumeAssertion(Request $httpRequest): Response
$selfVetRequestId = $session->get(SelfVetController::SELF_VET_SESSION_ID);
$secondFactorId = $selfVetRequestId->vettingSecondFactorId();
return $this->forward(
'Surfnet\StepupSelfService\SelfServiceBundle\Controller\SelfVetController::consumeSelfVetAssertion',
'Surfnet\StepupSelfService\SelfServiceBundle\Controller\SelfVet\SelfVetConsumeController::consumeSelfVetAssertion',
['secondFactorId' => $secondFactorId],
);
}
Expand Down
Expand Up @@ -41,7 +41,6 @@

/**
* @SuppressWarnings(PHPMD.CouplingBetweenObjects) - Controllers are prone to higher coupling. This one is no exception
* TODO: Split up into smaller controllers
*/
class SelfVetConsumeController extends AbstractController
{
Expand Down Expand Up @@ -98,7 +97,7 @@ public function consumeSelfVetAssertion(Request $httpRequest, string $secondFact
$samlLogger->error(
sprintf(
'Expected a response to the request with ID "%s", but the SAMLResponse was a response to a different request',
$initiatedRequestId
$initiatedRequestId->requestId()
)
);
throw new AuthenticationException('Unexpected InResponseTo in SAMLResponse');
Expand Down
Expand Up @@ -19,22 +19,6 @@ services:

Surfnet\StepupSelfService\SelfServiceBundle\Service\ControllerCheckerService:

# Surfnet\StepupSelfService\SelfServiceBundle\Controller\SelfVetController:
# arguments:
# - "@self_service.test_second_factor_authentication_request_factory"
# - "@surfnet_stepup_self_service_self_service.service.second_factor"
# - "@surfnet_stepup.service.second_factor_type"
# - "@self_service.service.self_vet_marshaller"
# - '@Surfnet\StepupSelfService\SelfServiceBundle\Service\AuthorizationService'
# - "@surfnet_saml.hosted.service_provider"
# - "@self_service.second_factor_test_idp"
# - "@surfnet_saml.http.redirect_binding"
# - "@surfnet_saml.http.post_binding"
# - "@surfnet_stepup.service.loa_resolution"
# - "@surfnet_saml.logger"
# - "@request_stack"
# - "@logger"

Surfnet\StepupSelfService\SelfServiceBundle\Controller\RecoveryTokenController:
arguments:
- '@Surfnet\StepupSelfService\SelfServiceBundle\Service\SelfAssertedTokens\RecoveryTokenService'
Expand All @@ -46,10 +30,21 @@ services:
- '@surfnet_saml.http.redirect_binding'
- '@surfnet_saml.http.post_binding'
- '@surfnet_saml.hosted.service_provider'
- '@self_service.second_factor_test_idp'
- '@surfnet_saml.remote.idp'
- '@surfnet_saml.logger'
- '@logger'

Surfnet\StepupSelfService\SelfServiceBundle\Controller\SelfVet\SelfVetConsumeController:
arguments:
- "@logger"
- "@surfnet_stepup_self_service_self_service.service.second_factor"
- "@self_service.service.self_vet_marshaller"
- "@surfnet_saml.hosted.service_provider"
- '@surfnet_saml.remote.idp'
- "@surfnet_saml.http.post_binding"
- "@surfnet_saml.logger"
- "@request_stack"

surfnet_stepup_self_service_self_service.service.command:
class: Surfnet\StepupSelfService\SelfServiceBundle\Service\CommandService
arguments:
Expand Down
Expand Up @@ -84,7 +84,7 @@ public function selfVet(SelfVetCommand $command): bool
$apiCommand->secondFactorId = $command->secondFactor->secondFactorIdentifier;
$apiCommand->secondFactorType = $command->secondFactor->type;
$apiCommand->authorityId = $command->identity->id;
$apiCommand->authoringSecondFactorLoa = $command->authoringLoa;
$apiCommand->authoringSecondFactorIdentifier = $command->authoringLoa;

$result = $this->commandService->execute($apiCommand);
return $result->isSuccessful();
Expand Down

0 comments on commit afc38db

Please sign in to comment.