Unverified Commit 9f495a45 authored by Hayden Baker's avatar Hayden Baker Committed by GitHub
Browse files

fix: Remove assertion on HttpApiKey scheme being present in client co… (#4309)

## Description
- Removes erroneous assertion, further explained in
https://github.com/smithy-lang/smithy-rs/issues/4226
- Closes https://github.com/smithy-lang/smithy-rs/issues/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: default avatarAaron Todd <aajtodd@users.noreply.github.com>
Co-authored-by: default avatarLandon James <lnj@amazon.com>
parent 1fe10969
Loading
Loading
Loading
Loading
+9 −0
Original line number Diff line number Diff line
---
applies_to: ["client"]
authors: ["haydenbaker"]
references: ["smithy-rs#4226"]
breaking: false
new_feature: false
bug_fix: true
---
Fixed problematic assertion on HttpApiKeyAuthTrait `scheme`, which was causing client-codegen to fail when the correct settings for api-key based auth were set.
 No newline at end of file
+1 −7
Original line number Diff line number Diff line
@@ -180,13 +180,7 @@ private class HttpAuthServiceRuntimePluginCustomization(
                        val trait = serviceShape.getTrait<HttpApiKeyAuthTrait>()!!
                        val location =
                            when (trait.`in`!!) {
                                HttpApiKeyAuthTrait.Location.HEADER -> {
                                    check(trait.scheme.isPresent) {
                                        "A scheme is required for `@httpApiKey` when `in` is set to `header`"
                                    }
                                    "Header"
                                }

                                HttpApiKeyAuthTrait.Location.HEADER -> "Header"
                                HttpApiKeyAuthTrait.Location.QUERY -> "Query"
                            }