Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

signed url for a s3 file that will return to api response #28

Open
UsamaKhan-hub opened this issue Feb 21, 2023 · 0 comments
Open

signed url for a s3 file that will return to api response #28

UsamaKhan-hub opened this issue Feb 21, 2023 · 0 comments

Comments

@UsamaKhan-hub
Copy link

UsamaKhan-hub commented Feb 21, 2023

Trying to upload enc files on s3 and retrieving them to create a signed url for the response to an API to access them from s3.
What i have achieved so far is :

Files are being uploaded to s3 as (.enc) even if i use streamDownload and decrypt file , saves it, it's working perfectly.

1- I am trying to get a singed url for a file that will return to api response , which is i am getting correctly using :
$command = $client->getCommand('GetObject', [ 'Bucket' => $bucket, 'Key' => **FileVault::disk('s3')->decrypt($key),** ]); $request = $client->createPresignedRequest($command, '+20 minutes'); $presignedUrl = (string)$request->getUri();
It is working fine if i put path of a normal file to key but when i try to decrypt it as well it says :

"message": "Found 1 error while validating the input provided for the GetObject operation:\n[Key] must be a string or an object that implements __toString(). Found object(SoareCostin\FileVault\FileVault)",

If you could guide me @soarecostin . Bundle of thanks already for this wonderful package.

@UsamaKhan-hub UsamaKhan-hub changed the title By decrypting files changed the (.enc) type of a file on s3 By decrypting files, (.enc) extention gets removed of that file on s3 Feb 21, 2023
@UsamaKhan-hub UsamaKhan-hub changed the title By decrypting files, (.enc) extention gets removed of that file on s3 signed url for a s3 file that will return to api response Feb 21, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant