1Password/connect-sdk-python

`download_file` function uses the wrong file UUID in the API route

hculea opened this issue · 0 comments

Starting with Connect 1.5.4, the file_id in the item representation is no longer the file ID, but the wrapping field's ID. (see the difference between the content_path's last token and the ID, in any item response that contains files).

The download_file function of the Python Client builds the API route itself, using this file ID and disregarding the content_path attribute. This makes the route broken, and a 404 is consistently returned, when calling this endpoint.

The fix should be rather simple: use the content_path, possibly similar to how the Go SDK does it (see https://github.com/1Password/connect-sdk-go/blob/main/connect/client.go#L552)