Skip to content

Commit

Permalink
Add a check for if SigV4ATrait is already applied
Browse files Browse the repository at this point in the history
  • Loading branch information
lauzadis committed Jan 22, 2024
1 parent 4b19660 commit 7acd860
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,11 @@ class SigV4AsymmetricTraitCustomization : KotlinIntegration {
// Needs to happen before the `SigV4AsymmetricAuthSchemeIntegration` & `SigV4AuthSchemeIntegration` (-50 & -50)
override val order: Byte = -60

// services which support SigV4A but don't model it
private val unmodeledSigV4aServices = listOf("s3", "eventbridge", "cloudfront keyvaluestore")

override fun enabledForService(model: Model, settings: KotlinSettings): Boolean =
when (settings.sdkId.lowercase()) {
"s3", "eventbridge", "cloudfront keyvaluestore" -> true
else -> false
}
unmodeledSigV4aServices.contains(settings.sdkId.lowercase()) && !model.isTraitApplied(SigV4ATrait::class.java)

override fun preprocessModel(model: Model, settings: KotlinSettings): Model =
ModelTransformer.create().mapShapes(model) { shape ->
Expand Down

0 comments on commit 7acd860

Please sign in to comment.