1
0
mirror of https://github.com/Yubico/yubikey-val.git synced 2025-01-20 10:52:15 +01:00
yubikey-val/ykval-db.sql

64 lines
1.7 KiB
MySQL
Raw Normal View History

2009-04-27 18:46:05 +00:00
-- DROP DATABASE ykval;
CREATE DATABASE ykval;
USE ykval;
2009-02-25 12:20:53 +00:00
CREATE TABLE clients (
2009-04-27 18:46:05 +00:00
id INT NOT NULL AUTO_INCREMENT,
active BOOLEAN DEFAULT TRUE,
created DATETIME NOT NULL,
secret VARCHAR(60) NOT NULL DEFAULT '',
2009-05-06 14:16:43 +00:00
email VARCHAR(255),
notes VARCHAR(100) DEFAULT '',
2009-08-28 12:08:20 +00:00
otp VARCHAR(100) DEFAULT '',
2009-04-27 18:46:05 +00:00
PRIMARY KEY (id)
2009-02-25 12:20:53 +00:00
);
CREATE TABLE yubikeys (
2009-04-27 18:46:05 +00:00
id INT NOT NULL UNIQUE AUTO_INCREMENT,
active BOOLEAN DEFAULT TRUE,
created DATETIME NOT NULL,
accessed DATETIME,
publicName VARCHAR(16) UNIQUE NOT NULL COLLATE ascii_bin,
internalName VARCHAR(12) NOT NULL COLLATE ascii_bin,
2009-04-27 18:46:05 +00:00
counter INT,
low INT,
high INT,
sessionUse INT,
notes VARCHAR(100) DEFAULT '',
2009-04-27 18:46:05 +00:00
PRIMARY KEY (id)
2009-02-25 12:20:53 +00:00
);
2009-04-27 18:52:05 +00:00
2009-11-25 10:37:37 +00:00
CREATE TABLE queue (
id INT NOT NULL UNIQUE AUTO_INCREMENT,
queued_time TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
modified_time TIMESTAMP,
random_key INT,
2009-11-25 14:15:13 +00:00
otp VARCHAR(100) NOT NULL,
2009-11-25 10:37:37 +00:00
server VARCHAR(100) NOT NULL,
2009-12-07 15:31:33 +00:00
info VARCHAR(256) NOT NULL,
2009-11-25 10:37:37 +00:00
PRIMARY KEY (id)
);
2009-05-06 14:28:42 +00:00
-- DROP USER 'ykval_verifier'@'localhost';
CREATE USER 'ykval_verifier'@'localhost';
2009-04-27 18:52:05 +00:00
GRANT SELECT,INSERT,UPDATE(accessed, counter, low, high, sessionUse)
ON ykval.yubikeys to 'ykval_verifier'@'localhost';
2009-05-06 13:20:40 +00:00
GRANT SELECT(id, secret, active)
2009-04-27 19:10:27 +00:00
ON ykval.clients to 'ykval_verifier'@'localhost';
GRANT SELECT,INSERT,UPDATE,DELETE
ON ykval.queue to 'ykval_verifier'@'localhost';
2009-08-28 11:27:30 +00:00
-- DROP USER 'ykval_getapikey'@'localhost';
CREATE USER 'ykval_getapikey'@'localhost';
GRANT SELECT(id),INSERT
ON ykval.clients to 'ykval_getapikey'@'localhost';
2009-08-31 08:25:01 +00:00
-- DROP USER 'ykval_revoke'@'localhost';
CREATE USER 'ykval_revoke'@'localhost';
GRANT UPDATE(active)
ON ykval.yubikeys to 'ykval_revoke'@'localhost';
GRANT SELECT(publicName)
ON ykval.yubikeys to 'ykval_revoke'@'localhost';
2009-04-27 18:52:05 +00:00
FLUSH PRIVILEGES;