Skip to content
This repository has been archived by the owner on May 16, 2023. It is now read-only.

Add default serialization for cookies in Custom Authorizer v2 Request #123

Merged
merged 1 commit into from
Oct 27, 2022

Conversation

themmes
Copy link
Contributor

@themmes themmes commented Oct 27, 2022

Context

When testing my CustomAuthorizer I got the missing 'cookies' field parsing error. It seems to be a required attribute without default setting, however it is not (always) provided by API Gateway.

Changes

  • Added the serde default annotation to let Serde assume an empty cookie Vec in case the cookie attribute is not part of the request
  • Added an example json without the cookie attribute
  • Added a test for an example request json without the cookie attribute
  • Fixed the test above that implied (the test function name) to be testing the same struct, but was actually using a different struct within the test

I hope this PR adds value, let me know if it raises any questions!

@calavera
Copy link
Owner

Thanks a lot for this fix! 🙌

@calavera calavera merged commit 6e0a79e into calavera:master Oct 27, 2022
@themmes
Copy link
Contributor Author

themmes commented Oct 27, 2022

You're very welcome, the project has been very useful so far!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants