mirror of
https://git.proxmox.com/git/proxmox
synced 2025-05-31 04:56:54 +00:00
src/client/http_client.rs: try to login
use an environment var to store passphrase (PBS_PASSWORD)
This commit is contained in:
parent
fe3b25029b
commit
50ff21da59
@ -458,6 +458,8 @@ pub fn handle_request(api: Arc<ApiConfig>, req: Request<Body>) -> BoxFut {
|
|||||||
if let Some(_username) = rpcenv.get_user() {
|
if let Some(_username) = rpcenv.get_user() {
|
||||||
// fixme: check permissions
|
// fixme: check permissions
|
||||||
} else {
|
} else {
|
||||||
|
println!("Abort UNAUTHORIZED API REQUEST");
|
||||||
|
|
||||||
// always delay unauthorized calls by 3 seconds (from start of 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 resp = (formatter.format_error)(http_err!(UNAUTHORIZED, "permission check failed.".into()));
|
||||||
let delayed_response = tokio::timer::Delay::new(delay_unauth_time)
|
let delayed_response = tokio::timer::Delay::new(delay_unauth_time)
|
||||||
|
Loading…
Reference in New Issue
Block a user