From 958eb2055973a166bae027fe5f0955319eaae06c Mon Sep 17 00:00:00 2001 From: upodroid Date: Mon, 26 Apr 2021 14:27:33 +0100 Subject: [PATCH] remove json key content --- backend/remote-state/gcs/backend.go | 14 -------------- 1 file changed, 14 deletions(-) diff --git a/backend/remote-state/gcs/backend.go b/backend/remote-state/gcs/backend.go index 3a4f1261d..b4e3cdf53 100644 --- a/backend/remote-state/gcs/backend.go +++ b/backend/remote-state/gcs/backend.go @@ -4,7 +4,6 @@ package gcs import ( "context" "encoding/base64" - "encoding/json" "fmt" "os" "strings" @@ -135,7 +134,6 @@ func (b *Backend) configure(ctx context.Context) error { if tokenSource != nil { credOptions = append(credOptions, option.WithTokenSource(tokenSource)) } else if creds != "" { - var account accountFile // to mirror how the provider works, we accept the file path or the contents contents, err := backend.ReadPathOrContents(creds) @@ -143,10 +141,6 @@ func (b *Backend) configure(ctx context.Context) error { return fmt.Errorf("Error loading credentials: %s", err) } - if err := json.Unmarshal([]byte(contents), &account); err != nil { - return fmt.Errorf("Error parsing credentials '%s': %s", contents, err) - } - credOptions = append(credOptions, option.WithCredentialsJSON([]byte(contents))) } @@ -215,11 +209,3 @@ func (b *Backend) configure(ctx context.Context) error { return nil } - -// accountFile represents the structure of the account file JSON file. -type accountFile struct { - PrivateKeyId string `json:"private_key_id"` - PrivateKey string `json:"private_key"` - ClientEmail string `json:"client_email"` - ClientId string `json:"client_id"` -}