mirror of
https://github.com/rustfs/rustfs.git
synced 2026-08-26 05:56:50 +00:00
chore(rustfs): adjudicate the remaining 36 bare dead_code allows (#6259)
This commit is contained in:
@@ -42,7 +42,6 @@ fn map_data_usage_result<E>(result: Result<DataUsageInfo, E>) -> S3Result<DataUs
|
|||||||
result.map_err(|_| S3Error::with_message(S3ErrorCode::InternalError, DATA_USAGE_LOAD_ERROR_MESSAGE))
|
result.map_err(|_| S3Error::with_message(S3ErrorCode::InternalError, DATA_USAGE_LOAD_ERROR_MESSAGE))
|
||||||
}
|
}
|
||||||
|
|
||||||
#[allow(dead_code)]
|
|
||||||
#[derive(Debug, Serialize, Default)]
|
#[derive(Debug, Serialize, Default)]
|
||||||
#[serde(rename_all = "PascalCase", default)]
|
#[serde(rename_all = "PascalCase", default)]
|
||||||
pub struct AccountInfo {
|
pub struct AccountInfo {
|
||||||
|
|||||||
@@ -394,7 +394,6 @@ impl Operation for ExportBucketMetadata {
|
|||||||
|
|
||||||
#[derive(Debug, Default, Deserialize)]
|
#[derive(Debug, Default, Deserialize)]
|
||||||
pub struct ImportBucketMetadataQuery {
|
pub struct ImportBucketMetadataQuery {
|
||||||
#[allow(dead_code)]
|
|
||||||
pub bucket: String,
|
pub bucket: String,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -455,12 +455,6 @@ pub fn register_replication_route(r: &mut S3Router<AdminOperation>) -> std::io::
|
|||||||
async fn validate_replication_admin_request(req: &S3Request<Body>, action: AdminAction) -> S3Result<Credentials> {
|
async fn validate_replication_admin_request(req: &S3Request<Body>, action: AdminAction) -> S3Result<Credentials> {
|
||||||
authorize_admin_request(req, vec![Action::AdminAction(action)]).await
|
authorize_admin_request(req, vec![Action::AdminAction(action)]).await
|
||||||
}
|
}
|
||||||
|
|
||||||
#[allow(dead_code)]
|
|
||||||
fn is_local_host(_host: String) -> bool {
|
|
||||||
false
|
|
||||||
}
|
|
||||||
|
|
||||||
pub(crate) async fn cluster_replication_stats(bucket: &str, context: Option<Arc<AppContext>>) -> BucketStats {
|
pub(crate) async fn cluster_replication_stats(bucket: &str, context: Option<Arc<AppContext>>) -> BucketStats {
|
||||||
let Some(stats) = current_replication_stats_handle_for_context(context.clone()) else {
|
let Some(stats) = current_replication_stats_handle_for_context(context.clone()) else {
|
||||||
return BucketStats::default();
|
return BucketStats::default();
|
||||||
|
|||||||
@@ -21,7 +21,6 @@ use matchit::Params;
|
|||||||
use rustfs_madmin::service_commands::ServiceTraceOpts;
|
use rustfs_madmin::service_commands::ServiceTraceOpts;
|
||||||
use s3s::{Body, S3Request, S3Response, S3Result, s3_error};
|
use s3s::{Body, S3Request, S3Response, S3Result, s3_error};
|
||||||
|
|
||||||
#[allow(dead_code)]
|
|
||||||
fn extract_trace_options(uri: &Uri) -> S3Result<ServiceTraceOpts> {
|
fn extract_trace_options(uri: &Uri) -> S3Result<ServiceTraceOpts> {
|
||||||
let mut st_opts = ServiceTraceOpts::default();
|
let mut st_opts = ServiceTraceOpts::default();
|
||||||
st_opts
|
st_opts
|
||||||
@@ -31,7 +30,6 @@ fn extract_trace_options(uri: &Uri) -> S3Result<ServiceTraceOpts> {
|
|||||||
Ok(st_opts)
|
Ok(st_opts)
|
||||||
}
|
}
|
||||||
|
|
||||||
#[allow(dead_code)]
|
|
||||||
pub struct Trace {}
|
pub struct Trace {}
|
||||||
|
|
||||||
#[async_trait::async_trait]
|
#[async_trait::async_trait]
|
||||||
|
|||||||
@@ -19,7 +19,6 @@ pub mod handlers;
|
|||||||
mod plugin_contract;
|
mod plugin_contract;
|
||||||
pub(crate) mod replication_metrics_wire;
|
pub(crate) mod replication_metrics_wire;
|
||||||
// Contract inventory is validated by tests before later runtime integration.
|
// Contract inventory is validated by tests before later runtime integration.
|
||||||
#[allow(dead_code)]
|
|
||||||
pub(crate) mod route_policy;
|
pub(crate) mod route_policy;
|
||||||
pub mod router;
|
pub mod router;
|
||||||
pub(crate) mod runtime_sources;
|
pub(crate) mod runtime_sources;
|
||||||
|
|||||||
@@ -1598,6 +1598,10 @@ pub const DEFERRED_ADMIN_ROUTE_POLICIES: &[DeferredAdminRoutePolicy] = &[
|
|||||||
),
|
),
|
||||||
];
|
];
|
||||||
|
|
||||||
|
#[allow(
|
||||||
|
dead_code,
|
||||||
|
reason = "asserted by this file's tests; the lib target cannot see test-only consumers (backlog#1823)"
|
||||||
|
)]
|
||||||
pub fn validate_admin_route_policy_specs() -> Result<(), AdminRouteMatrixError> {
|
pub fn validate_admin_route_policy_specs() -> Result<(), AdminRouteMatrixError> {
|
||||||
validate_admin_route_specs(ADMIN_ROUTE_POLICY_SPECS)
|
validate_admin_route_specs(ADMIN_ROUTE_POLICY_SPECS)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -5800,7 +5800,6 @@ mod tests {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#[allow(dead_code)]
|
|
||||||
#[derive(Debug, Clone)]
|
#[derive(Debug, Clone)]
|
||||||
pub struct Extra {
|
pub struct Extra {
|
||||||
pub credentials: Option<s3s::auth::Credentials>,
|
pub credentials: Option<s3s::auth::Credentials>,
|
||||||
|
|||||||
@@ -45,7 +45,6 @@ pub struct AppContext {
|
|||||||
object_store: Arc<ECStore>,
|
object_store: Arc<ECStore>,
|
||||||
iam: Arc<dyn IamInterface>,
|
iam: Arc<dyn IamInterface>,
|
||||||
federated_identity: Arc<dyn FederatedIdentityInterface>,
|
federated_identity: Arc<dyn FederatedIdentityInterface>,
|
||||||
#[allow(dead_code)]
|
|
||||||
kms: Arc<dyn KmsInterface>,
|
kms: Arc<dyn KmsInterface>,
|
||||||
kms_runtime: Arc<dyn KmsRuntimeInterface>,
|
kms_runtime: Arc<dyn KmsRuntimeInterface>,
|
||||||
outbound_tls_runtime: Arc<dyn OutboundTlsRuntimeInterface>,
|
outbound_tls_runtime: Arc<dyn OutboundTlsRuntimeInterface>,
|
||||||
@@ -162,7 +161,6 @@ impl AppContext {
|
|||||||
self.federated_identity.publish_handle(service)
|
self.federated_identity.publish_handle(service)
|
||||||
}
|
}
|
||||||
|
|
||||||
#[allow(dead_code)]
|
|
||||||
pub fn kms(&self) -> Arc<dyn KmsInterface> {
|
pub fn kms(&self) -> Arc<dyn KmsInterface> {
|
||||||
self.kms.clone()
|
self.kms.clone()
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -49,7 +49,6 @@ use tokio::sync::RwLock;
|
|||||||
|
|
||||||
/// Default IAM interface adapter.
|
/// Default IAM interface adapter.
|
||||||
pub struct IamHandle {
|
pub struct IamHandle {
|
||||||
#[allow(dead_code)]
|
|
||||||
iam: Arc<IamSys<ObjectStore>>,
|
iam: Arc<IamSys<ObjectStore>>,
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -110,7 +109,6 @@ impl FederatedIdentityInterface for FederatedIdentityHandle {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// Default KMS interface adapter.
|
/// Default KMS interface adapter.
|
||||||
#[allow(dead_code)]
|
|
||||||
pub struct KmsHandle {
|
pub struct KmsHandle {
|
||||||
kms: Arc<KmsServiceManager>,
|
kms: Arc<KmsServiceManager>,
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -36,7 +36,6 @@ use tokio::sync::RwLock;
|
|||||||
|
|
||||||
/// IAM interface for application-layer use-cases.
|
/// IAM interface for application-layer use-cases.
|
||||||
pub trait IamInterface: Send + Sync {
|
pub trait IamInterface: Send + Sync {
|
||||||
#[allow(dead_code)]
|
|
||||||
fn handle(&self) -> Arc<IamSys<ObjectStore>>;
|
fn handle(&self) -> Arc<IamSys<ObjectStore>>;
|
||||||
fn is_ready(&self) -> bool;
|
fn is_ready(&self) -> bool;
|
||||||
fn token_signing_key(&self) -> Option<String> {
|
fn token_signing_key(&self) -> Option<String> {
|
||||||
@@ -53,7 +52,6 @@ pub trait FederatedIdentityInterface: Send + Sync {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// KMS interface for application-layer use-cases.
|
/// KMS interface for application-layer use-cases.
|
||||||
#[allow(dead_code)]
|
|
||||||
pub trait KmsInterface: Send + Sync {
|
pub trait KmsInterface: Send + Sync {
|
||||||
fn handle(&self) -> Arc<KmsServiceManager>;
|
fn handle(&self) -> Arc<KmsServiceManager>;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -738,7 +738,7 @@ struct GetObjectPreparedRead {
|
|||||||
}
|
}
|
||||||
|
|
||||||
struct GetObjectStrategyContext {
|
struct GetObjectStrategyContext {
|
||||||
#[allow(dead_code)]
|
#[allow(dead_code, reason = "written but never read back (backlog#1823)")]
|
||||||
io_strategy: concurrency::IoStrategy,
|
io_strategy: concurrency::IoStrategy,
|
||||||
optimal_buffer_size: usize,
|
optimal_buffer_size: usize,
|
||||||
enable_readahead: bool,
|
enable_readahead: bool,
|
||||||
|
|||||||
@@ -31,7 +31,6 @@ pub async fn init_capacity_management_managed() -> Option<CapacityBackgroundTask
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// Get capacity statistics with metrics
|
/// Get capacity statistics with metrics
|
||||||
#[allow(dead_code)]
|
|
||||||
pub async fn get_capacity_with_metrics() -> Option<(u64, String)> {
|
pub async fn get_capacity_with_metrics() -> Option<(u64, String)> {
|
||||||
get_cached_capacity_with_metrics()
|
get_cached_capacity_with_metrics()
|
||||||
.await
|
.await
|
||||||
|
|||||||
@@ -765,7 +765,6 @@ fn resolve_buffer_profile_config(
|
|||||||
|
|
||||||
/// Parse and normalize server address for FTP/FTPS
|
/// Parse and normalize server address for FTP/FTPS
|
||||||
/// Forces IPv4 binding to avoid libunftp IPv6 compatibility issues
|
/// Forces IPv4 binding to avoid libunftp IPv6 compatibility issues
|
||||||
#[allow(dead_code)]
|
|
||||||
async fn parse_and_normalize_server_address(
|
async fn parse_and_normalize_server_address(
|
||||||
address_str: &str,
|
address_str: &str,
|
||||||
) -> Result<std::net::SocketAddr, Box<dyn std::error::Error + Send + Sync>> {
|
) -> Result<std::net::SocketAddr, Box<dyn std::error::Error + Send + Sync>> {
|
||||||
@@ -781,45 +780,6 @@ async fn parse_and_normalize_server_address(
|
|||||||
|
|
||||||
Ok(normalized_addr)
|
Ok(normalized_addr)
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Start FTP/FTPS server in background with shutdown support
|
|
||||||
/// # Arguments
|
|
||||||
/// * `server` - The FTP/FTPS server instance
|
|
||||||
/// * `protocol_name` - Name of the protocol (e.g., "FTP", "FTPS")
|
|
||||||
#[allow(dead_code)]
|
|
||||||
fn spawn_server<S>(server: S, protocol_name: &'static str) -> tokio::sync::broadcast::Sender<()>
|
|
||||||
where
|
|
||||||
S: std::future::Future<Output = Result<(), Box<dyn std::error::Error>>> + Send + 'static,
|
|
||||||
{
|
|
||||||
let (shutdown_tx, _) = tokio::sync::broadcast::channel(1);
|
|
||||||
|
|
||||||
tokio::spawn(async move {
|
|
||||||
if let Err(e) = server.await {
|
|
||||||
error!(
|
|
||||||
target: "rustfs::init",
|
|
||||||
event = "protocol_server_state",
|
|
||||||
component = LOG_COMPONENT_INIT,
|
|
||||||
subsystem = LOG_SUBSYSTEM_PROTOCOL,
|
|
||||||
protocol = protocol_name,
|
|
||||||
state = "runtime_failed",
|
|
||||||
error = %e,
|
|
||||||
"Protocol server failed"
|
|
||||||
);
|
|
||||||
}
|
|
||||||
info!(
|
|
||||||
target: "rustfs::init",
|
|
||||||
event = "protocol_server_state",
|
|
||||||
component = LOG_COMPONENT_INIT,
|
|
||||||
subsystem = LOG_SUBSYSTEM_PROTOCOL,
|
|
||||||
protocol = protocol_name,
|
|
||||||
state = "stopped",
|
|
||||||
"Protocol server stopped"
|
|
||||||
);
|
|
||||||
});
|
|
||||||
|
|
||||||
shutdown_tx
|
|
||||||
}
|
|
||||||
|
|
||||||
/// Starts the auto-tuner for performance optimization if enabled via environment variable.
|
/// Starts the auto-tuner for performance optimization if enabled via environment variable.
|
||||||
///
|
///
|
||||||
/// The auto-tuner reads `RUSTFS_AUTOTUNER_ENABLED` to decide whether to run.
|
/// The auto-tuner reads `RUSTFS_AUTOTUNER_ENABLED` to decide whether to run.
|
||||||
|
|||||||
@@ -211,7 +211,6 @@ fn apply_valid_status(state: &mut LicenseState, token: Token) {
|
|||||||
///
|
///
|
||||||
/// This is the extension point for OEM/build-time overlays.
|
/// This is the extension point for OEM/build-time overlays.
|
||||||
/// Returns `false` if the verifier was already initialized.
|
/// Returns `false` if the verifier was already initialized.
|
||||||
#[allow(dead_code)]
|
|
||||||
pub fn set_license_verifier(verifier: SharedLicenseVerifier) -> bool {
|
pub fn set_license_verifier(verifier: SharedLicenseVerifier) -> bool {
|
||||||
LICENSE_VERIFIER.set(verifier).is_ok()
|
LICENSE_VERIFIER.set(verifier).is_ok()
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -352,17 +352,6 @@ fn should_fail_test_init_attempt() -> bool {
|
|||||||
false
|
false
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Reset the test failure counter so the next `should_fail_test_init_attempt`
|
|
||||||
/// call re-reads the environment variable by restoring the sentinel value.
|
|
||||||
/// Intended for use in integration tests that share a process.
|
|
||||||
#[doc(hidden)]
|
|
||||||
#[allow(dead_code)]
|
|
||||||
pub(crate) fn reset_test_failure_counter() {
|
|
||||||
use std::sync::atomic::Ordering;
|
|
||||||
TEST_REMAINING_FAILURES.store(u64::MAX, Ordering::SeqCst);
|
|
||||||
}
|
|
||||||
|
|
||||||
async fn attempt_init_iam_sys(
|
async fn attempt_init_iam_sys(
|
||||||
store: Arc<ECStore>,
|
store: Arc<ECStore>,
|
||||||
) -> std::result::Result<Arc<rustfs_iam::sys::IamSys<rustfs_iam::store::object::ObjectStore>>, std::io::Error> {
|
) -> std::result::Result<Arc<rustfs_iam::sys::IamSys<rustfs_iam::store::object::ObjectStore>>, std::io::Error> {
|
||||||
|
|||||||
@@ -61,7 +61,7 @@ pub(crate) struct ReqInfo {
|
|||||||
pub object: Option<String>,
|
pub object: Option<String>,
|
||||||
pub version_id: Option<String>,
|
pub version_id: Option<String>,
|
||||||
pub replication_request_authorized: bool,
|
pub replication_request_authorized: bool,
|
||||||
#[allow(dead_code)]
|
#[allow(dead_code, reason = "written but never read back (backlog#1823)")]
|
||||||
pub region: Option<s3s::region::Region>,
|
pub region: Option<s3s::region::Region>,
|
||||||
pub request_context: Option<RequestContext>,
|
pub request_context: Option<RequestContext>,
|
||||||
/// Set by probe-style callers that treat AccessDenied as an expected filter
|
/// Set by probe-style callers that treat AccessDenied as an expected filter
|
||||||
|
|||||||
@@ -50,7 +50,7 @@ pub struct ConcurrencyManager {
|
|||||||
/// I/O load metrics for adaptive strategy calculation
|
/// I/O load metrics for adaptive strategy calculation
|
||||||
io_metrics: Arc<Mutex<IoLoadMetrics>>,
|
io_metrics: Arc<Mutex<IoLoadMetrics>>,
|
||||||
/// I/O priority queue for request scheduling
|
/// I/O priority queue for request scheduling
|
||||||
#[allow(dead_code)]
|
#[allow(dead_code, reason = "written but never read back (backlog#1823)")]
|
||||||
priority_queue: Arc<IoPriorityQueue<()>>,
|
priority_queue: Arc<IoPriorityQueue<()>>,
|
||||||
/// Bytes pool for buffer allocation and reuse
|
/// Bytes pool for buffer allocation and reuse
|
||||||
bytes_pool: Arc<BytesPool>,
|
bytes_pool: Arc<BytesPool>,
|
||||||
@@ -131,7 +131,6 @@ pub enum PutObjectAdmission {
|
|||||||
Rejected,
|
Rejected,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[allow(dead_code)]
|
|
||||||
impl ConcurrencyManager {
|
impl ConcurrencyManager {
|
||||||
/// Create a new concurrency manager with default settings
|
/// Create a new concurrency manager with default settings
|
||||||
///
|
///
|
||||||
|
|||||||
@@ -64,7 +64,6 @@ impl GetObjectGuard {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// Get the elapsed time since this guard was created.
|
/// Get the elapsed time since this guard was created.
|
||||||
#[allow(dead_code)]
|
|
||||||
// This helper is primarily used by unit tests to assert timing.
|
// This helper is primarily used by unit tests to assert timing.
|
||||||
// It's intentionally kept public for callers that may want to inspect
|
// It's intentionally kept public for callers that may want to inspect
|
||||||
// a guard's duration without dropping it.
|
// a guard's duration without dropping it.
|
||||||
|
|||||||
@@ -254,7 +254,10 @@ pub(crate) fn apply_bucket_default_lock_retention(
|
|||||||
/// );
|
/// );
|
||||||
/// ```
|
/// ```
|
||||||
///
|
///
|
||||||
#[allow(dead_code)]
|
#[allow(
|
||||||
|
dead_code,
|
||||||
|
reason = "exercised by ecfs_test; the lib target cannot see test-only consumers (backlog#1823)"
|
||||||
|
)]
|
||||||
pub(crate) fn get_adaptive_buffer_size_with_profile(file_size: i64, profile: Option<WorkloadProfile>) -> usize {
|
pub(crate) fn get_adaptive_buffer_size_with_profile(file_size: i64, profile: Option<WorkloadProfile>) -> usize {
|
||||||
let config = match profile {
|
let config = match profile {
|
||||||
Some(p) => RustFSBufferConfig::new(p),
|
Some(p) => RustFSBufferConfig::new(p),
|
||||||
@@ -798,26 +801,10 @@ fn cache_remove(bucket: &str) {
|
|||||||
map.remove(bucket);
|
map.remove(bucket);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Clear all entries in the cache.
|
|
||||||
#[allow(dead_code)]
|
|
||||||
fn cache_clear() {
|
|
||||||
if let Ok(mut map) = small_cache().write() {
|
|
||||||
map.clear();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/// Invalidate the validation cache for a specific bucket.
|
/// Invalidate the validation cache for a specific bucket.
|
||||||
pub fn invalidate_bucket_validation_cache(bucket: &str) {
|
pub fn invalidate_bucket_validation_cache(bucket: &str) {
|
||||||
cache_remove(bucket);
|
cache_remove(bucket);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Invalidate all bucket validation cache entries.
|
|
||||||
#[allow(dead_code)]
|
|
||||||
pub fn invalidate_all_bucket_validation_cache() {
|
|
||||||
cache_clear();
|
|
||||||
}
|
|
||||||
|
|
||||||
/// Helper function to get store and validate bucket exists.
|
/// Helper function to get store and validate bucket exists.
|
||||||
///
|
///
|
||||||
/// Uses adaptive cache with 5s TTL to avoid repeated stat_volume() calls.
|
/// Uses adaptive cache with 5s TTL to avoid repeated stat_volume() calls.
|
||||||
|
|||||||
@@ -15,15 +15,6 @@
|
|||||||
use super::ECStore;
|
use super::ECStore;
|
||||||
use crate::storage::storage_api::head_prefix_consumer::contract::list::ListOperations as _;
|
use crate::storage::storage_api::head_prefix_consumer::contract::list::ListOperations as _;
|
||||||
use std::sync::Arc;
|
use std::sync::Arc;
|
||||||
|
|
||||||
/// Determines if the key "looks like a prefix" (ends with `/`).
|
|
||||||
/// Note: No special handling for empty strings here; the caller must ensure the key has passed `validate_object_key`.
|
|
||||||
#[allow(dead_code)]
|
|
||||||
#[inline]
|
|
||||||
pub(crate) fn is_prefix_key(key: &str) -> bool {
|
|
||||||
key.ends_with('/')
|
|
||||||
}
|
|
||||||
|
|
||||||
/// Constructs a more explicit error message when `HEAD` is performed on a `prefix`-style key but the directory marker object is missing.
|
/// Constructs a more explicit error message when `HEAD` is performed on a `prefix`-style key but the directory marker object is missing.
|
||||||
///
|
///
|
||||||
/// `has_children`:
|
/// `has_children`:
|
||||||
|
|||||||
@@ -1018,12 +1018,6 @@ pub fn parse_copy_source_range(range_str: &str) -> S3Result<HTTPRangeSpec> {
|
|||||||
Err(s3_error!(InvalidArgument, "Invalid range format"))
|
Err(s3_error!(InvalidArgument, "Invalid range format"))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#[allow(dead_code)]
|
|
||||||
pub(crate) fn get_content_sha256(headers: &HeaderMap<HeaderValue>) -> Option<String> {
|
|
||||||
get_content_sha256_with_query(headers, None)
|
|
||||||
}
|
|
||||||
|
|
||||||
pub(crate) fn get_content_sha256_with_query(headers: &HeaderMap<HeaderValue>, query: Option<&str>) -> Option<String> {
|
pub(crate) fn get_content_sha256_with_query(headers: &HeaderMap<HeaderValue>, query: Option<&str>) -> Option<String> {
|
||||||
match get_request_auth_type_with_query(headers, query) {
|
match get_request_auth_type_with_query(headers, query) {
|
||||||
AuthType::Presigned | AuthType::Signed => {
|
AuthType::Presigned | AuthType::Signed => {
|
||||||
@@ -1036,14 +1030,6 @@ pub(crate) fn get_content_sha256_with_query(headers: &HeaderMap<HeaderValue>, qu
|
|||||||
_ => None,
|
_ => None,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// skip_content_sha256_cksum returns true if caller needs to skip
|
|
||||||
/// payload checksum, false if not.
|
|
||||||
#[allow(dead_code)]
|
|
||||||
fn skip_content_sha256_cksum(headers: &HeaderMap<HeaderValue>) -> bool {
|
|
||||||
skip_content_sha256_cksum_with_query(headers, None)
|
|
||||||
}
|
|
||||||
|
|
||||||
fn skip_content_sha256_cksum_with_query(headers: &HeaderMap<HeaderValue>, query: Option<&str>) -> bool {
|
fn skip_content_sha256_cksum_with_query(headers: &HeaderMap<HeaderValue>, query: Option<&str>) -> bool {
|
||||||
let include_query_values = matches!(get_request_auth_type_with_query(headers, query), AuthType::Presigned);
|
let include_query_values = matches!(get_request_auth_type_with_query(headers, query), AuthType::Presigned);
|
||||||
let content_sha256 = get_content_sha256_value(headers, query, include_query_values);
|
let content_sha256 = get_content_sha256_value(headers, query, include_query_values);
|
||||||
@@ -1138,12 +1124,6 @@ fn get_content_sha256_value(
|
|||||||
.and_then(|v| v.to_str().ok())
|
.and_then(|v| v.to_str().ok())
|
||||||
.map(str::to_owned)
|
.map(str::to_owned)
|
||||||
}
|
}
|
||||||
|
|
||||||
#[allow(dead_code)]
|
|
||||||
fn get_content_sha256_cksum(headers: &HeaderMap<HeaderValue>, service_type: ServiceType) -> String {
|
|
||||||
get_content_sha256_cksum_with_query(headers, None, service_type)
|
|
||||||
}
|
|
||||||
|
|
||||||
#[cfg(test)]
|
#[cfg(test)]
|
||||||
#[allow(unused_imports)]
|
#[allow(unused_imports)]
|
||||||
mod tests {
|
mod tests {
|
||||||
|
|||||||
@@ -3354,7 +3354,6 @@ async fn get_local_sse_dek_provider() -> Result<Arc<dyn SseDekProvider>, ApiErro
|
|||||||
/// Clears GLOBAL_SSE_DEK_PROVIDER (local/test providers) and
|
/// Clears GLOBAL_SSE_DEK_PROVIDER (local/test providers) and
|
||||||
/// GLOBAL_KMS_DEK_PROVIDER (test-injected KMS providers).
|
/// GLOBAL_KMS_DEK_PROVIDER (test-injected KMS providers).
|
||||||
#[cfg(test)]
|
#[cfg(test)]
|
||||||
#[allow(dead_code)]
|
|
||||||
pub fn reset_sse_dek_provider() {
|
pub fn reset_sse_dek_provider() {
|
||||||
if let Ok(mut slot) = GLOBAL_SSE_DEK_PROVIDER.write() {
|
if let Ok(mut slot) = GLOBAL_SSE_DEK_PROVIDER.write() {
|
||||||
*slot = None;
|
*slot = None;
|
||||||
@@ -3365,7 +3364,6 @@ pub fn reset_sse_dek_provider() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(test)]
|
#[cfg(test)]
|
||||||
#[allow(dead_code)]
|
|
||||||
pub fn set_sse_dek_provider_for_test(provider: Arc<dyn SseDekProvider>) {
|
pub fn set_sse_dek_provider_for_test(provider: Arc<dyn SseDekProvider>) {
|
||||||
if let Ok(mut slot) = GLOBAL_KMS_DEK_PROVIDER.write() {
|
if let Ok(mut slot) = GLOBAL_KMS_DEK_PROVIDER.write() {
|
||||||
*slot = Some(provider.clone());
|
*slot = Some(provider.clone());
|
||||||
|
|||||||
@@ -16,5 +16,4 @@ pub(crate) use crate::storage::rpc::node_service::make_heal_control_server_with_
|
|||||||
#[cfg(test)]
|
#[cfg(test)]
|
||||||
pub(crate) use crate::storage::rpc::node_service::{heal::heal_topology_fingerprint, make_heal_control_server_for_source};
|
pub(crate) use crate::storage::rpc::node_service::{heal::heal_topology_fingerprint, make_heal_control_server_for_source};
|
||||||
pub use crate::storage::rpc::{make_heal_control_server, make_server, make_tier_mutation_control_server};
|
pub use crate::storage::rpc::{make_heal_control_server, make_server, make_tier_mutation_control_server};
|
||||||
#[allow(dead_code)]
|
|
||||||
pub type NodeService = crate::storage::rpc::NodeService;
|
pub type NodeService = crate::storage::rpc::NodeService;
|
||||||
|
|||||||
@@ -45,7 +45,6 @@ pub struct VersionInfo {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// Update check result
|
/// Update check result
|
||||||
#[allow(dead_code)]
|
|
||||||
#[derive(Debug, Clone, Serialize, Deserialize)]
|
#[derive(Debug, Clone, Serialize, Deserialize)]
|
||||||
pub struct UpdateCheckResult {
|
pub struct UpdateCheckResult {
|
||||||
/// Whether update is available
|
/// Whether update is available
|
||||||
@@ -91,7 +90,6 @@ impl VersionChecker {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// Create version checker with custom configuration
|
/// Create version checker with custom configuration
|
||||||
#[allow(dead_code)]
|
|
||||||
pub fn with_config(url: String, timeout: Duration) -> Self {
|
pub fn with_config(url: String, timeout: Duration) -> Self {
|
||||||
let client = reqwest::Client::builder()
|
let client = reqwest::Client::builder()
|
||||||
.timeout(timeout)
|
.timeout(timeout)
|
||||||
@@ -175,7 +173,6 @@ pub async fn check_updates() -> Result<UpdateCheckResult, UpdateCheckError> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// Update check with custom URL
|
/// Update check with custom URL
|
||||||
#[allow(dead_code)]
|
|
||||||
pub async fn check_updates_with_url(url: String) -> Result<UpdateCheckResult, UpdateCheckError> {
|
pub async fn check_updates_with_url(url: String) -> Result<UpdateCheckResult, UpdateCheckError> {
|
||||||
let checker = VersionChecker::with_config(url, Duration::from_secs(10));
|
let checker = VersionChecker::with_config(url, Duration::from_secs(10));
|
||||||
checker.check_for_updates().await
|
checker.check_for_updates().await
|
||||||
|
|||||||
Reference in New Issue
Block a user