refactor(bare): enhance security and performance optimizations
- Remove unnecessary sorting in advertise_refs for deterministic output - Add path traversal detection and validation in bare_dir construction - Implement symlink resolution checks to prevent security vulnerabilities - Refactor cache system with CRC validation and improved metrics - Integrate repo-specific cache invalidation using indexed keys - Add comprehensive unit tests for commit operations and diff functionality - Move configuration constants to centralized config module - Optimize string operations in disk cache random value generation - Enhance license detection algorithm with cleaner matching logic - Streamline argument processing in various git operations - Update dependencies including crc32fast and flate2 for performance - Add signal handling capability to tokio runtime configuration
This commit is contained in:
@@ -115,7 +115,6 @@ impl pack_service_server::PackService for GitksService {
|
||||
.upload_pack(tokio_stream::wrappers::ReceiverStream::new(rx))
|
||||
.await?;
|
||||
let out = super::bridge_server_stream(resp.into_inner());
|
||||
// Create a dummy cancel token for the forwarded stream
|
||||
let cancel_token = tokio_util::sync::CancellationToken::new();
|
||||
let cancel_guard = cancel_token.drop_guard();
|
||||
return Ok(tonic::Response::new(
|
||||
@@ -190,7 +189,6 @@ impl pack_service_server::PackService for GitksService {
|
||||
.receive_pack(tokio_stream::wrappers::ReceiverStream::new(rx))
|
||||
.await?;
|
||||
let out = super::bridge_server_stream(resp.into_inner());
|
||||
// Create a dummy cancel token for the forwarded stream
|
||||
let cancel_token = tokio_util::sync::CancellationToken::new();
|
||||
let cancel_guard = cancel_token.drop_guard();
|
||||
return Ok(tonic::Response::new(
|
||||
@@ -310,7 +308,6 @@ impl pack_service_server::PackService for GitksService {
|
||||
return Ok(tonic::Response::new(ReceiverStream::new(rx)));
|
||||
}
|
||||
|
||||
// Cache miss: execute pack-objects and tee to cache
|
||||
tracing::info!(%repo, digest = %digest, "pack-objects cache miss");
|
||||
let stream = gb.pack_objects(inner).await?;
|
||||
let tee_stream = pc.tee_pack_stream(&digest, stream);
|
||||
|
||||
Reference in New Issue
Block a user