-
Notifications
You must be signed in to change notification settings - Fork 89
Description
We're relying on http4s to do our URLencoding for us, in both query and path parameters. However, it looks like this isn't following the smithy spec:
Characters not defined as unreserved by RFC 3986 section 2.3 MUST be percent-encoded. That is, all characters except for alphanumerics and -._~.
https://smithy.io/2.0/spec/http-bindings.html#httplabel-serialization-rules
http4s skips escaping of more than that - e.g. :, which is most notably part of any AWS ARN, making it currently impossible to e.g. call Lambdas across accounts.
We should update this - do our own pathencoding, where we'll have control over which characters we escape.
Now, this can be an incompatible change that'll break some APIs if we just do it for everyone - would like to avoid that. I propose:
- We do this for AWS protocols always
- We enable it as opt-in in
SimpleRestJson - Later - we switch to opt-out in
SimpleRestJson, with a deprecated method - Even later - we remove the deprecated method
We could keep it forever, but since the spec says it's a MUST, I'd rather keep it consistent.
Bonus points - verify if our handling of queries is compliant.