safety: remove hardcoded dev credentials, add clippy deny to broker_gateway
- api_gateway: DATABASE_URL now required (was fallback to hardcoded dev password) - broker_gateway: DATABASE_URL now required (was fallback to hardcoded dev password) - broker_gateway: add deny(clippy::unwrap_used, clippy::expect_used) to lib.rs Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -235,9 +235,8 @@ async fn main() -> Result<()> {
|
||||
};
|
||||
|
||||
// Initialize configuration manager (requires database)
|
||||
let database_url = std::env::var("DATABASE_URL").unwrap_or_else(|_| {
|
||||
"postgresql://foxhunt:foxhunt_dev_password@localhost:5432/foxhunt".to_string()
|
||||
});
|
||||
let database_url = std::env::var("DATABASE_URL")
|
||||
.map_err(|_| anyhow::anyhow!("DATABASE_URL environment variable must be set"))?;
|
||||
let db_pool = sqlx::PgPool::connect(&database_url)
|
||||
.await
|
||||
.map_err(|e| anyhow::anyhow!("Failed to connect to database: {}", e))?;
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
//! Provides broker connectivity for order routing via FIX protocol.
|
||||
|
||||
#![deny(warnings)]
|
||||
#![deny(clippy::unwrap_used, clippy::expect_used)]
|
||||
|
||||
pub mod proto {
|
||||
pub mod broker_gateway {
|
||||
|
||||
@@ -32,7 +32,7 @@ async fn main() -> Result<()> {
|
||||
|
||||
// Get database URL from environment
|
||||
let database_url = std::env::var("DATABASE_URL")
|
||||
.unwrap_or_else(|_| "postgresql://foxhunt:foxhunt_dev_password@localhost:5432/foxhunt".to_string());
|
||||
.context("DATABASE_URL environment variable must be set")?;
|
||||
|
||||
// Initialize database pool
|
||||
let db_pool = PgPool::connect(&database_url)
|
||||
|
||||
Reference in New Issue
Block a user