@@ -94,7 +94,7 @@ |
||
| 94 | 94 | return new Cookie( |
| 95 | 95 | $this->configuration->getName(), |
| 96 | 96 | $value, |
| 97 | - $this->configuration->isPersistent() ? $this->getTimestamp($this->configuration->getLifetime()): 0, |
|
| 97 | + $this->configuration->isPersistent() ? $this->getTimestamp($this->configuration->getLifetime()) : 0, |
|
| 98 | 98 | '/', |
| 99 | 99 | null, |
| 100 | 100 | true, |
@@ -271,7 +271,7 @@ |
||
| 271 | 271 | $form->addError( |
| 272 | 272 | new FormError( |
| 273 | 273 | $this->get('translator') |
| 274 | - ->trans('gateway.form.gateway_choose_second_factor.unknown_second_factor_type') |
|
| 274 | + ->trans('gateway.form.gateway_choose_second_factor.unknown_second_factor_type') |
|
| 275 | 275 | ) |
| 276 | 276 | ); |
| 277 | 277 | } |
@@ -247,7 +247,7 @@ discard block |
||
| 247 | 247 | |
| 248 | 248 | // Filter the selected second factor from the array collection |
| 249 | 249 | $secondFactorFiltered = $secondFactors->filter( |
| 250 | - function ($secondFactor) use ($secondFactorType) { |
|
| 250 | + function($secondFactor) use ($secondFactorType) { |
|
| 251 | 251 | return $secondFactorType === $secondFactor->secondFactorType; |
| 252 | 252 | } |
| 253 | 253 | ); |
@@ -392,7 +392,7 @@ discard block |
||
| 392 | 392 | $form = $this->createForm(VerifyYubikeyOtpType::class, $command)->handleRequest($request); |
| 393 | 393 | $cancelForm = $this->buildCancelAuthenticationForm($authenticationMode)->handleRequest($request); |
| 394 | 394 | |
| 395 | - if ($form->isSubmitted() && $form->isValid()) { |
|
| 395 | + if ($form->isSubmitted() && $form->isValid()) { |
|
| 396 | 396 | $result = $this->getStepupService()->verifyYubikeyOtp($command); |
| 397 | 397 | if ($result->didOtpVerificationFail()) { |
| 398 | 398 | $form->addError( |
@@ -32,7 +32,7 @@ discard block |
||
| 32 | 32 | |
| 33 | 33 | public function registerBundles(): iterable |
| 34 | 34 | { |
| 35 | - $contents = require $this->getProjectDir().'/config/bundles.php'; |
|
| 35 | + $contents = require $this->getProjectDir() . '/config/bundles.php'; |
|
| 36 | 36 | foreach ($contents as $class => $envs) { |
| 37 | 37 | if ($envs[$this->environment] ?? $envs['all'] ?? false) { |
| 38 | 38 | yield new $class(); |
@@ -47,23 +47,23 @@ discard block |
||
| 47 | 47 | |
| 48 | 48 | protected function configureContainer(ContainerBuilder $container, LoaderInterface $loader): void |
| 49 | 49 | { |
| 50 | - $container->addResource(new FileResource($this->getProjectDir().'/config/bundles.php')); |
|
| 50 | + $container->addResource(new FileResource($this->getProjectDir() . '/config/bundles.php')); |
|
| 51 | 51 | $container->setParameter('container.dumper.inline_class_loader', \PHP_VERSION_ID < 70400 || $this->debug); |
| 52 | 52 | $container->setParameter('container.dumper.inline_factories', true); |
| 53 | - $confDir = $this->getProjectDir().'/config'; |
|
| 53 | + $confDir = $this->getProjectDir() . '/config'; |
|
| 54 | 54 | |
| 55 | - $loader->load($confDir.'/{packages}/*'.self::CONFIG_EXTS, 'glob'); |
|
| 56 | - $loader->load($confDir.'/{packages}/'.$this->environment.'/*'.self::CONFIG_EXTS, 'glob'); |
|
| 57 | - $loader->load($confDir.'/{services}'.self::CONFIG_EXTS, 'glob'); |
|
| 58 | - $loader->load($confDir.'/{services}_'.$this->environment.self::CONFIG_EXTS, 'glob'); |
|
| 55 | + $loader->load($confDir . '/{packages}/*' . self::CONFIG_EXTS, 'glob'); |
|
| 56 | + $loader->load($confDir . '/{packages}/' . $this->environment . '/*' . self::CONFIG_EXTS, 'glob'); |
|
| 57 | + $loader->load($confDir . '/{services}' . self::CONFIG_EXTS, 'glob'); |
|
| 58 | + $loader->load($confDir . '/{services}_' . $this->environment . self::CONFIG_EXTS, 'glob'); |
|
| 59 | 59 | } |
| 60 | 60 | |
| 61 | 61 | protected function configureRoutes(RouteCollectionBuilder $routes): void |
| 62 | 62 | { |
| 63 | - $confDir = $this->getProjectDir().'/config'; |
|
| 63 | + $confDir = $this->getProjectDir() . '/config'; |
|
| 64 | 64 | |
| 65 | - $routes->import($confDir.'/{routes}/'.$this->environment.'/*'.self::CONFIG_EXTS, '/', 'glob'); |
|
| 66 | - $routes->import($confDir.'/{routes}/*'.self::CONFIG_EXTS, '/', 'glob'); |
|
| 67 | - $routes->import($confDir.'/{routes}'.self::CONFIG_EXTS, '/', 'glob'); |
|
| 65 | + $routes->import($confDir . '/{routes}/' . $this->environment . '/*' . self::CONFIG_EXTS, '/', 'glob'); |
|
| 66 | + $routes->import($confDir . '/{routes}/*' . self::CONFIG_EXTS, '/', 'glob'); |
|
| 67 | + $routes->import($confDir . '/{routes}' . self::CONFIG_EXTS, '/', 'glob'); |
|
| 68 | 68 | } |
| 69 | 69 | } |
@@ -69,7 +69,7 @@ |
||
| 69 | 69 | if ($subjectNameIdFromResponse !== $secondFactor->secondFactorIdentifier) { |
| 70 | 70 | throw new ReceivedInvalidSubjectNameIdException( |
| 71 | 71 | sprintf( |
| 72 | - 'The nameID received from the GSSP (%s) did not match the selected second factor (%s). This '. |
|
| 72 | + 'The nameID received from the GSSP (%s) did not match the selected second factor (%s). This ' . |
|
| 73 | 73 | 'might be an indication someone is tampering with a GSSP. The authentication was started by %s', |
| 74 | 74 | $subjectNameIdFromResponse, |
| 75 | 75 | $secondFactor->secondFactorIdentifier, |
@@ -149,7 +149,7 @@ |
||
| 149 | 149 | } else { |
| 150 | 150 | // Render the regular SAML response, we do not return it yet, the SSO on 2FA handler will use it to store |
| 151 | 151 | // the SSO on 2FA cookie. |
| 152 | - $httpResponse = $responseRendering->renderResponse($responseContext, $response, $request); |
|
| 152 | + $httpResponse = $responseRendering->renderResponse($responseContext, $response, $request); |
|
| 153 | 153 | } |
| 154 | 154 | |
| 155 | 155 | if ($response->isSuccess()) { |
@@ -83,15 +83,15 @@ discard block |
||
| 83 | 83 | public function aUserIdentifiedByWithAVettedToken($institution, $nameId, $tokenType) |
| 84 | 84 | { |
| 85 | 85 | switch (strtolower($tokenType)) { |
| 86 | - case "yubikey": |
|
| 87 | - $this->currentToken = $this->fixtureService->registerYubikeyToken($nameId, $institution); |
|
| 88 | - break; |
|
| 89 | - case "sms": |
|
| 90 | - $this->currentToken = $this->fixtureService->registerSmsToken($nameId, $institution); |
|
| 91 | - break; |
|
| 92 | - case "tiqr": |
|
| 93 | - $this->currentToken = $this->fixtureService->registerTiqrToken($nameId, $institution); |
|
| 94 | - break; |
|
| 86 | + case "yubikey": |
|
| 87 | + $this->currentToken = $this->fixtureService->registerYubikeyToken($nameId, $institution); |
|
| 88 | + break; |
|
| 89 | + case "sms": |
|
| 90 | + $this->currentToken = $this->fixtureService->registerSmsToken($nameId, $institution); |
|
| 91 | + break; |
|
| 92 | + case "tiqr": |
|
| 93 | + $this->currentToken = $this->fixtureService->registerTiqrToken($nameId, $institution); |
|
| 94 | + break; |
|
| 95 | 95 | } |
| 96 | 96 | } |
| 97 | 97 | |
@@ -101,15 +101,15 @@ discard block |
||
| 101 | 101 | public function aUserIdentifiedByWithASelfAssertedToken($institution, $nameId, $tokenType) |
| 102 | 102 | { |
| 103 | 103 | switch (strtolower($tokenType)) { |
| 104 | - case "yubikey": |
|
| 105 | - $this->currentToken = $this->fixtureService->registerYubikeyToken($nameId, $institution, true); |
|
| 106 | - break; |
|
| 107 | - case "sms": |
|
| 108 | - $this->currentToken = $this->fixtureService->registerSmsToken($nameId, $institution, true); |
|
| 109 | - break; |
|
| 110 | - case "tiqr": |
|
| 111 | - $this->currentToken = $this->fixtureService->registerTiqrToken($nameId, $institution, true); |
|
| 112 | - break; |
|
| 104 | + case "yubikey": |
|
| 105 | + $this->currentToken = $this->fixtureService->registerYubikeyToken($nameId, $institution, true); |
|
| 106 | + break; |
|
| 107 | + case "sms": |
|
| 108 | + $this->currentToken = $this->fixtureService->registerSmsToken($nameId, $institution, true); |
|
| 109 | + break; |
|
| 110 | + case "tiqr": |
|
| 111 | + $this->currentToken = $this->fixtureService->registerTiqrToken($nameId, $institution, true); |
|
| 112 | + break; |
|
| 113 | 113 | } |
| 114 | 114 | } |
| 115 | 115 | |
@@ -197,11 +197,11 @@ discard block |
||
| 197 | 197 | public function anInstitutionThatAllows(string $institution, string $option) |
| 198 | 198 | { |
| 199 | 199 | switch(true) { |
| 200 | - case $option === 'sso_on_2fa': |
|
| 201 | - $optionColumnName = 'sso_on2fa_enabled'; |
|
| 202 | - break; |
|
| 203 | - default: |
|
| 204 | - throw new RuntimeException(sprintf('Option "%s" is not supported', $option)); |
|
| 200 | + case $option === 'sso_on_2fa': |
|
| 201 | + $optionColumnName = 'sso_on2fa_enabled'; |
|
| 202 | + break; |
|
| 203 | + default: |
|
| 204 | + throw new RuntimeException(sprintf('Option "%s" is not supported', $option)); |
|
| 205 | 205 | } |
| 206 | 206 | $this->fixtureService->configureBoolean($institution, $optionColumnName, true); |
| 207 | 207 | } |
@@ -212,15 +212,15 @@ discard block |
||
| 212 | 212 | public function iShouldSelectMyTokenOnTheWAYG($tokenType) |
| 213 | 213 | { |
| 214 | 214 | switch (strtolower($tokenType)) { |
| 215 | - case "yubikey": |
|
| 216 | - $this->minkContext->pressButton('gateway_choose_second_factor_choose_yubikey'); |
|
| 217 | - break; |
|
| 218 | - case "sms": |
|
| 219 | - $this->minkContext->pressButton('gateway_choose_second_factor_choose_sms'); |
|
| 220 | - break; |
|
| 221 | - case "tiqr": |
|
| 222 | - $this->minkContext->pressButton('gateway_choose_second_factor_choose_tiqr'); |
|
| 223 | - break; |
|
| 215 | + case "yubikey": |
|
| 216 | + $this->minkContext->pressButton('gateway_choose_second_factor_choose_yubikey'); |
|
| 217 | + break; |
|
| 218 | + case "sms": |
|
| 219 | + $this->minkContext->pressButton('gateway_choose_second_factor_choose_sms'); |
|
| 220 | + break; |
|
| 221 | + case "tiqr": |
|
| 222 | + $this->minkContext->pressButton('gateway_choose_second_factor_choose_tiqr'); |
|
| 223 | + break; |
|
| 224 | 224 | } |
| 225 | 225 | } |
| 226 | 226 | |
@@ -196,7 +196,7 @@ discard block |
||
| 196 | 196 | */ |
| 197 | 197 | public function anInstitutionThatAllows(string $institution, string $option) |
| 198 | 198 | { |
| 199 | - switch(true) { |
|
| 199 | + switch (true) { |
|
| 200 | 200 | case $option === 'sso_on_2fa': |
| 201 | 201 | $optionColumnName = 'sso_on2fa_enabled'; |
| 202 | 202 | break; |
@@ -364,7 +364,7 @@ discard block |
||
| 364 | 364 | private function getCookieNames(array $responseCookieHeaders): array |
| 365 | 365 | { |
| 366 | 366 | $response = []; |
| 367 | - foreach($responseCookieHeaders as $cookie) { |
|
| 367 | + foreach ($responseCookieHeaders as $cookie) { |
|
| 368 | 368 | $parts = explode('=', $cookie); |
| 369 | 369 | $response[] = array_shift($parts); |
| 370 | 370 | } |