Skip to content
This repository has been archived by the owner on Apr 23, 2023. It is now read-only.

MorpheusNephew/cloudfront-signed-files

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Signed Things

The purpose of this project is to test out signed cookies/urls.

Project interactions

Uploading a file

sequenceDiagram
    participant web
    participant api
    participant db
    participant cf as cloudfront
    participant s3

    web->>api: POST create file to upload
    api->>db: create file record in db
    db->>api: here's the file record
    api->>web: here is where you'll upload that file
    web->>cf: upload file
    cf->>s3: file is getting uploaded

Loading

Get all files

sequenceDiagram
    participant web
    participant api
    participant db
    participant cf as cloudfront
    participant s3

    web->>api: GET all files added
    api->>db: Give me all of the file records
    db->>api: Here are the file records
    api->>web: file records are retrieved

Loading

Implementation

App

Database

The database is just mongo db served from docker. It stores file records which consists of a unique id, name of the file, and it's location within S3

API

The API is an express server that handles all of the file interactions. It is also responsible for doing the signing of the file url in S3 so that it can be viewed.

Web

Infrastructure

The infrastructure was setup using terraform

S3

This S3 bucket was set up to be private and can only be accessed via Cloudfront

Cloudfront

Cloudfront was used to be the entry point to the S3 bucket and set up to use a signing group which is used to determine who can have access to those files.

About

Cloudfront signed urls/cookies

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published