Compare commits
2 commits
6ca4bec377
...
8fe16d6ace
Author | SHA1 | Date | |
---|---|---|---|
8fe16d6ace | |||
44f713250c |
10 changed files with 120 additions and 3 deletions
1
.env
1
.env
|
@ -1 +0,0 @@
|
||||||
DATABASE_URL=sqlite://sqlite.db
|
|
|
@ -0,0 +1,12 @@
|
||||||
|
{
|
||||||
|
"db_name": "SQLite",
|
||||||
|
"query": "INSERT INTO user_tokens\n (username, token, created, valid)\n VALUES\n ($1, $2, DATETIME('NOW'), TRUE)\n ",
|
||||||
|
"describe": {
|
||||||
|
"columns": [],
|
||||||
|
"parameters": {
|
||||||
|
"Right": 2
|
||||||
|
},
|
||||||
|
"nullable": []
|
||||||
|
},
|
||||||
|
"hash": "2384c1ab0d95aaaf679befdf76c76cc4e48831d9f115ec780d6e182b1f205082"
|
||||||
|
}
|
|
@ -0,0 +1,12 @@
|
||||||
|
{
|
||||||
|
"db_name": "SQLite",
|
||||||
|
"query": "INSERT INTO server_padlocks (hash, padlock) VALUES ($1, $2)",
|
||||||
|
"describe": {
|
||||||
|
"columns": [],
|
||||||
|
"parameters": {
|
||||||
|
"Right": 2
|
||||||
|
},
|
||||||
|
"nullable": []
|
||||||
|
},
|
||||||
|
"hash": "331408b7348336c3cf427d3d23e8519adcbe7443f3e1923be2b7f9d27c71881c"
|
||||||
|
}
|
|
@ -0,0 +1,12 @@
|
||||||
|
{
|
||||||
|
"db_name": "SQLite",
|
||||||
|
"query": "CREATE TABLE IF NOT EXISTS user_tokens (\n id INTEGER PRIMARY KEY AUTOINCREMENT,\n username VARCHAR(255) NOT NULL,\n token NCHAR(30) NOT NULL,\n valid BOOLEAN NOT NULL,\n created DATETIME NOT NULL,\n last_used DATETIME\n )",
|
||||||
|
"describe": {
|
||||||
|
"columns": [],
|
||||||
|
"parameters": {
|
||||||
|
"Right": 0
|
||||||
|
},
|
||||||
|
"nullable": []
|
||||||
|
},
|
||||||
|
"hash": "441850f70a550ef82ed189278c037a0b2346810efc1c8e30a3a198761785719e"
|
||||||
|
}
|
|
@ -0,0 +1,12 @@
|
||||||
|
{
|
||||||
|
"db_name": "SQLite",
|
||||||
|
"query": "CREATE TABLE IF NOT EXISTS server_padlocks (\n hash TEXT NOT NULL UNIQUE,\n padlock TEXT NOT NULL\n ) STRICT",
|
||||||
|
"describe": {
|
||||||
|
"columns": [],
|
||||||
|
"parameters": {
|
||||||
|
"Right": 0
|
||||||
|
},
|
||||||
|
"nullable": []
|
||||||
|
},
|
||||||
|
"hash": "7d5263f214e9602447fd98e57f4090859de17e1b015e4e852efd7afd0c8acb2d"
|
||||||
|
}
|
|
@ -0,0 +1,12 @@
|
||||||
|
{
|
||||||
|
"db_name": "SQLite",
|
||||||
|
"query": "UPDATE user_tokens\n SET last_used = DATETIME('NOW')\n WHERE username = $1 AND token = $2",
|
||||||
|
"describe": {
|
||||||
|
"columns": [],
|
||||||
|
"parameters": {
|
||||||
|
"Right": 2
|
||||||
|
},
|
||||||
|
"nullable": []
|
||||||
|
},
|
||||||
|
"hash": "d580e26d87812e76b1c99b12c62060d9a9779c154e8b290479be939fa6d4d5c5"
|
||||||
|
}
|
|
@ -0,0 +1,38 @@
|
||||||
|
{
|
||||||
|
"db_name": "SQLite",
|
||||||
|
"query": "SELECT token, valid, created, last_used\n FROM user_tokens\n WHERE username = $1\n ORDER BY created DESC",
|
||||||
|
"describe": {
|
||||||
|
"columns": [
|
||||||
|
{
|
||||||
|
"name": "token",
|
||||||
|
"ordinal": 0,
|
||||||
|
"type_info": "Text"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "valid",
|
||||||
|
"ordinal": 1,
|
||||||
|
"type_info": "Bool"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "created",
|
||||||
|
"ordinal": 2,
|
||||||
|
"type_info": "Datetime"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "last_used",
|
||||||
|
"ordinal": 3,
|
||||||
|
"type_info": "Datetime"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"parameters": {
|
||||||
|
"Right": 1
|
||||||
|
},
|
||||||
|
"nullable": [
|
||||||
|
false,
|
||||||
|
false,
|
||||||
|
false,
|
||||||
|
true
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"hash": "ea4e38250ec0c44915951e55cb7c4c86fe62cf30e065278d7456d1251784fe11"
|
||||||
|
}
|
|
@ -0,0 +1,20 @@
|
||||||
|
{
|
||||||
|
"db_name": "SQLite",
|
||||||
|
"query": "SELECT padlock FROM server_padlocks WHERE hash = $1",
|
||||||
|
"describe": {
|
||||||
|
"columns": [
|
||||||
|
{
|
||||||
|
"name": "padlock",
|
||||||
|
"ordinal": 0,
|
||||||
|
"type_info": "Text"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"parameters": {
|
||||||
|
"Right": 1
|
||||||
|
},
|
||||||
|
"nullable": [
|
||||||
|
false
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"hash": "eefc79011b65be5656d6b5d3fadcfecaa85db4dd9f810d6ff7d2aab7b9a002ec"
|
||||||
|
}
|
2
Cargo.lock
generated
2
Cargo.lock
generated
|
@ -583,7 +583,7 @@ dependencies = [
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "factoriauth"
|
name = "factoriauth"
|
||||||
version = "0.1.0"
|
version = "1.0.0"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"async-trait",
|
"async-trait",
|
||||||
"axum",
|
"axum",
|
||||||
|
|
|
@ -5,7 +5,7 @@ name = "factoriauth"
|
||||||
description = "An unofficial authentication server for Factorio"
|
description = "An unofficial authentication server for Factorio"
|
||||||
repository = "https://git.it-syndikat.org/xiretza/factoriauth"
|
repository = "https://git.it-syndikat.org/xiretza/factoriauth"
|
||||||
documentation = "https://docs.rs/factoriauth"
|
documentation = "https://docs.rs/factoriauth"
|
||||||
version = "0.1.0"
|
version = "1.0.0"
|
||||||
authors = ["Lambda", "deneb"]
|
authors = ["Lambda", "deneb"]
|
||||||
edition = "2021"
|
edition = "2021"
|
||||||
license = "AGPL-3.0-or-later"
|
license = "AGPL-3.0-or-later"
|
||||||
|
|
Loading…
Reference in a new issue