Skip to content

No support for S3-compatible object storage (e.g: Wasabi)? Getting STS related error when trying #171

Open
@rija

Description

@rija

Description

Hello,

we are trying to setup Craft assets to use Wasabi, which is a S3-compatible object storage service.
We have installed the aws-s3 plugin to that effect.
When we trigger the uploading of the asset we get an error

Error executing "GetSessionToken" on "https://sts.amazonaws.com"; AWS HTTP error: Client error: `POST https://sts.amazonaws.com` resulted in a `403 Forbidden` response: <ErrorResponse xmlns="https://sts.amazonaws.com/doc/2011-06-15/"> <Error> <Type>Sender</Type> <Code>InvalidCli (truncated...) InvalidClientTokenId (client): The security token included in the request is invalid.

Which kind of make sense given the connection details we are supplying are for a Wasabi S3 endpoint.

Being S3-compatible, Wasabi does support the STS related idioms like GetSessionToken

When reading the aws-s3 documentation, I didn't see any references on specifying endpoints, so the AWS ones are probably hard-coded.

Could you consider adding such support?
A lot of big object storage services offers an S3-compatible API and for organisations like us who do multi-cloud a lot, we benefit from that facility.

Best.

Steps to reproduce

  1. Configure aws-s3 with following values:
OBJECT_STORAGE_ENDPOINT="https://s3.ap-northeast-1.wasabisys.com/"
OBJECT_STORAGE_BUCKET="cms-assets"
OBJECT_STORAGE_KEY="xxxx"
OBJECT_STORAGE_SECRET_KEY="xxxxxxxxxx"
OBJECT_STORAGE_REGION="ap-northeast-1"
OBJECT_STORAGE_SUBPATH="/dev"
  1. Setup an asset that use the object storage file system
  2. Create an entry type that has an image field with an asset location set to the above asset
  3. Make a new entry, upload a file and save the form

Additional info

  • Craft version: 4.5.6.1
  • PHP version: 8.2.10
  • Database driver & version: PostgreSQL 15.4
  • Plugins & versions: Amazon S3 2.0.3

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions