Bump to sdk aws go v2 at release v0.26.0...

Bump dependancies
Refactor / Fix aws to work with sdk-aws-go-v2 at release v0.26.0...
This commit is contained in:
Nicolas JUHEL
2020-09-30 13:04:47 +02:00
parent 47dc7f34ae
commit 94f90d7e22
38 changed files with 706 additions and 749 deletions

View File

@@ -3,39 +3,40 @@ package user
import (
"context"
"github.com/aws/aws-sdk-go-v2/service/iam"
"github.com/aws/aws-sdk-go-v2/service/s3"
"github.com/nabbar/golib/aws/helper"
"github.com/nabbar/golib/errors"
sdkiam "github.com/aws/aws-sdk-go-v2/service/iam"
sdkitp "github.com/aws/aws-sdk-go-v2/service/iam/types"
sdksss "github.com/aws/aws-sdk-go-v2/service/s3"
libhlp "github.com/nabbar/golib/aws/helper"
liberr "github.com/nabbar/golib/errors"
)
type client struct {
helper.Helper
iam *iam.Client
s3 *s3.Client
libhlp.Helper
iam *sdkiam.Client
s3 *sdksss.Client
}
type User interface {
List() (map[string]string, errors.Error)
Get(username string) (*iam.User, errors.Error)
Create(username string) errors.Error
Delete(username string) errors.Error
List() (map[string]string, liberr.Error)
Get(username string) (*sdkitp.User, liberr.Error)
Create(username string) liberr.Error
Delete(username string) liberr.Error
PolicyPut(policyDocument, policyName, username string) errors.Error
PolicyAttach(policyARN, username string) errors.Error
PolicyPut(policyDocument, policyName, username string) liberr.Error
PolicyAttach(policyARN, username string) liberr.Error
LoginCheck(username string) errors.Error
LoginCreate(username, password string) errors.Error
LoginDelete(username string) errors.Error
LoginCheck(username string) liberr.Error
LoginCreate(username, password string) liberr.Error
LoginDelete(username string) liberr.Error
AccessList(username string) (map[string]bool, errors.Error)
AccessCreate(username string) (string, string, errors.Error)
AccessDelete(username, accessKey string) errors.Error
AccessList(username string) (map[string]bool, liberr.Error)
AccessCreate(username string) (string, string, liberr.Error)
AccessDelete(username, accessKey string) liberr.Error
}
func New(ctx context.Context, bucket string, iam *iam.Client, s3 *s3.Client) User {
func New(ctx context.Context, bucket string, iam *sdkiam.Client, s3 *sdksss.Client) User {
return &client{
Helper: helper.New(ctx, bucket),
Helper: libhlp.New(ctx, bucket),
iam: iam,
s3: s3,
}