gcsproxy

package module
v0.0.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 4, 2023 License: MIT Imports: 12 Imported by: 0

README

gcsproxy

HTTP Proxy for Goolge Cloud Storage.

Run on Google Cloud

Motivation

Cloud Load Balancing can use Identity Aware Proxy (IAP) to restrict access. IAPs can be applied to the Backend Service, but not to the Backend Bucket. Therefore, access to Google Cloud Storage (GCS) cannot be restricted using IAP.

To apply IAP to Google Cloud Storage, you must access Google Cloud Storage (GCS) via the Backend Service. Therefore, a Proxy to GCS acting as a Backend Service is required to restrict access for GCS.

Usage

Deploy the built docker image ghcr.io/karupanerura/gcsproxy:v0.0.3 to Cloud Run or any other services of Google Cloud Platform.

Environment Variables
  • GCS_PROXY_BUCKET: GCS bucket name. (required)
  • GCS_PROXY_PATH_PREFIX: URL path prefix. use it as GCS object key from URL path exclude the path prefix. (default: "/")
  • GCS_PROXY_INDEX_FILE: Index file name. (e.g. "index.html")
  • GCS_PROXY_NOT_FOUND_PATH: Path for not found error. (e.g. "/404.html")

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateHTTPHandler

func CreateHTTPHandler(ctx context.Context, config Config, opts ...Option) (http.Handler, error)

Types

type Config

type Config struct {
	BucketName   string
	PathPrefix   string
	IndexFile    string
	NotFoundPath string
	BufByteSize  int
}

type Option

type Option interface {
	// contains filtered or unexported methods
}

func WithClient

func WithClient(client *storage.Client) Option

Directories

Path Synopsis
cmd

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL