Skip to content

Commit

Permalink
feat: mask sensitive fields in S3Strategy
Browse files Browse the repository at this point in the history
  • Loading branch information
ShiinaKin committed Nov 29, 2024
1 parent df19c11 commit 3d2d4c0
Showing 1 changed file with 8 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -15,6 +15,8 @@ import io.sakurasou.model.dao.group.GroupDao
import io.sakurasou.model.dao.strategy.StrategyDao
import io.sakurasou.model.dto.StrategyInsertDTO
import io.sakurasou.model.dto.StrategyUpdateDTO
import io.sakurasou.model.strategy.LocalStrategy
import io.sakurasou.model.strategy.S3Strategy
import kotlinx.datetime.Clock
import kotlinx.datetime.TimeZone
import kotlinx.datetime.toLocalDateTime
@@ -80,7 +82,12 @@ class StrategyServiceImpl(
val strategyVO = StrategyVO(
id = strategy.id,
name = strategy.name,
config = strategy.config,
config = strategy.config.let {
when (it) {
is LocalStrategy -> it
is S3Strategy -> it.copy(accessKey = "", secretKey = "")
}
},
// type = strategy.config::class.annotations.filterIsInstance<SerialName>().firstOrNull()?.value!!,
type = strategy.config.strategyType,
createTime = strategy.createTime

0 comments on commit 3d2d4c0

Please sign in to comment.