diff --git a/config/packages/events.yaml b/config/packages/events.yaml index 4c76b0e48..9761a346f 100644 --- a/config/packages/events.yaml +++ b/config/packages/events.yaml @@ -38,7 +38,7 @@ parameters: - Surfnet\Stepup\Identity\Event\InstitutionsRemovedFromWhitelistEvent - Surfnet\Stepup\Identity\Event\U2fDevicePossessionProvenEvent - Surfnet\Stepup\Identity\Event\SecondFactorVettedEvent - - Surfnet\Stepup\Identity\Event\SecondFactorVettedPossessionSkippedEvent + - Surfnet\Stepup\Identity\Event\SecondFactorVettedWithoutTokenProofOfPossession - Surfnet\Stepup\Identity\Event\VerifiedSecondFactorRevokedEvent - Surfnet\Stepup\Identity\Event\WhitelistCreatedEvent - Surfnet\Stepup\Identity\Event\UnverifiedSecondFactorRevokedEvent diff --git a/docs/personal-data.md b/docs/personal-data.md index b29f64962..bd1f38cdb 100644 --- a/docs/personal-data.md +++ b/docs/personal-data.md @@ -215,7 +215,7 @@ A list of all the [Identity events]((../src/Surfnet/Stepup/Identity/Event/) in s - Forgettable: secondFactorIdentifier - Forgettable: documentNumber -[SecondFactorVettedPossessionSkippedEvent](../src/Surfnet/Stepup/Identity/Event/SecondFactorVettedEvent.php) +[SecondFactorVettedWithoutTokenProofOfPossession](../src/Surfnet/Stepup/Identity/Event/SecondFactorVettedEvent.php) - identity_id - name_id - identity_institution diff --git a/src/Surfnet/Stepup/Helper/SecondFactorProvePossessionHelper.php b/src/Surfnet/Stepup/Helper/SecondFactorProvePossessionHelper.php index 82785d212..945414320 100644 --- a/src/Surfnet/Stepup/Helper/SecondFactorProvePossessionHelper.php +++ b/src/Surfnet/Stepup/Helper/SecondFactorProvePossessionHelper.php @@ -1,6 +1,6 @@ getSecondFactorType(), $this->skipProvePossessionSecondFactorTypes)) { - return true; - } - - return false; + return in_array($secondFactorType->getSecondFactorType(), $this->skipProvePossessionSecondFactorTypes); } } diff --git a/src/Surfnet/Stepup/Identity/Entity/VerifiedSecondFactor.php b/src/Surfnet/Stepup/Identity/Entity/VerifiedSecondFactor.php index 98b5f32c9..3e7709d96 100644 --- a/src/Surfnet/Stepup/Identity/Entity/VerifiedSecondFactor.php +++ b/src/Surfnet/Stepup/Identity/Entity/VerifiedSecondFactor.php @@ -24,7 +24,7 @@ use Surfnet\Stepup\Identity\Api\Identity; use Surfnet\Stepup\Identity\Event\CompliedWithVerifiedSecondFactorRevocationEvent; use Surfnet\Stepup\Identity\Event\IdentityForgottenEvent; -use Surfnet\Stepup\Identity\Event\SecondFactorVettedPossessionSkippedEvent; +use Surfnet\Stepup\Identity\Event\SecondFactorVettedWithoutTokenProofOfPossession; use Surfnet\Stepup\Identity\Event\SecondFactorVettedEvent; use Surfnet\Stepup\Identity\Event\VerifiedSecondFactorRevokedEvent; use Surfnet\Stepup\Identity\Value\DocumentNumber; @@ -143,7 +143,7 @@ public function vet(DocumentNumber $documentNumber, $provePossessionSkipped) { if ($provePossessionSkipped) { $this->apply( - new SecondFactorVettedPossessionSkippedEvent( + new SecondFactorVettedWithoutTokenProofOfPossession( $this->identity->getId(), $this->identity->getNameId(), $this->identity->getInstitution(), diff --git a/src/Surfnet/Stepup/Identity/Event/SecondFactorVettedPossessionSkippedEvent.php b/src/Surfnet/Stepup/Identity/Event/SecondFactorVettedPossessionSkippedEvent.php index 9f33cc55a..a93df7cb8 100644 --- a/src/Surfnet/Stepup/Identity/Event/SecondFactorVettedPossessionSkippedEvent.php +++ b/src/Surfnet/Stepup/Identity/Event/SecondFactorVettedPossessionSkippedEvent.php @@ -1,7 +1,7 @@ vettedSecondFactors->set($secondFactorId, $vetted); } - protected function applySecondFactorVettedPossessionSkippedEvent(SecondFactorVettedPossessionSkippedEvent $event) + protected function applySecondFactorVettedWithoutTokenProofOfPossession(SecondFactorVettedWithoutTokenProofOfPossession $event) { $secondFactorId = (string)$event->secondFactorId; diff --git a/src/Surfnet/Stepup/Tests/Identity/Event/ForgettableEventsTest.php b/src/Surfnet/Stepup/Tests/Identity/Event/ForgettableEventsTest.php index 854e3ba25..05495ba80 100644 --- a/src/Surfnet/Stepup/Tests/Identity/Event/ForgettableEventsTest.php +++ b/src/Surfnet/Stepup/Tests/Identity/Event/ForgettableEventsTest.php @@ -44,7 +44,7 @@ public function certain_events_are_forgettable_events_and_others_are_not() 'Surfnet\Stepup\Identity\Event\RegistrationAuthorityRetractedEvent', 'Surfnet\Stepup\Identity\Event\SecondFactorRevokedEvent', 'Surfnet\Stepup\Identity\Event\SecondFactorVettedEvent', - 'Surfnet\Stepup\Identity\Event\SecondFactorVettedPossessionSkippedEvent', + 'Surfnet\Stepup\Identity\Event\SecondFactorVettedWithoutTokenProofOfPossession', 'Surfnet\Stepup\Identity\Event\U2fDevicePossessionProvenEvent', 'Surfnet\Stepup\Identity\Event\U2fDevicePossessionProvenAndVerifiedEvent', 'Surfnet\Stepup\Identity\Event\UnverifiedSecondFactorRevokedEvent', diff --git a/src/Surfnet/StepupMiddleware/ApiBundle/Identity/Entity/AuditLogEntry.php b/src/Surfnet/StepupMiddleware/ApiBundle/Identity/Entity/AuditLogEntry.php index 330ea4716..01f58335b 100644 --- a/src/Surfnet/StepupMiddleware/ApiBundle/Identity/Entity/AuditLogEntry.php +++ b/src/Surfnet/StepupMiddleware/ApiBundle/Identity/Entity/AuditLogEntry.php @@ -57,7 +57,7 @@ class AuditLogEntry implements JsonSerializable 'Surfnet\Stepup\Identity\Event\PhonePossessionProvenEvent' => 'possession_proven', 'Surfnet\Stepup\Identity\Event\PhonePossessionProvenAndVerifiedEvent' => 'possession_proven', 'Surfnet\Stepup\Identity\Event\SecondFactorVettedEvent' => 'vetted', - 'Surfnet\Stepup\Identity\Event\SecondFactorVettedPossessionSkippedEvent' => 'vetted_possession_unknown', + 'Surfnet\Stepup\Identity\Event\SecondFactorVettedWithoutTokenProofOfPossession' => 'vetted_possession_unknown', 'Surfnet\Stepup\Identity\Event\UnverifiedSecondFactorRevokedEvent' => 'revoked', 'Surfnet\Stepup\Identity\Event\VerifiedSecondFactorRevokedEvent' => 'revoked', 'Surfnet\Stepup\Identity\Event\VettedSecondFactorRevokedEvent' => 'revoked', diff --git a/src/Surfnet/StepupMiddleware/ApiBundle/Identity/Projector/RaSecondFactorProjector.php b/src/Surfnet/StepupMiddleware/ApiBundle/Identity/Projector/RaSecondFactorProjector.php index 1fba661a8..55b83e31d 100644 --- a/src/Surfnet/StepupMiddleware/ApiBundle/Identity/Projector/RaSecondFactorProjector.php +++ b/src/Surfnet/StepupMiddleware/ApiBundle/Identity/Projector/RaSecondFactorProjector.php @@ -30,7 +30,7 @@ use Surfnet\Stepup\Identity\Event\IdentityRenamedEvent; use Surfnet\Stepup\Identity\Event\PhonePossessionProvenAndVerifiedEvent; use Surfnet\Stepup\Identity\Event\PhonePossessionProvenEvent; -use Surfnet\Stepup\Identity\Event\SecondFactorVettedPossessionSkippedEvent; +use Surfnet\Stepup\Identity\Event\SecondFactorVettedWithoutTokenProofOfPossession; use Surfnet\Stepup\Identity\Event\SecondFactorVettedEvent; use Surfnet\Stepup\Identity\Event\U2fDevicePossessionProvenAndVerifiedEvent; use Surfnet\Stepup\Identity\Event\U2fDevicePossessionProvenEvent; @@ -268,7 +268,7 @@ public function applySecondFactorVettedEvent(SecondFactorVettedEvent $event) $this->raSecondFactorRepository->save($secondFactor); } - public function applySecondFactorVettedPossessionSkippedEvent(SecondFactorVettedPossessionSkippedEvent $event) + public function applySecondFactorVettedWithoutTokenProofOfPossession(SecondFactorVettedWithoutTokenProofOfPossession $event) { $secondFactor = $this->raSecondFactorRepository->find((string) $event->secondFactorId); diff --git a/src/Surfnet/StepupMiddleware/ApiBundle/Identity/Projector/SecondFactorProjector.php b/src/Surfnet/StepupMiddleware/ApiBundle/Identity/Projector/SecondFactorProjector.php index b55649eb4..b0c6604d8 100644 --- a/src/Surfnet/StepupMiddleware/ApiBundle/Identity/Projector/SecondFactorProjector.php +++ b/src/Surfnet/StepupMiddleware/ApiBundle/Identity/Projector/SecondFactorProjector.php @@ -28,7 +28,7 @@ use Surfnet\Stepup\Identity\Event\IdentityForgottenEvent; use Surfnet\Stepup\Identity\Event\PhonePossessionProvenAndVerifiedEvent; use Surfnet\Stepup\Identity\Event\PhonePossessionProvenEvent; -use Surfnet\Stepup\Identity\Event\SecondFactorVettedPossessionSkippedEvent; +use Surfnet\Stepup\Identity\Event\SecondFactorVettedWithoutTokenProofOfPossession; use Surfnet\Stepup\Identity\Event\SecondFactorVettedEvent; use Surfnet\Stepup\Identity\Event\U2fDevicePossessionProvenAndVerifiedEvent; use Surfnet\Stepup\Identity\Event\U2fDevicePossessionProvenEvent; @@ -236,7 +236,7 @@ public function applySecondFactorVettedEvent(SecondFactorVettedEvent $event) $this->verifiedRepository->remove($verified); } - public function applySecondFactorVettedPossessionSkippedEvent(SecondFactorVettedPossessionSkippedEvent $event) + public function applySecondFactorVettedWithoutTokenProofOfPossession(SecondFactorVettedWithoutTokenProofOfPossession $event) { $verified = $this->verifiedRepository->find($event->secondFactorId->getSecondFactorId()); diff --git a/src/Surfnet/StepupMiddleware/ApiBundle/Identity/Repository/AuditLogRepository.php b/src/Surfnet/StepupMiddleware/ApiBundle/Identity/Repository/AuditLogRepository.php index fa681cefb..99235ae0b 100644 --- a/src/Surfnet/StepupMiddleware/ApiBundle/Identity/Repository/AuditLogRepository.php +++ b/src/Surfnet/StepupMiddleware/ApiBundle/Identity/Repository/AuditLogRepository.php @@ -47,8 +47,7 @@ public function __construct(ManagerRegistry $registry) 'Surfnet\Stepup\Identity\Event\PhonePossessionProvenAndVerifiedEvent', 'Surfnet\Stepup\Identity\Event\EmailVerifiedEvent', 'Surfnet\Stepup\Identity\Event\SecondFactorVettedEvent', - 'Surfnet\Stepup\Identity\Event\SecondFactorVettedPossessionSkippedEvent', - 'Surfnet\Stepup\Identity\Event\SecondFactorVettedPossessionSkippedEvent', + 'Surfnet\Stepup\Identity\Event\SecondFactorVettedWithoutTokenProofOfPossession', 'Surfnet\Stepup\Identity\Event\UnverifiedSecondFactorRevokedEvent', 'Surfnet\Stepup\Identity\Event\VerifiedSecondFactorRevokedEvent', 'Surfnet\Stepup\Identity\Event\VettedSecondFactorRevokedEvent', diff --git a/src/Surfnet/StepupMiddleware/CommandHandlingBundle/Processor/SecondFactorVettedEmailProcessor.php b/src/Surfnet/StepupMiddleware/CommandHandlingBundle/Processor/SecondFactorVettedEmailProcessor.php index b46ea302e..3b7be414e 100644 --- a/src/Surfnet/StepupMiddleware/CommandHandlingBundle/Processor/SecondFactorVettedEmailProcessor.php +++ b/src/Surfnet/StepupMiddleware/CommandHandlingBundle/Processor/SecondFactorVettedEmailProcessor.php @@ -19,7 +19,7 @@ namespace Surfnet\StepupMiddleware\CommandHandlingBundle\Processor; use Broadway\Processor\Processor; -use Surfnet\Stepup\Identity\Event\SecondFactorVettedPossessionSkippedEvent; +use Surfnet\Stepup\Identity\Event\SecondFactorVettedWithoutTokenProofOfPossession; use Surfnet\Stepup\Identity\Event\SecondFactorVettedEvent; use Surfnet\StepupMiddleware\CommandHandlingBundle\Identity\Service\SecondFactorVettedMailService; @@ -40,7 +40,7 @@ public function handleSecondFactorVettedEvent(SecondFactorVettedEvent $event) $this->secondFactorVettedMailService->sendVettedEmail($event->preferredLocale, $event->commonName, $event->email); } - public function handleSecondFactorVettedPossessionSkippedEvent(SecondFactorVettedPossessionSkippedEvent $event) + public function handleSecondFactorVettedWithoutTokenProofOfPossession(SecondFactorVettedWithoutTokenProofOfPossession $event) { $this->secondFactorVettedMailService->sendVettedEmail($event->preferredLocale, $event->commonName, $event->email); } diff --git a/src/Surfnet/StepupMiddleware/CommandHandlingBundle/Tests/Identity/CommandHandler/IdentityCommandHandlerTest.php b/src/Surfnet/StepupMiddleware/CommandHandlingBundle/Tests/Identity/CommandHandler/IdentityCommandHandlerTest.php index f3047ce5f..b633f64ab 100644 --- a/src/Surfnet/StepupMiddleware/CommandHandlingBundle/Tests/Identity/CommandHandler/IdentityCommandHandlerTest.php +++ b/src/Surfnet/StepupMiddleware/CommandHandlingBundle/Tests/Identity/CommandHandler/IdentityCommandHandlerTest.php @@ -38,7 +38,7 @@ use Surfnet\Stepup\Identity\Event\IdentityRenamedEvent; use Surfnet\Stepup\Identity\Event\LocalePreferenceExpressedEvent; use Surfnet\Stepup\Identity\Event\PhonePossessionProvenEvent; -use Surfnet\Stepup\Identity\Event\SecondFactorVettedPossessionSkippedEvent; +use Surfnet\Stepup\Identity\Event\SecondFactorVettedWithoutTokenProofOfPossession; use Surfnet\Stepup\Identity\Event\SecondFactorVettedEvent; use Surfnet\Stepup\Identity\Event\U2fDevicePossessionProvenEvent; use Surfnet\Stepup\Identity\Event\YubikeyPossessionProvenEvent; @@ -1544,7 +1544,7 @@ public function a_second_factor_can_be_vetted_without_a_physical_proven_possessi ]) ->when($command) ->then([ - new SecondFactorVettedPossessionSkippedEvent( + new SecondFactorVettedWithoutTokenProofOfPossession( $registrantId, $registrantNameId, $registrantInstitution, diff --git a/src/Surfnet/StepupMiddleware/CommandHandlingBundle/Tests/Identity/CommandHandler/SecondFactorRevocationTest.php b/src/Surfnet/StepupMiddleware/CommandHandlingBundle/Tests/Identity/CommandHandler/SecondFactorRevocationTest.php index 6bc8abe59..494dfd310 100644 --- a/src/Surfnet/StepupMiddleware/CommandHandlingBundle/Tests/Identity/CommandHandler/SecondFactorRevocationTest.php +++ b/src/Surfnet/StepupMiddleware/CommandHandlingBundle/Tests/Identity/CommandHandler/SecondFactorRevocationTest.php @@ -32,7 +32,7 @@ use Surfnet\Stepup\Identity\Event\CompliedWithVettedSecondFactorRevocationEvent; use Surfnet\Stepup\Identity\Event\EmailVerifiedEvent; use Surfnet\Stepup\Identity\Event\IdentityCreatedEvent; -use Surfnet\Stepup\Identity\Event\SecondFactorVettedPossessionSkippedEvent; +use Surfnet\Stepup\Identity\Event\SecondFactorVettedWithoutTokenProofOfPossession; use Surfnet\Stepup\Identity\Event\SecondFactorVettedEvent; use Surfnet\Stepup\Identity\Event\U2fDevicePossessionProvenEvent; use Surfnet\Stepup\Identity\Event\UnverifiedSecondFactorRevokedEvent; @@ -688,7 +688,7 @@ public function a_registration_authority_can_revoke_a_possession_proved_skipped_ $registrantEmail, new Locale('en_GB') ), - new SecondFactorVettedPossessionSkippedEvent( + new SecondFactorVettedWithoutTokenProofOfPossession( $registrantId, $registrantNameId, $registrantInstitution, diff --git a/src/Surfnet/StepupMiddleware/GatewayBundle/Projector/SecondFactorProjector.php b/src/Surfnet/StepupMiddleware/GatewayBundle/Projector/SecondFactorProjector.php index 4d1b18779..6a3d61b3c 100644 --- a/src/Surfnet/StepupMiddleware/GatewayBundle/Projector/SecondFactorProjector.php +++ b/src/Surfnet/StepupMiddleware/GatewayBundle/Projector/SecondFactorProjector.php @@ -22,7 +22,7 @@ use Surfnet\Stepup\Identity\Event\CompliedWithVettedSecondFactorRevocationEvent; use Surfnet\Stepup\Identity\Event\IdentityForgottenEvent; use Surfnet\Stepup\Identity\Event\LocalePreferenceExpressedEvent; -use Surfnet\Stepup\Identity\Event\SecondFactorVettedPossessionSkippedEvent; +use Surfnet\Stepup\Identity\Event\SecondFactorVettedWithoutTokenProofOfPossession; use Surfnet\Stepup\Identity\Event\SecondFactorVettedEvent; use Surfnet\Stepup\Identity\Event\VettedSecondFactorRevokedEvent; use Surfnet\Stepup\Identity\Event\YubikeySecondFactorBootstrappedEvent; @@ -75,7 +75,7 @@ public function applySecondFactorVettedEvent(SecondFactorVettedEvent $event) ); } - public function applySecondFactorVettedPossessionSkippedEvent(SecondFactorVettedPossessionSkippedEvent $event) + public function applySecondFactorVettedWithoutTokenProofOfPossession(SecondFactorVettedWithoutTokenProofOfPossession $event) { $this->repository->save( new SecondFactor(