docs: add todos/fixmes
This commit is contained in:
parent
70577fbe56
commit
11f89a2380
4 changed files with 11 additions and 1 deletions
|
@ -81,6 +81,7 @@ pub async fn res(mut payload: web::Payload, data: web::Data<Data>) -> Result<Htt
|
||||||
))
|
))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// FIXME: This regex doesnt seem to be working
|
||||||
let username_regex = Regex::new(r"[a-zA-Z0-9.-_]").unwrap();
|
let username_regex = Regex::new(r"[a-zA-Z0-9.-_]").unwrap();
|
||||||
|
|
||||||
if !username_regex.is_match(&account_information.identifier) || account_information.identifier.len() < 3 || account_information.identifier.len() > 32 {
|
if !username_regex.is_match(&account_information.identifier) || account_information.identifier.len() < 3 || account_information.identifier.len() > 32 {
|
||||||
|
@ -94,14 +95,16 @@ pub async fn res(mut payload: web::Payload, data: web::Data<Data>) -> Result<Htt
|
||||||
|
|
||||||
Ok(match data.pool.execute(
|
Ok(match data.pool.execute(
|
||||||
&*format!(
|
&*format!(
|
||||||
|
// FIXME: This can never be put into prod, it works for testing
|
||||||
"INSERT INTO users VALUES ( '{}', '{}', NULL, '{}', '{}', '0' )",
|
"INSERT INTO users VALUES ( '{}', '{}', NULL, '{}', '{}', '0' )",
|
||||||
uuid,
|
uuid,
|
||||||
account_information.identifier,
|
account_information.identifier,
|
||||||
|
// FIXME: Password has no security currently, either from a client or server perspective
|
||||||
account_information.password,
|
account_information.password,
|
||||||
account_information.email,
|
account_information.email,
|
||||||
)
|
)
|
||||||
).await {
|
).await {
|
||||||
Ok(v) => {
|
Ok(_out) => {
|
||||||
HttpResponse::Ok().json(
|
HttpResponse::Ok().json(
|
||||||
Response {
|
Response {
|
||||||
access_token: "bogus".to_string(),
|
access_token: "bogus".to_string(),
|
||||||
|
|
|
@ -18,12 +18,14 @@ struct Response {
|
||||||
#[get("/stats")]
|
#[get("/stats")]
|
||||||
pub async fn res(data: web::Data<Data>) -> impl Responder {
|
pub async fn res(data: web::Data<Data>) -> impl Responder {
|
||||||
let response = Response {
|
let response = Response {
|
||||||
|
// TODO: Get number of accounts from db
|
||||||
accounts: 0,
|
accounts: 0,
|
||||||
uptime: SystemTime::now()
|
uptime: SystemTime::now()
|
||||||
.duration_since(data.start_time)
|
.duration_since(data.start_time)
|
||||||
.expect("Seriously why dont you have time??")
|
.expect("Seriously why dont you have time??")
|
||||||
.as_secs(),
|
.as_secs(),
|
||||||
version: String::from(VERSION.unwrap_or("UNKNOWN")),
|
version: String::from(VERSION.unwrap_or("UNKNOWN")),
|
||||||
|
// TODO: Get build number from git hash or remove this from the spec
|
||||||
build_number: String::from("how do i implement this?"),
|
build_number: String::from("how do i implement this?"),
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -14,6 +14,7 @@ struct UnstableFeatures;
|
||||||
pub async fn res() -> impl Responder {
|
pub async fn res() -> impl Responder {
|
||||||
let response = Response {
|
let response = Response {
|
||||||
unstable_features: UnstableFeatures,
|
unstable_features: UnstableFeatures,
|
||||||
|
// TODO: Find a way to dynamically update this possibly?
|
||||||
versions: vec![String::from("1")],
|
versions: vec![String::from("1")],
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -22,6 +22,10 @@ async fn main() -> Result<(), Error> {
|
||||||
|
|
||||||
let pool = PgPool::connect_with(config.database.connect_options()).await?;
|
let pool = PgPool::connect_with(config.database.connect_options()).await?;
|
||||||
|
|
||||||
|
/*
|
||||||
|
TODO: Figure out if a table should be used here and if not then what.
|
||||||
|
Also figure out if these should be different types from what they currently are and if we should add more "constraints"
|
||||||
|
*/
|
||||||
pool.execute(r#"CREATE TABLE IF NOT EXISTS users (
|
pool.execute(r#"CREATE TABLE IF NOT EXISTS users (
|
||||||
uuid uuid UNIQUE NOT NULL,
|
uuid uuid UNIQUE NOT NULL,
|
||||||
username varchar(32) UNIQUE NOT NULL,
|
username varchar(32) UNIQUE NOT NULL,
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue