src/client/http_client.rs: try to login

use an environment var to store passphrase (PBS_PASSWORD)
This commit is contained in:
Dietmar Maurer 2019-02-13 14:31:43 +01:00
parent fe3b25029b
commit 50ff21da59

View File

@ -458,6 +458,8 @@ pub fn handle_request(api: Arc<ApiConfig>, req: Request<Body>) -> BoxFut {
if let Some(_username) = rpcenv.get_user() {
// fixme: check permissions
} else {
println!("Abort UNAUTHORIZED API REQUEST");
// always delay unauthorized calls by 3 seconds (from start of request)
let resp = (formatter.format_error)(http_err!(UNAUTHORIZED, "permission check failed.".into()));
let delayed_response = tokio::timer::Delay::new(delay_unauth_time)