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:
2026-10-28 15:07:30 +01:00
parent 93066c63ea
commit ce6ac0a78e
7 changed files with 364 additions and 4 deletions

View File

@@ -14,6 +14,7 @@ import (
chatclasses "git.golem15.com/golem15/sm-chat-plugin/classes"
chanclasses "git.golem15.com/golem15/sm-chatchannels-plugin/classes"
"git.golem15.com/golem15/summercms/modules/bouncer"
"git.golem15.com/golem15/summercms/modules/cooler"
"git.golem15.com/golem15/summercms/modules/phrasebook"
"git.golem15.com/golem15/summercms/modules/wire"
"gocloud.dev/blob"
@@ -66,6 +67,12 @@ type Handlers struct {
// ChatBots is whether golem15.chatbots is active, so its is_bot flags
// can be read.
ChatBots bool
// UploadKey returns the key the signed material upload URLs are signed
// with (app.key), or nil when none is set: then no URL is issued.
UploadKey func() []byte
// Cache returns the application cache that holds the issued upload
// tickets until they are used, or nil while none is available.
Cache func() cooler.Cache
}
func (h *Handlers) now() time.Time {