aboutsummaryrefslogtreecommitdiff
path: root/api.go
diff options
context:
space:
mode:
authorQuentin Dufour <quentin@deuxfleurs.fr>2023-09-15 14:59:23 +0200
committerQuentin Dufour <quentin@deuxfleurs.fr>2023-09-15 14:59:23 +0200
commite876bdd6632e0f00e2973cfba5336128ef00a3ab (patch)
tree100ea4df7f1d0e6bb5b6efa96ba9de5b3d0a9c56 /api.go
parentf8f417906ad9026cdf2ae6ac18a918cd4069312a (diff)
downloadguichet-e876bdd6632e0f00e2973cfba5336128ef00a3ab.tar.gz
guichet-e876bdd6632e0f00e2973cfba5336128ef00a3ab.zip
spec
Diffstat (limited to 'api.go')
-rw-r--r--api.go29
1 files changed, 29 insertions, 0 deletions
diff --git a/api.go b/api.go
index 9f3ef7b..bce9993 100644
--- a/api.go
+++ b/api.go
@@ -118,6 +118,35 @@ func handleAPIGarageBucket(w http.ResponseWriter, r *http.Request) {
return
}
+ // CHECK PATCH REQUEST
+
+ // READ BODY JSON
+
+ // VALIDATE OBJECT
+ // --- bucket query parameter ---
+ // 1. bucket must be owned by the key with owner permission, otherwise throw "unauthorized" (401)
+ // 2. must not end with deuxfleurs.fr or deuxfleurs.org, otherwise throw "forbidden" (403)
+ // --- global ---
+ // 1. can be true, false, or nil (use pointers)
+ // 2. if nil do nothing
+ // 3. if false, throw "not yet implemented" (501)
+ // 4. if true, check that the bucket name does not exist yet in the global namespace, throw "forbidden" (403)
+ // --- quota.size ---
+ // 1. if no quota on the bucket + this field is none, set to 50MB
+ // 2. if lower than 50MB, set to 50MB. If higher than 200MB, set to 200MB
+ // --- quota.files ---
+ // 1. if no quota on the bucket + this field is none, set to 10k
+ // 2. if lower than 10k, set to 10k. If higher than 40k, set to 40k
+
+ // IF BODY.GLOBAL is not NONE
+ // Add an alias
+
+ // IF BODY.QUOTA.SIZE is not NONE
+ // Change quota
+
+ // IF BODY.QUOTA.FILE is not NONE
+ // Change quota
+
log.Println(login, s3key)
return