diff --git a/services/backup/Cargo.lock b/services/backup/Cargo.lock --- a/services/backup/Cargo.lock +++ b/services/backup/Cargo.lock @@ -838,7 +838,7 @@ "aws-types", "chrono", "clap", - "comm-services-lib", + "comm-lib", "derive_more", "once_cell", "reqwest", @@ -1027,7 +1027,7 @@ checksum = "acbf1af155f9b9ef647e42cdc158db4b64a1b61f743629225fde6f3e0be2a7c7" [[package]] -name = "comm-services-lib" +name = "comm-lib" version = "0.1.0" dependencies = [ "actix-cors", diff --git a/services/backup/Cargo.toml b/services/backup/Cargo.toml --- a/services/backup/Cargo.toml +++ b/services/backup/Cargo.toml @@ -14,7 +14,7 @@ aws-types = "0.55" chrono = "0.4" clap = { version = "4.0", features = ["derive", "env"] } -comm-services-lib = { path = "../comm-services-lib", features = [ +comm-lib = { path = "../../shared/comm-lib", features = [ "http", "blob-client", ] } diff --git a/services/backup/Dockerfile b/services/backup/Dockerfile --- a/services/backup/Dockerfile +++ b/services/backup/Dockerfile @@ -14,7 +14,6 @@ # Copy actual application sources COPY shared ../../shared/ -COPY services/comm-services-lib ../comm-services-lib COPY services/backup ./ RUN cargo install --locked --path . diff --git a/services/backup/src/database/backup_item.rs b/services/backup/src/database/backup_item.rs --- a/services/backup/src/database/backup_item.rs +++ b/services/backup/src/database/backup_item.rs @@ -1,6 +1,6 @@ use aws_sdk_dynamodb::types::AttributeValue; use chrono::{DateTime, Utc}; -use comm_services_lib::{ +use comm_lib::{ blob::{client::BlobServiceClient, types::BlobInfo}, database::{AttributeTryInto, DBItemError, TryFromAttribute}, }; diff --git a/services/backup/src/database/log_item.rs b/services/backup/src/database/log_item.rs --- a/services/backup/src/database/log_item.rs +++ b/services/backup/src/database/log_item.rs @@ -1,7 +1,7 @@ use std::collections::HashMap; use aws_sdk_dynamodb::types::AttributeValue; -use comm_services_lib::database::{DBItemError, TryFromAttribute}; +use comm_lib::database::{DBItemError, TryFromAttribute}; use crate::constants::{ LOG_TABLE_FIELD_ATTACHMENT_HOLDERS, LOG_TABLE_FIELD_BACKUP_ID, @@ -42,7 +42,7 @@ } /// Total size of this item in the DynamoDB table. This value must be - /// smaller than [`comm_services_lib::constants::DDB_ITEM_SIZE_LIMIT`] + /// smaller than [`comm_lib::constants::DDB_ITEM_SIZE_LIMIT`] /// in order to successfully put this item into a DynamoDB database. pub fn total_size(&self) -> usize { let mut size: usize = LOG_ITEM_HEADERS_SIZE; diff --git a/services/backup/src/database/mod.rs b/services/backup/src/database/mod.rs --- a/services/backup/src/database/mod.rs +++ b/services/backup/src/database/mod.rs @@ -7,7 +7,7 @@ operation::get_item::GetItemOutput, types::{AttributeValue, ReturnValue}, }; -use comm_services_lib::database::Error; +use comm_lib::database::Error; use tracing::{error, trace, warn}; use crate::constants::{ diff --git a/services/backup/src/error.rs b/services/backup/src/error.rs --- a/services/backup/src/error.rs +++ b/services/backup/src/error.rs @@ -6,8 +6,8 @@ HttpResponse, ResponseError, }; pub use aws_sdk_dynamodb::Error as DynamoDBError; -use comm_services_lib::blob::client::BlobServiceError; -use comm_services_lib::database::Error as DBError; +use comm_lib::blob::client::BlobServiceError; +use comm_lib::database::Error as DBError; use reqwest::StatusCode; use tracing::{error, trace, warn}; @@ -17,7 +17,7 @@ pub enum BackupError { NoBackup, BlobError(BlobServiceError), - DB(comm_services_lib::database::Error), + DB(comm_lib::database::Error), } impl From<&BackupError> for actix_web::Error { diff --git a/services/backup/src/http/handlers/backup.rs b/services/backup/src/http/handlers/backup.rs --- a/services/backup/src/http/handlers/backup.rs +++ b/services/backup/src/http/handlers/backup.rs @@ -3,7 +3,7 @@ web::{self, Bytes}, HttpResponse, Responder, }; -use comm_services_lib::{ +use comm_lib::{ auth::UserIdentity, backup::LatestBackupIDResponse, blob::{client::BlobServiceClient, types::BlobInfo}, diff --git a/services/backup/src/http/mod.rs b/services/backup/src/http/mod.rs --- a/services/backup/src/http/mod.rs +++ b/services/backup/src/http/mod.rs @@ -1,6 +1,6 @@ use actix_web::{web, App, HttpResponse, HttpServer}; use anyhow::Result; -use comm_services_lib::{ +use comm_lib::{ blob::client::BlobServiceClient, http::auth::get_comm_authentication_middleware, }; @@ -27,7 +27,7 @@ HttpServer::new(move || { App::new() .wrap(tracing_actix_web::TracingLogger::default()) - .wrap(comm_services_lib::http::cors_config( + .wrap(comm_lib::http::cors_config( CONFIG.localstack_endpoint.is_some(), )) .app_data(db.clone()) diff --git a/services/backup/src/main.rs b/services/backup/src/main.rs --- a/services/backup/src/main.rs +++ b/services/backup/src/main.rs @@ -1,5 +1,5 @@ use anyhow::Result; -use comm_services_lib::blob::client::BlobServiceClient; +use comm_lib::blob::client::BlobServiceClient; use tracing::Level; use tracing_subscriber::EnvFilter; diff --git a/services/blob/Cargo.lock b/services/blob/Cargo.lock --- a/services/blob/Cargo.lock +++ b/services/blob/Cargo.lock @@ -926,7 +926,7 @@ "aws-sdk-s3", "chrono", "clap", - "comm-services-lib", + "comm-lib", "derive_more", "http", "once_cell", @@ -1080,7 +1080,7 @@ ] [[package]] -name = "comm-services-lib" +name = "comm-lib" version = "0.1.0" dependencies = [ "actix-cors", diff --git a/services/blob/Cargo.toml b/services/blob/Cargo.toml --- a/services/blob/Cargo.toml +++ b/services/blob/Cargo.toml @@ -16,7 +16,7 @@ aws-sdk-s3 = "0.27" chrono = "0.4" clap = { version = "4.0", features = ["derive", "env"] } -comm-services-lib = { path = "../comm-services-lib", features = ["http"] } +comm-lib = { path = "../../shared/comm-lib", features = ["http"] } derive_more = "0.99" http = "0.2" once_cell = "1.17" diff --git a/services/blob/Dockerfile b/services/blob/Dockerfile --- a/services/blob/Dockerfile +++ b/services/blob/Dockerfile @@ -15,7 +15,6 @@ # Copy actual application sources COPY shared ../../shared/ -COPY services/comm-services-lib ../comm-services-lib COPY services/blob ./ RUN cargo install --locked --path . diff --git a/services/blob/src/database/client.rs b/services/blob/src/database/client.rs --- a/services/blob/src/database/client.rs +++ b/services/blob/src/database/client.rs @@ -7,7 +7,7 @@ Error as DynamoDBError, }; use chrono::Utc; -use comm_services_lib::database::{ +use comm_lib::database::{ self, batch_operations::ExponentialBackoffConfig, TryFromAttribute, }; use std::collections::HashMap; diff --git a/services/blob/src/database/errors.rs b/services/blob/src/database/errors.rs --- a/services/blob/src/database/errors.rs +++ b/services/blob/src/database/errors.rs @@ -1,7 +1,7 @@ use std::fmt::{Display, Formatter}; use aws_sdk_dynamodb::Error as DynamoDBError; -use comm_services_lib::database::DBItemError; +use comm_lib::database::DBItemError; use crate::s3::S3PathError; @@ -21,9 +21,9 @@ MaxRetriesExceeded, } -impl From for Error { - fn from(value: comm_services_lib::database::Error) -> Self { - use comm_services_lib::database::Error as E; +impl From for Error { + fn from(value: comm_lib::database::Error) -> Self { + use comm_lib::database::Error as E; match value { E::AwsSdk(err) => Self::AwsSdk(err), E::Attribute(err) => Self::Attribute(err), diff --git a/services/blob/src/database/types.rs b/services/blob/src/database/types.rs --- a/services/blob/src/database/types.rs +++ b/services/blob/src/database/types.rs @@ -1,6 +1,6 @@ use aws_sdk_dynamodb::types::AttributeValue; use chrono::{DateTime, Utc}; -use comm_services_lib::database::{ +use comm_lib::database::{ parse_timestamp_attribute, AttributeTryInto, DBItemError, Value, }; use derive_more::Constructor; @@ -233,7 +233,7 @@ return Err(DBError::Attribute(DBItemError::new( ATTR_UNCHECKED.to_string(), Value::String(value.to_string()), - comm_services_lib::database::DBItemAttributeError::IncorrectType, + comm_lib::database::DBItemAttributeError::IncorrectType, ))); } diff --git a/services/blob/src/http/handlers/blob.rs b/services/blob/src/http/handlers/blob.rs --- a/services/blob/src/http/handlers/blob.rs +++ b/services/blob/src/http/handlers/blob.rs @@ -8,7 +8,7 @@ web, HttpResponse, }; use async_stream::try_stream; -use comm_services_lib::http::multipart; +use comm_lib::http::multipart; use serde::{Deserialize, Serialize}; use tokio_stream::StreamExt; use tracing::{info, instrument, trace, warn}; diff --git a/services/blob/src/http/mod.rs b/services/blob/src/http/mod.rs --- a/services/blob/src/http/mod.rs +++ b/services/blob/src/http/mod.rs @@ -2,7 +2,7 @@ use actix_web::{web, App, HttpServer}; use anyhow::Result; -use comm_services_lib::auth::AuthService; +use comm_lib::auth::AuthService; use tracing::info; mod errors; @@ -23,7 +23,7 @@ HttpServer::new(move || { App::new() .wrap(tracing_actix_web::TracingLogger::default()) - .wrap(comm_services_lib::http::cors_config( + .wrap(comm_lib::http::cors_config( CONFIG.localstack_endpoint.is_some(), )) .app_data(auth_service.to_owned()) diff --git a/services/blob/src/http/utils.rs b/services/blob/src/http/utils.rs --- a/services/blob/src/http/utils.rs +++ b/services/blob/src/http/utils.rs @@ -3,7 +3,7 @@ #[macro_export] macro_rules! validate_identifier { ($input_variable:expr) => {{ - if !comm_services_lib::tools::is_valid_identifier(&$input_variable) { + if !comm_lib::tools::is_valid_identifier(&$input_variable) { let variable_name = stringify!($input_variable); tracing::warn!( "{} is not a valid identifier: {}", diff --git a/services/blob/src/main.rs b/services/blob/src/main.rs --- a/services/blob/src/main.rs +++ b/services/blob/src/main.rs @@ -7,7 +7,7 @@ pub mod tools; use anyhow::Result; -use comm_services_lib::auth::AuthService; +use comm_lib::auth::AuthService; use config::Command; use tracing_subscriber::filter::{EnvFilter, LevelFilter}; diff --git a/services/blob/src/service.rs b/services/blob/src/service.rs --- a/services/blob/src/service.rs +++ b/services/blob/src/service.rs @@ -5,8 +5,8 @@ use async_stream::try_stream; use chrono::Duration; -use comm_services_lib::http::ByteStream; -use comm_services_lib::tools::BoxedError; +use comm_lib::http::ByteStream; +use comm_lib::tools::BoxedError; use tokio_stream::StreamExt; use tonic::codegen::futures_core::Stream; use tracing::{debug, error, info, trace, warn}; diff --git a/services/commtest/Cargo.lock b/services/commtest/Cargo.lock --- a/services/commtest/Cargo.lock +++ b/services/commtest/Cargo.lock @@ -630,19 +630,7 @@ ] [[package]] -name = "comm-opaque2" -version = "0.2.0" -dependencies = [ - "argon2", - "log", - "opaque-ke", - "rand", - "tonic 0.9.2", - "wasm-bindgen", -] - -[[package]] -name = "comm-services-lib" +name = "comm-lib" version = "0.1.0" dependencies = [ "anyhow", @@ -662,14 +650,26 @@ "tracing", ] +[[package]] +name = "comm-opaque2" +version = "0.2.0" +dependencies = [ + "argon2", + "log", + "opaque-ke", + "rand", + "tonic 0.9.2", + "wasm-bindgen", +] + [[package]] name = "commtest" version = "0.1.0" dependencies = [ "async-stream", "bytesize", + "comm-lib", "comm-opaque2", - "comm-services-lib", "derive_more", "futures-util", "grpc_clients", diff --git a/services/commtest/Cargo.toml b/services/commtest/Cargo.toml --- a/services/commtest/Cargo.toml +++ b/services/commtest/Cargo.toml @@ -25,7 +25,7 @@ rand = "0.8.5" reqwest = { version = "0.11", features = ["json", "multipart", "stream"] } serde = "1.0" -comm-services-lib = { path = "../comm-services-lib" } +comm-lib = { path = "../../shared/comm-lib" } uuid = { version = "1.2", features = ["v4"] } [build-dependencies] diff --git a/services/commtest/Dockerfile b/services/commtest/Dockerfile --- a/services/commtest/Dockerfile +++ b/services/commtest/Dockerfile @@ -34,7 +34,6 @@ # Copy actual application sources COPY shared ../../shared/ -COPY services/comm-services-lib ../comm-services-lib COPY services/terraform/dev ../terraform/dev COPY services/terraform/modules ../terraform/modules COPY services/commtest ./ diff --git a/services/commtest/src/backup/create_new_backup.rs b/services/commtest/src/backup/create_new_backup.rs --- a/services/commtest/src/backup/create_new_backup.rs +++ b/services/commtest/src/backup/create_new_backup.rs @@ -2,7 +2,7 @@ use crate::tools::Error; use async_stream::stream; -use comm_services_lib::auth::UserIdentity; +use comm_lib::auth::UserIdentity; use reqwest::{ multipart::{Form, Part}, Body, diff --git a/services/commtest/src/backup/pull_backup.rs b/services/commtest/src/backup/pull_backup.rs --- a/services/commtest/src/backup/pull_backup.rs +++ b/services/commtest/src/backup/pull_backup.rs @@ -1,7 +1,7 @@ use std::fmt::Display; use crate::tools::Error; -use comm_services_lib::auth::UserIdentity; +use comm_lib::auth::UserIdentity; #[derive(Debug, Clone)] pub enum BackupDescriptor { diff --git a/services/commtest/tests/backup_integration_test.rs b/services/commtest/tests/backup_integration_test.rs --- a/services/commtest/tests/backup_integration_test.rs +++ b/services/commtest/tests/backup_integration_test.rs @@ -1,5 +1,5 @@ use bytesize::ByteSize; -use comm_services_lib::{auth::UserIdentity, backup::LatestBackupIDResponse}; +use comm_lib::{auth::UserIdentity, backup::LatestBackupIDResponse}; use commtest::{ backup::{ backup_utils::BackupData, diff --git a/services/commtest/tests/backup_performance_test.rs b/services/commtest/tests/backup_performance_test.rs --- a/services/commtest/tests/backup_performance_test.rs +++ b/services/commtest/tests/backup_performance_test.rs @@ -1,5 +1,5 @@ use bytesize::ByteSize; -use comm_services_lib::{auth::UserIdentity, backup::LatestBackupIDResponse}; +use comm_lib::{auth::UserIdentity, backup::LatestBackupIDResponse}; use commtest::{ backup::{ backup_utils::BackupData, diff --git a/services/docker-compose.tests.yml b/services/docker-compose.tests.yml --- a/services/docker-compose.tests.yml +++ b/services/docker-compose.tests.yml @@ -33,7 +33,7 @@ # others COMM_NUMBER_OF_THREADS: '4' BLOB_SERVICE_EXECUTABLE: /shared/bin/blob - RUST_LOG: blob=trace,comm_services_lib=debug + RUST_LOG: blob=trace,comm_lib=debug tunnelbroker-server: image: tunnelbroker @@ -62,7 +62,7 @@ platform: '${PLATFORM:-linux/amd64}' env_file: test-commons.env environment: - RUST_LOG: blob=trace,comm_services_lib=debug + RUST_LOG: blob=trace,comm_lib=debug identity-server: image: identity diff --git a/services/feature-flags/Cargo.lock b/services/feature-flags/Cargo.lock --- a/services/feature-flags/Cargo.lock +++ b/services/feature-flags/Cargo.lock @@ -858,7 +858,7 @@ ] [[package]] -name = "comm-services-lib" +name = "comm-lib" version = "0.1.0" dependencies = [ "anyhow", @@ -1091,7 +1091,7 @@ "aws-sdk-dynamodb", "aws-types", "clap", - "comm-services-lib", + "comm-lib", "http", "once_cell", "serde", diff --git a/services/feature-flags/Cargo.toml b/services/feature-flags/Cargo.toml --- a/services/feature-flags/Cargo.toml +++ b/services/feature-flags/Cargo.toml @@ -13,10 +13,10 @@ aws-types = "0.55" aws-sdk-dynamodb = "0.27" clap = { version = "4.0", features = ["derive", "env"] } -comm-services-lib = { path = "../comm-services-lib" } +comm-lib = { path = "../../shared/comm-lib" } http = "0.2" once_cell = "1.17" serde = { version = "1.0", features = ["derive"] } -tokio = { version = "1.24", features = ["rt-multi-thread", "macros"]} +tokio = { version = "1.24", features = ["rt-multi-thread", "macros"] } tracing = "0.1" -tracing-subscriber = { version = "0.3", features = ["env-filter"]} +tracing-subscriber = { version = "0.3", features = ["env-filter"] } diff --git a/services/feature-flags/Dockerfile b/services/feature-flags/Dockerfile --- a/services/feature-flags/Dockerfile +++ b/services/feature-flags/Dockerfile @@ -10,7 +10,6 @@ # Copy actual application sources COPY shared ../../shared/ -COPY services/comm-services-lib ../comm-services-lib COPY services/feature-flags ./ RUN cargo install --locked --path . diff --git a/services/feature-flags/src/database.rs b/services/feature-flags/src/database.rs --- a/services/feature-flags/src/database.rs +++ b/services/feature-flags/src/database.rs @@ -5,7 +5,7 @@ PLATFORM_IOS, }; use aws_sdk_dynamodb::types::{AttributeValue, Select}; -use comm_services_lib::database::{ +use comm_lib::database::{ self, AttributeMap, DBItemError, Error, TryFromAttribute, }; use std::collections::HashMap; diff --git a/services/feature-flags/src/service.rs b/services/feature-flags/src/service.rs --- a/services/feature-flags/src/service.rs +++ b/services/feature-flags/src/service.rs @@ -2,7 +2,7 @@ use crate::constants::{PLATFORM_ANDROID, PLATFORM_IOS}; use crate::database::{DatabaseClient, FeatureConfig, Platform}; use actix_web::{web, App, HttpResponse, HttpServer}; -use comm_services_lib::database::Error; +use comm_lib::database::Error; use serde::{Deserialize, Serialize}; use std::collections::HashSet; use tracing::info; diff --git a/services/reports/Cargo.lock b/services/reports/Cargo.lock --- a/services/reports/Cargo.lock +++ b/services/reports/Cargo.lock @@ -1033,7 +1033,7 @@ checksum = "acbf1af155f9b9ef647e42cdc158db4b64a1b61f743629225fde6f3e0be2a7c7" [[package]] -name = "comm-services-lib" +name = "comm-lib" version = "0.1.0" dependencies = [ "actix-cors", @@ -2313,7 +2313,7 @@ "aws-sdk-dynamodb", "chrono", "clap", - "comm-services-lib", + "comm-lib", "derive_more", "hex", "http", diff --git a/services/reports/Cargo.toml b/services/reports/Cargo.toml --- a/services/reports/Cargo.toml +++ b/services/reports/Cargo.toml @@ -13,7 +13,7 @@ aws-sdk-dynamodb = "0.27" chrono = { version = "0.4", features = ["serde"] } clap = { version = "4.0", features = ["derive", "env"] } -comm-services-lib = { path = "../comm-services-lib", features = [ +comm-lib = { path = "../../shared/comm-lib", features = [ "blob-client", "http", "crypto", diff --git a/services/reports/Dockerfile b/services/reports/Dockerfile --- a/services/reports/Dockerfile +++ b/services/reports/Dockerfile @@ -14,7 +14,6 @@ # Copy actual application sources COPY shared ../../shared/ -COPY services/comm-services-lib ../comm-services-lib COPY services/reports ./ RUN cargo install --locked --path . diff --git a/services/reports/src/config.rs b/services/reports/src/config.rs --- a/services/reports/src/config.rs +++ b/services/reports/src/config.rs @@ -1,6 +1,6 @@ use anyhow::Result; use clap::{ArgAction, Parser}; -use comm_services_lib::blob::client::Url; +use comm_lib::blob::client::Url; use once_cell::sync::Lazy; use tracing::{info, warn}; diff --git a/services/reports/src/database/client.rs b/services/reports/src/database/client.rs --- a/services/reports/src/database/client.rs +++ b/services/reports/src/database/client.rs @@ -1,7 +1,5 @@ use aws_sdk_dynamodb::types::AttributeValue; -use comm_services_lib::database::{ - self, batch_operations::ExponentialBackoffConfig, -}; +use comm_lib::database::{self, batch_operations::ExponentialBackoffConfig}; use crate::constants::REPORT_LIST_DEFAULT_PAGE_SIZE; use crate::report_types::ReportID; diff --git a/services/reports/src/database/item.rs b/services/reports/src/database/item.rs --- a/services/reports/src/database/item.rs +++ b/services/reports/src/database/item.rs @@ -1,6 +1,6 @@ use aws_sdk_dynamodb::{primitives::Blob, types::AttributeValue}; use chrono::{DateTime, Utc}; -use comm_services_lib::{ +use comm_lib::{ blob::{ client::{BlobServiceClient, BlobServiceError}, types::BlobInfo, @@ -294,7 +294,7 @@ #[cfg(test)] mod tests { - use comm_services_lib::database::AttributeTryInto; + use comm_lib::database::AttributeTryInto; use super::*; diff --git a/services/reports/src/http/mod.rs b/services/reports/src/http/mod.rs --- a/services/reports/src/http/mod.rs +++ b/services/reports/src/http/mod.rs @@ -4,7 +4,7 @@ }; use actix_web::{web, App, HttpResponse, HttpServer, ResponseError}; use anyhow::Result; -use comm_services_lib::auth::AuthService; +use comm_lib::auth::AuthService; use http::StatusCode; use tracing::{debug, error, info, trace, warn}; @@ -19,7 +19,7 @@ auth_service: AuthService, ) -> Result<()> { use actix_web::middleware::{Logger, NormalizePath}; - use comm_services_lib::http::cors_config; + use comm_lib::http::cors_config; use tracing_actix_web::TracingLogger; info!( @@ -55,7 +55,7 @@ fn handle_reports_service_error(err: &ReportsServiceError) -> actix_web::Error { use aws_sdk_dynamodb::Error as DynamoDBError; - use comm_services_lib::database::Error as DBError; + use comm_lib::database::Error as DBError; trace!("Handling reports service error: {:?}", err); match err { diff --git a/services/reports/src/main.rs b/services/reports/src/main.rs --- a/services/reports/src/main.rs +++ b/services/reports/src/main.rs @@ -8,7 +8,7 @@ pub mod service; use anyhow::Result; -use comm_services_lib::{auth::AuthService, blob::client::BlobServiceClient}; +use comm_lib::{auth::AuthService, blob::client::BlobServiceClient}; use service::ReportsService; use tracing_subscriber::filter::{EnvFilter, LevelFilter}; diff --git a/services/reports/src/service.rs b/services/reports/src/service.rs --- a/services/reports/src/service.rs +++ b/services/reports/src/service.rs @@ -1,6 +1,6 @@ use actix_web::FromRequest; use chrono::Utc; -use comm_services_lib::{ +use comm_lib::{ auth::{AuthService, AuthorizationCredential}, blob::client::{BlobServiceClient, BlobServiceError}, crypto::aes256, diff --git a/services/scripts/list_services.sh b/services/scripts/list_services.sh --- a/services/scripts/list_services.sh +++ b/services/scripts/list_services.sh @@ -10,6 +10,5 @@ ! -name "node_modules" \ ! -name "commtest" \ ! -name "terraform" \ - ! -name "comm-services-lib" \ ! -name ".*" \ -print0 | xargs -0 -n1 basename diff --git a/services/terraform/remote/task_blob_cleanup.tf b/services/terraform/remote/task_blob_cleanup.tf --- a/services/terraform/remote/task_blob_cleanup.tf +++ b/services/terraform/remote/task_blob_cleanup.tf @@ -15,7 +15,7 @@ environment = [ { name = "RUST_LOG" - value = local.is_staging ? "info,blob=trace,comm_services_lib=debug" : "info" + value = local.is_staging ? "info,blob=trace,comm_lib=debug" : "info" }, { name = "BLOB_S3_BUCKET_NAME", diff --git a/services/test-commons.env b/services/test-commons.env --- a/services/test-commons.env +++ b/services/test-commons.env @@ -3,4 +3,4 @@ AWS_ACCESS_KEY_ID=test AWS_SECRET_ACCESS_KEY=test -RUST_LOG=info,comm_services_lib=debug,blob=debug,backup=debug,identity=debug,tunnelbroker=debug,grpc_clients=debug,commtest=debug +RUST_LOG=info,comm_lib=debug,blob=debug,backup=debug,identity=debug,tunnelbroker=debug,grpc_clients=debug,commtest=debug diff --git a/services/comm-services-lib/.gitignore b/shared/comm-lib/.gitignore rename from services/comm-services-lib/.gitignore rename to shared/comm-lib/.gitignore diff --git a/services/comm-services-lib/Cargo.lock b/shared/comm-lib/Cargo.lock rename from services/comm-services-lib/Cargo.lock rename to shared/comm-lib/Cargo.lock --- a/services/comm-services-lib/Cargo.lock +++ b/shared/comm-lib/Cargo.lock @@ -953,7 +953,7 @@ ] [[package]] -name = "comm-services-lib" +name = "comm-lib" version = "0.1.0" dependencies = [ "actix-cors", diff --git a/services/comm-services-lib/Cargo.toml b/shared/comm-lib/Cargo.toml rename from services/comm-services-lib/Cargo.toml rename to shared/comm-lib/Cargo.toml --- a/services/comm-services-lib/Cargo.toml +++ b/shared/comm-lib/Cargo.toml @@ -1,5 +1,5 @@ [package] -name = "comm-services-lib" +name = "comm-lib" version = "0.1.0" edition = "2021" license = "BSD-3-Clause" @@ -34,7 +34,7 @@ chrono = "0.4" constant_time_eq = "0.3" derive_more = "0.99" -grpc_clients = { path = "../../shared/grpc_clients" } +grpc_clients = { path = "../grpc_clients" } rand = "0.8" tokio = "1.32" tracing = "0.1" diff --git a/services/comm-services-lib/src/auth/mod.rs b/shared/comm-lib/src/auth/mod.rs rename from services/comm-services-lib/src/auth/mod.rs rename to shared/comm-lib/src/auth/mod.rs diff --git a/services/comm-services-lib/src/auth/service.rs b/shared/comm-lib/src/auth/service.rs rename from services/comm-services-lib/src/auth/service.rs rename to shared/comm-lib/src/auth/service.rs diff --git a/services/comm-services-lib/src/auth/types.rs b/shared/comm-lib/src/auth/types.rs rename from services/comm-services-lib/src/auth/types.rs rename to shared/comm-lib/src/auth/types.rs diff --git a/services/comm-services-lib/src/backup/mod.rs b/shared/comm-lib/src/backup/mod.rs rename from services/comm-services-lib/src/backup/mod.rs rename to shared/comm-lib/src/backup/mod.rs diff --git a/services/comm-services-lib/src/blob/client.rs b/shared/comm-lib/src/blob/client.rs rename from services/comm-services-lib/src/blob/client.rs rename to shared/comm-lib/src/blob/client.rs diff --git a/services/comm-services-lib/src/blob/mod.rs b/shared/comm-lib/src/blob/mod.rs rename from services/comm-services-lib/src/blob/mod.rs rename to shared/comm-lib/src/blob/mod.rs diff --git a/services/comm-services-lib/src/blob/types.rs b/shared/comm-lib/src/blob/types.rs rename from services/comm-services-lib/src/blob/types.rs rename to shared/comm-lib/src/blob/types.rs diff --git a/services/comm-services-lib/src/constants.rs b/shared/comm-lib/src/constants.rs rename from services/comm-services-lib/src/constants.rs rename to shared/comm-lib/src/constants.rs diff --git a/services/comm-services-lib/src/crypto/aes256.rs b/shared/comm-lib/src/crypto/aes256.rs rename from services/comm-services-lib/src/crypto/aes256.rs rename to shared/comm-lib/src/crypto/aes256.rs diff --git a/services/comm-services-lib/src/crypto/mod.rs b/shared/comm-lib/src/crypto/mod.rs rename from services/comm-services-lib/src/crypto/mod.rs rename to shared/comm-lib/src/crypto/mod.rs diff --git a/services/comm-services-lib/src/database.rs b/shared/comm-lib/src/database.rs rename from services/comm-services-lib/src/database.rs rename to shared/comm-lib/src/database.rs --- a/services/comm-services-lib/src/database.rs +++ b/shared/comm-lib/src/database.rs @@ -86,7 +86,7 @@ /// /// Types implementing this trait are able to do the following: /// ```ignore -/// use comm_services_lib::database::{TryFromAttribute, AttributeTryInto}; +/// use comm_lib::database::{TryFromAttribute, AttributeTryInto}; /// /// let foo = SomeType::try_from_attr("MyAttribute", Some(attribute))?; /// diff --git a/services/comm-services-lib/src/http.rs b/shared/comm-lib/src/http.rs rename from services/comm-services-lib/src/http.rs rename to shared/comm-lib/src/http.rs diff --git a/services/comm-services-lib/src/http/auth.rs b/shared/comm-lib/src/http/auth.rs rename from services/comm-services-lib/src/http/auth.rs rename to shared/comm-lib/src/http/auth.rs diff --git a/services/comm-services-lib/src/http/multipart.rs b/shared/comm-lib/src/http/multipart.rs rename from services/comm-services-lib/src/http/multipart.rs rename to shared/comm-lib/src/http/multipart.rs --- a/services/comm-services-lib/src/http/multipart.rs +++ b/shared/comm-lib/src/http/multipart.rs @@ -8,7 +8,7 @@ /// /// # Example /// ```no_run -/// # use comm_services_lib::http::multipart; +/// # use comm_lib::http::multipart; /// # use actix_multipart::Multipart; /// # async fn f(mut payload: Multipart) { /// let Some((name, mut stream)) = multipart::get_text_field(&mut payload).await.unwrap() else { diff --git a/services/comm-services-lib/src/lib.rs b/shared/comm-lib/src/lib.rs rename from services/comm-services-lib/src/lib.rs rename to shared/comm-lib/src/lib.rs diff --git a/services/comm-services-lib/src/tools.rs b/shared/comm-lib/src/tools.rs rename from services/comm-services-lib/src/tools.rs rename to shared/comm-lib/src/tools.rs