Skip to content

AWS S3 ACL and Scheme settings?  #118

Open

Description

@timReynolds

Is anyone using the AWS S3 adaptor with ACL set to anything other than the default? When trying to use it with something like authenticated-read I don't get a signed response back. This seems to be down to the fact the following code doesn't specify an expiry;

    /**
     * Return the url for a file upload.
     *
     * @param  string $styleName
     * @return string
     */
    public function url($styleName)
    {
        return $this->s3Client->getObjectUrl($this->attachedFile->s3_object_config['Bucket'], $this->path($styleName));
    }

Which based on my reading of the AWS docs is needed to get a pre-signed url which I believe is needed for anything other than public read.

Has anyone else had this issue? More than happy to make the required changes but wasn't convinced I correctly understood the code base.

Activity

  1. timReynolds commented on Jan 27, 2015

    @timReynolds
    Author

    For reference the S3 client method logic is;

        public function getObjectUrl($bucket, $key, $expires = null, array $args = array())
        {
            $command = $this->getCommand('GetObject', $args + array('Bucket' => $bucket, 'Key' => $key));
            if ($command->hasKey('Scheme')) {
                $scheme = $command['Scheme'];
                $request = $command->remove('Scheme')->prepare()->setScheme($scheme)->setPort(null);
            } else {
                $request = $command->prepare();
            }
            return $expires ? $this->createPresignedUrl($request, $expires) : $request->getUrl();
        }
    
  2. Dylan-Buth commented on May 24, 2016

    @Dylan-Buth

    @flaxandteal Did you ever create that pull request? Maybe I'm missing it but I can't find a way to display the private PDF on s3 to the user.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions