Skip to content

Commit

Permalink
Added the query parameter to the get config
Browse files Browse the repository at this point in the history
  • Loading branch information
ParthaI committed May 17, 2023
1 parent b77e98c commit 312e459
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions gcp/table_gcp_service_account_key.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import (
"github.com/turbot/steampipe-plugin-sdk/v5/grpc/proto"
"github.com/turbot/steampipe-plugin-sdk/v5/plugin"
"github.com/turbot/steampipe-plugin-sdk/v5/plugin/transform"
"google.golang.org/api/googleapi"
"google.golang.org/api/iam/v1"
)

Expand Down Expand Up @@ -132,7 +133,7 @@ func getGcpServiceAccountKey(ctx context.Context, d *plugin.QueryData, h *plugin
var name, serviceAccountName string
if h.Item != nil {
data := h.Item.(*iam.ServiceAccountKey)
name = data.Name
name = strings.Split(data.Name, "/")[5]
splitName := strings.Split(data.Name, "/")
serviceAccountName = splitName[3]
} else {
Expand Down Expand Up @@ -161,7 +162,9 @@ func getGcpServiceAccountKey(ctx context.Context, d *plugin.QueryData, h *plugin

keyName := "projects/" + project + "/serviceAccounts/" + serviceAccountName + "/keys/" + name

op, err := service.Projects.ServiceAccounts.Keys.Get(keyName).Do()
queryParameter := googleapi.QueryParameter("publicKeyType", "TYPE_RAW_PUBLIC_KEY", "TYPE_X509_PEM_FILE")

op, err := service.Projects.ServiceAccounts.Keys.Get(keyName).Do(queryParameter)
if err != nil {
return nil, err
}
Expand Down

0 comments on commit 312e459

Please sign in to comment.