- Summary
When we update an Identity instance from Netlify's API, we first get the identity instance from gotrue, then merge in any updates, and finally send the merged instance back to gotrue to replace the original.
This PR changes the instance update handler to merge the existing instance configuration with the request parameters. Fields can be explicitly unset by including the field's zero value (eg an empty string) in the json request body instead of omitting the key.
- Test plan
Added test that show
updating other fields on the Instance doesn't erase the password
password can be erased by passing password: "" in the request body
- Description for the changelog
Allow partial update of Instance fields in the Instance update handler.
- A picture of a cute animal (not mandatory but encouraged)
- Summary When we update an Identity instance from Netlify's API, we first get the identity instance from gotrue, then merge in any updates, and finally send the merged instance back to gotrue to replace the original.
This is problematic because gotrue no longer serializes the instance's SMTP password field (https://github.com/netlify/gotrue/pull/227).
This PR changes the instance update handler to merge the existing instance configuration with the request parameters. Fields can be explicitly unset by including the field's zero value (eg an empty string) in the json request body instead of omitting the key.
- Test plan Added test that show
Instance
doesn't erase the passwordpassword: ""
in the request body- Description for the changelog Allow partial update of Instance fields in the Instance update handler.
- A picture of a cute animal (not mandatory but encouraged)![snowcat](https://user-images.githubusercontent.com/1887071/90580722-68498900-e17e-11ea-82f5-e55db774ffbf.jpg)