From e876bdd6632e0f00e2973cfba5336128ef00a3ab Mon Sep 17 00:00:00 2001 From: Quentin Dufour Date: Fri, 15 Sep 2023 14:59:23 +0200 Subject: spec --- api.go | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) 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 -- cgit v1.2.3