Skip to content

Commit 4e05caa

Browse files
committed
backporting PeriodicSweepCache to SigV4a signer
1 parent a54b149 commit 4e05caa

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

runtime/auth/aws-signing-default/common/src/aws/smithy/kotlin/runtime/auth/awssigning/SigV4aSignatureCalculator.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
package aws.smithy.kotlin.runtime.auth.awssigning
66

77
import aws.smithy.kotlin.runtime.auth.awscredentials.Credentials
8-
import aws.smithy.kotlin.runtime.collections.ReadThroughCache
8+
import aws.smithy.kotlin.runtime.collections.PeriodicSweepCache
99
import aws.smithy.kotlin.runtime.content.BigInteger
1010
import aws.smithy.kotlin.runtime.hashing.HashSupplier
1111
import aws.smithy.kotlin.runtime.hashing.Sha256
@@ -32,7 +32,7 @@ internal val N_MINUS_TWO = "FFFFFFFF00000000FFFFFFFFFFFFFFFFBCE6FAADA7179E84F3B9
3232
* @param sha256Provider the [HashSupplier] to use for computing SHA-256 hashes
3333
*/
3434
internal class SigV4aSignatureCalculator(override val sha256Provider: HashSupplier = ::Sha256) : BaseSigV4SignatureCalculator(AwsSigningAlgorithm.SIGV4_ASYMMETRIC, sha256Provider) {
35-
private val privateKeyCache = ReadThroughCache<Credentials, ByteArray>(
35+
private val privateKeyCache = PeriodicSweepCache<Credentials, ByteArray>(
3636
minimumSweepPeriod = 1.hours, // note: Sweeps are effectively a no-op because expiration is [Instant.MAX_VALUE]
3737
)
3838

0 commit comments

Comments
 (0)