punchcard-cms / punchcard

The Punchcard CMS
Apache License 2.0
31 stars 19 forks source link

Core Developer: AWS S3 functionality #488

Open scottnath opened 7 years ago

scottnath commented 7 years ago

This is a technical story for the implementation of Amazon Web Services S3 into Punchcard.

Definitions

Feature: Uploads to S3
  As a core developer
  I want a way to upload files to S3
  So that we can use S3 as our file storage depot.

  Scenario: Handshake
    Given that content creator needs to upload files as content
      And that S3 must first check the veracity of a file before allowing an upload
     When a content creator submits a form with a file upload input
     Then Punchcard should attempt a `handshake` with S3
      And it should receive a response from S3
      And the response should be captured as a signed request.

  Scenario: Positive Handshake
    Given that a file upload has been sent to S3 in a `handshake`
     When S3 responds with a positive `handshake`
      And the signed request is captured
     Then Punchcard should create a unique name for the file
      And that name will be in uuid format
      And Punchcard should upload the file to S3 using the signed request
      And a url for the file should be generated
      And S3 storage should return the url of the file.

  Scenario: Negative Handshake
    Given that a file upload has been sent to S3 in a `handshake`
     When S3 responds with a negative `handshake`
     Then S3 storage should create an error
      And it should return this error.

Uploads to S3

Snugug commented 7 years ago

This will need to be rethought in light of storage plugins

Snugug commented 7 years ago
Snugug commented 7 years ago

Given https://github.com/punchcard-cms/punchcard/pull/529 can we mark this as resolved, without need for further action? No size, no milestone, just closed.

scottnath commented 7 years ago

We need a story to encompass setting up showing aws to work though

Snugug commented 7 years ago

I mean, do we? It's npm i vinyl-s3 --save and

  storage: {
    type: 's3', // set stype to S3
    dest: 's3://my-bucket/prefix', // straight from Vinyl S3
    settings: {}, // Vinyl S3 settings
    public: '{{dest}}', // or whatever they'd like
  },

with vinyl-s3

Snugug commented 7 years ago

That was the point of adopting Vinyl. Type is the Vinyl Adapter you want to use, dest is the standard Vinyl adapter dest, settings are vinyl adapter settings

scottnath commented 7 years ago

I understand the point, don't worry. I just want to not close this and say it's done without a working prototype or something to proves that aws actually connects to this. And for that we need a story to cover that POC (or whatever). It's also fine for that story to go into the backlog and not be done now, but we need to prove this works. Perhaps we could roll this into creating a deployable repo? Who knows...just please, don't close this without a plan (story) to show proof aws will work with Punchcard as it stands now.