Skip to content

Adjust URL-encoding rules #1663

@kubukoz

Description

@kubukoz

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:

  1. We do this for AWS protocols always
  2. We enable it as opt-in in SimpleRestJson
  3. Later - we switch to opt-out in SimpleRestJson, with a deprecated method
  4. 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.

Metadata

Metadata

Assignees

Labels

AWS supportIssues related to AWS support

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions