token-validator: wg tunnel API interface

This commit is contained in:
nemunaire 2019-03-13 13:47:01 +01:00
commit ab40917285
4 changed files with 241 additions and 14 deletions

View file

@ -112,6 +112,18 @@ CREATE TABLE IF NOT EXISTS student_sessions(
time TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
FOREIGN KEY(id_student) REFERENCES students(id_student)
) DEFAULT CHARACTER SET = utf8 COLLATE = utf8_bin;
`); err != nil {
return err
}
if _, err := db.Exec(`
CREATE TABLE IF NOT EXISTS student_tunnel_tokens(
token BLOB(255) NOT NULL,
token_text CHAR(10) NOT NULL,
id_student INTEGER NOT NULL,
time TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
pubkey BLOB(50) DEFAULT NULL,
FOREIGN KEY(id_student) REFERENCES students(id_student)
) DEFAULT CHARACTER SET = utf8 COLLATE = utf8_bin;
`); err != nil {
return err
}