New buckets for 0.6.0: small changes

- Fix bucket delete

- fix merge of bucket creation date

- Replace deletable with option in aliases
    Rationale: if two aliases point to conflicting bucket, resolving
    by making an arbitrary choice risks making data accessible when it
    shouldn't be. We'd rather resolve to deleting the alias until
    someone puts it back.
This commit is contained in:
Alex Auvolat
2022-01-03 18:32:15 +01:00
parent ba7f268b99
commit 1bcd6fabbd
12 changed files with 86 additions and 62 deletions
+1 -2
View File
@@ -86,9 +86,8 @@ async fn serve_file(garage: Arc<Garage>, req: Request<Body>) -> Result<Response<
.bucket_alias_table
.get(&EmptyKey, &bucket_name.to_string())
.await?
.map(|x| x.state.take().into_option())
.map(|x| x.state.take())
.flatten()
.map(|param| param.bucket_id)
.ok_or(Error::NotFound)?;
// Check bucket isn't deleted and has website access enabled