Skip to content

Commit

Permalink
fix: 修复存储管理私有密钥校验错误
Browse files Browse the repository at this point in the history
fix #76
  • Loading branch information
Charles7c committed Jun 24, 2024
1 parent 9995bf0 commit eb65cff
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,6 @@ public class StorageReq extends BaseReq {
* 私有密钥
*/
@Schema(description = "私有密钥", example = "")
@Length(max = 255, message = "私有密钥长度不能超过 {max} 个字符")
private String secretKey;

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -189,6 +189,7 @@ private void decodeSecretKey(StorageReq req, StorageDO storage) {
// 新增时或修改了 SecretKey
String secretKey = ExceptionUtils.exToNull(() -> SecureUtils.decryptByRsaPrivateKey(newSecretKey));
ValidationUtils.throwIfNull(secretKey, "私有密钥解密失败");
ValidationUtils.throwIf(secretKey.length() > 255, "私有密钥长度不能超过 255 个字符");
req.setSecretKey(secretKey);
}

Expand Down

0 comments on commit eb65cff

Please sign in to comment.