Skip to content

Commit

Permalink
Merge branch 'develop' into wip/radeusgd/9123-first-data-links
Browse files Browse the repository at this point in the history
# Conflicts:
#	distribution/lib/Standard/Base/0.0.0-dev/src/Enso_Cloud/Enso_File.enso
  • Loading branch information
radeusgd committed Mar 1, 2024
2 parents a316ca0 + b33802a commit 5bf71b3
Showing 1 changed file with 3 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -161,8 +161,7 @@ type Enso_File
with_input_stream : Vector File_Access -> (Input_Stream -> Any ! File_Error) -> Any ! File_Error | Illegal_Argument
with_input_stream self (open_options : Vector) action = if self.asset_type != Enso_Asset_Type.File then Error.throw (Illegal_Argument.Error "Only files can be opened as a stream.") else
if (open_options != [File_Access.Read]) then Error.throw (Illegal_Argument.Error "Files can only be opened for reading.") else
s3_url = get_download_url_for_file self
response = HTTP.fetch s3_url HTTP_Method.Get []
response = HTTP.fetch (get_download_url_for_file self) HTTP_Method.Get []
response.if_not_error <| response.body.with_stream action

## ALIAS load, open
Expand Down Expand Up @@ -360,7 +359,5 @@ get_file_description file:Enso_File -> JS_Object =
stored anywhere.
get_download_url_for_file file:Enso_File -> Text =
file_description = get_file_description file
## TODO migrate to the pre-signed URLs once that is implemented
presigned_url = file_description |> get_required_field "url"
path = file_description |> get_required_field "file" |> get_required_field "path"
path.replace "s3://production-enso-organizations-files/" "https://production-enso-organizations-files.s3.eu-west-1.amazonaws.com/"
presigned_url = file_description |> get_required_field "url"
presigned_url

0 comments on commit 5bf71b3

Please sign in to comment.