From d7e9e71df5a6ee179af3b9087cb60b235afbc85b Mon Sep 17 00:00:00 2001 From: utsav14nov Date: Tue, 8 Oct 2024 11:24:41 +0530 Subject: [PATCH] fix: review comment by muthu --- plugins/providers/shield/config.go | 8 ++++---- plugins/providers/shield/provider.go | 2 +- plugins/providers/shield/provider_test.go | 8 ++++---- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/plugins/providers/shield/config.go b/plugins/providers/shield/config.go index 828c89e7..d85b41fe 100644 --- a/plugins/providers/shield/config.go +++ b/plugins/providers/shield/config.go @@ -18,10 +18,10 @@ const ( ) type Credentials struct { - Host string `json:"host" mapstructure:"host" validate:"required"` - AuthHeader string `json:"auth_header" mapstructure:"auth_header" validate:"required"` - AuthEmail string `json:"auth_email" mapstructure:"auth_email" validate:"required"` - Version string `json:"version" mapstructure:"version"` + Host string `json:"host" mapstructure:"host" validate:"required"` + AuthHeader string `json:"auth_header" mapstructure:"auth_header" validate:"required"` + AuthEmail string `json:"auth_email" mapstructure:"auth_email" validate:"required"` + ClientVersion string `json:"client_version" mapstructure:"client_version"` } type Permission string diff --git a/plugins/providers/shield/provider.go b/plugins/providers/shield/provider.go index 908a08ec..2d78392b 100644 --- a/plugins/providers/shield/provider.go +++ b/plugins/providers/shield/provider.go @@ -130,7 +130,7 @@ func (p *provider) GetClient(providerURN string, credentials Credentials) (Shiel return p.Clients[providerURN], nil } - if credentials.Version == "new" { + if credentials.ClientVersion == "new" { client, err := NewShieldNewClient(&ClientConfig{ Host: credentials.Host, AuthHeader: credentials.AuthHeader, diff --git a/plugins/providers/shield/provider_test.go b/plugins/providers/shield/provider_test.go index 0f55c30c..2cb49ef5 100644 --- a/plugins/providers/shield/provider_test.go +++ b/plugins/providers/shield/provider_test.go @@ -1457,10 +1457,10 @@ func TestGetClient(t *testing.T) { p := shield.NewProvider("", logger) creds := shield.Credentials{ - Host: "http://localhost.com", - AuthEmail: "test-email", - Version: "new", - AuthHeader: "test-header", + Host: "http://localhost.com", + AuthEmail: "test-email", + ClientVersion: "new", + AuthHeader: "test-header", } _, err := p.GetClient(providerURN, creds)