test: expect signed one-time material uploads
- TestUploadTicket: HMAC under the jz.bm.upload.v1: label, expiry, malformed and foreign tickets, single use through the cache - TestSignedMaterialUploadRefusesBadTickets, TestCreateMaterialUploadNeedsCaller - TestRoutes, TestBMMCP and TestManageBucketKey expect the upload-url route, the uploads route with its two buckets and the upload tool - compile-only stubs
This commit is contained in:
@@ -11,6 +11,7 @@ import (
|
||||
|
||||
"git.golem15.com/golem15/summercms/modules/lagoon"
|
||||
"git.golem15.com/golem15/summercms/modules/lagoon/attach"
|
||||
"git.golem15.com/golem15/summercms/modules/wire"
|
||||
"gorm.io/gorm"
|
||||
)
|
||||
|
||||
@@ -140,3 +141,16 @@ func (h *Handlers) AttachMaterialInline(w http.ResponseWriter, r *http.Request)
|
||||
}
|
||||
h.writeMaterialDetailWith(w, r, db, m.ID, http.StatusCreated, map[string]any{"warning": MaterialFileWarning})
|
||||
}
|
||||
|
||||
// UploadPath is the path of the signed upload route.
|
||||
const UploadPath = "/_bm/api/v1/uploads/"
|
||||
|
||||
// CreateMaterialUpload is not implemented yet.
|
||||
func (h *Handlers) CreateMaterialUpload(w http.ResponseWriter, r *http.Request) {
|
||||
wire.WriteJSON(w, http.StatusNotImplemented, map[string]any{"error": true})
|
||||
}
|
||||
|
||||
// SignedMaterialUpload is not implemented yet.
|
||||
func (h *Handlers) SignedMaterialUpload(w http.ResponseWriter, r *http.Request) {
|
||||
wire.WriteJSON(w, http.StatusNotImplemented, map[string]any{"error": true})
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user