silverstripe / silverstripe-s3

Silverstripe module to store assets in S3 rather than on the local filesystem (SS4/SS5 only)
BSD 3-Clause "New" or "Revised" License
20 stars 25 forks source link

Using ECS, cannot see preview #46

Closed bendubuisson closed 3 years ago

bendubuisson commented 3 years ago

There seems to be an issue with the preview link generated:

<Code>SignatureDoesNotMatch</Code>
<Message>
The request signature we calculated does not match the signature you provided. Check your key and signing method.
</Message>

Instance has all access to S3, as it can write etc, so it's somehow the generated link for preview that has a problem.

It seems that error message is quite cryptic and could be a range of things...

I rely on policies to access S3, so I have not explicitly set keys, my next step is to try that. Every other Action works though which is why it's weird...

obj63mc commented 3 years ago

I would check out issue #33 and #43 as those should cover what you need. Essentially the preview links add a version ID to the query string which will break a signed request to view a protected asset

bendubuisson commented 3 years ago

@obj63mc ha that makes a lot of sense as I was able to acces signed requests of protected assets when using AbsoluteLink, will check it out thanks!

Shouldn't that be fixed in 1.1.0 though?

bendubuisson commented 3 years ago

So I confirmed it is due to the vid= appended to the image, but I thought that was fixed in 1.1.0?

obj63mc commented 3 years ago

With our 1.1.0 we just set the default config values to not bust cache in asset admin in _config/assetadmin.yml. It would depend on what version of asset admin you are using whether the config value would actually work or not. If you are on the latest version then I would request that https://github.com/silverstripe/silverstripe-asset-admin/issues/1026 be reopened

bendubuisson commented 3 years ago

Fixed with silverstripe/asset-admin 1.8 and

SilverStripe\AssetAdmin\Controller\AssetAdmin:
  bust_cache: false

Thank you!

Should it be part of the doc?

Cheers