Skip to content
This repository has been archived by the owner on Nov 19, 2018. It is now read-only.

Amazon S3 SDK Version #5

Open
jacobkossman opened this issue Jan 2, 2017 · 9 comments
Open

Amazon S3 SDK Version #5

jacobkossman opened this issue Jan 2, 2017 · 9 comments

Comments

@jacobkossman
Copy link

jacobkossman commented Jan 2, 2017

  Problem 1
    - Installation request for fineuploader/php-s3-server 1.1.0 -> satisfiable by fineuploader/php-s3-server[1.1.0].
    - fineuploader/php-s3-server 1.1.0 requires aws/aws-sdk-php 2.* -> satisfiable by aws/aws-sdk-php[2.0.0, 2.0.1, 2.0.2, 2.0.3, 2.1.0, 2.1.1, 2.1.2, 2.2.0, 2.2.1, 2.3.0, 2.3.1, 2.3.2, 2.3.3, 2.3.4, 2.4.0, 2.4.1, 2.4.10, 2.4.11, 2.4.12, 2.4.2, 2.4.3, 2.4.4, 2.4.5, 2.4.6, 2.4.7, 2.4.8, 2.4.9, 2.5.0, 2.5.1, 2.5.2, 2.5.3, 2.5.4, 2.6.0, 2.6.1, 2.6.10, 2.6.11, 2.6.12, 2.6.13, 2.6.14, 2.6.15, 2.6.16, 2.6.2, 2.6.3, 2.6.4, 2.6.5, 2.6.6, 2.6.7, 2.6.8, 2.6.9, 2.7.0, 2.7.1, 2.7.10, 2.7.11, 2.7.12, 2.7.13, 2.7.14, 2.7.15, 2.7.16, 2.7.17, 2.7.18, 2.7.19, 2.7.2, 2.7.20, 2.7.21, 2.7.22, 2.7.23, 2.7.24, 2.7.25, 2.7.26, 2.7.27, 2.7.3, 2.7.4, 2.7.5, 2.7.6, 2.7.7, 2.7.8, 2.7.9, 2.8.0, 2.8.1, 2.8.10, 2.8.12, 2.8.13, 2.8.14, 2.8.15, 2.8.16, 2.8.17, 2.8.18, 2.8.19, 2.8.2, 2.8.20, 2.8.21, 2.8.22, 2.8.23, 2.8.24, 2.8.25, 2.8.26, 2.8.27, 2.8.28, 2.8.29, 2.8.3, 2.8.30, 2.8.31, 2.8.4, 2.8.5, 2.8.6, 2.8.7, 2.8.8, 2.8.9, 2.8.x-dev] but these conflict with your requirements or minimum-stability.

composer.json

{
    "require": {
        "aws/aws-sdk-php": "^3.20",
        "fineuploader/php-s3-server": "1.1.0"
    }
}

how can i use with aws-php-sdk v3+ and amazon v4 options? (locale, etc)

@rnicholus
Copy link
Member

If you want to use v3 or newer of the AWS SDK, I guess the project's composer.json file needs to be updated to support v2 and v3. Or if this is not possible, updated to support v3 and released as php-s3-server 2.0.

@jaredcassidy
Copy link

Just to let you know I will be trying my hand at this

From this guide:
https://docs.aws.amazon.com/aws-sdk-php/v3/guide/guide/migration.html

The region is now required, what would be the best way to handle this, default to 'us-east-1' and then override from $_ENV if the region is set?

@rnicholus
Copy link
Member

default to 'us-east-1' and then override from $_ENV if the region is set?

I guess we do need a sensible default. We'll always know the region for v4 signature requests, since that will be sent with the signature request. But for v2 signatures, guess we'll have to have a default set and allow for that to be overridden via an environment variable or perhaps a parameter/header in the HTTP request.

@jaredcassidy
Copy link

Also on the success callback to the endpoint the region wont be sent as there is no signature request
(required for verifyFileInS3)

I just stumbled apon getbucketlocation in the v3 SDK

Will reply with my results with getbucketlocation

@jaredcassidy
Copy link

Hiya

I have my endpoint working with the v3 sdk, I will commit later (after work) to my fork and link here so we can discuss any changes. I did need to add some params to uploadSucess to pass the region and signature version.

AFAIK there were no changes required to the signature section of endpoint.php, only for the success callback as this is where we use getS3Client

I am new to github so if you would like me to commit differently then let me know :)

@jaredcassidy
Copy link

Have updated endpoint.php on jaredcassidy/php-s3-server

my upload page params

request: {
                endpoint: 'https://mys3bucket.s3-eu-west-2.amazonaws.com',
                accessKey: 'xxxxx',
            },
            objectProperties: {
                region: 'eu-west-2',
                acl: "public-read"
            },
            signature: {
                endpoint: '/vendor/fineuploader/php-s3-server/endpoint.php',
                version: 4
            },
            uploadSuccess: {
                endpoint: '/vendor/fineuploader/php-s3-server/endpoint.php?success',
                params: {
                  region: 'eu-west-2',
                  version: 4
                  }

@rnicholus
Copy link
Member

Can you open up a pull request so we can discuss further?

@jaredcassidy
Copy link

Sorry for the delay, have opened pull request

#8

@araphiel
Copy link

araphiel commented Jun 26, 2018

Hey there @jaredcassidy & @rnicholus,

This is old news but instead of manually signing requests, why not use generate a presigned POST request using the AWS PHP SDK?

https://docs.aws.amazon.com/sdk-for-php/v3/developer-guide/s3-presigned-post.html

screen shot 2018-06-26 at 1 19 38 pm

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants