forked from mtusi2026/mtusi2026lab7
Перенесены cmd/internal/config, compose.yaml, Dockerfile, скрипты, student-tests и evidence из mtusi-messenger (master, lab6). Skeleton lab7 (openapi/infrastructure 1.7.0, trust-matrix.md, security/THREAT_MODEL.md, infra/openbao, tests/security.py) сохранён; make test-security добавлен в Makefile.
32 lines
947 B
Go
32 lines
947 B
Go
package domain
|
|
|
|
import (
|
|
"strconv"
|
|
|
|
"github.com/google/uuid"
|
|
)
|
|
|
|
const (
|
|
StagingUploadPrefix = "staging/uploads/"
|
|
StagingVerifiedPrefix = "staging/verified/"
|
|
StagingPresignPrefix = "staging/presign/"
|
|
AttachmentsPrefix = "attachments/"
|
|
)
|
|
|
|
func StagingUploadKey(chatID, attachmentID uuid.UUID) string {
|
|
return StagingUploadPrefix + chatID.String() + "/" + attachmentID.String()
|
|
}
|
|
|
|
func StagingVerifiedKey(chatID, attachmentID uuid.UUID) string {
|
|
return StagingVerifiedPrefix + chatID.String() + "/" + attachmentID.String()
|
|
}
|
|
|
|
func OriginalObjectKey(chatID, attachmentID uuid.UUID) string {
|
|
return AttachmentsPrefix + chatID.String() + "/" + attachmentID.String() + "/original"
|
|
}
|
|
|
|
func VariantObjectKey(chatID, attachmentID uuid.UUID, pipelineVersion int, name VariantName) string {
|
|
return AttachmentsPrefix + chatID.String() + "/" + attachmentID.String() +
|
|
"/variants/v" + strconv.Itoa(pipelineVersion) + "/" + name.ObjectName()
|
|
}
|