Skip to content

Commit 9f495a4

Browse files
haydenbakeraajtoddlandonxjames
authored
fix: Remove assertion on HttpApiKey scheme being present in client co… (#4309)
## Description - Removes erroneous assertion, further explained in #4226 - Closes #4226 ## Checklist <!--- If a checkbox below is not applicable, then please DELETE it rather than leaving it unchecked --> - [x] For changes to the smithy-rs codegen or runtime crates, I have created a changelog entry Markdown file in the `.changelog` directory, specifying "client," "server," or both in the `applies_to` key. ---- _By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice._ --------- Co-authored-by: Aaron Todd <aajtodd@users.noreply.github.com> Co-authored-by: Landon James <lnj@amazon.com>
1 parent 1fe1096 commit 9f495a4

File tree

2 files changed

+10
-7
lines changed

2 files changed

+10
-7
lines changed

.changelog/1758067735.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
---
2+
applies_to: ["client"]
3+
authors: ["haydenbaker"]
4+
references: ["smithy-rs#4226"]
5+
breaking: false
6+
new_feature: false
7+
bug_fix: true
8+
---
9+
Fixed problematic assertion on HttpApiKeyAuthTrait `scheme`, which was causing client-codegen to fail when the correct settings for api-key based auth were set.

codegen-client/src/main/kotlin/software/amazon/smithy/rust/codegen/client/smithy/customizations/HttpAuthDecorator.kt

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -180,13 +180,7 @@ private class HttpAuthServiceRuntimePluginCustomization(
180180
val trait = serviceShape.getTrait<HttpApiKeyAuthTrait>()!!
181181
val location =
182182
when (trait.`in`!!) {
183-
HttpApiKeyAuthTrait.Location.HEADER -> {
184-
check(trait.scheme.isPresent) {
185-
"A scheme is required for `@httpApiKey` when `in` is set to `header`"
186-
}
187-
"Header"
188-
}
189-
183+
HttpApiKeyAuthTrait.Location.HEADER -> "Header"
190184
HttpApiKeyAuthTrait.Location.QUERY -> "Query"
191185
}
192186

0 commit comments

Comments
 (0)