mirror of
https://github.com/versity/versitygw.git
synced 2026-08-20 14:16:28 +00:00
feat: IAM config service from backend, created a new interface
This commit is contained in:
@@ -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)
|
||||
}
|
||||
@@ -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"
|
||||
|
||||
Reference in New Issue
Block a user