aboutsummaryrefslogtreecommitdiff
path: root/src/api/helpers.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/api/helpers.rs')
-rw-r--r--src/api/helpers.rs14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/api/helpers.rs b/src/api/helpers.rs
index 5f488912..cf60005d 100644
--- a/src/api/helpers.rs
+++ b/src/api/helpers.rs
@@ -1,4 +1,5 @@
use std::convert::Infallible;
+use std::sync::Arc;
use futures::{Stream, StreamExt, TryStreamExt};
@@ -10,6 +11,10 @@ use hyper::{
use idna::domain_to_unicode;
use serde::{Deserialize, Serialize};
+use garage_model::bucket_table::BucketParams;
+use garage_model::garage::Garage;
+use garage_model::key_table::Key;
+use garage_util::data::Uuid;
use garage_util::error::Error as GarageError;
use crate::common_error::{CommonError as Error, *};
@@ -27,6 +32,15 @@ pub enum Authorization {
Owner,
}
+/// The values which are known for each request related to a bucket
+pub struct ReqCtx {
+ pub garage: Arc<Garage>,
+ pub bucket_id: Uuid,
+ pub bucket_name: String,
+ pub bucket_params: BucketParams,
+ pub api_key: Key,
+}
+
/// Host to bucket
///
/// Convert a host, like "bucket.garage-site.tld" to the corresponding bucket "bucket",