Skip to content

Commit

Permalink
error message and hardcode secret
Browse files Browse the repository at this point in the history
  • Loading branch information
1riatsila1 committed Sep 4, 2024
1 parent 82859c2 commit 28b8b5b
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 6 deletions.
2 changes: 1 addition & 1 deletion pkg/config-api-provider/examples/full-demo/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ terraform {
provider "uxi" {
host = "test.api.capenetworks.com"
client_id = "client_id"
client_secret = var.client_secret
client_secret = "some_random_secret"
token_url = "https://test.sso.common.cloud.hpe.com/as/token.oauth2"
}

Expand Down
1 change: 0 additions & 1 deletion pkg/config-api-provider/examples/full-demo/variables.tf

This file was deleted.

2 changes: 1 addition & 1 deletion pkg/config-api-provider/provider/provider.go
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,6 @@ func getHttpClient(clientID string, clientSecret string, tokenURL string) *http.
AuthStyle: oauth2.AuthStyleInParams,
}

// Create a context and fetch a tokencould
// Create a context and fetch a token
return config.Client(context.Background())
}
4 changes: 1 addition & 3 deletions pkg/config-api-provider/provider/resources/group.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ package resources

import (
"context"
"fmt"

"github.com/aruba-uxi/configuration-api-terraform-provider/pkg/config-api-client"

Expand Down Expand Up @@ -89,9 +88,8 @@ func (r *groupResource) Configure(_ context.Context, req resource.ConfigureReque
if !ok {
resp.Diagnostics.AddError(
"Unexpected Data Source Configure Type",
fmt.Sprintf("Expected *config_api_client.APIClient, got: %T. Please report this issue to the provider developers.", req.ProviderData),
"Resource type: Group. Please report this issue to the provider developers.",
)

return

Check warning on line 93 in pkg/config-api-provider/provider/resources/group.go

View check run for this annotation

Codecov / codecov/patch

pkg/config-api-provider/provider/resources/group.go#L89-L93

Added lines #L89 - L93 were not covered by tests
}

Expand Down

0 comments on commit 28b8b5b

Please sign in to comment.