feat: implement putRelativeFile and deleteFile endpoints

This commit is contained in:
Juan Pablo Villafáñez
2024-07-31 12:50:41 +02:00
parent 21c3ae10a7
commit b5b9f8d189
6 changed files with 596 additions and 55 deletions
@@ -117,7 +117,7 @@ func prepareRoutes(r *chi.Mux, options Options) {
r.Use(func(h stdhttp.Handler) stdhttp.Handler {
// authentication and wopi context
return colabmiddleware.WopiContextAuthMiddleware(options.Config.Wopi.Secret, h)
return colabmiddleware.WopiContextAuthMiddleware(options.Config, h)
})
// check whether we should check for proof keys
@@ -149,14 +149,12 @@ func prepareRoutes(r *chi.Mux, options Options) {
// https://docs.microsoft.com/en-us/microsoft-365/cloud-storage-partner-program/rest/files/putuserinfo
stdhttp.Error(w, stdhttp.StatusText(stdhttp.StatusNotImplemented), stdhttp.StatusNotImplemented)
case "PUT_RELATIVE":
// https://docs.microsoft.com/en-us/microsoft-365/cloud-storage-partner-program/rest/files/putrelativefile
stdhttp.Error(w, stdhttp.StatusText(stdhttp.StatusNotImplemented), stdhttp.StatusNotImplemented)
adapter.PutRelativeFile(w, r)
case "RENAME_FILE":
// https://docs.microsoft.com/en-us/microsoft-365/cloud-storage-partner-program/rest/files/renamefile
stdhttp.Error(w, stdhttp.StatusText(stdhttp.StatusNotImplemented), stdhttp.StatusNotImplemented)
case "DELETE":
// https://docs.microsoft.com/en-us/microsoft-365/cloud-storage-partner-program/rest/files/deletefile
stdhttp.Error(w, stdhttp.StatusText(stdhttp.StatusNotImplemented), stdhttp.StatusNotImplemented)
adapter.DeleteFile(w, r)
default:
stdhttp.Error(w, stdhttp.StatusText(stdhttp.StatusInternalServerError), stdhttp.StatusInternalServerError)