API Token Fixes (#218)

* split api secret into owner_api secret and node api secrets

* update for master, drop requirement for authentication for foreign api when run on same port as owner api

* rustfmt

* re-trigger build
This commit is contained in:
Yeastplume
2019-09-12 13:18:15 +01:00
committed by GitHub
parent 78e30aa779
commit 26ad378686
7 changed files with 440 additions and 388 deletions
+2 -1
View File
@@ -45,6 +45,7 @@ fn show_recovery_phrase(phrase: ZeroingString) {
#[derive(Clone)]
pub struct GlobalArgs {
pub account: String,
pub api_secret: Option<String>,
pub node_api_secret: Option<String>,
pub show_spent: bool,
pub chain_type: global::ChainTypes,
@@ -178,7 +179,7 @@ where
wallet,
km,
config.owner_api_listen_addr().as_str(),
g_args.node_api_secret.clone(),
g_args.api_secret.clone(),
g_args.tls_conf.clone(),
config.owner_api_include_foreign.clone(),
);
+1
View File
@@ -137,6 +137,7 @@ where
let basic_auth_middleware = Arc::new(BasicAuthMiddleware::new(
api_basic_auth,
&GRIN_OWNER_BASIC_REALM,
Some("/v2/foreign".into()),
));
router.add_middleware(basic_auth_middleware);
}