token-validator: upload SSH key automatically validate latest challenge

This commit is contained in:
nemunaire 2019-03-25 22:46:12 +01:00
parent 7bfed9dc89
commit de1492e1db
2 changed files with 2 additions and 0 deletions

View File

@ -236,6 +236,7 @@ func init() {
Check: challengeDisk,
},
/* Last : SSH key, see ssh.go:156 in NewKey function */
}
router.GET("/challenge", apiHandler(getChallengeList))

View File

@ -153,6 +153,7 @@ func (s Student) NewKey(key string) (k StudentKey, err error) {
} else if kid, err := res.LastInsertId(); err != nil {
return StudentKey{}, err
} else {
s.UnlockNewChallenge(len(challenges), "")
return StudentKey{kid, s.Id, key, time.Now()}, nil
}
}