From 6086b821818ec6c69b770323e3bcd88d0093e512 Mon Sep 17 00:00:00 2001 From: Pierre-Olivier Mercier Date: Fri, 28 Feb 2020 13:22:31 +0100 Subject: [PATCH] token-validator: add email bonus challenge --- token-validator/challenge.go | 10 ++++++++++ token-validator/htdocs/js/adlin-dashboard.js | 9 +++++---- 2 files changed, 15 insertions(+), 4 deletions(-) diff --git a/token-validator/challenge.go b/token-validator/challenge.go index c74df7c..afdf224 100644 --- a/token-validator/challenge.go +++ b/token-validator/challenge.go @@ -194,6 +194,10 @@ func challengeDisk(s *Student, t *givenToken, chid int) error { } } +func challengeEMail(s *Student, t *givenToken, chid int) error { + return errors.New("This is not the expected token.") +} + var challenges []Challenge func init() { @@ -246,6 +250,12 @@ func init() { Check: challengeDisk, }, + /* Bonus 3 : mail */ + Challenge{ + Accessible: []func(*Student, *http.Request) error{noAccessRestriction}, + Check: challengeEMail, + }, + /* Last : SSH key, see ssh.go:156 in NewKey function */ Challenge{ Accessible: []func(*Student, *http.Request) error{noAccess}, diff --git a/token-validator/htdocs/js/adlin-dashboard.js b/token-validator/htdocs/js/adlin-dashboard.js index 0d88654..10402f4 100644 --- a/token-validator/htdocs/js/adlin-dashboard.js +++ b/token-validator/htdocs/js/adlin-dashboard.js @@ -5,10 +5,11 @@ var tuto_progress = [ 3: { title: "HTTPS on + time", label: "t3"}, 4: { title: "DNS ok", label: "t4"}, 5: { title: "On Internet", label: "t5"}, - 6: { title: "Bonus caché", label: "B?"}, - 7: { title: "Bonus ICMP", label: "B1"}, - 8: { title: "Bonus disk", label: "B2"}, - 9: { title: "Uploaded SSH key", label: "C"}, + 6: { title: "Bonus caché", label: "b0"}, + 7: { title: "Bonus ICMP", label: "b1"}, + 8: { title: "Bonus disk", label: "b2"}, + 9: { title: "Bonus email", label: "b3"}, + 10: { title: "Uploaded SSH key", label: "ssh"}, }, { 100: { title: "HTTP", label: "HTTP"},