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

Doesn't work on Laravel Vapor #8

Open
l4nos opened this issue May 8, 2022 · 5 comments
Open

Doesn't work on Laravel Vapor #8

l4nos opened this issue May 8, 2022 · 5 comments

Comments

@l4nos
Copy link

l4nos commented May 8, 2022

For some reason this isn't working on Laravel Vapor

The below error occurs during bucket creation:

{ "message": "Error: The authorization header is malformed; a non-empty Access Key (AKID) must be provided in the credential.", "context": { "aws_request_id": "e16b9054-cf45-58fb-aead-cab8f3dca600" }, "level": 400, "level_name": "ERROR", "channel": "staging", "datetime": "2022-05-04T08:33:44.397223+00:00", "extra": {} }

@l4nos
Copy link
Author

l4nos commented May 8, 2022

config('filesystems.disks.s3.key') returns null when creating the bucket. Tested via console command. Works on local server but not on Vapor.

@l4nos
Copy link
Author

l4nos commented May 8, 2022

$this->credentials = $credentials ?? new Credentials( config('filesystems.disks.s3.key'), config('filesystems.disks.s3.secret') );

Needs to change to

$this->credentials = $credentials ?? CredentialProvider::env();

In tenant-buckets\src\Bucket.php

@secrethash
Copy link
Contributor

I haven't yet had a chance to use it with Laravel Vapor yet. A pull request is always welcome 😁

Note: Do test for Laravel Vapor before creating a pull request. It would really be appreciated.

@l4nos
Copy link
Author

l4nos commented Aug 21, 2022

I'm currently using my version on 3 different laravel vapor instances. Working a charm. I have changed the namespace to my own, and also made a few other changes such as setting appropriate CORS permissions on buckets (as on serverless you have to stream large files to S3 which requires adequate CORS permissions set).

Happy to do a merge or branch this off to my own package, as I have further changes to make which kind of make this more of a specialist package for Vapor users.

Let me know your thoughts.

@msucevan
Copy link

I'm currently using my version on 3 different laravel vapor instances. Working a charm. I have changed the namespace to my own, and also made a few other changes such as setting appropriate CORS permissions on buckets (as on serverless you have to stream large files to S3 which requires adequate CORS permissions set).

Happy to do a merge or branch this off to my own package, as I have further changes to make which kind of make this more of a specialist package for Vapor users.

Let me know your thoughts.

Can you please create a PR if you have a working solution? Many thanks!

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

3 participants