From e77a94189ecbf13f041346e7d7b6d3ecf5876a6b Mon Sep 17 00:00:00 2001
From: Bryan Newbold <bnewbold@archive.org>
Date: Tue, 25 Aug 2020 20:10:46 -0700
Subject: rename 'allow_all...' to 'unsafe_all...'

---
 src/lib.rs  | 4 ++--
 src/main.rs | 8 ++++----
 2 files changed, 6 insertions(+), 6 deletions(-)

(limited to 'src')

diff --git a/src/lib.rs b/src/lib.rs
index c8967e3..f50fbdc 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -10,7 +10,7 @@ use parse::UrlQueryParams;
 pub struct ProxyConfig {
     pub bind_addr: Option<String>,     // 127.0.0.1:9292
     pub upstream_addr: Option<String>, // 127.0.0.1:9200
-    pub allow_all_indices: Option<bool>,
+    pub unsafe_all_indices: Option<bool>,
     pub index: Vec<IndexConfig>,
 }
 
@@ -21,7 +21,7 @@ pub struct IndexConfig {
 
 impl ProxyConfig {
     pub fn allow_index(&self, name: &str) -> bool {
-        if self.allow_all_indices == Some(true) {
+        if self.unsafe_all_indices == Some(true) {
             return true;
         }
         for index in &self.index {
diff --git a/src/main.rs b/src/main.rs
index d95ef4a..d1c0f02 100644
--- a/src/main.rs
+++ b/src/main.rs
@@ -66,7 +66,7 @@ fn load_config() -> ProxyConfig {
     let args: Vec<String> = env::args().collect();
     let args: Vec<&str> = args.iter().map(|x| x.as_str()).collect();
     let mut config_path: Option<String> = None;
-    let mut allow_all_indices = false;
+    let mut unsafe_all_indices = false;
 
     // first parse CLI arg
     match args.as_slice() {
@@ -80,7 +80,7 @@ fn load_config() -> ProxyConfig {
             std::process::exit(0);
         }
         [_, "--config", p] => config_path = Some(p.to_string()),
-        [_, "--allow-all-indices"] => allow_all_indices = true,
+        [_, "--unsafe-all-indices"] => unsafe_all_indices = true,
         _ => {
             eprintln!("{}", usage());
             eprintln!("couldn't parse arguments");
@@ -101,8 +101,8 @@ fn load_config() -> ProxyConfig {
     } else {
         ProxyConfig::default()
     };
-    if allow_all_indices {
-        config.allow_all_indices = Some(true);
+    if unsafe_all_indices {
+        config.unsafe_all_indices = Some(true);
     }
     config
 }
-- 
cgit v1.2.3