Remove useless imports and dead code
Some checks failed
continuous-integration/drone/push Build is failing
continuous-integration/drone/pr Build is failing

This commit is contained in:
Alex 2022-04-14 14:44:18 +02:00
parent f294458f20
commit 69f14245bb
Signed by: lx
GPG key ID: 0E496D15096376BE
4 changed files with 10 additions and 29 deletions

View file

@ -1,10 +1,8 @@
use std::sync::Arc; use std::sync::Arc;
use async_trait::async_trait; use async_trait::async_trait;
use chrono::{DateTime, NaiveDateTime, Utc};
use futures::future::Future; use futures::future::Future;
use futures::prelude::*;
use hyper::header;
use hyper::{Body, Method, Request, Response}; use hyper::{Body, Method, Request, Response};
use opentelemetry::{trace::SpanRef, KeyValue}; use opentelemetry::{trace::SpanRef, KeyValue};
@ -13,14 +11,14 @@ use garage_table::util::*;
use garage_util::error::Error as GarageError; use garage_util::error::Error as GarageError;
use garage_model::garage::Garage; use garage_model::garage::Garage;
use garage_model::key_table::Key;
use crate::error::*; use crate::error::*;
use crate::generic_server::*; use crate::generic_server::*;
use crate::signature::compute_scope;
use crate::signature::payload::check_payload_signature; use crate::signature::payload::check_payload_signature;
use crate::signature::streaming::*; use crate::signature::streaming::*;
use crate::signature::LONG_DATETIME;
use crate::helpers::*; use crate::helpers::*;
use crate::k2v::router::{Endpoint}; use crate::k2v::router::{Endpoint};
@ -59,22 +57,6 @@ impl ApiHandler for K2VApiServer {
type Endpoint = K2VApiEndpoint; type Endpoint = K2VApiEndpoint;
fn parse_endpoint(&self, req: &Request<Body>) -> Result<K2VApiEndpoint, Error> { fn parse_endpoint(&self, req: &Request<Body>) -> Result<K2VApiEndpoint, Error> {
let authority = req
.headers()
.get(header::HOST)
.ok_or_bad_request("Host header required")?
.to_str()?;
let host = authority_to_host(authority)?;
let bucket_name = self
.garage
.config
.s3_api
.root_domain
.as_ref()
.and_then(|root_domain| host_to_bucket(&host, root_domain));
let (endpoint, bucket_name) = Endpoint::from_request(req)?; let (endpoint, bucket_name) = Endpoint::from_request(req)?;
Ok(K2VApiEndpoint { Ok(K2VApiEndpoint {

View file

@ -2,8 +2,8 @@ use crate::error::*;
use std::borrow::Cow; use std::borrow::Cow;
use hyper::header::HeaderValue;
use hyper::{HeaderMap, Method, Request}; use hyper::{Method, Request};
use crate::router_macros::{router_match, generateQueryParameters}; use crate::router_macros::{router_match, generateQueryParameters};
use crate::helpers::Authorization; use crate::helpers::Authorization;

View file

@ -1,9 +1,8 @@
use std::sync::Arc; use std::sync::Arc;
use async_trait::async_trait; use async_trait::async_trait;
use chrono::{DateTime, NaiveDateTime, Utc};
use futures::future::Future; use futures::future::Future;
use futures::prelude::*;
use hyper::header; use hyper::header;
use hyper::{Body, Method, Request, Response}; use hyper::{Body, Method, Request, Response};
@ -17,10 +16,10 @@ use garage_model::key_table::Key;
use crate::error::*; use crate::error::*;
use crate::generic_server::*; use crate::generic_server::*;
use crate::signature::compute_scope;
use crate::signature::payload::check_payload_signature; use crate::signature::payload::check_payload_signature;
use crate::signature::streaming::*; use crate::signature::streaming::*;
use crate::signature::LONG_DATETIME;
use crate::helpers::*; use crate::helpers::*;
use crate::s3::bucket::*; use crate::s3::bucket::*;

View file

@ -4,7 +4,7 @@ use chrono::{DateTime, NaiveDateTime, Utc};
use futures::prelude::*; use futures::prelude::*;
use futures::task; use futures::task;
use hyper::body::Bytes; use hyper::body::Bytes;
use hyper::{Body, Method, Request, Response}; use hyper::{Body, Request};
use garage_model::key_table::Key; use garage_model::key_table::Key;
use hmac::Mac; use hmac::Mac;