elasticio / sftp-component

SFTP component for the elastic.io platform
Apache License 2.0
2 stars 3 forks source link

migrate attachment creation process to v2 #9

Closed khanzadyan closed 5 years ago

khanzadyan commented 6 years ago

During the creation of signed URL the component is still using the methods inv1 since it is referencing the elasticio-rest-node where the v1 is used: https://github.com/elasticio/elasticio-rest-node/blob/master/lib/client.js

The sftp attachment creation routines are here: https://github.com/elasticio/sftp-component/blob/master/lib/attachments.js

khanzadyan commented 6 years ago

@drobiazko and @zubairov not sure if this is component team job or something which should go into the platform development efforts.

ShkarupaNick commented 6 years ago

@zubairov
in API v1 "Create a signed url" operation use endpoint https://api.elastic.io/v1/resources/s3/signed-url while API v2 use endpoint https://api.elastic.io/v2/resources/storage/signed-url

What action I should to do? fix code in elasticio-rest-node (change logic of createSignedUrl() function to call v2 api) or make some new function in sftp-component which will work with v2 API??

any other idea?

zubairov commented 6 years ago

@khanzadyan thoughts? ⬆️

zubairov commented 6 years ago

@ShkarupaNick IMO we need to preserve current functionality as is but migrate the code to use v2 instead of v1

khanzadyan commented 6 years ago

@zubairov IMHO the client should not know about the used version of API. When they use the attachment in SFTP they are not particularly calling any resource on their own, our component does.

So what is the point of using the soon to be deprecated resource?

zubairov commented 5 years ago

@ShkarupaNick is it still open or can we close it?