/secure-file-storage

Proof of concept to demonstrate secure file uploads to S3 compatible storage

Primary LanguageJavaScript

secure-file-storage

Maintainability Test Coverage

Running the App Locally

docker-compose up

containers:

name description url
localstack/s3 localstack S3 service http://localhost:4566
secure-file-storage-api s3 api gateway http://localhost:8056/store

Initial Setup

Install the AWS CLI.

run

aws configure

AWS Access Key ID [None]: 123
AWS Secret Access Key [None]: xyz
Default region name [None]: 
Default output format [None]: 

Create a bucket using the gateway

aws --endpoint-url=http://localhost:8056/store s3 mb s3://demo-bucket

Attach an ACL to the bucket so it is readable:

aws --endpoint-url=http://localhost:8056/store s3api put-bucket-acl --bucket demo-bucket --acl public-read

go to http://localhost:8055 to check that the bucket has been created

dashboard-1

Upload a new file using postman collection

Select Upload a file request, go to body and click Select File

once you have uploaded your file (you should get a 200)

Select Get image request and execute.

You should see your image in postman

Source: