fix version 1
This commit is contained in:
@@ -35,6 +35,13 @@ func CreatePrivateData(ctx context.Context, in *pb.CreatePrivateDataRequest) (re
|
||||
}
|
||||
|
||||
// logic code
|
||||
// 使用服务端密钥加密资料内容后落库,客户端传入的 is_encrypted 不再作为依据
|
||||
encryptedData, err := encryptPrivateData(in.Data)
|
||||
if err != nil {
|
||||
printer.Error("Encrypt private data error: %v", err)
|
||||
return nil, err
|
||||
}
|
||||
|
||||
record := models.CloudPrivate{
|
||||
Std_IICUDS: types.Std_IICUDS{
|
||||
Identity: utils.UUID(),
|
||||
@@ -50,8 +57,8 @@ func CreatePrivateData(ctx context.Context, in *pb.CreatePrivateDataRequest) (re
|
||||
DataType: in.DataType,
|
||||
Title: in.Title,
|
||||
Description: in.Description,
|
||||
Data: in.Data,
|
||||
IsEncrypted: in.IsEncrypted,
|
||||
Data: encryptedData,
|
||||
IsEncrypted: true,
|
||||
Tags: in.Tags,
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user