groupware: jmap: fix id -> blobId attribute when uploading a blob

This commit is contained in:
Pascal Bleser
2025-10-24 17:12:59 +02:00
parent 0892f55ea4
commit a685507396
2 changed files with 3 additions and 3 deletions

View File

@@ -44,7 +44,7 @@ func (j *Client) GetBlobMetadata(accountId string, session *Session, ctx context
}
type UploadedBlob struct {
Id string `json:"id"`
BlobId string `json:"blobId"`
Size int `json:"size"`
Type string `json:"type"`
Sha512 string `json:"sha:512"`
@@ -133,7 +133,7 @@ func (j *Client) UploadBlob(accountId string, session *Session, ctx context.Cont
get := getResponse.List[0]
return UploadedBlob{
Id: upload.Id,
BlobId: upload.Id,
Size: upload.Size,
Type: upload.Type,
Sha512: get.DigestSha512,

View File

@@ -125,7 +125,7 @@ func (t TestJmapBlobClient) UploadBinary(ctx context.Context, logger *log.Logger
hasher := sha512.New()
hasher.Write(bytes)
return UploadedBlob{
Id: uuid.NewString(),
BlobId: uuid.NewString(),
Size: len(bytes),
Type: contentType,
Sha512: base64.StdEncoding.EncodeToString(hasher.Sum(nil)),