From de96fb5f7b29b3cd20a5aa8afdc7387d80eb71d6 Mon Sep 17 00:00:00 2001 From: Jacob Vecera Date: Wed, 26 Feb 2025 11:35:11 +0100 Subject: [PATCH] remove nonmandatory projectId --- pbm/storage/gcs/gcs.go | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/pbm/storage/gcs/gcs.go b/pbm/storage/gcs/gcs.go index 0fde89dc3..c76b9f100 100644 --- a/pbm/storage/gcs/gcs.go +++ b/pbm/storage/gcs/gcs.go @@ -33,9 +33,8 @@ type Config struct { } type Credentials struct { - ProjectID string `bson:"projectId" json:"projectId,omitempty" yaml:"projectId,omitempty"` - PrivateKey string `bson:"privateKey" json:"privateKey,omitempty" yaml:"privateKey,omitempty"` ClientEmail string `bson:"clientEmail" json:"clientEmail,omitempty" yaml:"clientEmail,omitempty"` + PrivateKey string `bson:"privateKey" json:"privateKey,omitempty" yaml:"privateKey,omitempty"` } type Retryer struct { @@ -54,7 +53,6 @@ type Retryer struct { type ServiceAccountCredentials struct { Type string `json:"type"` - ProjectID string `json:"project_id"` PrivateKey string `json:"private_key"` ClientEmail string `json:"client_email"` AuthURI string `json:"auth_uri"` @@ -265,15 +263,12 @@ func (g *GCS) Copy(src, dst string) error { func (g *GCS) gcsClient() (*gcs.Client, error) { ctx := context.Background() - if g.opts.Credentials.ProjectID == "" || - g.opts.Credentials.PrivateKey == "" || - g.opts.Credentials.ClientEmail == "" { - return nil, errors.New("projectID, privateKey and clientEmail are required for GCS credentials") + if g.opts.Credentials.PrivateKey == "" || g.opts.Credentials.ClientEmail == "" { + return nil, errors.New("clientEmail and privateKey are required for GCS credentials") } creds, err := json.Marshal(ServiceAccountCredentials{ Type: "service_account", - ProjectID: g.opts.Credentials.ProjectID, PrivateKey: g.opts.Credentials.PrivateKey, ClientEmail: g.opts.Credentials.ClientEmail, AuthURI: "https://accounts.google.com/o/oauth2/auth",