fix grpd dial option

This commit is contained in:
chrislu 2023-09-19 14:02:51 -07:00
parent 27af11f1e8
commit cf28108ea4
2 changed files with 12 additions and 3 deletions

View file

@ -52,7 +52,10 @@ func NewIamApiServer(router *mux.Router, option *IamServerOption) (iamApiServer
option: option, option: option,
masterClient: wdclient.NewMasterClient(option.GrpcDialOption, "", "iam", "", "", "", *pb.NewServiceDiscoveryFromMap(option.Masters)), masterClient: wdclient.NewMasterClient(option.GrpcDialOption, "", "iam", "", "", "", *pb.NewServiceDiscoveryFromMap(option.Masters)),
} }
s3Option := s3api.S3ApiServerOption{Filer: option.Filer} s3Option := s3api.S3ApiServerOption{
Filer: option.Filer,
GrpcDialOption: option.GrpcDialOption,
}
iamApiServer = &IamApiServer{ iamApiServer = &IamApiServer{
s3ApiConfig: s3ApiConfigure, s3ApiConfig: s3ApiConfigure,
iam: s3api.NewIdentityAccessManagement(&s3Option), iam: s3api.NewIdentityAccessManagement(&s3Option),

View file

@ -8,6 +8,8 @@ import (
"encoding/hex" "encoding/hex"
"errors" "errors"
"fmt" "fmt"
"google.golang.org/grpc"
"google.golang.org/grpc/credentials/insecure"
"io" "io"
"net/http" "net/http"
"net/url" "net/url"
@ -58,7 +60,9 @@ func TestIsRequestPresignedSignatureV4(t *testing.T) {
// Tests is requested authenticated function, tests replies for s3 errors. // Tests is requested authenticated function, tests replies for s3 errors.
func TestIsReqAuthenticated(t *testing.T) { func TestIsReqAuthenticated(t *testing.T) {
option := S3ApiServerOption{} option := S3ApiServerOption{
GrpcDialOption: grpc.WithTransportCredentials(insecure.NewCredentials()),
}
iam := NewIdentityAccessManagement(&option) iam := NewIdentityAccessManagement(&option)
iam.identities = []*Identity{ iam.identities = []*Identity{
{ {
@ -94,7 +98,9 @@ func TestIsReqAuthenticated(t *testing.T) {
} }
func TestCheckAdminRequestAuthType(t *testing.T) { func TestCheckAdminRequestAuthType(t *testing.T) {
option := S3ApiServerOption{} option := S3ApiServerOption{
GrpcDialOption: grpc.WithTransportCredentials(insecure.NewCredentials()),
}
iam := NewIdentityAccessManagement(&option) iam := NewIdentityAccessManagement(&option)
iam.identities = []*Identity{ iam.identities = []*Identity{
{ {