Skip to content
This repository was archived by the owner on Jun 25, 2024. It is now read-only.

Commit 2375e0c

Browse files
Merge pull request #50 from silinternational/develop
warn users of depleting codes
2 parents 8206462 + f0b32ea commit 2375e0c

9 files changed

Lines changed: 281 additions & 138 deletions

File tree

README.md

Lines changed: 105 additions & 103 deletions
Large diffs are not rendered by default.

development/idp4/m991231_235959_insert_mfa_test_users.php

Lines changed: 5 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -53,21 +53,11 @@ public function safeUp()
5353
[ 3 , 1 ,'$2y$10$rA5MdrbEcmbCiqtAgPXnYeBCEKc.AnylPArnamyu.x4DS/A0/0/4i', MySqlDateTime::now()], // 77802769
5454
[ 4 , 1 ,'$2y$10$JsiRI/W/FLfZzJLPj8umKeXP.rvsOW4aYQO5mOEOwGkBPpKhKWT2K', MySqlDateTime::now()], // 01970541
5555
[ 5 , 1 ,'$2y$10$NWw0.DPBSm.bjQoSck8xbeqJgENUhE/WazmHmsEtWoxs/UKaIdkUq', MySqlDateTime::now()], // 37771076
56-
[ 6 , 1 ,'$2y$10$KE2849CaFCh4FNy61QfZfO5.3KIakJ0Ri.diDYrTA6DY5FUcUkiTS', MySqlDateTime::now()], // 39178450
57-
[ 7 , 1 ,'$2y$10$RqIdEzZ0t9dN6XEbCv9saeR91jmhhnAU0IygG2vbkToJtnjVvPOA.', MySqlDateTime::now()], // 01813404
58-
[ 8 , 1 ,'$2y$10$iiokti/0BscHBdId9GMDeeycdJUbhu3CySBptid4WjlT3ByYSITkq', MySqlDateTime::now()], // 00416843
59-
[ 9 , 1 ,'$2y$10$cICT0MhQ81/dEWYK/kY/LO2VMYvkoqd1/euP5OG7u5V6FRrSBEY6i', MySqlDateTime::now()], // 90068701
60-
[ 10 , 1 ,'$2y$10$OzQeTZlUGLOa0Q6Wm2zViuqV4CLzlkJxu8Sjli/v.JI0oYzj.B7um', MySqlDateTime::now()], // 35775442
61-
[ 11 , 4 ,'$2y$10$j/V6zcotFES8MkVmgRaiMe2E6DV1qjmO8UhUoJQD0/.p6LhZddGn2', MySqlDateTime::now()], // 94923279
62-
[ 12 , 4 ,'$2y$10$If6srqyKGBag/x.nPDBeau9bjNR1RZgxqRVKhdRhJk2PkbOn5rKNS', MySqlDateTime::now()], // 82743523
63-
[ 13 , 4 ,'$2y$10$rA5MdrbEcmbCiqtAgPXnYeBCEKc.AnylPArnamyu.x4DS/A0/0/4i', MySqlDateTime::now()], // 77802769
64-
[ 14 , 4 ,'$2y$10$JsiRI/W/FLfZzJLPj8umKeXP.rvsOW4aYQO5mOEOwGkBPpKhKWT2K', MySqlDateTime::now()], // 01970541
65-
[ 15 , 4 ,'$2y$10$NWw0.DPBSm.bjQoSck8xbeqJgENUhE/WazmHmsEtWoxs/UKaIdkUq', MySqlDateTime::now()], // 37771076
66-
[ 16 , 4 ,'$2y$10$KE2849CaFCh4FNy61QfZfO5.3KIakJ0Ri.diDYrTA6DY5FUcUkiTS', MySqlDateTime::now()], // 39178450
67-
[ 17 , 4 ,'$2y$10$RqIdEzZ0t9dN6XEbCv9saeR91jmhhnAU0IygG2vbkToJtnjVvPOA.', MySqlDateTime::now()], // 01813404
68-
[ 18 , 4 ,'$2y$10$iiokti/0BscHBdId9GMDeeycdJUbhu3CySBptid4WjlT3ByYSITkq', MySqlDateTime::now()], // 00416843
69-
[ 19 , 4 ,'$2y$10$cICT0MhQ81/dEWYK/kY/LO2VMYvkoqd1/euP5OG7u5V6FRrSBEY6i', MySqlDateTime::now()], // 90068701
70-
[ 20 , 4 ,'$2y$10$OzQeTZlUGLOa0Q6Wm2zViuqV4CLzlkJxu8Sjli/v.JI0oYzj.B7um', MySqlDateTime::now()], // 35775442
56+
[ 6 , 4 ,'$2y$10$j/V6zcotFES8MkVmgRaiMe2E6DV1qjmO8UhUoJQD0/.p6LhZddGn2', MySqlDateTime::now()], // 94923279
57+
[ 7 , 4 ,'$2y$10$If6srqyKGBag/x.nPDBeau9bjNR1RZgxqRVKhdRhJk2PkbOn5rKNS', MySqlDateTime::now()], // 82743523
58+
[ 8 , 4 ,'$2y$10$rA5MdrbEcmbCiqtAgPXnYeBCEKc.AnylPArnamyu.x4DS/A0/0/4i', MySqlDateTime::now()], // 77802769
59+
[ 9 , 4 ,'$2y$10$JsiRI/W/FLfZzJLPj8umKeXP.rvsOW4aYQO5mOEOwGkBPpKhKWT2K', MySqlDateTime::now()], // 01970541
60+
[ 10 , 4 ,'$2y$10$NWw0.DPBSm.bjQoSck8xbeqJgENUhE/WazmHmsEtWoxs/UKaIdkUq', MySqlDateTime::now()], // 37771076
7161
]);
7262
}
7363

