Skip to content

Commit bb028dc

Browse files
authored
Merge pull request #559 from OpenConext/feature/yubikey_autocomplete
rename yubikey entry form to solve #558
2 parents b0823d2 + b66b705 commit bb028dc

9 files changed

Lines changed: 14 additions & 15 deletions

File tree

ci/docker/compose.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,13 @@ include:
44
services:
55

66
selenium:
7-
image: selenium/standalone-chrome:latest
7+
image: zenika/alpine-chrome:latest
88
container_name: gateway-selenium
9-
environment:
10-
START_XVFB: "false"
9+
command: ["--no-sandbox", "--headless", "--disable-gpu", "--remote-debugging-address=0.0.0.0", "--remote-debugging-port=9222", "--ignore-certificate-errors", "--disable-dev-shm-usage"]
1110
volumes:
1211
- /dev/shm:/dev/shm
1312
networks:
1413
openconextdev:
1514
aliases:
1615
- selenium.dev.openconext.local
16+
- chrome.dev.openconext.local

ci/docker/init.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
#!/usr/bin/env bash
22
cp ../../devconf/stepup/gateway/surfnet_yubikey.yaml.dist ../../devconf/stepup/gateway/surfnet_yubikey.yaml
33
echo "pulling the images"
4-
docker compose pull gateway selenium haproxy ssp mariadb azuremfa chrome
4+
docker compose pull gateway selenium haproxy ssp mariadb azuremfa
55
echo "starting the images"
6-
docker compose up gateway selenium haproxy ssp mariadb azuremfa chrome -d
6+
docker compose up gateway selenium haproxy ssp mariadb azuremfa -d
77
echo "intialising the environment"
88
docker compose exec -T gateway bash -c '
99
cp /var/www/html/devconf/stepup/gateway/surfnet_yubikey.yaml.dist /var/www/html/devconf/stepup/gateway/surfnet_yubikey.yaml && \

public/scss/authentication.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ body.authentication {
2020
}
2121
}
2222

23-
form[name="gateway_verify_yubikey_otp"] {
23+
form[name="gateway_verify_yubikey"] {
2424
max-width: 525px;
2525
padding: 2rem 0 4rem 0;
2626
}

src/Surfnet/StepupGateway/GatewayBundle/Command/VerifyYubikeyOtpCommand.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ class VerifyYubikeyOtpCommand
2828
*/
2929
#[Assert\NotBlank(message: 'gateway.verify_yubikey_command.otp.may_not_be_empty')]
3030
#[Assert\Type(type: 'string', message: 'gateway.verify_yubikey_command.otp.must_be_string')]
31-
public $otp;
31+
public $yubikeyInput;
3232

3333
/**
3434
* @var string

src/Surfnet/StepupGateway/GatewayBundle/Form/Type/VerifyYubikeyOtpType.php

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,12 +28,11 @@ class VerifyYubikeyOtpType extends AbstractType
2828
{
2929
public function buildForm(FormBuilderInterface $builder, array $options): void
3030
{
31-
$builder->add('otp', TextType::class, [
31+
$builder->add('yubikeyInput', TextType::class, [
3232
'label' => /** @Ignore */ false,
3333
'required' => true,
3434
'attr' => [
3535
'autofocus' => true,
36-
'autocomplete' => 'off',
3736
]
3837
]);
3938
// This button is the form's default button, so as to prevent the form being submitted as if the cancel button
@@ -52,6 +51,6 @@ public function configureOptions(OptionsResolver $resolver): void
5251

5352
public function getBlockPrefix(): string
5453
{
55-
return 'gateway_verify_yubikey_otp';
54+
return 'gateway_verify_yubikey';
5655
}
5756
}

src/Surfnet/StepupGateway/GatewayBundle/Resources/config/services.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -206,7 +206,7 @@ services:
206206

207207
gateway.form.verify_yubikey:
208208
class: Surfnet\StepupGateway\GatewayBundle\Form\Type\VerifyYubikeyOtpType
209-
tags: [{ name: form.type, alias: gateway_verify_yubikey_otp }]
209+
tags: [{ name: form.type, alias: gateway_verify_yubikey }]
210210

211211
gateway.form.choose_second_factor:
212212
class: Surfnet\StepupGateway\GatewayBundle\Form\Type\ChooseSecondFactorType

src/Surfnet/StepupGateway/GatewayBundle/Service/StepUpAuthenticationService.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -328,7 +328,7 @@ public function verifyYubikeyOtp(VerifyYubikeyOtpCommand $command)
328328
$requester->institution = $secondFactor->institution;
329329

330330
$otp = new ApiOtp();
331-
$otp->value = $command->otp;
331+
$otp->value = $command->yubikeyInput;
332332

333333
$result = $this->yubikeyService->verifyOtp($otp, $requester);
334334

templates/second_factor/verify_yubikey_second_factor.html.twig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
{% endfor %}
1616
{% endif %}
1717

18-
{{ form_row(form.otp, { value: '' }) }}
18+
{{ form_row(form.yubikeyInput, { value: '' }) }}
1919

2020
{{ form_end(form) }}
2121

tests/features/bootstrap/FeatureContext.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -152,8 +152,8 @@ public function iShouldSeeTheTiqrAuthenticationScreen(): void
152152
#[\Behat\Step\When('I enter the OTP')]
153153
public function iEnterTheOtp(): void
154154
{
155-
$this->minkContext->fillField('gateway_verify_yubikey_otp_otp', 'bogus-otp-we-use-a-mock-yubikey-service');
156-
$this->minkContext->pressButton('gateway_verify_yubikey_otp_submit');
155+
$this->minkContext->fillField('gateway_verify_yubikey_yubikeyInput', 'bogus-otp-we-use-a-mock-yubikey-service');
156+
$this->minkContext->pressButton('gateway_verify_yubikey_submit');
157157
$this->pressButtonWhenNoJavascriptSupport();
158158
}
159159

0 commit comments

Comments
 (0)