1.47
This commit is contained in:
parent
ee18a6220b
commit
1aeba8e394
@ -161,6 +161,20 @@ public class ExternalSystemServiceImpl extends BaseServiceImpl<ExternalSystem, E
|
||||
log.debug("保留原Token(空值):系统ID={}", id);
|
||||
}
|
||||
|
||||
// Config处理(如kubeconfig等敏感配置)
|
||||
if (SensitiveDataEncryptor.isMasked(dto.getConfig())) {
|
||||
// 如果是掩码,保留原Config
|
||||
dto.setConfig(existingSystem.getConfig());
|
||||
log.debug("保留原Config(掩码):系统ID={}", id);
|
||||
} else if (StringUtils.isNotBlank(dto.getConfig())) {
|
||||
// 如果是新Config,直接保存(Config不加密,因为需要直接使用)
|
||||
log.debug("更新Config:系统ID={}", id);
|
||||
} else {
|
||||
// 如果为空,保留原Config
|
||||
dto.setConfig(existingSystem.getConfig());
|
||||
log.debug("保留原Config(空值):系统ID={}", id);
|
||||
}
|
||||
|
||||
return super.update(id, dto);
|
||||
}
|
||||
|
||||
@ -354,6 +368,8 @@ public class ExternalSystemServiceImpl extends BaseServiceImpl<ExternalSystem, E
|
||||
dto.setPassword(SensitiveDataEncryptor.maskIfPresent(dto.getPassword()));
|
||||
// 如果有Token,用掩码替换
|
||||
dto.setToken(SensitiveDataEncryptor.maskIfPresent(dto.getToken()));
|
||||
// 如果有Config(如kubeconfig),用掩码替换
|
||||
dto.setConfig(SensitiveDataEncryptor.maskIfPresent(dto.getConfig()));
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Loading…
Reference in New Issue
Block a user