s3store

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Feb 8, 2021 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type TokenStorage

type TokenStorage struct {
	S3     s3iface.S3API
	Bucket string
}

TokenStorage uses S3 as a simple backing store for a user's oauth tokens. Tokens are stored as json documents named by the user's id. This isn't the most secure option although it can be improved by enabling encryption and strictly limiting access to the S3 bucket. Due to S3's eventually consistent nature a Read may not always reflect the lastest tokens provided to Write.

func (*TokenStorage) Read

func (s *TokenStorage) Read(ctx context.Context, id string) (*oauth2.Token, error)

func (*TokenStorage) Write

func (s *TokenStorage) Write(ctx context.Context, id string, token *oauth2.Token) error

Jump to

Keyboard shortcuts

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