s3

package
v0.42.0 Latest Latest
Warning

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

Go to latest
Published: Mar 22, 2024 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrNoSuchResources = errors.New("no such resources found")
)

Functions

This section is empty.

Types

type BindParams

type BindParams struct {
	Permissions         string `json:"permissions"`
	AllowExternalAccess bool   `json:"allow_external_access"`
}

type BucketCredentials

type BucketCredentials struct {
	BucketName         string `json:"bucket_name"`
	AWSAccessKeyID     string `json:"aws_access_key_id"`
	AWSSecretAccessKey string `json:"aws_secret_access_key"`
	AWSRegion          string `json:"aws_region"`
	DeployEnvironment  string `json:"deploy_env"`
}

type Client

type Client interface {
	CreateBucket(provisionData provider.ProvisionData) error
	DeleteBucket(name string) error
	AddUserToBucket(bindData provider.BindData) (BucketCredentials, error)
	RemoveUserFromBucketAndDeleteUser(bindingID, bucketName string) error
}

type Config

type Config struct {
	AWSRegion              string `json:"aws_region"`
	ResourcePrefix         string `json:"resource_prefix"`
	IAMUserPath            string `json:"iam_user_path"`
	DeployEnvironment      string `json:"deploy_env"`
	IpRestrictionPolicyARN string `json:"iam_ip_restriction_policy_arn"`
	CommonUserPolicyARN    string `json:"iam_common_user_policy_arn"`
	PermissionsBoundaryARN string `json:"iam_user_permissions_boundary_arn"`
	Timeout                time.Duration
}

func NewS3ClientConfig

func NewS3ClientConfig(configJSON []byte) (*Config, error)

type ProvisionParams

type ProvisionParams struct {
	PublicBucket bool `json:"public_bucket"`
}

type S3Client

type S3Client struct {
	// contains filtered or unexported fields
}

func NewS3Client

func NewS3Client(
	config *Config,
	s3Client s3iface.S3API,
	iamClient iamiface.IAMAPI,
	logger lager.Logger,
	ctx context.Context,
) *S3Client

func (*S3Client) AddUserToBucket

func (s *S3Client) AddUserToBucket(bindData provider.BindData) (BucketCredentials, error)

func (*S3Client) CreateBucket

func (s *S3Client) CreateBucket(provisionData provider.ProvisionData) error

func (*S3Client) DeleteBucket

func (s *S3Client) DeleteBucket(name string) error

func (*S3Client) RemoveUserFromBucketAndDeleteUser

func (s *S3Client) RemoveUserFromBucketAndDeleteUser(bindingID, bucketName string) error

Directories

Path Synopsis
Code generated by counterfeiter.
Code generated by counterfeiter.

Jump to

Keyboard shortcuts

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