Skip to content

Commit

Permalink
fix: review comment by muthu
Browse files Browse the repository at this point in the history
  • Loading branch information
utsav14nov committed Oct 8, 2024
1 parent 454ae50 commit d7e9e71
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
8 changes: 4 additions & 4 deletions plugins/providers/shield/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion plugins/providers/shield/provider.go
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
8 changes: 4 additions & 4 deletions plugins/providers/shield/provider_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit d7e9e71

Please sign in to comment.