key

package
v0.0.7 Latest Latest
Warning

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

Go to latest
Published: Apr 7, 2025 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateCredentials

func CreateCredentials(ctx context.Context, client UserCreator, user, group string) (accessKey, secretKey string, err error)

func CreatePolicy

func CreatePolicy(ctx context.Context, client PolicyCreator, canonicalUser, bucket string) error

func CreateUser

func CreateUser(ctx context.Context, client UserCreator, user, group string) (string, error)

func DeletePolicy

func DeletePolicy(ctx context.Context, client PolicyDeletor, canonicalUser, bucket string) error

func DeleteUser

func DeleteUser(ctx context.Context, client UserDeletor, user, group string) (string, error)

func GrantBucketAccess

func GrantBucketAccess(ctx context.Context, adminClient UserCreator, s3Client PolicyCreator, user, group, bucket string) (accessKey, secretKey string, err error)

Grant bucket access using keys

func RevokeBucketAccess

func RevokeBucketAccess(ctx context.Context, adminClient UserDeletor, s3Client PolicyDeletor, user, group, bucket string) error

Revoke bucket access using keys

Types

type PolicyCreator

type PolicyCreator interface {
	GetBucketPolicy(ctx context.Context, params *s3.GetBucketPolicyInput, optFns ...func(*s3.Options)) (*s3.GetBucketPolicyOutput, error)
	PutBucketPolicy(ctx context.Context, params *s3.PutBucketPolicyInput, optFns ...func(*s3.Options)) (*s3.PutBucketPolicyOutput, error)
}

type PolicyDeletor

type PolicyDeletor interface {
	GetBucketPolicy(ctx context.Context, params *s3.GetBucketPolicyInput, optFns ...func(*s3.Options)) (*s3.GetBucketPolicyOutput, error)
	DeleteBucketPolicy(ctx context.Context, params *s3.DeleteBucketPolicyInput, optFns ...func(*s3.Options)) (*s3.DeleteBucketPolicyOutput, error)
	PutBucketPolicy(ctx context.Context, params *s3.PutBucketPolicyInput, optFns ...func(*s3.Options)) (*s3.PutBucketPolicyOutput, error)
}

type UserCreator

type UserCreator interface {
	PutUser(ctx context.Context, body api.PutUserJSONRequestBody, reqEditors ...api.RequestEditorFn) (*http.Response, error)
	PutUserCredentialsWithResponse(ctx context.Context, params *api.PutUserCredentialsParams, reqEditors ...api.RequestEditorFn) (*api.PutUserCredentialsResponse, error)
}

type UserDeletor

type UserDeletor interface {
	GetUser(ctx context.Context, params *api.GetUserParams, reqEditors ...api.RequestEditorFn) (*http.Response, error)
	DeleteUser(ctx context.Context, params *api.DeleteUserParams, reqEditors ...api.RequestEditorFn) (*http.Response, error)
}

Jump to

Keyboard shortcuts

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