34 lines
628 B
Go
34 lines
628 B
Go
package data
|
|
|
|
import (
|
|
"kra/internal/config"
|
|
)
|
|
|
|
func cloneAdminConfig(value *config.Admin) *config.Admin {
|
|
if value == nil {
|
|
return &config.Admin{}
|
|
}
|
|
return config.CloneAdmin(value)
|
|
}
|
|
|
|
func maskStorageSecrets(storage *config.Storage) {
|
|
if storage == nil {
|
|
return
|
|
}
|
|
if storage.Qiniu != nil && storage.Qiniu.SecretKey != "" {
|
|
storage.Qiniu.SecretKey = "******"
|
|
}
|
|
for _, item := range []*config.ObjectStore{
|
|
storage.AliyunOSS,
|
|
storage.HuaweiOBS,
|
|
storage.TencentCOS,
|
|
storage.AWSS3,
|
|
storage.CloudflareR2,
|
|
storage.Minio,
|
|
} {
|
|
if item != nil && item.SecretKey != "" {
|
|
item.SecretKey = "******"
|
|
}
|
|
}
|
|
}
|