Skip to content

Commit

Permalink
pkg/pool clients: add ca_certfile and client_recv_msg_size
Browse files Browse the repository at this point in the history
  • Loading branch information
amalthundiyil committed May 2, 2022
1 parent 54dd3ea commit 5f20c8a
Show file tree
Hide file tree
Showing 23 changed files with 149 additions and 0 deletions.
8 changes: 8 additions & 0 deletions internal/grpc/services/gateway/applicationauth.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@ func (s *svc) GenerateAppPassword(
pool.Endpoint(s.c.ApplicationAuthEndpoint),
pool.Insecure(s.c.Insecure),
pool.SkipVerify(s.c.SkipVerify),
pool.CACertFile(s.c.CACertFile),
pool.MaxCallRecvMsgSize(s.c.MaxCallRecvMsgSize),
)
if err != nil {
err = errors.Wrap(err, "gateway: error calling GetAppAuthProviderServiceClient")
Expand All @@ -59,6 +61,8 @@ func (s *svc) ListAppPasswords(
pool.Endpoint(s.c.ApplicationAuthEndpoint),
pool.Insecure(s.c.Insecure),
pool.SkipVerify(s.c.SkipVerify),
pool.CACertFile(s.c.CACertFile),
pool.MaxCallRecvMsgSize(s.c.MaxCallRecvMsgSize),
)
if err != nil {
err = errors.Wrap(err, "gateway: error calling GetAppAuthProviderServiceClient")
Expand All @@ -83,6 +87,8 @@ func (s *svc) InvalidateAppPassword(
pool.Endpoint(s.c.ApplicationAuthEndpoint),
pool.Insecure(s.c.Insecure),
pool.SkipVerify(s.c.SkipVerify),
pool.CACertFile(s.c.CACertFile),
pool.MaxCallRecvMsgSize(s.c.MaxCallRecvMsgSize),
)
if err != nil {
err = errors.Wrap(err, "gateway: error calling GetAppAuthProviderServiceClient")
Expand All @@ -107,6 +113,8 @@ func (s *svc) GetAppPassword(
pool.Endpoint(s.c.ApplicationAuthEndpoint),
pool.Insecure(s.c.Insecure),
pool.SkipVerify(s.c.SkipVerify),
pool.CACertFile(s.c.CACertFile),
pool.MaxCallRecvMsgSize(s.c.MaxCallRecvMsgSize),
)
if err != nil {
err = errors.Wrap(err, "gateway: error calling GetAppAuthProviderServiceClient")
Expand Down
4 changes: 4 additions & 0 deletions internal/grpc/services/gateway/appprovider.go
Original file line number Diff line number Diff line change
Expand Up @@ -214,6 +214,8 @@ func (s *svc) openLocalResources(ctx context.Context, ri *storageprovider.Resour
pool.Endpoint(provider.Address),
pool.Insecure(s.c.Insecure),
pool.SkipVerify(s.c.SkipVerify),
pool.CACertFile(s.c.CACertFile),
pool.MaxCallRecvMsgSize(s.c.MaxCallRecvMsgSize),
)
if err != nil {
return nil, errors.Wrap(err, "gateway: error calling GetAppProviderClient")
Expand Down Expand Up @@ -242,6 +244,8 @@ func (s *svc) findAppProvider(
pool.Endpoint(s.c.AppRegistryEndpoint),
pool.Insecure(s.c.Insecure),
pool.SkipVerify(s.c.SkipVerify),
pool.CACertFile(s.c.CACertFile),
pool.MaxCallRecvMsgSize(s.c.MaxCallRecvMsgSize),
)
if err != nil {
err = errors.Wrap(err, "gateway: error getting appregistry client")
Expand Down
12 changes: 12 additions & 0 deletions internal/grpc/services/gateway/appregistry.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@ func (s *svc) GetAppProviders(
pool.Endpoint(s.c.AppRegistryEndpoint),
pool.Insecure(s.c.Insecure),
pool.SkipVerify(s.c.SkipVerify),
pool.CACertFile(s.c.CACertFile),
pool.MaxCallRecvMsgSize(s.c.MaxCallRecvMsgSize),
)
if err != nil {
err = errors.Wrap(err, "gateway: error calling GetAppRegistryClient")
Expand All @@ -59,6 +61,8 @@ func (s *svc) AddAppProvider(
pool.Endpoint(s.c.AppRegistryEndpoint),
pool.Insecure(s.c.Insecure),
pool.SkipVerify(s.c.SkipVerify),
pool.CACertFile(s.c.CACertFile),
pool.MaxCallRecvMsgSize(s.c.MaxCallRecvMsgSize),
)
if err != nil {
err = errors.Wrap(err, "gateway: error calling GetAppRegistryClient")
Expand All @@ -83,6 +87,8 @@ func (s *svc) ListAppProviders(
pool.Endpoint(s.c.AppRegistryEndpoint),
pool.Insecure(s.c.Insecure),
pool.SkipVerify(s.c.SkipVerify),
pool.CACertFile(s.c.CACertFile),
pool.MaxCallRecvMsgSize(s.c.MaxCallRecvMsgSize),
)
if err != nil {
err = errors.Wrap(err, "gateway: error calling GetAppRegistryClient")
Expand All @@ -107,6 +113,8 @@ func (s *svc) ListSupportedMimeTypes(
pool.Endpoint(s.c.AppRegistryEndpoint),
pool.Insecure(s.c.Insecure),
pool.SkipVerify(s.c.SkipVerify),
pool.CACertFile(s.c.CACertFile),
pool.MaxCallRecvMsgSize(s.c.MaxCallRecvMsgSize),
)
if err != nil {
err = errors.Wrap(err, "gateway: error calling GetAppRegistryClient")
Expand All @@ -131,6 +139,8 @@ func (s *svc) GetDefaultAppProviderForMimeType(
pool.Endpoint(s.c.AppRegistryEndpoint),
pool.Insecure(s.c.Insecure),
pool.SkipVerify(s.c.SkipVerify),
pool.CACertFile(s.c.CACertFile),
pool.MaxCallRecvMsgSize(s.c.MaxCallRecvMsgSize),
)
if err != nil {
err = errors.Wrap(err, "gateway: error calling GetAppRegistryClient")
Expand All @@ -155,6 +165,8 @@ func (s *svc) SetDefaultAppProviderForMimeType(
pool.Endpoint(s.c.AppRegistryEndpoint),
pool.Insecure(s.c.Insecure),
pool.SkipVerify(s.c.SkipVerify),
pool.CACertFile(s.c.CACertFile),
pool.MaxCallRecvMsgSize(s.c.MaxCallRecvMsgSize),
)
if err != nil {
err = errors.Wrap(err, "gateway: error calling GetAppRegistryClient")
Expand Down
4 changes: 4 additions & 0 deletions internal/grpc/services/gateway/authprovider.go
Original file line number Diff line number Diff line change
Expand Up @@ -228,6 +228,8 @@ func (s *svc) findAuthProvider(ctx context.Context, authType string) (authpb.Pro
pool.Endpoint(s.c.AuthRegistryEndpoint),
pool.Insecure(s.c.Insecure),
pool.SkipVerify(s.c.SkipVerify),
pool.CACertFile(s.c.CACertFile),
pool.MaxCallRecvMsgSize(s.c.MaxCallRecvMsgSize),
)
if err != nil {
err = errors.Wrap(err, "gateway: error getting auth registry client")
Expand All @@ -248,6 +250,8 @@ func (s *svc) findAuthProvider(ctx context.Context, authType string) (authpb.Pro
pool.Endpoint(res.Providers[0].Address),
pool.Insecure(s.c.Insecure),
pool.SkipVerify(s.c.SkipVerify),
pool.CACertFile(s.c.CACertFile),
pool.MaxCallRecvMsgSize(s.c.MaxCallRecvMsgSize),
)
if err != nil {
err = errors.Wrap(err, "gateway: error getting an auth provider client")
Expand Down
2 changes: 2 additions & 0 deletions internal/grpc/services/gateway/authregistry.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,8 @@ func (s *svc) ListAuthProviders(
pool.Endpoint(s.c.AuthRegistryEndpoint),
pool.Insecure(s.c.Insecure),
pool.SkipVerify(s.c.SkipVerify),
pool.CACertFile(s.c.CACertFile),
pool.MaxCallRecvMsgSize(s.c.MaxCallRecvMsgSize),
)
if err != nil {
err = errors.Wrap(err, "gateway: error getting auth registry client")
Expand Down
10 changes: 10 additions & 0 deletions internal/grpc/services/gateway/datatx.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@ func (s *svc) PullTransfer(ctx context.Context, req *datatx.PullTransferRequest)
pool.Endpoint(s.c.DataTxEndpoint),
pool.Insecure(s.c.Insecure),
pool.SkipVerify(s.c.SkipVerify),
pool.CACertFile(s.c.CACertFile),
pool.MaxCallRecvMsgSize(s.c.MaxCallRecvMsgSize),
)
if err != nil {
err = errors.Wrap(err, "gateway: error calling GetDataTxClient")
Expand All @@ -56,6 +58,8 @@ func (s *svc) GetTransferStatus(
pool.Endpoint(s.c.DataTxEndpoint),
pool.Insecure(s.c.Insecure),
pool.SkipVerify(s.c.SkipVerify),
pool.CACertFile(s.c.CACertFile),
pool.MaxCallRecvMsgSize(s.c.MaxCallRecvMsgSize),
)
if err != nil {
err = errors.Wrap(err, "gateway: error calling GetDataTxClient")
Expand All @@ -80,6 +84,8 @@ func (s *svc) CancelTransfer(
pool.Endpoint(s.c.DataTxEndpoint),
pool.Insecure(s.c.Insecure),
pool.SkipVerify(s.c.SkipVerify),
pool.CACertFile(s.c.CACertFile),
pool.MaxCallRecvMsgSize(s.c.MaxCallRecvMsgSize),
)
if err != nil {
err = errors.Wrap(err, "gateway: error calling GetDataTxClient")
Expand All @@ -104,6 +110,8 @@ func (s *svc) ListTransfers(
pool.Endpoint(s.c.DataTxEndpoint),
pool.Insecure(s.c.Insecure),
pool.SkipVerify(s.c.SkipVerify),
pool.CACertFile(s.c.CACertFile),
pool.MaxCallRecvMsgSize(s.c.MaxCallRecvMsgSize),
)
if err != nil {
err = errors.Wrap(err, "gateway: error calling GetDataTxClient")
Expand All @@ -128,6 +136,8 @@ func (s *svc) RetryTransfer(
pool.Endpoint(s.c.DataTxEndpoint),
pool.Insecure(s.c.Insecure),
pool.SkipVerify(s.c.SkipVerify),
pool.CACertFile(s.c.CACertFile),
pool.MaxCallRecvMsgSize(s.c.MaxCallRecvMsgSize),
)
if err != nil {
err = errors.Wrap(err, "gateway: error calling GetDataTxClient")
Expand Down
2 changes: 2 additions & 0 deletions internal/grpc/services/gateway/gateway.go
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,8 @@ type config struct {
EtagCacheTTL int `mapstructure:"etag_cache_ttl"`
AllowedUserAgents map[string][]string `mapstructure:"allowed_user_agents"` // map[path][]user-agent
CreateHomeCacheTTL int `mapstructure:"create_home_cache_ttl"`
CACertFile string `mapstructure:"ca_certfile"`
MaxCallRecvMsgSize int `mapstructure:"client_recv_msg_size"`
Insecure bool `mapstructure:"insecure"`
SkipVerify bool `mapstructure:"skip_verify"`
}
Expand Down
10 changes: 10 additions & 0 deletions internal/grpc/services/gateway/groupprovider.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@ func (s *svc) GetGroup(ctx context.Context, req *group.GetGroupRequest) (*group.
pool.Endpoint(s.c.GroupProviderEndpoint),
pool.Insecure(s.c.Insecure),
pool.SkipVerify(s.c.SkipVerify),
pool.CACertFile(s.c.CACertFile),
pool.MaxCallRecvMsgSize(s.c.MaxCallRecvMsgSize),
)
if err != nil {
return &group.GetGroupResponse{
Expand All @@ -55,6 +57,8 @@ func (s *svc) GetGroupByClaim(
pool.Endpoint(s.c.GroupProviderEndpoint),
pool.Insecure(s.c.Insecure),
pool.SkipVerify(s.c.SkipVerify),
pool.CACertFile(s.c.CACertFile),
pool.MaxCallRecvMsgSize(s.c.MaxCallRecvMsgSize),
)
if err != nil {
return &group.GetGroupByClaimResponse{
Expand All @@ -75,6 +79,8 @@ func (s *svc) FindGroups(ctx context.Context, req *group.FindGroupsRequest) (*gr
pool.Endpoint(s.c.GroupProviderEndpoint),
pool.Insecure(s.c.Insecure),
pool.SkipVerify(s.c.SkipVerify),
pool.CACertFile(s.c.CACertFile),
pool.MaxCallRecvMsgSize(s.c.MaxCallRecvMsgSize),
)
if err != nil {
return &group.FindGroupsResponse{
Expand All @@ -95,6 +101,8 @@ func (s *svc) GetMembers(ctx context.Context, req *group.GetMembersRequest) (*gr
pool.Endpoint(s.c.GroupProviderEndpoint),
pool.Insecure(s.c.Insecure),
pool.SkipVerify(s.c.SkipVerify),
pool.CACertFile(s.c.CACertFile),
pool.MaxCallRecvMsgSize(s.c.MaxCallRecvMsgSize),
)
if err != nil {
return &group.GetMembersResponse{
Expand All @@ -115,6 +123,8 @@ func (s *svc) HasMember(ctx context.Context, req *group.HasMemberRequest) (*grou
pool.Endpoint(s.c.GroupProviderEndpoint),
pool.Insecure(s.c.Insecure),
pool.SkipVerify(s.c.SkipVerify),
pool.CACertFile(s.c.CACertFile),
pool.MaxCallRecvMsgSize(s.c.MaxCallRecvMsgSize),
)
if err != nil {
return &group.HasMemberResponse{
Expand Down
2 changes: 2 additions & 0 deletions internal/grpc/services/gateway/ocmcore.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@ func (s *svc) CreateOCMCoreShare(
pool.Endpoint(s.c.OCMCoreEndpoint),
pool.Insecure(s.c.Insecure),
pool.SkipVerify(s.c.SkipVerify),
pool.CACertFile(s.c.CACertFile),
pool.MaxCallRecvMsgSize(s.c.MaxCallRecvMsgSize),
)
if err != nil {
return &ocmcore.CreateOCMCoreShareResponse{
Expand Down
10 changes: 10 additions & 0 deletions internal/grpc/services/gateway/ocminvitemanager.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@ func (s *svc) GenerateInviteToken(
pool.Endpoint(s.c.OCMInviteManagerEndpoint),
pool.Insecure(s.c.Insecure),
pool.SkipVerify(s.c.SkipVerify),
pool.CACertFile(s.c.CACertFile),
pool.MaxCallRecvMsgSize(s.c.MaxCallRecvMsgSize),
)
if err != nil {
return &invitepb.GenerateInviteTokenResponse{
Expand All @@ -58,6 +60,8 @@ func (s *svc) ForwardInvite(
pool.Endpoint(s.c.OCMInviteManagerEndpoint),
pool.Insecure(s.c.Insecure),
pool.SkipVerify(s.c.SkipVerify),
pool.CACertFile(s.c.CACertFile),
pool.MaxCallRecvMsgSize(s.c.MaxCallRecvMsgSize),
)
if err != nil {
return &invitepb.ForwardInviteResponse{
Expand All @@ -81,6 +85,8 @@ func (s *svc) AcceptInvite(
pool.Endpoint(s.c.OCMInviteManagerEndpoint),
pool.Insecure(s.c.Insecure),
pool.SkipVerify(s.c.SkipVerify),
pool.CACertFile(s.c.CACertFile),
pool.MaxCallRecvMsgSize(s.c.MaxCallRecvMsgSize),
)
if err != nil {
return &invitepb.AcceptInviteResponse{
Expand All @@ -104,6 +110,8 @@ func (s *svc) GetAcceptedUser(
pool.Endpoint(s.c.OCMInviteManagerEndpoint),
pool.Insecure(s.c.Insecure),
pool.SkipVerify(s.c.SkipVerify),
pool.CACertFile(s.c.CACertFile),
pool.MaxCallRecvMsgSize(s.c.MaxCallRecvMsgSize),
)
if err != nil {
return &invitepb.GetAcceptedUserResponse{
Expand All @@ -127,6 +135,8 @@ func (s *svc) FindAcceptedUsers(
pool.Endpoint(s.c.OCMInviteManagerEndpoint),
pool.Insecure(s.c.Insecure),
pool.SkipVerify(s.c.SkipVerify),
pool.CACertFile(s.c.CACertFile),
pool.MaxCallRecvMsgSize(s.c.MaxCallRecvMsgSize),
)
if err != nil {
return &invitepb.FindAcceptedUsersResponse{
Expand Down
6 changes: 6 additions & 0 deletions internal/grpc/services/gateway/ocmproviderauthorizer.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@ func (s *svc) IsProviderAllowed(
pool.Endpoint(s.c.OCMProviderAuthorizerEndpoint),
pool.Insecure(s.c.Insecure),
pool.SkipVerify(s.c.SkipVerify),
pool.CACertFile(s.c.CACertFile),
pool.MaxCallRecvMsgSize(s.c.MaxCallRecvMsgSize),
)
if err != nil {
return &ocmprovider.IsProviderAllowedResponse{
Expand All @@ -58,6 +60,8 @@ func (s *svc) GetInfoByDomain(
pool.Endpoint(s.c.OCMProviderAuthorizerEndpoint),
pool.Insecure(s.c.Insecure),
pool.SkipVerify(s.c.SkipVerify),
pool.CACertFile(s.c.CACertFile),
pool.MaxCallRecvMsgSize(s.c.MaxCallRecvMsgSize),
)
if err != nil {
return &ocmprovider.GetInfoByDomainResponse{
Expand All @@ -81,6 +85,8 @@ func (s *svc) ListAllProviders(
pool.Endpoint(s.c.OCMProviderAuthorizerEndpoint),
pool.Insecure(s.c.Insecure),
pool.SkipVerify(s.c.SkipVerify),
pool.CACertFile(s.c.CACertFile),
pool.MaxCallRecvMsgSize(s.c.MaxCallRecvMsgSize),
)
if err != nil {
return &ocmprovider.ListAllProvidersResponse{
Expand Down
16 changes: 16 additions & 0 deletions internal/grpc/services/gateway/ocmshareprovider.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,8 @@ func (s *svc) CreateOCMShare(ctx context.Context, req *ocm.CreateOCMShareRequest
pool.Endpoint(s.c.OCMShareProviderEndpoint),
pool.Insecure(s.c.Insecure),
pool.SkipVerify(s.c.SkipVerify),
pool.CACertFile(s.c.CACertFile),
pool.MaxCallRecvMsgSize(s.c.MaxCallRecvMsgSize),
)
if err != nil {
return &ocm.CreateOCMShareResponse{
Expand Down Expand Up @@ -83,6 +85,8 @@ func (s *svc) RemoveOCMShare(ctx context.Context, req *ocm.RemoveOCMShareRequest
pool.Endpoint(s.c.OCMShareProviderEndpoint),
pool.Insecure(s.c.Insecure),
pool.SkipVerify(s.c.SkipVerify),
pool.CACertFile(s.c.CACertFile),
pool.MaxCallRecvMsgSize(s.c.MaxCallRecvMsgSize),
)
if err != nil {
return &ocm.RemoveOCMShareResponse{
Expand Down Expand Up @@ -149,6 +153,8 @@ func (s *svc) getOCMShare(ctx context.Context, req *ocm.GetOCMShareRequest) (*oc
pool.Endpoint(s.c.OCMShareProviderEndpoint),
pool.Insecure(s.c.Insecure),
pool.SkipVerify(s.c.SkipVerify),
pool.CACertFile(s.c.CACertFile),
pool.MaxCallRecvMsgSize(s.c.MaxCallRecvMsgSize),
)
if err != nil {
err = errors.Wrap(err, "gateway: error calling GetOCMShareProviderClient")
Expand All @@ -171,6 +177,8 @@ func (s *svc) ListOCMShares(ctx context.Context, req *ocm.ListOCMSharesRequest)
pool.Endpoint(s.c.OCMShareProviderEndpoint),
pool.Insecure(s.c.Insecure),
pool.SkipVerify(s.c.SkipVerify),
pool.CACertFile(s.c.CACertFile),
pool.MaxCallRecvMsgSize(s.c.MaxCallRecvMsgSize),
)
if err != nil {
err = errors.Wrap(err, "gateway: error calling GetOCMShareProviderClient")
Expand All @@ -192,6 +200,8 @@ func (s *svc) UpdateOCMShare(ctx context.Context, req *ocm.UpdateOCMShareRequest
pool.Endpoint(s.c.OCMShareProviderEndpoint),
pool.Insecure(s.c.Insecure),
pool.SkipVerify(s.c.SkipVerify),
pool.CACertFile(s.c.CACertFile),
pool.MaxCallRecvMsgSize(s.c.MaxCallRecvMsgSize),
)
if err != nil {
err = errors.Wrap(err, "gateway: error calling GetOCMShareProviderClient")
Expand All @@ -216,6 +226,8 @@ func (s *svc) ListReceivedOCMShares(
pool.Endpoint(s.c.OCMShareProviderEndpoint),
pool.Insecure(s.c.Insecure),
pool.SkipVerify(s.c.SkipVerify),
pool.CACertFile(s.c.CACertFile),
pool.MaxCallRecvMsgSize(s.c.MaxCallRecvMsgSize),
)
if err != nil {
err = errors.Wrap(err, "gateway: error calling GetOCMShareProviderClient")
Expand All @@ -241,6 +253,8 @@ func (s *svc) UpdateReceivedOCMShare(
pool.Endpoint(s.c.OCMShareProviderEndpoint),
pool.Insecure(s.c.Insecure),
pool.SkipVerify(s.c.SkipVerify),
pool.CACertFile(s.c.CACertFile),
pool.MaxCallRecvMsgSize(s.c.MaxCallRecvMsgSize),
)
if err != nil {
err = errors.Wrap(err, "gateway: error calling GetOCMShareProviderClient")
Expand Down Expand Up @@ -463,6 +477,8 @@ func (s *svc) GetReceivedOCMShare(
pool.Endpoint(s.c.OCMShareProviderEndpoint),
pool.Insecure(s.c.Insecure),
pool.SkipVerify(s.c.SkipVerify),
pool.CACertFile(s.c.CACertFile),
pool.MaxCallRecvMsgSize(s.c.MaxCallRecvMsgSize),
)
if err != nil {
err = errors.Wrap(err, "gateway: error calling GetOCMShareProviderClient")
Expand Down
2 changes: 2 additions & 0 deletions internal/grpc/services/gateway/permissions.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@ func (s *svc) CheckPermission(
pool.Endpoint(s.c.PermissionsEndpoint),
pool.Insecure(s.c.Insecure),
pool.SkipVerify(s.c.SkipVerify),
pool.CACertFile(s.c.CACertFile),
pool.MaxCallRecvMsgSize(s.c.MaxCallRecvMsgSize),
)
if err != nil {
err = errors.Wrap(err, "gateway: error calling GetPermissionssClient")
Expand Down
Loading

0 comments on commit 5f20c8a

Please sign in to comment.