icarus_envy version bump #189
Generated
+3
-3
@@ -840,7 +840,7 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "icarus"
|
name = "icarus"
|
||||||
version = "0.2.1"
|
version = "0.2.2"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"axum",
|
"axum",
|
||||||
"axum-extra",
|
"axum-extra",
|
||||||
@@ -872,8 +872,8 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "icarus_envy"
|
name = "icarus_envy"
|
||||||
version = "0.3.5"
|
version = "0.4.1"
|
||||||
source = "git+ssh://git@git.kundeng.us/phoenix/icarus_envy.git?tag=v0.3.5-main-86c5050c7b-006#86c5050c7bd5164bc6e773fc404195023f7f7aaa"
|
source = "git+ssh://git@git.kundeng.us/phoenix/icarus_envy.git?tag=v0.4.1-main-8f0d123db5-006#8f0d123db51b18e9cc4ab5bd39a474ba99bd39c3"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"const_format",
|
"const_format",
|
||||||
"dotenvy",
|
"dotenvy",
|
||||||
|
|||||||
+2
-2
@@ -1,6 +1,6 @@
|
|||||||
[package]
|
[package]
|
||||||
name = "icarus"
|
name = "icarus"
|
||||||
version = "0.2.1"
|
version = "0.2.2"
|
||||||
edition = "2024"
|
edition = "2024"
|
||||||
rust-version = "1.88"
|
rust-version = "1.88"
|
||||||
|
|
||||||
@@ -27,7 +27,7 @@ utoipa = { version = "5.4.0", features = ["axum_extras"] }
|
|||||||
utoipa-swagger-ui = { version = "9.0.2", features = ["axum"] }
|
utoipa-swagger-ui = { version = "9.0.2", features = ["axum"] }
|
||||||
icarus_meta = { git = "ssh://git@git.kundeng.us/phoenix/icarus_meta.git", tag = "v0.3.0" }
|
icarus_meta = { git = "ssh://git@git.kundeng.us/phoenix/icarus_meta.git", tag = "v0.3.0" }
|
||||||
icarus_models = { git = "ssh://git@git.kundeng.us/phoenix/icarus_models.git", tag = "v0.5.6" }
|
icarus_models = { git = "ssh://git@git.kundeng.us/phoenix/icarus_models.git", tag = "v0.5.6" }
|
||||||
icarus_envy = { git = "ssh://git@git.kundeng.us/phoenix/icarus_envy.git", tag = "v0.3.5-main-86c5050c7b-006" }
|
icarus_envy = { git = "ssh://git@git.kundeng.us/phoenix/icarus_envy.git", tag = "v0.4.1-main-8f0d123db5-006" }
|
||||||
|
|
||||||
[dev-dependencies]
|
[dev-dependencies]
|
||||||
common-multipart-rfc7578 = { version = "0.7.0" }
|
common-multipart-rfc7578 = { version = "0.7.0" }
|
||||||
|
|||||||
+1
-6
@@ -1,6 +1,3 @@
|
|||||||
// use std::collections::BTreeMap;
|
|
||||||
// use std::sync::Arc;
|
|
||||||
|
|
||||||
use axum::{
|
use axum::{
|
||||||
Json,
|
Json,
|
||||||
http::{Request, StatusCode},
|
http::{Request, StatusCode},
|
||||||
@@ -10,9 +7,7 @@ use axum::{
|
|||||||
use axum_extra::extract::cookie::CookieJar;
|
use axum_extra::extract::cookie::CookieJar;
|
||||||
use jsonwebtoken::{DecodingKey, Validation, decode};
|
use jsonwebtoken::{DecodingKey, Validation, decode};
|
||||||
use serde::{Deserialize, Serialize};
|
use serde::{Deserialize, Serialize};
|
||||||
// use serde_json::{json, Value};
|
|
||||||
use thiserror::Error;
|
use thiserror::Error;
|
||||||
// use time::OffsetDateTime;
|
|
||||||
|
|
||||||
fn deserialize_i64_from_f64<'de, D>(deserializer: D) -> Result<i64, D::Error>
|
fn deserialize_i64_from_f64<'de, D>(deserializer: D) -> Result<i64, D::Error>
|
||||||
where
|
where
|
||||||
@@ -95,7 +90,7 @@ pub async fn auth<B>(
|
|||||||
(StatusCode::UNAUTHORIZED, Json(json_error))
|
(StatusCode::UNAUTHORIZED, Json(json_error))
|
||||||
})?;
|
})?;
|
||||||
|
|
||||||
let secret_key = icarus_envy::environment::get_secret_main_key().await;
|
let secret_key = icarus_envy::environment::get_secret_main_key().await.value;
|
||||||
|
|
||||||
let mut validation = Validation::new(jsonwebtoken::Algorithm::HS256);
|
let mut validation = Validation::new(jsonwebtoken::Algorithm::HS256);
|
||||||
validation.set_audience(&["icarus"]); // Must match exactly what's in the token
|
validation.set_audience(&["icarus"]); // Must match exactly what's in the token
|
||||||
|
|||||||
@@ -702,7 +702,7 @@ pub mod endpoint {
|
|||||||
let song_id = payload.song_id;
|
let song_id = payload.song_id;
|
||||||
match crate::callers::song::song_db::get_song(&pool, &song_id).await {
|
match crate::callers::song::song_db::get_song(&pool, &song_id).await {
|
||||||
Ok(song) => {
|
Ok(song) => {
|
||||||
let directory = icarus_envy::environment::get_root_directory().await;
|
let directory = icarus_envy::environment::get_root_directory().await.value;
|
||||||
let dir = std::path::Path::new(&directory);
|
let dir = std::path::Path::new(&directory);
|
||||||
|
|
||||||
// TODO: Make this random and the file extension should not be hard coded
|
// TODO: Make this random and the file extension should not be hard coded
|
||||||
|
|||||||
+1
-1
@@ -1209,7 +1209,7 @@ pub mod endpoint {
|
|||||||
let mut song = payload.to_song();
|
let mut song = payload.to_song();
|
||||||
song.filename =
|
song.filename =
|
||||||
song.generate_filename(icarus_models::types::MusicTypes::FlacExtension, true);
|
song.generate_filename(icarus_models::types::MusicTypes::FlacExtension, true);
|
||||||
song.directory = icarus_envy::environment::get_root_directory().await;
|
song.directory = icarus_envy::environment::get_root_directory().await.value;
|
||||||
|
|
||||||
match song_queue::get_data(&pool, &payload.song_queue_id).await {
|
match song_queue::get_data(&pool, &payload.song_queue_id).await {
|
||||||
Ok(data) => {
|
Ok(data) => {
|
||||||
|
|||||||
+14
-6
@@ -10,7 +10,7 @@ pub mod db {
|
|||||||
}
|
}
|
||||||
|
|
||||||
pub async fn create_pool() -> Result<sqlx::PgPool, sqlx::Error> {
|
pub async fn create_pool() -> Result<sqlx::PgPool, sqlx::Error> {
|
||||||
let database_url = icarus_envy::environment::get_db_url().await;
|
let database_url = icarus_envy::environment::get_db_url().await.value;
|
||||||
println!("Database url: {database_url}");
|
println!("Database url: {database_url}");
|
||||||
|
|
||||||
PgPoolOptions::new()
|
PgPoolOptions::new()
|
||||||
@@ -82,11 +82,19 @@ pub mod init {
|
|||||||
Ok("production") => {
|
Ok("production") => {
|
||||||
// In production, allow only your specific, trusted origins
|
// In production, allow only your specific, trusted origins
|
||||||
let allowed_origins_env = icarus_envy::environment::get_allowed_origins().await;
|
let allowed_origins_env = icarus_envy::environment::get_allowed_origins().await;
|
||||||
let allowed_origins: Vec<axum::http::HeaderValue> = allowed_origins_env
|
match icarus_envy::utility::delimitize(&allowed_origins_env) {
|
||||||
.split(",")
|
Ok(alwd) => {
|
||||||
.map(|s| s.parse::<axum::http::HeaderValue>().unwrap())
|
let allowed_origins: Vec<axum::http::HeaderValue> = alwd
|
||||||
.collect();
|
.into_iter()
|
||||||
cors.allow_origin(allowed_origins)
|
.map(|a| a.parse::<axum::http::HeaderValue>().unwrap())
|
||||||
|
.collect();
|
||||||
|
cors.allow_origin(allowed_origins)
|
||||||
|
}
|
||||||
|
Err(err) => {
|
||||||
|
eprintln!("Error getting allowed origins: Error: {err:?}");
|
||||||
|
std::process::exit(-1);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
_ => {
|
_ => {
|
||||||
// Development (default): Allow localhost origins
|
// Development (default): Allow localhost origins
|
||||||
|
|||||||
Reference in New Issue
Block a user