diff --git a/backend/auth/iam.go b/backend/auth/iam.go new file mode 100644 index 0000000..0e5bc4f --- /dev/null +++ b/backend/auth/iam.go @@ -0,0 +1,23 @@ +package auth + +import "github.com/versity/scoutgw/s3err" + +type IAMConfig struct { + AccessAccounts map[string]string +} + +type IAMService interface { + GetIAMConfig() (*IAMConfig, error) +} + +type IAMServiceUnsupported struct{} + +var _ IAMService = &IAMServiceUnsupported{} + +func New() IAMService { + return &IAMServiceUnsupported{} +} + +func (IAMServiceUnsupported) GetIAMConfig() (*IAMConfig, error) { + return nil, s3err.GetAPIError(s3err.ErrNotImplemented) +} diff --git a/backend/backend.go b/backend/backend.go index c757336..70db993 100644 --- a/backend/backend.go +++ b/backend/backend.go @@ -13,7 +13,6 @@ import ( //go:generate moq -out ../s3api/controllers/backend_moq_test.go -pkg controllers . Backend type Backend interface { fmt.Stringer - GetIAMConfig() ([]byte, error) Shutdown() ListBuckets() (*s3.ListBucketsOutput, error) @@ -58,10 +57,6 @@ var _ Backend = &BackendUnsupported{} func New() Backend { return &BackendUnsupported{} } - -func (BackendUnsupported) GetIAMConfig() ([]byte, error) { - return nil, fmt.Errorf("not supported") -} func (BackendUnsupported) Shutdown() {} func (BackendUnsupported) String() string { return "Unsupported"