Closed dunglas closed 1 year ago
Thanks for letting us know. I'd review a PR to implement this, but I don't have capacity to implement this at this time. Consider sponsoring me, which would allow me to allocate more time to OSS. I am spread across many OSS repos, including Guzzle.
This issue has been automatically marked as stale because there has been no recent activity. It will be closed after 30 days if no further activity occurs. Thank you for your contributions.
I discovered a potentially serious flaw while working on #309.
According to the API documentation,
PUT
has the following behavior for some types (load balancers, firewalls, and maybe others)The structure of APIs changes from time to time and new fields are added. These fields are not always (or immediately) supported by this library. This means that when calling
update()
, existing data (set through the UI for instance) may be deleted and replaced by the default values.Example of dangerous broken code:
The
size_unit
property is reset to its default value because it's not supported yet by this library.A safer approach would be to always store all retrieved properties through
GET
(even if currently unsupported by the library) in the entity (by creating dynamic properties, or storing them in a dedicated propAbstractEntity::$unsupportedProperty
), and include them in the JSON payload sent during aPUT
.