fix: resolve compiler warnings and downgrade JWT secret log to warn
- Downgrade OXICLOUD_JWT_SECRET missing log from error to warn level, since generating a random secret per session is valid behavior - Remove unused import super::* in calendar_storage_adapter tests - Remove unused import tokio_stream::StreamExt in compression_service tests - Prefix unused validate_user_ownership with _ in trash_service - Add nohup.out to .gitignore
This commit is contained in:
@@ -61,3 +61,4 @@ logs/
|
|||||||
*.bak
|
*.bak
|
||||||
*.swp
|
*.swp
|
||||||
*.swo
|
*.swo
|
||||||
|
nohup.out
|
||||||
|
|||||||
@@ -80,7 +80,7 @@ impl TrashService {
|
|||||||
/// Validates that the given user owns the trashed item.
|
/// Validates that the given user owns the trashed item.
|
||||||
/// Returns an error if the item does not exist or belongs to a different user.
|
/// Returns an error if the item does not exist or belongs to a different user.
|
||||||
#[instrument(skip(self))]
|
#[instrument(skip(self))]
|
||||||
async fn validate_user_ownership(&self, item_id: &str, user_id: &str) -> Result<()> {
|
async fn _validate_user_ownership(&self, item_id: &str, user_id: &str) -> Result<()> {
|
||||||
let item_uuid = Uuid::parse_str(item_id)
|
let item_uuid = Uuid::parse_str(item_id)
|
||||||
.map_err(|e| DomainError::validation_error(format!("Invalid item ID: {}", e)))?;
|
.map_err(|e| DomainError::validation_error(format!("Invalid item ID: {}", e)))?;
|
||||||
let user_uuid = Uuid::parse_str(user_id)
|
let user_uuid = Uuid::parse_str(user_id)
|
||||||
|
|||||||
@@ -464,12 +464,12 @@ impl AppConfig {
|
|||||||
let generated_secret: String = key.iter().map(|b| format!("{:02x}", b)).collect();
|
let generated_secret: String = key.iter().map(|b| format!("{:02x}", b)).collect();
|
||||||
config.auth.jwt_secret = generated_secret;
|
config.auth.jwt_secret = generated_secret;
|
||||||
|
|
||||||
tracing::error!("==========================================================");
|
tracing::warn!("==========================================================");
|
||||||
tracing::error!("SECURITY WARNING: OXICLOUD_JWT_SECRET is not set!");
|
tracing::warn!("OXICLOUD_JWT_SECRET is not set.");
|
||||||
tracing::error!("A random secret has been generated for this session.");
|
tracing::warn!("A random secret has been generated for this session.");
|
||||||
tracing::error!("All tokens will be INVALIDATED on restart.");
|
tracing::warn!("All tokens will be INVALIDATED on restart.");
|
||||||
tracing::error!("Set OXICLOUD_JWT_SECRET env var for production use.");
|
tracing::warn!("Set OXICLOUD_JWT_SECRET env var for production use.");
|
||||||
tracing::error!("==========================================================");
|
tracing::warn!("==========================================================");
|
||||||
}
|
}
|
||||||
|
|
||||||
if let Ok(access_token_expiry) = env::var("OXICLOUD_ACCESS_TOKEN_EXPIRY_SECS")
|
if let Ok(access_token_expiry) = env::var("OXICLOUD_ACCESS_TOKEN_EXPIRY_SECS")
|
||||||
|
|||||||
@@ -294,7 +294,5 @@ impl CalendarStoragePort for CalendarStorageAdapter {
|
|||||||
|
|
||||||
#[cfg(test)]
|
#[cfg(test)]
|
||||||
mod tests {
|
mod tests {
|
||||||
use super::*;
|
|
||||||
|
|
||||||
// Tests would go here using mock repositories
|
// Tests would go here using mock repositories
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -382,7 +382,6 @@ impl CompressionPort for GzipCompressionService {
|
|||||||
#[cfg(test)]
|
#[cfg(test)]
|
||||||
mod tests {
|
mod tests {
|
||||||
use super::*;
|
use super::*;
|
||||||
use tokio_stream::StreamExt;
|
|
||||||
use futures::TryStreamExt;
|
use futures::TryStreamExt;
|
||||||
|
|
||||||
#[tokio::test]
|
#[tokio::test]
|
||||||
|
|||||||
Reference in New Issue
Block a user