You've already forked AstralRinth
forked from didirus/AstralRinth
Version updates (#3626)
* Update some Labrinth dependencies * Update some Labrinth dependencies * Update some Labrinth dependencies * Update zip in Labrinth * Update itertools in Labrinth * Update validator in labrinth * Update thiserror in labrinth * Update rust_decimal, redis, and deadpool-redis in labrinth * Update totp-rs and spdx in labrinth * Update maxminddb and tar in labrinth * Update sentry and sentry-actix in labrinth * Update image in labrinth * Update lettre in labrinth * Update derive-new and rust_iso3166 in labrinth * Update async-stripe and json-patch in labrinth * Update clap and iana-time-zone in labrinth * Update labrinth to Rust 2024 * Cargo fmt * Just do a full cargo update * Update daedelus to Rust 2024 * Update daedelus_client to Rust 2024 * Set the formatting edition to 2024 * Fix formatting IntelliJ messed up my formatting
This commit is contained in:
@@ -10,9 +10,9 @@ use labrinth::models::{
|
||||
use crate::common::{api_v2::ApiV2, api_v3::ApiV3, dummy_data::TestFile};
|
||||
|
||||
use super::{
|
||||
Api, ApiProject, ApiTags, ApiTeams, ApiUser, ApiVersion,
|
||||
models::{CommonProject, CommonVersion},
|
||||
request_data::{ImageData, ProjectCreationRequestData},
|
||||
Api, ApiProject, ApiTags, ApiTeams, ApiUser, ApiVersion,
|
||||
};
|
||||
|
||||
#[derive(Clone)]
|
||||
|
||||
@@ -8,11 +8,11 @@ use self::request_data::{ImageData, ProjectCreationRequestData};
|
||||
use actix_web::dev::ServiceResponse;
|
||||
use async_trait::async_trait;
|
||||
use labrinth::{
|
||||
LabrinthConfig,
|
||||
models::{
|
||||
projects::{ProjectId, VersionType},
|
||||
teams::{OrganizationPermissions, ProjectPermissions},
|
||||
},
|
||||
LabrinthConfig,
|
||||
};
|
||||
|
||||
use super::dummy_data::TestFile;
|
||||
@@ -169,7 +169,7 @@ pub trait ApiProject {
|
||||
) -> ServiceResponse;
|
||||
async fn get_moderation_inbox(&self, pat: Option<&str>) -> ServiceResponse;
|
||||
async fn read_thread(&self, id: &str, pat: Option<&str>)
|
||||
-> ServiceResponse;
|
||||
-> ServiceResponse;
|
||||
async fn delete_thread_message(
|
||||
&self,
|
||||
id: &str,
|
||||
@@ -340,7 +340,7 @@ pub trait ApiVersion {
|
||||
pat: Option<&str>,
|
||||
) -> CommonVersion;
|
||||
async fn get_version(&self, id: &str, pat: Option<&str>)
|
||||
-> ServiceResponse;
|
||||
-> ServiceResponse;
|
||||
async fn get_version_deserialized_common(
|
||||
&self,
|
||||
id_or_slug: &str,
|
||||
|
||||
@@ -4,7 +4,7 @@ use super::{
|
||||
api_common::{Api, ApiBuildable},
|
||||
environment::LocalService,
|
||||
};
|
||||
use actix_web::{dev::ServiceResponse, test, App};
|
||||
use actix_web::{App, dev::ServiceResponse, test};
|
||||
use async_trait::async_trait;
|
||||
use labrinth::LabrinthConfig;
|
||||
use std::rc::Rc;
|
||||
|
||||
@@ -4,9 +4,9 @@ use crate::{
|
||||
assert_status,
|
||||
common::{
|
||||
api_common::{
|
||||
Api, ApiProject, AppendsOptionalPat,
|
||||
models::{CommonItemType, CommonProject, CommonVersion},
|
||||
request_data::{ImageData, ProjectCreationRequestData},
|
||||
Api, ApiProject, AppendsOptionalPat,
|
||||
},
|
||||
dummy_data::TestFile,
|
||||
},
|
||||
@@ -27,8 +27,8 @@ use serde_json::json;
|
||||
use crate::common::database::MOD_USER_PAT;
|
||||
|
||||
use super::{
|
||||
request_data::{self, get_public_project_creation_data},
|
||||
ApiV2,
|
||||
request_data::{self, get_public_project_creation_data},
|
||||
};
|
||||
|
||||
impl ApiV2 {
|
||||
|
||||
@@ -12,8 +12,8 @@ use crate::{
|
||||
assert_status,
|
||||
common::{
|
||||
api_common::{
|
||||
models::{CommonCategoryData, CommonLoaderData},
|
||||
Api, ApiTags, AppendsOptionalPat,
|
||||
models::{CommonCategoryData, CommonLoaderData},
|
||||
},
|
||||
database::ADMIN_USER_PAT,
|
||||
},
|
||||
|
||||
@@ -10,8 +10,8 @@ use serde_json::json;
|
||||
use crate::{
|
||||
assert_status,
|
||||
common::api_common::{
|
||||
models::{CommonNotification, CommonTeamMember},
|
||||
Api, ApiTeams, AppendsOptionalPat,
|
||||
models::{CommonNotification, CommonTeamMember},
|
||||
},
|
||||
};
|
||||
|
||||
|
||||
@@ -1,14 +1,14 @@
|
||||
use std::collections::HashMap;
|
||||
|
||||
use super::{
|
||||
request_data::{self, get_public_version_creation_data},
|
||||
ApiV2,
|
||||
request_data::{self, get_public_version_creation_data},
|
||||
};
|
||||
use crate::{
|
||||
assert_status,
|
||||
common::{
|
||||
api_common::{
|
||||
models::CommonVersion, Api, ApiVersion, AppendsOptionalPat,
|
||||
Api, ApiVersion, AppendsOptionalPat, models::CommonVersion,
|
||||
},
|
||||
dummy_data::TestFile,
|
||||
},
|
||||
|
||||
@@ -9,7 +9,7 @@ use serde_json::json;
|
||||
|
||||
use crate::{
|
||||
assert_status,
|
||||
common::api_common::{request_data::ImageData, Api, AppendsOptionalPat},
|
||||
common::api_common::{Api, AppendsOptionalPat, request_data::ImageData},
|
||||
};
|
||||
|
||||
use super::ApiV3;
|
||||
|
||||
@@ -4,7 +4,7 @@ use super::{
|
||||
api_common::{Api, ApiBuildable},
|
||||
environment::LocalService,
|
||||
};
|
||||
use actix_web::{dev::ServiceResponse, test, App};
|
||||
use actix_web::{App, dev::ServiceResponse, test};
|
||||
use async_trait::async_trait;
|
||||
use labrinth::LabrinthConfig;
|
||||
use std::rc::Rc;
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
use std::collections::HashMap;
|
||||
|
||||
use actix_http::StatusCode;
|
||||
use actix_web::http::header::{AUTHORIZATION, LOCATION};
|
||||
use actix_web::{
|
||||
dev::ServiceResponse,
|
||||
test::{self, TestRequest},
|
||||
@@ -9,7 +10,6 @@ use labrinth::auth::oauth::{
|
||||
OAuthClientAccessRequest, RespondToOAuthClientScopes, TokenRequest,
|
||||
TokenResponse,
|
||||
};
|
||||
use reqwest::header::{AUTHORIZATION, LOCATION};
|
||||
|
||||
use crate::{
|
||||
assert_status,
|
||||
|
||||
@@ -11,7 +11,7 @@ use serde_json::json;
|
||||
|
||||
use crate::{
|
||||
assert_status,
|
||||
common::api_common::{request_data::ImageData, Api, AppendsOptionalPat},
|
||||
common::api_common::{Api, AppendsOptionalPat, request_data::ImageData},
|
||||
};
|
||||
|
||||
use super::ApiV3;
|
||||
|
||||
@@ -20,9 +20,9 @@ use crate::{
|
||||
assert_status,
|
||||
common::{
|
||||
api_common::{
|
||||
Api, ApiProject, AppendsOptionalPat,
|
||||
models::{CommonItemType, CommonProject, CommonVersion},
|
||||
request_data::{ImageData, ProjectCreationRequestData},
|
||||
Api, ApiProject, AppendsOptionalPat,
|
||||
},
|
||||
database::MOD_USER_PAT,
|
||||
dummy_data::TestFile,
|
||||
@@ -30,8 +30,8 @@ use crate::{
|
||||
};
|
||||
|
||||
use super::{
|
||||
request_data::{self, get_public_project_creation_data},
|
||||
ApiV3,
|
||||
request_data::{self, get_public_project_creation_data},
|
||||
};
|
||||
|
||||
#[async_trait(?Send)]
|
||||
|
||||
@@ -14,8 +14,8 @@ use crate::{
|
||||
assert_status,
|
||||
common::{
|
||||
api_common::{
|
||||
models::{CommonCategoryData, CommonLoaderData},
|
||||
Api, ApiTags, AppendsOptionalPat,
|
||||
models::{CommonCategoryData, CommonLoaderData},
|
||||
},
|
||||
database::ADMIN_USER_PAT,
|
||||
},
|
||||
|
||||
@@ -10,8 +10,8 @@ use serde_json::json;
|
||||
use crate::{
|
||||
assert_status,
|
||||
common::api_common::{
|
||||
models::{CommonNotification, CommonTeamMember},
|
||||
Api, ApiTeams, AppendsOptionalPat,
|
||||
models::{CommonNotification, CommonTeamMember},
|
||||
},
|
||||
};
|
||||
|
||||
|
||||
@@ -1,14 +1,14 @@
|
||||
use std::collections::HashMap;
|
||||
|
||||
use super::{
|
||||
request_data::{self, get_public_version_creation_data},
|
||||
ApiV3,
|
||||
request_data::{self, get_public_version_creation_data},
|
||||
};
|
||||
use crate::{
|
||||
assert_status,
|
||||
common::{
|
||||
api_common::{
|
||||
models::CommonVersion, Api, ApiVersion, AppendsOptionalPat,
|
||||
Api, ApiVersion, AppendsOptionalPat, models::CommonVersion,
|
||||
},
|
||||
dummy_data::TestFile,
|
||||
},
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
#![allow(dead_code)]
|
||||
|
||||
use labrinth::{database::redis::RedisPool, search};
|
||||
use sqlx::{postgres::PgPoolOptions, PgPool};
|
||||
use sqlx::{PgPool, postgres::PgPoolOptions};
|
||||
use std::time::Duration;
|
||||
use url::Url;
|
||||
|
||||
@@ -161,7 +161,9 @@ impl TemporaryDatabase {
|
||||
let needs_update = dummy_data_update
|
||||
.is_none_or(|d| d != DUMMY_DATA_UPDATE);
|
||||
if needs_update {
|
||||
println!("Dummy data updated, so template DB tables will be dropped and re-created");
|
||||
println!(
|
||||
"Dummy data updated, so template DB tables will be dropped and re-created"
|
||||
);
|
||||
// Drop all tables in the database so they can be re-created and later filled with updated dummy data
|
||||
sqlx::query("DROP SCHEMA public CASCADE;")
|
||||
.execute(&pool)
|
||||
|
||||
@@ -11,7 +11,7 @@ use labrinth::models::{
|
||||
};
|
||||
use serde_json::json;
|
||||
use sqlx::Executor;
|
||||
use zip::{write::FileOptions, CompressionMethod, ZipWriter};
|
||||
use zip::{CompressionMethod, ZipWriter, write::FileOptions};
|
||||
|
||||
use crate::{
|
||||
assert_status,
|
||||
@@ -19,7 +19,7 @@ use crate::{
|
||||
};
|
||||
|
||||
use super::{
|
||||
api_common::{request_data::ImageData, ApiProject, AppendsOptionalPat},
|
||||
api_common::{ApiProject, AppendsOptionalPat, request_data::ImageData},
|
||||
api_v3::ApiV3,
|
||||
database::TemporaryDatabase,
|
||||
};
|
||||
@@ -98,7 +98,7 @@ impl TestFile {
|
||||
let mut zip = ZipWriter::new(&mut cursor);
|
||||
zip.start_file(
|
||||
"fabric.mod.json",
|
||||
FileOptions::default()
|
||||
FileOptions::<()>::default()
|
||||
.compression_method(CompressionMethod::Stored),
|
||||
)
|
||||
.unwrap();
|
||||
@@ -106,7 +106,7 @@ impl TestFile {
|
||||
|
||||
zip.start_file(
|
||||
"META-INF/mods.toml",
|
||||
FileOptions::default()
|
||||
FileOptions::<()>::default()
|
||||
.compression_method(CompressionMethod::Stored),
|
||||
)
|
||||
.unwrap();
|
||||
@@ -159,7 +159,7 @@ impl TestFile {
|
||||
let mut zip = ZipWriter::new(&mut cursor);
|
||||
zip.start_file(
|
||||
"modrinth.index.json",
|
||||
FileOptions::default()
|
||||
FileOptions::<()>::default()
|
||||
.compression_method(CompressionMethod::Stored),
|
||||
)
|
||||
.unwrap();
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
#![allow(dead_code)]
|
||||
|
||||
use super::{
|
||||
api_common::{generic::GenericApi, Api, ApiBuildable},
|
||||
api_common::{Api, ApiBuildable, generic::GenericApi},
|
||||
api_v2::ApiV2,
|
||||
api_v3::ApiV3,
|
||||
database::{TemporaryDatabase, FRIEND_USER_ID, USER_USER_PAT},
|
||||
database::{FRIEND_USER_ID, TemporaryDatabase, USER_USER_PAT},
|
||||
dummy_data,
|
||||
};
|
||||
use crate::{assert_status, common::setup};
|
||||
@@ -146,18 +146,18 @@ pub trait LocalService {
|
||||
) -> std::pin::Pin<
|
||||
Box<
|
||||
dyn std::future::Future<
|
||||
Output = Result<ServiceResponse, actix_web::Error>,
|
||||
>,
|
||||
Output = Result<ServiceResponse, actix_web::Error>,
|
||||
>,
|
||||
>,
|
||||
>;
|
||||
}
|
||||
impl<S> LocalService for S
|
||||
where
|
||||
S: actix_web::dev::Service<
|
||||
actix_http::Request,
|
||||
Response = ServiceResponse,
|
||||
Error = actix_web::Error,
|
||||
>,
|
||||
actix_http::Request,
|
||||
Response = ServiceResponse,
|
||||
Error = actix_web::Error,
|
||||
>,
|
||||
S::Future: 'static,
|
||||
{
|
||||
fn call(
|
||||
@@ -166,8 +166,8 @@ where
|
||||
) -> std::pin::Pin<
|
||||
Box<
|
||||
dyn std::future::Future<
|
||||
Output = Result<ServiceResponse, actix_web::Error>,
|
||||
>,
|
||||
Output = Result<ServiceResponse, actix_web::Error>,
|
||||
>,
|
||||
>,
|
||||
> {
|
||||
Box::pin(self.call(req))
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
use labrinth::{LabrinthConfig, file_hosting, queue};
|
||||
use labrinth::{check_env_vars, clickhouse};
|
||||
use labrinth::{file_hosting, queue, LabrinthConfig};
|
||||
use std::sync::Arc;
|
||||
|
||||
pub mod api_common;
|
||||
|
||||
@@ -8,7 +8,7 @@ use serde_json::json;
|
||||
|
||||
use crate::common::{
|
||||
api_common::ApiTeams,
|
||||
database::{generate_random_name, ADMIN_USER_PAT},
|
||||
database::{ADMIN_USER_PAT, generate_random_name},
|
||||
};
|
||||
|
||||
use super::{
|
||||
|
||||
@@ -10,7 +10,7 @@ use crate::{
|
||||
common::{
|
||||
api_common::{Api, ApiProject, ApiVersion},
|
||||
database::{FRIEND_USER_PAT, MOD_USER_PAT, USER_USER_PAT},
|
||||
dummy_data::{TestFile, DUMMY_CATEGORIES},
|
||||
dummy_data::{DUMMY_CATEGORIES, TestFile},
|
||||
},
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user