update deps

This commit is contained in:
mbecker20
2024-05-14 02:10:10 -07:00
parent c43293109d
commit e3c11db89e
12 changed files with 69 additions and 114 deletions

111
Cargo.lock generated
View File

@@ -827,7 +827,6 @@ version = "1.0.83"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f1174fb0b6ec23863f8b971027804a42614e347eafb0a95bf0b12cdae21fc4d0"
dependencies = [
"jobserver",
"libc",
]
@@ -950,15 +949,6 @@ dependencies = [
"libc",
]
[[package]]
name = "crc32fast"
version = "1.3.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b540bd8bc810d3885c6ea91e2018302f68baba2129ab3e88f32389ee9370880d"
dependencies = [
"cfg-if",
]
[[package]]
name = "crossbeam-channel"
version = "0.5.12"
@@ -1276,16 +1266,6 @@ version = "2.0.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "6999dc1837253364c2ebb0704ba97994bd874e8f195d665c50b7548f6ea92764"
[[package]]
name = "flate2"
version = "1.0.26"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "3b9429470923de8e8cbd4d2dc513535400b4b3fef0319fb5c4e1f520a7bef743"
dependencies = [
"crc32fast",
"miniz_oxide",
]
[[package]]
name = "fnv"
version = "1.0.7"
@@ -1931,15 +1911,6 @@ version = "1.0.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "453ad9f582a441959e5f0d088b02ce04cfe8d51a8eaf077f12ac6d3e94164ca6"
[[package]]
name = "jobserver"
version = "0.1.26"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "936cfd212a0155903bcbc060e316fb6cc7cbf2e1907329391ebadc1fe0ce77c2"
dependencies = [
"libc",
]
[[package]]
name = "js-sys"
version = "0.3.69"
@@ -2090,7 +2061,7 @@ dependencies = [
"dotenv",
"envy",
"logger",
"mongo_indexed",
"mongo_indexed 0.3.0",
"monitor_client 1.3.0",
"mungos",
"serde",
@@ -2143,7 +2114,19 @@ checksum = "f0cd571ac04a8ac4751e6899f404e5d1370ec79f17609ea5a3caa823619b7513"
dependencies = [
"anyhow",
"async-trait",
"mongo_indexed_derive",
"mongo_indexed_derive 0.2.2",
"mongodb",
"serde",
]
[[package]]
name = "mongo_indexed"
version = "0.3.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "3e837961dc668ca0d6e298066f22c1c9242bdfe7cc473b18f5e3d960f27e6adb"
dependencies = [
"anyhow",
"mongo_indexed_derive 0.3.0",
"mongodb",
"serde",
]
@@ -2160,10 +2143,21 @@ dependencies = [
]
[[package]]
name = "mongodb"
version = "2.8.0"
name = "mongo_indexed_derive"
version = "0.3.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "46c30763a5c6c52079602be44fa360ca3bfacee55fca73f4734aecd23706a7f2"
checksum = "2b1bfd94b65c8adb78d87177ccb5754204c175098be1057e7ad25282753dc4e8"
dependencies = [
"proc-macro2",
"quote",
"syn 2.0.53",
]
[[package]]
name = "mongodb"
version = "2.8.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ef206acb1b72389b49bc9985efe7eb1f8a9bb18e5680d262fac26c07f44025f1"
dependencies = [
"async-trait",
"base64 0.13.1",
@@ -2172,7 +2166,6 @@ dependencies = [
"chrono",
"derivative",
"derive_more",
"flate2",
"futures-core",
"futures-executor",
"futures-io",
@@ -2192,7 +2185,6 @@ dependencies = [
"serde_with 1.14.0",
"sha-1",
"sha2",
"snap",
"socket2 0.4.9",
"stringprep",
"strsim 0.10.0",
@@ -2206,7 +2198,6 @@ dependencies = [
"typed-builder",
"uuid",
"webpki-roots",
"zstd",
]
[[package]]
@@ -2242,7 +2233,7 @@ dependencies = [
"derive_variants",
"envy",
"futures",
"mongo_indexed",
"mongo_indexed 0.3.0",
"mungos",
"partial_derive2",
"reqwest 0.12.4",
@@ -2276,7 +2267,7 @@ dependencies = [
"derive_variants",
"envy",
"futures",
"mongo_indexed",
"mongo_indexed 0.2.2",
"mungos",
"partial_derive2",
"reqwest 0.12.4",
@@ -2314,7 +2305,7 @@ dependencies = [
"jwt",
"logger",
"merge_config_files",
"mongo_indexed",
"mongo_indexed 0.3.0",
"monitor_client 1.3.0",
"mungos",
"parse_csl",
@@ -2373,9 +2364,9 @@ dependencies = [
[[package]]
name = "mungos"
version = "0.5.4"
version = "0.5.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ecb32eadede40c482d0220c7949fcd5f1620185aa6317a1fc19b3b42ea0615b1"
checksum = "9c3f7dff35aea45b4619a4a2670319d0cfd336e63405229d764779c71627e450"
dependencies = [
"anyhow",
"async-trait",
@@ -3424,12 +3415,6 @@ version = "1.13.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "3c5e1a9a646d36c3599cd173a41282daf47c44583ad367b8e6837255952e5c67"
[[package]]
name = "snap"
version = "1.1.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "5e9f0ab6ef7eb7353d9119c170a436d1bf248eea575ac42d19d12f4e34130831"
[[package]]
name = "socket2"
version = "0.4.9"
@@ -4719,33 +4704,3 @@ name = "zeroize"
version = "1.6.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "2a0956f1ba7c7909bfb66c2e9e4124ab6f6482560f6628b5aaeba39207c9aad9"
[[package]]
name = "zstd"
version = "0.11.2+zstd.1.5.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "20cc960326ece64f010d2d2107537f26dc589a6573a316bd5b1dba685fa5fde4"
dependencies = [
"zstd-safe",
]
[[package]]
name = "zstd-safe"
version = "5.0.2+zstd.1.5.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1d2a5585e04f9eea4b2a3d1eca508c4dee9592a89ef6f450c11719da0726f4db"
dependencies = [
"libc",
"zstd-sys",
]
[[package]]
name = "zstd-sys"
version = "2.0.8+zstd.1.5.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "5556e6ee25d32df2586c098bbfa278803692a20d0ab9565e049480d52707ec8c"
dependencies = [
"cc",
"libc",
"pkg-config",
]

View File

@@ -27,10 +27,10 @@ termination_signal = "0.1.3"
async_timing_util = "0.1.14"
partial_derive2 = "0.4.2"
derive_variants = "0.1.3"
mongo_indexed = "0.2.2"
mongo_indexed = "0.3.0"
resolver_api = "0.1.9"
parse_csl = "0.1.0"
mungos = "0.5.4"
mungos = "0.5.5"
svi = "0.1.4"
# ASYNC

View File

@@ -1,4 +1,4 @@
use mongo_indexed::{create_index, create_unique_index, Indexed};
use mongo_indexed::{create_index, create_unique_index};
use monitor_client::entities::{
alert::Alert,
alerter::Alerter,
@@ -80,14 +80,20 @@ impl DbClient {
let db = client.database(db_name);
let client = DbClient {
users: User::collection(&db, true).await?,
user_groups: UserGroup::collection(&db, true).await?,
permissions: Permission::collection(&db, true).await?,
api_keys: ApiKey::collection(&db, true).await?,
tags: Tag::collection(&db, true).await?,
updates: Update::collection(&db, true).await?,
alerts: Alert::collection(&db, true).await?,
stats: SystemStatsRecord::collection(&db, true).await?,
users: mongo_indexed::collection::<User>(&db, true).await?,
user_groups: mongo_indexed::collection::<UserGroup>(&db, true)
.await?,
permissions: mongo_indexed::collection::<Permission>(&db, true)
.await?,
api_keys: mongo_indexed::collection::<ApiKey>(&db, true)
.await?,
tags: mongo_indexed::collection::<Tag>(&db, true).await?,
updates: mongo_indexed::collection::<Update>(&db, true).await?,
alerts: mongo_indexed::collection::<Alert>(&db, true).await?,
stats: mongo_indexed::collection::<SystemStatsRecord>(
&db, true,
)
.await?,
servers: resource_collection(&db, "Server").await?,
deployments: resource_collection(&db, "Deployment").await?,
builds: resource_collection(&db, "Build").await?,

View File

@@ -63,8 +63,8 @@ pub struct DbClient {
impl DbClient {
pub async fn new(db: &Database) -> anyhow::Result<DbClient> {
Ok(DbClient {
users: User::collection(db, true).await?,
updates: Update::collection(db, true).await?,
users: mongo_indexed::collection::<User>(db, true).await?,
updates: mongo_indexed::collection::<Update>(db, true).await?,
servers: resource_collection(db, "Server").await?,
deployments: resource_collection(db, "Deployment").await?,
builds: resource_collection(db, "Build").await?,

View File

@@ -3,7 +3,7 @@ use std::path::PathBuf;
use derive_variants::EnumVariants;
use mongo_indexed::derive::MongoIndexed;
use mungos::mongodb::bson::{
doc, serde_helpers::hex_string_as_object_id, Document,
doc, serde_helpers::hex_string_as_object_id,
};
use serde::{Deserialize, Serialize};
use typeshare::typeshare;
@@ -20,9 +20,9 @@ use super::{
#[derive(
Serialize, Deserialize, Debug, Clone, Default, MongoIndexed,
)]
#[doc_index(doc! { "data.type": 1 })]
#[doc_index(doc! { "target.type": 1 })]
#[doc_index(doc! { "target.id": 1 })]
#[doc_index({ "data.type": 1 })]
#[doc_index({ "target.type": 1 })]
#[doc_index({ "target.id": 1 })]
pub struct Alert {
/// The Mongo ID of the alert.
/// This field is de/serialized from/to JSON as

View File

@@ -1,5 +1,4 @@
use mongo_indexed::derive::MongoIndexed;
use mungos::mongodb::bson::Document;
use serde::{Deserialize, Serialize};
use typeshare::typeshare;

View File

@@ -1,8 +1,6 @@
use derive_variants::EnumVariants;
use mongo_indexed::derive::MongoIndexed;
use mungos::mongodb::bson::{
doc, serde_helpers::hex_string_as_object_id, Document,
};
use mungos::mongodb::bson::serde_helpers::hex_string_as_object_id;
use serde::{Deserialize, Serialize};
use strum::{AsRefStr, Display, EnumString};
use typeshare::typeshare;
@@ -13,11 +11,11 @@ use super::{update::ResourceTarget, MongoId};
#[typeshare]
#[derive(Debug, Clone, Serialize, Deserialize, MongoIndexed)]
// To query for all permissions on user target
#[doc_index(doc! { "user_target.type": 1, "user_target.id": 1 })]
#[doc_index({ "user_target.type": 1, "user_target.id": 1 })]
// To query for all permissions on a resource target
#[doc_index(doc! { "resource_target.type": 1, "resource_target.id": 1 })]
#[doc_index({ "resource_target.type": 1, "resource_target.id": 1 })]
// Only one permission allowed per user / resource target
#[unique_doc_index(doc! {
#[unique_doc_index({
"user_target.type": 1,
"user_target.id": 1,
"resource_target.type": 1,

View File

@@ -1,7 +1,6 @@
use std::{collections::HashMap, path::PathBuf};
use mongo_indexed::derive::MongoIndexed;
use mungos::mongodb::bson::Document;
use serde::{Deserialize, Serialize};
use strum::{Display, EnumString};
use typeshare::typeshare;

View File

@@ -1,7 +1,7 @@
use derive_builder::Builder;
use mongo_indexed::derive::MongoIndexed;
use mungos::mongodb::bson::{
doc, serde_helpers::hex_string_as_object_id, Document,
doc, serde_helpers::hex_string_as_object_id,
};
use partial_derive2::Partial;
use serde::{Deserialize, Serialize};

View File

@@ -2,7 +2,7 @@ use async_timing_util::unix_timestamp_ms;
use derive_variants::EnumVariants;
use mongo_indexed::derive::MongoIndexed;
use mungos::mongodb::bson::{
doc, serde_helpers::hex_string_as_object_id, Document,
doc, serde_helpers::hex_string_as_object_id,
};
use serde::{Deserialize, Serialize};
use strum::{AsRefStr, Display, EnumString};
@@ -22,8 +22,8 @@ use super::{
#[derive(
Serialize, Deserialize, Debug, Clone, Default, MongoIndexed,
)]
#[doc_index(doc! { "target.type": 1 })]
#[sparse_doc_index(doc! { "target.id": 1 })]
#[doc_index({ "target.type": 1 })]
#[sparse_doc_index({ "target.id": 1 })]
pub struct Update {
/// The Mongo ID of the update.
/// This field is de/serialized from/to JSON as

View File

@@ -2,7 +2,7 @@ use std::sync::OnceLock;
use mongo_indexed::derive::MongoIndexed;
use mungos::mongodb::bson::{
doc, serde_helpers::hex_string_as_object_id, Document,
doc, serde_helpers::hex_string_as_object_id,
};
use serde::{Deserialize, Serialize};
use typeshare::typeshare;
@@ -13,9 +13,9 @@ use crate::entities::{update::ResourceTarget, MongoId, I64};
#[derive(
Serialize, Deserialize, Debug, Clone, Default, MongoIndexed,
)]
#[doc_index(doc! { "config.type": 1 })]
#[sparse_doc_index(doc! { "config.data.google_id": 1 })]
#[sparse_doc_index(doc! { "config.data.github_id": 1 })]
#[doc_index({ "config.type": 1 })]
#[sparse_doc_index({ "config.data.google_id": 1 })]
#[sparse_doc_index({ "config.data.github_id": 1 })]
pub struct User {
/// The Mongo ID of the User.
/// This field is de/serialized from/to JSON as

View File

@@ -1,7 +1,5 @@
use mongo_indexed::derive::MongoIndexed;
use mungos::mongodb::bson::{
serde_helpers::hex_string_as_object_id, Document,
};
use mungos::mongodb::bson::serde_helpers::hex_string_as_object_id;
use serde::{Deserialize, Serialize};
use typeshare::typeshare;