Changed name and cargo fmt
This commit is contained in:
+3
-5
@@ -1,10 +1,9 @@
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
use sqlx::postgres::PgPoolOptions;
|
use sqlx::postgres::PgPoolOptions;
|
||||||
|
|
||||||
pub async fn create_pool() -> Result<sqlx::PgPool, sqlx::Error> {
|
pub async fn create_pool() -> Result<sqlx::PgPool, sqlx::Error> {
|
||||||
let database_url = textsender_models::envy::environment::get_db_url().await.value;
|
let database_url = textsender_models::envy::environment::get_db_url()
|
||||||
|
.await
|
||||||
|
.value;
|
||||||
println!("Database url: {database_url}");
|
println!("Database url: {database_url}");
|
||||||
|
|
||||||
PgPoolOptions::new()
|
PgPoolOptions::new()
|
||||||
@@ -21,4 +20,3 @@ pub async fn migrations(pool: &sqlx::PgPool) {
|
|||||||
.await
|
.await
|
||||||
.expect("Failed to run migrations");
|
.expect("Failed to run migrations");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -4,7 +4,6 @@ pub mod hashing;
|
|||||||
pub mod repo;
|
pub mod repo;
|
||||||
pub mod token_stuff;
|
pub mod token_stuff;
|
||||||
|
|
||||||
|
|
||||||
#[tokio::main]
|
#[tokio::main]
|
||||||
async fn main() {
|
async fn main() {
|
||||||
// initialize tracing
|
// initialize tracing
|
||||||
|
|||||||
@@ -48,4 +48,3 @@ pub async fn get_passphrase(
|
|||||||
Err(err) => Err(err),
|
Err(err) => Err(err),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -82,9 +82,9 @@ pub fn extract_id_from_token(key: &String, token: &String) -> Result<uuid::Uuid,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
pub const APP_TOKEN_TYPE: &str = "Icarus_App";
|
pub const APP_TOKEN_TYPE: &str = "Textsender_App";
|
||||||
pub const APP_SUBJECT: &str = "Something random";
|
pub const APP_SUBJECT: &str = "Something random";
|
||||||
pub const SERVICE_TOKEN_TYPE: &str = "Icarus_Service";
|
pub const SERVICE_TOKEN_TYPE: &str = "Textsender_Service";
|
||||||
pub const SERVICE_SUBJECT: &str = "Service random";
|
pub const SERVICE_SUBJECT: &str = "Service random";
|
||||||
|
|
||||||
pub fn get_token_type(key: &String, token: &String) -> Result<String, std::io::Error> {
|
pub fn get_token_type(key: &String, token: &String) -> Result<String, std::io::Error> {
|
||||||
|
|||||||
Reference in New Issue
Block a user