Skip to content

Commit 4eebbed

Browse files
committed
Generated SecureRandom for aws.ClientConfiguration
1 parent 64f9642 commit 4eebbed

File tree

2 files changed

+14
-2
lines changed

2 files changed

+14
-2
lines changed

gradle.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
#Gradle properties
2-
version=1.0.0
2+
version=1.0.2

src/jvmMain/kotlin/bbs/priorityqueue/sdk/Dynamodb.kt

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ import bbs.priorityqueue.model.ReturnStatusEnum
2727
import bbs.priorityqueue.model.SystemInfo
2828
import bbs.priorityqueue.utils.Utils
2929
import java.math.BigDecimal
30+
import java.security.SecureRandom
3031
import java.time.OffsetDateTime
3132
import java.time.ZoneOffset
3233
import java.util.*
@@ -66,10 +67,21 @@ class Dynamodb(builder: Builder) : Database {
6667
credentials
6768
)
6869
)
70+
71+
// Creates a new instance of secure random everytime Dynamodb is instantiated
72+
// Fix? to Random/SplittableRandom being stored in heap when library is being compiled for a native-image
73+
74+
val secureRandom : SecureRandom = SecureRandom()
75+
secureRandom.generateSeed(32)
76+
6977
if (!Utils.checkIfNullObject(awsRegion)) builder.withRegion(awsRegion)
7078
dynamoDB = builder
7179
.withClientConfiguration(
72-
ClientConfiguration().withMaxConnections(100).withConnectionTimeout(30000)).build()
80+
ClientConfiguration()
81+
.withMaxConnections(100)
82+
.withConnectionTimeout(30000)
83+
.withSecureRandom(secureRandom))
84+
.build()
7385

7486
val mapperConfig = DynamoDBMapperConfig.builder()
7587
.withSaveBehavior(DynamoDBMapperConfig.SaveBehavior.CLOBBER)

0 commit comments

Comments
 (0)