dictionaries/mfa.definition.json

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -132,6 +132,36 @@
132132
"fr": "Votre compte nécessite une sécurité supplémentaire, vous devez configurer la vérification en deux étapes en ce moment",
133133
"ko": "계정에 대한 추가 보안이 필요하므로 지금 2 단계 인증을 설정해야합니다."
134134
},
135+
"running_out_header": {
136+
"en": "Almost out of printable codes",
137+
"es": "Casi sin códigos imprimibles",
138+
"fr": "Codes imprimables presque épuisés",
139+
"ko": "인쇄 ​가능한 ​코드​가 거의 남지 않았습니다"
140+
},
141+
"running_out_info": {
142+
"en": "You only have {numBackupCodesRemaining} more left.",
143+
"es": "Solo tiene {numBackupCodesRemaining} más disponible.",
144+
"fr": "Vous avez seulement {numBackupCodesRemaining} qui restent.",
145+
"ko": "{numBackupCodesRemaining} 만 남았습니다."
146+
},
147+
"no_more_codes_header": {
148+
"en": "Last printable code used",
149+
"es": "Último código imprimible utilizado",
150+
"fr": "Dernier code imprimable utilisé",
151+
"ko": "​​마지막 인쇄 가능 코드가​​ ​사용되었습니다."
152+
},
153+
"has_options_besides_codes": {
154+
"en": "Thankfully you do have other 2-Step Verification options set up but you should create more Printable codes if you plan to need them in the future.",
155+
"es": "Afortunadamente, tiene otras opciones de verificación en dos pasos configuradas, pero debe crear más códigos imprimibles si planea necesitarlos en el futuro.",
156+
"fr": "Heureusement, vous avez d'autres options de vérification en deux étapes, mais vous devriez créer plus de codes imprimables si vous prévoyez en avoir besoin à l'avenir.",
157+
"ko": "다른 2 단계 인증 옵션​은​ 설정​ 되었으나​ ​인쇄 가능 코드가 나중에 ​필요할 ​것으로 ​예상되면​ 코드를 ​더 ​만들어야​ ​합니다."
158+
},
159+
"has_no_more_options": {
160+
"en": "Since you do not have any other 2-Step Verification options set up at this time, you will need to get more Printable codes before another one is required.",
161+
"es": "Como no tiene configuradas otras opciones de verificación en dos pasos en este momento, necesitará obtener más códigos imprimibles antes de que se requiera otro.",
162+
"fr": "Comme aucune autre option de vérification en deux étapes n'est configurée pour l'instant, vous devez obtenir davantage de codes imprimables avant d'en avoir besoin d'un autre.",
163+
"ko": "코드​가 요구되기 전에 인쇄 가능 코드를​ 더 가져와야​ ​합니다."
164+
},
135165
"use_others": {
136166
"en": "More options",
137167
"es": "Mas opciones",
@@ -192,6 +222,12 @@
192222
"fr": "Essayer de nouveau",
193223
"ko": "다시 시도"
194224
},
225+
"button_get_more": {
226+
"en": "Get more",
227+
"es": "Obtenga más",
228+
"fr": "Avoir plus",
229+
"ko": "더​ ​​가져오기"
230+
},
195231
"remember_this": {
196232
"en": "Remember this browser for 30 days",
197233
"es": "Recuerde esta navegador por 30 días",

docker-compose.yml

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ services:
117117
MYSQL_DATABASE: "silauth"
118118
MYSQL_USER: "user"
119119
MYSQL_PASSWORD: "pass"
120-
ID_BROKER_ACCESS_TOKEN: "arc-cli-abc123"
120+
ID_BROKER_ACCESS_TOKEN: "test-cli-abc123"
121121
ID_BROKER_ASSERT_VALID_IP: "false"
122122
ID_BROKER_BASE_URI: "http://broker"
123123
REMEMBER_ME_SECRET: "dummy"
@@ -151,8 +151,14 @@ services:
151151
MYSQL_PASSWORD: "pass"
152152
EMAIL_SERVICE_accessToken: "dummy"
153153
EMAIL_SERVICE_assertValidIp: "false"
154-
EMAIL_SERVICE_baseUrl: "localhost"
155-
API_ACCESS_KEYS: "arc-cli-abc123"
154+
EMAIL_SERVICE_baseUrl: "dummy"
155+
EMAILER_CLASS: Sil\SilIdBroker\Behat\Context\fakes\FakeEmailer
156+
HELP_CENTER_URL: "https://example.org/help"
157+
PASSWORD_FORGOT_URL: "https://example.org/forgot"
158+
PASSWORD_PROFILE_URL: "https://example.org/profile"
159+
SUPPORT_EMAIL: "support@example.org"
160+
EMAIL_SIGNATURE: "one red pill, please"
161+
API_ACCESS_KEYS: "test-cli-abc123"
156162
APP_ENV: "dev"
157163
MIGRATE_PW_FROM_LDAP: "false"
158164
command: ["bash", "-c", "whenavail brokerDb 3306 60 ./yii migrate --interactive=0 && ./run.sh"]

themes/material/common-head-elements.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
$colors = htmlentities($this->configuration->getValue('theme.color-scheme') ?: 'indigo-purple');
3333
?>
3434
<link rel="stylesheet" href="material.<?= $colors ?>.1.2.1.min.css">
35-
<link rel="stylesheet" href="styles.2.2.3.css">
35+
<link rel="stylesheet" href="styles.2.2.4.css">
3636

3737
<script async src="material.1.2.1.min.js"></script>
3838

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
<!DOCTYPE html>
2+
<html>
3+
<head>
4+
<title><?= $this->t('{material:mfa:title}') ?></title>
5+
6+
<?php include __DIR__ . '/../common-head-elements.php' ?>
7+
</head>
8+
<body class="gradient-bg">
9+
<div class="mdl-layout mdl-layout--fixed-header fill-viewport">
10+
<header class="mdl-layout__header">
11+
<div class="mdl-layout__header-row">
12+
<span class="mdl-layout-title">
13+
<?= $this->t('{material:mfa:header}') ?>
14+
</span>
15+
</div>
16+
</header>
17+
<main class="mdl-layout__content" layout-children="column">
18+
<form layout-children="column" method="post">
19+
<div class="mdl-card mdl-shadow--8dp">
20+
<div class="mdl-card__media white-bg margin" layout-children="column">
21+
<i class="mdl-color-text--red error material-icons mdl-typography--display-4">warning</i>
22+
</div>
23+
24+
<div class="mdl-card__title center">
25+
<h1 class="mdl-card__title-text">
26+
<?= $this->t('{material:mfa:running_out_header}') ?>
27+
</h1>
28+
</div>
29+
30+
<div class="mdl-card__title center" >
31+
<p class="mdl-card__subtitle-text">
32+
<?= $this->t('{material:mfa:running_out_info}', ['{numBackupCodesRemaining}' => (int)$this->data['numBackupCodesRemaining']]) ?>
33+
</p>
34+
</div>
35+
36+
<div class="mdl-card__actions" layout-children="row">
37+
<button name="continue" class="mdl-button">
38+
<?= $this->t('{material:mfa:button_later}') ?>
39+
</button>
40+
41+
<span flex></span>
42+
43+
<button name="setUpMfa" class="mdl-button mdl-button--raised mdl-button--primary">
44+
<?= $this->t('{material:mfa:button_get_more}') ?>
45+
</button>
46+
</div>
47+
</div>
48+
</form>
49+
</main>
50+
</div>
51+
</body>
52+
</html>

themes/material/mfa/must-set-up-mfa.php

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -39,17 +39,15 @@
3939
<?php
4040
$url = $this->data['learnMoreUrl'] ?? null;
4141
if (! empty($url)) {
42-
?>
43-
<a href="<?= htmlentities($url) ?>" target="_blank"
44-
class="mdl-button mdl-button--primary margin">
45-
<?= $this->t('{material:mfa:button_learn_more}') ?>
46-
</a>
47-
<?php
42+
?>
43+
<a href="<?= htmlentities($url) ?>" target="_blank" class="mdl-button mdl-button--primary margin">
44+
<?= $this->t('{material:mfa:button_learn_more}') ?>
45+
</a>
46+
<?php
4847
}
4948
?>
5049

51-
<button name="setUpMfa"
52-
class="mdl-button mdl-button--raised mdl-button--primary">
50+
<button name="setUpMfa" class="mdl-button mdl-button--raised mdl-button--primary">
5351
<?= $this->t('{material:mfa:button_set_up}') ?>
5452
</button>
5553
</div>
Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
<!DOCTYPE html>
2+
<html>
3+
<head>
4+
<title><?= $this->t('{material:mfa:title}') ?></title>
5+
6+
<?php include __DIR__ . '/../common-head-elements.php' ?>
7+
</head>
8+
<body class="gradient-bg">
9+
<div class="mdl-layout mdl-layout--fixed-header fill-viewport">
10+
<header class="mdl-layout__header">
11+
<div class="mdl-layout__header-row">
12+
<span class="mdl-layout-title">
13+
<?= $this->t('{material:mfa:header}') ?>
14+
</span>
15+
</div>
16+
</header>
17+
<main class="mdl-layout__content" layout-children="column">
18+
<form layout-children="column" method="post">
19+
<div class="mdl-card mdl-shadow--8dp">
20+
<div class="mdl-card__media white-bg margin" layout-children="column">
21+
<i class="mdl-color-text--red error material-icons mdl-typography--display-4">error</i>
22+
</div>
23+
24+
<div class="mdl-card__title center">
25+
<h1 class="mdl-card__title-text">
26+
<?= $this->t('{material:mfa:no_more_codes_header}') ?>
27+
</h1>
28+
</div>
29+
30+
<div class="mdl-card__title center" >
31+
<p class="mdl-card__subtitle-text">
32+
<?php if ($this->data['hasOtherMfaOptions']): ?>
33+
<?= $this->t('{material:mfa:has_options_besides_codes}') ?>
34+
<?php else: ?>
35+
<?= $this->t('{material:mfa:has_no_more_options}') ?>
36+
<?php endif; ?>
37+
</p>
38+
</div>
39+
40+
<div class="mdl-card__actions" layout-children="row">
41+
<?php if ($this->data['hasOtherMfaOptions']): ?>
42+
<button name="continue" class="mdl-button">
43+
<?= $this->t('{material:mfa:button_later}') ?>
44+
</button>
45+
<?php endif; ?>
46+
47+
<span flex></span>
48+
49+
<button name="setUpMfa" class="mdl-button mdl-button--raised mdl-button--primary">
50+
<?= $this->t('{material:mfa:button_get_more}') ?>
51+
</button>
52+
</div>
53+
</div>
54+
</form>
55+
</main>
56+
</div>
57+
</body>
58+
</html>
Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,7 @@ p {
1212
flex-direction: row;
1313
align-items: center;
1414

15-
/* make sure the children break nicely for different browser widths, e.g.,
16-
tablet, phone, etc. */
15+
/* make sure the children break nicely for different browser widths, e.g., tablet, phone, etc. */
1716
flex-wrap: wrap;
1817
}
1918

@@ -50,6 +49,9 @@ form p.error > i {
5049
margin: 0 1em;
5150
}
5251

52+
i.material-icons.mdl-typography--display-4 {
53+
font-size: 112px; /* needed to override font-size established in material icons. */
54+
}
5355
.margin {
5456
margin: 1em;
5557
}
@@ -168,16 +170,15 @@ form p.error > i {
168170
color: blue;
169171
}
170172

171-
/* The font-size in the mdl-textfield was overriding the one in
172-
caption since it was defined later in the CSS but the font-size from
173-
caption is what was needed here so more specificity required to override
174-
it back */
173+
/* The font-size in the mdl-textfield was overriding the one in caption since
174+
it was defined later in the CSS but the font-size from caption is what was
175+
needed here so more specificity required to override it back */
175176
.mdl-textfield.mdl-typography--caption {
176177
font-size: 12px
177178
}
178179

179-
/* special case where we want a button for all it's built-in characteristics, e.g., primary color,
180-
but also want to set the text apart a bit. */
180+
/* special case where we want a button for all it's built-in characteristics,
181+
e.g., primary color, but also want to set the text apart a bit. */
181182
.mdl-button.mdl-typography--caption {
182183
text-transform: none;
183184
font-size: 12px

0 commit comments

Comments
 (0)