steve64 Is it possible to use the LuaRT API (e.g. Http:download) to download a PRIVATE file from an S3 object storage bucket? Somewhere I read that LuaRT does not support authentication for this method. Is it right? If so, why? Any solution?
Samir It's not possible even with other tools like Curl, python etc... You could generate an Amazon S3 pre-signed URL, which would allow a private object to be downloaded with the Http:download() method
steve64 With Supabase, I was successful in downloading a private file with curl from Windows using GET and an "Authorization" header with Bearer mode and a string key. I will try the same from LuaRT asap using Http:get(). But I suppose I have to save to a file after explicitely. What is different in Http:download() ? I'm also concerned about multi-part transfers...
Samir Http:download() can take in count the same Authorization process with header fields, it should work
steve64 So far not working. For instance, I have this command that works fine: curl --verbose -X GET "https://<myserver>/storage/v1/object/sign/demobucket/myfile.pdf?token=<mytoken>" ^ -o myfile.pdf but I'm not able to translate it to working LuaRT code...
Samir You are right, actually Http:download() don't permit to provide parameters as Http:get() method can do.
steve64 But just now I got a successful run ! I used Http:download() and the JWT access token, exactly as I wanted. The real issue was in finding proper Supabase RLS policies for enabling access to authenticated users.
steve64 Also uploading files with Http:post() is working! No special advice other than configuring properly select and insert DBMS policies. Passing JWT access token in Http object headers is working. Of course, this works with Supabase object storage API. I do not know for generic S3. I need Supabase authentication on files, so I'm not currently interested in plain S3.