File tree Expand file tree Collapse file tree 1 file changed +2
-1
lines changed
Expand file tree Collapse file tree 1 file changed +2
-1
lines changed Original file line number Diff line number Diff line change @@ -280,13 +280,14 @@ func (key *MasterKey) TypeToIdentifier() string {
280280// It returns an error if the ResourceID is invalid, or if the setup of the
281281// client fails.
282282func (key * MasterKey ) newKMSClient (ctx context.Context ) (* kms.KeyManagementClient , error ) {
283- re := regexp .MustCompile (`^projects/[^/]+/locations/[^/]+/keyRings/[^/]+/cryptoKeys/[^/]+$` )
283+ re := regexp .MustCompile (`^projects/(?P<project> [^/]+) /locations/[^/]+/keyRings/[^/]+/cryptoKeys/[^/]+$` )
284284 matches := re .FindStringSubmatch (key .ResourceID )
285285 if matches == nil {
286286 return nil , fmt .Errorf ("no valid resource ID found in %q" , key .ResourceID )
287287 }
288288
289289 var opts []option.ClientOption
290+ opts = append (opts , option .WithQuotaProject (matches [1 ]))
290291 switch {
291292 case key .tokenSource != nil :
292293 opts = append (opts , option .WithTokenSource (key .tokenSource ))
You can’t perform that action at this time.
0 commit comments