s3

package
v0.0.0-...-0637115 Latest Latest
Warning

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

Go to latest
Published: Apr 2, 2020 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RandStringBytes

func RandStringBytes(n int) string

Types

type S3

type S3 struct {
	S3Interfaces S3Interfacer
	// contains filtered or unexported fields
}

func (*S3) Description

func (x *S3) Description() string

func (*S3) Process

func (x *S3) Process(e transistor.Event) error

How does this work? A bucket is shared by other staging projects in order to create access for a new project to use this storage, we will need to generate an IAM user to use this new prefix for this bucket

We want to do this so that we can utilize the same bucket but isolate each applications logical access

The artifacts that should be returned after an S3 extension is successfuly created should be the credentials for which the project will be using to access the bucket, as well as the prefix that has been assigned for this application to use in addition to the region the bucket is in

Accepts:

aws_access_key_id			- Access to create users and update policies
aws_secret_key
aws_region					- The region of the bucket
aws_bucket_prefix			- Which bucket to be shared
aws_generated_user_prefix	- What should the IAM users be prefixed with
aws_user_group_name			- For organizational purposes, group users together to easily find later
aws_credentials_timeout		- How long should we wait to see if the IAM credentials were successfully created

func (*S3) SampleConfig

func (x *S3) SampleConfig() string

func (*S3) Start

func (x *S3) Start(e chan transistor.Event) error

func (*S3) Stop

func (x *S3) Stop()

func (*S3) Subscribe

func (x *S3) Subscribe() []string

type S3API

type S3API interface {
	PutObject(*s3.PutObjectInput) (*s3.PutObjectOutput, error)
	CreateBucket(*s3.CreateBucketInput) (*s3.CreateBucketOutput, error)
	ListBuckets(*s3.ListBucketsInput) (*s3.ListBucketsOutput, error)

	PutBucketTagging(*s3.PutBucketTaggingInput) (*s3.PutBucketTaggingOutput, error)
}

type S3Data

type S3Data struct {
	AWSAccessKeyID           string
	AWSSecretKey             string
	AWSRegion                string
	AWSBucketPrefix          string
	AWSGeneratedUserPrefix   string
	AWSGeneratedUserName     string
	AWSUserGroupName         string
	AWSCredentialsTimeout    int
	AWSBucketGeneratedSuffix string
}

type S3Interface

type S3Interface struct {
	IAMSvc IAMAPI
	S3Svc  S3API
}

func (*S3Interface) GetIAMServiceInterface

func (x *S3Interface) GetIAMServiceInterface(data *S3Data) IAMAPI

Provide IAM interface for mock/testing purposes

func (*S3Interface) GetS3ServiceInterface

func (x *S3Interface) GetS3ServiceInterface(data *S3Data, testingAccessKey *iam.AccessKey) S3API

Provide S3 interface for mock/testing purposes

func (*S3Interface) New

func (x *S3Interface) New() S3Interfacer

type S3Interfacer

type S3Interfacer interface {
	New() S3Interfacer
	GetIAMServiceInterface(*S3Data) IAMAPI
	GetS3ServiceInterface(*S3Data, *iam.AccessKey) S3API
}

Jump to

Keyboard shortcuts

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