s3fs-fuse-0001: StatCache::RawGetChildStats() dedup uses std::find() on std::vector<std::string> inside loop over childmap. O(N*M) on every readdir() and rename_directory() call. Fix: unordered_set for O(1) lookup. MEDIUM severity, 13.8x at N=2000/M=1000. MOAD-0002 (intertangle): globals are config-only, set at startup. Subsystems (stat cache, fd cache, curl) are properly isolated behind singleton + mutex. CLEAN. MOAD-0003 (leaked context): no thread_local usage found. CLEAN. MOAD-0004 (logged secret): all credential logging uses mask_sensitive_string(). insecure_logging is opt-in and deprecated. CLEAN. MOAD-0005 (thundering herd): stat cache uses std::mutex properly. curl handle pool uses lock_guard. No unprotected cache paths. CLEAN.
22 lines
740 B
Diff
22 lines
740 B
Diff
--- a/iroh-relay/src/main.rs
|
|
+++ b/iroh-relay/src/main.rs
|
|
@@ -6,6 +6,7 @@
|
|
use std::{
|
|
+ collections::HashSet,
|
|
net::{Ipv6Addr, SocketAddr},
|
|
num::NonZeroU32,
|
|
path::{Path, PathBuf},
|
|
@@ -150,9 +151,9 @@
|
|
enum AccessConfig {
|
|
/// Allows everyone
|
|
#[default]
|
|
Everyone,
|
|
/// Allows only these endpoints.
|
|
- Allowlist(Vec<EndpointId>),
|
|
+ Allowlist(HashSet<EndpointId>),
|
|
/// Allows everyone, except these endpoints.
|
|
- Denylist(Vec<EndpointId>),
|
|
+ Denylist(HashSet<EndpointId>),
|
|
/// Performs a HTTP POST request to determine access for each endpoint that connects to the relay.
|
|
///
|
|
/// The request will have a header `X-Iroh-Endpoint-Id` set to the hex-encoded endpoint id attempting
|