diff --git a/proxy/api/Cargo.toml b/proxy/api/Cargo.toml index 2ecfe4cff0..cd7f80ed42 100644 --- a/proxy/api/Cargo.toml +++ b/proxy/api/Cargo.toml @@ -16,10 +16,6 @@ default-run = "radicle-proxy" # of the key stored on disk. unsafe-fast-keystore = [] -# Enables the option to use the HTTP API insecurely without checking for the -# session token to make testing easier. -insecure-http-api = [] - [dependencies] anyhow = "1.0" async-stream = "0.3" diff --git a/proxy/api/src/cli.rs b/proxy/api/src/cli.rs index 74402923ee..10f110ff24 100644 --- a/proxy/api/src/cli.rs +++ b/proxy/api/src/cli.rs @@ -46,7 +46,6 @@ pub struct Args { pub unsafe_fast_keystore: bool, /// If `true`, the HTTP api will accept any request without checking the auth token. - #[cfg(feature = "insecure-http-api")] #[structopt(long)] pub insecure_http_api: bool, diff --git a/proxy/api/src/process.rs b/proxy/api/src/process.rs index 93f664955e..723365c195 100644 --- a/proxy/api/src/process.rs +++ b/proxy/api/src/process.rs @@ -31,10 +31,9 @@ pub async fn run(args: Args) -> Result<(), anyhow::Error> { let mut service_manager = service::Manager::new(service::EnvironmentConfig { test_mode: args.test, + insecure_http_api: args.insecure_http_api, #[cfg(feature = "unsafe-fast-keystore")] unsafe_fast_keystore: args.unsafe_fast_keystore, - #[cfg(feature = "insecure-http-api")] - insecure_http_api: args.insecure_http_api, })?; if let Some(passphrase) = &args.key_passphrase { diff --git a/proxy/api/src/service.rs b/proxy/api/src/service.rs index 3b78836afb..b5ff78e7e6 100644 --- a/proxy/api/src/service.rs +++ b/proxy/api/src/service.rs @@ -43,7 +43,6 @@ pub struct EnvironmentConfig { pub unsafe_fast_keystore: bool, /// If `true`, the HTTP api will accept any request without checking the auth token. - #[cfg(feature = "insecure-http-api")] pub insecure_http_api: bool, } @@ -83,19 +82,13 @@ impl Environment { Arc::new(keystore::file(coco_profile.paths().clone())) }; - #[cfg(not(feature = "insecure-http-api"))] - let insecure_http_api = false; - - #[cfg(feature = "insecure-http-api")] - let insecure_http_api = config.insecure_http_api; - Ok(Self { key: None, temp_dir, coco_profile, keystore, test_mode: config.test_mode, - insecure_http_api, + insecure_http_api: config.insecure_http_api, }) } }