final updates for tag and build based on grin 1.1.0 merge

This commit is contained in:
Yeastplume
2019-04-03 14:22:30 +01:00
parent 0e9ccef3e5
commit 9b49bde4f9
7 changed files with 228 additions and 198 deletions
+1
View File
@@ -31,6 +31,7 @@ uuid = { version = "0.7", features = ["serde", "v4"] }
url = "1.7.0"
chrono = { version = "0.4.4", features = ["serde"] }
easy-jsonrpc = "0.4.1"
lazy_static = "1"
grin_wallet_util = { path = "../util", version = "1.1.0" }
+10 -2
View File
@@ -31,6 +31,7 @@ use crate::util::Mutex;
use failure::ResultExt;
use futures::future::{err, ok};
use futures::{Future, Stream};
use hyper::header::HeaderValue;
use hyper::{Body, Request, Response, StatusCode};
use serde::{Deserialize, Serialize};
use serde_json;
@@ -45,6 +46,11 @@ use crate::apiwallet::{Foreign, ForeignRpc, Owner, OwnerRpc};
use easy_jsonrpc;
use easy_jsonrpc::Handler;
lazy_static! {
pub static ref GRIN_OWNER_BASIC_REALM: HeaderValue =
HeaderValue::from_str("Basic realm=GrinOwnerAPI").unwrap();
}
/// Instantiate wallet Owner API for a single-use (command line) call
/// Return a function containing a loaded API context to call
pub fn owner_single_use<F, T: ?Sized, C, K>(wallet: Arc<Mutex<T>>, f: F) -> Result<(), Error>
@@ -93,8 +99,10 @@ where
if api_secret.is_some() {
let api_basic_auth =
"Basic ".to_string() + &to_base64(&("grin:".to_string() + &api_secret.unwrap()));
let basic_realm = "Basic realm=GrinOwnerAPI".to_string();
let basic_auth_middleware = Arc::new(BasicAuthMiddleware::new(api_basic_auth, basic_realm));
let basic_auth_middleware = Arc::new(BasicAuthMiddleware::new(
api_basic_auth,
&GRIN_OWNER_BASIC_REALM,
));
router.add_middleware(basic_auth_middleware);
}
+2
View File
@@ -19,6 +19,8 @@ extern crate prettytable;
#[macro_use]
extern crate log;
#[macro_use]
extern crate lazy_static;
use failure;
use grin_wallet_api as apiwallet;
use grin_wallet_config as config;