website logo
Create accountLogin
Home
DCS
Node
Resources
Help center
Navigate through spaces
Home
DCS
Node
Resources
Help center
⌘K
Storj DCS
Get Started
AWS CLI and Hosted Gateway MT
AWS SDK and Hosted Gateway MT
Uplink CLI
Satellite Admin Console
Object Browser
Downloads
Download Uplink CLI
Download Self-hosted S3 Compatible Gateway
Download Storj Client Libraries
SDKs & Reference
Tutorial
How-to Guides
Concepts
Support
Support Overview
FAQ
Community Forum
Status Page
Help Desk
Billing, Payment & Accounts
Resources
Moved Documents
Docs powered by archbee 
8min

Presigned URLs in the serverless cloud

This document will guide you through the process of creating presigned URLs in a serverless cloud environment using the Go programming language. Most applications will need some secure, server-side logic to enforce access-control.  Usually, though, the “goldilocks size” for infrastructure is as little as possible.  A minimum viable security solution would do well to be stateless. Presigned URLs work well here because they are inherently time limited, and thus not typically tracked (For more info see www.storj.io/blog/how-developers-can-easily-connect-storj-to-compute-for-presigned-urls)

Prerequisites

  • Basic knowledge of Go programming language
  • Storj account with S3 compatible (gateway) credentials
  • A cloud platform account with access to serverless functions (e.g., AWS Lambda, Google Cloud Functions)

Setting Up the Go Environment

  1. Install Go: Download and install the latest version of Go from the official website: https://golang.org/dl/
  2. Set up your Go workspace: Follow the official Go documentation to set up your Go workspace: https://golang.org/doc/code.html

Presigning URLs via Amazon Lambda

Create a new Go file main.go and import the necessary packages (e.g. run go get -u)

go
|


While Amazon has quite the variety of methods to deploy code to Lambda, this example showcases the most primitive and explicit method, using the aws cli tool.

deploy.sh

Shell
|


trust-policy.json

JSON
|


Presigning URLs via Google Cloud Functions

Create a new Go file main.go and import the necessary packages (e.g. run go get -u)

Go
|


deploy.sh

Shell
|




Updated 17 Mar 2023
Did this page help you?
Yes
No
UP NEXT
Web Hosting
Docs powered by archbee 
TABLE OF CONTENTS
Prerequisites
Setting Up the Go Environment
Presigning URLs via Amazon Lambda
Presigning URLs via Google Cloud Functions