Browse Source

fix grpd dial option

pull/4857/head
chrislu 1 year ago
parent
commit
cf28108ea4
  1. 5
      weed/iamapi/iamapi_server.go
  2. 10
      weed/s3api/auto_signature_v4_test.go

5
weed/iamapi/iamapi_server.go

@ -52,7 +52,10 @@ func NewIamApiServer(router *mux.Router, option *IamServerOption) (iamApiServer
option: option,
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{
s3ApiConfig: s3ApiConfigure,
iam: s3api.NewIdentityAccessManagement(&s3Option),

10
weed/s3api/auto_signature_v4_test.go

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

Loading…
Cancel
Save