From 34fab8ae0996e303616db588853bc1f78decd2ce Mon Sep 17 00:00:00 2001 From: Jim Kalafut Date: Mon, 1 Jun 2020 11:02:33 -0700 Subject: [PATCH] Update gcp secrets plugin (#9004) --- go.mod | 2 +- go.sum | 2 + .../plugin/backend.go | 6 +- .../plugin/iamutil/api_handle.go | 120 ++ .../plugin/iamutil/dataset_resource.go | 142 ++ .../plugin/iamutil/iam_handle.go | 70 - .../plugin/iamutil/iam_resource.go | 127 +- .../plugin/iamutil/resource.go | 52 + ..._resource_parser.go => resource_parser.go} | 28 +- ...es_generated.go => resources_generated.go} | 1243 ++++++++++++----- .../plugin/path_role_set.go | 4 +- .../plugin/role_set.go | 14 +- .../plugin/rollback.go | 16 +- .../plugin/secrets_service_account_key.go | 6 +- vendor/modules.txt | 2 +- 15 files changed, 1269 insertions(+), 565 deletions(-) create mode 100644 vendor/github.com/hashicorp/vault-plugin-secrets-gcp/plugin/iamutil/api_handle.go create mode 100644 vendor/github.com/hashicorp/vault-plugin-secrets-gcp/plugin/iamutil/dataset_resource.go delete mode 100644 vendor/github.com/hashicorp/vault-plugin-secrets-gcp/plugin/iamutil/iam_handle.go create mode 100644 vendor/github.com/hashicorp/vault-plugin-secrets-gcp/plugin/iamutil/resource.go rename vendor/github.com/hashicorp/vault-plugin-secrets-gcp/plugin/iamutil/{iam_resource_parser.go => resource_parser.go} (83%) rename vendor/github.com/hashicorp/vault-plugin-secrets-gcp/plugin/iamutil/{iam_resources_generated.go => resources_generated.go} (68%) diff --git a/go.mod b/go.mod index b6273b313..3015cefac 100644 --- a/go.mod +++ b/go.mod @@ -86,7 +86,7 @@ require ( github.com/hashicorp/vault-plugin-secrets-ad v0.6.4-beta1.0.20200518124111-3dceeb3ce90e github.com/hashicorp/vault-plugin-secrets-alicloud v0.5.5 github.com/hashicorp/vault-plugin-secrets-azure v0.5.6 - github.com/hashicorp/vault-plugin-secrets-gcp v0.6.1 + github.com/hashicorp/vault-plugin-secrets-gcp v0.6.2 github.com/hashicorp/vault-plugin-secrets-gcpkms v0.5.5 github.com/hashicorp/vault-plugin-secrets-kv v0.5.5 github.com/hashicorp/vault-plugin-secrets-mongodbatlas v0.1.2 diff --git a/go.sum b/go.sum index 591752af2..08eff7c54 100644 --- a/go.sum +++ b/go.sum @@ -508,6 +508,8 @@ github.com/hashicorp/vault-plugin-secrets-azure v0.5.6 h1:4PgQ5rCT29wW5PMyebEhPk github.com/hashicorp/vault-plugin-secrets-azure v0.5.6/go.mod h1:Q0cIL4kZWnMmQWkBfWtyOd7+JXTEpAyU4L932PMHq3E= github.com/hashicorp/vault-plugin-secrets-gcp v0.6.1 h1:APkzBSHo+sKeWxXCM1aGGwcbfKfVQFN3CHmNGHyfqL0= github.com/hashicorp/vault-plugin-secrets-gcp v0.6.1/go.mod h1:jVTE1fuhRcBOb/gnCT9W++AnlwiyQEX4S8iVCKhKQsE= +github.com/hashicorp/vault-plugin-secrets-gcp v0.6.2 h1:ovziWUzmj83UlVXK8tM926ZitLKa5ZwRvlMqVibWHEs= +github.com/hashicorp/vault-plugin-secrets-gcp v0.6.2/go.mod h1:psRQ/dm5XatoUKLDUeWrpP9icMJNtu/jmscUr37YGK4= github.com/hashicorp/vault-plugin-secrets-gcpkms v0.5.5 h1:NigzA2v+h+cjBPl41pRirRwWELF+RPJGch/ys0Sijrc= github.com/hashicorp/vault-plugin-secrets-gcpkms v0.5.5/go.mod h1:b6RwFD1bny1zbfqhD35iGJdQYHRtJLx3HfBD109GO38= github.com/hashicorp/vault-plugin-secrets-kv v0.5.5 h1:yLtfsAiJOkpRkk+OxQmFluQJ35OUw420Y+CwfGMWuSc= diff --git a/vendor/github.com/hashicorp/vault-plugin-secrets-gcp/plugin/backend.go b/vendor/github.com/hashicorp/vault-plugin-secrets-gcp/plugin/backend.go index e498fcfca..114f61b46 100644 --- a/vendor/github.com/hashicorp/vault-plugin-secrets-gcp/plugin/backend.go +++ b/vendor/github.com/hashicorp/vault-plugin-secrets-gcp/plugin/backend.go @@ -33,7 +33,7 @@ type backend struct { // cache directly. cache *cache.Cache - iamResources iamutil.IamResourceParser + resources iamutil.ResourceParser rolesetLock sync.Mutex } @@ -49,8 +49,8 @@ func Factory(ctx context.Context, conf *logical.BackendConfig) (logical.Backend, func Backend() *backend { var b = &backend{ - cache: cache.New(), - iamResources: iamutil.GetEnabledIamResources(), + cache: cache.New(), + resources: iamutil.GetEnabledResources(), } b.Backend = &framework.Backend{ diff --git a/vendor/github.com/hashicorp/vault-plugin-secrets-gcp/plugin/iamutil/api_handle.go b/vendor/github.com/hashicorp/vault-plugin-secrets-gcp/plugin/iamutil/api_handle.go new file mode 100644 index 000000000..5a1dc7e07 --- /dev/null +++ b/vendor/github.com/hashicorp/vault-plugin-secrets-gcp/plugin/iamutil/api_handle.go @@ -0,0 +1,120 @@ +package iamutil + +import ( + "context" + "encoding/json" + "fmt" + "io" + "net/http" + "strings" + + "github.com/hashicorp/errwrap" + "google.golang.org/api/googleapi" +) + +type ApiHandle struct { + c *http.Client + userAgent string +} + +func GetApiHandle(client *http.Client, userAgent string) *ApiHandle { + return &ApiHandle{ + c: client, + userAgent: userAgent, + } +} + +func (h *ApiHandle) DoGetRequest(ctx context.Context, r Resource, out interface{}) (err error) { + config := r.GetConfig() + req, err := constructRequest(r, &config.GetMethod, nil) + if err != nil { + return errwrap.Wrapf("Unable to construct Get request: {{err}}", err) + } + return h.doRequest(ctx, req, out) +} + +func (h *ApiHandle) DoSetRequest(ctx context.Context, r Resource, data io.Reader, out interface{}) error { + config := r.GetConfig() + req, err := constructRequest(r, &config.SetMethod, data) + if err != nil { + return errwrap.Wrapf("Unable to construct Set request: {{err}}", err) + } + return h.doRequest(ctx, req, out) +} + +func (h *ApiHandle) doRequest(ctx context.Context, req *http.Request, out interface{}) error { + if req.Header == nil { + req.Header = make(http.Header) + } + if h.userAgent != "" { + req.Header.Set("User-Agent", h.userAgent) + } + + resp, err := h.c.Do(req.WithContext(ctx)) + if err != nil { + return err + } + defer googleapi.CloseBody(resp) + + if err := googleapi.CheckResponse(resp); err != nil { + return err + } + + if err := json.NewDecoder(resp.Body).Decode(out); err != nil { + return errwrap.Wrapf("unable to decode JSON resp to output interface: {{err}}", err) + } + return nil +} + +func constructRequest(r Resource, restMethod *RestMethod, data io.Reader) (*http.Request, error) { + config := r.GetConfig() + if data == nil && config != nil && config.Service == "cloudresourcemanager" { + // In order to support Resource Manager policies with conditional bindings, + // we need to request the policy version of 3. This request parameter is backwards compatible + // and will return version 1 policies if they are not yet updated to version 3. + requestPolicyVersion3 := `{"options": {"requestedPolicyVersion": 3}}` + data = strings.NewReader(requestPolicyVersion3) + } + req, err := http.NewRequest( + restMethod.HttpMethod, + googleapi.ResolveRelative(restMethod.BaseURL, restMethod.Path), + data) + if err != nil { + return nil, err + } + + if req.Header == nil { + req.Header = make(http.Header) + } + if data != nil { + req.Header.Set("Content-Type", "application/json") + } + + relId := r.GetRelativeId() + replacementMap := make(map[string]string) + + if strings.Contains(restMethod.Path, "{+resource}") { + // +resource is used to represent full relative resource name + if len(config.Parameters) == 1 && config.Parameters[0] == "resource" { + relName := "" + tkns := strings.Split(config.TypeKey, "/") + for _, colId := range tkns { + if colName, ok := relId.IdTuples[colId]; ok { + relName += fmt.Sprintf("%s/%s/", colId, colName) + } + } + replacementMap["resource"] = strings.Trim(relName, "/") + } + } else { + for colId, resId := range relId.IdTuples { + rId, ok := config.CollectionReplacementKeys[colId] + if !ok { + return nil, fmt.Errorf("expected value for collection id %s", colId) + } + replacementMap[rId] = resId + } + } + + googleapi.Expand(req.URL, replacementMap) + return req, nil +} diff --git a/vendor/github.com/hashicorp/vault-plugin-secrets-gcp/plugin/iamutil/dataset_resource.go b/vendor/github.com/hashicorp/vault-plugin-secrets-gcp/plugin/iamutil/dataset_resource.go new file mode 100644 index 000000000..519032841 --- /dev/null +++ b/vendor/github.com/hashicorp/vault-plugin-secrets-gcp/plugin/iamutil/dataset_resource.go @@ -0,0 +1,142 @@ +package iamutil + +import ( + "context" + "encoding/json" + "errors" + "fmt" + "strings" + + "github.com/hashicorp/errwrap" + "github.com/hashicorp/go-gcp-common/gcputil" +) + +// NOTE: BigQuery does not conform to the typical REST for IAM policies +// instead it has an access array with bindings on the dataset +// object. https://cloud.google.com/bigquery/docs/reference/rest/v2/datasets#Dataset +type AccessBinding struct { + Role string `json:"role,omitempty"` + UserByEmail string `json:"userByEmail,omitempty"` + GroupByEmail string `json:"groupByEmail,omitempty"` +} + +type Dataset struct { + Access []*AccessBinding `json:"access,omitempty"` + Etag string `json:"etag,omitempty"` +} + +// NOTE: DatasetResource implements IamResource. +// This is because bigquery datasets have their own +// ACLs instead of an IAM policy +type DatasetResource struct { + relativeId *gcputil.RelativeResourceName + config *RestResource +} + +func (r *DatasetResource) GetConfig() *RestResource { + return r.config +} + +func (r *DatasetResource) GetRelativeId() *gcputil.RelativeResourceName { + return r.relativeId +} + +func (r *DatasetResource) GetIamPolicy(ctx context.Context, h *ApiHandle) (*Policy, error) { + var dataset Dataset + if err := h.DoGetRequest(ctx, r, &dataset); err != nil { + return nil, errwrap.Wrapf("unable to get BigQuery Dataset ACL: {{err}}", err) + } + p := datasetAsPolicy(&dataset) + return p, nil +} + +func (r *DatasetResource) SetIamPolicy(ctx context.Context, h *ApiHandle, p *Policy) (*Policy, error) { + var jsonP []byte + ds, err := policyAsDataset(p) + if err != nil { + return nil, err + } + jsonP, err = json.Marshal(ds) + if err != nil { + return nil, err + } + reqJson := fmt.Sprintf(r.config.SetMethod.RequestFormat, jsonP) + if !json.Valid([]byte(reqJson)) { + return nil, fmt.Errorf("request format from generated BigQuery Dataset config invalid JSON: %s", reqJson) + } + + var dataset Dataset + if err := h.DoSetRequest(ctx, r, strings.NewReader(reqJson), &dataset); err != nil { + return nil, errwrap.Wrapf("unable to set BigQuery Dataset ACL: {{err}}", err) + } + policy := datasetAsPolicy(&dataset) + + return policy, nil +} + +func policyAsDataset(p *Policy) (*Dataset, error) { + if p == nil { + return nil, errors.New("Policy cannot be nil") + } + + ds := &Dataset{Etag: p.Etag} + for _, binding := range p.Bindings { + if binding.Condition != nil { + return nil, errors.New("Bigquery Datasets do not support conditional IAM") + } + for _, member := range binding.Members { + var email, iamType string + memberSplit := strings.Split(member, ":") + if len(memberSplit) == 2 { + iamType = memberSplit[0] + email = memberSplit[1] + } else { + email = member + } + + if email != "" { + binding := &AccessBinding{Role: binding.Role} + if iamType == "group" { + binding.GroupByEmail = email + } else { + binding.UserByEmail = email + } + ds.Access = append(ds.Access, binding) + } + } + } + return ds, nil +} + +func datasetAsPolicy(ds *Dataset) *Policy { + if ds == nil { + return &Policy{} + } + + policy := &Policy{Etag: ds.Etag} + bindingMap := make(map[string]*Binding) + for _, accessBinding := range ds.Access { + var iamMember string + + //NOTE: Can either have GroupByEmail or UserByEmail but not both + if accessBinding.GroupByEmail != "" { + iamMember = fmt.Sprintf("group:%s", accessBinding.GroupByEmail) + } else if strings.HasSuffix(accessBinding.UserByEmail, "gserviceaccount.com") { + iamMember = fmt.Sprintf("serviceAccount:%s", accessBinding.UserByEmail) + } else { + iamMember = fmt.Sprintf("user:%s", accessBinding.UserByEmail) + } + if binding, ok := bindingMap[accessBinding.Role]; ok { + binding.Members = append(binding.Members, iamMember) + } else { + bindingMap[accessBinding.Role] = &Binding{ + Role: accessBinding.Role, + Members: []string{iamMember}, + } + } + } + for _, v := range bindingMap { + policy.Bindings = append(policy.Bindings, v) + } + return policy +} diff --git a/vendor/github.com/hashicorp/vault-plugin-secrets-gcp/plugin/iamutil/iam_handle.go b/vendor/github.com/hashicorp/vault-plugin-secrets-gcp/plugin/iamutil/iam_handle.go deleted file mode 100644 index 63700bef1..000000000 --- a/vendor/github.com/hashicorp/vault-plugin-secrets-gcp/plugin/iamutil/iam_handle.go +++ /dev/null @@ -1,70 +0,0 @@ -package iamutil - -import ( - "context" - "encoding/json" - "net/http" - - "github.com/hashicorp/errwrap" - "google.golang.org/api/googleapi" -) - -type IamHandle struct { - c *http.Client - userAgent string -} - -func GetIamHandle(client *http.Client, userAgent string) *IamHandle { - return &IamHandle{ - c: client, - userAgent: userAgent, - } -} - -func (h *IamHandle) GetIamPolicy(ctx context.Context, r IamResource) (*Policy, error) { - req, err := r.GetIamPolicyRequest() - if err != nil { - return nil, errwrap.Wrapf("unable to construct GetIamPolicy request: {{err}}", err) - } - var p Policy - if err := h.doRequest(ctx, req, &p); err != nil { - return nil, errwrap.Wrapf("unable to get policy: {{err}}", err) - } - return &p, nil -} - -func (h *IamHandle) SetIamPolicy(ctx context.Context, r IamResource, p *Policy) (*Policy, error) { - req, err := r.SetIamPolicyRequest(p) - if err != nil { - return nil, errwrap.Wrapf("unable to construct SetIamPolicy request: {{err}}", err) - } - var out Policy - if err := h.doRequest(ctx, req, &out); err != nil { - return nil, errwrap.Wrapf("unable to set policy: {{err}}", err) - } - return &out, nil -} - -func (h *IamHandle) doRequest(ctx context.Context, req *http.Request, out interface{}) error { - if req.Header == nil { - req.Header = make(http.Header) - } - if h.userAgent != "" { - req.Header.Set("User-Agent", h.userAgent) - } - - resp, err := h.c.Do(req.WithContext(ctx)) - if err != nil { - return err - } - defer googleapi.CloseBody(resp) - - if err := googleapi.CheckResponse(resp); err != nil { - return err - } - - if err := json.NewDecoder(resp.Body).Decode(out); err != nil { - return errwrap.Wrapf("unable to decode JSON resp to output interface: {{err}}", err) - } - return nil -} diff --git a/vendor/github.com/hashicorp/vault-plugin-secrets-gcp/plugin/iamutil/iam_resource.go b/vendor/github.com/hashicorp/vault-plugin-secrets-gcp/plugin/iamutil/iam_resource.go index a763408b8..811245d51 100644 --- a/vendor/github.com/hashicorp/vault-plugin-secrets-gcp/plugin/iamutil/iam_resource.go +++ b/vendor/github.com/hashicorp/vault-plugin-secrets-gcp/plugin/iamutil/iam_resource.go @@ -1,130 +1,49 @@ package iamutil import ( + "context" "encoding/json" "fmt" + "github.com/hashicorp/errwrap" "github.com/hashicorp/go-gcp-common/gcputil" - "google.golang.org/api/googleapi" - "io" - "net/http" "strings" ) -// IamResource handles constructing HTTP requests for getting and -// setting IAM policies. -type IamResource interface { - GetIamPolicyRequest() (*http.Request, error) - SetIamPolicyRequest(*Policy) (req *http.Request, err error) -} - -// parsedIamResource implements IamResource. -type parsedIamResource struct { +// IamResource implements Resource. +type IamResource struct { relativeId *gcputil.RelativeResourceName - config *IamRestResource + config *RestResource } -type IamRestResource struct { - // Name is the base name of the resource - // i.e. for a GCE instance: "instance" - Name string - - // Type Key is the identifying path for the resource, or - // the RESTful resource identifier without resource IDs - // i.e. For a GCE instance: "projects/zones/instances" - TypeKey string - - // Service Information - // Service is the name of the service this resource belongs to. - Service string - - // IsPreferredVersion is true if this version of the API/resource is preferred. - IsPreferredVersion bool - - // IsPreferredVersion is true if this version of the API/resource is preferred. - GetMethod RestMethod - - // IsPreferredVersion is true if this version of the API/resource is preferred. - SetMethod RestMethod - - // Ordered parameters to be replaced in method paths - Parameters []string - - // collection Id --> parameter to be replaced {} name - CollectionReplacementKeys map[string]string +func (r *IamResource) GetConfig() *RestResource { + return r.config } -type RestMethod struct { - HttpMethod string - BaseURL string - Path string - RequestFormat string +func (r *IamResource) GetRelativeId() *gcputil.RelativeResourceName { + return r.relativeId } -func (r *parsedIamResource) SetIamPolicyRequest(p *Policy) (req *http.Request, err error) { +func (r *IamResource) GetIamPolicy(ctx context.Context, h *ApiHandle) (*Policy, error) { + var p Policy + if err := h.DoGetRequest(ctx, r, &p); err != nil { + return nil, errwrap.Wrapf("unable to get policy: {{err}}", err) + } + return &p, nil +} + +func (r *IamResource) SetIamPolicy(ctx context.Context, h *ApiHandle, p *Policy) (*Policy, error) { jsonP, err := json.Marshal(p) if err != nil { return nil, err } - reqJson := fmt.Sprintf(r.config.SetMethod.RequestFormat, jsonP) if !json.Valid([]byte(reqJson)) { return nil, fmt.Errorf("request format from generated IAM config invalid JSON: %s", reqJson) } - return r.constructRequest(&r.config.SetMethod, strings.NewReader(reqJson)) -} - -var requestPolicyVersion3 = `{"options": {"requestedPolicyVersion": 3}}` - -func (r *parsedIamResource) GetIamPolicyRequest() (*http.Request, error) { - // In order to support Resource Manager policies with conditional bindings, - // we need to request the policy version of 3. This request parameter is backwards compatible - // and will return version 1 policies if they are not yet updated to version 3. - if r.config != nil && r.config.Service == "cloudresourcemanager" { - return r.constructRequest(&r.config.GetMethod, strings.NewReader(requestPolicyVersion3)) - } - return r.constructRequest(&r.config.GetMethod, nil) -} - -func (r *parsedIamResource) constructRequest(restMethod *RestMethod, data io.Reader) (*http.Request, error) { - req, err := http.NewRequest( - restMethod.HttpMethod, - googleapi.ResolveRelative(restMethod.BaseURL, restMethod.Path), - data) - if err != nil { - return nil, err - } - - if req.Header == nil { - req.Header = make(http.Header) - } - if data != nil { - req.Header.Set("Content-Type", "application/json") - } - - relId := r.relativeId - replacementMap := make(map[string]string) - - if strings.Contains(restMethod.Path, "{+resource}") { - // +resource is used to represent full relative resource name - if len(r.config.Parameters) == 1 && r.config.Parameters[0] == "resource" { - relName := "" - tkns := strings.Split(r.config.TypeKey, "/") - for _, colId := range tkns { - relName += fmt.Sprintf("%s/%s/", colId, relId.IdTuples[colId]) - } - replacementMap["resource"] = strings.Trim(relName, "/") - } - } else { - for colId, resId := range relId.IdTuples { - rId, ok := r.config.CollectionReplacementKeys[colId] - if !ok { - return nil, fmt.Errorf("expected value for collection id %s", colId) - } - replacementMap[rId] = resId - } - } - - googleapi.Expand(req.URL, replacementMap) - return req, nil + var policy Policy + if err := h.DoSetRequest(ctx, r, strings.NewReader(reqJson), &policy); err != nil { + return nil, errwrap.Wrapf("unable to set policy: {{err}}", err) + } + return &policy, nil } diff --git a/vendor/github.com/hashicorp/vault-plugin-secrets-gcp/plugin/iamutil/resource.go b/vendor/github.com/hashicorp/vault-plugin-secrets-gcp/plugin/iamutil/resource.go new file mode 100644 index 000000000..72739f854 --- /dev/null +++ b/vendor/github.com/hashicorp/vault-plugin-secrets-gcp/plugin/iamutil/resource.go @@ -0,0 +1,52 @@ +package iamutil + +import ( + "context" + + "github.com/hashicorp/go-gcp-common/gcputil" +) + +// Resource handles constructing HTTP requests for getting and +// setting IAM policies. +type Resource interface { + GetIamPolicy(context.Context, *ApiHandle) (*Policy, error) + SetIamPolicy(context.Context, *ApiHandle, *Policy) (*Policy, error) + GetConfig() *RestResource + GetRelativeId() *gcputil.RelativeResourceName +} + +type RestResource struct { + // Name is the base name of the resource + // i.e. for a GCE instance: "instance" + Name string + + // TypeKey is the identifying path for the resource, or + // the RESTful resource identifier without resource IDs + // i.e. For a GCE instance: "projects/zones/instances" + TypeKey string + + // Service is the name of the service this resource belongs to. + Service string + + // IsPreferredVersion is true if this version of the API/resource is preferred. + IsPreferredVersion bool + + // HTTP metadata for getting Policy data in GCP + GetMethod RestMethod + + // HTTP metadata for setting Policy data in GCP + SetMethod RestMethod + + // Ordered parameters to be replaced in method paths + Parameters []string + + // Mapping of collection ids onto the parameter to be replaced + CollectionReplacementKeys map[string]string +} + +type RestMethod struct { + HttpMethod string + BaseURL string + Path string + RequestFormat string +} diff --git a/vendor/github.com/hashicorp/vault-plugin-secrets-gcp/plugin/iamutil/iam_resource_parser.go b/vendor/github.com/hashicorp/vault-plugin-secrets-gcp/plugin/iamutil/resource_parser.go similarity index 83% rename from vendor/github.com/hashicorp/vault-plugin-secrets-gcp/plugin/iamutil/iam_resource_parser.go rename to vendor/github.com/hashicorp/vault-plugin-secrets-gcp/plugin/iamutil/resource_parser.go index 08d20dfc1..f0f3bb245 100644 --- a/vendor/github.com/hashicorp/vault-plugin-secrets-gcp/plugin/iamutil/iam_resource_parser.go +++ b/vendor/github.com/hashicorp/vault-plugin-secrets-gcp/plugin/iamutil/resource_parser.go @@ -14,17 +14,17 @@ const ( errorMultipleVersions = `please provide a self-link with version instead; multiple versions of this resource exist, all non-preferred` ) -// IamResourceParser handles parsing resource ID and REST +// ResourceParser handles parsing resource ID and REST // config from a given resource ID or name. -type IamResourceParser interface { - Parse(string) (IamResource, error) +type ResourceParser interface { + Parse(string) (Resource, error) } -// GeneratedResources implements IamResourceParser - a value +// GeneratedResources implements ResourceParser - a value // is generated using internal/generate_iam.go -type GeneratedResources map[string]map[string]map[string]IamRestResource +type GeneratedResources map[string]map[string]map[string]RestResource -func getResourceFromVersions(rawName string, versionMap map[string]IamRestResource) (*IamRestResource, error) { +func getResourceFromVersions(rawName string, versionMap map[string]RestResource) (*RestResource, error) { possibleVer := make([]string, 0, len(versionMap)) for v, config := range versionMap { if config.IsPreferredVersion || len(versionMap) == 1 { @@ -45,10 +45,10 @@ func getResourceFromVersions(rawName string, versionMap map[string]IamRestResour return nil, fmt.Errorf(resourceParsingErrorTmpl, rawName, errorMultipleVersions) } -func (apis GeneratedResources) GetRestConfig(rawName string, fullName *gcputil.FullResourceName, prefix string) (*IamRestResource, error) { +func (apis GeneratedResources) GetRestConfig(rawName string, fullName *gcputil.FullResourceName, prefix string) (*RestResource, error) { relName := fullName.RelativeResourceName if relName == nil { - return nil, fmt.Errorf(resourceParsingErrorTmpl, rawName, fmt.Errorf("unsupported resource type: %s", rawName)) + return nil, fmt.Errorf(resourceParsingErrorTmpl, rawName, fmt.Errorf("relative name does not exist: %s", rawName)) } serviceMap, ok := apis[relName.TypeKey] @@ -80,7 +80,7 @@ func (apis GeneratedResources) GetRestConfig(rawName string, fullName *gcputil.F return nil, fmt.Errorf(resourceParsingErrorTmpl, rawName, errorMultipleServices) } -func (apis GeneratedResources) Parse(rawName string) (IamResource, error) { +func (apis GeneratedResources) Parse(rawName string) (Resource, error) { rUrl, err := url.Parse(rawName) if err != nil { return nil, fmt.Errorf(`resource "%s" is invalid URI`, rawName) @@ -123,8 +123,10 @@ func (apis GeneratedResources) Parse(rawName string) (IamResource, error) { if err != nil { return nil, err } - return &parsedIamResource{ - relativeId: relName, - config: cfg, - }, nil + switch cfg.TypeKey { + case "projects/dataset": + return &DatasetResource{relativeId: relName, config: cfg}, nil + default: + return &IamResource{relativeId: relName, config: cfg}, nil + } } diff --git a/vendor/github.com/hashicorp/vault-plugin-secrets-gcp/plugin/iamutil/iam_resources_generated.go b/vendor/github.com/hashicorp/vault-plugin-secrets-gcp/plugin/iamutil/resources_generated.go similarity index 68% rename from vendor/github.com/hashicorp/vault-plugin-secrets-gcp/plugin/iamutil/iam_resources_generated.go rename to vendor/github.com/hashicorp/vault-plugin-secrets-gcp/plugin/iamutil/resources_generated.go index 1d6d5e9af..e33030c64 100644 --- a/vendor/github.com/hashicorp/vault-plugin-secrets-gcp/plugin/iamutil/iam_resources_generated.go +++ b/vendor/github.com/hashicorp/vault-plugin-secrets-gcp/plugin/iamutil/resources_generated.go @@ -1,14 +1,14 @@ // THIS FILE IS AUTOGENERATED USING go generate. DO NOT EDIT. package iamutil -func GetEnabledIamResources() GeneratedResources { - return generatedIamResources +func GetEnabledResources() GeneratedResources { + return generatedResources } -var generatedIamResources = map[string]map[string]map[string]IamRestResource{ +var generatedResources = map[string]map[string]map[string]RestResource{ "": { "iap": { - "v1": IamRestResource{ + "v1": RestResource{ Name: "v1", TypeKey: "", Service: "iap", @@ -27,7 +27,7 @@ var generatedIamResources = map[string]map[string]map[string]IamRestResource{ RequestFormat: `{"policy": %s}`, }, }, - "v1beta1": IamRestResource{ + "v1beta1": RestResource{ Name: "v1beta1", TypeKey: "", Service: "iap", @@ -50,7 +50,7 @@ var generatedIamResources = map[string]map[string]map[string]IamRestResource{ }, "b": { "storage": { - "v1": IamRestResource{ + "v1": RestResource{ Name: "buckets", TypeKey: "b", Service: "storage", @@ -62,12 +62,12 @@ var generatedIamResources = map[string]map[string]map[string]IamRestResource{ }, GetMethod: RestMethod{ HttpMethod: "GET", - BaseURL: "https://www.googleapis.com/storage/v1/", + BaseURL: "https://storage.googleapis.com/storage/v1/", Path: "b/{bucket}/iam", }, SetMethod: RestMethod{ HttpMethod: "PUT", - BaseURL: "https://www.googleapis.com/storage/v1/", + BaseURL: "https://storage.googleapis.com/storage/v1/", Path: "b/{bucket}/iam", RequestFormat: `%s`, }, @@ -76,7 +76,7 @@ var generatedIamResources = map[string]map[string]map[string]IamRestResource{ }, "b/o": { "storage": { - "v1": IamRestResource{ + "v1": RestResource{ Name: "objects", TypeKey: "b/o", Service: "storage", @@ -90,12 +90,12 @@ var generatedIamResources = map[string]map[string]map[string]IamRestResource{ }, GetMethod: RestMethod{ HttpMethod: "GET", - BaseURL: "https://www.googleapis.com/storage/v1/", + BaseURL: "https://storage.googleapis.com/storage/v1/", Path: "b/{bucket}/o/{object}/iam", }, SetMethod: RestMethod{ HttpMethod: "PUT", - BaseURL: "https://www.googleapis.com/storage/v1/", + BaseURL: "https://storage.googleapis.com/storage/v1/", Path: "b/{bucket}/o/{object}/iam", RequestFormat: `%s`, }, @@ -104,7 +104,7 @@ var generatedIamResources = map[string]map[string]map[string]IamRestResource{ }, "billingAccounts": { "cloudbilling": { - "v1": IamRestResource{ + "v1": RestResource{ Name: "billingAccounts", TypeKey: "billingAccounts", Service: "cloudbilling", @@ -127,7 +127,7 @@ var generatedIamResources = map[string]map[string]map[string]IamRestResource{ }, "buckets": { "storage": { - "v1": IamRestResource{ + "v1": RestResource{ Name: "buckets", TypeKey: "buckets", Service: "storage", @@ -139,12 +139,12 @@ var generatedIamResources = map[string]map[string]map[string]IamRestResource{ }, GetMethod: RestMethod{ HttpMethod: "GET", - BaseURL: "https://www.googleapis.com/storage/v1/", + BaseURL: "https://storage.googleapis.com/storage/v1/", Path: "b/{bucket}/iam", }, SetMethod: RestMethod{ HttpMethod: "PUT", - BaseURL: "https://www.googleapis.com/storage/v1/", + BaseURL: "https://storage.googleapis.com/storage/v1/", Path: "b/{bucket}/iam", RequestFormat: `%s`, }, @@ -153,7 +153,7 @@ var generatedIamResources = map[string]map[string]map[string]IamRestResource{ }, "buckets/objects": { "storage": { - "v1": IamRestResource{ + "v1": RestResource{ Name: "objects", TypeKey: "buckets/objects", Service: "storage", @@ -167,44 +167,21 @@ var generatedIamResources = map[string]map[string]map[string]IamRestResource{ }, GetMethod: RestMethod{ HttpMethod: "GET", - BaseURL: "https://www.googleapis.com/storage/v1/", + BaseURL: "https://storage.googleapis.com/storage/v1/", Path: "b/{bucket}/o/{object}/iam", }, SetMethod: RestMethod{ HttpMethod: "PUT", - BaseURL: "https://www.googleapis.com/storage/v1/", + BaseURL: "https://storage.googleapis.com/storage/v1/", Path: "b/{bucket}/o/{object}/iam", RequestFormat: `%s`, }, }, }, }, - "datasets": { - "genomics": { - "v1": IamRestResource{ - Name: "datasets", - TypeKey: "datasets", - Service: "genomics", - IsPreferredVersion: true, - Parameters: []string{"resource"}, - CollectionReplacementKeys: map[string]string{}, - GetMethod: RestMethod{ - HttpMethod: "POST", - BaseURL: "https://genomics.googleapis.com/", - Path: "v1/{+resource}:getIamPolicy", - }, - SetMethod: RestMethod{ - HttpMethod: "POST", - BaseURL: "https://genomics.googleapis.com/", - Path: "v1/{+resource}:setIamPolicy", - RequestFormat: `{"policy": %s}`, - }, - }, - }, - }, "folders": { "cloudresourcemanager": { - "v2": IamRestResource{ + "v2": RestResource{ Name: "folders", TypeKey: "folders", Service: "cloudresourcemanager", @@ -223,7 +200,7 @@ var generatedIamResources = map[string]map[string]map[string]IamRestResource{ RequestFormat: `{"policy": %s}`, }, }, - "v2beta1": IamRestResource{ + "v2beta1": RestResource{ Name: "folders", TypeKey: "folders", Service: "cloudresourcemanager", @@ -246,7 +223,7 @@ var generatedIamResources = map[string]map[string]map[string]IamRestResource{ }, "organizations": { "cloudresourcemanager": { - "v1": IamRestResource{ + "v1": RestResource{ Name: "organizations", TypeKey: "organizations", Service: "cloudresourcemanager", @@ -265,7 +242,7 @@ var generatedIamResources = map[string]map[string]map[string]IamRestResource{ RequestFormat: `{"policy": %s}`, }, }, - "v1beta1": IamRestResource{ + "v1beta1": RestResource{ Name: "organizations", TypeKey: "organizations", Service: "cloudresourcemanager", @@ -286,9 +263,70 @@ var generatedIamResources = map[string]map[string]map[string]IamRestResource{ }, }, }, + "organizations/sources": { + "securitycenter": { + "v1": RestResource{ + Name: "sources", + TypeKey: "organizations/sources", + Service: "securitycenter", + IsPreferredVersion: true, + Parameters: []string{"resource"}, + CollectionReplacementKeys: map[string]string{}, + GetMethod: RestMethod{ + HttpMethod: "POST", + BaseURL: "https://securitycenter.googleapis.com/", + Path: "v1/{+resource}:getIamPolicy", + }, + SetMethod: RestMethod{ + HttpMethod: "POST", + BaseURL: "https://securitycenter.googleapis.com/", + Path: "v1/{+resource}:setIamPolicy", + RequestFormat: `{"policy": %s}`, + }, + }, + "v1beta1": RestResource{ + Name: "sources", + TypeKey: "organizations/sources", + Service: "securitycenter", + IsPreferredVersion: false, + Parameters: []string{"resource"}, + CollectionReplacementKeys: map[string]string{}, + GetMethod: RestMethod{ + HttpMethod: "POST", + BaseURL: "https://securitycenter.googleapis.com/", + Path: "v1beta1/{+resource}:getIamPolicy", + }, + SetMethod: RestMethod{ + HttpMethod: "POST", + BaseURL: "https://securitycenter.googleapis.com/", + Path: "v1beta1/{+resource}:setIamPolicy", + RequestFormat: `{"policy": %s}`, + }, + }, + "v1p1beta1": RestResource{ + Name: "sources", + TypeKey: "organizations/sources", + Service: "securitycenter", + IsPreferredVersion: false, + Parameters: []string{"resource"}, + CollectionReplacementKeys: map[string]string{}, + GetMethod: RestMethod{ + HttpMethod: "POST", + BaseURL: "https://securitycenter.googleapis.com/", + Path: "v1p1beta1/{+resource}:getIamPolicy", + }, + SetMethod: RestMethod{ + HttpMethod: "POST", + BaseURL: "https://securitycenter.googleapis.com/", + Path: "v1p1beta1/{+resource}:setIamPolicy", + RequestFormat: `{"policy": %s}`, + }, + }, + }, + }, "projects": { "cloudresourcemanager": { - "v1": IamRestResource{ + "v1": RestResource{ Name: "projects", TypeKey: "projects", Service: "cloudresourcemanager", @@ -309,7 +347,7 @@ var generatedIamResources = map[string]map[string]map[string]IamRestResource{ RequestFormat: `{"policy": %s}`, }, }, - "v1beta1": IamRestResource{ + "v1beta1": RestResource{ Name: "projects", TypeKey: "projects", Service: "cloudresourcemanager", @@ -334,7 +372,7 @@ var generatedIamResources = map[string]map[string]map[string]IamRestResource{ }, "projects/backendBuckets": { "compute": { - "alpha": IamRestResource{ + "alpha": RestResource{ Name: "backendBuckets", TypeKey: "projects/backendBuckets", Service: "compute", @@ -346,12 +384,12 @@ var generatedIamResources = map[string]map[string]map[string]IamRestResource{ }, GetMethod: RestMethod{ HttpMethod: "GET", - BaseURL: "https://www.googleapis.com/compute/alpha/projects/", + BaseURL: "https://compute.googleapis.com/compute/alpha/projects/", Path: "{project}/global/backendBuckets/{resource}/getIamPolicy", }, SetMethod: RestMethod{ HttpMethod: "POST", - BaseURL: "https://www.googleapis.com/compute/alpha/projects/", + BaseURL: "https://compute.googleapis.com/compute/alpha/projects/", Path: "{project}/global/backendBuckets/{resource}/setIamPolicy", RequestFormat: `{"policy": %s}`, }, @@ -360,7 +398,7 @@ var generatedIamResources = map[string]map[string]map[string]IamRestResource{ }, "projects/configs": { "runtimeconfig": { - "v1beta1": IamRestResource{ + "v1beta1": RestResource{ Name: "configs", TypeKey: "projects/configs", Service: "runtimeconfig", @@ -381,9 +419,32 @@ var generatedIamResources = map[string]map[string]map[string]IamRestResource{ }, }, }, + "projects/datasets": { + "bigquery": { + "v2": RestResource{ + Name: "datasets", + TypeKey: "projects/datasets", + Service: "bigquery", + IsPreferredVersion: true, + Parameters: []string{"resource"}, + CollectionReplacementKeys: map[string]string{}, + GetMethod: RestMethod{ + HttpMethod: "GET", + BaseURL: "https://bigquery.googleapis.com", + Path: "bigquery/v2/{+resource}", + }, + SetMethod: RestMethod{ + HttpMethod: "PATCH", + BaseURL: "https://bigquery.googleapis.com", + Path: "bigquery/v2/{+resource}", + RequestFormat: `%s`, + }, + }, + }, + }, "projects/deployments": { "deploymentmanager": { - "alpha": IamRestResource{ + "alpha": RestResource{ Name: "deployments", TypeKey: "projects/deployments", Service: "deploymentmanager", @@ -405,7 +466,7 @@ var generatedIamResources = map[string]map[string]map[string]IamRestResource{ RequestFormat: `{"policy": %s}`, }, }, - "v2": IamRestResource{ + "v2": RestResource{ Name: "deployments", TypeKey: "projects/deployments", Service: "deploymentmanager", @@ -427,7 +488,7 @@ var generatedIamResources = map[string]map[string]map[string]IamRestResource{ RequestFormat: `{"policy": %s}`, }, }, - "v2beta": IamRestResource{ + "v2beta": RestResource{ Name: "deployments", TypeKey: "projects/deployments", Service: "deploymentmanager", @@ -453,7 +514,7 @@ var generatedIamResources = map[string]map[string]map[string]IamRestResource{ }, "projects/images": { "compute": { - "alpha": IamRestResource{ + "alpha": RestResource{ Name: "images", TypeKey: "projects/images", Service: "compute", @@ -465,17 +526,17 @@ var generatedIamResources = map[string]map[string]map[string]IamRestResource{ }, GetMethod: RestMethod{ HttpMethod: "GET", - BaseURL: "https://www.googleapis.com/compute/alpha/projects/", + BaseURL: "https://compute.googleapis.com/compute/alpha/projects/", Path: "{project}/global/images/{resource}/getIamPolicy", }, SetMethod: RestMethod{ HttpMethod: "POST", - BaseURL: "https://www.googleapis.com/compute/alpha/projects/", + BaseURL: "https://compute.googleapis.com/compute/alpha/projects/", Path: "{project}/global/images/{resource}/setIamPolicy", RequestFormat: `{"policy": %s}`, }, }, - "beta": IamRestResource{ + "beta": RestResource{ Name: "images", TypeKey: "projects/images", Service: "compute", @@ -487,17 +548,17 @@ var generatedIamResources = map[string]map[string]map[string]IamRestResource{ }, GetMethod: RestMethod{ HttpMethod: "GET", - BaseURL: "https://www.googleapis.com/compute/beta/projects/", + BaseURL: "https://compute.googleapis.com/compute/beta/projects/", Path: "{project}/global/images/{resource}/getIamPolicy", }, SetMethod: RestMethod{ HttpMethod: "POST", - BaseURL: "https://www.googleapis.com/compute/beta/projects/", + BaseURL: "https://compute.googleapis.com/compute/beta/projects/", Path: "{project}/global/images/{resource}/setIamPolicy", RequestFormat: `{"policy": %s}`, }, }, - "v1": IamRestResource{ + "v1": RestResource{ Name: "images", TypeKey: "projects/images", Service: "compute", @@ -509,12 +570,12 @@ var generatedIamResources = map[string]map[string]map[string]IamRestResource{ }, GetMethod: RestMethod{ HttpMethod: "GET", - BaseURL: "https://www.googleapis.com/compute/v1/projects/", + BaseURL: "https://compute.googleapis.com/compute/v1/projects/", Path: "{project}/global/images/{resource}/getIamPolicy", }, SetMethod: RestMethod{ HttpMethod: "POST", - BaseURL: "https://www.googleapis.com/compute/v1/projects/", + BaseURL: "https://compute.googleapis.com/compute/v1/projects/", Path: "{project}/global/images/{resource}/setIamPolicy", RequestFormat: `{"policy": %s}`, }, @@ -523,7 +584,7 @@ var generatedIamResources = map[string]map[string]map[string]IamRestResource{ }, "projects/instanceTemplates": { "compute": { - "alpha": IamRestResource{ + "alpha": RestResource{ Name: "instanceTemplates", TypeKey: "projects/instanceTemplates", Service: "compute", @@ -535,17 +596,17 @@ var generatedIamResources = map[string]map[string]map[string]IamRestResource{ }, GetMethod: RestMethod{ HttpMethod: "GET", - BaseURL: "https://www.googleapis.com/compute/alpha/projects/", + BaseURL: "https://compute.googleapis.com/compute/alpha/projects/", Path: "{project}/global/instanceTemplates/{resource}/getIamPolicy", }, SetMethod: RestMethod{ HttpMethod: "POST", - BaseURL: "https://www.googleapis.com/compute/alpha/projects/", + BaseURL: "https://compute.googleapis.com/compute/alpha/projects/", Path: "{project}/global/instanceTemplates/{resource}/setIamPolicy", RequestFormat: `{"policy": %s}`, }, }, - "beta": IamRestResource{ + "beta": RestResource{ Name: "instanceTemplates", TypeKey: "projects/instanceTemplates", Service: "compute", @@ -557,17 +618,17 @@ var generatedIamResources = map[string]map[string]map[string]IamRestResource{ }, GetMethod: RestMethod{ HttpMethod: "GET", - BaseURL: "https://www.googleapis.com/compute/beta/projects/", + BaseURL: "https://compute.googleapis.com/compute/beta/projects/", Path: "{project}/global/instanceTemplates/{resource}/getIamPolicy", }, SetMethod: RestMethod{ HttpMethod: "POST", - BaseURL: "https://www.googleapis.com/compute/beta/projects/", + BaseURL: "https://compute.googleapis.com/compute/beta/projects/", Path: "{project}/global/instanceTemplates/{resource}/setIamPolicy", RequestFormat: `{"policy": %s}`, }, }, - "v1": IamRestResource{ + "v1": RestResource{ Name: "instanceTemplates", TypeKey: "projects/instanceTemplates", Service: "compute", @@ -579,12 +640,12 @@ var generatedIamResources = map[string]map[string]map[string]IamRestResource{ }, GetMethod: RestMethod{ HttpMethod: "GET", - BaseURL: "https://www.googleapis.com/compute/v1/projects/", + BaseURL: "https://compute.googleapis.com/compute/v1/projects/", Path: "{project}/global/instanceTemplates/{resource}/getIamPolicy", }, SetMethod: RestMethod{ HttpMethod: "POST", - BaseURL: "https://www.googleapis.com/compute/v1/projects/", + BaseURL: "https://compute.googleapis.com/compute/v1/projects/", Path: "{project}/global/instanceTemplates/{resource}/setIamPolicy", RequestFormat: `{"policy": %s}`, }, @@ -593,7 +654,7 @@ var generatedIamResources = map[string]map[string]map[string]IamRestResource{ }, "projects/instances": { "bigtableadmin": { - "v2": IamRestResource{ + "v2": RestResource{ Name: "instances", TypeKey: "projects/instances", Service: "bigtableadmin", @@ -614,7 +675,7 @@ var generatedIamResources = map[string]map[string]map[string]IamRestResource{ }, }, "spanner": { - "v1": IamRestResource{ + "v1": RestResource{ Name: "instances", TypeKey: "projects/instances", Service: "spanner", @@ -635,9 +696,55 @@ var generatedIamResources = map[string]map[string]map[string]IamRestResource{ }, }, }, + "projects/instances/backups": { + "spanner": { + "v1": RestResource{ + Name: "backups", + TypeKey: "projects/instances/backups", + Service: "spanner", + IsPreferredVersion: true, + Parameters: []string{"resource"}, + CollectionReplacementKeys: map[string]string{}, + GetMethod: RestMethod{ + HttpMethod: "POST", + BaseURL: "https://spanner.googleapis.com/", + Path: "v1/{+resource}:getIamPolicy", + }, + SetMethod: RestMethod{ + HttpMethod: "POST", + BaseURL: "https://spanner.googleapis.com/", + Path: "v1/{+resource}:setIamPolicy", + RequestFormat: `{"policy": %s}`, + }, + }, + }, + }, + "projects/instances/clusters/backups": { + "bigtableadmin": { + "v2": RestResource{ + Name: "backups", + TypeKey: "projects/instances/clusters/backups", + Service: "bigtableadmin", + IsPreferredVersion: true, + Parameters: []string{"resource"}, + CollectionReplacementKeys: map[string]string{}, + GetMethod: RestMethod{ + HttpMethod: "POST", + BaseURL: "https://bigtableadmin.googleapis.com/", + Path: "v2/{+resource}:getIamPolicy", + }, + SetMethod: RestMethod{ + HttpMethod: "POST", + BaseURL: "https://bigtableadmin.googleapis.com/", + Path: "v2/{+resource}:setIamPolicy", + RequestFormat: `{"policy": %s}`, + }, + }, + }, + }, "projects/instances/databases": { "spanner": { - "v1": IamRestResource{ + "v1": RestResource{ Name: "databases", TypeKey: "projects/instances/databases", Service: "spanner", @@ -658,9 +765,32 @@ var generatedIamResources = map[string]map[string]map[string]IamRestResource{ }, }, }, + "projects/instances/tables": { + "bigtableadmin": { + "v2": RestResource{ + Name: "tables", + TypeKey: "projects/instances/tables", + Service: "bigtableadmin", + IsPreferredVersion: true, + Parameters: []string{"resource"}, + CollectionReplacementKeys: map[string]string{}, + GetMethod: RestMethod{ + HttpMethod: "POST", + BaseURL: "https://bigtableadmin.googleapis.com/", + Path: "v2/{+resource}:getIamPolicy", + }, + SetMethod: RestMethod{ + HttpMethod: "POST", + BaseURL: "https://bigtableadmin.googleapis.com/", + Path: "v2/{+resource}:setIamPolicy", + RequestFormat: `{"policy": %s}`, + }, + }, + }, + }, "projects/interconnects": { "compute": { - "alpha": IamRestResource{ + "alpha": RestResource{ Name: "interconnects", TypeKey: "projects/interconnects", Service: "compute", @@ -672,12 +802,12 @@ var generatedIamResources = map[string]map[string]map[string]IamRestResource{ }, GetMethod: RestMethod{ HttpMethod: "GET", - BaseURL: "https://www.googleapis.com/compute/alpha/projects/", + BaseURL: "https://compute.googleapis.com/compute/alpha/projects/", Path: "{project}/global/interconnects/{resource}/getIamPolicy", }, SetMethod: RestMethod{ HttpMethod: "POST", - BaseURL: "https://www.googleapis.com/compute/alpha/projects/", + BaseURL: "https://compute.googleapis.com/compute/alpha/projects/", Path: "{project}/global/interconnects/{resource}/setIamPolicy", RequestFormat: `{"policy": %s}`, }, @@ -686,7 +816,7 @@ var generatedIamResources = map[string]map[string]map[string]IamRestResource{ }, "projects/licenseCodes": { "compute": { - "alpha": IamRestResource{ + "alpha": RestResource{ Name: "licenseCodes", TypeKey: "projects/licenseCodes", Service: "compute", @@ -698,12 +828,12 @@ var generatedIamResources = map[string]map[string]map[string]IamRestResource{ }, GetMethod: RestMethod{ HttpMethod: "GET", - BaseURL: "https://www.googleapis.com/compute/alpha/projects/", + BaseURL: "https://compute.googleapis.com/compute/alpha/projects/", Path: "{project}/global/licenseCodes/{resource}/getIamPolicy", }, SetMethod: RestMethod{ HttpMethod: "POST", - BaseURL: "https://www.googleapis.com/compute/alpha/projects/", + BaseURL: "https://compute.googleapis.com/compute/alpha/projects/", Path: "{project}/global/licenseCodes/{resource}/setIamPolicy", RequestFormat: `{"policy": %s}`, }, @@ -712,7 +842,7 @@ var generatedIamResources = map[string]map[string]map[string]IamRestResource{ }, "projects/licenses": { "compute": { - "alpha": IamRestResource{ + "alpha": RestResource{ Name: "licenses", TypeKey: "projects/licenses", Service: "compute", @@ -724,17 +854,17 @@ var generatedIamResources = map[string]map[string]map[string]IamRestResource{ }, GetMethod: RestMethod{ HttpMethod: "GET", - BaseURL: "https://www.googleapis.com/compute/alpha/projects/", + BaseURL: "https://compute.googleapis.com/compute/alpha/projects/", Path: "{project}/global/licenses/{resource}/getIamPolicy", }, SetMethod: RestMethod{ HttpMethod: "POST", - BaseURL: "https://www.googleapis.com/compute/alpha/projects/", + BaseURL: "https://compute.googleapis.com/compute/alpha/projects/", Path: "{project}/global/licenses/{resource}/setIamPolicy", RequestFormat: `{"policy": %s}`, }, }, - "beta": IamRestResource{ + "beta": RestResource{ Name: "licenses", TypeKey: "projects/licenses", Service: "compute", @@ -746,17 +876,17 @@ var generatedIamResources = map[string]map[string]map[string]IamRestResource{ }, GetMethod: RestMethod{ HttpMethod: "GET", - BaseURL: "https://www.googleapis.com/compute/beta/projects/", + BaseURL: "https://compute.googleapis.com/compute/beta/projects/", Path: "{project}/global/licenses/{resource}/getIamPolicy", }, SetMethod: RestMethod{ HttpMethod: "POST", - BaseURL: "https://www.googleapis.com/compute/beta/projects/", + BaseURL: "https://compute.googleapis.com/compute/beta/projects/", Path: "{project}/global/licenses/{resource}/setIamPolicy", RequestFormat: `{"policy": %s}`, }, }, - "v1": IamRestResource{ + "v1": RestResource{ Name: "licenses", TypeKey: "projects/licenses", Service: "compute", @@ -768,12 +898,12 @@ var generatedIamResources = map[string]map[string]map[string]IamRestResource{ }, GetMethod: RestMethod{ HttpMethod: "GET", - BaseURL: "https://www.googleapis.com/compute/v1/projects/", + BaseURL: "https://compute.googleapis.com/compute/v1/projects/", Path: "{project}/global/licenses/{resource}/getIamPolicy", }, SetMethod: RestMethod{ HttpMethod: "POST", - BaseURL: "https://www.googleapis.com/compute/v1/projects/", + BaseURL: "https://compute.googleapis.com/compute/v1/projects/", Path: "{project}/global/licenses/{resource}/setIamPolicy", RequestFormat: `{"policy": %s}`, }, @@ -782,7 +912,26 @@ var generatedIamResources = map[string]map[string]map[string]IamRestResource{ }, "projects/locations/autoscalingPolicies": { "dataproc": { - "v1beta2": IamRestResource{ + "v1": RestResource{ + Name: "autoscalingPolicies", + TypeKey: "projects/locations/autoscalingPolicies", + Service: "dataproc", + IsPreferredVersion: true, + Parameters: []string{"resource"}, + CollectionReplacementKeys: map[string]string{}, + GetMethod: RestMethod{ + HttpMethod: "POST", + BaseURL: "https://dataproc.googleapis.com/", + Path: "v1/{+resource}:getIamPolicy", + }, + SetMethod: RestMethod{ + HttpMethod: "POST", + BaseURL: "https://dataproc.googleapis.com/", + Path: "v1/{+resource}:setIamPolicy", + RequestFormat: `{"policy": %s}`, + }, + }, + "v1beta2": RestResource{ Name: "autoscalingPolicies", TypeKey: "projects/locations/autoscalingPolicies", Service: "dataproc", @@ -803,28 +952,55 @@ var generatedIamResources = map[string]map[string]map[string]IamRestResource{ }, }, }, - "projects/locations/datasets": { - "healthcare": { - "v1alpha": IamRestResource{ - Name: "datasets", - TypeKey: "projects/locations/datasets", - Service: "healthcare", - IsPreferredVersion: false, + "projects/locations/connections": { + "bigqueryconnection": { + "v1beta1": RestResource{ + Name: "connections", + TypeKey: "projects/locations/connections", + Service: "bigqueryconnection", + IsPreferredVersion: true, + Parameters: []string{"resource"}, + CollectionReplacementKeys: map[string]string{}, + GetMethod: RestMethod{ + HttpMethod: "POST", + BaseURL: "https://bigqueryconnection.googleapis.com/", + Path: "v1beta1/{+resource}:getIamPolicy", + }, + SetMethod: RestMethod{ + HttpMethod: "POST", + BaseURL: "https://bigqueryconnection.googleapis.com/", + Path: "v1beta1/{+resource}:setIamPolicy", + RequestFormat: `{"policy": %s}`, + }, + }, + }, + }, + "projects/locations/connectivityTests": { + "networkmanagement": { + "v1beta1": RestResource{ + Name: "connectivityTests", + TypeKey: "projects/locations/connectivityTests", + Service: "networkmanagement", + IsPreferredVersion: true, Parameters: []string{"resource"}, CollectionReplacementKeys: map[string]string{}, GetMethod: RestMethod{ HttpMethod: "GET", - BaseURL: "https://healthcare.googleapis.com/", - Path: "v1alpha/{+resource}:getIamPolicy", + BaseURL: "https://networkmanagement.googleapis.com/", + Path: "v1beta1/{+resource}:getIamPolicy", }, SetMethod: RestMethod{ HttpMethod: "POST", - BaseURL: "https://healthcare.googleapis.com/", - Path: "v1alpha/{+resource}:setIamPolicy", + BaseURL: "https://networkmanagement.googleapis.com/", + Path: "v1beta1/{+resource}:setIamPolicy", RequestFormat: `{"policy": %s}`, }, }, - "v1alpha2": IamRestResource{ + }, + }, + "projects/locations/datasets": { + "healthcare": { + "v1beta1": RestResource{ Name: "datasets", TypeKey: "projects/locations/datasets", Service: "healthcare", @@ -834,12 +1010,12 @@ var generatedIamResources = map[string]map[string]map[string]IamRestResource{ GetMethod: RestMethod{ HttpMethod: "GET", BaseURL: "https://healthcare.googleapis.com/", - Path: "v1alpha2/{+resource}:getIamPolicy", + Path: "v1beta1/{+resource}:getIamPolicy", }, SetMethod: RestMethod{ HttpMethod: "POST", BaseURL: "https://healthcare.googleapis.com/", - Path: "v1alpha2/{+resource}:setIamPolicy", + Path: "v1beta1/{+resource}:setIamPolicy", RequestFormat: `{"policy": %s}`, }, }, @@ -847,26 +1023,7 @@ var generatedIamResources = map[string]map[string]map[string]IamRestResource{ }, "projects/locations/datasets/annotationStores": { "healthcare": { - "v1alpha": IamRestResource{ - Name: "annotationStores", - TypeKey: "projects/locations/datasets/annotationStores", - Service: "healthcare", - IsPreferredVersion: false, - Parameters: []string{"resource"}, - CollectionReplacementKeys: map[string]string{}, - GetMethod: RestMethod{ - HttpMethod: "POST", - BaseURL: "https://healthcare.googleapis.com/", - Path: "v1alpha/{+resource}:getIamPolicy", - }, - SetMethod: RestMethod{ - HttpMethod: "POST", - BaseURL: "https://healthcare.googleapis.com/", - Path: "v1alpha/{+resource}:setIamPolicy", - RequestFormat: `{"policy": %s}`, - }, - }, - "v1alpha2": IamRestResource{ + "v1beta1": RestResource{ Name: "annotationStores", TypeKey: "projects/locations/datasets/annotationStores", Service: "healthcare", @@ -874,14 +1031,14 @@ var generatedIamResources = map[string]map[string]map[string]IamRestResource{ Parameters: []string{"resource"}, CollectionReplacementKeys: map[string]string{}, GetMethod: RestMethod{ - HttpMethod: "POST", + HttpMethod: "GET", BaseURL: "https://healthcare.googleapis.com/", - Path: "v1alpha2/{+resource}:getIamPolicy", + Path: "v1beta1/{+resource}:getIamPolicy", }, SetMethod: RestMethod{ HttpMethod: "POST", BaseURL: "https://healthcare.googleapis.com/", - Path: "v1alpha2/{+resource}:setIamPolicy", + Path: "v1beta1/{+resource}:setIamPolicy", RequestFormat: `{"policy": %s}`, }, }, @@ -889,26 +1046,7 @@ var generatedIamResources = map[string]map[string]map[string]IamRestResource{ }, "projects/locations/datasets/dicomStores": { "healthcare": { - "v1alpha": IamRestResource{ - Name: "dicomStores", - TypeKey: "projects/locations/datasets/dicomStores", - Service: "healthcare", - IsPreferredVersion: false, - Parameters: []string{"resource"}, - CollectionReplacementKeys: map[string]string{}, - GetMethod: RestMethod{ - HttpMethod: "GET", - BaseURL: "https://healthcare.googleapis.com/", - Path: "v1alpha/{+resource}:getIamPolicy", - }, - SetMethod: RestMethod{ - HttpMethod: "POST", - BaseURL: "https://healthcare.googleapis.com/", - Path: "v1alpha/{+resource}:setIamPolicy", - RequestFormat: `{"policy": %s}`, - }, - }, - "v1alpha2": IamRestResource{ + "v1beta1": RestResource{ Name: "dicomStores", TypeKey: "projects/locations/datasets/dicomStores", Service: "healthcare", @@ -918,12 +1056,12 @@ var generatedIamResources = map[string]map[string]map[string]IamRestResource{ GetMethod: RestMethod{ HttpMethod: "GET", BaseURL: "https://healthcare.googleapis.com/", - Path: "v1alpha2/{+resource}:getIamPolicy", + Path: "v1beta1/{+resource}:getIamPolicy", }, SetMethod: RestMethod{ HttpMethod: "POST", BaseURL: "https://healthcare.googleapis.com/", - Path: "v1alpha2/{+resource}:setIamPolicy", + Path: "v1beta1/{+resource}:setIamPolicy", RequestFormat: `{"policy": %s}`, }, }, @@ -931,26 +1069,7 @@ var generatedIamResources = map[string]map[string]map[string]IamRestResource{ }, "projects/locations/datasets/fhirStores": { "healthcare": { - "v1alpha": IamRestResource{ - Name: "fhirStores", - TypeKey: "projects/locations/datasets/fhirStores", - Service: "healthcare", - IsPreferredVersion: false, - Parameters: []string{"resource"}, - CollectionReplacementKeys: map[string]string{}, - GetMethod: RestMethod{ - HttpMethod: "POST", - BaseURL: "https://healthcare.googleapis.com/", - Path: "v1alpha/{+resource}:getIamPolicy", - }, - SetMethod: RestMethod{ - HttpMethod: "POST", - BaseURL: "https://healthcare.googleapis.com/", - Path: "v1alpha/{+resource}:setIamPolicy", - RequestFormat: `{"policy": %s}`, - }, - }, - "v1alpha2": IamRestResource{ + "v1beta1": RestResource{ Name: "fhirStores", TypeKey: "projects/locations/datasets/fhirStores", Service: "healthcare", @@ -960,54 +1079,96 @@ var generatedIamResources = map[string]map[string]map[string]IamRestResource{ GetMethod: RestMethod{ HttpMethod: "GET", BaseURL: "https://healthcare.googleapis.com/", - Path: "v1alpha2/{+resource}:getIamPolicy", + Path: "v1beta1/{+resource}:getIamPolicy", }, SetMethod: RestMethod{ HttpMethod: "POST", BaseURL: "https://healthcare.googleapis.com/", - Path: "v1alpha2/{+resource}:setIamPolicy", + Path: "v1beta1/{+resource}:setIamPolicy", RequestFormat: `{"policy": %s}`, }, }, }, }, - "projects/locations/datasets/fhirStores/securityLabels": { - "healthcare": { - "v1alpha": IamRestResource{ - Name: "securityLabels", - TypeKey: "projects/locations/datasets/fhirStores/securityLabels", - Service: "healthcare", - IsPreferredVersion: false, - Parameters: []string{"resource"}, - CollectionReplacementKeys: map[string]string{}, - GetMethod: RestMethod{ - HttpMethod: "POST", - BaseURL: "https://healthcare.googleapis.com/", - Path: "v1alpha/{+resource}:getIamPolicy", - }, - SetMethod: RestMethod{ - HttpMethod: "POST", - BaseURL: "https://healthcare.googleapis.com/", - Path: "v1alpha/{+resource}:setIamPolicy", - RequestFormat: `{"policy": %s}`, - }, - }, - "v1alpha2": IamRestResource{ - Name: "securityLabels", - TypeKey: "projects/locations/datasets/fhirStores/securityLabels", - Service: "healthcare", + "projects/locations/domains": { + "managedidentities": { + "v1": RestResource{ + Name: "domains", + TypeKey: "projects/locations/domains", + Service: "managedidentities", IsPreferredVersion: true, Parameters: []string{"resource"}, CollectionReplacementKeys: map[string]string{}, GetMethod: RestMethod{ HttpMethod: "GET", - BaseURL: "https://healthcare.googleapis.com/", - Path: "v1alpha2/{+resource}:getIamPolicy", + BaseURL: "https://managedidentities.googleapis.com/", + Path: "v1/{+resource}:getIamPolicy", }, SetMethod: RestMethod{ HttpMethod: "POST", - BaseURL: "https://healthcare.googleapis.com/", - Path: "v1alpha2/{+resource}:setIamPolicy", + BaseURL: "https://managedidentities.googleapis.com/", + Path: "v1/{+resource}:setIamPolicy", + RequestFormat: `{"policy": %s}`, + }, + }, + "v1alpha1": RestResource{ + Name: "domains", + TypeKey: "projects/locations/domains", + Service: "managedidentities", + IsPreferredVersion: false, + Parameters: []string{"resource"}, + CollectionReplacementKeys: map[string]string{}, + GetMethod: RestMethod{ + HttpMethod: "GET", + BaseURL: "https://managedidentities.googleapis.com/", + Path: "v1alpha1/{+resource}:getIamPolicy", + }, + SetMethod: RestMethod{ + HttpMethod: "POST", + BaseURL: "https://managedidentities.googleapis.com/", + Path: "v1alpha1/{+resource}:setIamPolicy", + RequestFormat: `{"policy": %s}`, + }, + }, + "v1beta1": RestResource{ + Name: "domains", + TypeKey: "projects/locations/domains", + Service: "managedidentities", + IsPreferredVersion: false, + Parameters: []string{"resource"}, + CollectionReplacementKeys: map[string]string{}, + GetMethod: RestMethod{ + HttpMethod: "GET", + BaseURL: "https://managedidentities.googleapis.com/", + Path: "v1beta1/{+resource}:getIamPolicy", + }, + SetMethod: RestMethod{ + HttpMethod: "POST", + BaseURL: "https://managedidentities.googleapis.com/", + Path: "v1beta1/{+resource}:setIamPolicy", + RequestFormat: `{"policy": %s}`, + }, + }, + }, + }, + "projects/locations/entryGroups": { + "datacatalog": { + "v1beta1": RestResource{ + Name: "entryGroups", + TypeKey: "projects/locations/entryGroups", + Service: "datacatalog", + IsPreferredVersion: true, + Parameters: []string{"resource"}, + CollectionReplacementKeys: map[string]string{}, + GetMethod: RestMethod{ + HttpMethod: "POST", + BaseURL: "https://datacatalog.googleapis.com/", + Path: "v1beta1/{+resource}:getIamPolicy", + }, + SetMethod: RestMethod{ + HttpMethod: "POST", + BaseURL: "https://datacatalog.googleapis.com/", + Path: "v1beta1/{+resource}:setIamPolicy", RequestFormat: `{"policy": %s}`, }, }, @@ -1015,7 +1176,7 @@ var generatedIamResources = map[string]map[string]map[string]IamRestResource{ }, "projects/locations/functions": { "cloudfunctions": { - "v1": IamRestResource{ + "v1": RestResource{ Name: "functions", TypeKey: "projects/locations/functions", Service: "cloudfunctions", @@ -1036,9 +1197,53 @@ var generatedIamResources = map[string]map[string]map[string]IamRestResource{ }, }, }, + "projects/locations/instances": { + "datafusion": { + "v1beta1": RestResource{ + Name: "instances", + TypeKey: "projects/locations/instances", + Service: "datafusion", + IsPreferredVersion: true, + Parameters: []string{"resource"}, + CollectionReplacementKeys: map[string]string{}, + GetMethod: RestMethod{ + HttpMethod: "GET", + BaseURL: "https://datafusion.googleapis.com/", + Path: "v1beta1/{+resource}:getIamPolicy", + }, + SetMethod: RestMethod{ + HttpMethod: "POST", + BaseURL: "https://datafusion.googleapis.com/", + Path: "v1beta1/{+resource}:setIamPolicy", + RequestFormat: `{"policy": %s}`, + }, + }, + }, + "memcache": { + "v1beta2": RestResource{ + Name: "instances", + TypeKey: "projects/locations/instances", + Service: "memcache", + IsPreferredVersion: true, + Parameters: []string{"resource"}, + CollectionReplacementKeys: map[string]string{}, + GetMethod: RestMethod{ + HttpMethod: "GET", + BaseURL: "https://memcache.googleapis.com/", + Path: "v1beta2/{+resource}:getIamPolicy", + }, + SetMethod: RestMethod{ + HttpMethod: "POST", + BaseURL: "https://memcache.googleapis.com/", + Path: "v1beta2/{+resource}:setIamPolicy", + RequestFormat: `{"policy": %s}`, + }, + }, + }, + }, "projects/locations/keyRings": { "cloudkms": { - "v1": IamRestResource{ + "v1": RestResource{ Name: "keyRings", TypeKey: "projects/locations/keyRings", Service: "cloudkms", @@ -1061,7 +1266,7 @@ var generatedIamResources = map[string]map[string]map[string]IamRestResource{ }, "projects/locations/keyRings/cryptoKeys": { "cloudkms": { - "v1": IamRestResource{ + "v1": RestResource{ Name: "cryptoKeys", TypeKey: "projects/locations/keyRings/cryptoKeys", Service: "cloudkms", @@ -1084,7 +1289,7 @@ var generatedIamResources = map[string]map[string]map[string]IamRestResource{ }, "projects/locations/keyRings/importJobs": { "cloudkms": { - "v1": IamRestResource{ + "v1": RestResource{ Name: "importJobs", TypeKey: "projects/locations/keyRings/importJobs", Service: "cloudkms", @@ -1105,9 +1310,74 @@ var generatedIamResources = map[string]map[string]map[string]IamRestResource{ }, }, }, + "projects/locations/namespaces": { + "servicedirectory": { + "v1beta1": RestResource{ + Name: "namespaces", + TypeKey: "projects/locations/namespaces", + Service: "servicedirectory", + IsPreferredVersion: true, + Parameters: []string{"resource"}, + CollectionReplacementKeys: map[string]string{}, + GetMethod: RestMethod{ + HttpMethod: "POST", + BaseURL: "https://servicedirectory.googleapis.com/", + Path: "v1beta1/{+resource}:getIamPolicy", + }, + SetMethod: RestMethod{ + HttpMethod: "POST", + BaseURL: "https://servicedirectory.googleapis.com/", + Path: "v1beta1/{+resource}:setIamPolicy", + RequestFormat: `{"policy": %s}`, + }, + }, + }, + }, + "projects/locations/namespaces/services": { + "servicedirectory": { + "v1beta1": RestResource{ + Name: "services", + TypeKey: "projects/locations/namespaces/services", + Service: "servicedirectory", + IsPreferredVersion: true, + Parameters: []string{"resource"}, + CollectionReplacementKeys: map[string]string{}, + GetMethod: RestMethod{ + HttpMethod: "POST", + BaseURL: "https://servicedirectory.googleapis.com/", + Path: "v1beta1/{+resource}:getIamPolicy", + }, + SetMethod: RestMethod{ + HttpMethod: "POST", + BaseURL: "https://servicedirectory.googleapis.com/", + Path: "v1beta1/{+resource}:setIamPolicy", + RequestFormat: `{"policy": %s}`, + }, + }, + }, + }, "projects/locations/queues": { "cloudtasks": { - "v2beta2": IamRestResource{ + "v2": RestResource{ + Name: "queues", + TypeKey: "projects/locations/queues", + Service: "cloudtasks", + IsPreferredVersion: true, + Parameters: []string{"resource"}, + CollectionReplacementKeys: map[string]string{}, + GetMethod: RestMethod{ + HttpMethod: "POST", + BaseURL: "https://cloudtasks.googleapis.com/", + Path: "v2/{+resource}:getIamPolicy", + }, + SetMethod: RestMethod{ + HttpMethod: "POST", + BaseURL: "https://cloudtasks.googleapis.com/", + Path: "v2/{+resource}:setIamPolicy", + RequestFormat: `{"policy": %s}`, + }, + }, + "v2beta2": RestResource{ Name: "queues", TypeKey: "projects/locations/queues", Service: "cloudtasks", @@ -1126,11 +1396,11 @@ var generatedIamResources = map[string]map[string]map[string]IamRestResource{ RequestFormat: `{"policy": %s}`, }, }, - "v2beta3": IamRestResource{ + "v2beta3": RestResource{ Name: "queues", TypeKey: "projects/locations/queues", Service: "cloudtasks", - IsPreferredVersion: true, + IsPreferredVersion: false, Parameters: []string{"resource"}, CollectionReplacementKeys: map[string]string{}, GetMethod: RestMethod{ @@ -1149,7 +1419,7 @@ var generatedIamResources = map[string]map[string]map[string]IamRestResource{ }, "projects/locations/registries": { "cloudiot": { - "v1": IamRestResource{ + "v1": RestResource{ Name: "registries", TypeKey: "projects/locations/registries", Service: "cloudiot", @@ -1172,7 +1442,7 @@ var generatedIamResources = map[string]map[string]map[string]IamRestResource{ }, "projects/locations/registries/groups": { "cloudiot": { - "v1": IamRestResource{ + "v1": RestResource{ Name: "groups", TypeKey: "projects/locations/registries/groups", Service: "cloudiot", @@ -1193,9 +1463,120 @@ var generatedIamResources = map[string]map[string]map[string]IamRestResource{ }, }, }, + "projects/locations/services": { + "run": { + "v1": RestResource{ + Name: "services", + TypeKey: "projects/locations/services", + Service: "run", + IsPreferredVersion: true, + Parameters: []string{"resource"}, + CollectionReplacementKeys: map[string]string{}, + GetMethod: RestMethod{ + HttpMethod: "GET", + BaseURL: "https://run.googleapis.com/", + Path: "v1/{+resource}:getIamPolicy", + }, + SetMethod: RestMethod{ + HttpMethod: "POST", + BaseURL: "https://run.googleapis.com/", + Path: "v1/{+resource}:setIamPolicy", + RequestFormat: `{"policy": %s}`, + }, + }, + "v1alpha1": RestResource{ + Name: "services", + TypeKey: "projects/locations/services", + Service: "run", + IsPreferredVersion: false, + Parameters: []string{"resource"}, + CollectionReplacementKeys: map[string]string{}, + GetMethod: RestMethod{ + HttpMethod: "GET", + BaseURL: "https://run.googleapis.com/", + Path: "v1alpha1/{+resource}:getIamPolicy", + }, + SetMethod: RestMethod{ + HttpMethod: "POST", + BaseURL: "https://run.googleapis.com/", + Path: "v1alpha1/{+resource}:setIamPolicy", + RequestFormat: `{"policy": %s}`, + }, + }, + }, + }, + "projects/locations/tagTemplates": { + "datacatalog": { + "v1beta1": RestResource{ + Name: "tagTemplates", + TypeKey: "projects/locations/tagTemplates", + Service: "datacatalog", + IsPreferredVersion: true, + Parameters: []string{"resource"}, + CollectionReplacementKeys: map[string]string{}, + GetMethod: RestMethod{ + HttpMethod: "POST", + BaseURL: "https://datacatalog.googleapis.com/", + Path: "v1beta1/{+resource}:getIamPolicy", + }, + SetMethod: RestMethod{ + HttpMethod: "POST", + BaseURL: "https://datacatalog.googleapis.com/", + Path: "v1beta1/{+resource}:setIamPolicy", + RequestFormat: `{"policy": %s}`, + }, + }, + }, + }, + "projects/locations/taxonomies": { + "datacatalog": { + "v1beta1": RestResource{ + Name: "taxonomies", + TypeKey: "projects/locations/taxonomies", + Service: "datacatalog", + IsPreferredVersion: true, + Parameters: []string{"resource"}, + CollectionReplacementKeys: map[string]string{}, + GetMethod: RestMethod{ + HttpMethod: "POST", + BaseURL: "https://datacatalog.googleapis.com/", + Path: "v1beta1/{+resource}:getIamPolicy", + }, + SetMethod: RestMethod{ + HttpMethod: "POST", + BaseURL: "https://datacatalog.googleapis.com/", + Path: "v1beta1/{+resource}:setIamPolicy", + RequestFormat: `{"policy": %s}`, + }, + }, + }, + }, + "projects/locations/taxonomies/policyTags": { + "datacatalog": { + "v1beta1": RestResource{ + Name: "policyTags", + TypeKey: "projects/locations/taxonomies/policyTags", + Service: "datacatalog", + IsPreferredVersion: true, + Parameters: []string{"resource"}, + CollectionReplacementKeys: map[string]string{}, + GetMethod: RestMethod{ + HttpMethod: "POST", + BaseURL: "https://datacatalog.googleapis.com/", + Path: "v1beta1/{+resource}:getIamPolicy", + }, + SetMethod: RestMethod{ + HttpMethod: "POST", + BaseURL: "https://datacatalog.googleapis.com/", + Path: "v1beta1/{+resource}:setIamPolicy", + RequestFormat: `{"policy": %s}`, + }, + }, + }, + }, "projects/locations/workflowTemplates": { "dataproc": { - "v1": IamRestResource{ + "v1": RestResource{ Name: "workflowTemplates", TypeKey: "projects/locations/workflowTemplates", Service: "dataproc", @@ -1214,7 +1595,7 @@ var generatedIamResources = map[string]map[string]map[string]IamRestResource{ RequestFormat: `{"policy": %s}`, }, }, - "v1beta2": IamRestResource{ + "v1beta2": RestResource{ Name: "workflowTemplates", TypeKey: "projects/locations/workflowTemplates", Service: "dataproc", @@ -1237,7 +1618,7 @@ var generatedIamResources = map[string]map[string]map[string]IamRestResource{ }, "projects/machineImages": { "compute": { - "alpha": IamRestResource{ + "alpha": RestResource{ Name: "machineImages", TypeKey: "projects/machineImages", Service: "compute", @@ -1249,12 +1630,34 @@ var generatedIamResources = map[string]map[string]map[string]IamRestResource{ }, GetMethod: RestMethod{ HttpMethod: "GET", - BaseURL: "https://www.googleapis.com/compute/alpha/projects/", + BaseURL: "https://compute.googleapis.com/compute/alpha/projects/", Path: "{project}/global/machineImages/{resource}/getIamPolicy", }, SetMethod: RestMethod{ HttpMethod: "POST", - BaseURL: "https://www.googleapis.com/compute/alpha/projects/", + BaseURL: "https://compute.googleapis.com/compute/alpha/projects/", + Path: "{project}/global/machineImages/{resource}/setIamPolicy", + RequestFormat: `{"policy": %s}`, + }, + }, + "beta": RestResource{ + Name: "machineImages", + TypeKey: "projects/machineImages", + Service: "compute", + IsPreferredVersion: false, + Parameters: []string{"project", "resource"}, + CollectionReplacementKeys: map[string]string{ + "machineImages": "resource", + "projects": "project", + }, + GetMethod: RestMethod{ + HttpMethod: "GET", + BaseURL: "https://compute.googleapis.com/compute/beta/projects/", + Path: "{project}/global/machineImages/{resource}/getIamPolicy", + }, + SetMethod: RestMethod{ + HttpMethod: "POST", + BaseURL: "https://compute.googleapis.com/compute/beta/projects/", Path: "{project}/global/machineImages/{resource}/setIamPolicy", RequestFormat: `{"policy": %s}`, }, @@ -1263,7 +1666,7 @@ var generatedIamResources = map[string]map[string]map[string]IamRestResource{ }, "projects/notes": { "containeranalysis": { - "v1alpha1": IamRestResource{ + "v1alpha1": RestResource{ Name: "notes", TypeKey: "projects/notes", Service: "containeranalysis", @@ -1282,7 +1685,7 @@ var generatedIamResources = map[string]map[string]map[string]IamRestResource{ RequestFormat: `{"policy": %s}`, }, }, - "v1beta1": IamRestResource{ + "v1beta1": RestResource{ Name: "notes", TypeKey: "projects/notes", Service: "containeranalysis", @@ -1305,7 +1708,7 @@ var generatedIamResources = map[string]map[string]map[string]IamRestResource{ }, "projects/occurrences": { "containeranalysis": { - "v1alpha1": IamRestResource{ + "v1alpha1": RestResource{ Name: "occurrences", TypeKey: "projects/occurrences", Service: "containeranalysis", @@ -1324,7 +1727,7 @@ var generatedIamResources = map[string]map[string]map[string]IamRestResource{ RequestFormat: `{"policy": %s}`, }, }, - "v1beta1": IamRestResource{ + "v1beta1": RestResource{ Name: "occurrences", TypeKey: "projects/occurrences", Service: "containeranalysis", @@ -1347,7 +1750,26 @@ var generatedIamResources = map[string]map[string]map[string]IamRestResource{ }, "projects/regions/autoscalingPolicies": { "dataproc": { - "v1beta2": IamRestResource{ + "v1": RestResource{ + Name: "autoscalingPolicies", + TypeKey: "projects/regions/autoscalingPolicies", + Service: "dataproc", + IsPreferredVersion: true, + Parameters: []string{"resource"}, + CollectionReplacementKeys: map[string]string{}, + GetMethod: RestMethod{ + HttpMethod: "POST", + BaseURL: "https://dataproc.googleapis.com/", + Path: "v1/{+resource}:getIamPolicy", + }, + SetMethod: RestMethod{ + HttpMethod: "POST", + BaseURL: "https://dataproc.googleapis.com/", + Path: "v1/{+resource}:setIamPolicy", + RequestFormat: `{"policy": %s}`, + }, + }, + "v1beta2": RestResource{ Name: "autoscalingPolicies", TypeKey: "projects/regions/autoscalingPolicies", Service: "dataproc", @@ -1355,7 +1777,7 @@ var generatedIamResources = map[string]map[string]map[string]IamRestResource{ Parameters: []string{"resource"}, CollectionReplacementKeys: map[string]string{}, GetMethod: RestMethod{ - HttpMethod: "POST", + HttpMethod: "GET", BaseURL: "https://dataproc.googleapis.com/", Path: "v1beta2/{+resource}:getIamPolicy", }, @@ -1370,7 +1792,7 @@ var generatedIamResources = map[string]map[string]map[string]IamRestResource{ }, "projects/regions/clusters": { "dataproc": { - "v1": IamRestResource{ + "v1": RestResource{ Name: "clusters", TypeKey: "projects/regions/clusters", Service: "dataproc", @@ -1389,7 +1811,7 @@ var generatedIamResources = map[string]map[string]map[string]IamRestResource{ RequestFormat: `{"policy": %s}`, }, }, - "v1beta2": IamRestResource{ + "v1beta2": RestResource{ Name: "clusters", TypeKey: "projects/regions/clusters", Service: "dataproc", @@ -1412,7 +1834,7 @@ var generatedIamResources = map[string]map[string]map[string]IamRestResource{ }, "projects/regions/disks": { "compute": { - "alpha": IamRestResource{ + "alpha": RestResource{ Name: "regionDisks", TypeKey: "projects/regions/disks", Service: "compute", @@ -1425,17 +1847,17 @@ var generatedIamResources = map[string]map[string]map[string]IamRestResource{ }, GetMethod: RestMethod{ HttpMethod: "GET", - BaseURL: "https://www.googleapis.com/compute/alpha/projects/", + BaseURL: "https://compute.googleapis.com/compute/alpha/projects/", Path: "{project}/regions/{region}/disks/{resource}/getIamPolicy", }, SetMethod: RestMethod{ HttpMethod: "POST", - BaseURL: "https://www.googleapis.com/compute/alpha/projects/", + BaseURL: "https://compute.googleapis.com/compute/alpha/projects/", Path: "{project}/regions/{region}/disks/{resource}/setIamPolicy", RequestFormat: `{"policy": %s}`, }, }, - "beta": IamRestResource{ + "beta": RestResource{ Name: "regionDisks", TypeKey: "projects/regions/disks", Service: "compute", @@ -1448,12 +1870,12 @@ var generatedIamResources = map[string]map[string]map[string]IamRestResource{ }, GetMethod: RestMethod{ HttpMethod: "GET", - BaseURL: "https://www.googleapis.com/compute/beta/projects/", + BaseURL: "https://compute.googleapis.com/compute/beta/projects/", Path: "{project}/regions/{region}/disks/{resource}/getIamPolicy", }, SetMethod: RestMethod{ HttpMethod: "POST", - BaseURL: "https://www.googleapis.com/compute/beta/projects/", + BaseURL: "https://compute.googleapis.com/compute/beta/projects/", Path: "{project}/regions/{region}/disks/{resource}/setIamPolicy", RequestFormat: `{"policy": %s}`, }, @@ -1462,7 +1884,7 @@ var generatedIamResources = map[string]map[string]map[string]IamRestResource{ }, "projects/regions/interconnectAttachments": { "compute": { - "alpha": IamRestResource{ + "alpha": RestResource{ Name: "interconnectAttachments", TypeKey: "projects/regions/interconnectAttachments", Service: "compute", @@ -1475,12 +1897,12 @@ var generatedIamResources = map[string]map[string]map[string]IamRestResource{ }, GetMethod: RestMethod{ HttpMethod: "GET", - BaseURL: "https://www.googleapis.com/compute/alpha/projects/", + BaseURL: "https://compute.googleapis.com/compute/alpha/projects/", Path: "{project}/regions/{region}/interconnectAttachments/{resource}/getIamPolicy", }, SetMethod: RestMethod{ HttpMethod: "POST", - BaseURL: "https://www.googleapis.com/compute/alpha/projects/", + BaseURL: "https://compute.googleapis.com/compute/alpha/projects/", Path: "{project}/regions/{region}/interconnectAttachments/{resource}/setIamPolicy", RequestFormat: `{"policy": %s}`, }, @@ -1489,7 +1911,7 @@ var generatedIamResources = map[string]map[string]map[string]IamRestResource{ }, "projects/regions/jobs": { "dataproc": { - "v1": IamRestResource{ + "v1": RestResource{ Name: "jobs", TypeKey: "projects/regions/jobs", Service: "dataproc", @@ -1508,7 +1930,7 @@ var generatedIamResources = map[string]map[string]map[string]IamRestResource{ RequestFormat: `{"policy": %s}`, }, }, - "v1beta2": IamRestResource{ + "v1beta2": RestResource{ Name: "jobs", TypeKey: "projects/regions/jobs", Service: "dataproc", @@ -1531,7 +1953,7 @@ var generatedIamResources = map[string]map[string]map[string]IamRestResource{ }, "projects/regions/nodeTemplates": { "compute": { - "alpha": IamRestResource{ + "alpha": RestResource{ Name: "nodeTemplates", TypeKey: "projects/regions/nodeTemplates", Service: "compute", @@ -1544,17 +1966,17 @@ var generatedIamResources = map[string]map[string]map[string]IamRestResource{ }, GetMethod: RestMethod{ HttpMethod: "GET", - BaseURL: "https://www.googleapis.com/compute/alpha/projects/", + BaseURL: "https://compute.googleapis.com/compute/alpha/projects/", Path: "{project}/regions/{region}/nodeTemplates/{resource}/getIamPolicy", }, SetMethod: RestMethod{ HttpMethod: "POST", - BaseURL: "https://www.googleapis.com/compute/alpha/projects/", + BaseURL: "https://compute.googleapis.com/compute/alpha/projects/", Path: "{project}/regions/{region}/nodeTemplates/{resource}/setIamPolicy", RequestFormat: `{"policy": %s}`, }, }, - "beta": IamRestResource{ + "beta": RestResource{ Name: "nodeTemplates", TypeKey: "projects/regions/nodeTemplates", Service: "compute", @@ -1567,17 +1989,17 @@ var generatedIamResources = map[string]map[string]map[string]IamRestResource{ }, GetMethod: RestMethod{ HttpMethod: "GET", - BaseURL: "https://www.googleapis.com/compute/beta/projects/", + BaseURL: "https://compute.googleapis.com/compute/beta/projects/", Path: "{project}/regions/{region}/nodeTemplates/{resource}/getIamPolicy", }, SetMethod: RestMethod{ HttpMethod: "POST", - BaseURL: "https://www.googleapis.com/compute/beta/projects/", + BaseURL: "https://compute.googleapis.com/compute/beta/projects/", Path: "{project}/regions/{region}/nodeTemplates/{resource}/setIamPolicy", RequestFormat: `{"policy": %s}`, }, }, - "v1": IamRestResource{ + "v1": RestResource{ Name: "nodeTemplates", TypeKey: "projects/regions/nodeTemplates", Service: "compute", @@ -1590,12 +2012,12 @@ var generatedIamResources = map[string]map[string]map[string]IamRestResource{ }, GetMethod: RestMethod{ HttpMethod: "GET", - BaseURL: "https://www.googleapis.com/compute/v1/projects/", + BaseURL: "https://compute.googleapis.com/compute/v1/projects/", Path: "{project}/regions/{region}/nodeTemplates/{resource}/getIamPolicy", }, SetMethod: RestMethod{ HttpMethod: "POST", - BaseURL: "https://www.googleapis.com/compute/v1/projects/", + BaseURL: "https://compute.googleapis.com/compute/v1/projects/", Path: "{project}/regions/{region}/nodeTemplates/{resource}/setIamPolicy", RequestFormat: `{"policy": %s}`, }, @@ -1604,7 +2026,7 @@ var generatedIamResources = map[string]map[string]map[string]IamRestResource{ }, "projects/regions/operations": { "dataproc": { - "v1": IamRestResource{ + "v1": RestResource{ Name: "operations", TypeKey: "projects/regions/operations", Service: "dataproc", @@ -1623,7 +2045,7 @@ var generatedIamResources = map[string]map[string]map[string]IamRestResource{ RequestFormat: `{"policy": %s}`, }, }, - "v1beta2": IamRestResource{ + "v1beta2": RestResource{ Name: "operations", TypeKey: "projects/regions/operations", Service: "dataproc", @@ -1646,7 +2068,7 @@ var generatedIamResources = map[string]map[string]map[string]IamRestResource{ }, "projects/regions/resourcePolicies": { "compute": { - "alpha": IamRestResource{ + "alpha": RestResource{ Name: "resourcePolicies", TypeKey: "projects/regions/resourcePolicies", Service: "compute", @@ -1659,12 +2081,58 @@ var generatedIamResources = map[string]map[string]map[string]IamRestResource{ }, GetMethod: RestMethod{ HttpMethod: "GET", - BaseURL: "https://www.googleapis.com/compute/alpha/projects/", + BaseURL: "https://compute.googleapis.com/compute/alpha/projects/", Path: "{project}/regions/{region}/resourcePolicies/{resource}/getIamPolicy", }, SetMethod: RestMethod{ HttpMethod: "POST", - BaseURL: "https://www.googleapis.com/compute/alpha/projects/", + BaseURL: "https://compute.googleapis.com/compute/alpha/projects/", + Path: "{project}/regions/{region}/resourcePolicies/{resource}/setIamPolicy", + RequestFormat: `{"policy": %s}`, + }, + }, + "beta": RestResource{ + Name: "resourcePolicies", + TypeKey: "projects/regions/resourcePolicies", + Service: "compute", + IsPreferredVersion: false, + Parameters: []string{"project", "region", "resource"}, + CollectionReplacementKeys: map[string]string{ + "projects": "project", + "regions": "region", + "resourcePolicies": "resource", + }, + GetMethod: RestMethod{ + HttpMethod: "GET", + BaseURL: "https://compute.googleapis.com/compute/beta/projects/", + Path: "{project}/regions/{region}/resourcePolicies/{resource}/getIamPolicy", + }, + SetMethod: RestMethod{ + HttpMethod: "POST", + BaseURL: "https://compute.googleapis.com/compute/beta/projects/", + Path: "{project}/regions/{region}/resourcePolicies/{resource}/setIamPolicy", + RequestFormat: `{"policy": %s}`, + }, + }, + "v1": RestResource{ + Name: "resourcePolicies", + TypeKey: "projects/regions/resourcePolicies", + Service: "compute", + IsPreferredVersion: true, + Parameters: []string{"project", "region", "resource"}, + CollectionReplacementKeys: map[string]string{ + "projects": "project", + "regions": "region", + "resourcePolicies": "resource", + }, + GetMethod: RestMethod{ + HttpMethod: "GET", + BaseURL: "https://compute.googleapis.com/compute/v1/projects/", + Path: "{project}/regions/{region}/resourcePolicies/{resource}/getIamPolicy", + }, + SetMethod: RestMethod{ + HttpMethod: "POST", + BaseURL: "https://compute.googleapis.com/compute/v1/projects/", Path: "{project}/regions/{region}/resourcePolicies/{resource}/setIamPolicy", RequestFormat: `{"policy": %s}`, }, @@ -1673,7 +2141,7 @@ var generatedIamResources = map[string]map[string]map[string]IamRestResource{ }, "projects/regions/subnetworks": { "compute": { - "alpha": IamRestResource{ + "alpha": RestResource{ Name: "subnetworks", TypeKey: "projects/regions/subnetworks", Service: "compute", @@ -1686,17 +2154,17 @@ var generatedIamResources = map[string]map[string]map[string]IamRestResource{ }, GetMethod: RestMethod{ HttpMethod: "GET", - BaseURL: "https://www.googleapis.com/compute/alpha/projects/", + BaseURL: "https://compute.googleapis.com/compute/alpha/projects/", Path: "{project}/regions/{region}/subnetworks/{resource}/getIamPolicy", }, SetMethod: RestMethod{ HttpMethod: "POST", - BaseURL: "https://www.googleapis.com/compute/alpha/projects/", + BaseURL: "https://compute.googleapis.com/compute/alpha/projects/", Path: "{project}/regions/{region}/subnetworks/{resource}/setIamPolicy", RequestFormat: `{"policy": %s}`, }, }, - "beta": IamRestResource{ + "beta": RestResource{ Name: "subnetworks", TypeKey: "projects/regions/subnetworks", Service: "compute", @@ -1709,17 +2177,17 @@ var generatedIamResources = map[string]map[string]map[string]IamRestResource{ }, GetMethod: RestMethod{ HttpMethod: "GET", - BaseURL: "https://www.googleapis.com/compute/beta/projects/", + BaseURL: "https://compute.googleapis.com/compute/beta/projects/", Path: "{project}/regions/{region}/subnetworks/{resource}/getIamPolicy", }, SetMethod: RestMethod{ HttpMethod: "POST", - BaseURL: "https://www.googleapis.com/compute/beta/projects/", + BaseURL: "https://compute.googleapis.com/compute/beta/projects/", Path: "{project}/regions/{region}/subnetworks/{resource}/setIamPolicy", RequestFormat: `{"policy": %s}`, }, }, - "v1": IamRestResource{ + "v1": RestResource{ Name: "subnetworks", TypeKey: "projects/regions/subnetworks", Service: "compute", @@ -1732,12 +2200,12 @@ var generatedIamResources = map[string]map[string]map[string]IamRestResource{ }, GetMethod: RestMethod{ HttpMethod: "GET", - BaseURL: "https://www.googleapis.com/compute/v1/projects/", + BaseURL: "https://compute.googleapis.com/compute/v1/projects/", Path: "{project}/regions/{region}/subnetworks/{resource}/getIamPolicy", }, SetMethod: RestMethod{ HttpMethod: "POST", - BaseURL: "https://www.googleapis.com/compute/v1/projects/", + BaseURL: "https://compute.googleapis.com/compute/v1/projects/", Path: "{project}/regions/{region}/subnetworks/{resource}/setIamPolicy", RequestFormat: `{"policy": %s}`, }, @@ -1746,7 +2214,7 @@ var generatedIamResources = map[string]map[string]map[string]IamRestResource{ }, "projects/regions/workflowTemplates": { "dataproc": { - "v1": IamRestResource{ + "v1": RestResource{ Name: "workflowTemplates", TypeKey: "projects/regions/workflowTemplates", Service: "dataproc", @@ -1765,7 +2233,7 @@ var generatedIamResources = map[string]map[string]map[string]IamRestResource{ RequestFormat: `{"policy": %s}`, }, }, - "v1beta2": IamRestResource{ + "v1beta2": RestResource{ Name: "workflowTemplates", TypeKey: "projects/regions/workflowTemplates", Service: "dataproc", @@ -1788,7 +2256,7 @@ var generatedIamResources = map[string]map[string]map[string]IamRestResource{ }, "projects/repos": { "sourcerepo": { - "v1": IamRestResource{ + "v1": RestResource{ Name: "repos", TypeKey: "projects/repos", Service: "sourcerepo", @@ -1809,9 +2277,51 @@ var generatedIamResources = map[string]map[string]map[string]IamRestResource{ }, }, }, + "projects/secrets": { + "secretmanager": { + "v1": RestResource{ + Name: "secrets", + TypeKey: "projects/secrets", + Service: "secretmanager", + IsPreferredVersion: true, + Parameters: []string{"resource"}, + CollectionReplacementKeys: map[string]string{}, + GetMethod: RestMethod{ + HttpMethod: "GET", + BaseURL: "https://secretmanager.googleapis.com/", + Path: "v1/{+resource}:getIamPolicy", + }, + SetMethod: RestMethod{ + HttpMethod: "POST", + BaseURL: "https://secretmanager.googleapis.com/", + Path: "v1/{+resource}:setIamPolicy", + RequestFormat: `{"policy": %s}`, + }, + }, + "v1beta1": RestResource{ + Name: "secrets", + TypeKey: "projects/secrets", + Service: "secretmanager", + IsPreferredVersion: false, + Parameters: []string{"resource"}, + CollectionReplacementKeys: map[string]string{}, + GetMethod: RestMethod{ + HttpMethod: "GET", + BaseURL: "https://secretmanager.googleapis.com/", + Path: "v1beta1/{+resource}:getIamPolicy", + }, + SetMethod: RestMethod{ + HttpMethod: "POST", + BaseURL: "https://secretmanager.googleapis.com/", + Path: "v1beta1/{+resource}:setIamPolicy", + RequestFormat: `{"policy": %s}`, + }, + }, + }, + }, "projects/serviceAccounts": { "iam": { - "v1": IamRestResource{ + "v1": RestResource{ Name: "serviceAccounts", TypeKey: "projects/serviceAccounts", Service: "iam", @@ -1834,7 +2344,7 @@ var generatedIamResources = map[string]map[string]map[string]IamRestResource{ }, "projects/snapshots": { "compute": { - "alpha": IamRestResource{ + "alpha": RestResource{ Name: "snapshots", TypeKey: "projects/snapshots", Service: "compute", @@ -1846,17 +2356,17 @@ var generatedIamResources = map[string]map[string]map[string]IamRestResource{ }, GetMethod: RestMethod{ HttpMethod: "GET", - BaseURL: "https://www.googleapis.com/compute/alpha/projects/", + BaseURL: "https://compute.googleapis.com/compute/alpha/projects/", Path: "{project}/global/snapshots/{resource}/getIamPolicy", }, SetMethod: RestMethod{ HttpMethod: "POST", - BaseURL: "https://www.googleapis.com/compute/alpha/projects/", + BaseURL: "https://compute.googleapis.com/compute/alpha/projects/", Path: "{project}/global/snapshots/{resource}/setIamPolicy", RequestFormat: `{"policy": %s}`, }, }, - "beta": IamRestResource{ + "beta": RestResource{ Name: "snapshots", TypeKey: "projects/snapshots", Service: "compute", @@ -1868,17 +2378,17 @@ var generatedIamResources = map[string]map[string]map[string]IamRestResource{ }, GetMethod: RestMethod{ HttpMethod: "GET", - BaseURL: "https://www.googleapis.com/compute/beta/projects/", + BaseURL: "https://compute.googleapis.com/compute/beta/projects/", Path: "{project}/global/snapshots/{resource}/getIamPolicy", }, SetMethod: RestMethod{ HttpMethod: "POST", - BaseURL: "https://www.googleapis.com/compute/beta/projects/", + BaseURL: "https://compute.googleapis.com/compute/beta/projects/", Path: "{project}/global/snapshots/{resource}/setIamPolicy", RequestFormat: `{"policy": %s}`, }, }, - "v1": IamRestResource{ + "v1": RestResource{ Name: "snapshots", TypeKey: "projects/snapshots", Service: "compute", @@ -1890,19 +2400,19 @@ var generatedIamResources = map[string]map[string]map[string]IamRestResource{ }, GetMethod: RestMethod{ HttpMethod: "GET", - BaseURL: "https://www.googleapis.com/compute/v1/projects/", + BaseURL: "https://compute.googleapis.com/compute/v1/projects/", Path: "{project}/global/snapshots/{resource}/getIamPolicy", }, SetMethod: RestMethod{ HttpMethod: "POST", - BaseURL: "https://www.googleapis.com/compute/v1/projects/", + BaseURL: "https://compute.googleapis.com/compute/v1/projects/", Path: "{project}/global/snapshots/{resource}/setIamPolicy", RequestFormat: `{"policy": %s}`, }, }, }, "pubsub": { - "v1": IamRestResource{ + "v1": RestResource{ Name: "snapshots", TypeKey: "projects/snapshots", Service: "pubsub", @@ -1925,7 +2435,7 @@ var generatedIamResources = map[string]map[string]map[string]IamRestResource{ }, "projects/subscriptions": { "pubsub": { - "v1": IamRestResource{ + "v1": RestResource{ Name: "subscriptions", TypeKey: "projects/subscriptions", Service: "pubsub", @@ -1944,7 +2454,7 @@ var generatedIamResources = map[string]map[string]map[string]IamRestResource{ RequestFormat: `{"policy": %s}`, }, }, - "v1beta2": IamRestResource{ + "v1beta2": RestResource{ Name: "subscriptions", TypeKey: "projects/subscriptions", Service: "pubsub", @@ -1967,7 +2477,7 @@ var generatedIamResources = map[string]map[string]map[string]IamRestResource{ }, "projects/topics": { "pubsub": { - "v1": IamRestResource{ + "v1": RestResource{ Name: "topics", TypeKey: "projects/topics", Service: "pubsub", @@ -1986,7 +2496,7 @@ var generatedIamResources = map[string]map[string]map[string]IamRestResource{ RequestFormat: `{"policy": %s}`, }, }, - "v1beta2": IamRestResource{ + "v1beta2": RestResource{ Name: "topics", TypeKey: "projects/topics", Service: "pubsub", @@ -2007,59 +2517,9 @@ var generatedIamResources = map[string]map[string]map[string]IamRestResource{ }, }, }, - "projects/zones/allocations": { - "compute": { - "alpha": IamRestResource{ - Name: "allocations", - TypeKey: "projects/zones/allocations", - Service: "compute", - IsPreferredVersion: false, - Parameters: []string{"project", "zone", "resource"}, - CollectionReplacementKeys: map[string]string{ - "allocations": "resource", - "projects": "project", - "zones": "zone", - }, - GetMethod: RestMethod{ - HttpMethod: "GET", - BaseURL: "https://www.googleapis.com/compute/alpha/projects/", - Path: "{project}/zones/{zone}/allocations/{resource}/getIamPolicy", - }, - SetMethod: RestMethod{ - HttpMethod: "POST", - BaseURL: "https://www.googleapis.com/compute/alpha/projects/", - Path: "{project}/zones/{zone}/allocations/{resource}/setIamPolicy", - RequestFormat: `{"policy": %s}`, - }, - }, - "beta": IamRestResource{ - Name: "allocations", - TypeKey: "projects/zones/allocations", - Service: "compute", - IsPreferredVersion: false, - Parameters: []string{"project", "zone", "resource"}, - CollectionReplacementKeys: map[string]string{ - "allocations": "resource", - "projects": "project", - "zones": "zone", - }, - GetMethod: RestMethod{ - HttpMethod: "GET", - BaseURL: "https://www.googleapis.com/compute/beta/projects/", - Path: "{project}/zones/{zone}/allocations/{resource}/getIamPolicy", - }, - SetMethod: RestMethod{ - HttpMethod: "POST", - BaseURL: "https://www.googleapis.com/compute/beta/projects/", - Path: "{project}/zones/{zone}/allocations/{resource}/setIamPolicy", - RequestFormat: `{"policy": %s}`, - }, - }, - }, - }, "projects/zones/disks": { "compute": { - "alpha": IamRestResource{ + "alpha": RestResource{ Name: "disks", TypeKey: "projects/zones/disks", Service: "compute", @@ -2072,17 +2532,17 @@ var generatedIamResources = map[string]map[string]map[string]IamRestResource{ }, GetMethod: RestMethod{ HttpMethod: "GET", - BaseURL: "https://www.googleapis.com/compute/alpha/projects/", + BaseURL: "https://compute.googleapis.com/compute/alpha/projects/", Path: "{project}/zones/{zone}/disks/{resource}/getIamPolicy", }, SetMethod: RestMethod{ HttpMethod: "POST", - BaseURL: "https://www.googleapis.com/compute/alpha/projects/", + BaseURL: "https://compute.googleapis.com/compute/alpha/projects/", Path: "{project}/zones/{zone}/disks/{resource}/setIamPolicy", RequestFormat: `{"policy": %s}`, }, }, - "beta": IamRestResource{ + "beta": RestResource{ Name: "disks", TypeKey: "projects/zones/disks", Service: "compute", @@ -2095,17 +2555,17 @@ var generatedIamResources = map[string]map[string]map[string]IamRestResource{ }, GetMethod: RestMethod{ HttpMethod: "GET", - BaseURL: "https://www.googleapis.com/compute/beta/projects/", + BaseURL: "https://compute.googleapis.com/compute/beta/projects/", Path: "{project}/zones/{zone}/disks/{resource}/getIamPolicy", }, SetMethod: RestMethod{ HttpMethod: "POST", - BaseURL: "https://www.googleapis.com/compute/beta/projects/", + BaseURL: "https://compute.googleapis.com/compute/beta/projects/", Path: "{project}/zones/{zone}/disks/{resource}/setIamPolicy", RequestFormat: `{"policy": %s}`, }, }, - "v1": IamRestResource{ + "v1": RestResource{ Name: "disks", TypeKey: "projects/zones/disks", Service: "compute", @@ -2118,12 +2578,12 @@ var generatedIamResources = map[string]map[string]map[string]IamRestResource{ }, GetMethod: RestMethod{ HttpMethod: "GET", - BaseURL: "https://www.googleapis.com/compute/v1/projects/", + BaseURL: "https://compute.googleapis.com/compute/v1/projects/", Path: "{project}/zones/{zone}/disks/{resource}/getIamPolicy", }, SetMethod: RestMethod{ HttpMethod: "POST", - BaseURL: "https://www.googleapis.com/compute/v1/projects/", + BaseURL: "https://compute.googleapis.com/compute/v1/projects/", Path: "{project}/zones/{zone}/disks/{resource}/setIamPolicy", RequestFormat: `{"policy": %s}`, }, @@ -2132,7 +2592,7 @@ var generatedIamResources = map[string]map[string]map[string]IamRestResource{ }, "projects/zones/instances": { "compute": { - "alpha": IamRestResource{ + "alpha": RestResource{ Name: "instances", TypeKey: "projects/zones/instances", Service: "compute", @@ -2145,17 +2605,17 @@ var generatedIamResources = map[string]map[string]map[string]IamRestResource{ }, GetMethod: RestMethod{ HttpMethod: "GET", - BaseURL: "https://www.googleapis.com/compute/alpha/projects/", + BaseURL: "https://compute.googleapis.com/compute/alpha/projects/", Path: "{project}/zones/{zone}/instances/{resource}/getIamPolicy", }, SetMethod: RestMethod{ HttpMethod: "POST", - BaseURL: "https://www.googleapis.com/compute/alpha/projects/", + BaseURL: "https://compute.googleapis.com/compute/alpha/projects/", Path: "{project}/zones/{zone}/instances/{resource}/setIamPolicy", RequestFormat: `{"policy": %s}`, }, }, - "beta": IamRestResource{ + "beta": RestResource{ Name: "instances", TypeKey: "projects/zones/instances", Service: "compute", @@ -2168,17 +2628,17 @@ var generatedIamResources = map[string]map[string]map[string]IamRestResource{ }, GetMethod: RestMethod{ HttpMethod: "GET", - BaseURL: "https://www.googleapis.com/compute/beta/projects/", + BaseURL: "https://compute.googleapis.com/compute/beta/projects/", Path: "{project}/zones/{zone}/instances/{resource}/getIamPolicy", }, SetMethod: RestMethod{ HttpMethod: "POST", - BaseURL: "https://www.googleapis.com/compute/beta/projects/", + BaseURL: "https://compute.googleapis.com/compute/beta/projects/", Path: "{project}/zones/{zone}/instances/{resource}/setIamPolicy", RequestFormat: `{"policy": %s}`, }, }, - "v1": IamRestResource{ + "v1": RestResource{ Name: "instances", TypeKey: "projects/zones/instances", Service: "compute", @@ -2191,12 +2651,12 @@ var generatedIamResources = map[string]map[string]map[string]IamRestResource{ }, GetMethod: RestMethod{ HttpMethod: "GET", - BaseURL: "https://www.googleapis.com/compute/v1/projects/", + BaseURL: "https://compute.googleapis.com/compute/v1/projects/", Path: "{project}/zones/{zone}/instances/{resource}/getIamPolicy", }, SetMethod: RestMethod{ HttpMethod: "POST", - BaseURL: "https://www.googleapis.com/compute/v1/projects/", + BaseURL: "https://compute.googleapis.com/compute/v1/projects/", Path: "{project}/zones/{zone}/instances/{resource}/setIamPolicy", RequestFormat: `{"policy": %s}`, }, @@ -2205,7 +2665,7 @@ var generatedIamResources = map[string]map[string]map[string]IamRestResource{ }, "projects/zones/nodeGroups": { "compute": { - "alpha": IamRestResource{ + "alpha": RestResource{ Name: "nodeGroups", TypeKey: "projects/zones/nodeGroups", Service: "compute", @@ -2218,17 +2678,17 @@ var generatedIamResources = map[string]map[string]map[string]IamRestResource{ }, GetMethod: RestMethod{ HttpMethod: "GET", - BaseURL: "https://www.googleapis.com/compute/alpha/projects/", + BaseURL: "https://compute.googleapis.com/compute/alpha/projects/", Path: "{project}/zones/{zone}/nodeGroups/{resource}/getIamPolicy", }, SetMethod: RestMethod{ HttpMethod: "POST", - BaseURL: "https://www.googleapis.com/compute/alpha/projects/", + BaseURL: "https://compute.googleapis.com/compute/alpha/projects/", Path: "{project}/zones/{zone}/nodeGroups/{resource}/setIamPolicy", RequestFormat: `{"policy": %s}`, }, }, - "beta": IamRestResource{ + "beta": RestResource{ Name: "nodeGroups", TypeKey: "projects/zones/nodeGroups", Service: "compute", @@ -2241,17 +2701,17 @@ var generatedIamResources = map[string]map[string]map[string]IamRestResource{ }, GetMethod: RestMethod{ HttpMethod: "GET", - BaseURL: "https://www.googleapis.com/compute/beta/projects/", + BaseURL: "https://compute.googleapis.com/compute/beta/projects/", Path: "{project}/zones/{zone}/nodeGroups/{resource}/getIamPolicy", }, SetMethod: RestMethod{ HttpMethod: "POST", - BaseURL: "https://www.googleapis.com/compute/beta/projects/", + BaseURL: "https://compute.googleapis.com/compute/beta/projects/", Path: "{project}/zones/{zone}/nodeGroups/{resource}/setIamPolicy", RequestFormat: `{"policy": %s}`, }, }, - "v1": IamRestResource{ + "v1": RestResource{ Name: "nodeGroups", TypeKey: "projects/zones/nodeGroups", Service: "compute", @@ -2264,21 +2724,94 @@ var generatedIamResources = map[string]map[string]map[string]IamRestResource{ }, GetMethod: RestMethod{ HttpMethod: "GET", - BaseURL: "https://www.googleapis.com/compute/v1/projects/", + BaseURL: "https://compute.googleapis.com/compute/v1/projects/", Path: "{project}/zones/{zone}/nodeGroups/{resource}/getIamPolicy", }, SetMethod: RestMethod{ HttpMethod: "POST", - BaseURL: "https://www.googleapis.com/compute/v1/projects/", + BaseURL: "https://compute.googleapis.com/compute/v1/projects/", Path: "{project}/zones/{zone}/nodeGroups/{resource}/setIamPolicy", RequestFormat: `{"policy": %s}`, }, }, }, }, + "projects/zones/reservations": { + "compute": { + "alpha": RestResource{ + Name: "reservations", + TypeKey: "projects/zones/reservations", + Service: "compute", + IsPreferredVersion: false, + Parameters: []string{"project", "zone", "resource"}, + CollectionReplacementKeys: map[string]string{ + "projects": "project", + "reservations": "resource", + "zones": "zone", + }, + GetMethod: RestMethod{ + HttpMethod: "GET", + BaseURL: "https://compute.googleapis.com/compute/alpha/projects/", + Path: "{project}/zones/{zone}/reservations/{resource}/getIamPolicy", + }, + SetMethod: RestMethod{ + HttpMethod: "POST", + BaseURL: "https://compute.googleapis.com/compute/alpha/projects/", + Path: "{project}/zones/{zone}/reservations/{resource}/setIamPolicy", + RequestFormat: `{"policy": %s}`, + }, + }, + "beta": RestResource{ + Name: "reservations", + TypeKey: "projects/zones/reservations", + Service: "compute", + IsPreferredVersion: false, + Parameters: []string{"project", "zone", "resource"}, + CollectionReplacementKeys: map[string]string{ + "projects": "project", + "reservations": "resource", + "zones": "zone", + }, + GetMethod: RestMethod{ + HttpMethod: "GET", + BaseURL: "https://compute.googleapis.com/compute/beta/projects/", + Path: "{project}/zones/{zone}/reservations/{resource}/getIamPolicy", + }, + SetMethod: RestMethod{ + HttpMethod: "POST", + BaseURL: "https://compute.googleapis.com/compute/beta/projects/", + Path: "{project}/zones/{zone}/reservations/{resource}/setIamPolicy", + RequestFormat: `{"policy": %s}`, + }, + }, + "v1": RestResource{ + Name: "reservations", + TypeKey: "projects/zones/reservations", + Service: "compute", + IsPreferredVersion: true, + Parameters: []string{"project", "zone", "resource"}, + CollectionReplacementKeys: map[string]string{ + "projects": "project", + "reservations": "resource", + "zones": "zone", + }, + GetMethod: RestMethod{ + HttpMethod: "GET", + BaseURL: "https://compute.googleapis.com/compute/v1/projects/", + Path: "{project}/zones/{zone}/reservations/{resource}/getIamPolicy", + }, + SetMethod: RestMethod{ + HttpMethod: "POST", + BaseURL: "https://compute.googleapis.com/compute/v1/projects/", + Path: "{project}/zones/{zone}/reservations/{resource}/setIamPolicy", + RequestFormat: `{"policy": %s}`, + }, + }, + }, + }, "providers/notes": { "containeranalysis": { - "v1alpha1": IamRestResource{ + "v1alpha1": RestResource{ Name: "notes", TypeKey: "providers/notes", Service: "containeranalysis", @@ -2301,7 +2834,7 @@ var generatedIamResources = map[string]map[string]map[string]IamRestResource{ }, "services": { "servicemanagement": { - "v1": IamRestResource{ + "v1": RestResource{ Name: "services", TypeKey: "services", Service: "servicemanagement", @@ -2324,7 +2857,7 @@ var generatedIamResources = map[string]map[string]map[string]IamRestResource{ }, "services/consumers": { "servicemanagement": { - "v1": IamRestResource{ + "v1": RestResource{ Name: "consumers", TypeKey: "services/consumers", Service: "servicemanagement", diff --git a/vendor/github.com/hashicorp/vault-plugin-secrets-gcp/plugin/path_role_set.go b/vendor/github.com/hashicorp/vault-plugin-secrets-gcp/plugin/path_role_set.go index f32ed7d78..962a8d1cc 100644 --- a/vendor/github.com/hashicorp/vault-plugin-secrets-gcp/plugin/path_role_set.go +++ b/vendor/github.com/hashicorp/vault-plugin-secrets-gcp/plugin/path_role_set.go @@ -236,7 +236,7 @@ func (b *backend) pathRoleSetDelete(ctx context.Context, req *logical.Request, d return nil, err } - iamHandle := iamutil.GetIamHandle(httpC, useragent.String()) + apiHandle := iamutil.GetApiHandle(httpC, useragent.String()) warnings := make([]string, 0) if rs.AccountId != nil { @@ -250,7 +250,7 @@ func (b *backend) pathRoleSetDelete(ctx context.Context, req *logical.Request, d warnings = append(warnings, w) } - if merr := b.removeBindings(ctx, iamHandle, rs.AccountId.EmailOrId, rs.Bindings); merr != nil { + if merr := b.removeBindings(ctx, apiHandle, rs.AccountId.EmailOrId, rs.Bindings); merr != nil { for _, err := range merr.Errors { w := fmt.Sprintf("unable to delete IAM policy bindings for service account %q (WAL entry to clean-up later has been added): %v", rs.AccountId.EmailOrId, err) warnings = append(warnings, w) diff --git a/vendor/github.com/hashicorp/vault-plugin-secrets-gcp/plugin/role_set.go b/vendor/github.com/hashicorp/vault-plugin-secrets-gcp/plugin/role_set.go index e8cfbead4..632faeb0a 100644 --- a/vendor/github.com/hashicorp/vault-plugin-secrets-gcp/plugin/role_set.go +++ b/vendor/github.com/hashicorp/vault-plugin-secrets-gcp/plugin/role_set.go @@ -137,7 +137,7 @@ func (b *backend) saveRoleSetWithNewAccount(ctx context.Context, s logical.Stora return nil, err } - iamHandle := iamutil.GetIamHandle(httpC, useragent.String()) + apiHandle := iamutil.GetApiHandle(httpC, useragent.String()) oldAccount := rs.AccountId oldBindings := rs.Bindings @@ -162,7 +162,7 @@ func (b *backend) saveRoleSetWithNewAccount(ctx context.Context, s logical.Stora binds = newBinds rs.Bindings = newBinds } - walIds, err := rs.updateIamPolicies(ctx, s, b.iamResources, iamHandle, binds) + walIds, err := rs.updateIamPolicies(ctx, s, b.resources, apiHandle, binds) if err != nil { tryDeleteWALs(ctx, s, oldWals...) return nil, err @@ -194,7 +194,7 @@ func (b *backend) saveRoleSetWithNewAccount(ctx context.Context, s logical.Stora // Return any errors as warnings so user knows immediate cleanup failed warnings := make([]string, 0) - if errs := b.removeBindings(ctx, iamHandle, oldAccount.EmailOrId, oldBindings); errs != nil { + if errs := b.removeBindings(ctx, apiHandle, oldAccount.EmailOrId, oldBindings); errs != nil { warnings = make([]string, len(errs.Errors), len(errs.Errors)+2) for idx, err := range errs.Errors { warnings[idx] = fmt.Sprintf("unable to immediately delete old binding (WAL cleanup entry has been added): %v", err) @@ -358,7 +358,7 @@ func (rs *RoleSet) newKeyForTokenGen(ctx context.Context, s logical.Storage, iam return walId, nil } -func (rs *RoleSet) updateIamPolicies(ctx context.Context, s logical.Storage, enabledIamResources iamutil.IamResourceParser, iamHandle *iamutil.IamHandle, rb ResourceBindings) ([]string, error) { +func (rs *RoleSet) updateIamPolicies(ctx context.Context, s logical.Storage, enabledResources iamutil.ResourceParser, apiHandle *iamutil.ApiHandle, rb ResourceBindings) ([]string, error) { wals := make([]string, 0, len(rb)) for rName, roles := range rb { walId, err := framework.PutWAL(ctx, s, walTypeIamPolicy, &walIamPolicy{ @@ -374,12 +374,12 @@ func (rs *RoleSet) updateIamPolicies(ctx context.Context, s logical.Storage, ena return wals, err } - resource, err := enabledIamResources.Parse(rName) + resource, err := enabledResources.Parse(rName) if err != nil { return wals, err } - p, err := iamHandle.GetIamPolicy(ctx, resource) + p, err := resource.GetIamPolicy(ctx, apiHandle) if err != nil { return wals, err } @@ -392,7 +392,7 @@ func (rs *RoleSet) updateIamPolicies(ctx context.Context, s logical.Storage, ena continue } - if _, err := iamHandle.SetIamPolicy(ctx, resource, newP); err != nil { + if _, err := resource.SetIamPolicy(ctx, apiHandle, newP); err != nil { return wals, err } wals = append(wals, walId) diff --git a/vendor/github.com/hashicorp/vault-plugin-secrets-gcp/plugin/rollback.go b/vendor/github.com/hashicorp/vault-plugin-secrets-gcp/plugin/rollback.go index 6d85f5421..fca1d7314 100644 --- a/vendor/github.com/hashicorp/vault-plugin-secrets-gcp/plugin/rollback.go +++ b/vendor/github.com/hashicorp/vault-plugin-secrets-gcp/plugin/rollback.go @@ -182,7 +182,7 @@ func (b *backend) serviceAccountPolicyRollback(ctx context.Context, req *logical } } - r, err := b.iamResources.Parse(entry.Resource) + r, err := b.resources.Parse(entry.Resource) if err != nil { return err } @@ -192,12 +192,12 @@ func (b *backend) serviceAccountPolicyRollback(ctx context.Context, req *logical return err } - iamHandle := iamutil.GetIamHandle(httpC, useragent.String()) + apiHandle := iamutil.GetApiHandle(httpC, useragent.String()) if err != nil { return err } - p, err := iamHandle.GetIamPolicy(ctx, r) + p, err := r.GetIamPolicy(ctx, apiHandle) if err != nil { return err } @@ -212,7 +212,7 @@ func (b *backend) serviceAccountPolicyRollback(ctx context.Context, req *logical return nil } - _, err = iamHandle.SetIamPolicy(ctx, r, newP) + _, err = r.SetIamPolicy(ctx, apiHandle, newP) return err } @@ -240,15 +240,15 @@ func (b *backend) deleteTokenGenKey(ctx context.Context, iamAdmin *iam.Service, return nil } -func (b *backend) removeBindings(ctx context.Context, iamHandle *iamutil.IamHandle, email string, bindings ResourceBindings) (allErr *multierror.Error) { +func (b *backend) removeBindings(ctx context.Context, apiHandle *iamutil.ApiHandle, email string, bindings ResourceBindings) (allErr *multierror.Error) { for resName, roles := range bindings { - resource, err := b.iamResources.Parse(resName) + resource, err := b.resources.Parse(resName) if err != nil { allErr = multierror.Append(allErr, errwrap.Wrapf(fmt.Sprintf("unable to delete role binding for resource '%s': {{err}}", resName), err)) continue } - p, err := iamHandle.GetIamPolicy(ctx, resource) + p, err := resource.GetIamPolicy(ctx, apiHandle) if err != nil { allErr = multierror.Append(allErr, errwrap.Wrapf(fmt.Sprintf("unable to delete role binding for resource '%s': {{err}}", resName), err)) continue @@ -261,7 +261,7 @@ func (b *backend) removeBindings(ctx context.Context, iamHandle *iamutil.IamHand if !changed { continue } - if _, err = iamHandle.SetIamPolicy(ctx, resource, newP); err != nil { + if _, err = resource.SetIamPolicy(ctx, apiHandle, newP); err != nil { allErr = multierror.Append(allErr, errwrap.Wrapf(fmt.Sprintf("unable to delete role binding for resource '%s': {{err}}", resName), err)) continue } diff --git a/vendor/github.com/hashicorp/vault-plugin-secrets-gcp/plugin/secrets_service_account_key.go b/vendor/github.com/hashicorp/vault-plugin-secrets-gcp/plugin/secrets_service_account_key.go index 4279c2fd7..411652520 100644 --- a/vendor/github.com/hashicorp/vault-plugin-secrets-gcp/plugin/secrets_service_account_key.go +++ b/vendor/github.com/hashicorp/vault-plugin-secrets-gcp/plugin/secrets_service_account_key.go @@ -58,7 +58,7 @@ func pathSecretServiceAccountKey(b *backend) *framework.Path { Description: fmt.Sprintf(`Private key type for service account key - defaults to %s"`, privateKeyTypeJson), Default: privateKeyTypeJson, }, - "ttl": &framework.FieldSchema{ + "ttl": { Type: framework.TypeDurationSecond, Description: "Lifetime of the service account key", }, @@ -215,6 +215,10 @@ func (b *backend) getSecretKey(ctx context.Context, s logical.Storage, rs *RoleS resp := b.Secret(SecretTypeKey).Response(secretD, internalD) resp.Secret.Renewable = true + resp.Secret.MaxTTL = cfg.MaxTTL + resp.Secret.TTL = cfg.TTL + + // If the request came with a TTL value, overwrite the config default if ttl > 0 { resp.Secret.TTL = time.Duration(ttl) * time.Second } diff --git a/vendor/modules.txt b/vendor/modules.txt index e12822522..4bb0eb703 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -442,7 +442,7 @@ github.com/hashicorp/vault-plugin-secrets-alicloud github.com/hashicorp/vault-plugin-secrets-alicloud/clients # github.com/hashicorp/vault-plugin-secrets-azure v0.5.6 github.com/hashicorp/vault-plugin-secrets-azure -# github.com/hashicorp/vault-plugin-secrets-gcp v0.6.1 +# github.com/hashicorp/vault-plugin-secrets-gcp v0.6.2 github.com/hashicorp/vault-plugin-secrets-gcp/plugin github.com/hashicorp/vault-plugin-secrets-gcp/plugin/iamutil github.com/hashicorp/vault-plugin-secrets-gcp/plugin/util