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

s3Client settings validation #112

Open
spawn-guy opened this issue Jan 5, 2015 · 2 comments
Open

s3Client settings validation #112

spawn-guy opened this issue Jan 5, 2015 · 2 comments

Comments

@spawn-guy
Copy link

Hello,
I've planned to use the "default" approach with configuring AWS
http://docs.aws.amazon.com/aws-sdk-php/guide/latest/quick-start.html#client-factory-method
they, basically, say that most of the options are "optional" or "replaceable".

but in \Codesleeve\Stapler\Validator->validateS3Options there are those checks.. that stop me from using key=null,secret=null. and, actually, they are not that much needed, if these keys are read from the environment. and if i already have a default AWS Instance.
i was thinking about using 's3_client_config' => null, to use the default config.

i think S3Client will throw an error if it was mis-configured. but stapler adds an additional level of validation.. so i must say: "These options will be NOT passed directly" but "validated and passed".

Is it possible to remove those validators?
or update them to the proper AWS implemented version?
any other ideas?

@tabennett
Copy link
Contributor

Yeah, think we can remove those validation checks. When I first wrote the S3 driver I had no idea you could even store your instance profile credentials like that (via AWS IAM). I'll see if about getting those removed. If you want to PR it you're more than welcome to.

@almunnings
Copy link

Also noting that the key and secret have moved into a credentials array for 3.0.x of SDK.
This is an annoyance now.

Workaround is to just leave the key and secret array keys as junk in the settings.

    's3_client_config' => [
        'region' => env('AWS_REGION', ''),
        'scheme' => 'https',
        'version' => 'latest',
        'timeout' => 30,
        'credentials' => array(
            'key' => env('AWS_KEY', ''),
            'secret' => env('AWS_SECRET', ''),
        ),
        // Legacy stapler support
        'key' => 'legacy',
        'secret' => 'legacy',
    ],

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