Просмотр исходного кода

add gcp project id as part of the credential exchange response

Alexander Belanger 4 лет назад
Родитель
Сommit
4b4ff18cb9

+ 3 - 0
internal/repository/credentials/credentials.go

@@ -16,6 +16,9 @@ type OAuthCredential struct {
 type GCPCredential struct {
 	// KeyData for a service account for GCP connectors
 	GCPKeyData []byte `json:"gcp_key_data"`
+
+	// GCPProjectID is the GCP project id
+	GCPProjectID []byte `json:"gcp_project_id"`
 }
 
 type AWSCredential struct {

+ 2 - 1
provisioner/server/handlers/credentials/get_credentials_ee.go

@@ -82,7 +82,8 @@ func (c *CredentialsGetHandler) ServeHTTP(w http.ResponseWriter, r *http.Request
 		}
 
 		resp.GCP = &credentials.GCPCredential{
-			GCPKeyData: gcpInt.GCPKeyData,
+			GCPKeyData:   gcpInt.GCPKeyData,
+			GCPProjectID: []byte(gcpInt.GCPProjectID),
 		}
 	} else if ceToken.AWSCredentialID != 0 {
 		awsInt, err := repo.AWSIntegration().ReadAWSIntegration(ceToken.ProjectID, ceToken.AWSCredentialID)