From 908a299ea3bb363603674b885879b776e9f16de1 Mon Sep 17 00:00:00 2001 From: Jeff Mitchell Date: Fri, 7 Aug 2020 12:55:02 -0400 Subject: [PATCH] Convert SDK to the new options API (#238) --- api/authmethods/account.gen.go | 198 ++++++ api/{scopes => authmethods}/authenticate.go | 19 +- api/authmethods/authmethods.gen.go | 177 +++++ api/authmethods/option.gen.go | 210 ++++++ .../password_account_attributes.gen.go | 7 + .../password_auth_method_attributes.gen.go | 7 + api/authtokens/authtoken.gen.go | 83 --- api/authtokens/authtokens.gen.go | 123 ++++ api/authtokens/delete.gen.go | 49 -- api/authtokens/list.gen.go | 50 -- api/authtokens/option.gen.go | 54 ++ api/authtokens/read.gen.go | 46 -- api/client.go | 8 +- api/error.gen.go | 12 +- api/groups/create.gen.go | 42 -- api/groups/custom.go | 117 ---- api/groups/delete.gen.go | 49 -- api/groups/group.gen.go | 396 +++++++++-- api/groups/list.gen.go | 50 -- api/groups/member.gen.go | 11 +- api/groups/option.gen.go | 90 +++ api/groups/read.gen.go | 46 -- api/groups/update.gen.go | 52 -- api/hosts/awsec2_host_catalog.gen.go | 40 -- api/hosts/create.gen.go | 75 --- api/hosts/host.gen.go | 235 +++++-- api/hosts/host_catalog.gen.go | 217 ++++-- api/hosts/host_set.gen.go | 82 --- api/hosts/option.gen.go | 126 ++++ api/hosts/read.gen.go | 46 -- api/hosts/static_host_catalog.gen.go | 31 - api/info/scope.gen.go | 21 - api/internal/genapi/Makefile | 4 +- api/internal/genapi/create.go | 127 ---- api/internal/genapi/delete.go | 124 ---- api/internal/genapi/input.go | 330 +++++---- api/internal/genapi/list.go | 128 ---- api/internal/genapi/main.go | 7 +- api/internal/genapi/parse.go | 366 +++------- api/internal/genapi/read.go | 133 ---- api/internal/genapi/templates.go | 629 ++++++++++++++---- api/internal/genapi/update.go | 125 ---- api/internal/tests/detail_template_test.go | 12 +- api/roles/create.gen.go | 42 -- api/roles/custom.go | 217 ------ api/roles/delete.gen.go | 49 -- api/roles/grant.gen.go | 13 +- api/roles/grant_json.gen.go | 11 +- api/roles/list.gen.go | 50 -- api/roles/option.gen.go | 102 +++ api/roles/principal.gen.go | 11 +- api/roles/read.gen.go | 46 -- api/roles/role.gen.go | 567 ++++++++++++++-- api/roles/update.gen.go | 52 -- api/scopes/create.gen.go | 43 -- api/scopes/delete.gen.go | 49 -- api/scopes/list.gen.go | 51 -- api/scopes/option.gen.go | 90 +++ api/scopes/read.gen.go | 47 -- api/scopes/scope.gen.go | 227 +++++-- api/scopes/scope_info.gen.go | 10 + api/scopes/update.gen.go | 53 -- api/users/create.gen.go | 42 -- api/users/delete.gen.go | 49 -- api/users/list.gen.go | 50 -- api/users/option.gen.go | 90 +++ api/users/read.gen.go | 46 -- api/users/update.gen.go | 52 -- api/users/user.gen.go | 228 +++++-- go.mod | 2 + go.sum | 1 + internal/auth/password/store/password.pb.go | 115 ++-- internal/cmd/base/base.go | 6 +- .../cmd/commands/authenticate/password.go | 8 +- internal/cmd/commands/hosts/host_create.go | 19 +- internal/cmd/commands/roles/funcs.go | 18 +- internal/cmd/commands/roles/role.go | 87 ++- internal/cmd/commands/scopes/create.go | 12 +- internal/cmd/commands/scopes/funcs.go | 8 +- internal/cmd/commands/scopes/read.go | 13 +- internal/db/migrations/postgres.gen.go | 27 +- internal/db/migrations/postgres/06_iam.up.sql | 27 +- internal/gen/controller.swagger.json | 56 +- .../api/resources/auth/auth_method.pb.go | 355 ---------- .../{auth => authmethods}/account.pb.go | 192 +++--- .../resources/authmethods/auth_method.pb.go | 359 ++++++++++ .../api/resources/groups/group.pb.go | 71 +- .../controller/api/resources/hosts/host.pb.go | 79 +-- .../api/resources/hosts/host_catalog.pb.go | 96 +-- .../api/resources/hosts/host_set.pb.go | 88 +-- .../controller/api/resources/roles/role.pb.go | 147 ++-- .../api/resources/scopes/scope.pb.go | 104 +-- .../controller/api/resources/users/user.pb.go | 85 ++- .../api/services/auth_method_service.pb.go | 281 ++++---- .../api/services/authaccount_service.pb.go | 317 ++++----- .../api/services/group_service.pb.go | 394 +++++------ .../api/services/role_service.pb.go | 317 +++++---- .../api/services/scope_service.pb.go | 164 ++--- .../api/services/user_service.pb.go | 169 ++--- .../gen/controller/protooptions/masks.pb.go | 198 ------ .../gen/controller/protooptions/options.pb.go | 218 ++++++ .../gen/controller/protooptions/testing.pb.go | 205 +++--- internal/host/static/store/static.pb.go | 144 ++-- internal/iam/auth_account.go | 2 +- internal/iam/group.go | 4 +- internal/iam/group_member.go | 4 +- internal/iam/principal_role.go | 8 +- internal/iam/repository.go | 22 +- internal/iam/repository_group.go | 4 +- internal/iam/repository_group_test.go | 11 +- internal/iam/repository_role.go | 4 +- internal/iam/repository_role_test.go | 4 +- internal/iam/repository_scope.go | 4 +- internal/iam/repository_scope_test.go | 25 +- internal/iam/repository_test.go | 2 +- internal/iam/repository_user.go | 4 +- internal/iam/repository_user_test.go | 6 +- internal/iam/resource.go | 2 +- internal/iam/role.go | 4 +- internal/iam/role_grant.go | 4 +- internal/iam/scope.go | 4 +- internal/iam/store/group.pb.go | 62 +- internal/iam/store/role.pb.go | 70 +- internal/iam/store/scope.pb.go | 76 ++- internal/iam/store/user.pb.go | 70 +- internal/iam/user.go | 4 +- .../{auth => authmethods}/v1/account.proto | 18 +- .../v1/auth_method.proto | 18 +- .../api/resources/groups/v1/group.proto | 10 +- .../api/resources/hosts/v1/host.proto | 9 +- .../api/resources/hosts/v1/host_catalog.proto | 12 +- .../api/resources/hosts/v1/host_set.proto | 9 +- .../api/resources/roles/v1/role.proto | 12 +- .../api/resources/scopes/v1/scope.proto | 13 +- .../api/resources/users/v1/user.proto | 13 +- .../api/services/v1/auth_method_service.proto | 14 +- .../api/services/v1/authaccount_service.proto | 14 +- .../api/services/v1/group_service.proto | 11 +- .../api/services/v1/role_service.proto | 17 +- .../api/services/v1/scope_service.proto | 5 +- .../api/services/v1/user_service.proto | 5 +- .../v1/{masks.proto => options.proto} | 9 +- .../custom_options/v1/testing.proto | 2 +- .../auth/password/store/v1/password.proto | 2 +- .../storage/host/static/store/v1/static.proto | 2 +- .../storage/iam/store/v1/group.proto | 2 +- .../storage/iam/store/v1/role.proto | 2 +- .../storage/iam/store/v1/scope.proto | 6 +- .../storage/iam/store/v1/user.proto | 6 +- internal/servers/controller/cors_test.go | 3 +- .../handlers/accounts/account_service.go | 2 +- .../handlers/accounts/account_service_test.go | 2 +- .../authmethods/authmethod_service.go | 2 +- .../authmethods/authmethod_service_test.go | 2 +- .../handlers/groups/group_service.go | 22 +- .../handlers/groups/group_service_test.go | 57 +- .../controller/handlers/roles/role_service.go | 30 +- .../handlers/roles/role_service_test.go | 69 +- .../handlers/scopes/scope_service.go | 7 +- .../handlers/scopes/scope_service_test.go | 42 +- .../controller/handlers/users/user_service.go | 7 +- .../handlers/users/user_service_test.go | 52 +- 162 files changed, 6440 insertions(+), 5891 deletions(-) create mode 100644 api/authmethods/account.gen.go rename api/{scopes => authmethods}/authenticate.go (63%) create mode 100644 api/authmethods/authmethods.gen.go create mode 100644 api/authmethods/option.gen.go create mode 100644 api/authmethods/password_account_attributes.gen.go create mode 100644 api/authmethods/password_auth_method_attributes.gen.go delete mode 100644 api/authtokens/authtoken.gen.go create mode 100644 api/authtokens/authtokens.gen.go delete mode 100644 api/authtokens/delete.gen.go delete mode 100644 api/authtokens/list.gen.go create mode 100644 api/authtokens/option.gen.go delete mode 100644 api/authtokens/read.gen.go delete mode 100644 api/groups/create.gen.go delete mode 100644 api/groups/custom.go delete mode 100644 api/groups/delete.gen.go delete mode 100644 api/groups/list.gen.go create mode 100644 api/groups/option.gen.go delete mode 100644 api/groups/read.gen.go delete mode 100644 api/groups/update.gen.go delete mode 100644 api/hosts/awsec2_host_catalog.gen.go delete mode 100644 api/hosts/create.gen.go delete mode 100644 api/hosts/host_set.gen.go create mode 100644 api/hosts/option.gen.go delete mode 100644 api/hosts/read.gen.go delete mode 100644 api/hosts/static_host_catalog.gen.go delete mode 100644 api/info/scope.gen.go delete mode 100644 api/internal/genapi/create.go delete mode 100644 api/internal/genapi/delete.go delete mode 100644 api/internal/genapi/list.go delete mode 100644 api/internal/genapi/read.go delete mode 100644 api/internal/genapi/update.go delete mode 100644 api/roles/create.gen.go delete mode 100644 api/roles/custom.go delete mode 100644 api/roles/delete.gen.go delete mode 100644 api/roles/list.gen.go create mode 100644 api/roles/option.gen.go delete mode 100644 api/roles/read.gen.go delete mode 100644 api/roles/update.gen.go delete mode 100644 api/scopes/create.gen.go delete mode 100644 api/scopes/delete.gen.go delete mode 100644 api/scopes/list.gen.go create mode 100644 api/scopes/option.gen.go delete mode 100644 api/scopes/read.gen.go create mode 100644 api/scopes/scope_info.gen.go delete mode 100644 api/scopes/update.gen.go delete mode 100644 api/users/create.gen.go delete mode 100644 api/users/delete.gen.go delete mode 100644 api/users/list.gen.go create mode 100644 api/users/option.gen.go delete mode 100644 api/users/read.gen.go delete mode 100644 api/users/update.gen.go delete mode 100644 internal/gen/controller/api/resources/auth/auth_method.pb.go rename internal/gen/controller/api/resources/{auth => authmethods}/account.pb.go (50%) create mode 100644 internal/gen/controller/api/resources/authmethods/auth_method.pb.go delete mode 100644 internal/gen/controller/protooptions/masks.pb.go create mode 100644 internal/gen/controller/protooptions/options.pb.go rename internal/proto/local/controller/api/resources/{auth => authmethods}/v1/account.proto (65%) rename internal/proto/local/controller/api/resources/{auth => authmethods}/v1/auth_method.proto (63%) rename internal/proto/local/controller/custom_options/v1/{masks.proto => options.proto} (56%) diff --git a/api/authmethods/account.gen.go b/api/authmethods/account.gen.go new file mode 100644 index 000000000..012bd62c5 --- /dev/null +++ b/api/authmethods/account.gen.go @@ -0,0 +1,198 @@ +// Code generated by "make api"; DO NOT EDIT. +package authmethods + +import ( + "context" + "fmt" + "time" + + "github.com/hashicorp/watchtower/api" + "github.com/hashicorp/watchtower/api/scopes" +) + +type Account struct { + Id string `json:"id,omitempty"` + Scope *scopes.ScopeInfo `json:"scope,omitempty"` + AuthMethodId string `json:"auth_method_id,omitempty"` + Name string `json:"name,omitempty"` + Description string `json:"description,omitempty"` + CreatedTime time.Time `json:"created_time,omitempty"` + UpdatedTime time.Time `json:"updated_time,omitempty"` + Disabled bool `json:"disabled,omitempty"` + Type string `json:"type,omitempty"` + Attributes map[string]interface{} `json:"attributes,omitempty"` +} + +type accountClient struct { + client *api.Client +} + +func NewAccountClient(c *api.Client) *accountClient { + return &accountClient{client: c} +} + +func (c *accountClient) Create(ctx context.Context, authMethodId string, opt ...Option) (*Account, *api.Error, error) { + if authMethodId == "" { + return nil, nil, fmt.Errorf("empty authMethodId value passed into Create request") + } + + if c.client == nil { + return nil, nil, fmt.Errorf("nil client") + } + + opts, apiOpts := getOpts(opt...) + + req, err := c.client.NewRequest(ctx, "POST", fmt.Sprintf("auth-methods/%s/accounts", authMethodId), opts.valueMap, apiOpts...) + if err != nil { + return nil, nil, fmt.Errorf("error creating Create request: %w", err) + } + + resp, err := c.client.Do(req) + if err != nil { + return nil, nil, fmt.Errorf("error performing client request during Create call: %w", err) + } + + target := new(Account) + apiErr, err := resp.Decode(target) + if err != nil { + return nil, nil, fmt.Errorf("error decoding Create response: %w", err) + } + + return target, apiErr, nil +} + +func (c *accountClient) Read(ctx context.Context, authMethodId string, accountId string, opt ...Option) (*Account, *api.Error, error) { + if authMethodId == "" { + return nil, nil, fmt.Errorf("empty authMethodId value passed into Read request") + } + + if accountId == "" { + return nil, nil, fmt.Errorf("empty accountId value passed into Read request") + } + + if c.client == nil { + return nil, nil, fmt.Errorf("nil client") + } + + _, apiOpts := getOpts(opt...) + + req, err := c.client.NewRequest(ctx, "GET", fmt.Sprintf("auth-methods/%s/accounts/%s", authMethodId, accountId), nil, apiOpts...) + if err != nil { + return nil, nil, fmt.Errorf("error creating Read request: %w", err) + } + + resp, err := c.client.Do(req) + if err != nil { + return nil, nil, fmt.Errorf("error performing client request during Read call: %w", err) + } + + target := new(Account) + apiErr, err := resp.Decode(target) + if err != nil { + return nil, nil, fmt.Errorf("error decoding Read response: %w", err) + } + + return target, apiErr, nil +} + +func (c *accountClient) Update(ctx context.Context, authMethodId string, accountId string, version uint32, opt ...Option) (*Account, *api.Error, error) { + if authMethodId == "" { + return nil, nil, fmt.Errorf("empty authMethodId value passed into Update request") + } + if accountId == "" { + return nil, nil, fmt.Errorf("empty accountId value passed into Update request") + } + if c.client == nil { + return nil, nil, fmt.Errorf("nil client") + } + + opts, apiOpts := getOpts(opt...) + + req, err := c.client.NewRequest(ctx, "PATCH", fmt.Sprintf("auth-methods/%s/accounts/%s", authMethodId, accountId), opts.valueMap, apiOpts...) + if err != nil { + return nil, nil, fmt.Errorf("error creating Update request: %w", err) + } + + resp, err := c.client.Do(req) + if err != nil { + return nil, nil, fmt.Errorf("error performing client request during Update call: %w", err) + } + + target := new(Account) + apiErr, err := resp.Decode(target) + if err != nil { + return nil, nil, fmt.Errorf("error decoding Update response: %w", err) + } + + return target, apiErr, nil +} + +func (c *accountClient) Delete(ctx context.Context, authMethodId string, accountId string, opt ...Option) (bool, *api.Error, error) { + if authMethodId == "" { + return false, nil, fmt.Errorf("empty authMethodId value passed into Delete request") + } + + if accountId == "" { + return false, nil, fmt.Errorf("empty accountId value passed into Delete request") + } + + if c.client == nil { + return false, nil, fmt.Errorf("nil client") + } + + _, apiOpts := getOpts(opt...) + + req, err := c.client.NewRequest(ctx, "DELETE", fmt.Sprintf("auth-methods/%s/accounts/%s", authMethodId, accountId), nil, apiOpts...) + if err != nil { + return false, nil, fmt.Errorf("error creating Delete request: %w", err) + } + + resp, err := c.client.Do(req) + if err != nil { + return false, nil, fmt.Errorf("error performing client request during Delete call: %w", err) + } + + type deleteResponse struct { + Existed bool + } + target := &deleteResponse{} + apiErr, err := resp.Decode(target) + if err != nil { + return false, nil, fmt.Errorf("error decoding Delete response: %w", err) + } + + return target.Existed, apiErr, nil +} + +func (c *accountClient) List(ctx context.Context, authMethodId string, opt ...Option) ([]*Account, *api.Error, error) { + if authMethodId == "" { + return nil, nil, fmt.Errorf("empty authMethodId value passed into List request") + } + + if c.client == nil { + return nil, nil, fmt.Errorf("nil client") + } + + _, apiOpts := getOpts(opt...) + + req, err := c.client.NewRequest(ctx, "GET", fmt.Sprintf("auth-methods/%s/accounts", authMethodId), nil, apiOpts...) + if err != nil { + return nil, nil, fmt.Errorf("error creating List request: %w", err) + } + + resp, err := c.client.Do(req) + if err != nil { + return nil, nil, fmt.Errorf("error performing client request during List call: %w", err) + } + + type listResponse struct { + Items []*Account + } + target := &listResponse{} + apiErr, err := resp.Decode(target) + if err != nil { + return nil, nil, fmt.Errorf("error decoding List response: %w", err) + } + + return target.Items, apiErr, nil +} diff --git a/api/scopes/authenticate.go b/api/authmethods/authenticate.go similarity index 63% rename from api/scopes/authenticate.go rename to api/authmethods/authenticate.go index cbafaeed0..02e5e91ab 100644 --- a/api/scopes/authenticate.go +++ b/api/authmethods/authenticate.go @@ -1,4 +1,4 @@ -package scopes +package authmethods import ( "context" @@ -10,17 +10,12 @@ import ( // TODO: This will need to be changed when we add Auth Method API to watchtower. We'll also need a better // way to handle different auth method types. -func (s Scope) Authenticate(ctx context.Context, authMethodId, name, password string) (*authtokens.AuthToken, *api.Error, error) { - if s.Client == nil { +func (c *authmethodClient) Authenticate(ctx context.Context, authMethodId, name, password string, opt ...Option) (*authtokens.AuthToken, *api.Error, error) { + if c.client == nil { return nil, nil, fmt.Errorf("nil client in Authenticate request") } - var opts []api.Option - if s.Scope.Id != "" { - // If it's explicitly set here, override anything that might be in the - // client - opts = append(opts, api.WithScopeId(s.Scope.Id)) - } + _, apiOpts := getOpts(opt...) reqBody := map[string]interface{}{ "credentials": map[string]string{ @@ -29,12 +24,12 @@ func (s Scope) Authenticate(ctx context.Context, authMethodId, name, password st }, } - req, err := s.Client.NewRequest(ctx, "POST", fmt.Sprintf("auth-methods/%s:authenticate", authMethodId), reqBody, opts...) + req, err := c.client.NewRequest(ctx, "POST", fmt.Sprintf("auth-methods/%s:authenticate", authMethodId), reqBody, apiOpts...) if err != nil { return nil, nil, fmt.Errorf("error creating Authenticate request: %w", err) } - resp, err := s.Client.Do(req) + resp, err := c.client.Do(req) if err != nil { return nil, nil, fmt.Errorf("error performing client request during Authenticate call: %w", err) } @@ -46,7 +41,7 @@ func (s Scope) Authenticate(ctx context.Context, authMethodId, name, password st } if target.Token != "" { - s.Client.SetToken(target.Token) + c.client.SetToken(target.Token) } return target, apiErr, nil diff --git a/api/authmethods/authmethods.gen.go b/api/authmethods/authmethods.gen.go new file mode 100644 index 000000000..a5304fe17 --- /dev/null +++ b/api/authmethods/authmethods.gen.go @@ -0,0 +1,177 @@ +// Code generated by "make api"; DO NOT EDIT. +package authmethods + +import ( + "context" + "fmt" + "time" + + "github.com/hashicorp/watchtower/api" + "github.com/hashicorp/watchtower/api/scopes" +) + +type AuthMethod struct { + Id string `json:"id,omitempty"` + Scope *scopes.ScopeInfo `json:"scope,omitempty"` + Name string `json:"name,omitempty"` + Description string `json:"description,omitempty"` + CreatedTime time.Time `json:"created_time,omitempty"` + UpdatedTime time.Time `json:"updated_time,omitempty"` + Type string `json:"type,omitempty"` + Attributes map[string]interface{} `json:"attributes,omitempty"` +} + +type authmethodClient struct { + client *api.Client +} + +func NewAuthMethodClient(c *api.Client) *authmethodClient { + return &authmethodClient{client: c} +} + +func (c *authmethodClient) Create(ctx context.Context, opt ...Option) (*AuthMethod, *api.Error, error) { + if c.client == nil { + return nil, nil, fmt.Errorf("nil client") + } + + opts, apiOpts := getOpts(opt...) + + req, err := c.client.NewRequest(ctx, "POST", fmt.Sprintf("auth-methods"), opts.valueMap, apiOpts...) + if err != nil { + return nil, nil, fmt.Errorf("error creating Create request: %w", err) + } + + resp, err := c.client.Do(req) + if err != nil { + return nil, nil, fmt.Errorf("error performing client request during Create call: %w", err) + } + + target := new(AuthMethod) + apiErr, err := resp.Decode(target) + if err != nil { + return nil, nil, fmt.Errorf("error decoding Create response: %w", err) + } + + return target, apiErr, nil +} + +func (c *authmethodClient) Read(ctx context.Context, authMethodId string, opt ...Option) (*AuthMethod, *api.Error, error) { + if authMethodId == "" { + return nil, nil, fmt.Errorf("empty authMethodId value passed into Read request") + } + + if c.client == nil { + return nil, nil, fmt.Errorf("nil client") + } + + _, apiOpts := getOpts(opt...) + + req, err := c.client.NewRequest(ctx, "GET", fmt.Sprintf("auth-methods/%s", authMethodId), nil, apiOpts...) + if err != nil { + return nil, nil, fmt.Errorf("error creating Read request: %w", err) + } + + resp, err := c.client.Do(req) + if err != nil { + return nil, nil, fmt.Errorf("error performing client request during Read call: %w", err) + } + + target := new(AuthMethod) + apiErr, err := resp.Decode(target) + if err != nil { + return nil, nil, fmt.Errorf("error decoding Read response: %w", err) + } + + return target, apiErr, nil +} + +func (c *authmethodClient) Update(ctx context.Context, authMethodId string, version uint32, opt ...Option) (*AuthMethod, *api.Error, error) { + if authMethodId == "" { + return nil, nil, fmt.Errorf("empty authMethodId value passed into Update request") + } + if c.client == nil { + return nil, nil, fmt.Errorf("nil client") + } + + opts, apiOpts := getOpts(opt...) + + req, err := c.client.NewRequest(ctx, "PATCH", fmt.Sprintf("auth-methods/%s", authMethodId), opts.valueMap, apiOpts...) + if err != nil { + return nil, nil, fmt.Errorf("error creating Update request: %w", err) + } + + resp, err := c.client.Do(req) + if err != nil { + return nil, nil, fmt.Errorf("error performing client request during Update call: %w", err) + } + + target := new(AuthMethod) + apiErr, err := resp.Decode(target) + if err != nil { + return nil, nil, fmt.Errorf("error decoding Update response: %w", err) + } + + return target, apiErr, nil +} + +func (c *authmethodClient) Delete(ctx context.Context, authMethodId string, opt ...Option) (bool, *api.Error, error) { + if authMethodId == "" { + return false, nil, fmt.Errorf("empty authMethodId value passed into Delete request") + } + + if c.client == nil { + return false, nil, fmt.Errorf("nil client") + } + + _, apiOpts := getOpts(opt...) + + req, err := c.client.NewRequest(ctx, "DELETE", fmt.Sprintf("auth-methods/%s", authMethodId), nil, apiOpts...) + if err != nil { + return false, nil, fmt.Errorf("error creating Delete request: %w", err) + } + + resp, err := c.client.Do(req) + if err != nil { + return false, nil, fmt.Errorf("error performing client request during Delete call: %w", err) + } + + type deleteResponse struct { + Existed bool + } + target := &deleteResponse{} + apiErr, err := resp.Decode(target) + if err != nil { + return false, nil, fmt.Errorf("error decoding Delete response: %w", err) + } + + return target.Existed, apiErr, nil +} + +func (c *authmethodClient) List(ctx context.Context, opt ...Option) ([]*AuthMethod, *api.Error, error) { + if c.client == nil { + return nil, nil, fmt.Errorf("nil client") + } + + _, apiOpts := getOpts(opt...) + + req, err := c.client.NewRequest(ctx, "GET", fmt.Sprintf("auth-methods"), nil, apiOpts...) + if err != nil { + return nil, nil, fmt.Errorf("error creating List request: %w", err) + } + + resp, err := c.client.Do(req) + if err != nil { + return nil, nil, fmt.Errorf("error performing client request during List call: %w", err) + } + + type listResponse struct { + Items []*AuthMethod + } + target := &listResponse{} + apiErr, err := resp.Decode(target) + if err != nil { + return nil, nil, fmt.Errorf("error decoding List response: %w", err) + } + + return target.Items, apiErr, nil +} diff --git a/api/authmethods/option.gen.go b/api/authmethods/option.gen.go new file mode 100644 index 000000000..6bd66377d --- /dev/null +++ b/api/authmethods/option.gen.go @@ -0,0 +1,210 @@ +package authmethods + +import ( + "github.com/hashicorp/watchtower/api" +) + +// Option is a func that sets optional attributes for a call. This does not need +// to be used directly, but instead option arguments are built from the +// functions in this package. WithX options set a value to that given in the +// argument; DefaultX options indicate that the value should be set to its +// default. When an API call is made options are processed in ther order they +// appear in the function call, so for a given argument X, a succession of WithX +// or DefaultX calls will result in the last call taking effect. +type Option func(*options) + +type options struct { + valueMap map[string]interface{} + withScopeId string + withAutomaticVersioning bool +} + +func getDefaultOptions() options { + return options{ + valueMap: make(map[string]interface{}), + } +} + +func getOpts(opt ...Option) (options, []api.Option) { + opts := getDefaultOptions() + for _, o := range opt { + o(&opts) + } + var apiOpts []api.Option + if opts.withScopeId != "" { + apiOpts = append(apiOpts, api.WithScopeId(opts.withScopeId)) + } + return opts, apiOpts +} + +func WithScopeId(id string) Option { + return func(o *options) { + o.withScopeId = id + } +} + +// If set, and if the version is zero during an update, the API will perform a +// fetch to get the current version of the resource and populate it during the +// update call. This is convenient but opens up the possibility for subtle +// order-of-modification issues, so use carefully. +func WithAutomaticVersioning() Option { + return func(o *options) { + o.withAutomaticVersioning = true + } +} + +func WithAttributes(inAttributes map[string]interface{}) Option { + return func(o *options) { + o.valueMap["attributes"] = inAttributes + } +} + +func DefaultAttributes() Option { + return func(o *options) { + o.valueMap["attributes"] = nil + } +} + +func WithDescription(inDescription string) Option { + return func(o *options) { + o.valueMap["description"] = inDescription + } +} + +func DefaultDescription() Option { + return func(o *options) { + o.valueMap["description"] = nil + } +} + +func WithDisabled(inDisabled bool) Option { + return func(o *options) { + o.valueMap["disabled"] = inDisabled + } +} + +func DefaultDisabled() Option { + return func(o *options) { + o.valueMap["disabled"] = nil + } +} + +func WithPasswordAuthMethodMinPasswordLength(inMinPasswordLength uint32) Option { + return func(o *options) { + raw, ok := o.valueMap["attributes"] + if !ok { + raw = interface{}(map[string]interface{}{}) + } + val := raw.(map[string]interface{}) + val["min_password_length"] = inMinPasswordLength + o.valueMap["attributes"] = val + } +} + +func DefaultPasswordAuthMethodMinPasswordLength() Option { + return func(o *options) { + raw, ok := o.valueMap["attributes"] + if !ok { + raw = interface{}(map[string]interface{}{}) + } + val := raw.(map[string]interface{}) + val["min_password_length"] = nil + o.valueMap["attributes"] = val + } +} + +func WithPasswordAuthMethodMinUserNameLength(inMinUserNameLength uint32) Option { + return func(o *options) { + raw, ok := o.valueMap["attributes"] + if !ok { + raw = interface{}(map[string]interface{}{}) + } + val := raw.(map[string]interface{}) + val["min_user_name_length"] = inMinUserNameLength + o.valueMap["attributes"] = val + } +} + +func DefaultPasswordAuthMethodMinUserNameLength() Option { + return func(o *options) { + raw, ok := o.valueMap["attributes"] + if !ok { + raw = interface{}(map[string]interface{}{}) + } + val := raw.(map[string]interface{}) + val["min_user_name_length"] = nil + o.valueMap["attributes"] = val + } +} + +func WithName(inName string) Option { + return func(o *options) { + o.valueMap["name"] = inName + } +} + +func DefaultName() Option { + return func(o *options) { + o.valueMap["name"] = nil + } +} + +func WithPasswordAccountPassword(inPassword string) Option { + return func(o *options) { + raw, ok := o.valueMap["attributes"] + if !ok { + raw = interface{}(map[string]interface{}{}) + } + val := raw.(map[string]interface{}) + val["password"] = inPassword + o.valueMap["attributes"] = val + } +} + +func DefaultPasswordAccountPassword() Option { + return func(o *options) { + raw, ok := o.valueMap["attributes"] + if !ok { + raw = interface{}(map[string]interface{}{}) + } + val := raw.(map[string]interface{}) + val["password"] = nil + o.valueMap["attributes"] = val + } +} + +func WithType(inType string) Option { + return func(o *options) { + o.valueMap["type"] = inType + } +} + +func DefaultType() Option { + return func(o *options) { + o.valueMap["type"] = nil + } +} + +func WithPasswordAccountUsername(inUsername string) Option { + return func(o *options) { + raw, ok := o.valueMap["attributes"] + if !ok { + raw = interface{}(map[string]interface{}{}) + } + val := raw.(map[string]interface{}) + val["username"] = inUsername + o.valueMap["attributes"] = val + } +} + +func DefaultPasswordAccountUsername() Option { + return func(o *options) { + raw, ok := o.valueMap["attributes"] + if !ok { + raw = interface{}(map[string]interface{}{}) + } + val := raw.(map[string]interface{}) + val["username"] = nil + o.valueMap["attributes"] = val + } +} diff --git a/api/authmethods/password_account_attributes.gen.go b/api/authmethods/password_account_attributes.gen.go new file mode 100644 index 000000000..9f9ca1c13 --- /dev/null +++ b/api/authmethods/password_account_attributes.gen.go @@ -0,0 +1,7 @@ +// Code generated by "make api"; DO NOT EDIT. +package authmethods + +type PasswordAccountAttributes struct { + Username string `json:"username,omitempty"` + Password string `json:"password,omitempty"` +} diff --git a/api/authmethods/password_auth_method_attributes.gen.go b/api/authmethods/password_auth_method_attributes.gen.go new file mode 100644 index 000000000..c8e0cdce6 --- /dev/null +++ b/api/authmethods/password_auth_method_attributes.gen.go @@ -0,0 +1,7 @@ +// Code generated by "make api"; DO NOT EDIT. +package authmethods + +type PasswordAuthMethodAttributes struct { + MinUserNameLength uint32 `json:"min_user_name_length,omitempty"` + MinPasswordLength uint32 `json:"min_password_length,omitempty"` +} diff --git a/api/authtokens/authtoken.gen.go b/api/authtokens/authtoken.gen.go deleted file mode 100644 index 8c103d995..000000000 --- a/api/authtokens/authtoken.gen.go +++ /dev/null @@ -1,83 +0,0 @@ -// Code generated by "make api"; DO NOT EDIT. -package authtokens - -import ( - "encoding/json" - "strings" - "time" - - "github.com/fatih/structs" - - "github.com/hashicorp/watchtower/api" - "github.com/hashicorp/watchtower/api/info" - "github.com/hashicorp/watchtower/api/internal/strutil" -) - -type AuthToken struct { - Client *api.Client `json:"-"` - - defaultFields []string - - // The ID of the AuthToken - // Output only. - Id string `json:"id,omitempty"` - // Scope information for this resource - // Output only. - Scope info.Scope `json:"scope,omitempty"` - // The token value, which will only be populated after authentication and is - // only ever visible to the end user whose login request resulted in this - // auth token being created. - // Output only. - Token string `json:"token,omitempty"` - // The id of the user of this AuthToken. - // Output only. - UserId string `json:"user_id,omitempty"` - // The id of the user of this AuthToken. - // Output only. - AuthMethodId string `json:"auth_method_id,omitempty"` - // The time this resource was created - // Output only. - CreatedTime time.Time `json:"created_time,omitempty"` - // The time this resource was last updated. - // Output only. - UpdatedTime time.Time `json:"updated_time,omitempty"` - // The approximate time this AuthToken was last used. - // Output only. - ApproximateLastUsedTime time.Time `json:"approximate_last_used_time,omitempty"` - // The time this AuthToken expires. - // Output only. - ExpirationTime time.Time `json:"expiration_time,omitempty"` -} - -func (s *AuthToken) SetDefault(key string) { - lowerKey := strings.ToLower(key) - validMap := map[string]string{"approximatelastusedtime": "approximate_last_used_time", "authmethodid": "auth_method_id", "createdtime": "created_time", "expirationtime": "expiration_time", "id": "id", "scope": "scope", "token": "token", "updatedtime": "updated_time", "userid": "user_id"} - for k, v := range validMap { - if k == lowerKey || v == lowerKey { - s.defaultFields = strutil.AppendIfMissing(s.defaultFields, v) - return - } - } -} - -func (s *AuthToken) UnsetDefault(key string) { - lowerKey := strings.ToLower(key) - validMap := map[string]string{"approximatelastusedtime": "approximate_last_used_time", "authmethodid": "auth_method_id", "createdtime": "created_time", "expirationtime": "expiration_time", "id": "id", "scope": "scope", "token": "token", "updatedtime": "updated_time", "userid": "user_id"} - for k, v := range validMap { - if k == lowerKey || v == lowerKey { - s.defaultFields = strutil.StrListDelete(s.defaultFields, v) - return - } - } -} - -func (s AuthToken) MarshalJSON() ([]byte, error) { - m := structs.Map(s) - if m == nil { - m = make(map[string]interface{}) - } - for _, k := range s.defaultFields { - m[k] = nil - } - return json.Marshal(m) -} diff --git a/api/authtokens/authtokens.gen.go b/api/authtokens/authtokens.gen.go new file mode 100644 index 000000000..0d987a814 --- /dev/null +++ b/api/authtokens/authtokens.gen.go @@ -0,0 +1,123 @@ +// Code generated by "make api"; DO NOT EDIT. +package authtokens + +import ( + "context" + "fmt" + "time" + + "github.com/hashicorp/watchtower/api" + "github.com/hashicorp/watchtower/api/scopes" +) + +type AuthToken struct { + Id string `json:"id,omitempty"` + Scope *scopes.ScopeInfo `json:"scope,omitempty"` + Token string `json:"token,omitempty"` + UserId string `json:"user_id,omitempty"` + AuthMethodId string `json:"auth_method_id,omitempty"` + CreatedTime time.Time `json:"created_time,omitempty"` + UpdatedTime time.Time `json:"updated_time,omitempty"` + ApproximateLastUsedTime time.Time `json:"approximate_last_used_time,omitempty"` + ExpirationTime time.Time `json:"expiration_time,omitempty"` +} + +type authtokenClient struct { + client *api.Client +} + +func NewAuthTokenClient(c *api.Client) *authtokenClient { + return &authtokenClient{client: c} +} + +func (c *authtokenClient) Read(ctx context.Context, authTokenId string, opt ...Option) (*AuthToken, *api.Error, error) { + if authTokenId == "" { + return nil, nil, fmt.Errorf("empty authTokenId value passed into Read request") + } + + if c.client == nil { + return nil, nil, fmt.Errorf("nil client") + } + + _, apiOpts := getOpts(opt...) + + req, err := c.client.NewRequest(ctx, "GET", fmt.Sprintf("auth-tokens/%s", authTokenId), nil, apiOpts...) + if err != nil { + return nil, nil, fmt.Errorf("error creating Read request: %w", err) + } + + resp, err := c.client.Do(req) + if err != nil { + return nil, nil, fmt.Errorf("error performing client request during Read call: %w", err) + } + + target := new(AuthToken) + apiErr, err := resp.Decode(target) + if err != nil { + return nil, nil, fmt.Errorf("error decoding Read response: %w", err) + } + + return target, apiErr, nil +} + +func (c *authtokenClient) Delete(ctx context.Context, authTokenId string, opt ...Option) (bool, *api.Error, error) { + if authTokenId == "" { + return false, nil, fmt.Errorf("empty authTokenId value passed into Delete request") + } + + if c.client == nil { + return false, nil, fmt.Errorf("nil client") + } + + _, apiOpts := getOpts(opt...) + + req, err := c.client.NewRequest(ctx, "DELETE", fmt.Sprintf("auth-tokens/%s", authTokenId), nil, apiOpts...) + if err != nil { + return false, nil, fmt.Errorf("error creating Delete request: %w", err) + } + + resp, err := c.client.Do(req) + if err != nil { + return false, nil, fmt.Errorf("error performing client request during Delete call: %w", err) + } + + type deleteResponse struct { + Existed bool + } + target := &deleteResponse{} + apiErr, err := resp.Decode(target) + if err != nil { + return false, nil, fmt.Errorf("error decoding Delete response: %w", err) + } + + return target.Existed, apiErr, nil +} + +func (c *authtokenClient) List(ctx context.Context, opt ...Option) ([]*AuthToken, *api.Error, error) { + if c.client == nil { + return nil, nil, fmt.Errorf("nil client") + } + + _, apiOpts := getOpts(opt...) + + req, err := c.client.NewRequest(ctx, "GET", fmt.Sprintf("auth-tokens"), nil, apiOpts...) + if err != nil { + return nil, nil, fmt.Errorf("error creating List request: %w", err) + } + + resp, err := c.client.Do(req) + if err != nil { + return nil, nil, fmt.Errorf("error performing client request during List call: %w", err) + } + + type listResponse struct { + Items []*AuthToken + } + target := &listResponse{} + apiErr, err := resp.Decode(target) + if err != nil { + return nil, nil, fmt.Errorf("error decoding List response: %w", err) + } + + return target.Items, apiErr, nil +} diff --git a/api/authtokens/delete.gen.go b/api/authtokens/delete.gen.go deleted file mode 100644 index eb93159d9..000000000 --- a/api/authtokens/delete.gen.go +++ /dev/null @@ -1,49 +0,0 @@ -// Code generated by "make api"; DO NOT EDIT. -package authtokens - -import ( - "context" - "fmt" - - "github.com/hashicorp/watchtower/api" -) - -// DeleteAuthToken returns true iff the AuthToken existed when the delete attempt was made. -func (s AuthToken) DeleteAuthToken(ctx context.Context, id string) (bool, *api.Error, error) { - if id == "" { - return false, nil, fmt.Errorf("empty id provided to DeleteAuthToken request") - } - - if s.Client == nil { - return false, nil, fmt.Errorf("nil client in DeleteAuthToken request") - } - - var opts []api.Option - if s.Scope.Id != "" { - // If it's explicitly set here, override anything that might be in the - // client - opts = append(opts, api.WithScopeId(s.Scope.Id)) - } - - req, err := s.Client.NewRequest(ctx, "DELETE", fmt.Sprintf("%s/%s", "auth-tokens", id), nil, opts...) - if err != nil { - return false, nil, fmt.Errorf("error creating DeleteAuthToken request: %w", err) - } - - resp, err := s.Client.Do(req) - if err != nil { - return false, nil, fmt.Errorf("error performing client request during DeleteAuthToken call: %w", err) - } - - type deleteResponse struct { - Existed bool - } - target := &deleteResponse{} - - apiErr, err := resp.Decode(target) - if err != nil { - return false, nil, fmt.Errorf("error decoding DeleteAuthToken repsonse: %w", err) - } - - return target.Existed, apiErr, nil -} diff --git a/api/authtokens/list.gen.go b/api/authtokens/list.gen.go deleted file mode 100644 index b27b51d80..000000000 --- a/api/authtokens/list.gen.go +++ /dev/null @@ -1,50 +0,0 @@ -// Code generated by "make api"; DO NOT EDIT. -package authtokens - -import ( - "context" - "fmt" - - "github.com/hashicorp/watchtower/api" -) - -func (s AuthToken) ListAuthTokens(ctx context.Context) ([]*AuthToken, *api.Error, error) { - if s.Client == nil { - return nil, nil, fmt.Errorf("nil client in ListAuthToken request") - } - - var opts []api.Option - if s.Scope.Id != "" { - // If it's explicitly set here, override anything that might be in the - // client - opts = append(opts, api.WithScopeId(s.Scope.Id)) - } - - req, err := s.Client.NewRequest(ctx, "GET", "auth-tokens", nil, opts...) - if err != nil { - return nil, nil, fmt.Errorf("error creating ListAuthTokens request: %w", err) - } - - resp, err := s.Client.Do(req) - if err != nil { - return nil, nil, fmt.Errorf("error performing client request during ListAuthTokens call: %w", err) - } - - type listResponse struct { - Items []*AuthToken - } - target := &listResponse{} - - apiErr, err := resp.Decode(target) - if err != nil { - return nil, nil, fmt.Errorf("error decoding ListAuthTokens response: %w", err) - } - - for _, t := range target.Items { - - t.Client = s.Client - - } - - return target.Items, apiErr, nil -} diff --git a/api/authtokens/option.gen.go b/api/authtokens/option.gen.go new file mode 100644 index 000000000..ede5c23e9 --- /dev/null +++ b/api/authtokens/option.gen.go @@ -0,0 +1,54 @@ +package authtokens + +import ( + "github.com/hashicorp/watchtower/api" +) + +// Option is a func that sets optional attributes for a call. This does not need +// to be used directly, but instead option arguments are built from the +// functions in this package. WithX options set a value to that given in the +// argument; DefaultX options indicate that the value should be set to its +// default. When an API call is made options are processed in ther order they +// appear in the function call, so for a given argument X, a succession of WithX +// or DefaultX calls will result in the last call taking effect. +type Option func(*options) + +type options struct { + valueMap map[string]interface{} + withScopeId string + withAutomaticVersioning bool +} + +func getDefaultOptions() options { + return options{ + valueMap: make(map[string]interface{}), + } +} + +func getOpts(opt ...Option) (options, []api.Option) { + opts := getDefaultOptions() + for _, o := range opt { + o(&opts) + } + var apiOpts []api.Option + if opts.withScopeId != "" { + apiOpts = append(apiOpts, api.WithScopeId(opts.withScopeId)) + } + return opts, apiOpts +} + +func WithScopeId(id string) Option { + return func(o *options) { + o.withScopeId = id + } +} + +// If set, and if the version is zero during an update, the API will perform a +// fetch to get the current version of the resource and populate it during the +// update call. This is convenient but opens up the possibility for subtle +// order-of-modification issues, so use carefully. +func WithAutomaticVersioning() Option { + return func(o *options) { + o.withAutomaticVersioning = true + } +} diff --git a/api/authtokens/read.gen.go b/api/authtokens/read.gen.go deleted file mode 100644 index e7f1222de..000000000 --- a/api/authtokens/read.gen.go +++ /dev/null @@ -1,46 +0,0 @@ -// Code generated by "make api"; DO NOT EDIT. -package authtokens - -import ( - "context" - "fmt" - - "github.com/hashicorp/watchtower/api" -) - -func (s AuthToken) ReadAuthToken(ctx context.Context, id string) (*AuthToken, *api.Error, error) { - if id == "" { - return nil, nil, fmt.Errorf("empty ID value passed into ReadAuthToken request") - } - - if s.Client == nil { - return nil, nil, fmt.Errorf("nil client in ReadAuthToken request") - } - - var opts []api.Option - if s.Scope.Id != "" { - // If it's explicitly set here, override anything that might be in the - // client - opts = append(opts, api.WithScopeId(s.Scope.Id)) - } - - req, err := s.Client.NewRequest(ctx, "GET", fmt.Sprintf("%s/%s", "auth-tokens", id), nil, opts...) - if err != nil { - return nil, nil, fmt.Errorf("error creating ReadAuthToken request: %w", err) - } - - resp, err := s.Client.Do(req) - if err != nil { - return nil, nil, fmt.Errorf("error performing client request during ReadAuthToken call: %w", err) - } - - target := new(AuthToken) - apiErr, err := resp.Decode(target) - if err != nil { - return nil, nil, fmt.Errorf("error decoding ReadAuthToken repsonse: %w", err) - } - - target.Client = s.Client - - return target, apiErr, nil -} diff --git a/api/client.go b/api/client.go index 9b08df9ad..701e27a5f 100644 --- a/api/client.go +++ b/api/client.go @@ -140,6 +140,7 @@ func DefaultConfig() (*Config, error) { HttpClient: cleanhttp.DefaultPooledClient(), Timeout: time.Second * 60, TLSConfig: &TLSConfig{}, + ScopeId: "global", } // We read the environment now; after DefaultClient returns we can override @@ -672,6 +673,9 @@ func (c *Client) NewRequest(ctx context.Context, method, requestPath string, bod if opts.withScopeId != "" { scopeId = opts.withScopeId } + if scopeId == "" { + scopeId = "global" + } scopedPath := strings.TrimPrefix(requestPath, "/") switch requestPath { @@ -683,9 +687,7 @@ func (c *Client) NewRequest(ctx context.Context, method, requestPath string, bod // If their path already has 'scopes/' in it, use the given request path // instead of building it from the client's scope information if !strings.HasPrefix(scopedPath, "scopes/") { - if scopeId != "" { - scopedPath = path.Join("scopes", scopeId, scopedPath) - } + scopedPath = path.Join("scopes", scopeId, scopedPath) } } scopedPath = path.Join(u.Path, "/v1", scopedPath) diff --git a/api/error.gen.go b/api/error.gen.go index 9d6c77f27..063236c95 100644 --- a/api/error.gen.go +++ b/api/error.gen.go @@ -2,14 +2,8 @@ package api type Error struct { - - // The HTTP Status code applicable to this error - Status int32 `json:"status,omitempty"` - // An application-specific error string - Code string `json:"code,omitempty"` - // A human readable explanation specific to this occurrence of the error - Message string `json:"message,omitempty"` - // Additional metadata regarding the error. Depending on the error - // different fields will be populated. + Status int32 `json:"status,omitempty"` + Code string `json:"code,omitempty"` + Message string `json:"message,omitempty"` Details *ErrorDetails `json:"details,omitempty"` } diff --git a/api/groups/create.gen.go b/api/groups/create.gen.go deleted file mode 100644 index 72b10ec3a..000000000 --- a/api/groups/create.gen.go +++ /dev/null @@ -1,42 +0,0 @@ -// Code generated by "make api"; DO NOT EDIT. -package groups - -import ( - "context" - "fmt" - - "github.com/hashicorp/watchtower/api" -) - -func (s Group) CreateGroup(ctx context.Context, r *Group) (*Group, *api.Error, error) { - if s.Client == nil { - return nil, nil, fmt.Errorf("nil client in CreateGroup request") - } - - var opts []api.Option - if s.Scope.Id != "" { - // If it's explicitly set here, override anything that might be in the - // client - opts = append(opts, api.WithScopeId(s.Scope.Id)) - } - - req, err := s.Client.NewRequest(ctx, "POST", "groups", r, opts...) - if err != nil { - return nil, nil, fmt.Errorf("error creating CreateGroup request: %w", err) - } - - resp, err := s.Client.Do(req) - if err != nil { - return nil, nil, fmt.Errorf("error performing client request during CreateGroup call: %w", err) - } - - target := new(Group) - apiErr, err := resp.Decode(target) - if err != nil { - return nil, nil, fmt.Errorf("error decoding CreateGroup repsonse: %w", err) - } - - target.Client = s.Client - - return target, apiErr, nil -} diff --git a/api/groups/custom.go b/api/groups/custom.go deleted file mode 100644 index 827e3b3e6..000000000 --- a/api/groups/custom.go +++ /dev/null @@ -1,117 +0,0 @@ -package groups - -import ( - "context" - "fmt" - - "github.com/hashicorp/watchtower/api" -) - -func (s Group) AddMembers(ctx context.Context, memberIds []string) (*Group, *api.Error, error) { - if s.Client == nil { - return nil, nil, fmt.Errorf("nil client in AddMembers request") - } - // We assume that the client provided has the org and optionally the project id of the request. - - if len(memberIds) == 0 { - return nil, nil, fmt.Errorf("empty memberIds slice") - } - - body := map[string]interface{}{ - "version": s.Version, - "member_ids": memberIds, - } - - req, err := s.Client.NewRequest(ctx, "POST", fmt.Sprintf("groups/%s:add-members", s.Id), body) - if err != nil { - return nil, nil, fmt.Errorf("error creating AddMembers request: %w", err) - } - - resp, err := s.Client.Do(req) - if err != nil { - return nil, nil, fmt.Errorf("error performing client request during AddMembers call: %w", err) - } - - target := new(Group) - apiErr, err := resp.Decode(target) - if err != nil { - return nil, nil, fmt.Errorf("error decoding AddMembers repsonse: %w", err) - } - - target.Client = s.Client - - return target, apiErr, nil -} - -func (s Group) SetMembers(ctx context.Context, memberIds []string) (*Group, *api.Error, error) { - if s.Client == nil { - return nil, nil, fmt.Errorf("nil client in SetMembers request") - } - // We assume that the client provided has the org and optionally the project id of the request. - - body := map[string]interface{}{ - "version": s.Version, - } - if len(memberIds) > 0 { - body["member_ids"] = memberIds - } else if memberIds != nil { - // In this function, a non-nil but empty list means clear out - body["member_ids"] = nil - } - - req, err := s.Client.NewRequest(ctx, "POST", fmt.Sprintf("groups/%s:set-members", s.Id), body) - if err != nil { - return nil, nil, fmt.Errorf("error creating SetMembers request: %w", err) - } - - resp, err := s.Client.Do(req) - if err != nil { - return nil, nil, fmt.Errorf("error performing client request during SetMembers call: %w", err) - } - - target := new(Group) - apiErr, err := resp.Decode(target) - if err != nil { - return nil, nil, fmt.Errorf("error decoding SetMembers repsonse: %w", err) - } - - target.Client = s.Client - - return target, apiErr, nil -} - -func (s Group) RemoveMembers(ctx context.Context, memberIds []string) (*Group, *api.Error, error) { - if s.Client == nil { - return nil, nil, fmt.Errorf("nil client in RemoveMembers request") - } - // We assume that the client provided has the org and optionally the project id of the request. - - if len(memberIds) == 0 { - return nil, nil, fmt.Errorf("empty memberIds slice") - } - - body := map[string]interface{}{ - "version": s.Version, - "member_ids": memberIds, - } - - req, err := s.Client.NewRequest(ctx, "POST", fmt.Sprintf("groups/%s:remove-members", s.Id), body) - if err != nil { - return nil, nil, fmt.Errorf("error creating RemoveMembers request: %w", err) - } - - resp, err := s.Client.Do(req) - if err != nil { - return nil, nil, fmt.Errorf("error performing client request during RemoveMembers call: %w", err) - } - - target := new(Group) - apiErr, err := resp.Decode(target) - if err != nil { - return nil, nil, fmt.Errorf("error decoding RemoveMembers repsonse: %w", err) - } - - target.Client = s.Client - - return target, apiErr, nil -} diff --git a/api/groups/delete.gen.go b/api/groups/delete.gen.go deleted file mode 100644 index e399f1808..000000000 --- a/api/groups/delete.gen.go +++ /dev/null @@ -1,49 +0,0 @@ -// Code generated by "make api"; DO NOT EDIT. -package groups - -import ( - "context" - "fmt" - - "github.com/hashicorp/watchtower/api" -) - -// DeleteGroup returns true iff the Group existed when the delete attempt was made. -func (s Group) DeleteGroup(ctx context.Context, id string) (bool, *api.Error, error) { - if id == "" { - return false, nil, fmt.Errorf("empty id provided to DeleteGroup request") - } - - if s.Client == nil { - return false, nil, fmt.Errorf("nil client in DeleteGroup request") - } - - var opts []api.Option - if s.Scope.Id != "" { - // If it's explicitly set here, override anything that might be in the - // client - opts = append(opts, api.WithScopeId(s.Scope.Id)) - } - - req, err := s.Client.NewRequest(ctx, "DELETE", fmt.Sprintf("%s/%s", "groups", id), nil, opts...) - if err != nil { - return false, nil, fmt.Errorf("error creating DeleteGroup request: %w", err) - } - - resp, err := s.Client.Do(req) - if err != nil { - return false, nil, fmt.Errorf("error performing client request during DeleteGroup call: %w", err) - } - - type deleteResponse struct { - Existed bool - } - target := &deleteResponse{} - - apiErr, err := resp.Decode(target) - if err != nil { - return false, nil, fmt.Errorf("error decoding DeleteGroup repsonse: %w", err) - } - - return target.Existed, apiErr, nil -} diff --git a/api/groups/group.gen.go b/api/groups/group.gen.go index e0cfb7861..0e2d0e23a 100644 --- a/api/groups/group.gen.go +++ b/api/groups/group.gen.go @@ -2,81 +2,355 @@ package groups import ( - "encoding/json" - "strings" + "context" + "errors" + "fmt" "time" - "github.com/fatih/structs" + "github.com/kr/pretty" "github.com/hashicorp/watchtower/api" - "github.com/hashicorp/watchtower/api/info" - "github.com/hashicorp/watchtower/api/internal/strutil" + "github.com/hashicorp/watchtower/api/scopes" ) type Group struct { - Client *api.Client `json:"-"` - - defaultFields []string - - // The ID of the Project - // Output only. - Id string `json:"id,omitempty"` - // Scope information for this resource - // Output only. - Scope info.Scope `json:"scope,omitempty"` - // Optional name for identification purposes - Name *string `json:"name,omitempty"` - // Optional user-set descripton for identification purposes - Description *string `json:"description,omitempty"` - // The time this resource was created - // Output only. - CreatedTime time.Time `json:"created_time,omitempty"` - // The time this resource was last updated. - // Output only. - UpdatedTime time.Time `json:"updated_time,omitempty"` - // Whether the resource is disabled - Disabled *bool `json:"disabled,omitempty"` - // The version can be used in subsiquent write requests to ensure this resource - // has not changed and to fail the write if it has. - // Output only. - Version uint32 `json:"version,omitempty"` - // Contains the list of member ids in this group. - // Output only. - MemberIds []string `json:"member_ids,omitempty"` - // The members of this group. - // Output only. - Members []*Member `json:"members,omitempty"` + Id string `json:"id,omitempty"` + Scope *scopes.ScopeInfo `json:"scope,omitempty"` + Name string `json:"name,omitempty"` + Description string `json:"description,omitempty"` + CreatedTime time.Time `json:"created_time,omitempty"` + UpdatedTime time.Time `json:"updated_time,omitempty"` + Disabled bool `json:"disabled,omitempty"` + Version uint32 `json:"version,omitempty"` + MemberIds []string `json:"member_ids,omitempty"` + Members []*Member `json:"members,omitempty"` } -func (s *Group) SetDefault(key string) { - lowerKey := strings.ToLower(key) - validMap := map[string]string{"createdtime": "created_time", "description": "description", "disabled": "disabled", "id": "id", "memberids": "member_ids", "members": "members", "name": "name", "scope": "scope", "updatedtime": "updated_time", "version": "version"} - for k, v := range validMap { - if k == lowerKey || v == lowerKey { - s.defaultFields = strutil.AppendIfMissing(s.defaultFields, v) - return +type groupClient struct { + client *api.Client +} + +func NewGroupClient(c *api.Client) *groupClient { + return &groupClient{client: c} +} + +func (c *groupClient) Create(ctx context.Context, opt ...Option) (*Group, *api.Error, error) { + if c.client == nil { + return nil, nil, fmt.Errorf("nil client") + } + + opts, apiOpts := getOpts(opt...) + + req, err := c.client.NewRequest(ctx, "POST", fmt.Sprintf("groups"), opts.valueMap, apiOpts...) + if err != nil { + return nil, nil, fmt.Errorf("error creating Create request: %w", err) + } + + resp, err := c.client.Do(req) + if err != nil { + return nil, nil, fmt.Errorf("error performing client request during Create call: %w", err) + } + + target := new(Group) + apiErr, err := resp.Decode(target) + if err != nil { + return nil, nil, fmt.Errorf("error decoding Create response: %w", err) + } + + return target, apiErr, nil +} + +func (c *groupClient) Read(ctx context.Context, groupId string, opt ...Option) (*Group, *api.Error, error) { + if groupId == "" { + return nil, nil, fmt.Errorf("empty groupId value passed into Read request") + } + + if c.client == nil { + return nil, nil, fmt.Errorf("nil client") + } + + _, apiOpts := getOpts(opt...) + + req, err := c.client.NewRequest(ctx, "GET", fmt.Sprintf("groups/%s", groupId), nil, apiOpts...) + if err != nil { + return nil, nil, fmt.Errorf("error creating Read request: %w", err) + } + + resp, err := c.client.Do(req) + if err != nil { + return nil, nil, fmt.Errorf("error performing client request during Read call: %w", err) + } + + target := new(Group) + apiErr, err := resp.Decode(target) + if err != nil { + return nil, nil, fmt.Errorf("error decoding Read response: %w", err) + } + + return target, apiErr, nil +} + +func (c *groupClient) Update(ctx context.Context, groupId string, version uint32, opt ...Option) (*Group, *api.Error, error) { + if groupId == "" { + return nil, nil, fmt.Errorf("empty groupId value passed into Update request") + } + if c.client == nil { + return nil, nil, fmt.Errorf("nil client") + } + + opts, apiOpts := getOpts(opt...) + + if version == 0 { + if !opts.withAutomaticVersioning { + return nil, nil, errors.New("zero version number passed into Update request and automatic versioning not specified") } - } -} - -func (s *Group) UnsetDefault(key string) { - lowerKey := strings.ToLower(key) - validMap := map[string]string{"createdtime": "created_time", "description": "description", "disabled": "disabled", "id": "id", "memberids": "member_ids", "members": "members", "name": "name", "scope": "scope", "updatedtime": "updated_time", "version": "version"} - for k, v := range validMap { - if k == lowerKey || v == lowerKey { - s.defaultFields = strutil.StrListDelete(s.defaultFields, v) - return + existingTarget, existingApiErr, existingErr := c.Read(ctx, groupId, opt...) + if existingErr != nil { + return nil, nil, fmt.Errorf("error performing initial check-and-set read: %w", existingErr) } + if existingApiErr != nil { + return nil, nil, fmt.Errorf("error from controller when performing initial check-and-set read: %s", pretty.Sprint(existingApiErr)) + } + if existingTarget == nil { + return nil, nil, errors.New("nil resource found when performing initial check-and-set read") + } + version = existingTarget.Version } + opts.valueMap["version"] = version + + req, err := c.client.NewRequest(ctx, "PATCH", fmt.Sprintf("groups/%s", groupId), opts.valueMap, apiOpts...) + if err != nil { + return nil, nil, fmt.Errorf("error creating Update request: %w", err) + } + + resp, err := c.client.Do(req) + if err != nil { + return nil, nil, fmt.Errorf("error performing client request during Update call: %w", err) + } + + target := new(Group) + apiErr, err := resp.Decode(target) + if err != nil { + return nil, nil, fmt.Errorf("error decoding Update response: %w", err) + } + + return target, apiErr, nil } -func (s Group) MarshalJSON() ([]byte, error) { - m := structs.Map(s) - if m == nil { - m = make(map[string]interface{}) +func (c *groupClient) Delete(ctx context.Context, groupId string, opt ...Option) (bool, *api.Error, error) { + if groupId == "" { + return false, nil, fmt.Errorf("empty groupId value passed into Delete request") } - for _, k := range s.defaultFields { - m[k] = nil + + if c.client == nil { + return false, nil, fmt.Errorf("nil client") } - return json.Marshal(m) + + _, apiOpts := getOpts(opt...) + + req, err := c.client.NewRequest(ctx, "DELETE", fmt.Sprintf("groups/%s", groupId), nil, apiOpts...) + if err != nil { + return false, nil, fmt.Errorf("error creating Delete request: %w", err) + } + + resp, err := c.client.Do(req) + if err != nil { + return false, nil, fmt.Errorf("error performing client request during Delete call: %w", err) + } + + type deleteResponse struct { + Existed bool + } + target := &deleteResponse{} + apiErr, err := resp.Decode(target) + if err != nil { + return false, nil, fmt.Errorf("error decoding Delete response: %w", err) + } + + return target.Existed, apiErr, nil +} + +func (c *groupClient) List(ctx context.Context, opt ...Option) ([]*Group, *api.Error, error) { + if c.client == nil { + return nil, nil, fmt.Errorf("nil client") + } + + _, apiOpts := getOpts(opt...) + + req, err := c.client.NewRequest(ctx, "GET", fmt.Sprintf("groups"), nil, apiOpts...) + if err != nil { + return nil, nil, fmt.Errorf("error creating List request: %w", err) + } + + resp, err := c.client.Do(req) + if err != nil { + return nil, nil, fmt.Errorf("error performing client request during List call: %w", err) + } + + type listResponse struct { + Items []*Group + } + target := &listResponse{} + apiErr, err := resp.Decode(target) + if err != nil { + return nil, nil, fmt.Errorf("error decoding List response: %w", err) + } + + return target.Items, apiErr, nil +} + +func (c *groupClient) AddMembers(ctx context.Context, groupId string, version uint32, memberIds []string, opt ...Option) (*Group, *api.Error, error) { + if groupId == "" { + return nil, nil, fmt.Errorf("empty groupId value passed into AddMembers request") + } + if c.client == nil { + return nil, nil, fmt.Errorf("nil client") + } + + opts, apiOpts := getOpts(opt...) + + if version == 0 { + if !opts.withAutomaticVersioning { + return nil, nil, errors.New("zero version number passed into AddMembers request") + } + existingTarget, existingApiErr, existingErr := c.Read(ctx, groupId, opt...) + if existingErr != nil { + return nil, nil, fmt.Errorf("error performing initial check-and-set read: %w", existingErr) + } + if existingApiErr != nil { + return nil, nil, fmt.Errorf("error from controller when performing initial check-and-set read: %s", pretty.Sprint(existingApiErr)) + } + if existingTarget == nil { + return nil, nil, errors.New("nil resource found when performing initial check-and-set read") + } + version = existingTarget.Version + } + opts.valueMap["version"] = version + + if len(memberIds) > 0 { + opts.valueMap["member_ids"] = memberIds + } + + req, err := c.client.NewRequest(ctx, "POST", fmt.Sprintf("groups/%s:add-members", groupId), opts.valueMap, apiOpts...) + if err != nil { + return nil, nil, fmt.Errorf("error creating AddMembers request: %w", err) + } + + resp, err := c.client.Do(req) + if err != nil { + return nil, nil, fmt.Errorf("error performing client request during AddMembers call: %w", err) + } + + target := new(Group) + apiErr, err := resp.Decode(target) + if err != nil { + return nil, nil, fmt.Errorf("error decoding AddMembers response: %w", err) + } + + return target, apiErr, nil +} + +func (c *groupClient) SetMembers(ctx context.Context, groupId string, version uint32, memberIds []string, opt ...Option) (*Group, *api.Error, error) { + if groupId == "" { + return nil, nil, fmt.Errorf("empty groupId value passed into SetMembers request") + } + if c.client == nil { + return nil, nil, fmt.Errorf("nil client") + } + + opts, apiOpts := getOpts(opt...) + + if version == 0 { + if !opts.withAutomaticVersioning { + return nil, nil, errors.New("zero version number passed into SetMembers request") + } + existingTarget, existingApiErr, existingErr := c.Read(ctx, groupId, opt...) + if existingErr != nil { + return nil, nil, fmt.Errorf("error performing initial check-and-set read: %w", existingErr) + } + if existingApiErr != nil { + return nil, nil, fmt.Errorf("error from controller when performing initial check-and-set read: %s", pretty.Sprint(existingApiErr)) + } + if existingTarget == nil { + return nil, nil, errors.New("nil resource found when performing initial check-and-set read") + } + version = existingTarget.Version + } + opts.valueMap["version"] = version + + if len(memberIds) > 0 { + opts.valueMap["member_ids"] = memberIds + } else if memberIds != nil { + // In this function, a non-nil but empty list means clear out + opts.valueMap["member_ids"] = nil + } + + req, err := c.client.NewRequest(ctx, "POST", fmt.Sprintf("groups/%s:set-members", groupId), opts.valueMap, apiOpts...) + if err != nil { + return nil, nil, fmt.Errorf("error creating SetMembers request: %w", err) + } + + resp, err := c.client.Do(req) + if err != nil { + return nil, nil, fmt.Errorf("error performing client request during SetMembers call: %w", err) + } + + target := new(Group) + apiErr, err := resp.Decode(target) + if err != nil { + return nil, nil, fmt.Errorf("error decoding SetMembers response: %w", err) + } + + return target, apiErr, nil +} + +func (c *groupClient) RemoveMembers(ctx context.Context, groupId string, version uint32, memberIds []string, opt ...Option) (*Group, *api.Error, error) { + if groupId == "" { + return nil, nil, fmt.Errorf("empty groupId value passed into RemoveMembers request") + } + if c.client == nil { + return nil, nil, fmt.Errorf("nil client") + } + + opts, apiOpts := getOpts(opt...) + + if version == 0 { + if !opts.withAutomaticVersioning { + return nil, nil, errors.New("zero version number passed into RemoveMembers request") + } + existingTarget, existingApiErr, existingErr := c.Read(ctx, groupId, opt...) + if existingErr != nil { + return nil, nil, fmt.Errorf("error performing initial check-and-set read: %w", existingErr) + } + if existingApiErr != nil { + return nil, nil, fmt.Errorf("error from controller when performing initial check-and-set read: %s", pretty.Sprint(existingApiErr)) + } + if existingTarget == nil { + return nil, nil, errors.New("nil resource found when performing initial check-and-set read") + } + version = existingTarget.Version + } + opts.valueMap["version"] = version + + if len(memberIds) > 0 { + opts.valueMap["member_ids"] = memberIds + } + + req, err := c.client.NewRequest(ctx, "POST", fmt.Sprintf("groups/%s:remove-members", groupId), opts.valueMap, apiOpts...) + if err != nil { + return nil, nil, fmt.Errorf("error creating RemoveMembers request: %w", err) + } + + resp, err := c.client.Do(req) + if err != nil { + return nil, nil, fmt.Errorf("error performing client request during RemoveMembers call: %w", err) + } + + target := new(Group) + apiErr, err := resp.Decode(target) + if err != nil { + return nil, nil, fmt.Errorf("error decoding RemoveMembers response: %w", err) + } + + return target, apiErr, nil } diff --git a/api/groups/list.gen.go b/api/groups/list.gen.go deleted file mode 100644 index 17d7f09fe..000000000 --- a/api/groups/list.gen.go +++ /dev/null @@ -1,50 +0,0 @@ -// Code generated by "make api"; DO NOT EDIT. -package groups - -import ( - "context" - "fmt" - - "github.com/hashicorp/watchtower/api" -) - -func (s Group) ListGroups(ctx context.Context) ([]*Group, *api.Error, error) { - if s.Client == nil { - return nil, nil, fmt.Errorf("nil client in ListGroup request") - } - - var opts []api.Option - if s.Scope.Id != "" { - // If it's explicitly set here, override anything that might be in the - // client - opts = append(opts, api.WithScopeId(s.Scope.Id)) - } - - req, err := s.Client.NewRequest(ctx, "GET", "groups", nil, opts...) - if err != nil { - return nil, nil, fmt.Errorf("error creating ListGroups request: %w", err) - } - - resp, err := s.Client.Do(req) - if err != nil { - return nil, nil, fmt.Errorf("error performing client request during ListGroups call: %w", err) - } - - type listResponse struct { - Items []*Group - } - target := &listResponse{} - - apiErr, err := resp.Decode(target) - if err != nil { - return nil, nil, fmt.Errorf("error decoding ListGroups response: %w", err) - } - - for _, t := range target.Items { - - t.Client = s.Client - - } - - return target.Items, apiErr, nil -} diff --git a/api/groups/member.gen.go b/api/groups/member.gen.go index 0f207cf20..01fd29904 100644 --- a/api/groups/member.gen.go +++ b/api/groups/member.gen.go @@ -2,14 +2,7 @@ package groups type Member struct { - - // The ID of the member. - // Output only. - Id string `json:"id,omitempty"` - // The type of the member. - // Output only. - Type string `json:"type,omitempty"` - // The scope ID of the member. - // Output only. + Id string `json:"id,omitempty"` + Type string `json:"type,omitempty"` ScopeId string `json:"scope_id,omitempty"` } diff --git a/api/groups/option.gen.go b/api/groups/option.gen.go new file mode 100644 index 000000000..9b57a55cd --- /dev/null +++ b/api/groups/option.gen.go @@ -0,0 +1,90 @@ +package groups + +import ( + "github.com/hashicorp/watchtower/api" +) + +// Option is a func that sets optional attributes for a call. This does not need +// to be used directly, but instead option arguments are built from the +// functions in this package. WithX options set a value to that given in the +// argument; DefaultX options indicate that the value should be set to its +// default. When an API call is made options are processed in ther order they +// appear in the function call, so for a given argument X, a succession of WithX +// or DefaultX calls will result in the last call taking effect. +type Option func(*options) + +type options struct { + valueMap map[string]interface{} + withScopeId string + withAutomaticVersioning bool +} + +func getDefaultOptions() options { + return options{ + valueMap: make(map[string]interface{}), + } +} + +func getOpts(opt ...Option) (options, []api.Option) { + opts := getDefaultOptions() + for _, o := range opt { + o(&opts) + } + var apiOpts []api.Option + if opts.withScopeId != "" { + apiOpts = append(apiOpts, api.WithScopeId(opts.withScopeId)) + } + return opts, apiOpts +} + +func WithScopeId(id string) Option { + return func(o *options) { + o.withScopeId = id + } +} + +// If set, and if the version is zero during an update, the API will perform a +// fetch to get the current version of the resource and populate it during the +// update call. This is convenient but opens up the possibility for subtle +// order-of-modification issues, so use carefully. +func WithAutomaticVersioning() Option { + return func(o *options) { + o.withAutomaticVersioning = true + } +} + +func WithDescription(inDescription string) Option { + return func(o *options) { + o.valueMap["description"] = inDescription + } +} + +func DefaultDescription() Option { + return func(o *options) { + o.valueMap["description"] = nil + } +} + +func WithDisabled(inDisabled bool) Option { + return func(o *options) { + o.valueMap["disabled"] = inDisabled + } +} + +func DefaultDisabled() Option { + return func(o *options) { + o.valueMap["disabled"] = nil + } +} + +func WithName(inName string) Option { + return func(o *options) { + o.valueMap["name"] = inName + } +} + +func DefaultName() Option { + return func(o *options) { + o.valueMap["name"] = nil + } +} diff --git a/api/groups/read.gen.go b/api/groups/read.gen.go deleted file mode 100644 index 76afb8ca0..000000000 --- a/api/groups/read.gen.go +++ /dev/null @@ -1,46 +0,0 @@ -// Code generated by "make api"; DO NOT EDIT. -package groups - -import ( - "context" - "fmt" - - "github.com/hashicorp/watchtower/api" -) - -func (s Group) ReadGroup(ctx context.Context, id string) (*Group, *api.Error, error) { - if id == "" { - return nil, nil, fmt.Errorf("empty ID value passed into ReadGroup request") - } - - if s.Client == nil { - return nil, nil, fmt.Errorf("nil client in ReadGroup request") - } - - var opts []api.Option - if s.Scope.Id != "" { - // If it's explicitly set here, override anything that might be in the - // client - opts = append(opts, api.WithScopeId(s.Scope.Id)) - } - - req, err := s.Client.NewRequest(ctx, "GET", fmt.Sprintf("%s/%s", "groups", id), nil, opts...) - if err != nil { - return nil, nil, fmt.Errorf("error creating ReadGroup request: %w", err) - } - - resp, err := s.Client.Do(req) - if err != nil { - return nil, nil, fmt.Errorf("error performing client request during ReadGroup call: %w", err) - } - - target := new(Group) - apiErr, err := resp.Decode(target) - if err != nil { - return nil, nil, fmt.Errorf("error decoding ReadGroup repsonse: %w", err) - } - - target.Client = s.Client - - return target, apiErr, nil -} diff --git a/api/groups/update.gen.go b/api/groups/update.gen.go deleted file mode 100644 index ac956998e..000000000 --- a/api/groups/update.gen.go +++ /dev/null @@ -1,52 +0,0 @@ -// Code generated by "make api"; DO NOT EDIT. -package groups - -import ( - "context" - "fmt" - - "github.com/hashicorp/watchtower/api" -) - -func (s Group) UpdateGroup(ctx context.Context, r *Group) (*Group, *api.Error, error) { - if r == nil { - - } - if r.Id == "" { - return nil, nil, fmt.Errorf("empty Group ID field in CreateGroup request") - } - - if s.Client == nil { - return nil, nil, fmt.Errorf("nil client in CreateGroup request") - } - - var opts []api.Option - if s.Scope.Id != "" { - // If it's explicitly set here, override anything that might be in the - // client - opts = append(opts, api.WithScopeId(s.Scope.Id)) - } - - id := r.Id - r.Id = "" - - req, err := s.Client.NewRequest(ctx, "PATCH", fmt.Sprintf("%s/%s", "groups", id), r, opts...) - if err != nil { - return nil, nil, fmt.Errorf("error creating CreateGroup request: %w", err) - } - - resp, err := s.Client.Do(req) - if err != nil { - return nil, nil, fmt.Errorf("error performing client request during UpdateGroup call: %w", err) - } - - target := new(Group) - apiErr, err := resp.Decode(target) - if err != nil { - return nil, nil, fmt.Errorf("error decoding UpdateGroup repsonse: %w", err) - } - - target.Client = s.Client - - return target, apiErr, nil -} diff --git a/api/hosts/awsec2_host_catalog.gen.go b/api/hosts/awsec2_host_catalog.gen.go deleted file mode 100644 index 44aeb1b15..000000000 --- a/api/hosts/awsec2_host_catalog.gen.go +++ /dev/null @@ -1,40 +0,0 @@ -// Code generated by "make api"; DO NOT EDIT. -package hosts - -import ( - "fmt" - - "github.com/mitchellh/mapstructure" -) - -type AwsEc2HostCatalog struct { - *HostCatalog - - // The AWS regions from which this catalog will retrieve the EC2 instances. - Regions []string `json:"regions,omitempty"` - // The access key used for authenticating with AWS when retrieving EC2 instance details. - AccessKey *string `json:"access_key,omitempty"` - // Input only. - SecretKey *string `json:"secret_key,omitempty"` - // This value will never be returned in a response. - Rotate *bool `json:"rotate,omitempty"` -} - -func (s HostCatalog) AsAwsEc2HostCatalog() (*AwsEc2HostCatalog, error) { - out := &AwsEc2HostCatalog{ - HostCatalog: &s, - } - decoder, err := mapstructure.NewDecoder(&mapstructure.DecoderConfig{ - Result: out, - TagName: "json", - }) - if err != nil { - return nil, fmt.Errorf("error creating map decoder: %w", err) - } - - if err := decoder.Decode(s.Attributes); err != nil { - return nil, fmt.Errorf("error decoding attributes map: %w", err) - } - - return out, nil -} diff --git a/api/hosts/create.gen.go b/api/hosts/create.gen.go deleted file mode 100644 index f23840616..000000000 --- a/api/hosts/create.gen.go +++ /dev/null @@ -1,75 +0,0 @@ -// Code generated by "make api"; DO NOT EDIT. -package hosts - -import ( - "context" - "fmt" - - "github.com/hashicorp/watchtower/api" -) - -func (s HostCatalog) CreateHost(ctx context.Context, r *Host) (*Host, *api.Error, error) { - if s.Client == nil { - return nil, nil, fmt.Errorf("nil client in CreateHost request") - } - - var opts []api.Option - if s.Scope.Id != "" { - // If it's explicitly set here, override anything that might be in the - // client - opts = append(opts, api.WithScopeId(s.Scope.Id)) - } - - req, err := s.Client.NewRequest(ctx, "POST", fmt.Sprintf("host-catalogs/%s/hosts", s.Id), r, opts...) - if err != nil { - return nil, nil, fmt.Errorf("error creating CreateHost request: %w", err) - } - - resp, err := s.Client.Do(req) - if err != nil { - return nil, nil, fmt.Errorf("error performing client request during CreateHost call: %w", err) - } - - target := new(Host) - apiErr, err := resp.Decode(target) - if err != nil { - return nil, nil, fmt.Errorf("error decoding CreateHost repsonse: %w", err) - } - - target.Client = s.Client - - return target, apiErr, nil -} - -func (s HostCatalog) CreateHostSet(ctx context.Context, r *HostSet) (*HostSet, *api.Error, error) { - if s.Client == nil { - return nil, nil, fmt.Errorf("nil client in CreateHostSet request") - } - - var opts []api.Option - if s.Scope.Id != "" { - // If it's explicitly set here, override anything that might be in the - // client - opts = append(opts, api.WithScopeId(s.Scope.Id)) - } - - req, err := s.Client.NewRequest(ctx, "POST", fmt.Sprintf("host-catalogs/%s/host-sets", s.Id), r, opts...) - if err != nil { - return nil, nil, fmt.Errorf("error creating CreateHostSet request: %w", err) - } - - resp, err := s.Client.Do(req) - if err != nil { - return nil, nil, fmt.Errorf("error performing client request during CreateHostSet call: %w", err) - } - - target := new(HostSet) - apiErr, err := resp.Decode(target) - if err != nil { - return nil, nil, fmt.Errorf("error decoding CreateHostSet repsonse: %w", err) - } - - target.Client = s.Client - - return target, apiErr, nil -} diff --git a/api/hosts/host.gen.go b/api/hosts/host.gen.go index af4b6c77b..5e2fbfa86 100644 --- a/api/hosts/host.gen.go +++ b/api/hosts/host.gen.go @@ -2,75 +2,196 @@ package hosts import ( - "encoding/json" - "strings" + "context" + "fmt" "time" - "github.com/fatih/structs" - "github.com/hashicorp/watchtower/api" - "github.com/hashicorp/watchtower/api/info" - "github.com/hashicorp/watchtower/api/internal/strutil" + "github.com/hashicorp/watchtower/api/scopes" ) type Host struct { - Client *api.Client `json:"-"` - - defaultFields []string - - // The ID of the host - // Output only. - Id string `json:"id,omitempty"` - // Scope information for this resource - // Output only. - Scope info.Scope `json:"scope,omitempty"` - // The type of the resource, to help differentiate schemas - Type *string `json:"type,omitempty"` - // Optional name for identification purposes - Name *string `json:"name,omitempty"` - // Optional user-set description for identification purposes - Description *string `json:"description,omitempty"` - // The time this resource was created - // Output only. - CreatedTime time.Time `json:"created_time,omitempty"` - // The time this resource was last updated - // Output only. - UpdatedTime time.Time `json:"updated_time,omitempty"` - // Whether the host is disabled - Disabled *bool `json:"disabled,omitempty"` - // The address (DNS or IP name) used to reach the host - Address *string `json:"address,omitempty"` + Id string `json:"id,omitempty"` + Scope *scopes.ScopeInfo `json:"scope,omitempty"` + Type string `json:"type,omitempty"` + Name string `json:"name,omitempty"` + Description string `json:"description,omitempty"` + CreatedTime time.Time `json:"created_time,omitempty"` + UpdatedTime time.Time `json:"updated_time,omitempty"` + Disabled bool `json:"disabled,omitempty"` + Address string `json:"address,omitempty"` } -func (s *Host) SetDefault(key string) { - lowerKey := strings.ToLower(key) - validMap := map[string]string{"address": "address", "createdtime": "created_time", "description": "description", "disabled": "disabled", "id": "id", "name": "name", "scope": "scope", "type": "type", "updatedtime": "updated_time"} - for k, v := range validMap { - if k == lowerKey || v == lowerKey { - s.defaultFields = strutil.AppendIfMissing(s.defaultFields, v) - return - } - } +type hostClient struct { + client *api.Client } -func (s *Host) UnsetDefault(key string) { - lowerKey := strings.ToLower(key) - validMap := map[string]string{"address": "address", "createdtime": "created_time", "description": "description", "disabled": "disabled", "id": "id", "name": "name", "scope": "scope", "type": "type", "updatedtime": "updated_time"} - for k, v := range validMap { - if k == lowerKey || v == lowerKey { - s.defaultFields = strutil.StrListDelete(s.defaultFields, v) - return - } - } +func NewHostClient(c *api.Client) *hostClient { + return &hostClient{client: c} } -func (s Host) MarshalJSON() ([]byte, error) { - m := structs.Map(s) - if m == nil { - m = make(map[string]interface{}) +func (c *hostClient) Create(ctx context.Context, hostCatalogId string, opt ...Option) (*Host, *api.Error, error) { + if hostCatalogId == "" { + return nil, nil, fmt.Errorf("empty hostCatalogId value passed into Create request") } - for _, k := range s.defaultFields { - m[k] = nil + + if c.client == nil { + return nil, nil, fmt.Errorf("nil client") } - return json.Marshal(m) + + opts, apiOpts := getOpts(opt...) + + req, err := c.client.NewRequest(ctx, "POST", fmt.Sprintf("host-catalogs/%s/hosts", hostCatalogId), opts.valueMap, apiOpts...) + if err != nil { + return nil, nil, fmt.Errorf("error creating Create request: %w", err) + } + + resp, err := c.client.Do(req) + if err != nil { + return nil, nil, fmt.Errorf("error performing client request during Create call: %w", err) + } + + target := new(Host) + apiErr, err := resp.Decode(target) + if err != nil { + return nil, nil, fmt.Errorf("error decoding Create response: %w", err) + } + + return target, apiErr, nil +} + +func (c *hostClient) Read(ctx context.Context, hostCatalogId string, hostId string, opt ...Option) (*Host, *api.Error, error) { + if hostCatalogId == "" { + return nil, nil, fmt.Errorf("empty hostCatalogId value passed into Read request") + } + + if hostId == "" { + return nil, nil, fmt.Errorf("empty hostId value passed into Read request") + } + + if c.client == nil { + return nil, nil, fmt.Errorf("nil client") + } + + _, apiOpts := getOpts(opt...) + + req, err := c.client.NewRequest(ctx, "GET", fmt.Sprintf("host-catalogs/%s/hosts/%s", hostCatalogId, hostId), nil, apiOpts...) + if err != nil { + return nil, nil, fmt.Errorf("error creating Read request: %w", err) + } + + resp, err := c.client.Do(req) + if err != nil { + return nil, nil, fmt.Errorf("error performing client request during Read call: %w", err) + } + + target := new(Host) + apiErr, err := resp.Decode(target) + if err != nil { + return nil, nil, fmt.Errorf("error decoding Read response: %w", err) + } + + return target, apiErr, nil +} + +func (c *hostClient) Update(ctx context.Context, hostCatalogId string, hostId string, version uint32, opt ...Option) (*Host, *api.Error, error) { + if hostCatalogId == "" { + return nil, nil, fmt.Errorf("empty hostCatalogId value passed into Update request") + } + if hostId == "" { + return nil, nil, fmt.Errorf("empty hostId value passed into Update request") + } + if c.client == nil { + return nil, nil, fmt.Errorf("nil client") + } + + opts, apiOpts := getOpts(opt...) + + req, err := c.client.NewRequest(ctx, "PATCH", fmt.Sprintf("host-catalogs/%s/hosts/%s", hostCatalogId, hostId), opts.valueMap, apiOpts...) + if err != nil { + return nil, nil, fmt.Errorf("error creating Update request: %w", err) + } + + resp, err := c.client.Do(req) + if err != nil { + return nil, nil, fmt.Errorf("error performing client request during Update call: %w", err) + } + + target := new(Host) + apiErr, err := resp.Decode(target) + if err != nil { + return nil, nil, fmt.Errorf("error decoding Update response: %w", err) + } + + return target, apiErr, nil +} + +func (c *hostClient) Delete(ctx context.Context, hostCatalogId string, hostId string, opt ...Option) (bool, *api.Error, error) { + if hostCatalogId == "" { + return false, nil, fmt.Errorf("empty hostCatalogId value passed into Delete request") + } + + if hostId == "" { + return false, nil, fmt.Errorf("empty hostId value passed into Delete request") + } + + if c.client == nil { + return false, nil, fmt.Errorf("nil client") + } + + _, apiOpts := getOpts(opt...) + + req, err := c.client.NewRequest(ctx, "DELETE", fmt.Sprintf("host-catalogs/%s/hosts/%s", hostCatalogId, hostId), nil, apiOpts...) + if err != nil { + return false, nil, fmt.Errorf("error creating Delete request: %w", err) + } + + resp, err := c.client.Do(req) + if err != nil { + return false, nil, fmt.Errorf("error performing client request during Delete call: %w", err) + } + + type deleteResponse struct { + Existed bool + } + target := &deleteResponse{} + apiErr, err := resp.Decode(target) + if err != nil { + return false, nil, fmt.Errorf("error decoding Delete response: %w", err) + } + + return target.Existed, apiErr, nil +} + +func (c *hostClient) List(ctx context.Context, hostCatalogId string, opt ...Option) ([]*Host, *api.Error, error) { + if hostCatalogId == "" { + return nil, nil, fmt.Errorf("empty hostCatalogId value passed into List request") + } + + if c.client == nil { + return nil, nil, fmt.Errorf("nil client") + } + + _, apiOpts := getOpts(opt...) + + req, err := c.client.NewRequest(ctx, "GET", fmt.Sprintf("host-catalogs/%s/hosts", hostCatalogId), nil, apiOpts...) + if err != nil { + return nil, nil, fmt.Errorf("error creating List request: %w", err) + } + + resp, err := c.client.Do(req) + if err != nil { + return nil, nil, fmt.Errorf("error performing client request during List call: %w", err) + } + + type listResponse struct { + Items []*Host + } + target := &listResponse{} + apiErr, err := resp.Decode(target) + if err != nil { + return nil, nil, fmt.Errorf("error decoding List response: %w", err) + } + + return target.Items, apiErr, nil } diff --git a/api/hosts/host_catalog.gen.go b/api/hosts/host_catalog.gen.go index 70ea8866d..863d3c898 100644 --- a/api/hosts/host_catalog.gen.go +++ b/api/hosts/host_catalog.gen.go @@ -2,76 +2,177 @@ package hosts import ( - "encoding/json" - "strings" + "context" + "fmt" "time" - "github.com/fatih/structs" - "github.com/hashicorp/watchtower/api" - "github.com/hashicorp/watchtower/api/info" - "github.com/hashicorp/watchtower/api/internal/strutil" + "github.com/hashicorp/watchtower/api/scopes" ) type HostCatalog struct { - Client *api.Client `json:"-"` - - defaultFields []string - - // The ID of the host - // Output only. - Id string `json:"id,omitempty"` - // Scope information for this resource - // Output only. - Scope info.Scope `json:"scope,omitempty"` - // The type of the resource, to help differentiate schemas - Type *string `json:"type,omitempty"` - // Optional name for identification purposes - Name *string `json:"name,omitempty"` - // Optional user-set description for identification purposes - Description *string `json:"description,omitempty"` - // The time this resource was created - // Output only. - CreatedTime time.Time `json:"created_time,omitempty"` - // The time this resource was last updated - // Output only. - UpdatedTime time.Time `json:"updated_time,omitempty"` - // Whether the catalog is disabled - Disabled *bool `json:"disabled,omitempty"` - // Attributes specific to the catalog type - Attributes map[string]interface { - } `json:"attributes,omitempty"` + Id string `json:"id,omitempty"` + Scope *scopes.ScopeInfo `json:"scope,omitempty"` + Type string `json:"type,omitempty"` + Name string `json:"name,omitempty"` + Description string `json:"description,omitempty"` + CreatedTime time.Time `json:"created_time,omitempty"` + UpdatedTime time.Time `json:"updated_time,omitempty"` + Disabled bool `json:"disabled,omitempty"` + Attributes map[string]interface{} `json:"attributes,omitempty"` } -func (s *HostCatalog) SetDefault(key string) { - lowerKey := strings.ToLower(key) - validMap := map[string]string{"attributes": "attributes", "createdtime": "created_time", "description": "description", "disabled": "disabled", "id": "id", "name": "name", "scope": "scope", "type": "type", "updatedtime": "updated_time"} - for k, v := range validMap { - if k == lowerKey || v == lowerKey { - s.defaultFields = strutil.AppendIfMissing(s.defaultFields, v) - return - } - } +type hostcatalogClient struct { + client *api.Client } -func (s *HostCatalog) UnsetDefault(key string) { - lowerKey := strings.ToLower(key) - validMap := map[string]string{"attributes": "attributes", "createdtime": "created_time", "description": "description", "disabled": "disabled", "id": "id", "name": "name", "scope": "scope", "type": "type", "updatedtime": "updated_time"} - for k, v := range validMap { - if k == lowerKey || v == lowerKey { - s.defaultFields = strutil.StrListDelete(s.defaultFields, v) - return - } - } +func NewHostCatalogClient(c *api.Client) *hostcatalogClient { + return &hostcatalogClient{client: c} } -func (s HostCatalog) MarshalJSON() ([]byte, error) { - m := structs.Map(s) - if m == nil { - m = make(map[string]interface{}) +func (c *hostcatalogClient) Create(ctx context.Context, opt ...Option) (*HostCatalog, *api.Error, error) { + if c.client == nil { + return nil, nil, fmt.Errorf("nil client") } - for _, k := range s.defaultFields { - m[k] = nil + + opts, apiOpts := getOpts(opt...) + + req, err := c.client.NewRequest(ctx, "POST", fmt.Sprintf("host-catalogs"), opts.valueMap, apiOpts...) + if err != nil { + return nil, nil, fmt.Errorf("error creating Create request: %w", err) } - return json.Marshal(m) + + resp, err := c.client.Do(req) + if err != nil { + return nil, nil, fmt.Errorf("error performing client request during Create call: %w", err) + } + + target := new(HostCatalog) + apiErr, err := resp.Decode(target) + if err != nil { + return nil, nil, fmt.Errorf("error decoding Create response: %w", err) + } + + return target, apiErr, nil +} + +func (c *hostcatalogClient) Read(ctx context.Context, hostCatalogId string, opt ...Option) (*HostCatalog, *api.Error, error) { + if hostCatalogId == "" { + return nil, nil, fmt.Errorf("empty hostCatalogId value passed into Read request") + } + + if c.client == nil { + return nil, nil, fmt.Errorf("nil client") + } + + _, apiOpts := getOpts(opt...) + + req, err := c.client.NewRequest(ctx, "GET", fmt.Sprintf("host-catalogs/%s", hostCatalogId), nil, apiOpts...) + if err != nil { + return nil, nil, fmt.Errorf("error creating Read request: %w", err) + } + + resp, err := c.client.Do(req) + if err != nil { + return nil, nil, fmt.Errorf("error performing client request during Read call: %w", err) + } + + target := new(HostCatalog) + apiErr, err := resp.Decode(target) + if err != nil { + return nil, nil, fmt.Errorf("error decoding Read response: %w", err) + } + + return target, apiErr, nil +} + +func (c *hostcatalogClient) Update(ctx context.Context, hostCatalogId string, version uint32, opt ...Option) (*HostCatalog, *api.Error, error) { + if hostCatalogId == "" { + return nil, nil, fmt.Errorf("empty hostCatalogId value passed into Update request") + } + if c.client == nil { + return nil, nil, fmt.Errorf("nil client") + } + + opts, apiOpts := getOpts(opt...) + + req, err := c.client.NewRequest(ctx, "PATCH", fmt.Sprintf("host-catalogs/%s", hostCatalogId), opts.valueMap, apiOpts...) + if err != nil { + return nil, nil, fmt.Errorf("error creating Update request: %w", err) + } + + resp, err := c.client.Do(req) + if err != nil { + return nil, nil, fmt.Errorf("error performing client request during Update call: %w", err) + } + + target := new(HostCatalog) + apiErr, err := resp.Decode(target) + if err != nil { + return nil, nil, fmt.Errorf("error decoding Update response: %w", err) + } + + return target, apiErr, nil +} + +func (c *hostcatalogClient) Delete(ctx context.Context, hostCatalogId string, opt ...Option) (bool, *api.Error, error) { + if hostCatalogId == "" { + return false, nil, fmt.Errorf("empty hostCatalogId value passed into Delete request") + } + + if c.client == nil { + return false, nil, fmt.Errorf("nil client") + } + + _, apiOpts := getOpts(opt...) + + req, err := c.client.NewRequest(ctx, "DELETE", fmt.Sprintf("host-catalogs/%s", hostCatalogId), nil, apiOpts...) + if err != nil { + return false, nil, fmt.Errorf("error creating Delete request: %w", err) + } + + resp, err := c.client.Do(req) + if err != nil { + return false, nil, fmt.Errorf("error performing client request during Delete call: %w", err) + } + + type deleteResponse struct { + Existed bool + } + target := &deleteResponse{} + apiErr, err := resp.Decode(target) + if err != nil { + return false, nil, fmt.Errorf("error decoding Delete response: %w", err) + } + + return target.Existed, apiErr, nil +} + +func (c *hostcatalogClient) List(ctx context.Context, opt ...Option) ([]*HostCatalog, *api.Error, error) { + if c.client == nil { + return nil, nil, fmt.Errorf("nil client") + } + + _, apiOpts := getOpts(opt...) + + req, err := c.client.NewRequest(ctx, "GET", fmt.Sprintf("host-catalogs"), nil, apiOpts...) + if err != nil { + return nil, nil, fmt.Errorf("error creating List request: %w", err) + } + + resp, err := c.client.Do(req) + if err != nil { + return nil, nil, fmt.Errorf("error performing client request during List call: %w", err) + } + + type listResponse struct { + Items []*HostCatalog + } + target := &listResponse{} + apiErr, err := resp.Decode(target) + if err != nil { + return nil, nil, fmt.Errorf("error decoding List response: %w", err) + } + + return target.Items, apiErr, nil } diff --git a/api/hosts/host_set.gen.go b/api/hosts/host_set.gen.go deleted file mode 100644 index a95ba49b5..000000000 --- a/api/hosts/host_set.gen.go +++ /dev/null @@ -1,82 +0,0 @@ -// Code generated by "make api"; DO NOT EDIT. -package hosts - -import ( - "encoding/json" - "strings" - "time" - - "github.com/fatih/structs" - - "github.com/hashicorp/watchtower/api" - "github.com/hashicorp/watchtower/api/info" - "github.com/hashicorp/watchtower/api/internal/strutil" -) - -type HostSet struct { - Client *api.Client `json:"-"` - - defaultFields []string - - // The ID of the host - // Output only. - Id string `json:"id,omitempty"` - // Scope information for this resource - // Output only. - Scope info.Scope `json:"scope,omitempty"` - // The type of the resource, to help differentiate schemas - Type *string `json:"type,omitempty"` - // Optional name for identification purposes - Name *string `json:"name,omitempty"` - // Optional user-set description for identification purposes - Description *string `json:"description,omitempty"` - // The time this resource was created - // Output only. - CreatedTime time.Time `json:"created_time,omitempty"` - // The time this resource was last updated - // Output only. - UpdatedTime time.Time `json:"updated_time,omitempty"` - // Whether the host set is disabled - Disabled *bool `json:"disabled,omitempty"` - // The total count of hosts in this host set - // Output only. - Size *int64 `json:"size,omitempty"` - // A list of hosts in this host set - // TODO: Figure out if this should be in the basic HostSet view and what - // view to use on the Hosts. - // Output only. - Hosts []*Host `json:"hosts,omitempty"` -} - -func (s *HostSet) SetDefault(key string) { - lowerKey := strings.ToLower(key) - validMap := map[string]string{"createdtime": "created_time", "description": "description", "disabled": "disabled", "hosts": "hosts", "id": "id", "name": "name", "scope": "scope", "size": "size", "type": "type", "updatedtime": "updated_time"} - for k, v := range validMap { - if k == lowerKey || v == lowerKey { - s.defaultFields = strutil.AppendIfMissing(s.defaultFields, v) - return - } - } -} - -func (s *HostSet) UnsetDefault(key string) { - lowerKey := strings.ToLower(key) - validMap := map[string]string{"createdtime": "created_time", "description": "description", "disabled": "disabled", "hosts": "hosts", "id": "id", "name": "name", "scope": "scope", "size": "size", "type": "type", "updatedtime": "updated_time"} - for k, v := range validMap { - if k == lowerKey || v == lowerKey { - s.defaultFields = strutil.StrListDelete(s.defaultFields, v) - return - } - } -} - -func (s HostSet) MarshalJSON() ([]byte, error) { - m := structs.Map(s) - if m == nil { - m = make(map[string]interface{}) - } - for _, k := range s.defaultFields { - m[k] = nil - } - return json.Marshal(m) -} diff --git a/api/hosts/option.gen.go b/api/hosts/option.gen.go new file mode 100644 index 000000000..8513743e5 --- /dev/null +++ b/api/hosts/option.gen.go @@ -0,0 +1,126 @@ +package hosts + +import ( + "github.com/hashicorp/watchtower/api" +) + +// Option is a func that sets optional attributes for a call. This does not need +// to be used directly, but instead option arguments are built from the +// functions in this package. WithX options set a value to that given in the +// argument; DefaultX options indicate that the value should be set to its +// default. When an API call is made options are processed in ther order they +// appear in the function call, so for a given argument X, a succession of WithX +// or DefaultX calls will result in the last call taking effect. +type Option func(*options) + +type options struct { + valueMap map[string]interface{} + withScopeId string + withAutomaticVersioning bool +} + +func getDefaultOptions() options { + return options{ + valueMap: make(map[string]interface{}), + } +} + +func getOpts(opt ...Option) (options, []api.Option) { + opts := getDefaultOptions() + for _, o := range opt { + o(&opts) + } + var apiOpts []api.Option + if opts.withScopeId != "" { + apiOpts = append(apiOpts, api.WithScopeId(opts.withScopeId)) + } + return opts, apiOpts +} + +func WithScopeId(id string) Option { + return func(o *options) { + o.withScopeId = id + } +} + +// If set, and if the version is zero during an update, the API will perform a +// fetch to get the current version of the resource and populate it during the +// update call. This is convenient but opens up the possibility for subtle +// order-of-modification issues, so use carefully. +func WithAutomaticVersioning() Option { + return func(o *options) { + o.withAutomaticVersioning = true + } +} + +func WithAddress(inAddress string) Option { + return func(o *options) { + o.valueMap["address"] = inAddress + } +} + +func DefaultAddress() Option { + return func(o *options) { + o.valueMap["address"] = nil + } +} + +func WithAttributes(inAttributes map[string]interface{}) Option { + return func(o *options) { + o.valueMap["attributes"] = inAttributes + } +} + +func DefaultAttributes() Option { + return func(o *options) { + o.valueMap["attributes"] = nil + } +} + +func WithDescription(inDescription string) Option { + return func(o *options) { + o.valueMap["description"] = inDescription + } +} + +func DefaultDescription() Option { + return func(o *options) { + o.valueMap["description"] = nil + } +} + +func WithDisabled(inDisabled bool) Option { + return func(o *options) { + o.valueMap["disabled"] = inDisabled + } +} + +func DefaultDisabled() Option { + return func(o *options) { + o.valueMap["disabled"] = nil + } +} + +func WithName(inName string) Option { + return func(o *options) { + o.valueMap["name"] = inName + } +} + +func DefaultName() Option { + return func(o *options) { + o.valueMap["name"] = nil + } +} + +func WithType(inType string) Option { + return func(o *options) { + o.valueMap["type"] = inType + } +} + +func DefaultType() Option { + return func(o *options) { + o.valueMap["type"] = nil + } +} diff --git a/api/hosts/read.gen.go b/api/hosts/read.gen.go deleted file mode 100644 index e234f77bd..000000000 --- a/api/hosts/read.gen.go +++ /dev/null @@ -1,46 +0,0 @@ -// Code generated by "make api"; DO NOT EDIT. -package hosts - -import ( - "context" - "fmt" - - "github.com/hashicorp/watchtower/api" -) - -func (s HostCatalog) ReadHostCatalog(ctx context.Context, id string) (*HostCatalog, *api.Error, error) { - if id == "" { - return nil, nil, fmt.Errorf("empty ID value passed into ReadHostCatalog request") - } - - if s.Client == nil { - return nil, nil, fmt.Errorf("nil client in ReadHostCatalog request") - } - - var opts []api.Option - if s.Scope.Id != "" { - // If it's explicitly set here, override anything that might be in the - // client - opts = append(opts, api.WithScopeId(s.Scope.Id)) - } - - req, err := s.Client.NewRequest(ctx, "GET", fmt.Sprintf("%s/%s", "host-catalogs", id), nil, opts...) - if err != nil { - return nil, nil, fmt.Errorf("error creating ReadHostCatalog request: %w", err) - } - - resp, err := s.Client.Do(req) - if err != nil { - return nil, nil, fmt.Errorf("error performing client request during ReadHostCatalog call: %w", err) - } - - target := new(HostCatalog) - apiErr, err := resp.Decode(target) - if err != nil { - return nil, nil, fmt.Errorf("error decoding ReadHostCatalog repsonse: %w", err) - } - - target.Client = s.Client - - return target, apiErr, nil -} diff --git a/api/hosts/static_host_catalog.gen.go b/api/hosts/static_host_catalog.gen.go deleted file mode 100644 index 210ac120b..000000000 --- a/api/hosts/static_host_catalog.gen.go +++ /dev/null @@ -1,31 +0,0 @@ -// Code generated by "make api"; DO NOT EDIT. -package hosts - -import ( - "fmt" - - "github.com/mitchellh/mapstructure" -) - -type StaticHostCatalog struct { - *HostCatalog -} - -func (s HostCatalog) AsStaticHostCatalog() (*StaticHostCatalog, error) { - out := &StaticHostCatalog{ - HostCatalog: &s, - } - decoder, err := mapstructure.NewDecoder(&mapstructure.DecoderConfig{ - Result: out, - TagName: "json", - }) - if err != nil { - return nil, fmt.Errorf("error creating map decoder: %w", err) - } - - if err := decoder.Decode(s.Attributes); err != nil { - return nil, fmt.Errorf("error decoding attributes map: %w", err) - } - - return out, nil -} diff --git a/api/info/scope.gen.go b/api/info/scope.gen.go deleted file mode 100644 index 6fd1ae38e..000000000 --- a/api/info/scope.gen.go +++ /dev/null @@ -1,21 +0,0 @@ -// Code generated by "make api"; DO NOT EDIT. -package info - -type Scope struct { - - // The ID of the Scope - // Output only. - Id string `json:"id,omitempty"` - // The type of the Scope - // Output only. - Type string `json:"type,omitempty"` - // The name of the scope, if any - // Output only. - Name string `json:"name,omitempty"` - // The description of the scope, if any - // Output only. - Description string `json:"description,omitempty"` - // The ID of the parent scope, if any - // Output only. - ParentScopeId string `json:"parent_scope_id,omitempty"` -} diff --git a/api/internal/genapi/Makefile b/api/internal/genapi/Makefile index 21eaac97c..7051f247c 100644 --- a/api/internal/genapi/Makefile +++ b/api/internal/genapi/Makefile @@ -2,8 +2,10 @@ # Be sure to place this BEFORE `include` directives, if any. THIS_FILE := $(lastword $(MAKEFILE_LIST)) +export API_GEN_BASEPATH := ${GEN_BASEPATH}/api + api: go run . - goimports -w ${GEN_BASEPATH}/api + goimports -w ${API_GEN_BASEPATH} .PHONY: api diff --git a/api/internal/genapi/create.go b/api/internal/genapi/create.go deleted file mode 100644 index 85e6b4b48..000000000 --- a/api/internal/genapi/create.go +++ /dev/null @@ -1,127 +0,0 @@ -package main - -import ( - "bytes" - "fmt" - "io/ioutil" - "os" - "strings" - "text/template" -) - -type createInfo struct { - baseType string - targetType string - path string -} - -var createFuncs = map[string][]*createInfo{ - "scopes": { - { - baseType: "Scope", - targetType: "Scope", - path: `"scopes"`, - }, - }, - "groups": { - { - baseType: "Group", - targetType: "Group", - path: `"groups"`, - }, - }, - "users": { - { - baseType: "User", - targetType: "User", - path: `"users"`, - }, - }, - "roles": { - { - baseType: "Role", - targetType: "Role", - path: `"roles"`, - }, - }, - "hosts": { - { - baseType: "HostCatalog", - targetType: "Host", - path: `fmt.Sprintf("host-catalogs/%s/hosts", s.Id)`, - }, - { - baseType: "HostCatalog", - targetType: "HostSet", - path: `fmt.Sprintf("host-catalogs/%s/host-sets", s.Id)`, - }, - }, -} - -func writeCreateFuncs() { - for outPkg, funcs := range createFuncs { - outFile := os.Getenv("GEN_BASEPATH") + fmt.Sprintf("/api/%s/create.gen.go", outPkg) - outBuf := bytes.NewBuffer([]byte(fmt.Sprintf( - `// Code generated by "make api"; DO NOT EDIT. -package %s -`, outPkg))) - for _, createInfo := range funcs { - createFuncTemplate.Execute(outBuf, struct { - BaseType string - TargetType string - TargetName string - Path string - }{ - BaseType: createInfo.baseType, - TargetType: createInfo.targetType, - TargetName: strings.Split(createInfo.targetType, ".")[strings.Count(createInfo.targetType, ".")], - Path: createInfo.path, - }) - } - if err := ioutil.WriteFile(outFile, outBuf.Bytes(), 0644); err != nil { - fmt.Printf("error writing file %q: %v\n", outFile, err) - os.Exit(1) - } - } -} - -var createFuncTemplate = template.Must(template.New("").Parse( - ` -func (s {{ .BaseType }}) Create{{ .TargetName }}(ctx context.Context, r *{{ .TargetType }}) (*{{ .TargetType }}, *api.Error, error) { - if s.Client == nil { - return nil, nil, fmt.Errorf("nil client in Create{{ .TargetName }} request") - } - - var opts []api.Option - if s.Scope.Id != "" { - // If it's explicitly set here, override anything that might be in the - // client - opts = append(opts, api.WithScopeId(s.Scope.Id)) - } - - req, err := s.Client.NewRequest(ctx, "POST", {{ .Path }}, r, opts...) - if err != nil { - return nil, nil, fmt.Errorf("error creating Create{{ .TargetName }} request: %w", err) - } - - resp, err := s.Client.Do(req) - if err != nil { - return nil, nil, fmt.Errorf("error performing client request during Create{{ .TargetName }} call: %w", err) - } - - target := new({{ .TargetType }}) - apiErr, err := resp.Decode(target) - if err != nil { - return nil, nil, fmt.Errorf("error decoding Create{{ .TargetName }} repsonse: %w", err) - } - - {{ if (eq .TargetType "Scope") }} - target.Client = s.Client.Clone() - target.Client.SetScopeId(target.Id) - {{ else }} - target.Client = s.Client - {{ end }} - - return target, apiErr, nil -} -`)) diff --git a/api/internal/genapi/delete.go b/api/internal/genapi/delete.go deleted file mode 100644 index 08442e27c..000000000 --- a/api/internal/genapi/delete.go +++ /dev/null @@ -1,124 +0,0 @@ -package main - -import ( - "bytes" - "fmt" - "io/ioutil" - "os" - "strings" - "text/template" -) - -type deleteInfo struct { - baseType string - targetType string - path string -} - -var deleteFuncs = map[string][]*deleteInfo{ - "scopes": { - { - "Scope", - "Scope", - "scopes", - }, - }, - "authtokens": { - { - "AuthToken", - "AuthToken", - "auth-tokens", - }, - }, - "groups": { - { - "Group", - "Group", - "groups", - }, - }, - "users": { - { - "User", - "User", - "users", - }, - }, - "roles": { - { - "Role", - "Role", - "roles", - }, - }, -} - -func writeDeleteFuncs() { - for outPkg, funcs := range deleteFuncs { - outFile := os.Getenv("GEN_BASEPATH") + fmt.Sprintf("/api/%s/delete.gen.go", outPkg) - outBuf := bytes.NewBuffer([]byte(fmt.Sprintf( - `// Code generated by "make api"; DO NOT EDIT. -package %s -`, outPkg))) - for _, deleteInfo := range funcs { - deleteFuncTemplate.Execute(outBuf, struct { - BaseType string - TargetType string - TargetName string - Path string - }{ - BaseType: deleteInfo.baseType, - TargetType: deleteInfo.targetType, - TargetName: strings.Split(deleteInfo.targetType, ".")[strings.Count(deleteInfo.targetType, ".")], - Path: deleteInfo.path, - }) - } - if err := ioutil.WriteFile(outFile, outBuf.Bytes(), 0644); err != nil { - fmt.Printf("error writing file %q: %v\n", outFile, err) - os.Exit(1) - } - } -} - -var deleteFuncTemplate = template.Must(template.New("").Parse( - ` -// Delete{{ .TargetName }} returns true iff the {{ .TargetType }} existed when the delete attempt was made. -func (s {{ .BaseType }}) Delete{{ .TargetName }}(ctx context.Context, id string) (bool, *api.Error, error) { - if id == "" { - return false, nil, fmt.Errorf("empty id provided to Delete{{ .TargetName }} request") - } - - if s.Client == nil { - return false, nil, fmt.Errorf("nil client in Delete{{ .TargetName }} request") - } - - var opts []api.Option - if s.Scope.Id != "" { - // If it's explicitly set here, override anything that might be in the - // client - opts = append(opts, api.WithScopeId(s.Scope.Id)) - } - - req, err := s.Client.NewRequest(ctx, "DELETE", fmt.Sprintf("%s/%s", "{{ .Path }}", id), nil, opts...) - if err != nil { - return false, nil, fmt.Errorf("error creating Delete{{ .TargetName }} request: %w", err) - } - - resp, err := s.Client.Do(req) - if err != nil { - return false, nil, fmt.Errorf("error performing client request during Delete{{ .TargetName }} call: %w", err) - } - - type deleteResponse struct { - Existed bool - } - target := &deleteResponse{} - - apiErr, err := resp.Decode(target) - if err != nil { - return false, nil, fmt.Errorf("error decoding Delete{{ .TargetName }} repsonse: %w", err) - } - - return target.Existed, apiErr, nil -} -`)) diff --git a/api/internal/genapi/input.go b/api/internal/genapi/input.go index 1f7fa2436..bc981f8d3 100644 --- a/api/internal/genapi/input.go +++ b/api/internal/genapi/input.go @@ -1,161 +1,251 @@ package main -import "os" +import ( + "text/template" + + "github.com/hashicorp/watchtower/internal/gen/controller/api" + "github.com/hashicorp/watchtower/internal/gen/controller/api/resources/authmethods" + "github.com/hashicorp/watchtower/internal/gen/controller/api/resources/authtokens" + "github.com/hashicorp/watchtower/internal/gen/controller/api/resources/groups" + "github.com/hashicorp/watchtower/internal/gen/controller/api/resources/hosts" + "github.com/hashicorp/watchtower/internal/gen/controller/api/resources/roles" + "github.com/hashicorp/watchtower/internal/gen/controller/api/resources/scopes" + "github.com/hashicorp/watchtower/internal/gen/controller/api/resources/users" + "google.golang.org/protobuf/proto" +) + +type structureInfo struct { + pkg string + name string + fields []fieldInfo +} + +type fieldInfo struct { + Name string + ProtoName string + FieldType string + GenerateSdkOption bool + SubtypeName string +} type structInfo struct { - inFile string - inName string - outFile string - outName string - outPkg string - structFields string - parentName string - detailName string - outputOnly bool - templateType templateType - nameJsonMap map[string]string + inProto proto.Message + outFile string + generatedStructure structureInfo + templates []*template.Template + + // Subtype name for types implementing an abstract resource type. This is + // used as text to insert into With/Default function calls to separate out + // implementations of the same abstract type. This way e.g. a WithUsername + // option turns into WithPasswordAccountUsername which is wordy but + // unambiguous. It also switches the behavior of the functions to work on + // the attributes map. + subtypeName string + + // mappings of names of resources and param names for sub slice types, e.g. + // role principals and group members + sliceSubTypes map[string]string + + // outputOnly indicates that we shouldn't create options for setting members + // for this struct + outputOnly bool + + // versionEnabled indicates that we should build a Version handler in + // update. Eventually everything should support this and this param can go + // away. + versionEnabled bool + + // The parameters passed into the path. These should be non-pluralized resource names. + // The templates will convert '-' to '_' and append an _id to them in the SDK param + // and append an 's' to it when building the path. + // The final value should be the path name of the resource since for single resource + // operations all values are used for the function argument. + // For collection based operations the last value is ignored for generating function argument. + pathArgs []string } var inputStructs = []*structInfo{ { - inFile: os.Getenv("GEN_BASEPATH") + "/internal/gen/controller/api/error.pb.go", - inName: "Error", - outFile: os.Getenv("GEN_BASEPATH") + "/api/error.gen.go", - outName: "Error", - outPkg: "api", + inProto: &api.Error{}, + outFile: "error.gen.go", outputOnly: true, }, { - inFile: os.Getenv("GEN_BASEPATH") + "/internal/gen/controller/api/error.pb.go", - inName: "ErrorDetails", - outFile: os.Getenv("GEN_BASEPATH") + "/api/error_details.gen.go", - outName: "ErrorDetails", - outPkg: "api", + inProto: &api.ErrorDetails{}, + outFile: "error_details.gen.go", outputOnly: true, }, { - inFile: os.Getenv("GEN_BASEPATH") + "/internal/gen/controller/api/error.pb.go", - inName: "FieldError", - outFile: os.Getenv("GEN_BASEPATH") + "/api/field_error.gen.go", - outName: "FieldError", - outPkg: "api", + inProto: &api.FieldError{}, + outFile: "field_error.gen.go", + outputOnly: true, + }, + // Scope related resources + { + inProto: &scopes.ScopeInfo{}, + outFile: "scopes/scope_info.gen.go", outputOnly: true, }, { - inFile: os.Getenv("GEN_BASEPATH") + "/internal/gen/controller/api/resources/hosts/host.pb.go", - inName: "Host", - outFile: os.Getenv("GEN_BASEPATH") + "/api/hosts/host.gen.go", - outName: "Host", - outPkg: "hosts", + inProto: &scopes.Scope{}, + outFile: "scopes/scope.gen.go", + templates: []*template.Template{ + clientTemplate, + createTemplate, + readTemplate, + updateTemplate, + deleteTemplate, + listTemplate, + }, + pathArgs: []string{"scope"}, + versionEnabled: true, }, + // User related resources { - inFile: os.Getenv("GEN_BASEPATH") + "/internal/gen/controller/api/resources/hosts/host_set.pb.go", - inName: "HostSet", - outFile: os.Getenv("GEN_BASEPATH") + "/api/hosts/host_set.gen.go", - outName: "HostSet", - outPkg: "hosts", + inProto: &users.User{}, + outFile: "users/user.gen.go", + templates: []*template.Template{ + clientTemplate, + createTemplate, + readTemplate, + updateTemplate, + deleteTemplate, + listTemplate, + }, + pathArgs: []string{"user"}, + versionEnabled: true, }, + // Group related resources { - inFile: os.Getenv("GEN_BASEPATH") + "/internal/gen/controller/api/resources/hosts/host_catalog.pb.go", - inName: "HostCatalog", - outFile: os.Getenv("GEN_BASEPATH") + "/api/hosts/host_catalog.gen.go", - outName: "HostCatalog", - outPkg: "hosts", - }, - { - inFile: os.Getenv("GEN_BASEPATH") + "/internal/gen/controller/api/resources/authtokens/authtoken.pb.go", - inName: "AuthToken", - outFile: os.Getenv("GEN_BASEPATH") + "/api/authtokens/authtoken.gen.go", - outName: "AuthToken", - outPkg: "authtokens", - }, - { - inFile: os.Getenv("GEN_BASEPATH") + "/internal/gen/controller/api/resources/scopes/scope.pb.go", - inName: "Scope", - outFile: os.Getenv("GEN_BASEPATH") + "/api/scopes/scope.gen.go", - outName: "Scope", - outPkg: "scopes", - }, - - { - inFile: os.Getenv("GEN_BASEPATH") + "/internal/gen/controller/api/resources/scopes/scope.pb.go", - inName: "ScopeInfo", - outFile: os.Getenv("GEN_BASEPATH") + "/api/info/scope.gen.go", - outName: "Scope", - outPkg: "info", + inProto: &groups.Member{}, + outFile: "groups/member.gen.go", outputOnly: true, }, { - inFile: os.Getenv("GEN_BASEPATH") + "/internal/gen/controller/api/resources/users/user.pb.go", - inName: "User", - outFile: os.Getenv("GEN_BASEPATH") + "/api/users/user.gen.go", - outName: "User", - outPkg: "users", + inProto: &groups.Group{}, + outFile: "groups/group.gen.go", + templates: []*template.Template{ + clientTemplate, + createTemplate, + readTemplate, + updateTemplate, + deleteTemplate, + listTemplate, + }, + sliceSubTypes: map[string]string{ + "Members": "memberIds", + }, + pathArgs: []string{"group"}, + versionEnabled: true, }, + // Role related resources { - inFile: os.Getenv("GEN_BASEPATH") + "/internal/gen/controller/api/resources/groups/group.pb.go", - inName: "Group", - outFile: os.Getenv("GEN_BASEPATH") + "/api/groups/group.gen.go", - outName: "Group", - outPkg: "groups", - }, - { - inFile: os.Getenv("GEN_BASEPATH") + "/internal/gen/controller/api/resources/groups/group.pb.go", - inName: "Member", - outFile: os.Getenv("GEN_BASEPATH") + "/api/groups/member.gen.go", - outName: "Member", - outPkg: "groups", + inProto: &roles.Grant{}, + outFile: "roles/grant.gen.go", outputOnly: true, }, { - inFile: os.Getenv("GEN_BASEPATH") + "/internal/gen/controller/api/resources/roles/role.pb.go", - inName: "Role", - outFile: os.Getenv("GEN_BASEPATH") + "/api/roles/role.gen.go", - outName: "Role", - outPkg: "roles", - }, - { - inFile: os.Getenv("GEN_BASEPATH") + "/internal/gen/controller/api/resources/roles/role.pb.go", - inName: "Principal", - outFile: os.Getenv("GEN_BASEPATH") + "/api/roles/principal.gen.go", - outName: "Principal", - outPkg: "roles", + inProto: &roles.Principal{}, + outFile: "roles/principal.gen.go", outputOnly: true, }, { - inFile: os.Getenv("GEN_BASEPATH") + "/internal/gen/controller/api/resources/roles/role.pb.go", - inName: "Grant", - outFile: os.Getenv("GEN_BASEPATH") + "/api/roles/grant.gen.go", - outName: "Grant", - outPkg: "roles", + inProto: &roles.GrantJson{}, + outFile: "roles/grant_json.gen.go", outputOnly: true, }, { - inFile: os.Getenv("GEN_BASEPATH") + "/internal/gen/controller/api/resources/roles/role.pb.go", - inName: "GrantJson", - outFile: os.Getenv("GEN_BASEPATH") + "/api/roles/grant_json.gen.go", - outName: "GrantJson", - outPkg: "roles", - outputOnly: true, + inProto: &roles.Role{}, + outFile: "roles/role.gen.go", + templates: []*template.Template{ + clientTemplate, + createTemplate, + readTemplate, + updateTemplate, + deleteTemplate, + listTemplate, + }, + sliceSubTypes: map[string]string{ + "Principals": "principalIds", + "Grants": "grantStrings", + }, + pathArgs: []string{"role"}, + versionEnabled: true, + }, + // Auth Methods related resources + { + inProto: &authmethods.AuthMethod{}, + outFile: "authmethods/authmethods.gen.go", + templates: []*template.Template{ + clientTemplate, + createTemplate, + readTemplate, + updateTemplate, + deleteTemplate, + listTemplate, + }, + pathArgs: []string{"auth-method"}, }, { - inFile: os.Getenv("GEN_BASEPATH") + "/internal/gen/controller/api/resources/hosts/host_catalog.pb.go", - inName: "StaticHostCatalogDetails", - outFile: os.Getenv("GEN_BASEPATH") + "/api/hosts/static_host_catalog.gen.go", - outName: "StaticHostCatalogDetails", - outPkg: "hosts", - parentName: "HostCatalog", - detailName: "StaticHostCatalog", - templateType: templateTypeDetail, + inProto: &authmethods.PasswordAuthMethodAttributes{}, + outFile: "authmethods/password_auth_method_attributes.gen.go", + subtypeName: "PasswordAuthMethod", }, { - inFile: os.Getenv("GEN_BASEPATH") + "/internal/gen/controller/api/resources/hosts/host_catalog.pb.go", - inName: "AwsEc2HostCatalogDetails", - outFile: os.Getenv("GEN_BASEPATH") + "/api/hosts/awsec2_host_catalog.gen.go", - outName: "AwsEc2HostCatalogDetails", - outPkg: "hosts", - parentName: "HostCatalog", - detailName: "AwsEc2HostCatalog", - templateType: templateTypeDetail, + inProto: &authmethods.Account{}, + outFile: "authmethods/account.gen.go", + templates: []*template.Template{ + clientTemplate, + createTemplate, + readTemplate, + updateTemplate, + deleteTemplate, + listTemplate, + }, + pathArgs: []string{"auth-method", "account"}, + }, + { + inProto: &authmethods.PasswordAccountAttributes{}, + outFile: "authmethods/password_account_attributes.gen.go", + subtypeName: "PasswordAccount", + }, + // Auth Tokens + { + inProto: &authtokens.AuthToken{}, + outFile: "authtokens/authtokens.gen.go", + templates: []*template.Template{ + clientTemplate, + readTemplate, + deleteTemplate, + listTemplate, + }, + pathArgs: []string{"auth-token"}, + }, + // Host related resources + { + inProto: &hosts.HostCatalog{}, + outFile: "hosts/host_catalog.gen.go", + templates: []*template.Template{ + clientTemplate, + createTemplate, + readTemplate, + updateTemplate, + deleteTemplate, + listTemplate, + }, + pathArgs: []string{"host-catalog"}, + }, + { + inProto: &hosts.Host{}, + outFile: "hosts/host.gen.go", + templates: []*template.Template{ + clientTemplate, + createTemplate, + readTemplate, + updateTemplate, + deleteTemplate, + listTemplate, + }, + pathArgs: []string{"host-catalog", "host"}, }, } diff --git a/api/internal/genapi/list.go b/api/internal/genapi/list.go deleted file mode 100644 index e28aada22..000000000 --- a/api/internal/genapi/list.go +++ /dev/null @@ -1,128 +0,0 @@ -package main - -import ( - "bytes" - "fmt" - "io/ioutil" - "os" - "strings" - "text/template" -) - -type listInfo struct { - baseType string - targetType string - path string -} - -var listFuncs = map[string][]*listInfo{ - "scopes": { - { - baseType: "Scope", - targetType: "Scope", - path: "scopes", - }, - }, - "authtokens": { - { - baseType: "AuthToken", - targetType: "AuthToken", - path: "auth-tokens", - }, - }, - "groups": { - { - baseType: "Group", - targetType: "Group", - path: "groups", - }, - }, - "users": { - { - baseType: "User", - targetType: "User", - path: "users", - }, - }, - "roles": { - { - baseType: "Role", - targetType: "Role", - path: "roles", - }, - }, -} - -func writeListFuncs() { - for outPkg, funcs := range listFuncs { - outFile := os.Getenv("GEN_BASEPATH") + fmt.Sprintf("/api/%s/list.gen.go", outPkg) - outBuf := bytes.NewBuffer([]byte(fmt.Sprintf( - `// Code generated by "make api"; DO NOT EDIT. -package %s -`, outPkg))) - for _, listInfo := range funcs { - listFuncTemplate.Execute(outBuf, struct { - BaseType string - TargetType string - TargetName string - Path string - }{ - BaseType: listInfo.baseType, - TargetType: listInfo.targetType, - TargetName: strings.Split(listInfo.targetType, ".")[strings.Count(listInfo.targetType, ".")], - Path: listInfo.path, - }) - } - if err := ioutil.WriteFile(outFile, outBuf.Bytes(), 0644); err != nil { - fmt.Printf("error writing file %q: %v\n", outFile, err) - os.Exit(1) - } - } -} - -var listFuncTemplate = template.Must(template.New("").Parse( - ` -func (s {{ .BaseType }}) List{{ .TargetName }}s(ctx context.Context) ([]*{{ .TargetType }}, *api.Error, error) { - if s.Client == nil { - return nil, nil, fmt.Errorf("nil client in List{{ .TargetName }} request") - } - - var opts []api.Option - if s.Scope.Id != "" { - // If it's explicitly set here, override anything that might be in the - // client - opts = append(opts, api.WithScopeId(s.Scope.Id)) - } - - req, err := s.Client.NewRequest(ctx, "GET", "{{ .Path }}", nil, opts...) - if err != nil { - return nil, nil, fmt.Errorf("error creating List{{ .TargetName }}s request: %w", err) - } - - resp, err := s.Client.Do(req) - if err != nil { - return nil, nil, fmt.Errorf("error performing client request during List{{ .TargetName }}s call: %w", err) - } - - type listResponse struct { - Items []*{{ .TargetType }} - } - target := &listResponse{} - - apiErr, err := resp.Decode(target) - if err != nil { - return nil, nil, fmt.Errorf("error decoding List{{ .TargetName }}s response: %w", err) - } - - for _, t := range target.Items { - {{ if (eq .TargetType "Scope") }} - t.Client = s.Client.Clone() - t.Client.SetScopeId(t.Id) - {{ else }} - t.Client = s.Client - {{ end }} - } - - return target.Items, apiErr, nil -} -`)) diff --git a/api/internal/genapi/main.go b/api/internal/genapi/main.go index 0d246fe4a..077ff8ede 100644 --- a/api/internal/genapi/main.go +++ b/api/internal/genapi/main.go @@ -2,10 +2,5 @@ package main func main() { parsePBs() - writeStructTemplates() - writeCreateFuncs() - writeReadFuncs() - writeUpdateFuncs() - writeListFuncs() - writeDeleteFuncs() + fillTemplates() } diff --git a/api/internal/genapi/parse.go b/api/internal/genapi/parse.go index ad4c68d2f..7c382d0fa 100644 --- a/api/internal/genapi/parse.go +++ b/api/internal/genapi/parse.go @@ -1,286 +1,104 @@ package main import ( - "bufio" - "bytes" "fmt" - "go/ast" - "go/format" - "go/parser" - "go/token" - "os" - "path/filepath" - "regexp" - "strings" + + _struct "github.com/golang/protobuf/ptypes/struct" + "google.golang.org/protobuf/proto" + "google.golang.org/protobuf/reflect/protoreflect" + "google.golang.org/protobuf/types/descriptorpb" + "google.golang.org/protobuf/types/known/timestamppb" + "google.golang.org/protobuf/types/known/wrapperspb" + + "github.com/hashicorp/watchtower/internal/gen/controller/protooptions" + + "github.com/iancoleman/strcase" ) -var regex = regexp.MustCompile(`(json:".*")`) - -type visitFn func(node ast.Node) - -func (fn visitFn) Visit(node ast.Node) ast.Visitor { - fn(node) - return fn +func printDebug(desc protoreflect.MessageDescriptor) { + fmt.Printf("Evaluating: %q\n", desc.FullName()) + fmt.Printf("Name: %q\n", strcase.ToCamel(string(desc.Name()))) + fmt.Printf("ProtoName: %q\n", desc.Name()) + fmt.Printf("Double Parent: %q\n", desc.FullName().Parent().Parent().Name()) + fmt.Printf("Field Descriptors:\n") + for i := 0; i < desc.Fields().Len(); i++ { + fieldDesc := desc.Fields().Get(i) + fmt.Printf(" field %d: %#v\n", i, fieldDesc) + fieldDesc.Options() + } + fmt.Println() } func parsePBs() { - for _, inputStruct := range inputStructs { - inFile, err := filepath.Abs(inputStruct.inFile) - if err != nil { - fmt.Printf("error opening file %q: %v\n", inputStruct.inFile, err) - os.Exit(1) + for _, in := range inputStructs { + msg := in.inProto.ProtoReflect() + desc := msg.Descriptor() + + //printDebug(desc) + + // Evaluate above, populate below. + in.generatedStructure.pkg = packageFromFullName(desc.FullName()) + in.generatedStructure.name = string(desc.Name()) + for i := 0; i < desc.Fields().Len(); i++ { + fd := desc.Fields().Get(i) + fi := fieldInfo{ + Name: strcase.ToCamel(string(fd.Name())), + ProtoName: string(fd.Name()), + } + // Adjust for slices + sliceText := "" + if fd.Cardinality() == protoreflect.Repeated { + sliceText = "[]" + } + // Add generate option info + opts := fd.Options().(*descriptorpb.FieldOptions) + if proto.GetExtension(opts, protooptions.E_GenerateSdkOption).(bool) { + fi.GenerateSdkOption = true + } + switch k := fd.Kind(); k { + case protoreflect.MessageKind: + ptr, pkg, name := messageKind(fd) + if pkg != "" && pkg != in.generatedStructure.pkg { + name = fmt.Sprintf("%s.%s", pkg, name) + } + fi.FieldType = sliceText + ptr + name + default: + fi.FieldType = sliceText + k.String() + } + in.generatedStructure.fields = append(in.generatedStructure.fields, fi) } - - fset := token.NewFileSet() - inAst, err := parser.ParseFile(fset, inFile, nil, parser.ParseComments) - if err != nil { - fmt.Printf("error parsing %s: %v\n", inFile, err) - os.Exit(1) - } - - inputStruct.nameJsonMap = make(map[string]string) - ast.Walk(visitFn(func(n ast.Node) { - spec, ok := n.(*ast.TypeSpec) - if !ok { - return - } - if spec.Name == nil { - return - } - if spec.Name.Name != inputStruct.inName { - return - } - - spec.Name.Name = inputStruct.outName - st, ok := spec.Type.(*ast.StructType) - if !ok { - fmt.Printf("expected struct type for identifier, got %t\n", spec.Type) - os.Exit(1) - return - } - - if st.Fields.List == nil { - fmt.Printf("no fields found in %q\n", inputStruct.inName) - os.Exit(1) - return - } - - // Tee up unexported field deletion - var elideList []int - { - defer func() { - var cutCount int - // Remove unexported proto stuff - for _, val := range elideList { - loc := val - cutCount - st.Fields.List = append(st.Fields.List[:loc], st.Fields.List[loc+1:]...) - cutCount++ - } - - // Add default fields if a base resource - if inputStruct.templateType == templateTypeResource && !inputStruct.outputOnly { - st.Fields.List = append([]*ast.Field{{ - Names: []*ast.Ident{ - { - Name: "defaultFields", - Obj: &ast.Object{ - Kind: ast.Var, - Name: "defaultFields", - }, - }, - }, - Type: &ast.ArrayType{ - Elt: &ast.Ident{ - Name: "string", - }, - }, - }}, st.Fields.List...) - } - }() - } - - for i, field := range st.Fields.List { - if !field.Names[0].IsExported() { - elideList = append(elideList, i) - continue - } - - // Anything that isn't a basic type we expect to be a star - // expression with a selector; that is, a wrapper value, timestamp - // value, etc. - // - // TODO: this isn't necessarily a good assumption, which means we - // might get failures with other types. This is an internal tools - // only; we can revisit as needed! - var selectorExpr *ast.SelectorExpr - switch typ := field.Type.(type) { - case *ast.Ident: - goto TAGMODIFY - case *ast.ArrayType: - goto TAGMODIFY - case *ast.StarExpr: - switch nextTyp := typ.X.(type) { - case *ast.Ident: - // Already a pointer, don't do anything - if nextTyp.Name == "ScopeInfo" { - st.Fields.List[i] = &ast.Field{ - Names: field.Names, - Type: &ast.Ident{ - Name: "info.Scope", - }, - Tag: field.Tag, - } - } - goto TAGMODIFY - case *ast.SelectorExpr: - selectorExpr = nextTyp - } - case *ast.SelectorExpr: - selectorExpr = typ - } - - switch { - case selectorExpr != nil: - xident, ok := selectorExpr.X.(*ast.Ident) - if !ok { - fmt.Printf("unexpected non-ident type in selector\n") - os.Exit(1) - } - - switch xident.Name { - case "wrappers": - switch selectorExpr.Sel.Name { - case "StringValue": - st.Fields.List[i] = &ast.Field{ - Names: field.Names, - Type: &ast.Ident{ - Name: "*string", - }, - Tag: field.Tag, - } - case "BoolValue": - st.Fields.List[i] = &ast.Field{ - Names: field.Names, - Type: &ast.Ident{ - Name: "*bool", - }, - Tag: field.Tag, - } - case "Int64Value": - st.Fields.List[i] = &ast.Field{ - Names: field.Names, - Type: &ast.Ident{ - Name: "*int64", - }, - Tag: field.Tag, - } - default: - fmt.Printf("unhandled wrappers selector sel name %q\n", selectorExpr.Sel.Name) - os.Exit(1) - } - - case "timestamp": - switch selectorExpr.Sel.Name { - case "Timestamp": - st.Fields.List[i] = &ast.Field{ - Names: field.Names, - Type: &ast.Ident{ - Name: "time.Time", - }, - Tag: field.Tag, - } - - default: - fmt.Printf("unhandled timestamp selector sel name %q\n", selectorExpr.Sel.Name) - os.Exit(1) - } - - case "scopes": - switch selectorExpr.Sel.Name { - case "ScopeInfo": - st.Fields.List[i] = &ast.Field{ - Names: field.Names, - Type: &ast.Ident{ - Name: "info.Scope", - }, - Tag: field.Tag, - } - - default: - fmt.Printf("unhandled scopes selector sel name %q\n", selectorExpr.Sel.Name) - os.Exit(1) - } - - case "_struct": - switch selectorExpr.Sel.Name { - case "Struct": - st.Fields.List[i] = &ast.Field{ - Names: field.Names, - Type: &ast.MapType{ - Key: &ast.Ident{ - Name: "string", - }, - Value: &ast.InterfaceType{ - Methods: &ast.FieldList{}, - }, - }, - Tag: field.Tag, - } - - default: - fmt.Printf("unhandled timestamp selector sel name %q\n", selectorExpr.Sel.Name) - os.Exit(1) - } - - default: - fmt.Printf("unhandled xident name %q\n", xident.Name) - os.Exit(1) - } - - default: - fmt.Println("unhandled non-ident, non-selector case") - os.Exit(1) - } - - TAGMODIFY: - tagString := regex.FindString(st.Fields.List[i].Tag.Value) - st.Fields.List[i].Tag.Value = "`" + tagString + "`" - tagString = strings.TrimSuffix(strings.TrimPrefix(tagString, `json:"`), `,omitempty"`) - inputStruct.nameJsonMap[strings.ToLower(field.Names[0].Name)] = tagString - } - }), inAst) - - buf := new(bytes.Buffer) - if err := format.Node(buf, fset, inAst); err != nil { - fmt.Printf("error formatting new code: %v\n", err) - os.Exit(1) - } - - // We have to manually cut out the lines we don't want because comments - // won't be preserved otherwise. See the note about lossy comments in - // https://arslan.io/2017/09/14/the-ultimate-guide-to-writing-a-go-tool/ - scanner := bufio.NewScanner(bytes.NewBufferString(buf.String())) - var inType bool - var outBuf []string - for scanner.Scan() { - if !inType { - if strings.HasPrefix(scanner.Text(), "type "+inputStruct.outName+" struct") { - inType = true - // Don't add this line, we'll do it in the template - continue - } - } else { - if scanner.Text() == "}" { - // We've reached the end of the type - break - } - } - - if inType { - outBuf = append(outBuf, scanner.Text()) - } - } - - inputStruct.structFields = strings.Join(outBuf, "\n") + //fmt.Printf("Parsed: %#v\n", in.generatedStructure) + } +} + +func packageFromFullName(fullName protoreflect.FullName) string { + // Example full name: controller.api.resources.groups.v1.Group + // Crawling up the parent twice jumps back past v1.Group placing us at "groups". + pkgName := fullName.Parent().Parent().Name() + if pkgName.IsValid() { + return string(pkgName) + } + return "" +} + +var ( + stringValueName = (&wrapperspb.StringValue{}).ProtoReflect().Descriptor().FullName() + boolValueName = (&wrapperspb.BoolValue{}).ProtoReflect().Descriptor().FullName() + structValueName = (&_struct.Struct{}).ProtoReflect().Descriptor().FullName() + timestampName = (×tamppb.Timestamp{}).ProtoReflect().Descriptor().FullName() +) + +func messageKind(fd protoreflect.FieldDescriptor) (ptr, pkg, name string) { + switch fd.Message().FullName() { + case stringValueName: + return "", "", "string" + case boolValueName: + return "", "", "bool" + case structValueName: + return "", "", "map[string]interface{}" + case timestampName: + return "", "time", "Time" + default: + return "*", packageFromFullName(fd.Message().FullName()), string(fd.Message().Name()) } } diff --git a/api/internal/genapi/read.go b/api/internal/genapi/read.go deleted file mode 100644 index 94c1cfa7f..000000000 --- a/api/internal/genapi/read.go +++ /dev/null @@ -1,133 +0,0 @@ -package main - -import ( - "bytes" - "fmt" - "io/ioutil" - "os" - "strings" - "text/template" -) - -type readInfo struct { - baseType string - targetType string - path string -} - -var readFuncs = map[string][]*readInfo{ - "scopes": { - { - baseType: "Scope", - targetType: "Scope", - path: "scopes", - }, - }, - "authtokens": { - { - baseType: "AuthToken", - targetType: "AuthToken", - path: "auth-tokens", - }, - }, - "groups": { - { - baseType: "Group", - targetType: "Group", - path: "groups", - }, - }, - "users": { - { - baseType: "User", - targetType: "User", - path: "users", - }, - }, - "roles": { - { - baseType: "Role", - targetType: "Role", - path: "roles", - }, - }, - "hosts": { - { - baseType: "HostCatalog", - targetType: "HostCatalog", - path: "host-catalogs", - }, - }, -} - -func writeReadFuncs() { - for outPkg, funcs := range readFuncs { - outFile := os.Getenv("GEN_BASEPATH") + fmt.Sprintf("/api/%s/read.gen.go", outPkg) - outBuf := bytes.NewBuffer([]byte(fmt.Sprintf( - `// Code generated by "make api"; DO NOT EDIT. -package %s -`, outPkg))) - for _, readInfo := range funcs { - readFuncTemplate.Execute(outBuf, struct { - BaseType string - TargetType string - TargetName string - Path string - }{ - BaseType: readInfo.baseType, - TargetType: readInfo.targetType, - TargetName: strings.Split(readInfo.targetType, ".")[strings.Count(readInfo.targetType, ".")], - Path: readInfo.path, - }) - } - if err := ioutil.WriteFile(outFile, outBuf.Bytes(), 0644); err != nil { - fmt.Printf("error writing file %q: %v\n", outFile, err) - os.Exit(1) - } - } -} - -var readFuncTemplate = template.Must(template.New("").Parse( - ` -func (s {{ .BaseType }}) Read{{ .TargetName }}(ctx context.Context, id string) (*{{ .TargetType }}, *api.Error, error) { - if id == "" { - return nil, nil, fmt.Errorf("empty ID value passed into Read{{ .TargetName }} request") - } - - if s.Client == nil { - return nil, nil, fmt.Errorf("nil client in Read{{ .TargetName }} request") - } - - var opts []api.Option - if s.Scope.Id != "" { - // If it's explicitly set here, override anything that might be in the - // client - opts = append(opts, api.WithScopeId(s.Scope.Id)) - } - - req, err := s.Client.NewRequest(ctx, "GET", fmt.Sprintf("%s/%s", "{{ .Path }}", id), nil, opts...) - if err != nil { - return nil, nil, fmt.Errorf("error creating Read{{ .TargetName }} request: %w", err) - } - - resp, err := s.Client.Do(req) - if err != nil { - return nil, nil, fmt.Errorf("error performing client request during Read{{ .TargetName }} call: %w", err) - } - - target := new({{ .TargetType }}) - apiErr, err := resp.Decode(target) - if err != nil { - return nil, nil, fmt.Errorf("error decoding Read{{ .TargetName }} repsonse: %w", err) - } - - {{ if (eq .TargetType "Scope") }} - target.Client = s.Client.Clone() - target.Client.SetScopeId(target.Id) - {{ else }} - target.Client = s.Client - {{ end }} - - return target, apiErr, nil -} -`)) diff --git a/api/internal/genapi/templates.go b/api/internal/genapi/templates.go index 1538e4de0..6ce134e07 100644 --- a/api/internal/genapi/templates.go +++ b/api/internal/genapi/templates.go @@ -6,54 +6,162 @@ import ( "io/ioutil" "os" "path/filepath" + "sort" + "strings" "text/template" + + "github.com/iancoleman/strcase" ) -type templateType int +func toPath(segments []string, action string) string { + var printfString, printfArg []string + for i, s := range segments { + if i%2 == 0 { + // The first (zero index) is always the resource name, the next will be the id. + printfString = append(printfString, s) + } else { + printfString = append(printfString, "%s") + printfArg = append(printfArg, s) + } + } + if action != "" { + action = fmt.Sprintf(":%s", action) + } + return fmt.Sprintf("fmt.Sprintf(\"%s%s\", %s)", strings.Join(printfString, "/"), action, strings.Join(printfArg, ", ")) +} -const ( - templateTypeResource templateType = iota - templateTypeDetail -) +func getArgsAndPaths(in []string, action string) (colArgs, resArgs []string, colPath, resPath string) { + var argNames, pathSegment []string + for _, s := range in { + varName := fmt.Sprintf("%sId", strcase.ToLowerCamel(strings.ReplaceAll(s, "-", "_"))) + collectionName := fmt.Sprintf("%ss", s) -func writeStructTemplates() { - for _, inputStruct := range inputStructs { + argNames = append(argNames, varName) + pathSegment = append(pathSegment, collectionName, varName) + } + + return argNames[:len(argNames)-1], argNames, toPath(pathSegment[:len(pathSegment)-1], action), toPath(pathSegment, action) +} + +type templateInput struct { + ClientName string + Name string + Package string + Fields []fieldInfo + PathArgs []string + CollectionFunctionArgs []string + ResourceFunctionArgs []string + CollectionPath string + ResourcePath string + SliceSubTypes map[string]string + VersionEnabled bool +} + +func fillTemplates() { + optionsMap := map[string]map[string]fieldInfo{} + for _, in := range inputStructs { outBuf := new(bytes.Buffer) - switch inputStruct.templateType { - case templateTypeResource: - structTemplate.Execute(outBuf, struct { - Name string - Package string - StructFields string - NameJsonMap map[string]string - OutputOnly bool - }{ - Name: inputStruct.outName, - Package: inputStruct.outPkg, - StructFields: inputStruct.structFields, - NameJsonMap: inputStruct.nameJsonMap, - OutputOnly: inputStruct.outputOnly, - }) - - case templateTypeDetail: - detailTemplate.Execute(outBuf, struct { - Package string - StructFields string - ParentName string - DetailName string - }{ - Package: inputStruct.outPkg, - StructFields: inputStruct.structFields, - ParentName: inputStruct.parentName, - DetailName: inputStruct.detailName, - }) + input := templateInput{ + ClientName: strings.ToLower(in.generatedStructure.name), + Name: in.generatedStructure.name, + Package: in.generatedStructure.pkg, + Fields: in.generatedStructure.fields, + PathArgs: in.pathArgs, + VersionEnabled: in.versionEnabled, } - outFile, err := filepath.Abs(inputStruct.outFile) - if err != nil { - fmt.Printf("error opening file %q: %v\n", inputStruct.outFile, err) + if len(in.pathArgs) > 0 { + input.CollectionFunctionArgs, input.ResourceFunctionArgs, input.CollectionPath, input.ResourcePath = getArgsAndPaths(in.pathArgs, "") + } + + if err := structTemplate.Execute(outBuf, input); err != nil { + fmt.Printf("error executing struct template for resource %s: %v\n", in.generatedStructure.name, err) os.Exit(1) } + + if len(in.sliceSubTypes) > 0 { + input.SliceSubTypes = in.sliceSubTypes + in.templates = append(in.templates, sliceSubTypeTemplate) + } + + for _, t := range in.templates { + if err := t.Execute(outBuf, input); err != nil { + fmt.Printf("error executing function template for resource %s: %v\n", in.generatedStructure.name, err) + os.Exit(1) + } + } + + // We want to generate options per-package, not per-struct, so we + // collate them all here for writing later. The map argument of the + // package map is to prevent duplicates since we may have multiple e.g. + // Name or Description fields. + if !in.outputOnly { + pkgOptionMap := map[string]fieldInfo{} + for _, val := range input.Fields { + if val.GenerateSdkOption { + val.SubtypeName = in.subtypeName + pkgOptionMap[val.Name] = val + } + } + optionMap := optionsMap[input.Package] + if optionMap == nil { + optionMap = map[string]fieldInfo{} + } + for name, val := range pkgOptionMap { + optionMap[name] = val + } + optionsMap[input.Package] = optionMap + } + + outFile, err := filepath.Abs(fmt.Sprintf("%s/%s", os.Getenv("API_GEN_BASEPATH"), in.outFile)) + if err != nil { + fmt.Printf("error opening file %q: %v\n", in.outFile, err) + os.Exit(1) + } + outDir := filepath.Dir(outFile) + if _, err := os.Stat(outDir); os.IsNotExist(err) { + _ = os.Mkdir(outDir, os.ModePerm) + } + if err := ioutil.WriteFile(outFile, outBuf.Bytes(), 0644); err != nil { + fmt.Printf("error writing file %q: %v\n", outFile, err) + os.Exit(1) + } + } + + // Now reconstruct options per package and write them out + for pkg, options := range optionsMap { + outBuf := new(bytes.Buffer) + + var fieldNames []string + for _, v := range options { + fieldNames = append(fieldNames, v.Name) + } + sort.Strings(fieldNames) + + var fields []fieldInfo + for _, v := range fieldNames { + fields = append(fields, options[v]) + } + + input := templateInput{ + Package: pkg, + Fields: fields, + } + + if err := optionTemplate.Execute(outBuf, input); err != nil { + fmt.Printf("error executing option template for package %s: %v\n", pkg, err) + os.Exit(1) + } + + outFile, err := filepath.Abs(fmt.Sprintf("%s/%s/%s", os.Getenv("API_GEN_BASEPATH"), pkg, "option.gen.go")) + if err != nil { + fmt.Printf("error opening file %q: %v\n", "option.gen.go", err) + os.Exit(1) + } + outDir := filepath.Dir(outFile) + if _, err := os.Stat(outDir); os.IsNotExist(err) { + _ = os.Mkdir(outDir, os.ModePerm) + } if err := ioutil.WriteFile(outFile, outBuf.Bytes(), 0644); err != nil { fmt.Printf("error writing file %q: %v\n", outFile, err) os.Exit(1) @@ -61,99 +169,398 @@ func writeStructTemplates() { } } -// TODO: Add documentation around SetDefault and how it behaves when the field corresponding to the provided key is already set. +var listTemplate = template.Must(template.New("").Parse(` +func (c *{{ .ClientName }}Client) List(ctx context.Context, {{ range .CollectionFunctionArgs }} {{ . }} string, {{ end }}opt... Option) ([]*{{ .Name }}, *api.Error, error) { {{ range .CollectionFunctionArgs }} + if {{ . }} == "" { + return nil, nil, fmt.Errorf("empty {{ . }} value passed into List request") + } + {{ end }} + if c.client == nil { + return nil, nil, fmt.Errorf("nil client") + } + + _, apiOpts := getOpts(opt...) + + req, err := c.client.NewRequest(ctx, "GET", {{ .CollectionPath }}, nil, apiOpts...) + if err != nil { + return nil, nil, fmt.Errorf("error creating List request: %w", err) + } + + resp, err := c.client.Do(req) + if err != nil { + return nil, nil, fmt.Errorf("error performing client request during List call: %w", err) + } + + type listResponse struct { + Items []*{{ .Name }} + } + target := &listResponse{} + apiErr, err := resp.Decode(target) + if err != nil { + return nil, nil, fmt.Errorf("error decoding List response: %w", err) + } + + return target.Items, apiErr, nil +} +`)) + +var readTemplate = template.Must(template.New("").Parse(` +func (c *{{ .ClientName }}Client) Read(ctx context.Context, {{ range .ResourceFunctionArgs }} {{ . }} string, {{ end }} opt... Option) (*{{ .Name }}, *api.Error, error) { {{ range .ResourceFunctionArgs }} + if {{ . }} == "" { + return nil, nil, fmt.Errorf("empty {{ . }} value passed into Read request") + } + {{ end }} + if c.client == nil { + return nil, nil, fmt.Errorf("nil client") + } + + _, apiOpts := getOpts(opt...) + + req, err := c.client.NewRequest(ctx, "GET", {{ .ResourcePath }}, nil, apiOpts...) + if err != nil { + return nil, nil, fmt.Errorf("error creating Read request: %w", err) + } + + resp, err := c.client.Do(req) + if err != nil { + return nil, nil, fmt.Errorf("error performing client request during Read call: %w", err) + } + + target := new({{ .Name }}) + apiErr, err := resp.Decode(target) + if err != nil { + return nil, nil, fmt.Errorf("error decoding Read response: %w", err) + } + + return target, apiErr, nil +} +`)) + +var deleteTemplate = template.Must(template.New("").Parse(` +func (c *{{ .ClientName }}Client) Delete(ctx context.Context, {{ range .ResourceFunctionArgs }} {{ . }} string, {{ end }} opt... Option) (bool, *api.Error, error) { {{ range .ResourceFunctionArgs }} + if {{ . }} == "" { + return false, nil, fmt.Errorf("empty {{ . }} value passed into Delete request") + } + {{ end }} + if c.client == nil { + return false, nil, fmt.Errorf("nil client") + } + + _, apiOpts := getOpts(opt...) + + req, err := c.client.NewRequest(ctx, "DELETE", {{ .ResourcePath }}, nil, apiOpts...) + if err != nil { + return false, nil, fmt.Errorf("error creating Delete request: %w", err) + } + + resp, err := c.client.Do(req) + if err != nil { + return false, nil, fmt.Errorf("error performing client request during Delete call: %w", err) + } + + type deleteResponse struct { + Existed bool + } + target := &deleteResponse{} + apiErr, err := resp.Decode(target) + if err != nil { + return false, nil, fmt.Errorf("error decoding Delete response: %w", err) + } + + return target.Existed, apiErr, nil +} +`)) + +var createTemplate = template.Must(template.New("").Parse(` +func (c *{{ .ClientName }}Client) Create(ctx context.Context, {{ range .CollectionFunctionArgs }} {{ . }} string, {{ end }} opt... Option) (*{{ .Name }}, *api.Error, error) { {{ range .CollectionFunctionArgs }} + if {{ . }} == "" { + return nil, nil, fmt.Errorf("empty {{ . }} value passed into Create request") + } + {{ end }} + if c.client == nil { + return nil, nil, fmt.Errorf("nil client") + } + + opts, apiOpts := getOpts(opt...) + + req, err := c.client.NewRequest(ctx, "POST", {{ .CollectionPath }}, opts.valueMap, apiOpts...) + if err != nil { + return nil, nil, fmt.Errorf("error creating Create request: %w", err) + } + + resp, err := c.client.Do(req) + if err != nil { + return nil, nil, fmt.Errorf("error performing client request during Create call: %w", err) + } + + target := new({{ .Name }}) + apiErr, err := resp.Decode(target) + if err != nil { + return nil, nil, fmt.Errorf("error decoding Create response: %w", err) + } + + return target, apiErr, nil +} +`)) + +var updateTemplate = template.Must(template.New("").Parse(` +func (c *{{ .ClientName }}Client) Update(ctx context.Context, {{ range .ResourceFunctionArgs }} {{ . }} string, {{ end }}version uint32, opt... Option) (*{{ .Name }}, *api.Error, error) { {{ range .ResourceFunctionArgs }} + if {{ . }} == "" { + return nil, nil, fmt.Errorf("empty {{ . }} value passed into Update request") + }{{ end }} + if c.client == nil { + return nil, nil, fmt.Errorf("nil client") + } + + opts, apiOpts := getOpts(opt...) + + {{ if .VersionEnabled }} + if version == 0 { + if !opts.withAutomaticVersioning { + return nil, nil, errors.New("zero version number passed into Update request and automatic versioning not specified") + } + existingTarget, existingApiErr, existingErr := c.Read(ctx, {{ range .ResourceFunctionArgs }} {{ . }}, {{ end }} opt...) + if existingErr != nil { + return nil, nil, fmt.Errorf("error performing initial check-and-set read: %w", existingErr) + } + if existingApiErr != nil { + return nil, nil, fmt.Errorf("error from controller when performing initial check-and-set read: %s", pretty.Sprint(existingApiErr)) + } + if existingTarget == nil { + return nil, nil, errors.New("nil resource found when performing initial check-and-set read") + } + version = existingTarget.Version + } + opts.valueMap["version"] = version + {{ end }} + + req, err := c.client.NewRequest(ctx, "PATCH", {{ .ResourcePath }}, opts.valueMap, apiOpts...) + if err != nil { + return nil, nil, fmt.Errorf("error creating Update request: %w", err) + } + + resp, err := c.client.Do(req) + if err != nil { + return nil, nil, fmt.Errorf("error performing client request during Update call: %w", err) + } + + target := new({{ .Name }}) + apiErr, err := resp.Decode(target) + if err != nil { + return nil, nil, fmt.Errorf("error decoding Update response: %w", err) + } + + return target, apiErr, nil +} +`)) + +var sliceSubTypeTemplate = template.Must(template.New("").Funcs( + template.FuncMap{ + "makeSlice": makeSlice, + "snakeCase": snakeCase, + "kebabCase": kebabCase, + "getPathWithAction": getPathWithAction, + }, +).Parse(` +{{ $input := . }} +{{ range $index, $op := makeSlice "Add" "Set" "Remove" }} +{{ range $key, $value := $input.SliceSubTypes }} +{{ $fullName := print $op $key }} +{{ $actionName := kebabCase $fullName }} +{{ $resPath := getPathWithAction $input.PathArgs $actionName }} +func (c *{{ $input.ClientName }}Client) {{ $fullName }}(ctx context.Context, {{ range $input.ResourceFunctionArgs }} {{ . }} string, {{ end }}version uint32, {{ $value }} []string, opt... Option) (*{{ $input.Name }}, *api.Error, error) { {{ range $input.ResourceFunctionArgs }} + if {{ . }} == "" { + return nil, nil, fmt.Errorf("empty {{ . }} value passed into {{ $fullName }} request") + }{{ end }} + if c.client == nil { + return nil, nil, fmt.Errorf("nil client") + } + + opts, apiOpts := getOpts(opt...) + + {{ if $input.VersionEnabled }} + if version == 0 { + if !opts.withAutomaticVersioning { + return nil, nil, errors.New("zero version number passed into {{ $fullName }} request") + } + existingTarget, existingApiErr, existingErr := c.Read(ctx, {{ range $input.ResourceFunctionArgs }} {{ . }}, {{ end }} opt...) + if existingErr != nil { + return nil, nil, fmt.Errorf("error performing initial check-and-set read: %w", existingErr) + } + if existingApiErr != nil { + return nil, nil, fmt.Errorf("error from controller when performing initial check-and-set read: %s", pretty.Sprint(existingApiErr)) + } + if existingTarget == nil { + return nil, nil, errors.New("nil resource found when performing initial check-and-set read") + } + version = existingTarget.Version + } + opts.valueMap["version"] = version + {{ end }} + + if len({{ $value }}) > 0 { + opts.valueMap["{{ snakeCase $value }}"] = {{ $value }} + }{{ if ( eq $op "Set" ) }} else if {{ $value }} != nil { + // In this function, a non-nil but empty list means clear out + opts.valueMap["{{ snakeCase $value }}"] = nil + } + {{ end }} + + req, err := c.client.NewRequest(ctx, "POST", {{ $resPath }}, opts.valueMap, apiOpts...) + if err != nil { + return nil, nil, fmt.Errorf("error creating {{ $fullName }} request: %w", err) + } + + resp, err := c.client.Do(req) + if err != nil { + return nil, nil, fmt.Errorf("error performing client request during {{ $fullName }} call: %w", err) + } + + target := new({{ $input.Name }}) + apiErr, err := resp.Decode(target) + if err != nil { + return nil, nil, fmt.Errorf("error decoding {{ $fullName }} response: %w", err) + } + + return target, apiErr, nil +} +{{ end }} +{{ end }} +`)) + var structTemplate = template.Must(template.New("").Parse( - `// Code generated by "make api"; DO NOT EDIT. + fmt.Sprint(`// Code generated by "make api"; DO NOT EDIT. package {{ .Package }} import ( "context" - "encoding/json" - "strings" + "fmt" + "time" - "github.com/fatih/structs" + "github.com/kr/pretty" "github.com/hashicorp/watchtower/api" - "github.com/hashicorp/watchtower/api/internal/strutil" + "github.com/hashicorp/watchtower/api/scopes" ) -type {{ .Name }} struct { - {{ if (not .OutputOnly) }} - Client *api.Client ` + "`json:\"-\"`" + ` - {{ end }} - {{ .StructFields }} +type {{ .Name }} struct { {{ range .Fields }} +{{ .Name }} {{ .FieldType }} `, "`json:\"{{ .ProtoName }},omitempty\"`", `{{ end }} +} +`))) + +var clientTemplate = template.Must(template.New("").Parse(` +type {{ .ClientName }}Client struct { + client *api.Client } -{{ if (not .OutputOnly) }} -func (s *{{ .Name }}) SetDefault(key string) { - lowerKey := strings.ToLower(key) - validMap := {{ printf "%#v" .NameJsonMap }} - for k, v := range validMap { - if k == lowerKey || v == lowerKey { - s.defaultFields = strutil.AppendIfMissing(s.defaultFields, v) - return +func New{{ .Name }}Client(c *api.Client) *{{ .ClientName }}Client { + return &{{ .ClientName }}Client{ client: c } +} +`)) + +var optionTemplate = template.Must(template.New("").Parse(` +package {{ .Package }} + +import ( + "context" + "fmt" + "time" + + "github.com/hashicorp/watchtower/api" +) + +// Option is a func that sets optional attributes for a call. This does not need +// to be used directly, but instead option arguments are built from the +// functions in this package. WithX options set a value to that given in the +// argument; DefaultX options indicate that the value should be set to its +// default. When an API call is made options are processed in ther order they +// appear in the function call, so for a given argument X, a succession of WithX +// or DefaultX calls will result in the last call taking effect. +type Option func(*options) + +type options struct { + valueMap map[string]interface{} + withScopeId string + withAutomaticVersioning bool +} + +func getDefaultOptions() options { + return options{ + valueMap: make(map[string]interface{}), + } +} + +func getOpts(opt ...Option) (options, []api.Option) { + opts := getDefaultOptions() + for _, o := range opt { + o(&opts) + } + var apiOpts []api.Option + if opts.withScopeId != "" { + apiOpts = append(apiOpts, api.WithScopeId(opts.withScopeId)) + } + return opts, apiOpts +} + +func WithScopeId(id string) Option { + return func(o *options) { + o.withScopeId = id + } +} + +// If set, and if the version is zero during an update, the API will perform a +// fetch to get the current version of the resource and populate it during the +// update call. This is convenient but opens up the possibility for subtle +// order-of-modification issues, so use carefully. +func WithAutomaticVersioning() Option { + return func(o *options) { + o.withAutomaticVersioning = true + } +} +{{ range .Fields }} +func With{{ .SubtypeName }}{{ .Name }}(in{{ .Name }} {{ .FieldType }}) Option { + return func(o *options) { {{ if ( not ( eq .SubtypeName "" ) ) }} + raw, ok := o.valueMap["attributes"] + if !ok { + raw = interface{}(map[string]interface{}{}) } - } + val := raw.(map[string]interface{}) + val["{{ .ProtoName }}"] = in{{ .Name }} + o.valueMap["attributes"] = val + {{ else }} + o.valueMap["{{ .ProtoName }}"] = in{{ .Name }} + {{ end }} } } -func (s *{{ .Name }}) UnsetDefault(key string) { - lowerKey := strings.ToLower(key) - validMap := {{ printf "%#v" .NameJsonMap }} - for k, v := range validMap { - if k == lowerKey || v == lowerKey { - s.defaultFields = strutil.StrListDelete(s.defaultFields, v) - return +func Default{{ .SubtypeName }}{{ .Name }}() Option { + return func(o *options) { {{ if ( not ( eq .SubtypeName "" ) ) }} + raw, ok := o.valueMap["attributes"] + if !ok { + raw = interface{}(map[string]interface{}{}) } - } -} - -func (s {{ .Name }}) MarshalJSON() ([]byte, error) { - m := structs.Map(s) - if m == nil { - m = make(map[string]interface{}) - } - for _, k := range s.defaultFields { - m[k] = nil - } - return json.Marshal(m) + val := raw.(map[string]interface{}) + val["{{ .ProtoName }}"] = nil + o.valueMap["attributes"] = val + {{ else }} + o.valueMap["{{ .ProtoName }}"] = nil + {{ end }} } } {{ end }} `)) -var detailTemplate = template.Must(template.New("").Parse( - `// Code generated by "make api"; DO NOT EDIT. -package {{ .Package }} - -import ( - "fmt" - - "github.com/mitchellh/mapstructure" - - "github.com/hashicorp/watchtower/api" -) - -type {{ .DetailName }} struct { - *{{ .ParentName }} - - {{ .StructFields }} +func makeSlice(strs ...string) []string { + return strs } -func (s {{ .ParentName }}) As{{ .DetailName }}() (*{{ .DetailName }}, error) { - out := &{{ .DetailName }}{ - {{ .ParentName }}: &s, - } - decoder, err := mapstructure.NewDecoder(&mapstructure.DecoderConfig{ - Result: out, - TagName: "json", - }) - if err != nil { - return nil, fmt.Errorf("error creating map decoder: %w", err) - } - - if err := decoder.Decode(s.Attributes); err != nil { - return nil, fmt.Errorf("error decoding attributes map: %w", err) - } - - return out, nil +func snakeCase(in string) string { + return strcase.ToSnake(in) +} + +func kebabCase(in string) string { + return strcase.ToKebab(in) +} + +func getPathWithAction(resArgs []string, action string) string { + _, _, _, resPath := getArgsAndPaths(resArgs, action) + return resPath } -`)) diff --git a/api/internal/genapi/update.go b/api/internal/genapi/update.go deleted file mode 100644 index 89745b1cd..000000000 --- a/api/internal/genapi/update.go +++ /dev/null @@ -1,125 +0,0 @@ -package main - -import ( - "bytes" - "fmt" - "io/ioutil" - "os" - "strings" - "text/template" -) - -type updateInfo struct { - baseType string - targetType string - path string -} - -var updateFuncs = map[string][]*updateInfo{ - "scopes": { - { - baseType: "Scope", - targetType: "Scope", - path: "scopes", - }, - }, - "groups": { - { - baseType: "Group", - targetType: "Group", - path: "groups", - }, - }, - "users": { - { - baseType: "User", - targetType: "User", - path: "users", - }, - }, - "roles": { - { - baseType: "Role", - targetType: "Role", - path: "roles", - }, - }, -} - -func writeUpdateFuncs() { - for outPkg, funcs := range updateFuncs { - outFile := os.Getenv("GEN_BASEPATH") + fmt.Sprintf("/api/%s/update.gen.go", outPkg) - outBuf := bytes.NewBuffer([]byte(fmt.Sprintf( - `// Code generated by "make api"; DO NOT EDIT. -package %s -`, outPkg))) - for _, updateInfo := range funcs { - updateFuncTemplate.Execute(outBuf, struct { - BaseType string - TargetType string - TargetName string - Path string - }{ - BaseType: updateInfo.baseType, - TargetType: updateInfo.targetType, - TargetName: strings.Split(updateInfo.targetType, ".")[strings.Count(updateInfo.targetType, ".")], - Path: updateInfo.path, - }) - } - if err := ioutil.WriteFile(outFile, outBuf.Bytes(), 0644); err != nil { - fmt.Printf("error writing file %q: %v\n", outFile, err) - os.Exit(1) - } - } -} - -var updateFuncTemplate = template.Must(template.New("").Parse( - ` -func (s {{ .BaseType }}) Update{{ .TargetName }}(ctx context.Context, r *{{ .TargetType }}) (*{{ .TargetType }}, *api.Error, error) { - if r == nil { - - } - if r.Id == "" { - return nil, nil, fmt.Errorf("empty {{ .TargetType }} ID field in Create{{ .TargetName }} request") - } - - if s.Client == nil { - return nil, nil, fmt.Errorf("nil client in Create{{ .TargetName }} request") - } - - var opts []api.Option - if s.Scope.Id != "" { - // If it's explicitly set here, override anything that might be in the - // client - opts = append(opts, api.WithScopeId(s.Scope.Id)) - } - - id := r.Id - r.Id = "" - - req, err := s.Client.NewRequest(ctx, "PATCH", fmt.Sprintf("%s/%s", "{{ .Path }}", id), r, opts...) - if err != nil { - return nil, nil, fmt.Errorf("error creating Create{{ .TargetName }} request: %w", err) - } - - resp, err := s.Client.Do(req) - if err != nil { - return nil, nil, fmt.Errorf("error performing client request during Update{{ .TargetName }} call: %w", err) - } - - target := new({{ .TargetType }}) - apiErr, err := resp.Decode(target) - if err != nil { - return nil, nil, fmt.Errorf("error decoding Update{{ .TargetName }} repsonse: %w", err) - } - - {{ if (eq .TargetType "Scope") }} - target.Client = s.Client.Clone() - target.Client.SetScopeId(target.Id) - {{ else }} - target.Client = s.Client - {{ end }} - - return target, apiErr, nil -} -`)) diff --git a/api/internal/tests/detail_template_test.go b/api/internal/tests/detail_template_test.go index 82e69b71f..ace68f64a 100644 --- a/api/internal/tests/detail_template_test.go +++ b/api/internal/tests/detail_template_test.go @@ -1,14 +1,7 @@ package tests -import ( - "testing" - "time" - - "github.com/hashicorp/watchtower/api" - "github.com/hashicorp/watchtower/api/hosts" - "github.com/stretchr/testify/assert" -) - +// TODO: Reenable once we reimplement generation of As functions once static hosts lands +/* func TestDetailTemplating(t *testing.T) { lt := time.Now() c := hosts.HostCatalog{ @@ -32,3 +25,4 @@ func TestDetailTemplating(t *testing.T) { Rotate: api.Bool(true), }, ac) } +*/ diff --git a/api/roles/create.gen.go b/api/roles/create.gen.go deleted file mode 100644 index bca1739a6..000000000 --- a/api/roles/create.gen.go +++ /dev/null @@ -1,42 +0,0 @@ -// Code generated by "make api"; DO NOT EDIT. -package roles - -import ( - "context" - "fmt" - - "github.com/hashicorp/watchtower/api" -) - -func (s Role) CreateRole(ctx context.Context, r *Role) (*Role, *api.Error, error) { - if s.Client == nil { - return nil, nil, fmt.Errorf("nil client in CreateRole request") - } - - var opts []api.Option - if s.Scope.Id != "" { - // If it's explicitly set here, override anything that might be in the - // client - opts = append(opts, api.WithScopeId(s.Scope.Id)) - } - - req, err := s.Client.NewRequest(ctx, "POST", "roles", r, opts...) - if err != nil { - return nil, nil, fmt.Errorf("error creating CreateRole request: %w", err) - } - - resp, err := s.Client.Do(req) - if err != nil { - return nil, nil, fmt.Errorf("error performing client request during CreateRole call: %w", err) - } - - target := new(Role) - apiErr, err := resp.Decode(target) - if err != nil { - return nil, nil, fmt.Errorf("error decoding CreateRole repsonse: %w", err) - } - - target.Client = s.Client - - return target, apiErr, nil -} diff --git a/api/roles/custom.go b/api/roles/custom.go deleted file mode 100644 index 7c78ce5df..000000000 --- a/api/roles/custom.go +++ /dev/null @@ -1,217 +0,0 @@ -package roles - -import ( - "context" - "fmt" - - "github.com/hashicorp/watchtower/api" -) - -func (s Role) AddPrincipals(ctx context.Context, roleId string, principalIds []string) (*Role, *api.Error, error) { - if s.Client == nil { - return nil, nil, fmt.Errorf("nil client in AddPrincipals request") - } - // We assume that the client provided has the org and optionally the project id of the request. - - body := map[string]interface{}{ - "version": s.Version, - } - if len(principalIds) > 0 { - body["principal_ids"] = principalIds - } - - req, err := s.Client.NewRequest(ctx, "POST", fmt.Sprintf("roles/%s:add-principals", roleId), body) - if err != nil { - return nil, nil, fmt.Errorf("error creating AddPrincipals request: %w", err) - } - - resp, err := s.Client.Do(req) - if err != nil { - return nil, nil, fmt.Errorf("error performing client request during AddPrincipals call: %w", err) - } - - target := new(Role) - apiErr, err := resp.Decode(target) - if err != nil { - return nil, nil, fmt.Errorf("error decoding AddPrincipals repsonse: %w", err) - } - - target.Client = s.Client - - return target, apiErr, nil -} - -func (s Role) SetPrincipals(ctx context.Context, roleId string, principalIds []string) (*Role, *api.Error, error) { - if s.Client == nil { - return nil, nil, fmt.Errorf("nil client in SetPrincipals request") - } - // We assume that the client provided has the org and optionally the project id of the request. - - body := map[string]interface{}{ - "version": s.Version, - } - if len(principalIds) > 0 { - body["principal_ids"] = principalIds - } else if principalIds != nil { - // In this function, a non-nil but empty list means clear out - body["principal_ids"] = nil - } - - req, err := s.Client.NewRequest(ctx, "POST", fmt.Sprintf("roles/%s:set-principals", roleId), body) - if err != nil { - return nil, nil, fmt.Errorf("error creating SetPrincipals request: %w", err) - } - - resp, err := s.Client.Do(req) - if err != nil { - return nil, nil, fmt.Errorf("error performing client request during SetPrincipals call: %w", err) - } - - target := new(Role) - apiErr, err := resp.Decode(target) - if err != nil { - return nil, nil, fmt.Errorf("error decoding SetPrincipals repsonse: %w", err) - } - - target.Client = s.Client - - return target, apiErr, nil -} - -func (s Role) RemovePrincipals(ctx context.Context, roleId string, principalIds []string) (*Role, *api.Error, error) { - if s.Client == nil { - return nil, nil, fmt.Errorf("nil client in RemovePrincipals request") - } - // We assume that the client provided has the org and optionally the project id of the request. - - body := map[string]interface{}{ - "version": s.Version, - } - if len(principalIds) > 0 { - body["principal_ids"] = principalIds - } - - req, err := s.Client.NewRequest(ctx, "POST", fmt.Sprintf("roles/%s:remove-principals", roleId), body) - if err != nil { - return nil, nil, fmt.Errorf("error creating RemovePrincipals request: %w", err) - } - - resp, err := s.Client.Do(req) - if err != nil { - return nil, nil, fmt.Errorf("error performing client request during RemovePrincipals call: %w", err) - } - - target := new(Role) - apiErr, err := resp.Decode(target) - if err != nil { - return nil, nil, fmt.Errorf("error decoding RemovePrincipals repsonse: %w", err) - } - - target.Client = s.Client - - return target, apiErr, nil -} - -func (s Role) AddGrants(ctx context.Context, roleId string, grants []string) (*Role, *api.Error, error) { - if s.Client == nil { - return nil, nil, fmt.Errorf("nil client in AddGrants request") - } - // We assume that the client provided has the org and optionally the project id of the request. - - body := map[string]interface{}{ - "version": s.Version, - } - if len(grants) > 0 { - body["grant_strings"] = grants - } - - req, err := s.Client.NewRequest(ctx, "POST", fmt.Sprintf("roles/%s:add-grants", roleId), body) - if err != nil { - return nil, nil, fmt.Errorf("error creating AddGrants request: %w", err) - } - - resp, err := s.Client.Do(req) - if err != nil { - return nil, nil, fmt.Errorf("error performing client request during AddGrants call: %w", err) - } - - target := new(Role) - apiErr, err := resp.Decode(target) - if err != nil { - return nil, nil, fmt.Errorf("error decoding AddGrants repsonse: %w", err) - } - - target.Client = s.Client - - return target, apiErr, nil -} - -func (s Role) SetGrants(ctx context.Context, roleId string, grants []string) (*Role, *api.Error, error) { - if s.Client == nil { - return nil, nil, fmt.Errorf("nil client in SetGrants request") - } - // We assume that the client provided has the org and optionally the project id of the request. - - body := map[string]interface{}{ - "version": s.Version, - } - if len(grants) > 0 { - body["grant_strings"] = grants - } else if grants != nil { - body["grant_strings"] = nil - } - - req, err := s.Client.NewRequest(ctx, "POST", fmt.Sprintf("roles/%s:set-grants", roleId), body) - if err != nil { - return nil, nil, fmt.Errorf("error creating SetGrants request: %w", err) - } - - resp, err := s.Client.Do(req) - if err != nil { - return nil, nil, fmt.Errorf("error performing client request during SetGrants call: %w", err) - } - - target := new(Role) - apiErr, err := resp.Decode(target) - if err != nil { - return nil, nil, fmt.Errorf("error decoding SetGrants repsonse: %w", err) - } - - target.Client = s.Client - - return target, apiErr, nil -} - -func (s Role) RemoveGrants(ctx context.Context, roleId string, grants []string) (*Role, *api.Error, error) { - if s.Client == nil { - return nil, nil, fmt.Errorf("nil client in RemoveGrants request") - } - // We assume that the client provided has the org and optionally the project id of the request. - - body := map[string]interface{}{ - "version": s.Version, - } - if len(grants) > 0 { - body["grant_strings"] = grants - } - - req, err := s.Client.NewRequest(ctx, "POST", fmt.Sprintf("roles/%s:remove-grants", roleId), body) - if err != nil { - return nil, nil, fmt.Errorf("error creating RemoveGrants request: %w", err) - } - - resp, err := s.Client.Do(req) - if err != nil { - return nil, nil, fmt.Errorf("error performing client request during RemoveGrants call: %w", err) - } - - target := new(Role) - apiErr, err := resp.Decode(target) - if err != nil { - return nil, nil, fmt.Errorf("error decoding RemoveGrants repsonse: %w", err) - } - - target.Client = s.Client - - return target, apiErr, nil -} diff --git a/api/roles/delete.gen.go b/api/roles/delete.gen.go deleted file mode 100644 index 5be578a7e..000000000 --- a/api/roles/delete.gen.go +++ /dev/null @@ -1,49 +0,0 @@ -// Code generated by "make api"; DO NOT EDIT. -package roles - -import ( - "context" - "fmt" - - "github.com/hashicorp/watchtower/api" -) - -// DeleteRole returns true iff the Role existed when the delete attempt was made. -func (s Role) DeleteRole(ctx context.Context, id string) (bool, *api.Error, error) { - if id == "" { - return false, nil, fmt.Errorf("empty id provided to DeleteRole request") - } - - if s.Client == nil { - return false, nil, fmt.Errorf("nil client in DeleteRole request") - } - - var opts []api.Option - if s.Scope.Id != "" { - // If it's explicitly set here, override anything that might be in the - // client - opts = append(opts, api.WithScopeId(s.Scope.Id)) - } - - req, err := s.Client.NewRequest(ctx, "DELETE", fmt.Sprintf("%s/%s", "roles", id), nil, opts...) - if err != nil { - return false, nil, fmt.Errorf("error creating DeleteRole request: %w", err) - } - - resp, err := s.Client.Do(req) - if err != nil { - return false, nil, fmt.Errorf("error performing client request during DeleteRole call: %w", err) - } - - type deleteResponse struct { - Existed bool - } - target := &deleteResponse{} - - apiErr, err := resp.Decode(target) - if err != nil { - return false, nil, fmt.Errorf("error decoding DeleteRole repsonse: %w", err) - } - - return target.Existed, apiErr, nil -} diff --git a/api/roles/grant.gen.go b/api/roles/grant.gen.go index 02e7d06be..79da581f7 100644 --- a/api/roles/grant.gen.go +++ b/api/roles/grant.gen.go @@ -2,14 +2,7 @@ package roles type Grant struct { - - // The original user-supplied string. - // Output only. - Raw string `json:"raw,omitempty"` - // The canonically formatted string. - // Output only. - Canonical string `json:"canonical,omitempty"` - // The JSON representation of the grant. - // Output only. - Json *GrantJson `json:"json,omitempty"` + Raw string `json:"raw,omitempty"` + Canonical string `json:"canonical,omitempty"` + Json *GrantJson `json:"json,omitempty"` } diff --git a/api/roles/grant_json.gen.go b/api/roles/grant_json.gen.go index a84586325..310a1d0d2 100644 --- a/api/roles/grant_json.gen.go +++ b/api/roles/grant_json.gen.go @@ -2,14 +2,7 @@ package roles type GrantJson struct { - - // The ID, if set. - // Output only. - Id string `json:"id,omitempty"` - // The type, if set. - // Output only. - Type string `json:"type,omitempty"` - // The actions. - // Output only. + Id string `json:"id,omitempty"` + Type string `json:"type,omitempty"` Actions []string `json:"actions,omitempty"` } diff --git a/api/roles/list.gen.go b/api/roles/list.gen.go deleted file mode 100644 index f854c0c65..000000000 --- a/api/roles/list.gen.go +++ /dev/null @@ -1,50 +0,0 @@ -// Code generated by "make api"; DO NOT EDIT. -package roles - -import ( - "context" - "fmt" - - "github.com/hashicorp/watchtower/api" -) - -func (s Role) ListRoles(ctx context.Context) ([]*Role, *api.Error, error) { - if s.Client == nil { - return nil, nil, fmt.Errorf("nil client in ListRole request") - } - - var opts []api.Option - if s.Scope.Id != "" { - // If it's explicitly set here, override anything that might be in the - // client - opts = append(opts, api.WithScopeId(s.Scope.Id)) - } - - req, err := s.Client.NewRequest(ctx, "GET", "roles", nil, opts...) - if err != nil { - return nil, nil, fmt.Errorf("error creating ListRoles request: %w", err) - } - - resp, err := s.Client.Do(req) - if err != nil { - return nil, nil, fmt.Errorf("error performing client request during ListRoles call: %w", err) - } - - type listResponse struct { - Items []*Role - } - target := &listResponse{} - - apiErr, err := resp.Decode(target) - if err != nil { - return nil, nil, fmt.Errorf("error decoding ListRoles response: %w", err) - } - - for _, t := range target.Items { - - t.Client = s.Client - - } - - return target.Items, apiErr, nil -} diff --git a/api/roles/option.gen.go b/api/roles/option.gen.go new file mode 100644 index 000000000..138fed101 --- /dev/null +++ b/api/roles/option.gen.go @@ -0,0 +1,102 @@ +package roles + +import ( + "github.com/hashicorp/watchtower/api" +) + +// Option is a func that sets optional attributes for a call. This does not need +// to be used directly, but instead option arguments are built from the +// functions in this package. WithX options set a value to that given in the +// argument; DefaultX options indicate that the value should be set to its +// default. When an API call is made options are processed in ther order they +// appear in the function call, so for a given argument X, a succession of WithX +// or DefaultX calls will result in the last call taking effect. +type Option func(*options) + +type options struct { + valueMap map[string]interface{} + withScopeId string + withAutomaticVersioning bool +} + +func getDefaultOptions() options { + return options{ + valueMap: make(map[string]interface{}), + } +} + +func getOpts(opt ...Option) (options, []api.Option) { + opts := getDefaultOptions() + for _, o := range opt { + o(&opts) + } + var apiOpts []api.Option + if opts.withScopeId != "" { + apiOpts = append(apiOpts, api.WithScopeId(opts.withScopeId)) + } + return opts, apiOpts +} + +func WithScopeId(id string) Option { + return func(o *options) { + o.withScopeId = id + } +} + +// If set, and if the version is zero during an update, the API will perform a +// fetch to get the current version of the resource and populate it during the +// update call. This is convenient but opens up the possibility for subtle +// order-of-modification issues, so use carefully. +func WithAutomaticVersioning() Option { + return func(o *options) { + o.withAutomaticVersioning = true + } +} + +func WithDescription(inDescription string) Option { + return func(o *options) { + o.valueMap["description"] = inDescription + } +} + +func DefaultDescription() Option { + return func(o *options) { + o.valueMap["description"] = nil + } +} + +func WithDisabled(inDisabled bool) Option { + return func(o *options) { + o.valueMap["disabled"] = inDisabled + } +} + +func DefaultDisabled() Option { + return func(o *options) { + o.valueMap["disabled"] = nil + } +} + +func WithGrantScopeId(inGrantScopeId string) Option { + return func(o *options) { + o.valueMap["grant_scope_id"] = inGrantScopeId + } +} + +func DefaultGrantScopeId() Option { + return func(o *options) { + o.valueMap["grant_scope_id"] = nil + } +} + +func WithName(inName string) Option { + return func(o *options) { + o.valueMap["name"] = inName + } +} + +func DefaultName() Option { + return func(o *options) { + o.valueMap["name"] = nil + } +} diff --git a/api/roles/principal.gen.go b/api/roles/principal.gen.go index 961b1bbba..9419e507e 100644 --- a/api/roles/principal.gen.go +++ b/api/roles/principal.gen.go @@ -2,14 +2,7 @@ package roles type Principal struct { - - // The ID of the principal. - // Output only. - Id string `json:"id,omitempty"` - // The type of the principal. - // Output only. - Type string `json:"type,omitempty"` - // The scope ID of the principal. - // Output only. + Id string `json:"id,omitempty"` + Type string `json:"type,omitempty"` ScopeId string `json:"scope_id,omitempty"` } diff --git a/api/roles/read.gen.go b/api/roles/read.gen.go deleted file mode 100644 index 655ed57e6..000000000 --- a/api/roles/read.gen.go +++ /dev/null @@ -1,46 +0,0 @@ -// Code generated by "make api"; DO NOT EDIT. -package roles - -import ( - "context" - "fmt" - - "github.com/hashicorp/watchtower/api" -) - -func (s Role) ReadRole(ctx context.Context, id string) (*Role, *api.Error, error) { - if id == "" { - return nil, nil, fmt.Errorf("empty ID value passed into ReadRole request") - } - - if s.Client == nil { - return nil, nil, fmt.Errorf("nil client in ReadRole request") - } - - var opts []api.Option - if s.Scope.Id != "" { - // If it's explicitly set here, override anything that might be in the - // client - opts = append(opts, api.WithScopeId(s.Scope.Id)) - } - - req, err := s.Client.NewRequest(ctx, "GET", fmt.Sprintf("%s/%s", "roles", id), nil, opts...) - if err != nil { - return nil, nil, fmt.Errorf("error creating ReadRole request: %w", err) - } - - resp, err := s.Client.Do(req) - if err != nil { - return nil, nil, fmt.Errorf("error performing client request during ReadRole call: %w", err) - } - - target := new(Role) - apiErr, err := resp.Decode(target) - if err != nil { - return nil, nil, fmt.Errorf("error decoding ReadRole repsonse: %w", err) - } - - target.Client = s.Client - - return target, apiErr, nil -} diff --git a/api/roles/role.gen.go b/api/roles/role.gen.go index 542bdc42d..6e4d4ef0b 100644 --- a/api/roles/role.gen.go +++ b/api/roles/role.gen.go @@ -2,93 +2,514 @@ package roles import ( - "encoding/json" - "strings" + "context" + "errors" + "fmt" "time" - "github.com/fatih/structs" + "github.com/kr/pretty" "github.com/hashicorp/watchtower/api" - "github.com/hashicorp/watchtower/api/info" - "github.com/hashicorp/watchtower/api/internal/strutil" + "github.com/hashicorp/watchtower/api/scopes" ) type Role struct { - Client *api.Client `json:"-"` - - defaultFields []string - - // The ID of the Role - // Output only. - Id string `json:"id,omitempty"` - // Scope information for this resource - // Output only. - Scope info.Scope `json:"scope,omitempty"` - // Optional name for identification purposes - Name *string `json:"name,omitempty"` - // Optional user-set description for identification purposes - Description *string `json:"description,omitempty"` - // The time this resource was created - // Output only. - CreatedTime time.Time `json:"created_time,omitempty"` - // The time this resource was last updated. - // Output only. - UpdatedTime time.Time `json:"updated_time,omitempty"` - // Whether the resource is disabled - Disabled *bool `json:"disabled,omitempty"` - // The scope the grants will apply to. If the role is at the global scope, - // this can be an org or project. If the role is at an org - // scope, this can be a project within the org. It is invalid for - // this to be anything other than the role's scope when the role's scope is - // a project. - GrantScopeId *string `json:"grant_scope_id,omitempty"` - // The version can be used in subsiquent write requests to ensure this resource - // has not changed and to fail the write if it has. - // Output only. - Version uint32 `json:"version,omitempty"` - // The IDs (only) of principals that are assigned to this role. - // Output only. - PrincipalIds []string `json:"principal_ids,omitempty"` - // The principals that are assigned to this role. - // Output only. - Principals []*Principal `json:"principals,omitempty"` - // The grants that this role provides for its principals. - // Output only. - GrantStrings []string `json:"grant_strings,omitempty"` - // The parsed grant information. - // Output only. - Grants []*Grant `json:"grants,omitempty"` + Id string `json:"id,omitempty"` + Scope *scopes.ScopeInfo `json:"scope,omitempty"` + Name string `json:"name,omitempty"` + Description string `json:"description,omitempty"` + CreatedTime time.Time `json:"created_time,omitempty"` + UpdatedTime time.Time `json:"updated_time,omitempty"` + Disabled bool `json:"disabled,omitempty"` + GrantScopeId string `json:"grant_scope_id,omitempty"` + Version uint32 `json:"version,omitempty"` + PrincipalIds []string `json:"principal_ids,omitempty"` + Principals []*Principal `json:"principals,omitempty"` + GrantStrings []string `json:"grant_strings,omitempty"` + Grants []*Grant `json:"grants,omitempty"` } -func (s *Role) SetDefault(key string) { - lowerKey := strings.ToLower(key) - validMap := map[string]string{"createdtime": "created_time", "description": "description", "disabled": "disabled", "grants": "grants", "grantscopeid": "grant_scope_id", "grantstrings": "grant_strings", "id": "id", "name": "name", "principalids": "principal_ids", "principals": "principals", "scope": "scope", "updatedtime": "updated_time", "version": "version"} - for k, v := range validMap { - if k == lowerKey || v == lowerKey { - s.defaultFields = strutil.AppendIfMissing(s.defaultFields, v) - return +type roleClient struct { + client *api.Client +} + +func NewRoleClient(c *api.Client) *roleClient { + return &roleClient{client: c} +} + +func (c *roleClient) Create(ctx context.Context, opt ...Option) (*Role, *api.Error, error) { + if c.client == nil { + return nil, nil, fmt.Errorf("nil client") + } + + opts, apiOpts := getOpts(opt...) + + req, err := c.client.NewRequest(ctx, "POST", fmt.Sprintf("roles"), opts.valueMap, apiOpts...) + if err != nil { + return nil, nil, fmt.Errorf("error creating Create request: %w", err) + } + + resp, err := c.client.Do(req) + if err != nil { + return nil, nil, fmt.Errorf("error performing client request during Create call: %w", err) + } + + target := new(Role) + apiErr, err := resp.Decode(target) + if err != nil { + return nil, nil, fmt.Errorf("error decoding Create response: %w", err) + } + + return target, apiErr, nil +} + +func (c *roleClient) Read(ctx context.Context, roleId string, opt ...Option) (*Role, *api.Error, error) { + if roleId == "" { + return nil, nil, fmt.Errorf("empty roleId value passed into Read request") + } + + if c.client == nil { + return nil, nil, fmt.Errorf("nil client") + } + + _, apiOpts := getOpts(opt...) + + req, err := c.client.NewRequest(ctx, "GET", fmt.Sprintf("roles/%s", roleId), nil, apiOpts...) + if err != nil { + return nil, nil, fmt.Errorf("error creating Read request: %w", err) + } + + resp, err := c.client.Do(req) + if err != nil { + return nil, nil, fmt.Errorf("error performing client request during Read call: %w", err) + } + + target := new(Role) + apiErr, err := resp.Decode(target) + if err != nil { + return nil, nil, fmt.Errorf("error decoding Read response: %w", err) + } + + return target, apiErr, nil +} + +func (c *roleClient) Update(ctx context.Context, roleId string, version uint32, opt ...Option) (*Role, *api.Error, error) { + if roleId == "" { + return nil, nil, fmt.Errorf("empty roleId value passed into Update request") + } + if c.client == nil { + return nil, nil, fmt.Errorf("nil client") + } + + opts, apiOpts := getOpts(opt...) + + if version == 0 { + if !opts.withAutomaticVersioning { + return nil, nil, errors.New("zero version number passed into Update request and automatic versioning not specified") } - } -} - -func (s *Role) UnsetDefault(key string) { - lowerKey := strings.ToLower(key) - validMap := map[string]string{"createdtime": "created_time", "description": "description", "disabled": "disabled", "grants": "grants", "grantscopeid": "grant_scope_id", "grantstrings": "grant_strings", "id": "id", "name": "name", "principalids": "principal_ids", "principals": "principals", "scope": "scope", "updatedtime": "updated_time", "version": "version"} - for k, v := range validMap { - if k == lowerKey || v == lowerKey { - s.defaultFields = strutil.StrListDelete(s.defaultFields, v) - return + existingTarget, existingApiErr, existingErr := c.Read(ctx, roleId, opt...) + if existingErr != nil { + return nil, nil, fmt.Errorf("error performing initial check-and-set read: %w", existingErr) } + if existingApiErr != nil { + return nil, nil, fmt.Errorf("error from controller when performing initial check-and-set read: %s", pretty.Sprint(existingApiErr)) + } + if existingTarget == nil { + return nil, nil, errors.New("nil resource found when performing initial check-and-set read") + } + version = existingTarget.Version } + opts.valueMap["version"] = version + + req, err := c.client.NewRequest(ctx, "PATCH", fmt.Sprintf("roles/%s", roleId), opts.valueMap, apiOpts...) + if err != nil { + return nil, nil, fmt.Errorf("error creating Update request: %w", err) + } + + resp, err := c.client.Do(req) + if err != nil { + return nil, nil, fmt.Errorf("error performing client request during Update call: %w", err) + } + + target := new(Role) + apiErr, err := resp.Decode(target) + if err != nil { + return nil, nil, fmt.Errorf("error decoding Update response: %w", err) + } + + return target, apiErr, nil } -func (s Role) MarshalJSON() ([]byte, error) { - m := structs.Map(s) - if m == nil { - m = make(map[string]interface{}) +func (c *roleClient) Delete(ctx context.Context, roleId string, opt ...Option) (bool, *api.Error, error) { + if roleId == "" { + return false, nil, fmt.Errorf("empty roleId value passed into Delete request") } - for _, k := range s.defaultFields { - m[k] = nil + + if c.client == nil { + return false, nil, fmt.Errorf("nil client") } - return json.Marshal(m) + + _, apiOpts := getOpts(opt...) + + req, err := c.client.NewRequest(ctx, "DELETE", fmt.Sprintf("roles/%s", roleId), nil, apiOpts...) + if err != nil { + return false, nil, fmt.Errorf("error creating Delete request: %w", err) + } + + resp, err := c.client.Do(req) + if err != nil { + return false, nil, fmt.Errorf("error performing client request during Delete call: %w", err) + } + + type deleteResponse struct { + Existed bool + } + target := &deleteResponse{} + apiErr, err := resp.Decode(target) + if err != nil { + return false, nil, fmt.Errorf("error decoding Delete response: %w", err) + } + + return target.Existed, apiErr, nil +} + +func (c *roleClient) List(ctx context.Context, opt ...Option) ([]*Role, *api.Error, error) { + if c.client == nil { + return nil, nil, fmt.Errorf("nil client") + } + + _, apiOpts := getOpts(opt...) + + req, err := c.client.NewRequest(ctx, "GET", fmt.Sprintf("roles"), nil, apiOpts...) + if err != nil { + return nil, nil, fmt.Errorf("error creating List request: %w", err) + } + + resp, err := c.client.Do(req) + if err != nil { + return nil, nil, fmt.Errorf("error performing client request during List call: %w", err) + } + + type listResponse struct { + Items []*Role + } + target := &listResponse{} + apiErr, err := resp.Decode(target) + if err != nil { + return nil, nil, fmt.Errorf("error decoding List response: %w", err) + } + + return target.Items, apiErr, nil +} + +func (c *roleClient) AddGrants(ctx context.Context, roleId string, version uint32, grantStrings []string, opt ...Option) (*Role, *api.Error, error) { + if roleId == "" { + return nil, nil, fmt.Errorf("empty roleId value passed into AddGrants request") + } + if c.client == nil { + return nil, nil, fmt.Errorf("nil client") + } + + opts, apiOpts := getOpts(opt...) + + if version == 0 { + if !opts.withAutomaticVersioning { + return nil, nil, errors.New("zero version number passed into AddGrants request") + } + existingTarget, existingApiErr, existingErr := c.Read(ctx, roleId, opt...) + if existingErr != nil { + return nil, nil, fmt.Errorf("error performing initial check-and-set read: %w", existingErr) + } + if existingApiErr != nil { + return nil, nil, fmt.Errorf("error from controller when performing initial check-and-set read: %s", pretty.Sprint(existingApiErr)) + } + if existingTarget == nil { + return nil, nil, errors.New("nil resource found when performing initial check-and-set read") + } + version = existingTarget.Version + } + opts.valueMap["version"] = version + + if len(grantStrings) > 0 { + opts.valueMap["grant_strings"] = grantStrings + } + + req, err := c.client.NewRequest(ctx, "POST", fmt.Sprintf("roles/%s:add-grants", roleId), opts.valueMap, apiOpts...) + if err != nil { + return nil, nil, fmt.Errorf("error creating AddGrants request: %w", err) + } + + resp, err := c.client.Do(req) + if err != nil { + return nil, nil, fmt.Errorf("error performing client request during AddGrants call: %w", err) + } + + target := new(Role) + apiErr, err := resp.Decode(target) + if err != nil { + return nil, nil, fmt.Errorf("error decoding AddGrants response: %w", err) + } + + return target, apiErr, nil +} + +func (c *roleClient) AddPrincipals(ctx context.Context, roleId string, version uint32, principalIds []string, opt ...Option) (*Role, *api.Error, error) { + if roleId == "" { + return nil, nil, fmt.Errorf("empty roleId value passed into AddPrincipals request") + } + if c.client == nil { + return nil, nil, fmt.Errorf("nil client") + } + + opts, apiOpts := getOpts(opt...) + + if version == 0 { + if !opts.withAutomaticVersioning { + return nil, nil, errors.New("zero version number passed into AddPrincipals request") + } + existingTarget, existingApiErr, existingErr := c.Read(ctx, roleId, opt...) + if existingErr != nil { + return nil, nil, fmt.Errorf("error performing initial check-and-set read: %w", existingErr) + } + if existingApiErr != nil { + return nil, nil, fmt.Errorf("error from controller when performing initial check-and-set read: %s", pretty.Sprint(existingApiErr)) + } + if existingTarget == nil { + return nil, nil, errors.New("nil resource found when performing initial check-and-set read") + } + version = existingTarget.Version + } + opts.valueMap["version"] = version + + if len(principalIds) > 0 { + opts.valueMap["principal_ids"] = principalIds + } + + req, err := c.client.NewRequest(ctx, "POST", fmt.Sprintf("roles/%s:add-principals", roleId), opts.valueMap, apiOpts...) + if err != nil { + return nil, nil, fmt.Errorf("error creating AddPrincipals request: %w", err) + } + + resp, err := c.client.Do(req) + if err != nil { + return nil, nil, fmt.Errorf("error performing client request during AddPrincipals call: %w", err) + } + + target := new(Role) + apiErr, err := resp.Decode(target) + if err != nil { + return nil, nil, fmt.Errorf("error decoding AddPrincipals response: %w", err) + } + + return target, apiErr, nil +} + +func (c *roleClient) SetGrants(ctx context.Context, roleId string, version uint32, grantStrings []string, opt ...Option) (*Role, *api.Error, error) { + if roleId == "" { + return nil, nil, fmt.Errorf("empty roleId value passed into SetGrants request") + } + if c.client == nil { + return nil, nil, fmt.Errorf("nil client") + } + + opts, apiOpts := getOpts(opt...) + + if version == 0 { + if !opts.withAutomaticVersioning { + return nil, nil, errors.New("zero version number passed into SetGrants request") + } + existingTarget, existingApiErr, existingErr := c.Read(ctx, roleId, opt...) + if existingErr != nil { + return nil, nil, fmt.Errorf("error performing initial check-and-set read: %w", existingErr) + } + if existingApiErr != nil { + return nil, nil, fmt.Errorf("error from controller when performing initial check-and-set read: %s", pretty.Sprint(existingApiErr)) + } + if existingTarget == nil { + return nil, nil, errors.New("nil resource found when performing initial check-and-set read") + } + version = existingTarget.Version + } + opts.valueMap["version"] = version + + if len(grantStrings) > 0 { + opts.valueMap["grant_strings"] = grantStrings + } else if grantStrings != nil { + // In this function, a non-nil but empty list means clear out + opts.valueMap["grant_strings"] = nil + } + + req, err := c.client.NewRequest(ctx, "POST", fmt.Sprintf("roles/%s:set-grants", roleId), opts.valueMap, apiOpts...) + if err != nil { + return nil, nil, fmt.Errorf("error creating SetGrants request: %w", err) + } + + resp, err := c.client.Do(req) + if err != nil { + return nil, nil, fmt.Errorf("error performing client request during SetGrants call: %w", err) + } + + target := new(Role) + apiErr, err := resp.Decode(target) + if err != nil { + return nil, nil, fmt.Errorf("error decoding SetGrants response: %w", err) + } + + return target, apiErr, nil +} + +func (c *roleClient) SetPrincipals(ctx context.Context, roleId string, version uint32, principalIds []string, opt ...Option) (*Role, *api.Error, error) { + if roleId == "" { + return nil, nil, fmt.Errorf("empty roleId value passed into SetPrincipals request") + } + if c.client == nil { + return nil, nil, fmt.Errorf("nil client") + } + + opts, apiOpts := getOpts(opt...) + + if version == 0 { + if !opts.withAutomaticVersioning { + return nil, nil, errors.New("zero version number passed into SetPrincipals request") + } + existingTarget, existingApiErr, existingErr := c.Read(ctx, roleId, opt...) + if existingErr != nil { + return nil, nil, fmt.Errorf("error performing initial check-and-set read: %w", existingErr) + } + if existingApiErr != nil { + return nil, nil, fmt.Errorf("error from controller when performing initial check-and-set read: %s", pretty.Sprint(existingApiErr)) + } + if existingTarget == nil { + return nil, nil, errors.New("nil resource found when performing initial check-and-set read") + } + version = existingTarget.Version + } + opts.valueMap["version"] = version + + if len(principalIds) > 0 { + opts.valueMap["principal_ids"] = principalIds + } else if principalIds != nil { + // In this function, a non-nil but empty list means clear out + opts.valueMap["principal_ids"] = nil + } + + req, err := c.client.NewRequest(ctx, "POST", fmt.Sprintf("roles/%s:set-principals", roleId), opts.valueMap, apiOpts...) + if err != nil { + return nil, nil, fmt.Errorf("error creating SetPrincipals request: %w", err) + } + + resp, err := c.client.Do(req) + if err != nil { + return nil, nil, fmt.Errorf("error performing client request during SetPrincipals call: %w", err) + } + + target := new(Role) + apiErr, err := resp.Decode(target) + if err != nil { + return nil, nil, fmt.Errorf("error decoding SetPrincipals response: %w", err) + } + + return target, apiErr, nil +} + +func (c *roleClient) RemoveGrants(ctx context.Context, roleId string, version uint32, grantStrings []string, opt ...Option) (*Role, *api.Error, error) { + if roleId == "" { + return nil, nil, fmt.Errorf("empty roleId value passed into RemoveGrants request") + } + if c.client == nil { + return nil, nil, fmt.Errorf("nil client") + } + + opts, apiOpts := getOpts(opt...) + + if version == 0 { + if !opts.withAutomaticVersioning { + return nil, nil, errors.New("zero version number passed into RemoveGrants request") + } + existingTarget, existingApiErr, existingErr := c.Read(ctx, roleId, opt...) + if existingErr != nil { + return nil, nil, fmt.Errorf("error performing initial check-and-set read: %w", existingErr) + } + if existingApiErr != nil { + return nil, nil, fmt.Errorf("error from controller when performing initial check-and-set read: %s", pretty.Sprint(existingApiErr)) + } + if existingTarget == nil { + return nil, nil, errors.New("nil resource found when performing initial check-and-set read") + } + version = existingTarget.Version + } + opts.valueMap["version"] = version + + if len(grantStrings) > 0 { + opts.valueMap["grant_strings"] = grantStrings + } + + req, err := c.client.NewRequest(ctx, "POST", fmt.Sprintf("roles/%s:remove-grants", roleId), opts.valueMap, apiOpts...) + if err != nil { + return nil, nil, fmt.Errorf("error creating RemoveGrants request: %w", err) + } + + resp, err := c.client.Do(req) + if err != nil { + return nil, nil, fmt.Errorf("error performing client request during RemoveGrants call: %w", err) + } + + target := new(Role) + apiErr, err := resp.Decode(target) + if err != nil { + return nil, nil, fmt.Errorf("error decoding RemoveGrants response: %w", err) + } + + return target, apiErr, nil +} + +func (c *roleClient) RemovePrincipals(ctx context.Context, roleId string, version uint32, principalIds []string, opt ...Option) (*Role, *api.Error, error) { + if roleId == "" { + return nil, nil, fmt.Errorf("empty roleId value passed into RemovePrincipals request") + } + if c.client == nil { + return nil, nil, fmt.Errorf("nil client") + } + + opts, apiOpts := getOpts(opt...) + + if version == 0 { + if !opts.withAutomaticVersioning { + return nil, nil, errors.New("zero version number passed into RemovePrincipals request") + } + existingTarget, existingApiErr, existingErr := c.Read(ctx, roleId, opt...) + if existingErr != nil { + return nil, nil, fmt.Errorf("error performing initial check-and-set read: %w", existingErr) + } + if existingApiErr != nil { + return nil, nil, fmt.Errorf("error from controller when performing initial check-and-set read: %s", pretty.Sprint(existingApiErr)) + } + if existingTarget == nil { + return nil, nil, errors.New("nil resource found when performing initial check-and-set read") + } + version = existingTarget.Version + } + opts.valueMap["version"] = version + + if len(principalIds) > 0 { + opts.valueMap["principal_ids"] = principalIds + } + + req, err := c.client.NewRequest(ctx, "POST", fmt.Sprintf("roles/%s:remove-principals", roleId), opts.valueMap, apiOpts...) + if err != nil { + return nil, nil, fmt.Errorf("error creating RemovePrincipals request: %w", err) + } + + resp, err := c.client.Do(req) + if err != nil { + return nil, nil, fmt.Errorf("error performing client request during RemovePrincipals call: %w", err) + } + + target := new(Role) + apiErr, err := resp.Decode(target) + if err != nil { + return nil, nil, fmt.Errorf("error decoding RemovePrincipals response: %w", err) + } + + return target, apiErr, nil } diff --git a/api/roles/update.gen.go b/api/roles/update.gen.go deleted file mode 100644 index 2b41e3878..000000000 --- a/api/roles/update.gen.go +++ /dev/null @@ -1,52 +0,0 @@ -// Code generated by "make api"; DO NOT EDIT. -package roles - -import ( - "context" - "fmt" - - "github.com/hashicorp/watchtower/api" -) - -func (s Role) UpdateRole(ctx context.Context, r *Role) (*Role, *api.Error, error) { - if r == nil { - - } - if r.Id == "" { - return nil, nil, fmt.Errorf("empty Role ID field in CreateRole request") - } - - if s.Client == nil { - return nil, nil, fmt.Errorf("nil client in CreateRole request") - } - - var opts []api.Option - if s.Scope.Id != "" { - // If it's explicitly set here, override anything that might be in the - // client - opts = append(opts, api.WithScopeId(s.Scope.Id)) - } - - id := r.Id - r.Id = "" - - req, err := s.Client.NewRequest(ctx, "PATCH", fmt.Sprintf("%s/%s", "roles", id), r, opts...) - if err != nil { - return nil, nil, fmt.Errorf("error creating CreateRole request: %w", err) - } - - resp, err := s.Client.Do(req) - if err != nil { - return nil, nil, fmt.Errorf("error performing client request during UpdateRole call: %w", err) - } - - target := new(Role) - apiErr, err := resp.Decode(target) - if err != nil { - return nil, nil, fmt.Errorf("error decoding UpdateRole repsonse: %w", err) - } - - target.Client = s.Client - - return target, apiErr, nil -} diff --git a/api/scopes/create.gen.go b/api/scopes/create.gen.go deleted file mode 100644 index 867113cce..000000000 --- a/api/scopes/create.gen.go +++ /dev/null @@ -1,43 +0,0 @@ -// Code generated by "make api"; DO NOT EDIT. -package scopes - -import ( - "context" - "fmt" - - "github.com/hashicorp/watchtower/api" -) - -func (s Scope) CreateScope(ctx context.Context, r *Scope) (*Scope, *api.Error, error) { - if s.Client == nil { - return nil, nil, fmt.Errorf("nil client in CreateScope request") - } - - var opts []api.Option - if s.Scope.Id != "" { - // If it's explicitly set here, override anything that might be in the - // client - opts = append(opts, api.WithScopeId(s.Scope.Id)) - } - - req, err := s.Client.NewRequest(ctx, "POST", "scopes", r, opts...) - if err != nil { - return nil, nil, fmt.Errorf("error creating CreateScope request: %w", err) - } - - resp, err := s.Client.Do(req) - if err != nil { - return nil, nil, fmt.Errorf("error performing client request during CreateScope call: %w", err) - } - - target := new(Scope) - apiErr, err := resp.Decode(target) - if err != nil { - return nil, nil, fmt.Errorf("error decoding CreateScope repsonse: %w", err) - } - - target.Client = s.Client.Clone() - target.Client.SetScopeId(target.Id) - - return target, apiErr, nil -} diff --git a/api/scopes/delete.gen.go b/api/scopes/delete.gen.go deleted file mode 100644 index 5b04911d9..000000000 --- a/api/scopes/delete.gen.go +++ /dev/null @@ -1,49 +0,0 @@ -// Code generated by "make api"; DO NOT EDIT. -package scopes - -import ( - "context" - "fmt" - - "github.com/hashicorp/watchtower/api" -) - -// DeleteScope returns true iff the Scope existed when the delete attempt was made. -func (s Scope) DeleteScope(ctx context.Context, id string) (bool, *api.Error, error) { - if id == "" { - return false, nil, fmt.Errorf("empty id provided to DeleteScope request") - } - - if s.Client == nil { - return false, nil, fmt.Errorf("nil client in DeleteScope request") - } - - var opts []api.Option - if s.Scope.Id != "" { - // If it's explicitly set here, override anything that might be in the - // client - opts = append(opts, api.WithScopeId(s.Scope.Id)) - } - - req, err := s.Client.NewRequest(ctx, "DELETE", fmt.Sprintf("%s/%s", "scopes", id), nil, opts...) - if err != nil { - return false, nil, fmt.Errorf("error creating DeleteScope request: %w", err) - } - - resp, err := s.Client.Do(req) - if err != nil { - return false, nil, fmt.Errorf("error performing client request during DeleteScope call: %w", err) - } - - type deleteResponse struct { - Existed bool - } - target := &deleteResponse{} - - apiErr, err := resp.Decode(target) - if err != nil { - return false, nil, fmt.Errorf("error decoding DeleteScope repsonse: %w", err) - } - - return target.Existed, apiErr, nil -} diff --git a/api/scopes/list.gen.go b/api/scopes/list.gen.go deleted file mode 100644 index e4e381ee7..000000000 --- a/api/scopes/list.gen.go +++ /dev/null @@ -1,51 +0,0 @@ -// Code generated by "make api"; DO NOT EDIT. -package scopes - -import ( - "context" - "fmt" - - "github.com/hashicorp/watchtower/api" -) - -func (s Scope) ListScopes(ctx context.Context) ([]*Scope, *api.Error, error) { - if s.Client == nil { - return nil, nil, fmt.Errorf("nil client in ListScope request") - } - - var opts []api.Option - if s.Scope.Id != "" { - // If it's explicitly set here, override anything that might be in the - // client - opts = append(opts, api.WithScopeId(s.Scope.Id)) - } - - req, err := s.Client.NewRequest(ctx, "GET", "scopes", nil, opts...) - if err != nil { - return nil, nil, fmt.Errorf("error creating ListScopes request: %w", err) - } - - resp, err := s.Client.Do(req) - if err != nil { - return nil, nil, fmt.Errorf("error performing client request during ListScopes call: %w", err) - } - - type listResponse struct { - Items []*Scope - } - target := &listResponse{} - - apiErr, err := resp.Decode(target) - if err != nil { - return nil, nil, fmt.Errorf("error decoding ListScopes response: %w", err) - } - - for _, t := range target.Items { - - t.Client = s.Client.Clone() - t.Client.SetScopeId(t.Id) - - } - - return target.Items, apiErr, nil -} diff --git a/api/scopes/option.gen.go b/api/scopes/option.gen.go new file mode 100644 index 000000000..8b9ff4f56 --- /dev/null +++ b/api/scopes/option.gen.go @@ -0,0 +1,90 @@ +package scopes + +import ( + "github.com/hashicorp/watchtower/api" +) + +// Option is a func that sets optional attributes for a call. This does not need +// to be used directly, but instead option arguments are built from the +// functions in this package. WithX options set a value to that given in the +// argument; DefaultX options indicate that the value should be set to its +// default. When an API call is made options are processed in ther order they +// appear in the function call, so for a given argument X, a succession of WithX +// or DefaultX calls will result in the last call taking effect. +type Option func(*options) + +type options struct { + valueMap map[string]interface{} + withScopeId string + withAutomaticVersioning bool +} + +func getDefaultOptions() options { + return options{ + valueMap: make(map[string]interface{}), + } +} + +func getOpts(opt ...Option) (options, []api.Option) { + opts := getDefaultOptions() + for _, o := range opt { + o(&opts) + } + var apiOpts []api.Option + if opts.withScopeId != "" { + apiOpts = append(apiOpts, api.WithScopeId(opts.withScopeId)) + } + return opts, apiOpts +} + +func WithScopeId(id string) Option { + return func(o *options) { + o.withScopeId = id + } +} + +// If set, and if the version is zero during an update, the API will perform a +// fetch to get the current version of the resource and populate it during the +// update call. This is convenient but opens up the possibility for subtle +// order-of-modification issues, so use carefully. +func WithAutomaticVersioning() Option { + return func(o *options) { + o.withAutomaticVersioning = true + } +} + +func WithDescription(inDescription string) Option { + return func(o *options) { + o.valueMap["description"] = inDescription + } +} + +func DefaultDescription() Option { + return func(o *options) { + o.valueMap["description"] = nil + } +} + +func WithDisabled(inDisabled bool) Option { + return func(o *options) { + o.valueMap["disabled"] = inDisabled + } +} + +func DefaultDisabled() Option { + return func(o *options) { + o.valueMap["disabled"] = nil + } +} + +func WithName(inName string) Option { + return func(o *options) { + o.valueMap["name"] = inName + } +} + +func DefaultName() Option { + return func(o *options) { + o.valueMap["name"] = nil + } +} diff --git a/api/scopes/read.gen.go b/api/scopes/read.gen.go deleted file mode 100644 index 3a9d0008f..000000000 --- a/api/scopes/read.gen.go +++ /dev/null @@ -1,47 +0,0 @@ -// Code generated by "make api"; DO NOT EDIT. -package scopes - -import ( - "context" - "fmt" - - "github.com/hashicorp/watchtower/api" -) - -func (s Scope) ReadScope(ctx context.Context, id string) (*Scope, *api.Error, error) { - if id == "" { - return nil, nil, fmt.Errorf("empty ID value passed into ReadScope request") - } - - if s.Client == nil { - return nil, nil, fmt.Errorf("nil client in ReadScope request") - } - - var opts []api.Option - if s.Scope.Id != "" { - // If it's explicitly set here, override anything that might be in the - // client - opts = append(opts, api.WithScopeId(s.Scope.Id)) - } - - req, err := s.Client.NewRequest(ctx, "GET", fmt.Sprintf("%s/%s", "scopes", id), nil, opts...) - if err != nil { - return nil, nil, fmt.Errorf("error creating ReadScope request: %w", err) - } - - resp, err := s.Client.Do(req) - if err != nil { - return nil, nil, fmt.Errorf("error performing client request during ReadScope call: %w", err) - } - - target := new(Scope) - apiErr, err := resp.Decode(target) - if err != nil { - return nil, nil, fmt.Errorf("error decoding ReadScope repsonse: %w", err) - } - - target.Client = s.Client.Clone() - target.Client.SetScopeId(target.Id) - - return target, apiErr, nil -} diff --git a/api/scopes/scope.gen.go b/api/scopes/scope.gen.go index ff577e65f..e4f00a039 100644 --- a/api/scopes/scope.gen.go +++ b/api/scopes/scope.gen.go @@ -2,71 +2,196 @@ package scopes import ( - "encoding/json" - "strings" + "context" + "errors" + "fmt" "time" - "github.com/fatih/structs" + "github.com/kr/pretty" "github.com/hashicorp/watchtower/api" - "github.com/hashicorp/watchtower/api/info" - "github.com/hashicorp/watchtower/api/internal/strutil" ) type Scope struct { - Client *api.Client `json:"-"` - - defaultFields []string - - // The ID of the Scope - // Output only. - Id string `json:"id,omitempty"` - // Scope information for this resource - // Output only. - Scope info.Scope `json:"scope,omitempty"` - // Optional name for identification purposes - Name *string `json:"name,omitempty"` - // Optional user-set descripton for identification purposes - Description *string `json:"description,omitempty"` - // The time this resource was created - // Output only. - CreatedTime time.Time `json:"created_time,omitempty"` - // The time this resource was last updated. - // Output only. - UpdatedTime time.Time `json:"updated_time,omitempty"` - // Whether the resource is disabled - Disabled *bool `json:"disabled,omitempty"` + Id string `json:"id,omitempty"` + Scope *ScopeInfo `json:"scope,omitempty"` + Name string `json:"name,omitempty"` + Description string `json:"description,omitempty"` + CreatedTime time.Time `json:"created_time,omitempty"` + UpdatedTime time.Time `json:"updated_time,omitempty"` + Disabled bool `json:"disabled,omitempty"` + Version uint32 `json:"version,omitempty"` } -func (s *Scope) SetDefault(key string) { - lowerKey := strings.ToLower(key) - validMap := map[string]string{"createdtime": "created_time", "description": "description", "disabled": "disabled", "id": "id", "name": "name", "scope": "scope", "updatedtime": "updated_time"} - for k, v := range validMap { - if k == lowerKey || v == lowerKey { - s.defaultFields = strutil.AppendIfMissing(s.defaultFields, v) - return +type scopeClient struct { + client *api.Client +} + +func NewScopeClient(c *api.Client) *scopeClient { + return &scopeClient{client: c} +} + +func (c *scopeClient) Create(ctx context.Context, opt ...Option) (*Scope, *api.Error, error) { + if c.client == nil { + return nil, nil, fmt.Errorf("nil client") + } + + opts, apiOpts := getOpts(opt...) + + req, err := c.client.NewRequest(ctx, "POST", fmt.Sprintf("scopes"), opts.valueMap, apiOpts...) + if err != nil { + return nil, nil, fmt.Errorf("error creating Create request: %w", err) + } + + resp, err := c.client.Do(req) + if err != nil { + return nil, nil, fmt.Errorf("error performing client request during Create call: %w", err) + } + + target := new(Scope) + apiErr, err := resp.Decode(target) + if err != nil { + return nil, nil, fmt.Errorf("error decoding Create response: %w", err) + } + + return target, apiErr, nil +} + +func (c *scopeClient) Read(ctx context.Context, scopeId string, opt ...Option) (*Scope, *api.Error, error) { + if scopeId == "" { + return nil, nil, fmt.Errorf("empty scopeId value passed into Read request") + } + + if c.client == nil { + return nil, nil, fmt.Errorf("nil client") + } + + _, apiOpts := getOpts(opt...) + + req, err := c.client.NewRequest(ctx, "GET", fmt.Sprintf("scopes/%s", scopeId), nil, apiOpts...) + if err != nil { + return nil, nil, fmt.Errorf("error creating Read request: %w", err) + } + + resp, err := c.client.Do(req) + if err != nil { + return nil, nil, fmt.Errorf("error performing client request during Read call: %w", err) + } + + target := new(Scope) + apiErr, err := resp.Decode(target) + if err != nil { + return nil, nil, fmt.Errorf("error decoding Read response: %w", err) + } + + return target, apiErr, nil +} + +func (c *scopeClient) Update(ctx context.Context, scopeId string, version uint32, opt ...Option) (*Scope, *api.Error, error) { + if scopeId == "" { + return nil, nil, fmt.Errorf("empty scopeId value passed into Update request") + } + if c.client == nil { + return nil, nil, fmt.Errorf("nil client") + } + + opts, apiOpts := getOpts(opt...) + + if version == 0 { + if !opts.withAutomaticVersioning { + return nil, nil, errors.New("zero version number passed into Update request and automatic versioning not specified") } - } -} - -func (s *Scope) UnsetDefault(key string) { - lowerKey := strings.ToLower(key) - validMap := map[string]string{"createdtime": "created_time", "description": "description", "disabled": "disabled", "id": "id", "name": "name", "scope": "scope", "updatedtime": "updated_time"} - for k, v := range validMap { - if k == lowerKey || v == lowerKey { - s.defaultFields = strutil.StrListDelete(s.defaultFields, v) - return + existingTarget, existingApiErr, existingErr := c.Read(ctx, scopeId, opt...) + if existingErr != nil { + return nil, nil, fmt.Errorf("error performing initial check-and-set read: %w", existingErr) } + if existingApiErr != nil { + return nil, nil, fmt.Errorf("error from controller when performing initial check-and-set read: %s", pretty.Sprint(existingApiErr)) + } + if existingTarget == nil { + return nil, nil, errors.New("nil resource found when performing initial check-and-set read") + } + version = existingTarget.Version } + opts.valueMap["version"] = version + + req, err := c.client.NewRequest(ctx, "PATCH", fmt.Sprintf("scopes/%s", scopeId), opts.valueMap, apiOpts...) + if err != nil { + return nil, nil, fmt.Errorf("error creating Update request: %w", err) + } + + resp, err := c.client.Do(req) + if err != nil { + return nil, nil, fmt.Errorf("error performing client request during Update call: %w", err) + } + + target := new(Scope) + apiErr, err := resp.Decode(target) + if err != nil { + return nil, nil, fmt.Errorf("error decoding Update response: %w", err) + } + + return target, apiErr, nil } -func (s Scope) MarshalJSON() ([]byte, error) { - m := structs.Map(s) - if m == nil { - m = make(map[string]interface{}) +func (c *scopeClient) Delete(ctx context.Context, scopeId string, opt ...Option) (bool, *api.Error, error) { + if scopeId == "" { + return false, nil, fmt.Errorf("empty scopeId value passed into Delete request") } - for _, k := range s.defaultFields { - m[k] = nil + + if c.client == nil { + return false, nil, fmt.Errorf("nil client") } - return json.Marshal(m) + + _, apiOpts := getOpts(opt...) + + req, err := c.client.NewRequest(ctx, "DELETE", fmt.Sprintf("scopes/%s", scopeId), nil, apiOpts...) + if err != nil { + return false, nil, fmt.Errorf("error creating Delete request: %w", err) + } + + resp, err := c.client.Do(req) + if err != nil { + return false, nil, fmt.Errorf("error performing client request during Delete call: %w", err) + } + + type deleteResponse struct { + Existed bool + } + target := &deleteResponse{} + apiErr, err := resp.Decode(target) + if err != nil { + return false, nil, fmt.Errorf("error decoding Delete response: %w", err) + } + + return target.Existed, apiErr, nil +} + +func (c *scopeClient) List(ctx context.Context, opt ...Option) ([]*Scope, *api.Error, error) { + if c.client == nil { + return nil, nil, fmt.Errorf("nil client") + } + + _, apiOpts := getOpts(opt...) + + req, err := c.client.NewRequest(ctx, "GET", fmt.Sprintf("scopes"), nil, apiOpts...) + if err != nil { + return nil, nil, fmt.Errorf("error creating List request: %w", err) + } + + resp, err := c.client.Do(req) + if err != nil { + return nil, nil, fmt.Errorf("error performing client request during List call: %w", err) + } + + type listResponse struct { + Items []*Scope + } + target := &listResponse{} + apiErr, err := resp.Decode(target) + if err != nil { + return nil, nil, fmt.Errorf("error decoding List response: %w", err) + } + + return target.Items, apiErr, nil } diff --git a/api/scopes/scope_info.gen.go b/api/scopes/scope_info.gen.go new file mode 100644 index 000000000..62d35119e --- /dev/null +++ b/api/scopes/scope_info.gen.go @@ -0,0 +1,10 @@ +// Code generated by "make api"; DO NOT EDIT. +package scopes + +type ScopeInfo struct { + Id string `json:"id,omitempty"` + Type string `json:"type,omitempty"` + Name string `json:"name,omitempty"` + Description string `json:"description,omitempty"` + ParentScopeId string `json:"parent_scope_id,omitempty"` +} diff --git a/api/scopes/update.gen.go b/api/scopes/update.gen.go deleted file mode 100644 index 90d2aa591..000000000 --- a/api/scopes/update.gen.go +++ /dev/null @@ -1,53 +0,0 @@ -// Code generated by "make api"; DO NOT EDIT. -package scopes - -import ( - "context" - "fmt" - - "github.com/hashicorp/watchtower/api" -) - -func (s Scope) UpdateScope(ctx context.Context, r *Scope) (*Scope, *api.Error, error) { - if r == nil { - - } - if r.Id == "" { - return nil, nil, fmt.Errorf("empty Scope ID field in CreateScope request") - } - - if s.Client == nil { - return nil, nil, fmt.Errorf("nil client in CreateScope request") - } - - var opts []api.Option - if s.Scope.Id != "" { - // If it's explicitly set here, override anything that might be in the - // client - opts = append(opts, api.WithScopeId(s.Scope.Id)) - } - - id := r.Id - r.Id = "" - - req, err := s.Client.NewRequest(ctx, "PATCH", fmt.Sprintf("%s/%s", "scopes", id), r, opts...) - if err != nil { - return nil, nil, fmt.Errorf("error creating CreateScope request: %w", err) - } - - resp, err := s.Client.Do(req) - if err != nil { - return nil, nil, fmt.Errorf("error performing client request during UpdateScope call: %w", err) - } - - target := new(Scope) - apiErr, err := resp.Decode(target) - if err != nil { - return nil, nil, fmt.Errorf("error decoding UpdateScope repsonse: %w", err) - } - - target.Client = s.Client.Clone() - target.Client.SetScopeId(target.Id) - - return target, apiErr, nil -} diff --git a/api/users/create.gen.go b/api/users/create.gen.go deleted file mode 100644 index 77e6e35b0..000000000 --- a/api/users/create.gen.go +++ /dev/null @@ -1,42 +0,0 @@ -// Code generated by "make api"; DO NOT EDIT. -package users - -import ( - "context" - "fmt" - - "github.com/hashicorp/watchtower/api" -) - -func (s User) CreateUser(ctx context.Context, r *User) (*User, *api.Error, error) { - if s.Client == nil { - return nil, nil, fmt.Errorf("nil client in CreateUser request") - } - - var opts []api.Option - if s.Scope.Id != "" { - // If it's explicitly set here, override anything that might be in the - // client - opts = append(opts, api.WithScopeId(s.Scope.Id)) - } - - req, err := s.Client.NewRequest(ctx, "POST", "users", r, opts...) - if err != nil { - return nil, nil, fmt.Errorf("error creating CreateUser request: %w", err) - } - - resp, err := s.Client.Do(req) - if err != nil { - return nil, nil, fmt.Errorf("error performing client request during CreateUser call: %w", err) - } - - target := new(User) - apiErr, err := resp.Decode(target) - if err != nil { - return nil, nil, fmt.Errorf("error decoding CreateUser repsonse: %w", err) - } - - target.Client = s.Client - - return target, apiErr, nil -} diff --git a/api/users/delete.gen.go b/api/users/delete.gen.go deleted file mode 100644 index d5bb3115f..000000000 --- a/api/users/delete.gen.go +++ /dev/null @@ -1,49 +0,0 @@ -// Code generated by "make api"; DO NOT EDIT. -package users - -import ( - "context" - "fmt" - - "github.com/hashicorp/watchtower/api" -) - -// DeleteUser returns true iff the User existed when the delete attempt was made. -func (s User) DeleteUser(ctx context.Context, id string) (bool, *api.Error, error) { - if id == "" { - return false, nil, fmt.Errorf("empty id provided to DeleteUser request") - } - - if s.Client == nil { - return false, nil, fmt.Errorf("nil client in DeleteUser request") - } - - var opts []api.Option - if s.Scope.Id != "" { - // If it's explicitly set here, override anything that might be in the - // client - opts = append(opts, api.WithScopeId(s.Scope.Id)) - } - - req, err := s.Client.NewRequest(ctx, "DELETE", fmt.Sprintf("%s/%s", "users", id), nil, opts...) - if err != nil { - return false, nil, fmt.Errorf("error creating DeleteUser request: %w", err) - } - - resp, err := s.Client.Do(req) - if err != nil { - return false, nil, fmt.Errorf("error performing client request during DeleteUser call: %w", err) - } - - type deleteResponse struct { - Existed bool - } - target := &deleteResponse{} - - apiErr, err := resp.Decode(target) - if err != nil { - return false, nil, fmt.Errorf("error decoding DeleteUser repsonse: %w", err) - } - - return target.Existed, apiErr, nil -} diff --git a/api/users/list.gen.go b/api/users/list.gen.go deleted file mode 100644 index c2d88b297..000000000 --- a/api/users/list.gen.go +++ /dev/null @@ -1,50 +0,0 @@ -// Code generated by "make api"; DO NOT EDIT. -package users - -import ( - "context" - "fmt" - - "github.com/hashicorp/watchtower/api" -) - -func (s User) ListUsers(ctx context.Context) ([]*User, *api.Error, error) { - if s.Client == nil { - return nil, nil, fmt.Errorf("nil client in ListUser request") - } - - var opts []api.Option - if s.Scope.Id != "" { - // If it's explicitly set here, override anything that might be in the - // client - opts = append(opts, api.WithScopeId(s.Scope.Id)) - } - - req, err := s.Client.NewRequest(ctx, "GET", "users", nil, opts...) - if err != nil { - return nil, nil, fmt.Errorf("error creating ListUsers request: %w", err) - } - - resp, err := s.Client.Do(req) - if err != nil { - return nil, nil, fmt.Errorf("error performing client request during ListUsers call: %w", err) - } - - type listResponse struct { - Items []*User - } - target := &listResponse{} - - apiErr, err := resp.Decode(target) - if err != nil { - return nil, nil, fmt.Errorf("error decoding ListUsers response: %w", err) - } - - for _, t := range target.Items { - - t.Client = s.Client - - } - - return target.Items, apiErr, nil -} diff --git a/api/users/option.gen.go b/api/users/option.gen.go new file mode 100644 index 000000000..28402c1f5 --- /dev/null +++ b/api/users/option.gen.go @@ -0,0 +1,90 @@ +package users + +import ( + "github.com/hashicorp/watchtower/api" +) + +// Option is a func that sets optional attributes for a call. This does not need +// to be used directly, but instead option arguments are built from the +// functions in this package. WithX options set a value to that given in the +// argument; DefaultX options indicate that the value should be set to its +// default. When an API call is made options are processed in ther order they +// appear in the function call, so for a given argument X, a succession of WithX +// or DefaultX calls will result in the last call taking effect. +type Option func(*options) + +type options struct { + valueMap map[string]interface{} + withScopeId string + withAutomaticVersioning bool +} + +func getDefaultOptions() options { + return options{ + valueMap: make(map[string]interface{}), + } +} + +func getOpts(opt ...Option) (options, []api.Option) { + opts := getDefaultOptions() + for _, o := range opt { + o(&opts) + } + var apiOpts []api.Option + if opts.withScopeId != "" { + apiOpts = append(apiOpts, api.WithScopeId(opts.withScopeId)) + } + return opts, apiOpts +} + +func WithScopeId(id string) Option { + return func(o *options) { + o.withScopeId = id + } +} + +// If set, and if the version is zero during an update, the API will perform a +// fetch to get the current version of the resource and populate it during the +// update call. This is convenient but opens up the possibility for subtle +// order-of-modification issues, so use carefully. +func WithAutomaticVersioning() Option { + return func(o *options) { + o.withAutomaticVersioning = true + } +} + +func WithDescription(inDescription string) Option { + return func(o *options) { + o.valueMap["description"] = inDescription + } +} + +func DefaultDescription() Option { + return func(o *options) { + o.valueMap["description"] = nil + } +} + +func WithDisabled(inDisabled bool) Option { + return func(o *options) { + o.valueMap["disabled"] = inDisabled + } +} + +func DefaultDisabled() Option { + return func(o *options) { + o.valueMap["disabled"] = nil + } +} + +func WithName(inName string) Option { + return func(o *options) { + o.valueMap["name"] = inName + } +} + +func DefaultName() Option { + return func(o *options) { + o.valueMap["name"] = nil + } +} diff --git a/api/users/read.gen.go b/api/users/read.gen.go deleted file mode 100644 index e01569c39..000000000 --- a/api/users/read.gen.go +++ /dev/null @@ -1,46 +0,0 @@ -// Code generated by "make api"; DO NOT EDIT. -package users - -import ( - "context" - "fmt" - - "github.com/hashicorp/watchtower/api" -) - -func (s User) ReadUser(ctx context.Context, id string) (*User, *api.Error, error) { - if id == "" { - return nil, nil, fmt.Errorf("empty ID value passed into ReadUser request") - } - - if s.Client == nil { - return nil, nil, fmt.Errorf("nil client in ReadUser request") - } - - var opts []api.Option - if s.Scope.Id != "" { - // If it's explicitly set here, override anything that might be in the - // client - opts = append(opts, api.WithScopeId(s.Scope.Id)) - } - - req, err := s.Client.NewRequest(ctx, "GET", fmt.Sprintf("%s/%s", "users", id), nil, opts...) - if err != nil { - return nil, nil, fmt.Errorf("error creating ReadUser request: %w", err) - } - - resp, err := s.Client.Do(req) - if err != nil { - return nil, nil, fmt.Errorf("error performing client request during ReadUser call: %w", err) - } - - target := new(User) - apiErr, err := resp.Decode(target) - if err != nil { - return nil, nil, fmt.Errorf("error decoding ReadUser repsonse: %w", err) - } - - target.Client = s.Client - - return target, apiErr, nil -} diff --git a/api/users/update.gen.go b/api/users/update.gen.go deleted file mode 100644 index c321eaa73..000000000 --- a/api/users/update.gen.go +++ /dev/null @@ -1,52 +0,0 @@ -// Code generated by "make api"; DO NOT EDIT. -package users - -import ( - "context" - "fmt" - - "github.com/hashicorp/watchtower/api" -) - -func (s User) UpdateUser(ctx context.Context, r *User) (*User, *api.Error, error) { - if r == nil { - - } - if r.Id == "" { - return nil, nil, fmt.Errorf("empty User ID field in CreateUser request") - } - - if s.Client == nil { - return nil, nil, fmt.Errorf("nil client in CreateUser request") - } - - var opts []api.Option - if s.Scope.Id != "" { - // If it's explicitly set here, override anything that might be in the - // client - opts = append(opts, api.WithScopeId(s.Scope.Id)) - } - - id := r.Id - r.Id = "" - - req, err := s.Client.NewRequest(ctx, "PATCH", fmt.Sprintf("%s/%s", "users", id), r, opts...) - if err != nil { - return nil, nil, fmt.Errorf("error creating CreateUser request: %w", err) - } - - resp, err := s.Client.Do(req) - if err != nil { - return nil, nil, fmt.Errorf("error performing client request during UpdateUser call: %w", err) - } - - target := new(User) - apiErr, err := resp.Decode(target) - if err != nil { - return nil, nil, fmt.Errorf("error decoding UpdateUser repsonse: %w", err) - } - - target.Client = s.Client - - return target, apiErr, nil -} diff --git a/api/users/user.gen.go b/api/users/user.gen.go index 064ab2a2c..1f4405926 100644 --- a/api/users/user.gen.go +++ b/api/users/user.gen.go @@ -2,71 +2,197 @@ package users import ( - "encoding/json" - "strings" + "context" + "errors" + "fmt" "time" - "github.com/fatih/structs" + "github.com/kr/pretty" "github.com/hashicorp/watchtower/api" - "github.com/hashicorp/watchtower/api/info" - "github.com/hashicorp/watchtower/api/internal/strutil" + "github.com/hashicorp/watchtower/api/scopes" ) type User struct { - Client *api.Client `json:"-"` - - defaultFields []string - - // The ID of the Project - // Output only. - Id string `json:"id,omitempty"` - // Scope information for this resource - // Output only. - Scope info.Scope `json:"scope,omitempty"` - // Optional name for identification purposes - Name *string `json:"name,omitempty"` - // Optional user-set descripton for identification purposes - Description *string `json:"description,omitempty"` - // The time this resource was created - // Output only. - CreatedTime time.Time `json:"created_time,omitempty"` - // The time this resource was last updated. - // Output only. - UpdatedTime time.Time `json:"updated_time,omitempty"` - // Whether the resource is disabled - Disabled *bool `json:"disabled,omitempty"` + Id string `json:"id,omitempty"` + Scope *scopes.ScopeInfo `json:"scope,omitempty"` + Name string `json:"name,omitempty"` + Description string `json:"description,omitempty"` + CreatedTime time.Time `json:"created_time,omitempty"` + UpdatedTime time.Time `json:"updated_time,omitempty"` + Disabled bool `json:"disabled,omitempty"` + Version uint32 `json:"version,omitempty"` } -func (s *User) SetDefault(key string) { - lowerKey := strings.ToLower(key) - validMap := map[string]string{"createdtime": "created_time", "description": "description", "disabled": "disabled", "id": "id", "name": "name", "scope": "scope", "updatedtime": "updated_time"} - for k, v := range validMap { - if k == lowerKey || v == lowerKey { - s.defaultFields = strutil.AppendIfMissing(s.defaultFields, v) - return +type userClient struct { + client *api.Client +} + +func NewUserClient(c *api.Client) *userClient { + return &userClient{client: c} +} + +func (c *userClient) Create(ctx context.Context, opt ...Option) (*User, *api.Error, error) { + if c.client == nil { + return nil, nil, fmt.Errorf("nil client") + } + + opts, apiOpts := getOpts(opt...) + + req, err := c.client.NewRequest(ctx, "POST", fmt.Sprintf("users"), opts.valueMap, apiOpts...) + if err != nil { + return nil, nil, fmt.Errorf("error creating Create request: %w", err) + } + + resp, err := c.client.Do(req) + if err != nil { + return nil, nil, fmt.Errorf("error performing client request during Create call: %w", err) + } + + target := new(User) + apiErr, err := resp.Decode(target) + if err != nil { + return nil, nil, fmt.Errorf("error decoding Create response: %w", err) + } + + return target, apiErr, nil +} + +func (c *userClient) Read(ctx context.Context, userId string, opt ...Option) (*User, *api.Error, error) { + if userId == "" { + return nil, nil, fmt.Errorf("empty userId value passed into Read request") + } + + if c.client == nil { + return nil, nil, fmt.Errorf("nil client") + } + + _, apiOpts := getOpts(opt...) + + req, err := c.client.NewRequest(ctx, "GET", fmt.Sprintf("users/%s", userId), nil, apiOpts...) + if err != nil { + return nil, nil, fmt.Errorf("error creating Read request: %w", err) + } + + resp, err := c.client.Do(req) + if err != nil { + return nil, nil, fmt.Errorf("error performing client request during Read call: %w", err) + } + + target := new(User) + apiErr, err := resp.Decode(target) + if err != nil { + return nil, nil, fmt.Errorf("error decoding Read response: %w", err) + } + + return target, apiErr, nil +} + +func (c *userClient) Update(ctx context.Context, userId string, version uint32, opt ...Option) (*User, *api.Error, error) { + if userId == "" { + return nil, nil, fmt.Errorf("empty userId value passed into Update request") + } + if c.client == nil { + return nil, nil, fmt.Errorf("nil client") + } + + opts, apiOpts := getOpts(opt...) + + if version == 0 { + if !opts.withAutomaticVersioning { + return nil, nil, errors.New("zero version number passed into Update request and automatic versioning not specified") } - } -} - -func (s *User) UnsetDefault(key string) { - lowerKey := strings.ToLower(key) - validMap := map[string]string{"createdtime": "created_time", "description": "description", "disabled": "disabled", "id": "id", "name": "name", "scope": "scope", "updatedtime": "updated_time"} - for k, v := range validMap { - if k == lowerKey || v == lowerKey { - s.defaultFields = strutil.StrListDelete(s.defaultFields, v) - return + existingTarget, existingApiErr, existingErr := c.Read(ctx, userId, opt...) + if existingErr != nil { + return nil, nil, fmt.Errorf("error performing initial check-and-set read: %w", existingErr) } + if existingApiErr != nil { + return nil, nil, fmt.Errorf("error from controller when performing initial check-and-set read: %s", pretty.Sprint(existingApiErr)) + } + if existingTarget == nil { + return nil, nil, errors.New("nil resource found when performing initial check-and-set read") + } + version = existingTarget.Version } + opts.valueMap["version"] = version + + req, err := c.client.NewRequest(ctx, "PATCH", fmt.Sprintf("users/%s", userId), opts.valueMap, apiOpts...) + if err != nil { + return nil, nil, fmt.Errorf("error creating Update request: %w", err) + } + + resp, err := c.client.Do(req) + if err != nil { + return nil, nil, fmt.Errorf("error performing client request during Update call: %w", err) + } + + target := new(User) + apiErr, err := resp.Decode(target) + if err != nil { + return nil, nil, fmt.Errorf("error decoding Update response: %w", err) + } + + return target, apiErr, nil } -func (s User) MarshalJSON() ([]byte, error) { - m := structs.Map(s) - if m == nil { - m = make(map[string]interface{}) +func (c *userClient) Delete(ctx context.Context, userId string, opt ...Option) (bool, *api.Error, error) { + if userId == "" { + return false, nil, fmt.Errorf("empty userId value passed into Delete request") } - for _, k := range s.defaultFields { - m[k] = nil + + if c.client == nil { + return false, nil, fmt.Errorf("nil client") } - return json.Marshal(m) + + _, apiOpts := getOpts(opt...) + + req, err := c.client.NewRequest(ctx, "DELETE", fmt.Sprintf("users/%s", userId), nil, apiOpts...) + if err != nil { + return false, nil, fmt.Errorf("error creating Delete request: %w", err) + } + + resp, err := c.client.Do(req) + if err != nil { + return false, nil, fmt.Errorf("error performing client request during Delete call: %w", err) + } + + type deleteResponse struct { + Existed bool + } + target := &deleteResponse{} + apiErr, err := resp.Decode(target) + if err != nil { + return false, nil, fmt.Errorf("error decoding Delete response: %w", err) + } + + return target.Existed, apiErr, nil +} + +func (c *userClient) List(ctx context.Context, opt ...Option) ([]*User, *api.Error, error) { + if c.client == nil { + return nil, nil, fmt.Errorf("nil client") + } + + _, apiOpts := getOpts(opt...) + + req, err := c.client.NewRequest(ctx, "GET", fmt.Sprintf("users"), nil, apiOpts...) + if err != nil { + return nil, nil, fmt.Errorf("error creating List request: %w", err) + } + + resp, err := c.client.Do(req) + if err != nil { + return nil, nil, fmt.Errorf("error performing client request during List call: %w", err) + } + + type listResponse struct { + Items []*User + } + target := &listResponse{} + apiErr, err := resp.Decode(target) + if err != nil { + return nil, nil, fmt.Errorf("error decoding List response: %w", err) + } + + return target.Items, apiErr, nil } diff --git a/go.mod b/go.mod index eedd42f11..58914dd6c 100644 --- a/go.mod +++ b/go.mod @@ -34,6 +34,7 @@ require ( github.com/hashicorp/hcl v1.0.0 github.com/hashicorp/vault v1.2.1-0.20200717203022-646babcf458c github.com/hashicorp/vault/sdk v0.1.14-0.20200717191844-f687267c8086 + github.com/iancoleman/strcase v0.0.0-20180726023541-3605ed457bf7 github.com/jackc/pgx/v4 v4.8.0 github.com/jinzhu/gorm v1.9.15 github.com/kr/pretty v0.2.0 @@ -55,6 +56,7 @@ require ( github.com/sergi/go-diff v1.0.0 // indirect github.com/stretchr/testify v1.6.1 github.com/zalando/go-keyring v0.1.0 + go.uber.org/atomic v1.6.0 golang.org/x/crypto v0.0.0-20200709230013-948cd5f35899 golang.org/x/time v0.0.0-20200630173020-3af7569d3a1e golang.org/x/tools v0.0.0-20200722181740-bd1e9de8d890 diff --git a/go.sum b/go.sum index 98ff01e3c..163e57e40 100644 --- a/go.sum +++ b/go.sum @@ -799,6 +799,7 @@ github.com/hinshun/vt10x v0.0.0-20180616224451-1954e6464174 h1:WlZsjVhE8Af9IcZDG github.com/hinshun/vt10x v0.0.0-20180616224451-1954e6464174/go.mod h1:DqJ97dSdRW1W22yXSB90986pcOyQ7r45iio1KN2ez1A= github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU= github.com/huaweicloud/golangsdk v0.0.0-20200304081349-45ec0797f2a4/go.mod h1:WQBcHRNX9shz3928lWEvstQJtAtYI7ks6XlgtRT9Tcw= +github.com/iancoleman/strcase v0.0.0-20180726023541-3605ed457bf7 h1:ux/56T2xqZO/3cP1I2F86qpeoYPCOzk+KF/UH/Ar+lk= github.com/iancoleman/strcase v0.0.0-20180726023541-3605ed457bf7/go.mod h1:SK73tn/9oHe+/Y0h39VT4UCxmurVJkR5NA7kMEAOgSE= github.com/ianlancetaylor/demangle v0.0.0-20181102032728-5e5cf60278f6/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= github.com/imdario/mergo v0.3.6/go.mod h1:2EnlNZ0deacrJVfApfmtdGgDfMuh/nq6Ok1EcJh5FfA= diff --git a/internal/auth/password/store/password.pb.go b/internal/auth/password/store/password.pb.go index db326b949..cf0c7ff66 100644 --- a/internal/auth/password/store/password.pb.go +++ b/internal/auth/password/store/password.pb.go @@ -272,66 +272,67 @@ var file_controller_storage_auth_password_store_v1_password_proto_rawDesc = []by 0x72, 0x65, 0x2e, 0x76, 0x31, 0x1a, 0x2f, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x65, 0x72, 0x2f, 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x2f, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x2f, 0x76, 0x31, 0x2f, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, - 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x28, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x6c, + 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x2a, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x65, 0x72, 0x2f, 0x63, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x5f, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, - 0x73, 0x2f, 0x76, 0x31, 0x2f, 0x6d, 0x61, 0x73, 0x6b, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, - 0x22, 0xd1, 0x03, 0x0a, 0x0a, 0x41, 0x75, 0x74, 0x68, 0x4d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x12, - 0x1b, 0x0a, 0x09, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, - 0x28, 0x09, 0x52, 0x08, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x49, 0x64, 0x12, 0x4b, 0x0a, 0x0b, - 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, + 0x73, 0x2f, 0x76, 0x31, 0x2f, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x22, 0xd1, 0x03, 0x0a, 0x0a, 0x41, 0x75, 0x74, 0x68, 0x4d, 0x65, 0x74, 0x68, 0x6f, + 0x64, 0x12, 0x1b, 0x0a, 0x09, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x5f, 0x69, 0x64, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x49, 0x64, 0x12, 0x4b, + 0x0a, 0x0b, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x02, 0x20, + 0x01, 0x28, 0x0b, 0x32, 0x2a, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x65, 0x72, + 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x2e, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, + 0x6d, 0x70, 0x2e, 0x76, 0x31, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, + 0x0a, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x54, 0x69, 0x6d, 0x65, 0x12, 0x4b, 0x0a, 0x0b, 0x75, + 0x70, 0x64, 0x61, 0x74, 0x65, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, + 0x32, 0x2a, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x65, 0x72, 0x2e, 0x73, 0x74, + 0x6f, 0x72, 0x61, 0x67, 0x65, 0x2e, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x2e, + 0x76, 0x31, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x0a, 0x75, 0x70, + 0x64, 0x61, 0x74, 0x65, 0x54, 0x69, 0x6d, 0x65, 0x12, 0x24, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, + 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x42, 0x10, 0xc2, 0xdd, 0x29, 0x0c, 0x0a, 0x04, 0x6e, 0x61, + 0x6d, 0x65, 0x12, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x40, + 0x0a, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x05, 0x20, + 0x01, 0x28, 0x09, 0x42, 0x1e, 0xc2, 0xdd, 0x29, 0x1a, 0x0a, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, + 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, + 0x69, 0x6f, 0x6e, 0x52, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, + 0x12, 0x19, 0x0a, 0x08, 0x73, 0x63, 0x6f, 0x70, 0x65, 0x5f, 0x69, 0x64, 0x18, 0x06, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x07, 0x73, 0x63, 0x6f, 0x70, 0x65, 0x49, 0x64, 0x12, 0x28, 0x0a, 0x10, 0x70, + 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x5f, 0x63, 0x6f, 0x6e, 0x66, 0x5f, 0x69, 0x64, 0x18, + 0x07, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0e, 0x70, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x43, + 0x6f, 0x6e, 0x66, 0x49, 0x64, 0x12, 0x2f, 0x0a, 0x14, 0x6d, 0x69, 0x6e, 0x5f, 0x75, 0x73, 0x65, + 0x72, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x5f, 0x6c, 0x65, 0x6e, 0x67, 0x74, 0x68, 0x18, 0x08, 0x20, + 0x01, 0x28, 0x0d, 0x52, 0x11, 0x6d, 0x69, 0x6e, 0x55, 0x73, 0x65, 0x72, 0x4e, 0x61, 0x6d, 0x65, + 0x4c, 0x65, 0x6e, 0x67, 0x74, 0x68, 0x12, 0x2e, 0x0a, 0x13, 0x6d, 0x69, 0x6e, 0x5f, 0x70, 0x61, + 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x5f, 0x6c, 0x65, 0x6e, 0x67, 0x74, 0x68, 0x18, 0x09, 0x20, + 0x01, 0x28, 0x0d, 0x52, 0x11, 0x6d, 0x69, 0x6e, 0x50, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, + 0x4c, 0x65, 0x6e, 0x67, 0x74, 0x68, 0x22, 0xeb, 0x02, 0x0a, 0x07, 0x41, 0x63, 0x63, 0x6f, 0x75, + 0x6e, 0x74, 0x12, 0x1b, 0x0a, 0x09, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x5f, 0x69, 0x64, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x49, 0x64, 0x12, + 0x4b, 0x0a, 0x0b, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x02, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2a, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x65, + 0x72, 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x2e, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, + 0x61, 0x6d, 0x70, 0x2e, 0x76, 0x31, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, + 0x52, 0x0a, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x54, 0x69, 0x6d, 0x65, 0x12, 0x4b, 0x0a, 0x0b, + 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2a, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x65, 0x72, 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x2e, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, - 0x2e, 0x76, 0x31, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x0a, 0x63, - 0x72, 0x65, 0x61, 0x74, 0x65, 0x54, 0x69, 0x6d, 0x65, 0x12, 0x4b, 0x0a, 0x0b, 0x75, 0x70, 0x64, - 0x61, 0x74, 0x65, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2a, - 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x65, 0x72, 0x2e, 0x73, 0x74, 0x6f, 0x72, - 0x61, 0x67, 0x65, 0x2e, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x2e, 0x76, 0x31, - 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x0a, 0x75, 0x70, 0x64, 0x61, - 0x74, 0x65, 0x54, 0x69, 0x6d, 0x65, 0x12, 0x24, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x04, - 0x20, 0x01, 0x28, 0x09, 0x42, 0x10, 0xc2, 0xdd, 0x29, 0x0c, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, - 0x12, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x40, 0x0a, 0x0b, - 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x05, 0x20, 0x01, 0x28, - 0x09, 0x42, 0x1e, 0xc2, 0xdd, 0x29, 0x1a, 0x0a, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, - 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, - 0x6e, 0x52, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x19, - 0x0a, 0x08, 0x73, 0x63, 0x6f, 0x70, 0x65, 0x5f, 0x69, 0x64, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, - 0x52, 0x07, 0x73, 0x63, 0x6f, 0x70, 0x65, 0x49, 0x64, 0x12, 0x28, 0x0a, 0x10, 0x70, 0x61, 0x73, - 0x73, 0x77, 0x6f, 0x72, 0x64, 0x5f, 0x63, 0x6f, 0x6e, 0x66, 0x5f, 0x69, 0x64, 0x18, 0x07, 0x20, - 0x01, 0x28, 0x09, 0x52, 0x0e, 0x70, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x43, 0x6f, 0x6e, - 0x66, 0x49, 0x64, 0x12, 0x2f, 0x0a, 0x14, 0x6d, 0x69, 0x6e, 0x5f, 0x75, 0x73, 0x65, 0x72, 0x5f, - 0x6e, 0x61, 0x6d, 0x65, 0x5f, 0x6c, 0x65, 0x6e, 0x67, 0x74, 0x68, 0x18, 0x08, 0x20, 0x01, 0x28, - 0x0d, 0x52, 0x11, 0x6d, 0x69, 0x6e, 0x55, 0x73, 0x65, 0x72, 0x4e, 0x61, 0x6d, 0x65, 0x4c, 0x65, - 0x6e, 0x67, 0x74, 0x68, 0x12, 0x2e, 0x0a, 0x13, 0x6d, 0x69, 0x6e, 0x5f, 0x70, 0x61, 0x73, 0x73, - 0x77, 0x6f, 0x72, 0x64, 0x5f, 0x6c, 0x65, 0x6e, 0x67, 0x74, 0x68, 0x18, 0x09, 0x20, 0x01, 0x28, - 0x0d, 0x52, 0x11, 0x6d, 0x69, 0x6e, 0x50, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x4c, 0x65, - 0x6e, 0x67, 0x74, 0x68, 0x22, 0xeb, 0x02, 0x0a, 0x07, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, - 0x12, 0x1b, 0x0a, 0x09, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, - 0x01, 0x28, 0x09, 0x52, 0x08, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x49, 0x64, 0x12, 0x4b, 0x0a, - 0x0b, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, - 0x28, 0x0b, 0x32, 0x2a, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x65, 0x72, 0x2e, - 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x2e, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, - 0x70, 0x2e, 0x76, 0x31, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x0a, - 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x54, 0x69, 0x6d, 0x65, 0x12, 0x4b, 0x0a, 0x0b, 0x75, 0x70, - 0x64, 0x61, 0x74, 0x65, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, - 0x2a, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x65, 0x72, 0x2e, 0x73, 0x74, 0x6f, - 0x72, 0x61, 0x67, 0x65, 0x2e, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x2e, 0x76, - 0x31, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x0a, 0x75, 0x70, 0x64, - 0x61, 0x74, 0x65, 0x54, 0x69, 0x6d, 0x65, 0x12, 0x24, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, - 0x04, 0x20, 0x01, 0x28, 0x09, 0x42, 0x10, 0xc2, 0xdd, 0x29, 0x0c, 0x0a, 0x04, 0x6e, 0x61, 0x6d, - 0x65, 0x12, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x40, 0x0a, - 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x05, 0x20, 0x01, - 0x28, 0x09, 0x42, 0x1e, 0xc2, 0xdd, 0x29, 0x1a, 0x0a, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, - 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, - 0x6f, 0x6e, 0x52, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x12, - 0x24, 0x0a, 0x0e, 0x61, 0x75, 0x74, 0x68, 0x5f, 0x6d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x5f, 0x69, - 0x64, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x61, 0x75, 0x74, 0x68, 0x4d, 0x65, 0x74, - 0x68, 0x6f, 0x64, 0x49, 0x64, 0x12, 0x1b, 0x0a, 0x09, 0x75, 0x73, 0x65, 0x72, 0x5f, 0x6e, 0x61, - 0x6d, 0x65, 0x18, 0x07, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x75, 0x73, 0x65, 0x72, 0x4e, 0x61, - 0x6d, 0x65, 0x42, 0x44, 0x5a, 0x42, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, - 0x2f, 0x68, 0x61, 0x73, 0x68, 0x69, 0x63, 0x6f, 0x72, 0x70, 0x2f, 0x77, 0x61, 0x74, 0x63, 0x68, - 0x74, 0x6f, 0x77, 0x65, 0x72, 0x2f, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x2f, 0x61, - 0x75, 0x74, 0x68, 0x2f, 0x70, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x2f, 0x73, 0x74, 0x6f, - 0x72, 0x65, 0x3b, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x2e, 0x76, 0x31, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x0a, 0x75, + 0x70, 0x64, 0x61, 0x74, 0x65, 0x54, 0x69, 0x6d, 0x65, 0x12, 0x24, 0x0a, 0x04, 0x6e, 0x61, 0x6d, + 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x42, 0x10, 0xc2, 0xdd, 0x29, 0x0c, 0x0a, 0x04, 0x6e, + 0x61, 0x6d, 0x65, 0x12, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, + 0x40, 0x0a, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x05, + 0x20, 0x01, 0x28, 0x09, 0x42, 0x1e, 0xc2, 0xdd, 0x29, 0x1a, 0x0a, 0x0b, 0x64, 0x65, 0x73, 0x63, + 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, + 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, + 0x6e, 0x12, 0x24, 0x0a, 0x0e, 0x61, 0x75, 0x74, 0x68, 0x5f, 0x6d, 0x65, 0x74, 0x68, 0x6f, 0x64, + 0x5f, 0x69, 0x64, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x61, 0x75, 0x74, 0x68, 0x4d, + 0x65, 0x74, 0x68, 0x6f, 0x64, 0x49, 0x64, 0x12, 0x1b, 0x0a, 0x09, 0x75, 0x73, 0x65, 0x72, 0x5f, + 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x07, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x75, 0x73, 0x65, 0x72, + 0x4e, 0x61, 0x6d, 0x65, 0x42, 0x44, 0x5a, 0x42, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, + 0x6f, 0x6d, 0x2f, 0x68, 0x61, 0x73, 0x68, 0x69, 0x63, 0x6f, 0x72, 0x70, 0x2f, 0x77, 0x61, 0x74, + 0x63, 0x68, 0x74, 0x6f, 0x77, 0x65, 0x72, 0x2f, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, + 0x2f, 0x61, 0x75, 0x74, 0x68, 0x2f, 0x70, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x2f, 0x73, + 0x74, 0x6f, 0x72, 0x65, 0x3b, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x33, } var ( diff --git a/internal/cmd/base/base.go b/internal/cmd/base/base.go index fc357b2d5..20244bd70 100644 --- a/internal/cmd/base/base.go +++ b/internal/cmd/base/base.go @@ -197,6 +197,10 @@ func (c *Command) Client() (*api.Client, error) { if c.flagScope != NotSetValue { c.client.SetScopeId(c.flagScope) } + // At this point if we haven't figured out the scope, default to "global" + if c.client.ScopeId() == "" { + c.client.SetScopeId("global") + } return c.client, nil } @@ -240,7 +244,7 @@ func (c *Command) FlagSet(bit FlagSetBit) *FlagSets { Default: NotSetValue, EnvVar: api.EnvWatchtowerScopeId, Completion: complete.PredictAnything, - Usage: "Scope in which to make the request.", + Usage: `Scope in which to make the request. If not specified, will default to the scope of a saved token (if found), otherwise will default to "global".`, }) f.StringVar(&StringVar{ diff --git a/internal/cmd/commands/authenticate/password.go b/internal/cmd/commands/authenticate/password.go index 2de206ebb..51126394e 100644 --- a/internal/cmd/commands/authenticate/password.go +++ b/internal/cmd/commands/authenticate/password.go @@ -9,7 +9,7 @@ import ( "time" "github.com/hashicorp/vault/sdk/helper/password" - "github.com/hashicorp/watchtower/api/scopes" + "github.com/hashicorp/watchtower/api/authmethods" "github.com/hashicorp/watchtower/internal/cmd/base" "github.com/kr/pretty" "github.com/mitchellh/cli" @@ -122,14 +122,10 @@ func (c *PasswordCommand) Run(args []string) int { return 2 } - scp := &scopes.Scope{ - Client: client, - } - // note: Authenticate() calls SetToken() under the hood to set the // auth bearer on the client so we do not need to do anything with the // returned token after this call, so we ignore it - result, apiErr, err := scp.Authenticate(c.Context, c.flagMethodId, c.flagName, c.flagPassword) + result, apiErr, err := authmethods.NewAuthMethodClient(client).Authenticate(c.Context, c.flagMethodId, c.flagName, c.flagPassword) if err != nil { c.UI.Error(fmt.Sprintf("Error trying to perform authentication: %s", err.Error())) return 2 diff --git a/internal/cmd/commands/hosts/host_create.go b/internal/cmd/commands/hosts/host_create.go index aab95e7ad..8320b7326 100644 --- a/internal/cmd/commands/hosts/host_create.go +++ b/internal/cmd/commands/hosts/host_create.go @@ -4,7 +4,6 @@ import ( "fmt" "strings" - "github.com/hashicorp/watchtower/api" "github.com/hashicorp/watchtower/api/hosts" "github.com/hashicorp/watchtower/internal/cmd/base" "github.com/kr/pretty" @@ -111,19 +110,11 @@ func (c *CreateCommand) Run(args []string) int { return 2 } - catalog := &hosts.HostCatalog{ - Client: client, - Id: c.flagCatalogId, - } - - host := &hosts.Host{ - Address: api.String(c.flagAddress), - Name: api.StringOrNil(c.flagName), - Description: api.StringOrNil(c.flagDescription), - } - - var apiErr *api.Error - host, apiErr, err = catalog.CreateHost(c.Context, host) + host, apiErr, err := hosts.NewHostClient(client).Create(c.Context, + c.flagCatalogId, + hosts.WithAddress(c.flagAddress), + hosts.WithName(c.flagName), + hosts.WithDescription(c.flagDescription)) switch { case err != nil: diff --git a/internal/cmd/commands/roles/funcs.go b/internal/cmd/commands/roles/funcs.go index aa4c53512..351d1c3d7 100644 --- a/internal/cmd/commands/roles/funcs.go +++ b/internal/cmd/commands/roles/funcs.go @@ -174,6 +174,12 @@ func populateFlags(c *Command, f *base.FlagSet, flagNames []string) { Target: &c.flagGrants, Usage: "The grants to add, remove, or set. May be specified multiple times. Can be in compact string format or JSON (be sure to escape JSON properly).", }) + case "version": + f.IntVar(&base.IntVar{ + Name: "version", + Target: &c.flagVersion, + Usage: "The version of the resource against which to perform an update operation. If not specified, the command will perform a check-and-set automatically.", + }) } } } @@ -190,19 +196,19 @@ func generateRoleTableOutput(role *roles.Role) string { fmt.Sprintf(" Version: %d", role.Version), } } - if role.Name != nil { + if role.Name != "" { output = append(output, - fmt.Sprintf(" Name: %s", *role.Name), + fmt.Sprintf(" Name: %s", role.Name), ) } - if role.Description != nil { + if role.Description != "" { output = append(output, - fmt.Sprintf(" Description: %s", *role.Description), + fmt.Sprintf(" Description: %s", role.Description), ) } - if role.GrantScopeId != nil { + if role.GrantScopeId != "" { output = append(output, - fmt.Sprintf(" Grant Scope ID: %s", *role.GrantScopeId), + fmt.Sprintf(" Grant Scope ID: %s", role.GrantScopeId), ) } if len(role.Principals) > 0 { diff --git a/internal/cmd/commands/roles/role.go b/internal/cmd/commands/roles/role.go index e1cfc77c3..bc7ce97f9 100644 --- a/internal/cmd/commands/roles/role.go +++ b/internal/cmd/commands/roles/role.go @@ -27,6 +27,7 @@ type Command struct { flagGrantScopeId string flagPrincipals []string flagGrants []string + flagVersion int } func (c *Command) Synopsis() string { @@ -57,15 +58,15 @@ var helpMap = map[string]func() string{ var flagsMap = map[string][]string{ "create": {"name", "description", "grantscopeid"}, - "update": {"id", "name", "description", "grantscopeid"}, + "update": {"id", "name", "description", "grantscopeid", "version"}, "read": {"id"}, "delete": {"id"}, - "add-principals": {"id", "principal"}, - "set-principals": {"id", "principal"}, - "remove-principals": {"id", "principal"}, - "add-grants": {"id", "grant"}, - "set-grants": {"id", "grant"}, - "remove-grants": {"id", "grant"}, + "add-principals": {"id", "principal", "version"}, + "set-principals": {"id", "principal", "version"}, + "remove-principals": {"id", "principal", "version"}, + "add-grants": {"id", "grant", "version"}, + "set-grants": {"id", "grant", "version"}, + "remove-grants": {"id", "grant", "version"}, } func (c *Command) Help() string { @@ -115,30 +116,28 @@ func (c *Command) Run(args []string) int { return 2 } - role := &roles.Role{ - Client: client, - } + var opts []roles.Option switch c.flagName { case "": case "null": - role.SetDefault("name") + opts = append(opts, roles.DefaultName()) default: - role.Name = api.String(c.flagName) + opts = append(opts, roles.WithName(c.flagName)) } switch c.flagDescription { case "": case "null": - role.SetDefault("description") + opts = append(opts, roles.DefaultDescription()) default: - role.Description = api.String(c.flagDescription) + opts = append(opts, roles.WithDescription(c.flagDescription)) } switch c.flagGrantScopeId { case "": case "null": - role.SetDefault("grantscopeid") + opts = append(opts, roles.DefaultGrantScopeId()) default: - role.GrantScopeId = api.String(c.flagGrantScopeId) + opts = append(opts, roles.WithGrantScopeId(c.flagGrantScopeId)) } principals := c.flagPrincipals @@ -193,51 +192,50 @@ func (c *Command) Run(args []string) int { } } - var apiErr *api.Error - - var existed bool - var listedRoles []*roles.Role + roleClient := roles.NewRoleClient(client) // Perform check-and-set when needed + var version uint32 switch c.Func { case "create", "read", "delete", "list": // These don't udpate so don't need the existing version default: - existingRole, existingApiErr, existingErr := role.ReadRole(c.Context, c.flagId) - if existingErr != nil { - c.UI.Error(fmt.Sprintf("Error performing initial check-and-set read: %s", err.Error())) - return 2 + switch c.flagVersion { + case 0: + opts = append(opts, roles.WithAutomaticVersioning()) + default: + version = uint32(c.flagVersion) } - if existingApiErr != nil { - c.UI.Error(fmt.Sprintf("Error from controller when performing initial check-and-set read: %s", pretty.Sprint(apiErr))) - return 1 - } - role.Version = existingRole.Version } + var existed bool + var role *roles.Role + var listedRoles []*roles.Role + var apiErr *api.Error + switch c.Func { case "create": - role, apiErr, err = role.CreateRole(c.Context, role) + role, apiErr, err = roleClient.Create(c.Context, opts...) case "update": - role, apiErr, err = role.UpdateRole(c.Context, role) + role, apiErr, err = roleClient.Update(c.Context, c.flagId, version, opts...) case "read": - role, apiErr, err = role.ReadRole(c.Context, c.flagId) + role, apiErr, err = roleClient.Read(c.Context, c.flagId, opts...) case "delete": - existed, apiErr, err = role.DeleteRole(c.Context, c.flagId) + existed, apiErr, err = roleClient.Delete(c.Context, c.flagId, opts...) case "list": - listedRoles, apiErr, err = role.ListRoles(c.Context) + listedRoles, apiErr, err = roleClient.List(c.Context, opts...) case "add-principals": - role, apiErr, err = role.AddPrincipals(c.Context, c.flagId, principals) + role, apiErr, err = roleClient.AddPrincipals(c.Context, c.flagId, version, principals, opts...) case "set-principals": - role, apiErr, err = role.SetPrincipals(c.Context, c.flagId, principals) + role, apiErr, err = roleClient.SetPrincipals(c.Context, c.flagId, version, principals, opts...) case "remove-principals": - role, apiErr, err = role.RemovePrincipals(c.Context, c.flagId, principals) + role, apiErr, err = roleClient.RemovePrincipals(c.Context, c.flagId, version, principals, opts...) case "add-grants": - role, apiErr, err = role.AddGrants(c.Context, c.flagId, grants) + role, apiErr, err = roleClient.AddGrants(c.Context, c.flagId, version, grants, opts...) case "set-grants": - role, apiErr, err = role.SetGrants(c.Context, c.flagId, grants) + role, apiErr, err = roleClient.SetGrants(c.Context, c.flagId, version, grants, opts...) case "remove-grants": - role, apiErr, err = role.RemoveGrants(c.Context, c.flagId, grants) + role, apiErr, err = roleClient.RemoveGrants(c.Context, c.flagId, version, grants, opts...) } plural := "role" @@ -271,7 +269,6 @@ func (c *Command) Run(args []string) int { return 0 case "list": - switch base.Format(c.UI) { case "json": if len(listedRoles) == 0 { @@ -304,14 +301,14 @@ func (c *Command) Run(args []string) int { fmt.Sprintf(" ID: %s", r.Id), ) } - if r.Name != nil { + if r.Name != "" { output = append(output, - fmt.Sprintf(" Name: %s", *r.Name), + fmt.Sprintf(" Name: %s", r.Name), ) } - if r.Description != nil { + if r.Description != "" { output = append(output, - fmt.Sprintf(" Description: %s", *r.Description), + fmt.Sprintf(" Description: %s", r.Description), ) } } diff --git a/internal/cmd/commands/scopes/create.go b/internal/cmd/commands/scopes/create.go index e8efee3fb..a505c5c2a 100644 --- a/internal/cmd/commands/scopes/create.go +++ b/internal/cmd/commands/scopes/create.go @@ -4,7 +4,6 @@ import ( "fmt" "strings" - "github.com/hashicorp/watchtower/api" "github.com/hashicorp/watchtower/api/scopes" "github.com/hashicorp/watchtower/internal/cmd/base" "github.com/kr/pretty" @@ -86,14 +85,9 @@ func (c *CreateScopeCommand) Run(args []string) int { return 2 } - scp := &scopes.Scope{ - Client: client, - Name: api.StringOrNil(c.flagName), - Description: api.StringOrNil(c.flagDescription), - } - - var apiErr *api.Error - scp, apiErr, err = scp.CreateScope(c.Context, scp) + scp, apiErr, err := scopes.NewScopeClient(client).Create(c.Context, + scopes.WithName(c.flagName), + scopes.WithDescription(c.flagDescription)) switch { case err != nil: diff --git a/internal/cmd/commands/scopes/funcs.go b/internal/cmd/commands/scopes/funcs.go index d162ad5d8..687a94746 100644 --- a/internal/cmd/commands/scopes/funcs.go +++ b/internal/cmd/commands/scopes/funcs.go @@ -21,14 +21,14 @@ func printScope(in *scopes.Scope) string { }..., ) } - if in.Name != nil { + if in.Name != "" { ret = append(ret, - fmt.Sprintf(" Name: %s", *in.Name), + fmt.Sprintf(" Name: %s", in.Name), ) } - if in.Description != nil { + if in.Description != "" { ret = append(ret, - fmt.Sprintf(" Description: %s", *in.Description), + fmt.Sprintf(" Description: %s", in.Description), ) } diff --git a/internal/cmd/commands/scopes/read.go b/internal/cmd/commands/scopes/read.go index d3e0e2951..0488c9513 100644 --- a/internal/cmd/commands/scopes/read.go +++ b/internal/cmd/commands/scopes/read.go @@ -4,7 +4,6 @@ import ( "fmt" "strings" - "github.com/hashicorp/watchtower/api" "github.com/hashicorp/watchtower/api/scopes" "github.com/hashicorp/watchtower/internal/cmd/base" "github.com/kr/pretty" @@ -77,16 +76,12 @@ func (c *ReadScopeCommand) Run(args []string) int { return 2 } - id := c.flagId - if id == "" { - id = client.ScopeId() - } - scp := &scopes.Scope{ - Client: client, + if len(c.flagId) == 0 { + c.UI.Error("No scope ID supplied via -id") + return 1 } - var apiErr *api.Error - scp, apiErr, err = scp.ReadScope(c.Context, id) + scp, apiErr, err := scopes.NewScopeClient(client).Read(c.Context, c.flagId) switch { case err != nil: diff --git a/internal/db/migrations/postgres.gen.go b/internal/db/migrations/postgres.gen.go index 9040b351e..2471f2526 100644 --- a/internal/db/migrations/postgres.gen.go +++ b/internal/db/migrations/postgres.gen.go @@ -544,7 +544,11 @@ create table iam_scope ( ) ), description text, - parent_id text references iam_scope(public_id) on delete cascade on update cascade + parent_id text references iam_scope(public_id) on delete cascade on update cascade, + + -- version allows optimistic locking of the role when modifying the role + -- itself and when modifying dependent items like principal roles. + version wt_version not null default 1 ); create table iam_scope_global ( @@ -643,6 +647,10 @@ before insert on iam_scope for each row execute procedure default_create_time(); +create trigger + update_version_column +after update on iam_scope + for each row execute procedure update_version_column(); -- define the immutable fields for iam_scope create trigger @@ -719,6 +727,7 @@ create table iam_user ( scope_id wt_scope_id not null references iam_scope(public_id) on delete cascade on update cascade, unique(name, scope_id), disabled boolean not null default false, + version wt_version not null default 1, -- The order of columns is important for performance. See: -- https://dba.stackexchange.com/questions/58970/enforcing-constraints-two-tables-away/58972#58972 @@ -796,6 +805,11 @@ begin end; $$ language plpgsql; +create trigger + update_version_column +after update on iam_user + for each row execute procedure update_version_column(); + create trigger ensure_user_scope_id_valid before @@ -843,13 +857,8 @@ create table iam_role ( grant_scope_id wt_scope_id not null references iam_scope(public_id) on delete cascade on update cascade, unique(name, scope_id), disabled boolean not null default false, - -- version allows optimistic locking of the role when modifying the role - -- itself and when modifying dependent items like principal roles. - -- TODO (jlambert 6/2020) add before update trigger to automatically - -- increment the version when needed. This trigger can be addded when PR - -- #126 is merged and update_version_column() is available. - version bigint not null default 1, - + version wt_version not null default 1, + -- add unique index so a composite fk can be declared. unique(scope_id, public_id) ); @@ -960,7 +969,7 @@ create table iam_group ( disabled boolean not null default false, -- version allows optimistic locking of the group when modifying the group -- itself and when modifying dependent items like group members. - version bigint not null default 1, + version wt_version not null default 1, -- add unique index so a composite fk can be declared. unique(scope_id, public_id) diff --git a/internal/db/migrations/postgres/06_iam.up.sql b/internal/db/migrations/postgres/06_iam.up.sql index fdbba194e..14d7e55a3 100644 --- a/internal/db/migrations/postgres/06_iam.up.sql +++ b/internal/db/migrations/postgres/06_iam.up.sql @@ -39,7 +39,11 @@ create table iam_scope ( ) ), description text, - parent_id text references iam_scope(public_id) on delete cascade on update cascade + parent_id text references iam_scope(public_id) on delete cascade on update cascade, + + -- version allows optimistic locking of the role when modifying the role + -- itself and when modifying dependent items like principal roles. + version wt_version not null default 1 ); create table iam_scope_global ( @@ -138,6 +142,10 @@ before insert on iam_scope for each row execute procedure default_create_time(); +create trigger + update_version_column +after update on iam_scope + for each row execute procedure update_version_column(); -- define the immutable fields for iam_scope create trigger @@ -214,6 +222,7 @@ create table iam_user ( scope_id wt_scope_id not null references iam_scope(public_id) on delete cascade on update cascade, unique(name, scope_id), disabled boolean not null default false, + version wt_version not null default 1, -- The order of columns is important for performance. See: -- https://dba.stackexchange.com/questions/58970/enforcing-constraints-two-tables-away/58972#58972 @@ -291,6 +300,11 @@ begin end; $$ language plpgsql; +create trigger + update_version_column +after update on iam_user + for each row execute procedure update_version_column(); + create trigger ensure_user_scope_id_valid before @@ -338,13 +352,8 @@ create table iam_role ( grant_scope_id wt_scope_id not null references iam_scope(public_id) on delete cascade on update cascade, unique(name, scope_id), disabled boolean not null default false, - -- version allows optimistic locking of the role when modifying the role - -- itself and when modifying dependent items like principal roles. - -- TODO (jlambert 6/2020) add before update trigger to automatically - -- increment the version when needed. This trigger can be addded when PR - -- #126 is merged and update_version_column() is available. - version bigint not null default 1, - + version wt_version not null default 1, + -- add unique index so a composite fk can be declared. unique(scope_id, public_id) ); @@ -455,7 +464,7 @@ create table iam_group ( disabled boolean not null default false, -- version allows optimistic locking of the group when modifying the group -- itself and when modifying dependent items like group members. - version bigint not null default 1, + version wt_version not null default 1, -- add unique index so a composite fk can be declared. unique(scope_id, public_id) diff --git a/internal/gen/controller.swagger.json b/internal/gen/controller.swagger.json index 8e5d4e3a7..af2b2624f 100644 --- a/internal/gen/controller.swagger.json +++ b/internal/gen/controller.swagger.json @@ -103,7 +103,7 @@ "200": { "description": "", "schema": { - "$ref": "#/definitions/controller.api.resources.auth.v1.AuthMethod" + "$ref": "#/definitions/controller.api.resources.authmethods.v1.AuthMethod" } } }, @@ -113,7 +113,7 @@ "in": "body", "required": true, "schema": { - "$ref": "#/definitions/controller.api.resources.auth.v1.AuthMethod" + "$ref": "#/definitions/controller.api.resources.authmethods.v1.AuthMethod" } } ], @@ -159,7 +159,7 @@ "200": { "description": "", "schema": { - "$ref": "#/definitions/controller.api.resources.auth.v1.Account" + "$ref": "#/definitions/controller.api.resources.authmethods.v1.Account" } } }, @@ -175,7 +175,7 @@ "in": "body", "required": true, "schema": { - "$ref": "#/definitions/controller.api.resources.auth.v1.Account" + "$ref": "#/definitions/controller.api.resources.authmethods.v1.Account" } } ], @@ -192,7 +192,7 @@ "200": { "description": "", "schema": { - "$ref": "#/definitions/controller.api.resources.auth.v1.Account" + "$ref": "#/definitions/controller.api.resources.authmethods.v1.Account" } } }, @@ -256,7 +256,7 @@ "200": { "description": "", "schema": { - "$ref": "#/definitions/controller.api.resources.auth.v1.Account" + "$ref": "#/definitions/controller.api.resources.authmethods.v1.Account" } } }, @@ -278,7 +278,7 @@ "in": "body", "required": true, "schema": { - "$ref": "#/definitions/controller.api.resources.auth.v1.Account" + "$ref": "#/definitions/controller.api.resources.authmethods.v1.Account" } } ], @@ -329,7 +329,7 @@ "200": { "description": "", "schema": { - "$ref": "#/definitions/controller.api.resources.auth.v1.AuthMethod" + "$ref": "#/definitions/controller.api.resources.authmethods.v1.AuthMethod" } } }, @@ -381,7 +381,7 @@ "200": { "description": "", "schema": { - "$ref": "#/definitions/controller.api.resources.auth.v1.AuthMethod" + "$ref": "#/definitions/controller.api.resources.authmethods.v1.AuthMethod" } } }, @@ -397,7 +397,7 @@ "in": "body", "required": true, "schema": { - "$ref": "#/definitions/controller.api.resources.auth.v1.AuthMethod" + "$ref": "#/definitions/controller.api.resources.authmethods.v1.AuthMethod" } } ], @@ -1806,7 +1806,7 @@ } }, "definitions": { - "controller.api.resources.auth.v1.Account": { + "controller.api.resources.authmethods.v1.Account": { "type": "object", "properties": { "id": { @@ -1860,7 +1860,7 @@ }, "title": "Account contains all fields related to an auth Account resource" }, - "controller.api.resources.auth.v1.AuthMethod": { + "controller.api.resources.authmethods.v1.AuthMethod": { "type": "object", "properties": { "id": { @@ -2000,7 +2000,7 @@ "version": { "type": "integer", "format": "int64", - "description": "The version can be used in subsiquent write requests to ensure this resource\nhas not changed and to fail the write if it has.\nOutput only.", + "description": "The version can be used in subsequent write requests to ensure this resource\nhas not changed and to fail the write if it has.\nOutput only.", "readOnly": true }, "member_ids": { @@ -2307,7 +2307,7 @@ "version": { "type": "integer", "format": "int64", - "description": "The version can be used in subsiquent write requests to ensure this resource\nhas not changed and to fail the write if it has.\nOutput only.", + "description": "The version can be used in subsequent write requests to ensure this resource\nhas not changed and to fail the write if it has.\nOutput only.", "readOnly": true }, "principal_ids": { @@ -2382,6 +2382,12 @@ "type": "boolean", "format": "boolean", "title": "Whether the resource is disabled" + }, + "version": { + "type": "integer", + "format": "int64", + "description": "The version can be used in subsequent write requests to ensure this\nresource has not changed and to fail the write if it has.\nOutput only.", + "readOnly": true } }, "title": "Scope contains all fields related to a Scope resource" @@ -2453,6 +2459,12 @@ "type": "boolean", "format": "boolean", "title": "Whether the resource is disabled" + }, + "version": { + "type": "integer", + "format": "int64", + "description": "The version can be used in subsequent write requests to ensure this\nresource has not changed and to fail the write if it has.\nOutput only.", + "readOnly": true } }, "title": "User contains all fields related to a User resource" @@ -2573,7 +2585,7 @@ "type": "string" }, "item": { - "$ref": "#/definitions/controller.api.resources.auth.v1.Account" + "$ref": "#/definitions/controller.api.resources.authmethods.v1.Account" } } }, @@ -2584,7 +2596,7 @@ "type": "string" }, "item": { - "$ref": "#/definitions/controller.api.resources.auth.v1.AuthMethod" + "$ref": "#/definitions/controller.api.resources.authmethods.v1.AuthMethod" } } }, @@ -2759,7 +2771,7 @@ "type": "object", "properties": { "item": { - "$ref": "#/definitions/controller.api.resources.auth.v1.Account" + "$ref": "#/definitions/controller.api.resources.authmethods.v1.Account" } } }, @@ -2767,7 +2779,7 @@ "type": "object", "properties": { "item": { - "$ref": "#/definitions/controller.api.resources.auth.v1.AuthMethod" + "$ref": "#/definitions/controller.api.resources.authmethods.v1.AuthMethod" } } }, @@ -2841,7 +2853,7 @@ "items": { "type": "array", "items": { - "$ref": "#/definitions/controller.api.resources.auth.v1.Account" + "$ref": "#/definitions/controller.api.resources.authmethods.v1.Account" } } } @@ -2852,7 +2864,7 @@ "items": { "type": "array", "items": { - "$ref": "#/definitions/controller.api.resources.auth.v1.AuthMethod" + "$ref": "#/definitions/controller.api.resources.authmethods.v1.AuthMethod" } } } @@ -3114,7 +3126,7 @@ "type": "object", "properties": { "item": { - "$ref": "#/definitions/controller.api.resources.auth.v1.Account" + "$ref": "#/definitions/controller.api.resources.authmethods.v1.Account" } } }, @@ -3122,7 +3134,7 @@ "type": "object", "properties": { "item": { - "$ref": "#/definitions/controller.api.resources.auth.v1.AuthMethod" + "$ref": "#/definitions/controller.api.resources.authmethods.v1.AuthMethod" } } }, diff --git a/internal/gen/controller/api/resources/auth/auth_method.pb.go b/internal/gen/controller/api/resources/auth/auth_method.pb.go deleted file mode 100644 index 454b350d3..000000000 --- a/internal/gen/controller/api/resources/auth/auth_method.pb.go +++ /dev/null @@ -1,355 +0,0 @@ -// Code generated by protoc-gen-go. DO NOT EDIT. -// versions: -// protoc-gen-go v1.25.0 -// protoc v3.12.3 -// source: controller/api/resources/auth/v1/auth_method.proto - -package auth - -import ( - proto "github.com/golang/protobuf/proto" - _struct "github.com/golang/protobuf/ptypes/struct" - timestamp "github.com/golang/protobuf/ptypes/timestamp" - wrappers "github.com/golang/protobuf/ptypes/wrappers" - scopes "github.com/hashicorp/watchtower/internal/gen/controller/api/resources/scopes" - _ "github.com/hashicorp/watchtower/internal/gen/controller/protooptions" - protoreflect "google.golang.org/protobuf/reflect/protoreflect" - protoimpl "google.golang.org/protobuf/runtime/protoimpl" - reflect "reflect" - sync "sync" -) - -const ( - // Verify that this generated code is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) - // Verify that runtime/protoimpl is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) -) - -// This is a compile-time assertion that a sufficiently up-to-date version -// of the legacy proto package is being used. -const _ = proto.ProtoPackageIsVersion4 - -// AuthMethod contains all fields related to a AuthMethod resource -type AuthMethod struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // The ID of the AuthMethod - // Output only. - Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` - // Scope information for this resource - // Output only. - Scope *scopes.ScopeInfo `protobuf:"bytes,2,opt,name=scope,proto3" json:"scope,omitempty"` - // Optional name for identification purposes - Name *wrappers.StringValue `protobuf:"bytes,3,opt,name=name,proto3" json:"name,omitempty"` - // Optional user-set descripton for identification purposes - Description *wrappers.StringValue `protobuf:"bytes,4,opt,name=description,proto3" json:"description,omitempty"` - // The time this resource was created - // Output only. - CreatedTime *timestamp.Timestamp `protobuf:"bytes,5,opt,name=created_time,proto3" json:"created_time,omitempty"` - // The time this resource was last updated. - // Output only. - UpdatedTime *timestamp.Timestamp `protobuf:"bytes,6,opt,name=updated_time,proto3" json:"updated_time,omitempty"` - // The auth method type. This can be "password" or "oidc". - Type string `protobuf:"bytes,7,opt,name=type,proto3" json:"type,omitempty"` - // The attributes that are applied for the specific Auth Method type. - Attributes *_struct.Struct `protobuf:"bytes,8,opt,name=attributes,proto3" json:"attributes,omitempty"` -} - -func (x *AuthMethod) Reset() { - *x = AuthMethod{} - if protoimpl.UnsafeEnabled { - mi := &file_controller_api_resources_auth_v1_auth_method_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *AuthMethod) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*AuthMethod) ProtoMessage() {} - -func (x *AuthMethod) ProtoReflect() protoreflect.Message { - mi := &file_controller_api_resources_auth_v1_auth_method_proto_msgTypes[0] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use AuthMethod.ProtoReflect.Descriptor instead. -func (*AuthMethod) Descriptor() ([]byte, []int) { - return file_controller_api_resources_auth_v1_auth_method_proto_rawDescGZIP(), []int{0} -} - -func (x *AuthMethod) GetId() string { - if x != nil { - return x.Id - } - return "" -} - -func (x *AuthMethod) GetScope() *scopes.ScopeInfo { - if x != nil { - return x.Scope - } - return nil -} - -func (x *AuthMethod) GetName() *wrappers.StringValue { - if x != nil { - return x.Name - } - return nil -} - -func (x *AuthMethod) GetDescription() *wrappers.StringValue { - if x != nil { - return x.Description - } - return nil -} - -func (x *AuthMethod) GetCreatedTime() *timestamp.Timestamp { - if x != nil { - return x.CreatedTime - } - return nil -} - -func (x *AuthMethod) GetUpdatedTime() *timestamp.Timestamp { - if x != nil { - return x.UpdatedTime - } - return nil -} - -func (x *AuthMethod) GetType() string { - if x != nil { - return x.Type - } - return "" -} - -func (x *AuthMethod) GetAttributes() *_struct.Struct { - if x != nil { - return x.Attributes - } - return nil -} - -type PasswordAuthMethodAttributes struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // The minimum length allowed for user names for accounts in this auth method. - MinUserNameLength uint32 `protobuf:"varint,1,opt,name=min_user_name_length,json=minUserNameLength,proto3" json:"min_user_name_length,omitempty"` - // The minimum length allowed for passwords for accounts in this auth method. - MinPasswordLength uint32 `protobuf:"varint,2,opt,name=min_password_length,json=minPasswordLength,proto3" json:"min_password_length,omitempty"` -} - -func (x *PasswordAuthMethodAttributes) Reset() { - *x = PasswordAuthMethodAttributes{} - if protoimpl.UnsafeEnabled { - mi := &file_controller_api_resources_auth_v1_auth_method_proto_msgTypes[1] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *PasswordAuthMethodAttributes) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*PasswordAuthMethodAttributes) ProtoMessage() {} - -func (x *PasswordAuthMethodAttributes) ProtoReflect() protoreflect.Message { - mi := &file_controller_api_resources_auth_v1_auth_method_proto_msgTypes[1] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use PasswordAuthMethodAttributes.ProtoReflect.Descriptor instead. -func (*PasswordAuthMethodAttributes) Descriptor() ([]byte, []int) { - return file_controller_api_resources_auth_v1_auth_method_proto_rawDescGZIP(), []int{1} -} - -func (x *PasswordAuthMethodAttributes) GetMinUserNameLength() uint32 { - if x != nil { - return x.MinUserNameLength - } - return 0 -} - -func (x *PasswordAuthMethodAttributes) GetMinPasswordLength() uint32 { - if x != nil { - return x.MinPasswordLength - } - return 0 -} - -var File_controller_api_resources_auth_v1_auth_method_proto protoreflect.FileDescriptor - -var file_controller_api_resources_auth_v1_auth_method_proto_rawDesc = []byte{ - 0x0a, 0x32, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x65, 0x72, 0x2f, 0x61, 0x70, 0x69, - 0x2f, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, 0x2f, 0x61, 0x75, 0x74, 0x68, 0x2f, - 0x76, 0x31, 0x2f, 0x61, 0x75, 0x74, 0x68, 0x5f, 0x6d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x2e, 0x70, - 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x20, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x65, 0x72, - 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, 0x2e, 0x61, - 0x75, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x1a, 0x1f, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, - 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, - 0x70, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, - 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x77, 0x72, 0x61, 0x70, 0x70, 0x65, 0x72, - 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1c, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, - 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x73, 0x74, 0x72, 0x75, 0x63, 0x74, 0x2e, - 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x65, - 0x72, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, 0x2f, - 0x73, 0x63, 0x6f, 0x70, 0x65, 0x73, 0x2f, 0x76, 0x31, 0x2f, 0x73, 0x63, 0x6f, 0x70, 0x65, 0x2e, - 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x28, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x65, - 0x72, 0x2f, 0x63, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x5f, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, - 0x2f, 0x76, 0x31, 0x2f, 0x6d, 0x61, 0x73, 0x6b, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, - 0xd2, 0x03, 0x0a, 0x0a, 0x41, 0x75, 0x74, 0x68, 0x4d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x12, 0x0e, - 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x43, - 0x0a, 0x05, 0x73, 0x63, 0x6f, 0x70, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2d, 0x2e, - 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x65, 0x72, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x72, - 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, 0x2e, 0x73, 0x63, 0x6f, 0x70, 0x65, 0x73, 0x2e, - 0x76, 0x31, 0x2e, 0x53, 0x63, 0x6f, 0x70, 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x05, 0x73, 0x63, - 0x6f, 0x70, 0x65, 0x12, 0x42, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, - 0x0b, 0x32, 0x1c, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, - 0x62, 0x75, 0x66, 0x2e, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x42, - 0x10, 0xc2, 0xdd, 0x29, 0x0c, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x04, 0x6e, 0x61, 0x6d, - 0x65, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x5e, 0x0a, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, - 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x67, - 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x53, - 0x74, 0x72, 0x69, 0x6e, 0x67, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x42, 0x1e, 0xc2, 0xdd, 0x29, 0x1a, - 0x0a, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x0b, 0x64, - 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x0b, 0x64, 0x65, 0x73, 0x63, - 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x3e, 0x0a, 0x0c, 0x63, 0x72, 0x65, 0x61, 0x74, - 0x65, 0x64, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, - 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, - 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x0c, 0x63, 0x72, 0x65, 0x61, 0x74, - 0x65, 0x64, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x12, 0x3e, 0x0a, 0x0c, 0x75, 0x70, 0x64, 0x61, 0x74, - 0x65, 0x64, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, - 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, - 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x0c, 0x75, 0x70, 0x64, 0x61, 0x74, - 0x65, 0x64, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, - 0x07, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x12, 0x37, 0x0a, 0x0a, 0x61, - 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x73, 0x18, 0x08, 0x20, 0x01, 0x28, 0x0b, 0x32, - 0x17, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, - 0x66, 0x2e, 0x53, 0x74, 0x72, 0x75, 0x63, 0x74, 0x52, 0x0a, 0x61, 0x74, 0x74, 0x72, 0x69, 0x62, - 0x75, 0x74, 0x65, 0x73, 0x22, 0x7f, 0x0a, 0x1c, 0x50, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, - 0x41, 0x75, 0x74, 0x68, 0x4d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x41, 0x74, 0x74, 0x72, 0x69, 0x62, - 0x75, 0x74, 0x65, 0x73, 0x12, 0x2f, 0x0a, 0x14, 0x6d, 0x69, 0x6e, 0x5f, 0x75, 0x73, 0x65, 0x72, - 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x5f, 0x6c, 0x65, 0x6e, 0x67, 0x74, 0x68, 0x18, 0x01, 0x20, 0x01, - 0x28, 0x0d, 0x52, 0x11, 0x6d, 0x69, 0x6e, 0x55, 0x73, 0x65, 0x72, 0x4e, 0x61, 0x6d, 0x65, 0x4c, - 0x65, 0x6e, 0x67, 0x74, 0x68, 0x12, 0x2e, 0x0a, 0x13, 0x6d, 0x69, 0x6e, 0x5f, 0x70, 0x61, 0x73, - 0x73, 0x77, 0x6f, 0x72, 0x64, 0x5f, 0x6c, 0x65, 0x6e, 0x67, 0x74, 0x68, 0x18, 0x02, 0x20, 0x01, - 0x28, 0x0d, 0x52, 0x11, 0x6d, 0x69, 0x6e, 0x50, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x4c, - 0x65, 0x6e, 0x67, 0x74, 0x68, 0x42, 0x51, 0x5a, 0x4f, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, - 0x63, 0x6f, 0x6d, 0x2f, 0x68, 0x61, 0x73, 0x68, 0x69, 0x63, 0x6f, 0x72, 0x70, 0x2f, 0x77, 0x61, - 0x74, 0x63, 0x68, 0x74, 0x6f, 0x77, 0x65, 0x72, 0x2f, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x61, - 0x6c, 0x2f, 0x67, 0x65, 0x6e, 0x2f, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x65, 0x72, - 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, 0x2f, 0x61, - 0x75, 0x74, 0x68, 0x3b, 0x61, 0x75, 0x74, 0x68, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, -} - -var ( - file_controller_api_resources_auth_v1_auth_method_proto_rawDescOnce sync.Once - file_controller_api_resources_auth_v1_auth_method_proto_rawDescData = file_controller_api_resources_auth_v1_auth_method_proto_rawDesc -) - -func file_controller_api_resources_auth_v1_auth_method_proto_rawDescGZIP() []byte { - file_controller_api_resources_auth_v1_auth_method_proto_rawDescOnce.Do(func() { - file_controller_api_resources_auth_v1_auth_method_proto_rawDescData = protoimpl.X.CompressGZIP(file_controller_api_resources_auth_v1_auth_method_proto_rawDescData) - }) - return file_controller_api_resources_auth_v1_auth_method_proto_rawDescData -} - -var file_controller_api_resources_auth_v1_auth_method_proto_msgTypes = make([]protoimpl.MessageInfo, 2) -var file_controller_api_resources_auth_v1_auth_method_proto_goTypes = []interface{}{ - (*AuthMethod)(nil), // 0: controller.api.resources.auth.v1.AuthMethod - (*PasswordAuthMethodAttributes)(nil), // 1: controller.api.resources.auth.v1.PasswordAuthMethodAttributes - (*scopes.ScopeInfo)(nil), // 2: controller.api.resources.scopes.v1.ScopeInfo - (*wrappers.StringValue)(nil), // 3: google.protobuf.StringValue - (*timestamp.Timestamp)(nil), // 4: google.protobuf.Timestamp - (*_struct.Struct)(nil), // 5: google.protobuf.Struct -} -var file_controller_api_resources_auth_v1_auth_method_proto_depIdxs = []int32{ - 2, // 0: controller.api.resources.auth.v1.AuthMethod.scope:type_name -> controller.api.resources.scopes.v1.ScopeInfo - 3, // 1: controller.api.resources.auth.v1.AuthMethod.name:type_name -> google.protobuf.StringValue - 3, // 2: controller.api.resources.auth.v1.AuthMethod.description:type_name -> google.protobuf.StringValue - 4, // 3: controller.api.resources.auth.v1.AuthMethod.created_time:type_name -> google.protobuf.Timestamp - 4, // 4: controller.api.resources.auth.v1.AuthMethod.updated_time:type_name -> google.protobuf.Timestamp - 5, // 5: controller.api.resources.auth.v1.AuthMethod.attributes:type_name -> google.protobuf.Struct - 6, // [6:6] is the sub-list for method output_type - 6, // [6:6] is the sub-list for method input_type - 6, // [6:6] is the sub-list for extension type_name - 6, // [6:6] is the sub-list for extension extendee - 0, // [0:6] is the sub-list for field type_name -} - -func init() { file_controller_api_resources_auth_v1_auth_method_proto_init() } -func file_controller_api_resources_auth_v1_auth_method_proto_init() { - if File_controller_api_resources_auth_v1_auth_method_proto != nil { - return - } - if !protoimpl.UnsafeEnabled { - file_controller_api_resources_auth_v1_auth_method_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*AuthMethod); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_controller_api_resources_auth_v1_auth_method_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*PasswordAuthMethodAttributes); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - } - type x struct{} - out := protoimpl.TypeBuilder{ - File: protoimpl.DescBuilder{ - GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: file_controller_api_resources_auth_v1_auth_method_proto_rawDesc, - NumEnums: 0, - NumMessages: 2, - NumExtensions: 0, - NumServices: 0, - }, - GoTypes: file_controller_api_resources_auth_v1_auth_method_proto_goTypes, - DependencyIndexes: file_controller_api_resources_auth_v1_auth_method_proto_depIdxs, - MessageInfos: file_controller_api_resources_auth_v1_auth_method_proto_msgTypes, - }.Build() - File_controller_api_resources_auth_v1_auth_method_proto = out.File - file_controller_api_resources_auth_v1_auth_method_proto_rawDesc = nil - file_controller_api_resources_auth_v1_auth_method_proto_goTypes = nil - file_controller_api_resources_auth_v1_auth_method_proto_depIdxs = nil -} diff --git a/internal/gen/controller/api/resources/auth/account.pb.go b/internal/gen/controller/api/resources/authmethods/account.pb.go similarity index 50% rename from internal/gen/controller/api/resources/auth/account.pb.go rename to internal/gen/controller/api/resources/authmethods/account.pb.go index 09ee4bec8..8e5c99334 100644 --- a/internal/gen/controller/api/resources/auth/account.pb.go +++ b/internal/gen/controller/api/resources/authmethods/account.pb.go @@ -2,9 +2,9 @@ // versions: // protoc-gen-go v1.25.0 // protoc v3.12.3 -// source: controller/api/resources/auth/v1/account.proto +// source: controller/api/resources/authmethods/v1/account.proto -package auth +package authmethods import ( proto "github.com/golang/protobuf/proto" @@ -66,7 +66,7 @@ type Account struct { func (x *Account) Reset() { *x = Account{} if protoimpl.UnsafeEnabled { - mi := &file_controller_api_resources_auth_v1_account_proto_msgTypes[0] + mi := &file_controller_api_resources_authmethods_v1_account_proto_msgTypes[0] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -79,7 +79,7 @@ func (x *Account) String() string { func (*Account) ProtoMessage() {} func (x *Account) ProtoReflect() protoreflect.Message { - mi := &file_controller_api_resources_auth_v1_account_proto_msgTypes[0] + mi := &file_controller_api_resources_authmethods_v1_account_proto_msgTypes[0] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -92,7 +92,7 @@ func (x *Account) ProtoReflect() protoreflect.Message { // Deprecated: Use Account.ProtoReflect.Descriptor instead. func (*Account) Descriptor() ([]byte, []int) { - return file_controller_api_resources_auth_v1_account_proto_rawDescGZIP(), []int{0} + return file_controller_api_resources_authmethods_v1_account_proto_rawDescGZIP(), []int{0} } func (x *Account) GetId() string { @@ -179,7 +179,7 @@ type PasswordAccountAttributes struct { func (x *PasswordAccountAttributes) Reset() { *x = PasswordAccountAttributes{} if protoimpl.UnsafeEnabled { - mi := &file_controller_api_resources_auth_v1_account_proto_msgTypes[1] + mi := &file_controller_api_resources_authmethods_v1_account_proto_msgTypes[1] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -192,7 +192,7 @@ func (x *PasswordAccountAttributes) String() string { func (*PasswordAccountAttributes) ProtoMessage() {} func (x *PasswordAccountAttributes) ProtoReflect() protoreflect.Message { - mi := &file_controller_api_resources_auth_v1_account_proto_msgTypes[1] + mi := &file_controller_api_resources_authmethods_v1_account_proto_msgTypes[1] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -205,7 +205,7 @@ func (x *PasswordAccountAttributes) ProtoReflect() protoreflect.Message { // Deprecated: Use PasswordAccountAttributes.ProtoReflect.Descriptor instead. func (*PasswordAccountAttributes) Descriptor() ([]byte, []int) { - return file_controller_api_resources_auth_v1_account_proto_rawDescGZIP(), []int{1} + return file_controller_api_resources_authmethods_v1_account_proto_rawDescGZIP(), []int{1} } func (x *PasswordAccountAttributes) GetUsername() string { @@ -222,26 +222,27 @@ func (x *PasswordAccountAttributes) GetPassword() *wrappers.StringValue { return nil } -var File_controller_api_resources_auth_v1_account_proto protoreflect.FileDescriptor +var File_controller_api_resources_authmethods_v1_account_proto protoreflect.FileDescriptor -var file_controller_api_resources_auth_v1_account_proto_rawDesc = []byte{ - 0x0a, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x65, 0x72, 0x2f, 0x61, 0x70, 0x69, - 0x2f, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, 0x2f, 0x61, 0x75, 0x74, 0x68, 0x2f, - 0x76, 0x31, 0x2f, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, - 0x12, 0x20, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x65, 0x72, 0x2e, 0x61, 0x70, 0x69, - 0x2e, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, 0x2e, 0x61, 0x75, 0x74, 0x68, 0x2e, - 0x76, 0x31, 0x1a, 0x1f, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, - 0x62, 0x75, 0x66, 0x2f, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x2e, 0x70, 0x72, - 0x6f, 0x74, 0x6f, 0x1a, 0x1e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, - 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x77, 0x72, 0x61, 0x70, 0x70, 0x65, 0x72, 0x73, 0x2e, 0x70, 0x72, - 0x6f, 0x74, 0x6f, 0x1a, 0x1c, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, - 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x73, 0x74, 0x72, 0x75, 0x63, 0x74, 0x2e, 0x70, 0x72, 0x6f, 0x74, - 0x6f, 0x1a, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x65, 0x72, 0x2f, 0x61, 0x70, - 0x69, 0x2f, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, 0x2f, 0x73, 0x63, 0x6f, 0x70, - 0x65, 0x73, 0x2f, 0x76, 0x31, 0x2f, 0x73, 0x63, 0x6f, 0x70, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, - 0x6f, 0x1a, 0x28, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x65, 0x72, 0x2f, 0x63, 0x75, - 0x73, 0x74, 0x6f, 0x6d, 0x5f, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2f, 0x76, 0x31, 0x2f, - 0x6d, 0x61, 0x73, 0x6b, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xaf, 0x04, 0x0a, 0x07, +var file_controller_api_resources_authmethods_v1_account_proto_rawDesc = []byte{ + 0x0a, 0x35, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x65, 0x72, 0x2f, 0x61, 0x70, 0x69, + 0x2f, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, 0x2f, 0x61, 0x75, 0x74, 0x68, 0x6d, + 0x65, 0x74, 0x68, 0x6f, 0x64, 0x73, 0x2f, 0x76, 0x31, 0x2f, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, + 0x74, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x27, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, + 0x6c, 0x65, 0x72, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, + 0x73, 0x2e, 0x61, 0x75, 0x74, 0x68, 0x6d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x73, 0x2e, 0x76, 0x31, + 0x1a, 0x1f, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, + 0x66, 0x2f, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x2e, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x1a, 0x1e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, + 0x75, 0x66, 0x2f, 0x77, 0x72, 0x61, 0x70, 0x70, 0x65, 0x72, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x1a, 0x1c, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, + 0x75, 0x66, 0x2f, 0x73, 0x74, 0x72, 0x75, 0x63, 0x74, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, + 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x65, 0x72, 0x2f, 0x61, 0x70, 0x69, 0x2f, + 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, 0x2f, 0x73, 0x63, 0x6f, 0x70, 0x65, 0x73, + 0x2f, 0x76, 0x31, 0x2f, 0x73, 0x63, 0x6f, 0x70, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, + 0x2a, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x65, 0x72, 0x2f, 0x63, 0x75, 0x73, 0x74, + 0x6f, 0x6d, 0x5f, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2f, 0x76, 0x31, 0x2f, 0x6f, 0x70, + 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xc3, 0x04, 0x0a, 0x07, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x43, 0x0a, 0x05, 0x73, 0x63, 0x6f, 0x70, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2d, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, @@ -250,79 +251,82 @@ var file_controller_api_resources_auth_v1_account_proto_rawDesc = []byte{ 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x05, 0x73, 0x63, 0x6f, 0x70, 0x65, 0x12, 0x26, 0x0a, 0x0e, 0x61, 0x75, 0x74, 0x68, 0x5f, 0x6d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x5f, 0x69, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0e, 0x61, 0x75, 0x74, 0x68, 0x5f, 0x6d, 0x65, 0x74, 0x68, 0x6f, - 0x64, 0x5f, 0x69, 0x64, 0x12, 0x42, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x04, 0x20, 0x01, + 0x64, 0x5f, 0x69, 0x64, 0x12, 0x46, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x56, 0x61, 0x6c, 0x75, 0x65, - 0x42, 0x10, 0xc2, 0xdd, 0x29, 0x0c, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x04, 0x6e, 0x61, - 0x6d, 0x65, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x5e, 0x0a, 0x0b, 0x64, 0x65, 0x73, 0x63, - 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1c, 0x2e, - 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, - 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x42, 0x1e, 0xc2, 0xdd, 0x29, - 0x1a, 0x0a, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x0b, - 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x0b, 0x64, 0x65, 0x73, - 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x3e, 0x0a, 0x0c, 0x63, 0x72, 0x65, 0x61, - 0x74, 0x65, 0x64, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, - 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, - 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x0c, 0x63, 0x72, 0x65, 0x61, - 0x74, 0x65, 0x64, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x12, 0x3e, 0x0a, 0x0c, 0x75, 0x70, 0x64, 0x61, - 0x74, 0x65, 0x64, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, - 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, - 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x0c, 0x75, 0x70, 0x64, 0x61, - 0x74, 0x65, 0x64, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x12, 0x36, 0x0a, 0x08, 0x64, 0x69, 0x73, 0x61, - 0x62, 0x6c, 0x65, 0x64, 0x18, 0x08, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, - 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x42, 0x6f, 0x6f, - 0x6c, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, 0x08, 0x64, 0x69, 0x73, 0x61, 0x62, 0x6c, 0x65, 0x64, - 0x12, 0x12, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, 0x09, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, - 0x74, 0x79, 0x70, 0x65, 0x12, 0x37, 0x0a, 0x0a, 0x61, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, - 0x65, 0x73, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, - 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x53, 0x74, 0x72, 0x75, 0x63, - 0x74, 0x52, 0x0a, 0x61, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x73, 0x22, 0x71, 0x0a, - 0x19, 0x50, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, - 0x41, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x73, 0x12, 0x1a, 0x0a, 0x08, 0x75, 0x73, - 0x65, 0x72, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x75, 0x73, - 0x65, 0x72, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x38, 0x0a, 0x08, 0x70, 0x61, 0x73, 0x73, 0x77, 0x6f, - 0x72, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, - 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x53, 0x74, 0x72, 0x69, 0x6e, - 0x67, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, 0x08, 0x70, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, - 0x42, 0x51, 0x5a, 0x4f, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x68, + 0x42, 0x14, 0xa0, 0xda, 0x29, 0x01, 0xc2, 0xdd, 0x29, 0x0c, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, + 0x12, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x62, 0x0a, 0x0b, + 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x05, 0x20, 0x01, 0x28, + 0x0b, 0x32, 0x1c, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x62, 0x75, 0x66, 0x2e, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x42, + 0x22, 0xa0, 0xda, 0x29, 0x01, 0xc2, 0xdd, 0x29, 0x1a, 0x0a, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, + 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, + 0x69, 0x6f, 0x6e, 0x52, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, + 0x12, 0x3e, 0x0a, 0x0c, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x5f, 0x74, 0x69, 0x6d, 0x65, + 0x18, 0x06, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, + 0x6d, 0x70, 0x52, 0x0c, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x5f, 0x74, 0x69, 0x6d, 0x65, + 0x12, 0x3e, 0x0a, 0x0c, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x64, 0x5f, 0x74, 0x69, 0x6d, 0x65, + 0x18, 0x07, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, + 0x6d, 0x70, 0x52, 0x0c, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x64, 0x5f, 0x74, 0x69, 0x6d, 0x65, + 0x12, 0x3c, 0x0a, 0x08, 0x64, 0x69, 0x73, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x18, 0x08, 0x20, 0x01, + 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x42, 0x6f, 0x6f, 0x6c, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x42, 0x04, + 0xa0, 0xda, 0x29, 0x01, 0x52, 0x08, 0x64, 0x69, 0x73, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x12, 0x12, + 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, 0x09, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x74, 0x79, + 0x70, 0x65, 0x12, 0x3d, 0x0a, 0x0a, 0x61, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x73, + 0x18, 0x0a, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x53, 0x74, 0x72, 0x75, 0x63, 0x74, 0x42, + 0x04, 0xa0, 0xda, 0x29, 0x01, 0x52, 0x0a, 0x61, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, + 0x73, 0x22, 0x7d, 0x0a, 0x19, 0x50, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x41, 0x63, 0x63, + 0x6f, 0x75, 0x6e, 0x74, 0x41, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x73, 0x12, 0x20, + 0x0a, 0x08, 0x75, 0x73, 0x65, 0x72, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, + 0x42, 0x04, 0xa0, 0xda, 0x29, 0x01, 0x52, 0x08, 0x75, 0x73, 0x65, 0x72, 0x6e, 0x61, 0x6d, 0x65, + 0x12, 0x3e, 0x0a, 0x08, 0x70, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x18, 0x02, 0x20, 0x01, + 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x56, 0x61, 0x6c, 0x75, 0x65, + 0x42, 0x04, 0xa0, 0xda, 0x29, 0x01, 0x52, 0x08, 0x70, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, + 0x42, 0x5f, 0x5a, 0x5d, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x68, 0x61, 0x73, 0x68, 0x69, 0x63, 0x6f, 0x72, 0x70, 0x2f, 0x77, 0x61, 0x74, 0x63, 0x68, 0x74, 0x6f, 0x77, 0x65, 0x72, 0x2f, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x2f, 0x67, 0x65, 0x6e, 0x2f, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x65, 0x72, 0x2f, 0x61, 0x70, 0x69, 0x2f, - 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, 0x2f, 0x61, 0x75, 0x74, 0x68, 0x3b, 0x61, - 0x75, 0x74, 0x68, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, 0x2f, 0x61, 0x75, 0x74, 0x68, 0x6d, 0x65, + 0x74, 0x68, 0x6f, 0x64, 0x73, 0x3b, 0x61, 0x75, 0x74, 0x68, 0x6d, 0x65, 0x74, 0x68, 0x6f, 0x64, + 0x73, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( - file_controller_api_resources_auth_v1_account_proto_rawDescOnce sync.Once - file_controller_api_resources_auth_v1_account_proto_rawDescData = file_controller_api_resources_auth_v1_account_proto_rawDesc + file_controller_api_resources_authmethods_v1_account_proto_rawDescOnce sync.Once + file_controller_api_resources_authmethods_v1_account_proto_rawDescData = file_controller_api_resources_authmethods_v1_account_proto_rawDesc ) -func file_controller_api_resources_auth_v1_account_proto_rawDescGZIP() []byte { - file_controller_api_resources_auth_v1_account_proto_rawDescOnce.Do(func() { - file_controller_api_resources_auth_v1_account_proto_rawDescData = protoimpl.X.CompressGZIP(file_controller_api_resources_auth_v1_account_proto_rawDescData) +func file_controller_api_resources_authmethods_v1_account_proto_rawDescGZIP() []byte { + file_controller_api_resources_authmethods_v1_account_proto_rawDescOnce.Do(func() { + file_controller_api_resources_authmethods_v1_account_proto_rawDescData = protoimpl.X.CompressGZIP(file_controller_api_resources_authmethods_v1_account_proto_rawDescData) }) - return file_controller_api_resources_auth_v1_account_proto_rawDescData + return file_controller_api_resources_authmethods_v1_account_proto_rawDescData } -var file_controller_api_resources_auth_v1_account_proto_msgTypes = make([]protoimpl.MessageInfo, 2) -var file_controller_api_resources_auth_v1_account_proto_goTypes = []interface{}{ - (*Account)(nil), // 0: controller.api.resources.auth.v1.Account - (*PasswordAccountAttributes)(nil), // 1: controller.api.resources.auth.v1.PasswordAccountAttributes +var file_controller_api_resources_authmethods_v1_account_proto_msgTypes = make([]protoimpl.MessageInfo, 2) +var file_controller_api_resources_authmethods_v1_account_proto_goTypes = []interface{}{ + (*Account)(nil), // 0: controller.api.resources.authmethods.v1.Account + (*PasswordAccountAttributes)(nil), // 1: controller.api.resources.authmethods.v1.PasswordAccountAttributes (*scopes.ScopeInfo)(nil), // 2: controller.api.resources.scopes.v1.ScopeInfo (*wrappers.StringValue)(nil), // 3: google.protobuf.StringValue (*timestamp.Timestamp)(nil), // 4: google.protobuf.Timestamp (*wrappers.BoolValue)(nil), // 5: google.protobuf.BoolValue (*_struct.Struct)(nil), // 6: google.protobuf.Struct } -var file_controller_api_resources_auth_v1_account_proto_depIdxs = []int32{ - 2, // 0: controller.api.resources.auth.v1.Account.scope:type_name -> controller.api.resources.scopes.v1.ScopeInfo - 3, // 1: controller.api.resources.auth.v1.Account.name:type_name -> google.protobuf.StringValue - 3, // 2: controller.api.resources.auth.v1.Account.description:type_name -> google.protobuf.StringValue - 4, // 3: controller.api.resources.auth.v1.Account.created_time:type_name -> google.protobuf.Timestamp - 4, // 4: controller.api.resources.auth.v1.Account.updated_time:type_name -> google.protobuf.Timestamp - 5, // 5: controller.api.resources.auth.v1.Account.disabled:type_name -> google.protobuf.BoolValue - 6, // 6: controller.api.resources.auth.v1.Account.attributes:type_name -> google.protobuf.Struct - 3, // 7: controller.api.resources.auth.v1.PasswordAccountAttributes.password:type_name -> google.protobuf.StringValue +var file_controller_api_resources_authmethods_v1_account_proto_depIdxs = []int32{ + 2, // 0: controller.api.resources.authmethods.v1.Account.scope:type_name -> controller.api.resources.scopes.v1.ScopeInfo + 3, // 1: controller.api.resources.authmethods.v1.Account.name:type_name -> google.protobuf.StringValue + 3, // 2: controller.api.resources.authmethods.v1.Account.description:type_name -> google.protobuf.StringValue + 4, // 3: controller.api.resources.authmethods.v1.Account.created_time:type_name -> google.protobuf.Timestamp + 4, // 4: controller.api.resources.authmethods.v1.Account.updated_time:type_name -> google.protobuf.Timestamp + 5, // 5: controller.api.resources.authmethods.v1.Account.disabled:type_name -> google.protobuf.BoolValue + 6, // 6: controller.api.resources.authmethods.v1.Account.attributes:type_name -> google.protobuf.Struct + 3, // 7: controller.api.resources.authmethods.v1.PasswordAccountAttributes.password:type_name -> google.protobuf.StringValue 8, // [8:8] is the sub-list for method output_type 8, // [8:8] is the sub-list for method input_type 8, // [8:8] is the sub-list for extension type_name @@ -330,13 +334,13 @@ var file_controller_api_resources_auth_v1_account_proto_depIdxs = []int32{ 0, // [0:8] is the sub-list for field type_name } -func init() { file_controller_api_resources_auth_v1_account_proto_init() } -func file_controller_api_resources_auth_v1_account_proto_init() { - if File_controller_api_resources_auth_v1_account_proto != nil { +func init() { file_controller_api_resources_authmethods_v1_account_proto_init() } +func file_controller_api_resources_authmethods_v1_account_proto_init() { + if File_controller_api_resources_authmethods_v1_account_proto != nil { return } if !protoimpl.UnsafeEnabled { - file_controller_api_resources_auth_v1_account_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + file_controller_api_resources_authmethods_v1_account_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*Account); i { case 0: return &v.state @@ -348,7 +352,7 @@ func file_controller_api_resources_auth_v1_account_proto_init() { return nil } } - file_controller_api_resources_auth_v1_account_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + file_controller_api_resources_authmethods_v1_account_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*PasswordAccountAttributes); i { case 0: return &v.state @@ -365,18 +369,18 @@ func file_controller_api_resources_auth_v1_account_proto_init() { out := protoimpl.TypeBuilder{ File: protoimpl.DescBuilder{ GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: file_controller_api_resources_auth_v1_account_proto_rawDesc, + RawDescriptor: file_controller_api_resources_authmethods_v1_account_proto_rawDesc, NumEnums: 0, NumMessages: 2, NumExtensions: 0, NumServices: 0, }, - GoTypes: file_controller_api_resources_auth_v1_account_proto_goTypes, - DependencyIndexes: file_controller_api_resources_auth_v1_account_proto_depIdxs, - MessageInfos: file_controller_api_resources_auth_v1_account_proto_msgTypes, + GoTypes: file_controller_api_resources_authmethods_v1_account_proto_goTypes, + DependencyIndexes: file_controller_api_resources_authmethods_v1_account_proto_depIdxs, + MessageInfos: file_controller_api_resources_authmethods_v1_account_proto_msgTypes, }.Build() - File_controller_api_resources_auth_v1_account_proto = out.File - file_controller_api_resources_auth_v1_account_proto_rawDesc = nil - file_controller_api_resources_auth_v1_account_proto_goTypes = nil - file_controller_api_resources_auth_v1_account_proto_depIdxs = nil + File_controller_api_resources_authmethods_v1_account_proto = out.File + file_controller_api_resources_authmethods_v1_account_proto_rawDesc = nil + file_controller_api_resources_authmethods_v1_account_proto_goTypes = nil + file_controller_api_resources_authmethods_v1_account_proto_depIdxs = nil } diff --git a/internal/gen/controller/api/resources/authmethods/auth_method.pb.go b/internal/gen/controller/api/resources/authmethods/auth_method.pb.go new file mode 100644 index 000000000..14a24d032 --- /dev/null +++ b/internal/gen/controller/api/resources/authmethods/auth_method.pb.go @@ -0,0 +1,359 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.25.0 +// protoc v3.12.3 +// source: controller/api/resources/authmethods/v1/auth_method.proto + +package authmethods + +import ( + proto "github.com/golang/protobuf/proto" + _struct "github.com/golang/protobuf/ptypes/struct" + timestamp "github.com/golang/protobuf/ptypes/timestamp" + wrappers "github.com/golang/protobuf/ptypes/wrappers" + scopes "github.com/hashicorp/watchtower/internal/gen/controller/api/resources/scopes" + _ "github.com/hashicorp/watchtower/internal/gen/controller/protooptions" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + reflect "reflect" + sync "sync" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +// This is a compile-time assertion that a sufficiently up-to-date version +// of the legacy proto package is being used. +const _ = proto.ProtoPackageIsVersion4 + +// AuthMethod contains all fields related to a AuthMethod resource +type AuthMethod struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // The ID of the AuthMethod + // Output only. + Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` + // Scope information for this resource + // Output only. + Scope *scopes.ScopeInfo `protobuf:"bytes,2,opt,name=scope,proto3" json:"scope,omitempty"` + // Optional name for identification purposes + Name *wrappers.StringValue `protobuf:"bytes,3,opt,name=name,proto3" json:"name,omitempty"` + // Optional user-set descripton for identification purposes + Description *wrappers.StringValue `protobuf:"bytes,4,opt,name=description,proto3" json:"description,omitempty"` + // The time this resource was created + // Output only. + CreatedTime *timestamp.Timestamp `protobuf:"bytes,5,opt,name=created_time,proto3" json:"created_time,omitempty"` + // The time this resource was last updated. + // Output only. + UpdatedTime *timestamp.Timestamp `protobuf:"bytes,6,opt,name=updated_time,proto3" json:"updated_time,omitempty"` + // The auth method type. This can be "password" or "oidc". + Type string `protobuf:"bytes,7,opt,name=type,proto3" json:"type,omitempty"` + // The attributes that are applied for the specific Auth Method type. + Attributes *_struct.Struct `protobuf:"bytes,8,opt,name=attributes,proto3" json:"attributes,omitempty"` +} + +func (x *AuthMethod) Reset() { + *x = AuthMethod{} + if protoimpl.UnsafeEnabled { + mi := &file_controller_api_resources_authmethods_v1_auth_method_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *AuthMethod) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*AuthMethod) ProtoMessage() {} + +func (x *AuthMethod) ProtoReflect() protoreflect.Message { + mi := &file_controller_api_resources_authmethods_v1_auth_method_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use AuthMethod.ProtoReflect.Descriptor instead. +func (*AuthMethod) Descriptor() ([]byte, []int) { + return file_controller_api_resources_authmethods_v1_auth_method_proto_rawDescGZIP(), []int{0} +} + +func (x *AuthMethod) GetId() string { + if x != nil { + return x.Id + } + return "" +} + +func (x *AuthMethod) GetScope() *scopes.ScopeInfo { + if x != nil { + return x.Scope + } + return nil +} + +func (x *AuthMethod) GetName() *wrappers.StringValue { + if x != nil { + return x.Name + } + return nil +} + +func (x *AuthMethod) GetDescription() *wrappers.StringValue { + if x != nil { + return x.Description + } + return nil +} + +func (x *AuthMethod) GetCreatedTime() *timestamp.Timestamp { + if x != nil { + return x.CreatedTime + } + return nil +} + +func (x *AuthMethod) GetUpdatedTime() *timestamp.Timestamp { + if x != nil { + return x.UpdatedTime + } + return nil +} + +func (x *AuthMethod) GetType() string { + if x != nil { + return x.Type + } + return "" +} + +func (x *AuthMethod) GetAttributes() *_struct.Struct { + if x != nil { + return x.Attributes + } + return nil +} + +type PasswordAuthMethodAttributes struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // The minimum length allowed for user names for accounts in this auth method. + MinUserNameLength uint32 `protobuf:"varint,1,opt,name=min_user_name_length,json=minUserNameLength,proto3" json:"min_user_name_length,omitempty"` + // The minimum length allowed for passwords for accounts in this auth method. + MinPasswordLength uint32 `protobuf:"varint,2,opt,name=min_password_length,json=minPasswordLength,proto3" json:"min_password_length,omitempty"` +} + +func (x *PasswordAuthMethodAttributes) Reset() { + *x = PasswordAuthMethodAttributes{} + if protoimpl.UnsafeEnabled { + mi := &file_controller_api_resources_authmethods_v1_auth_method_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *PasswordAuthMethodAttributes) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*PasswordAuthMethodAttributes) ProtoMessage() {} + +func (x *PasswordAuthMethodAttributes) ProtoReflect() protoreflect.Message { + mi := &file_controller_api_resources_authmethods_v1_auth_method_proto_msgTypes[1] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use PasswordAuthMethodAttributes.ProtoReflect.Descriptor instead. +func (*PasswordAuthMethodAttributes) Descriptor() ([]byte, []int) { + return file_controller_api_resources_authmethods_v1_auth_method_proto_rawDescGZIP(), []int{1} +} + +func (x *PasswordAuthMethodAttributes) GetMinUserNameLength() uint32 { + if x != nil { + return x.MinUserNameLength + } + return 0 +} + +func (x *PasswordAuthMethodAttributes) GetMinPasswordLength() uint32 { + if x != nil { + return x.MinPasswordLength + } + return 0 +} + +var File_controller_api_resources_authmethods_v1_auth_method_proto protoreflect.FileDescriptor + +var file_controller_api_resources_authmethods_v1_auth_method_proto_rawDesc = []byte{ + 0x0a, 0x39, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x65, 0x72, 0x2f, 0x61, 0x70, 0x69, + 0x2f, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, 0x2f, 0x61, 0x75, 0x74, 0x68, 0x6d, + 0x65, 0x74, 0x68, 0x6f, 0x64, 0x73, 0x2f, 0x76, 0x31, 0x2f, 0x61, 0x75, 0x74, 0x68, 0x5f, 0x6d, + 0x65, 0x74, 0x68, 0x6f, 0x64, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x27, 0x63, 0x6f, 0x6e, + 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x65, 0x72, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x72, 0x65, 0x73, 0x6f, + 0x75, 0x72, 0x63, 0x65, 0x73, 0x2e, 0x61, 0x75, 0x74, 0x68, 0x6d, 0x65, 0x74, 0x68, 0x6f, 0x64, + 0x73, 0x2e, 0x76, 0x31, 0x1a, 0x1f, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x2e, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x77, 0x72, 0x61, 0x70, 0x70, 0x65, 0x72, 0x73, 0x2e, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1c, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x73, 0x74, 0x72, 0x75, 0x63, 0x74, 0x2e, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x1a, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x65, 0x72, 0x2f, + 0x61, 0x70, 0x69, 0x2f, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, 0x2f, 0x73, 0x63, + 0x6f, 0x70, 0x65, 0x73, 0x2f, 0x76, 0x31, 0x2f, 0x73, 0x63, 0x6f, 0x70, 0x65, 0x2e, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x1a, 0x2a, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x65, 0x72, 0x2f, + 0x63, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x5f, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2f, 0x76, + 0x31, 0x2f, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, + 0xe6, 0x03, 0x0a, 0x0a, 0x41, 0x75, 0x74, 0x68, 0x4d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x12, 0x0e, + 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x43, + 0x0a, 0x05, 0x73, 0x63, 0x6f, 0x70, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2d, 0x2e, + 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x65, 0x72, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x72, + 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, 0x2e, 0x73, 0x63, 0x6f, 0x70, 0x65, 0x73, 0x2e, + 0x76, 0x31, 0x2e, 0x53, 0x63, 0x6f, 0x70, 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x05, 0x73, 0x63, + 0x6f, 0x70, 0x65, 0x12, 0x46, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, + 0x0b, 0x32, 0x1c, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x62, 0x75, 0x66, 0x2e, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x42, + 0x14, 0xa0, 0xda, 0x29, 0x01, 0xc2, 0xdd, 0x29, 0x0c, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, + 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x62, 0x0a, 0x0b, 0x64, + 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, + 0x32, 0x1c, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, + 0x75, 0x66, 0x2e, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x42, 0x22, + 0xa0, 0xda, 0x29, 0x01, 0xc2, 0xdd, 0x29, 0x1a, 0x0a, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, + 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, + 0x6f, 0x6e, 0x52, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x12, + 0x3e, 0x0a, 0x0c, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x18, + 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, + 0x70, 0x52, 0x0c, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x12, + 0x3e, 0x0a, 0x0c, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x64, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x18, + 0x06, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, + 0x70, 0x52, 0x0c, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x64, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x12, + 0x18, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, 0x07, 0x20, 0x01, 0x28, 0x09, 0x42, 0x04, 0xa0, + 0xda, 0x29, 0x01, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x12, 0x3d, 0x0a, 0x0a, 0x61, 0x74, 0x74, + 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x73, 0x18, 0x08, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x17, 0x2e, + 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, + 0x53, 0x74, 0x72, 0x75, 0x63, 0x74, 0x42, 0x04, 0xa0, 0xda, 0x29, 0x01, 0x52, 0x0a, 0x61, 0x74, + 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x73, 0x22, 0x8b, 0x01, 0x0a, 0x1c, 0x50, 0x61, 0x73, + 0x73, 0x77, 0x6f, 0x72, 0x64, 0x41, 0x75, 0x74, 0x68, 0x4d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x41, + 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x73, 0x12, 0x35, 0x0a, 0x14, 0x6d, 0x69, 0x6e, + 0x5f, 0x75, 0x73, 0x65, 0x72, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x5f, 0x6c, 0x65, 0x6e, 0x67, 0x74, + 0x68, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x42, 0x04, 0xa0, 0xda, 0x29, 0x01, 0x52, 0x11, 0x6d, + 0x69, 0x6e, 0x55, 0x73, 0x65, 0x72, 0x4e, 0x61, 0x6d, 0x65, 0x4c, 0x65, 0x6e, 0x67, 0x74, 0x68, + 0x12, 0x34, 0x0a, 0x13, 0x6d, 0x69, 0x6e, 0x5f, 0x70, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, + 0x5f, 0x6c, 0x65, 0x6e, 0x67, 0x74, 0x68, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0d, 0x42, 0x04, 0xa0, + 0xda, 0x29, 0x01, 0x52, 0x11, 0x6d, 0x69, 0x6e, 0x50, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, + 0x4c, 0x65, 0x6e, 0x67, 0x74, 0x68, 0x42, 0x5f, 0x5a, 0x5d, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, + 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x68, 0x61, 0x73, 0x68, 0x69, 0x63, 0x6f, 0x72, 0x70, 0x2f, 0x77, + 0x61, 0x74, 0x63, 0x68, 0x74, 0x6f, 0x77, 0x65, 0x72, 0x2f, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, + 0x61, 0x6c, 0x2f, 0x67, 0x65, 0x6e, 0x2f, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x65, + 0x72, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, 0x2f, + 0x61, 0x75, 0x74, 0x68, 0x6d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x73, 0x3b, 0x61, 0x75, 0x74, 0x68, + 0x6d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x73, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_controller_api_resources_authmethods_v1_auth_method_proto_rawDescOnce sync.Once + file_controller_api_resources_authmethods_v1_auth_method_proto_rawDescData = file_controller_api_resources_authmethods_v1_auth_method_proto_rawDesc +) + +func file_controller_api_resources_authmethods_v1_auth_method_proto_rawDescGZIP() []byte { + file_controller_api_resources_authmethods_v1_auth_method_proto_rawDescOnce.Do(func() { + file_controller_api_resources_authmethods_v1_auth_method_proto_rawDescData = protoimpl.X.CompressGZIP(file_controller_api_resources_authmethods_v1_auth_method_proto_rawDescData) + }) + return file_controller_api_resources_authmethods_v1_auth_method_proto_rawDescData +} + +var file_controller_api_resources_authmethods_v1_auth_method_proto_msgTypes = make([]protoimpl.MessageInfo, 2) +var file_controller_api_resources_authmethods_v1_auth_method_proto_goTypes = []interface{}{ + (*AuthMethod)(nil), // 0: controller.api.resources.authmethods.v1.AuthMethod + (*PasswordAuthMethodAttributes)(nil), // 1: controller.api.resources.authmethods.v1.PasswordAuthMethodAttributes + (*scopes.ScopeInfo)(nil), // 2: controller.api.resources.scopes.v1.ScopeInfo + (*wrappers.StringValue)(nil), // 3: google.protobuf.StringValue + (*timestamp.Timestamp)(nil), // 4: google.protobuf.Timestamp + (*_struct.Struct)(nil), // 5: google.protobuf.Struct +} +var file_controller_api_resources_authmethods_v1_auth_method_proto_depIdxs = []int32{ + 2, // 0: controller.api.resources.authmethods.v1.AuthMethod.scope:type_name -> controller.api.resources.scopes.v1.ScopeInfo + 3, // 1: controller.api.resources.authmethods.v1.AuthMethod.name:type_name -> google.protobuf.StringValue + 3, // 2: controller.api.resources.authmethods.v1.AuthMethod.description:type_name -> google.protobuf.StringValue + 4, // 3: controller.api.resources.authmethods.v1.AuthMethod.created_time:type_name -> google.protobuf.Timestamp + 4, // 4: controller.api.resources.authmethods.v1.AuthMethod.updated_time:type_name -> google.protobuf.Timestamp + 5, // 5: controller.api.resources.authmethods.v1.AuthMethod.attributes:type_name -> google.protobuf.Struct + 6, // [6:6] is the sub-list for method output_type + 6, // [6:6] is the sub-list for method input_type + 6, // [6:6] is the sub-list for extension type_name + 6, // [6:6] is the sub-list for extension extendee + 0, // [0:6] is the sub-list for field type_name +} + +func init() { file_controller_api_resources_authmethods_v1_auth_method_proto_init() } +func file_controller_api_resources_authmethods_v1_auth_method_proto_init() { + if File_controller_api_resources_authmethods_v1_auth_method_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_controller_api_resources_authmethods_v1_auth_method_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*AuthMethod); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_controller_api_resources_authmethods_v1_auth_method_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*PasswordAuthMethodAttributes); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_controller_api_resources_authmethods_v1_auth_method_proto_rawDesc, + NumEnums: 0, + NumMessages: 2, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_controller_api_resources_authmethods_v1_auth_method_proto_goTypes, + DependencyIndexes: file_controller_api_resources_authmethods_v1_auth_method_proto_depIdxs, + MessageInfos: file_controller_api_resources_authmethods_v1_auth_method_proto_msgTypes, + }.Build() + File_controller_api_resources_authmethods_v1_auth_method_proto = out.File + file_controller_api_resources_authmethods_v1_auth_method_proto_rawDesc = nil + file_controller_api_resources_authmethods_v1_auth_method_proto_goTypes = nil + file_controller_api_resources_authmethods_v1_auth_method_proto_depIdxs = nil +} diff --git a/internal/gen/controller/api/resources/groups/group.pb.go b/internal/gen/controller/api/resources/groups/group.pb.go index 942f9e316..0bbb35233 100644 --- a/internal/gen/controller/api/resources/groups/group.pb.go +++ b/internal/gen/controller/api/resources/groups/group.pb.go @@ -122,7 +122,7 @@ type Group struct { UpdatedTime *timestamp.Timestamp `protobuf:"bytes,6,opt,name=updated_time,proto3" json:"updated_time,omitempty"` // Whether the resource is disabled Disabled *wrappers.BoolValue `protobuf:"bytes,7,opt,name=disabled,proto3" json:"disabled,omitempty"` - // The version can be used in subsiquent write requests to ensure this resource + // The version can be used in subsequent write requests to ensure this resource // has not changed and to fail the write if it has. // Output only. Version uint32 `protobuf:"varint,8,opt,name=version,proto3" json:"version,omitempty"` @@ -251,41 +251,42 @@ var file_controller_api_resources_groups_v1_group_proto_rawDesc = []byte{ 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x65, 0x72, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, 0x2f, 0x73, 0x63, 0x6f, 0x70, 0x65, 0x73, 0x2f, 0x76, 0x31, 0x2f, 0x73, 0x63, 0x6f, 0x70, 0x65, 0x2e, - 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x28, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x65, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x2a, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x65, 0x72, 0x2f, 0x63, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x5f, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, - 0x2f, 0x76, 0x31, 0x2f, 0x6d, 0x61, 0x73, 0x6b, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, - 0x48, 0x0a, 0x06, 0x4d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, - 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x74, 0x79, 0x70, - 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x12, 0x1a, 0x0a, - 0x08, 0x73, 0x63, 0x6f, 0x70, 0x65, 0x5f, 0x69, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x08, 0x73, 0x63, 0x6f, 0x70, 0x65, 0x5f, 0x69, 0x64, 0x22, 0xb7, 0x04, 0x0a, 0x05, 0x47, 0x72, - 0x6f, 0x75, 0x70, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x02, 0x69, 0x64, 0x12, 0x43, 0x0a, 0x05, 0x73, 0x63, 0x6f, 0x70, 0x65, 0x18, 0x02, 0x20, 0x01, - 0x28, 0x0b, 0x32, 0x2d, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x65, 0x72, 0x2e, - 0x61, 0x70, 0x69, 0x2e, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, 0x2e, 0x73, 0x63, - 0x6f, 0x70, 0x65, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x63, 0x6f, 0x70, 0x65, 0x49, 0x6e, 0x66, - 0x6f, 0x52, 0x05, 0x73, 0x63, 0x6f, 0x70, 0x65, 0x12, 0x42, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, - 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, - 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x56, - 0x61, 0x6c, 0x75, 0x65, 0x42, 0x10, 0xc2, 0xdd, 0x29, 0x0c, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, - 0x12, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x5e, 0x0a, 0x0b, - 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x04, 0x20, 0x01, 0x28, - 0x0b, 0x32, 0x1c, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, - 0x62, 0x75, 0x66, 0x2e, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x42, - 0x1e, 0xc2, 0xdd, 0x29, 0x1a, 0x0a, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, - 0x6f, 0x6e, 0x12, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x52, - 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x3e, 0x0a, 0x0c, - 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x05, 0x20, 0x01, - 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, - 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x0c, - 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x12, 0x3e, 0x0a, 0x0c, - 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x64, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x06, 0x20, 0x01, - 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, - 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x0c, - 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x64, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x12, 0x36, 0x0a, 0x08, - 0x64, 0x69, 0x73, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, - 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, - 0x2e, 0x42, 0x6f, 0x6f, 0x6c, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, 0x08, 0x64, 0x69, 0x73, 0x61, + 0x2f, 0x76, 0x31, 0x2f, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x22, 0x48, 0x0a, 0x06, 0x4d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x12, 0x0e, 0x0a, 0x02, 0x69, + 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x74, + 0x79, 0x70, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x12, + 0x1a, 0x0a, 0x08, 0x73, 0x63, 0x6f, 0x70, 0x65, 0x5f, 0x69, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x08, 0x73, 0x63, 0x6f, 0x70, 0x65, 0x5f, 0x69, 0x64, 0x22, 0xc5, 0x04, 0x0a, 0x05, + 0x47, 0x72, 0x6f, 0x75, 0x70, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x43, 0x0a, 0x05, 0x73, 0x63, 0x6f, 0x70, 0x65, 0x18, 0x02, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2d, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x65, + 0x72, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, 0x2e, + 0x73, 0x63, 0x6f, 0x70, 0x65, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x63, 0x6f, 0x70, 0x65, 0x49, + 0x6e, 0x66, 0x6f, 0x52, 0x05, 0x73, 0x63, 0x6f, 0x70, 0x65, 0x12, 0x46, 0x0a, 0x04, 0x6e, 0x61, + 0x6d, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, + 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x53, 0x74, 0x72, 0x69, 0x6e, + 0x67, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x42, 0x14, 0xa0, 0xda, 0x29, 0x01, 0xc2, 0xdd, 0x29, 0x0c, + 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x52, 0x04, 0x6e, 0x61, + 0x6d, 0x65, 0x12, 0x62, 0x0a, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, + 0x6e, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, + 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, + 0x56, 0x61, 0x6c, 0x75, 0x65, 0x42, 0x22, 0xa0, 0xda, 0x29, 0x01, 0xc2, 0xdd, 0x29, 0x1a, 0x0a, + 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x0b, 0x64, 0x65, + 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, + 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x3e, 0x0a, 0x0c, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, + 0x64, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, + 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, + 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x0c, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, + 0x64, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x12, 0x3e, 0x0a, 0x0c, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, + 0x64, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, + 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, + 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x0c, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, + 0x64, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x12, 0x3c, 0x0a, 0x08, 0x64, 0x69, 0x73, 0x61, 0x62, 0x6c, + 0x65, 0x64, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, + 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x42, 0x6f, 0x6f, 0x6c, 0x56, + 0x61, 0x6c, 0x75, 0x65, 0x42, 0x04, 0xa0, 0xda, 0x29, 0x01, 0x52, 0x08, 0x64, 0x69, 0x73, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x12, 0x18, 0x0a, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x08, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x1d, 0x0a, 0x0a, 0x6d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x5f, 0x69, 0x64, 0x73, 0x18, 0x09, 0x20, 0x03, diff --git a/internal/gen/controller/api/resources/hosts/host.pb.go b/internal/gen/controller/api/resources/hosts/host.pb.go index 3a2f61958..496051cec 100644 --- a/internal/gen/controller/api/resources/hosts/host.pb.go +++ b/internal/gen/controller/api/resources/hosts/host.pb.go @@ -11,6 +11,7 @@ import ( timestamp "github.com/golang/protobuf/ptypes/timestamp" wrappers "github.com/golang/protobuf/ptypes/wrappers" scopes "github.com/hashicorp/watchtower/internal/gen/controller/api/resources/scopes" + _ "github.com/hashicorp/watchtower/internal/gen/controller/protooptions" protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoimpl "google.golang.org/protobuf/runtime/protoimpl" reflect "reflect" @@ -168,44 +169,48 @@ var file_controller_api_resources_hosts_v1_host_proto_rawDesc = []byte{ 0x74, 0x6f, 0x1a, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x65, 0x72, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, 0x2f, 0x73, 0x63, 0x6f, 0x70, 0x65, 0x73, 0x2f, 0x76, 0x31, 0x2f, 0x73, 0x63, 0x6f, 0x70, 0x65, 0x2e, 0x70, 0x72, 0x6f, - 0x74, 0x6f, 0x22, 0xef, 0x03, 0x0a, 0x04, 0x48, 0x6f, 0x73, 0x74, 0x12, 0x0e, 0x0a, 0x02, 0x69, - 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x43, 0x0a, 0x05, 0x73, - 0x63, 0x6f, 0x70, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2d, 0x2e, 0x63, 0x6f, 0x6e, - 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x65, 0x72, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x72, 0x65, 0x73, 0x6f, - 0x75, 0x72, 0x63, 0x65, 0x73, 0x2e, 0x73, 0x63, 0x6f, 0x70, 0x65, 0x73, 0x2e, 0x76, 0x31, 0x2e, - 0x53, 0x63, 0x6f, 0x70, 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x05, 0x73, 0x63, 0x6f, 0x70, 0x65, - 0x12, 0x30, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1c, + 0x74, 0x6f, 0x1a, 0x2a, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x65, 0x72, 0x2f, 0x63, + 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x5f, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2f, 0x76, 0x31, + 0x2f, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x87, + 0x04, 0x0a, 0x04, 0x48, 0x6f, 0x73, 0x74, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x43, 0x0a, 0x05, 0x73, 0x63, 0x6f, 0x70, 0x65, + 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2d, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, + 0x6c, 0x65, 0x72, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, + 0x73, 0x2e, 0x73, 0x63, 0x6f, 0x70, 0x65, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x63, 0x6f, 0x70, + 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x05, 0x73, 0x63, 0x6f, 0x70, 0x65, 0x12, 0x30, 0x0a, 0x04, + 0x74, 0x79, 0x70, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x67, 0x6f, 0x6f, + 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x53, 0x74, 0x72, + 0x69, 0x6e, 0x67, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x12, 0x36, + 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x67, + 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x53, + 0x74, 0x72, 0x69, 0x6e, 0x67, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x42, 0x04, 0xa0, 0xda, 0x29, 0x01, + 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x44, 0x0a, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, + 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x67, 0x6f, + 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x53, 0x74, + 0x72, 0x69, 0x6e, 0x67, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x42, 0x04, 0xa0, 0xda, 0x29, 0x01, 0x52, + 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x3e, 0x0a, 0x0c, + 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x06, 0x20, 0x01, + 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x0c, + 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x12, 0x3e, 0x0a, 0x0c, + 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x64, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x07, 0x20, 0x01, + 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x0c, + 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x64, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x12, 0x3c, 0x0a, 0x08, + 0x64, 0x69, 0x73, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x18, 0x08, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, - 0x2e, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, 0x04, 0x74, 0x79, - 0x70, 0x65, 0x12, 0x30, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, - 0x32, 0x1c, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, - 0x75, 0x66, 0x2e, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, 0x04, - 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x3e, 0x0a, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, - 0x69, 0x6f, 0x6e, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x67, 0x6f, 0x6f, 0x67, - 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x53, 0x74, 0x72, 0x69, - 0x6e, 0x67, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, - 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x3e, 0x0a, 0x0c, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x5f, - 0x74, 0x69, 0x6d, 0x65, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, - 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, - 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x0c, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x5f, - 0x74, 0x69, 0x6d, 0x65, 0x12, 0x3e, 0x0a, 0x0c, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x64, 0x5f, - 0x74, 0x69, 0x6d, 0x65, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, - 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, - 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x0c, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x64, 0x5f, - 0x74, 0x69, 0x6d, 0x65, 0x12, 0x36, 0x0a, 0x08, 0x64, 0x69, 0x73, 0x61, 0x62, 0x6c, 0x65, 0x64, - 0x18, 0x08, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, - 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x42, 0x6f, 0x6f, 0x6c, 0x56, 0x61, 0x6c, - 0x75, 0x65, 0x52, 0x08, 0x64, 0x69, 0x73, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x12, 0x36, 0x0a, 0x07, - 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x09, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1c, 0x2e, - 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, - 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, 0x07, 0x61, 0x64, 0x64, - 0x72, 0x65, 0x73, 0x73, 0x42, 0x53, 0x5a, 0x51, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, - 0x6f, 0x6d, 0x2f, 0x68, 0x61, 0x73, 0x68, 0x69, 0x63, 0x6f, 0x72, 0x70, 0x2f, 0x77, 0x61, 0x74, - 0x63, 0x68, 0x74, 0x6f, 0x77, 0x65, 0x72, 0x2f, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, - 0x2f, 0x67, 0x65, 0x6e, 0x2f, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x65, 0x72, 0x2f, - 0x61, 0x70, 0x69, 0x2f, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, 0x2f, 0x68, 0x6f, - 0x73, 0x74, 0x73, 0x3b, 0x68, 0x6f, 0x73, 0x74, 0x73, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, - 0x33, + 0x2e, 0x42, 0x6f, 0x6f, 0x6c, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x42, 0x04, 0xa0, 0xda, 0x29, 0x01, + 0x52, 0x08, 0x64, 0x69, 0x73, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x12, 0x3c, 0x0a, 0x07, 0x61, 0x64, + 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x09, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x67, 0x6f, + 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x53, 0x74, + 0x72, 0x69, 0x6e, 0x67, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x42, 0x04, 0xa0, 0xda, 0x29, 0x01, 0x52, + 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x42, 0x53, 0x5a, 0x51, 0x67, 0x69, 0x74, 0x68, + 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x68, 0x61, 0x73, 0x68, 0x69, 0x63, 0x6f, 0x72, 0x70, + 0x2f, 0x77, 0x61, 0x74, 0x63, 0x68, 0x74, 0x6f, 0x77, 0x65, 0x72, 0x2f, 0x69, 0x6e, 0x74, 0x65, + 0x72, 0x6e, 0x61, 0x6c, 0x2f, 0x67, 0x65, 0x6e, 0x2f, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, + 0x6c, 0x65, 0x72, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, + 0x73, 0x2f, 0x68, 0x6f, 0x73, 0x74, 0x73, 0x3b, 0x68, 0x6f, 0x73, 0x74, 0x73, 0x62, 0x06, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( diff --git a/internal/gen/controller/api/resources/hosts/host_catalog.pb.go b/internal/gen/controller/api/resources/hosts/host_catalog.pb.go index d2a4722b5..9a273f0a4 100644 --- a/internal/gen/controller/api/resources/hosts/host_catalog.pb.go +++ b/internal/gen/controller/api/resources/hosts/host_catalog.pb.go @@ -285,27 +285,28 @@ var file_controller_api_resources_hosts_v1_host_catalog_proto_rawDesc = []byte{ 0x63, 0x74, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x65, 0x72, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, 0x2f, 0x73, 0x63, 0x6f, 0x70, 0x65, 0x73, 0x2f, 0x76, 0x31, 0x2f, 0x73, 0x63, 0x6f, - 0x70, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x28, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, + 0x70, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x2a, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x65, 0x72, 0x2f, 0x63, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x5f, 0x6f, 0x70, 0x74, 0x69, - 0x6f, 0x6e, 0x73, 0x2f, 0x76, 0x31, 0x2f, 0x6d, 0x61, 0x73, 0x6b, 0x73, 0x2e, 0x70, 0x72, 0x6f, - 0x74, 0x6f, 0x22, 0xa9, 0x04, 0x0a, 0x0b, 0x48, 0x6f, 0x73, 0x74, 0x43, 0x61, 0x74, 0x61, 0x6c, - 0x6f, 0x67, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, - 0x69, 0x64, 0x12, 0x43, 0x0a, 0x05, 0x73, 0x63, 0x6f, 0x70, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, - 0x0b, 0x32, 0x2d, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x65, 0x72, 0x2e, 0x61, - 0x70, 0x69, 0x2e, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, 0x2e, 0x73, 0x63, 0x6f, - 0x70, 0x65, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x63, 0x6f, 0x70, 0x65, 0x49, 0x6e, 0x66, 0x6f, - 0x52, 0x05, 0x73, 0x63, 0x6f, 0x70, 0x65, 0x12, 0x30, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, - 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, - 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x56, 0x61, - 0x6c, 0x75, 0x65, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x12, 0x42, 0x0a, 0x04, 0x6e, 0x61, 0x6d, - 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, + 0x6f, 0x6e, 0x73, 0x2f, 0x76, 0x31, 0x2f, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xc3, 0x04, 0x0a, 0x0b, 0x48, 0x6f, 0x73, 0x74, 0x43, 0x61, 0x74, + 0x61, 0x6c, 0x6f, 0x67, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x02, 0x69, 0x64, 0x12, 0x43, 0x0a, 0x05, 0x73, 0x63, 0x6f, 0x70, 0x65, 0x18, 0x02, 0x20, + 0x01, 0x28, 0x0b, 0x32, 0x2d, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x65, 0x72, + 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, 0x2e, 0x73, + 0x63, 0x6f, 0x70, 0x65, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x63, 0x6f, 0x70, 0x65, 0x49, 0x6e, + 0x66, 0x6f, 0x52, 0x05, 0x73, 0x63, 0x6f, 0x70, 0x65, 0x12, 0x36, 0x0a, 0x04, 0x74, 0x79, 0x70, + 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, - 0x56, 0x61, 0x6c, 0x75, 0x65, 0x42, 0x10, 0xc2, 0xdd, 0x29, 0x0c, 0x0a, 0x04, 0x6e, 0x61, 0x6d, - 0x65, 0x12, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x5e, 0x0a, - 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x05, 0x20, 0x01, - 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, - 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x56, 0x61, 0x6c, 0x75, 0x65, - 0x42, 0x1e, 0xc2, 0xdd, 0x29, 0x1a, 0x0a, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, + 0x56, 0x61, 0x6c, 0x75, 0x65, 0x42, 0x04, 0xa0, 0xda, 0x29, 0x01, 0x52, 0x04, 0x74, 0x79, 0x70, + 0x65, 0x12, 0x46, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, + 0x1c, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, + 0x66, 0x2e, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x42, 0x14, 0xa0, + 0xda, 0x29, 0x01, 0xc2, 0xdd, 0x29, 0x0c, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x04, 0x6e, + 0x61, 0x6d, 0x65, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x62, 0x0a, 0x0b, 0x64, 0x65, 0x73, + 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1c, + 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, + 0x2e, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x42, 0x22, 0xa0, 0xda, + 0x29, 0x01, 0xc2, 0xdd, 0x29, 0x1a, 0x0a, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x3e, 0x0a, 0x0c, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x06, 0x20, @@ -315,36 +316,37 @@ var file_controller_api_resources_hosts_v1_host_catalog_proto_rawDesc = []byte{ 0x0c, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x64, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, - 0x0c, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x64, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x12, 0x36, 0x0a, + 0x0c, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x64, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x12, 0x3c, 0x0a, 0x08, 0x64, 0x69, 0x73, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x18, 0x08, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, - 0x66, 0x2e, 0x42, 0x6f, 0x6f, 0x6c, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, 0x08, 0x64, 0x69, 0x73, - 0x61, 0x62, 0x6c, 0x65, 0x64, 0x12, 0x37, 0x0a, 0x0a, 0x61, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, - 0x74, 0x65, 0x73, 0x18, 0x09, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x67, 0x6f, 0x6f, 0x67, - 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x53, 0x74, 0x72, 0x75, - 0x63, 0x74, 0x52, 0x0a, 0x61, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x73, 0x22, 0x1a, - 0x0a, 0x18, 0x53, 0x74, 0x61, 0x74, 0x69, 0x63, 0x48, 0x6f, 0x73, 0x74, 0x43, 0x61, 0x74, 0x61, - 0x6c, 0x6f, 0x67, 0x44, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x73, 0x22, 0xe4, 0x01, 0x0a, 0x18, 0x41, - 0x77, 0x73, 0x45, 0x63, 0x32, 0x48, 0x6f, 0x73, 0x74, 0x43, 0x61, 0x74, 0x61, 0x6c, 0x6f, 0x67, - 0x44, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x73, 0x12, 0x18, 0x0a, 0x07, 0x72, 0x65, 0x67, 0x69, 0x6f, - 0x6e, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x09, 0x52, 0x07, 0x72, 0x65, 0x67, 0x69, 0x6f, 0x6e, - 0x73, 0x12, 0x3c, 0x0a, 0x0a, 0x61, 0x63, 0x63, 0x65, 0x73, 0x73, 0x5f, 0x6b, 0x65, 0x79, 0x18, - 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, - 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x56, 0x61, - 0x6c, 0x75, 0x65, 0x52, 0x0a, 0x61, 0x63, 0x63, 0x65, 0x73, 0x73, 0x5f, 0x6b, 0x65, 0x79, 0x12, - 0x3c, 0x0a, 0x0a, 0x73, 0x65, 0x63, 0x72, 0x65, 0x74, 0x5f, 0x6b, 0x65, 0x79, 0x18, 0x03, 0x20, - 0x01, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, - 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x56, 0x61, 0x6c, 0x75, - 0x65, 0x52, 0x0a, 0x73, 0x65, 0x63, 0x72, 0x65, 0x74, 0x5f, 0x6b, 0x65, 0x79, 0x12, 0x32, 0x0a, - 0x06, 0x72, 0x6f, 0x74, 0x61, 0x74, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, - 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, - 0x42, 0x6f, 0x6f, 0x6c, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, 0x06, 0x72, 0x6f, 0x74, 0x61, 0x74, - 0x65, 0x42, 0x53, 0x5a, 0x51, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, - 0x68, 0x61, 0x73, 0x68, 0x69, 0x63, 0x6f, 0x72, 0x70, 0x2f, 0x77, 0x61, 0x74, 0x63, 0x68, 0x74, - 0x6f, 0x77, 0x65, 0x72, 0x2f, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x2f, 0x67, 0x65, - 0x6e, 0x2f, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x65, 0x72, 0x2f, 0x61, 0x70, 0x69, - 0x2f, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, 0x2f, 0x68, 0x6f, 0x73, 0x74, 0x73, - 0x3b, 0x68, 0x6f, 0x73, 0x74, 0x73, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x66, 0x2e, 0x42, 0x6f, 0x6f, 0x6c, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x42, 0x04, 0xa0, 0xda, 0x29, + 0x01, 0x52, 0x08, 0x64, 0x69, 0x73, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x12, 0x3d, 0x0a, 0x0a, 0x61, + 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x73, 0x18, 0x09, 0x20, 0x01, 0x28, 0x0b, 0x32, + 0x17, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, + 0x66, 0x2e, 0x53, 0x74, 0x72, 0x75, 0x63, 0x74, 0x42, 0x04, 0xa0, 0xda, 0x29, 0x01, 0x52, 0x0a, + 0x61, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x73, 0x22, 0x1a, 0x0a, 0x18, 0x53, 0x74, + 0x61, 0x74, 0x69, 0x63, 0x48, 0x6f, 0x73, 0x74, 0x43, 0x61, 0x74, 0x61, 0x6c, 0x6f, 0x67, 0x44, + 0x65, 0x74, 0x61, 0x69, 0x6c, 0x73, 0x22, 0xe4, 0x01, 0x0a, 0x18, 0x41, 0x77, 0x73, 0x45, 0x63, + 0x32, 0x48, 0x6f, 0x73, 0x74, 0x43, 0x61, 0x74, 0x61, 0x6c, 0x6f, 0x67, 0x44, 0x65, 0x74, 0x61, + 0x69, 0x6c, 0x73, 0x12, 0x18, 0x0a, 0x07, 0x72, 0x65, 0x67, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x01, + 0x20, 0x03, 0x28, 0x09, 0x52, 0x07, 0x72, 0x65, 0x67, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x3c, 0x0a, + 0x0a, 0x61, 0x63, 0x63, 0x65, 0x73, 0x73, 0x5f, 0x6b, 0x65, 0x79, 0x18, 0x02, 0x20, 0x01, 0x28, + 0x0b, 0x32, 0x1c, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x62, 0x75, 0x66, 0x2e, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, + 0x0a, 0x61, 0x63, 0x63, 0x65, 0x73, 0x73, 0x5f, 0x6b, 0x65, 0x79, 0x12, 0x3c, 0x0a, 0x0a, 0x73, + 0x65, 0x63, 0x72, 0x65, 0x74, 0x5f, 0x6b, 0x65, 0x79, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, + 0x1c, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, + 0x66, 0x2e, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, 0x0a, 0x73, + 0x65, 0x63, 0x72, 0x65, 0x74, 0x5f, 0x6b, 0x65, 0x79, 0x12, 0x32, 0x0a, 0x06, 0x72, 0x6f, 0x74, + 0x61, 0x74, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, + 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x42, 0x6f, 0x6f, 0x6c, + 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, 0x06, 0x72, 0x6f, 0x74, 0x61, 0x74, 0x65, 0x42, 0x53, 0x5a, + 0x51, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x68, 0x61, 0x73, 0x68, + 0x69, 0x63, 0x6f, 0x72, 0x70, 0x2f, 0x77, 0x61, 0x74, 0x63, 0x68, 0x74, 0x6f, 0x77, 0x65, 0x72, + 0x2f, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x2f, 0x67, 0x65, 0x6e, 0x2f, 0x63, 0x6f, + 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x65, 0x72, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x72, 0x65, 0x73, + 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, 0x2f, 0x68, 0x6f, 0x73, 0x74, 0x73, 0x3b, 0x68, 0x6f, 0x73, + 0x74, 0x73, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( diff --git a/internal/gen/controller/api/resources/hosts/host_set.pb.go b/internal/gen/controller/api/resources/hosts/host_set.pb.go index a3bcf0daf..4296ea5a2 100644 --- a/internal/gen/controller/api/resources/hosts/host_set.pb.go +++ b/internal/gen/controller/api/resources/hosts/host_set.pb.go @@ -11,6 +11,7 @@ import ( timestamp "github.com/golang/protobuf/ptypes/timestamp" wrappers "github.com/golang/protobuf/ptypes/wrappers" scopes "github.com/hashicorp/watchtower/internal/gen/controller/api/resources/scopes" + _ "github.com/hashicorp/watchtower/internal/gen/controller/protooptions" protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoimpl "google.golang.org/protobuf/runtime/protoimpl" reflect "reflect" @@ -184,47 +185,52 @@ var file_controller_api_resources_hosts_v1_host_set_proto_rawDesc = []byte{ 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x65, 0x72, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, 0x2f, 0x73, 0x63, 0x6f, 0x70, 0x65, 0x73, 0x2f, 0x76, 0x31, 0x2f, 0x73, 0x63, 0x6f, 0x70, 0x65, 0x2e, 0x70, - 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xaa, 0x04, 0x0a, 0x07, 0x48, 0x6f, 0x73, 0x74, 0x53, 0x65, 0x74, - 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, - 0x12, 0x43, 0x0a, 0x05, 0x73, 0x63, 0x6f, 0x70, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, - 0x2d, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x65, 0x72, 0x2e, 0x61, 0x70, 0x69, - 0x2e, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, 0x2e, 0x73, 0x63, 0x6f, 0x70, 0x65, - 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x63, 0x6f, 0x70, 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x05, - 0x73, 0x63, 0x6f, 0x70, 0x65, 0x12, 0x30, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, 0x03, 0x20, - 0x01, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, - 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x56, 0x61, 0x6c, 0x75, - 0x65, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x12, 0x30, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, - 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, - 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x56, 0x61, - 0x6c, 0x75, 0x65, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x3e, 0x0a, 0x0b, 0x64, 0x65, 0x73, - 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1c, - 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, - 0x2e, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, 0x0b, 0x64, 0x65, - 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x3e, 0x0a, 0x0c, 0x63, 0x72, 0x65, - 0x61, 0x74, 0x65, 0x64, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0b, 0x32, - 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, - 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x0c, 0x63, 0x72, 0x65, - 0x61, 0x74, 0x65, 0x64, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x12, 0x3e, 0x0a, 0x0c, 0x75, 0x70, 0x64, - 0x61, 0x74, 0x65, 0x64, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0b, 0x32, - 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, - 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x0c, 0x75, 0x70, 0x64, - 0x61, 0x74, 0x65, 0x64, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x12, 0x36, 0x0a, 0x08, 0x64, 0x69, 0x73, - 0x61, 0x62, 0x6c, 0x65, 0x64, 0x18, 0x08, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, - 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x42, 0x6f, - 0x6f, 0x6c, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, 0x08, 0x64, 0x69, 0x73, 0x61, 0x62, 0x6c, 0x65, - 0x64, 0x12, 0x2f, 0x0a, 0x04, 0x73, 0x69, 0x7a, 0x65, 0x18, 0x09, 0x20, 0x01, 0x28, 0x0b, 0x32, - 0x1b, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, - 0x66, 0x2e, 0x49, 0x6e, 0x74, 0x36, 0x34, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, 0x04, 0x73, 0x69, - 0x7a, 0x65, 0x12, 0x3d, 0x0a, 0x05, 0x68, 0x6f, 0x73, 0x74, 0x73, 0x18, 0x0a, 0x20, 0x03, 0x28, - 0x0b, 0x32, 0x27, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x65, 0x72, 0x2e, 0x61, - 0x70, 0x69, 0x2e, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, 0x2e, 0x68, 0x6f, 0x73, - 0x74, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x48, 0x6f, 0x73, 0x74, 0x52, 0x05, 0x68, 0x6f, 0x73, 0x74, - 0x73, 0x42, 0x53, 0x5a, 0x51, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, - 0x68, 0x61, 0x73, 0x68, 0x69, 0x63, 0x6f, 0x72, 0x70, 0x2f, 0x77, 0x61, 0x74, 0x63, 0x68, 0x74, - 0x6f, 0x77, 0x65, 0x72, 0x2f, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x2f, 0x67, 0x65, - 0x6e, 0x2f, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x65, 0x72, 0x2f, 0x61, 0x70, 0x69, - 0x2f, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, 0x2f, 0x68, 0x6f, 0x73, 0x74, 0x73, - 0x3b, 0x68, 0x6f, 0x73, 0x74, 0x73, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x2a, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x65, 0x72, + 0x2f, 0x63, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x5f, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2f, + 0x76, 0x31, 0x2f, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x22, 0xc2, 0x04, 0x0a, 0x07, 0x48, 0x6f, 0x73, 0x74, 0x53, 0x65, 0x74, 0x12, 0x0e, 0x0a, 0x02, + 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x43, 0x0a, 0x05, + 0x73, 0x63, 0x6f, 0x70, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2d, 0x2e, 0x63, 0x6f, + 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x65, 0x72, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x72, 0x65, 0x73, + 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, 0x2e, 0x73, 0x63, 0x6f, 0x70, 0x65, 0x73, 0x2e, 0x76, 0x31, + 0x2e, 0x53, 0x63, 0x6f, 0x70, 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x05, 0x73, 0x63, 0x6f, 0x70, + 0x65, 0x12, 0x36, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, + 0x1c, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, + 0x66, 0x2e, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x42, 0x04, 0xa0, + 0xda, 0x29, 0x01, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x12, 0x36, 0x0a, 0x04, 0x6e, 0x61, 0x6d, + 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, + 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, + 0x56, 0x61, 0x6c, 0x75, 0x65, 0x42, 0x04, 0xa0, 0xda, 0x29, 0x01, 0x52, 0x04, 0x6e, 0x61, 0x6d, + 0x65, 0x12, 0x44, 0x0a, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, + 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x56, + 0x61, 0x6c, 0x75, 0x65, 0x42, 0x04, 0xa0, 0xda, 0x29, 0x01, 0x52, 0x0b, 0x64, 0x65, 0x73, 0x63, + 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x3e, 0x0a, 0x0c, 0x63, 0x72, 0x65, 0x61, 0x74, + 0x65, 0x64, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, + 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, + 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x0c, 0x63, 0x72, 0x65, 0x61, 0x74, + 0x65, 0x64, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x12, 0x3e, 0x0a, 0x0c, 0x75, 0x70, 0x64, 0x61, 0x74, + 0x65, 0x64, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, + 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, + 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x0c, 0x75, 0x70, 0x64, 0x61, 0x74, + 0x65, 0x64, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x12, 0x3c, 0x0a, 0x08, 0x64, 0x69, 0x73, 0x61, 0x62, + 0x6c, 0x65, 0x64, 0x18, 0x08, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, + 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x42, 0x6f, 0x6f, 0x6c, + 0x56, 0x61, 0x6c, 0x75, 0x65, 0x42, 0x04, 0xa0, 0xda, 0x29, 0x01, 0x52, 0x08, 0x64, 0x69, 0x73, + 0x61, 0x62, 0x6c, 0x65, 0x64, 0x12, 0x2f, 0x0a, 0x04, 0x73, 0x69, 0x7a, 0x65, 0x18, 0x09, 0x20, + 0x01, 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x49, 0x6e, 0x74, 0x36, 0x34, 0x56, 0x61, 0x6c, 0x75, 0x65, + 0x52, 0x04, 0x73, 0x69, 0x7a, 0x65, 0x12, 0x3d, 0x0a, 0x05, 0x68, 0x6f, 0x73, 0x74, 0x73, 0x18, + 0x0a, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x27, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x6c, + 0x65, 0x72, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, + 0x2e, 0x68, 0x6f, 0x73, 0x74, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x48, 0x6f, 0x73, 0x74, 0x52, 0x05, + 0x68, 0x6f, 0x73, 0x74, 0x73, 0x42, 0x53, 0x5a, 0x51, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, + 0x63, 0x6f, 0x6d, 0x2f, 0x68, 0x61, 0x73, 0x68, 0x69, 0x63, 0x6f, 0x72, 0x70, 0x2f, 0x77, 0x61, + 0x74, 0x63, 0x68, 0x74, 0x6f, 0x77, 0x65, 0x72, 0x2f, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x61, + 0x6c, 0x2f, 0x67, 0x65, 0x6e, 0x2f, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x65, 0x72, + 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, 0x2f, 0x68, + 0x6f, 0x73, 0x74, 0x73, 0x3b, 0x68, 0x6f, 0x73, 0x74, 0x73, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x33, } var ( diff --git a/internal/gen/controller/api/resources/roles/role.pb.go b/internal/gen/controller/api/resources/roles/role.pb.go index c31d66cd3..590c11934 100644 --- a/internal/gen/controller/api/resources/roles/role.pb.go +++ b/internal/gen/controller/api/resources/roles/role.pb.go @@ -266,7 +266,7 @@ type Role struct { // this to be anything other than the role's scope when the role's scope is // a project. GrantScopeId *wrappers.StringValue `protobuf:"bytes,8,opt,name=grant_scope_id,proto3" json:"grant_scope_id,omitempty"` - // The version can be used in subsiquent write requests to ensure this resource + // The version can be used in subsequent write requests to ensure this resource // has not changed and to fail the write if it has. // Output only. Version uint32 `protobuf:"varint,9,opt,name=version,proto3" json:"version,omitempty"` @@ -422,82 +422,83 @@ var file_controller_api_resources_roles_v1_role_proto_rawDesc = []byte{ 0x74, 0x6f, 0x1a, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x65, 0x72, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, 0x2f, 0x73, 0x63, 0x6f, 0x70, 0x65, 0x73, 0x2f, 0x76, 0x31, 0x2f, 0x73, 0x63, 0x6f, 0x70, 0x65, 0x2e, 0x70, 0x72, 0x6f, - 0x74, 0x6f, 0x1a, 0x28, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x65, 0x72, 0x2f, 0x63, + 0x74, 0x6f, 0x1a, 0x2a, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x65, 0x72, 0x2f, 0x63, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x5f, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2f, 0x76, 0x31, - 0x2f, 0x6d, 0x61, 0x73, 0x6b, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x4b, 0x0a, 0x09, - 0x50, 0x72, 0x69, 0x6e, 0x63, 0x69, 0x70, 0x61, 0x6c, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, - 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x74, 0x79, 0x70, - 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x12, 0x1a, 0x0a, - 0x08, 0x73, 0x63, 0x6f, 0x70, 0x65, 0x5f, 0x69, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x08, 0x73, 0x63, 0x6f, 0x70, 0x65, 0x5f, 0x69, 0x64, 0x22, 0x49, 0x0a, 0x09, 0x47, 0x72, 0x61, - 0x6e, 0x74, 0x4a, 0x73, 0x6f, 0x6e, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, - 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, 0x02, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x61, 0x63, - 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x09, 0x52, 0x07, 0x61, 0x63, 0x74, - 0x69, 0x6f, 0x6e, 0x73, 0x22, 0x79, 0x0a, 0x05, 0x47, 0x72, 0x61, 0x6e, 0x74, 0x12, 0x10, 0x0a, - 0x03, 0x72, 0x61, 0x77, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x72, 0x61, 0x77, 0x12, - 0x1c, 0x0a, 0x09, 0x63, 0x61, 0x6e, 0x6f, 0x6e, 0x69, 0x63, 0x61, 0x6c, 0x18, 0x02, 0x20, 0x01, - 0x28, 0x09, 0x52, 0x09, 0x63, 0x61, 0x6e, 0x6f, 0x6e, 0x69, 0x63, 0x61, 0x6c, 0x12, 0x40, 0x0a, - 0x04, 0x6a, 0x73, 0x6f, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2c, 0x2e, 0x63, 0x6f, - 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x65, 0x72, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x72, 0x65, 0x73, - 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, 0x2e, 0x72, 0x6f, 0x6c, 0x65, 0x73, 0x2e, 0x76, 0x31, 0x2e, - 0x47, 0x72, 0x61, 0x6e, 0x74, 0x4a, 0x73, 0x6f, 0x6e, 0x52, 0x04, 0x6a, 0x73, 0x6f, 0x6e, 0x22, - 0x97, 0x06, 0x0a, 0x04, 0x52, 0x6f, 0x6c, 0x65, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x43, 0x0a, 0x05, 0x73, 0x63, 0x6f, 0x70, - 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2d, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, - 0x6c, 0x6c, 0x65, 0x72, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, - 0x65, 0x73, 0x2e, 0x73, 0x63, 0x6f, 0x70, 0x65, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x63, 0x6f, - 0x70, 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x05, 0x73, 0x63, 0x6f, 0x70, 0x65, 0x12, 0x42, 0x0a, - 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x67, 0x6f, - 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x53, 0x74, - 0x72, 0x69, 0x6e, 0x67, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x42, 0x10, 0xc2, 0xdd, 0x29, 0x0c, 0x0a, - 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x52, 0x04, 0x6e, 0x61, 0x6d, - 0x65, 0x12, 0x5e, 0x0a, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, - 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, - 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x56, - 0x61, 0x6c, 0x75, 0x65, 0x42, 0x1e, 0xc2, 0xdd, 0x29, 0x1a, 0x0a, 0x0b, 0x64, 0x65, 0x73, 0x63, - 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, - 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, - 0x6e, 0x12, 0x3e, 0x0a, 0x0c, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x5f, 0x74, 0x69, 0x6d, - 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, - 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, - 0x61, 0x6d, 0x70, 0x52, 0x0c, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x5f, 0x74, 0x69, 0x6d, - 0x65, 0x12, 0x3e, 0x0a, 0x0c, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x64, 0x5f, 0x74, 0x69, 0x6d, - 0x65, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, - 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, - 0x61, 0x6d, 0x70, 0x52, 0x0c, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x64, 0x5f, 0x74, 0x69, 0x6d, - 0x65, 0x12, 0x36, 0x0a, 0x08, 0x64, 0x69, 0x73, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x18, 0x07, 0x20, - 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, - 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x42, 0x6f, 0x6f, 0x6c, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, - 0x08, 0x64, 0x69, 0x73, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x12, 0x68, 0x0a, 0x0e, 0x67, 0x72, 0x61, + 0x2f, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x4b, + 0x0a, 0x09, 0x50, 0x72, 0x69, 0x6e, 0x63, 0x69, 0x70, 0x61, 0x6c, 0x12, 0x0e, 0x0a, 0x02, 0x69, + 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x74, + 0x79, 0x70, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x12, + 0x1a, 0x0a, 0x08, 0x73, 0x63, 0x6f, 0x70, 0x65, 0x5f, 0x69, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x08, 0x73, 0x63, 0x6f, 0x70, 0x65, 0x5f, 0x69, 0x64, 0x22, 0x49, 0x0a, 0x09, 0x47, + 0x72, 0x61, 0x6e, 0x74, 0x4a, 0x73, 0x6f, 0x6e, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, + 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x12, 0x18, 0x0a, 0x07, + 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x09, 0x52, 0x07, 0x61, + 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x22, 0x79, 0x0a, 0x05, 0x47, 0x72, 0x61, 0x6e, 0x74, 0x12, + 0x10, 0x0a, 0x03, 0x72, 0x61, 0x77, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x72, 0x61, + 0x77, 0x12, 0x1c, 0x0a, 0x09, 0x63, 0x61, 0x6e, 0x6f, 0x6e, 0x69, 0x63, 0x61, 0x6c, 0x18, 0x02, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x63, 0x61, 0x6e, 0x6f, 0x6e, 0x69, 0x63, 0x61, 0x6c, 0x12, + 0x40, 0x0a, 0x04, 0x6a, 0x73, 0x6f, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2c, 0x2e, + 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x65, 0x72, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x72, + 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, 0x2e, 0x72, 0x6f, 0x6c, 0x65, 0x73, 0x2e, 0x76, + 0x31, 0x2e, 0x47, 0x72, 0x61, 0x6e, 0x74, 0x4a, 0x73, 0x6f, 0x6e, 0x52, 0x04, 0x6a, 0x73, 0x6f, + 0x6e, 0x22, 0xa9, 0x06, 0x0a, 0x04, 0x52, 0x6f, 0x6c, 0x65, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x43, 0x0a, 0x05, 0x73, 0x63, + 0x6f, 0x70, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2d, 0x2e, 0x63, 0x6f, 0x6e, 0x74, + 0x72, 0x6f, 0x6c, 0x6c, 0x65, 0x72, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x72, 0x65, 0x73, 0x6f, 0x75, + 0x72, 0x63, 0x65, 0x73, 0x2e, 0x73, 0x63, 0x6f, 0x70, 0x65, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x53, + 0x63, 0x6f, 0x70, 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x05, 0x73, 0x63, 0x6f, 0x70, 0x65, 0x12, + 0x46, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1c, 0x2e, + 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, + 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x42, 0x14, 0xa0, 0xda, 0x29, + 0x01, 0xc2, 0xdd, 0x29, 0x0c, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x04, 0x6e, 0x61, 0x6d, + 0x65, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x62, 0x0a, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, + 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x67, + 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x53, + 0x74, 0x72, 0x69, 0x6e, 0x67, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x42, 0x22, 0xa0, 0xda, 0x29, 0x01, + 0xc2, 0xdd, 0x29, 0x1a, 0x0a, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, + 0x6e, 0x12, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x0b, + 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x3e, 0x0a, 0x0c, 0x63, + 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, + 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x0c, 0x63, + 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x12, 0x3e, 0x0a, 0x0c, 0x75, + 0x70, 0x64, 0x61, 0x74, 0x65, 0x64, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x06, 0x20, 0x01, 0x28, + 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x0c, 0x75, + 0x70, 0x64, 0x61, 0x74, 0x65, 0x64, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x12, 0x3c, 0x0a, 0x08, 0x64, + 0x69, 0x73, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, + 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, + 0x42, 0x6f, 0x6f, 0x6c, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x42, 0x04, 0xa0, 0xda, 0x29, 0x01, 0x52, + 0x08, 0x64, 0x69, 0x73, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x12, 0x6c, 0x0a, 0x0e, 0x67, 0x72, 0x61, 0x6e, 0x74, 0x5f, 0x73, 0x63, 0x6f, 0x70, 0x65, 0x5f, 0x69, 0x64, 0x18, 0x08, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x42, - 0x22, 0xc2, 0xdd, 0x29, 0x1e, 0x0a, 0x0e, 0x67, 0x72, 0x61, 0x6e, 0x74, 0x5f, 0x73, 0x63, 0x6f, - 0x70, 0x65, 0x5f, 0x69, 0x64, 0x12, 0x0c, 0x47, 0x72, 0x61, 0x6e, 0x74, 0x53, 0x63, 0x6f, 0x70, - 0x65, 0x49, 0x64, 0x52, 0x0e, 0x67, 0x72, 0x61, 0x6e, 0x74, 0x5f, 0x73, 0x63, 0x6f, 0x70, 0x65, - 0x5f, 0x69, 0x64, 0x12, 0x18, 0x0a, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x09, - 0x20, 0x01, 0x28, 0x0d, 0x52, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x24, 0x0a, - 0x0d, 0x70, 0x72, 0x69, 0x6e, 0x63, 0x69, 0x70, 0x61, 0x6c, 0x5f, 0x69, 0x64, 0x73, 0x18, 0x0a, - 0x20, 0x03, 0x28, 0x09, 0x52, 0x0d, 0x70, 0x72, 0x69, 0x6e, 0x63, 0x69, 0x70, 0x61, 0x6c, 0x5f, - 0x69, 0x64, 0x73, 0x12, 0x4c, 0x0a, 0x0a, 0x70, 0x72, 0x69, 0x6e, 0x63, 0x69, 0x70, 0x61, 0x6c, - 0x73, 0x18, 0x0b, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x2c, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, - 0x6c, 0x6c, 0x65, 0x72, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, - 0x65, 0x73, 0x2e, 0x72, 0x6f, 0x6c, 0x65, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x50, 0x72, 0x69, 0x6e, - 0x63, 0x69, 0x70, 0x61, 0x6c, 0x52, 0x0a, 0x70, 0x72, 0x69, 0x6e, 0x63, 0x69, 0x70, 0x61, 0x6c, - 0x73, 0x12, 0x24, 0x0a, 0x0d, 0x67, 0x72, 0x61, 0x6e, 0x74, 0x5f, 0x73, 0x74, 0x72, 0x69, 0x6e, - 0x67, 0x73, 0x18, 0x0c, 0x20, 0x03, 0x28, 0x09, 0x52, 0x0d, 0x67, 0x72, 0x61, 0x6e, 0x74, 0x5f, - 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x73, 0x12, 0x40, 0x0a, 0x06, 0x67, 0x72, 0x61, 0x6e, 0x74, - 0x73, 0x18, 0x0d, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x28, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, - 0x6c, 0x6c, 0x65, 0x72, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, - 0x65, 0x73, 0x2e, 0x72, 0x6f, 0x6c, 0x65, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x72, 0x61, 0x6e, - 0x74, 0x52, 0x06, 0x67, 0x72, 0x61, 0x6e, 0x74, 0x73, 0x42, 0x53, 0x5a, 0x51, 0x67, 0x69, 0x74, - 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x68, 0x61, 0x73, 0x68, 0x69, 0x63, 0x6f, 0x72, - 0x70, 0x2f, 0x77, 0x61, 0x74, 0x63, 0x68, 0x74, 0x6f, 0x77, 0x65, 0x72, 0x2f, 0x69, 0x6e, 0x74, - 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x2f, 0x67, 0x65, 0x6e, 0x2f, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, - 0x6c, 0x6c, 0x65, 0x72, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, - 0x65, 0x73, 0x2f, 0x72, 0x6f, 0x6c, 0x65, 0x73, 0x3b, 0x72, 0x6f, 0x6c, 0x65, 0x73, 0x62, 0x06, - 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x26, 0xa0, 0xda, 0x29, 0x01, 0xc2, 0xdd, 0x29, 0x1e, 0x0a, 0x0e, 0x67, 0x72, 0x61, 0x6e, 0x74, + 0x5f, 0x73, 0x63, 0x6f, 0x70, 0x65, 0x5f, 0x69, 0x64, 0x12, 0x0c, 0x47, 0x72, 0x61, 0x6e, 0x74, + 0x53, 0x63, 0x6f, 0x70, 0x65, 0x49, 0x64, 0x52, 0x0e, 0x67, 0x72, 0x61, 0x6e, 0x74, 0x5f, 0x73, + 0x63, 0x6f, 0x70, 0x65, 0x5f, 0x69, 0x64, 0x12, 0x18, 0x0a, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, + 0x6f, 0x6e, 0x18, 0x09, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, + 0x6e, 0x12, 0x24, 0x0a, 0x0d, 0x70, 0x72, 0x69, 0x6e, 0x63, 0x69, 0x70, 0x61, 0x6c, 0x5f, 0x69, + 0x64, 0x73, 0x18, 0x0a, 0x20, 0x03, 0x28, 0x09, 0x52, 0x0d, 0x70, 0x72, 0x69, 0x6e, 0x63, 0x69, + 0x70, 0x61, 0x6c, 0x5f, 0x69, 0x64, 0x73, 0x12, 0x4c, 0x0a, 0x0a, 0x70, 0x72, 0x69, 0x6e, 0x63, + 0x69, 0x70, 0x61, 0x6c, 0x73, 0x18, 0x0b, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x2c, 0x2e, 0x63, 0x6f, + 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x65, 0x72, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x72, 0x65, 0x73, + 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, 0x2e, 0x72, 0x6f, 0x6c, 0x65, 0x73, 0x2e, 0x76, 0x31, 0x2e, + 0x50, 0x72, 0x69, 0x6e, 0x63, 0x69, 0x70, 0x61, 0x6c, 0x52, 0x0a, 0x70, 0x72, 0x69, 0x6e, 0x63, + 0x69, 0x70, 0x61, 0x6c, 0x73, 0x12, 0x24, 0x0a, 0x0d, 0x67, 0x72, 0x61, 0x6e, 0x74, 0x5f, 0x73, + 0x74, 0x72, 0x69, 0x6e, 0x67, 0x73, 0x18, 0x0c, 0x20, 0x03, 0x28, 0x09, 0x52, 0x0d, 0x67, 0x72, + 0x61, 0x6e, 0x74, 0x5f, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x73, 0x12, 0x40, 0x0a, 0x06, 0x67, + 0x72, 0x61, 0x6e, 0x74, 0x73, 0x18, 0x0d, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x28, 0x2e, 0x63, 0x6f, + 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x65, 0x72, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x72, 0x65, 0x73, + 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, 0x2e, 0x72, 0x6f, 0x6c, 0x65, 0x73, 0x2e, 0x76, 0x31, 0x2e, + 0x47, 0x72, 0x61, 0x6e, 0x74, 0x52, 0x06, 0x67, 0x72, 0x61, 0x6e, 0x74, 0x73, 0x42, 0x53, 0x5a, + 0x51, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x68, 0x61, 0x73, 0x68, + 0x69, 0x63, 0x6f, 0x72, 0x70, 0x2f, 0x77, 0x61, 0x74, 0x63, 0x68, 0x74, 0x6f, 0x77, 0x65, 0x72, + 0x2f, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x2f, 0x67, 0x65, 0x6e, 0x2f, 0x63, 0x6f, + 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x65, 0x72, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x72, 0x65, 0x73, + 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, 0x2f, 0x72, 0x6f, 0x6c, 0x65, 0x73, 0x3b, 0x72, 0x6f, 0x6c, + 0x65, 0x73, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( diff --git a/internal/gen/controller/api/resources/scopes/scope.pb.go b/internal/gen/controller/api/resources/scopes/scope.pb.go index 4986a28a0..c3b61924a 100644 --- a/internal/gen/controller/api/resources/scopes/scope.pb.go +++ b/internal/gen/controller/api/resources/scopes/scope.pb.go @@ -141,6 +141,10 @@ type Scope struct { UpdatedTime *timestamp.Timestamp `protobuf:"bytes,6,opt,name=updated_time,proto3" json:"updated_time,omitempty"` // Whether the resource is disabled Disabled *wrappers.BoolValue `protobuf:"bytes,7,opt,name=disabled,proto3" json:"disabled,omitempty"` + // The version can be used in subsequent write requests to ensure this + // resource has not changed and to fail the write if it has. + // Output only. + Version uint32 `protobuf:"varint,8,opt,name=version,proto3" json:"version,omitempty"` } func (x *Scope) Reset() { @@ -224,6 +228,13 @@ func (x *Scope) GetDisabled() *wrappers.BoolValue { return nil } +func (x *Scope) GetVersion() uint32 { + if x != nil { + return x.Version + } + return 0 +} + var File_controller_api_resources_scopes_v1_scope_proto protoreflect.FileDescriptor var file_controller_api_resources_scopes_v1_scope_proto_rawDesc = []byte{ @@ -236,52 +247,55 @@ var file_controller_api_resources_scopes_v1_scope_proto_rawDesc = []byte{ 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x77, 0x72, 0x61, 0x70, 0x70, 0x65, 0x72, 0x73, 0x2e, - 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x28, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x65, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x2a, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x65, 0x72, 0x2f, 0x63, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x5f, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, - 0x2f, 0x76, 0x31, 0x2f, 0x6d, 0x61, 0x73, 0x6b, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, - 0x8f, 0x01, 0x0a, 0x09, 0x53, 0x63, 0x6f, 0x70, 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x0e, 0x0a, - 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x12, 0x0a, - 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x74, 0x79, 0x70, - 0x65, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x20, 0x0a, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, - 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x64, 0x65, 0x73, 0x63, - 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x28, 0x0a, 0x0f, 0x70, 0x61, 0x72, 0x65, 0x6e, - 0x74, 0x5f, 0x73, 0x63, 0x6f, 0x70, 0x65, 0x5f, 0x69, 0x64, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, - 0x52, 0x0f, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x5f, 0x73, 0x63, 0x6f, 0x70, 0x65, 0x5f, 0x69, - 0x64, 0x22, 0xb8, 0x03, 0x0a, 0x05, 0x53, 0x63, 0x6f, 0x70, 0x65, 0x12, 0x0e, 0x0a, 0x02, 0x69, - 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x43, 0x0a, 0x05, 0x73, - 0x63, 0x6f, 0x70, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2d, 0x2e, 0x63, 0x6f, 0x6e, - 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x65, 0x72, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x72, 0x65, 0x73, 0x6f, - 0x75, 0x72, 0x63, 0x65, 0x73, 0x2e, 0x73, 0x63, 0x6f, 0x70, 0x65, 0x73, 0x2e, 0x76, 0x31, 0x2e, - 0x53, 0x63, 0x6f, 0x70, 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x05, 0x73, 0x63, 0x6f, 0x70, 0x65, - 0x12, 0x42, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1c, - 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, - 0x2e, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x42, 0x10, 0xc2, 0xdd, - 0x29, 0x0c, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x52, 0x04, - 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x5e, 0x0a, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, - 0x69, 0x6f, 0x6e, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x67, 0x6f, 0x6f, 0x67, - 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x53, 0x74, 0x72, 0x69, - 0x6e, 0x67, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x42, 0x1e, 0xc2, 0xdd, 0x29, 0x1a, 0x0a, 0x0b, 0x64, - 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x0b, 0x64, 0x65, 0x73, 0x63, - 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, - 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x3e, 0x0a, 0x0c, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x5f, - 0x74, 0x69, 0x6d, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, - 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, - 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x0c, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x5f, - 0x74, 0x69, 0x6d, 0x65, 0x12, 0x3e, 0x0a, 0x0c, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x64, 0x5f, - 0x74, 0x69, 0x6d, 0x65, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, - 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, - 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x0c, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x64, 0x5f, - 0x74, 0x69, 0x6d, 0x65, 0x12, 0x36, 0x0a, 0x08, 0x64, 0x69, 0x73, 0x61, 0x62, 0x6c, 0x65, 0x64, - 0x18, 0x07, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, - 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x42, 0x6f, 0x6f, 0x6c, 0x56, 0x61, 0x6c, - 0x75, 0x65, 0x52, 0x08, 0x64, 0x69, 0x73, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x42, 0x55, 0x5a, 0x53, - 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x68, 0x61, 0x73, 0x68, 0x69, - 0x63, 0x6f, 0x72, 0x70, 0x2f, 0x77, 0x61, 0x74, 0x63, 0x68, 0x74, 0x6f, 0x77, 0x65, 0x72, 0x2f, - 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x2f, 0x67, 0x65, 0x6e, 0x2f, 0x63, 0x6f, 0x6e, - 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x65, 0x72, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x72, 0x65, 0x73, 0x6f, - 0x75, 0x72, 0x63, 0x65, 0x73, 0x2f, 0x73, 0x63, 0x6f, 0x70, 0x65, 0x73, 0x3b, 0x73, 0x63, 0x6f, - 0x70, 0x65, 0x73, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x2f, 0x76, 0x31, 0x2f, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x22, 0x8f, 0x01, 0x0a, 0x09, 0x53, 0x63, 0x6f, 0x70, 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x12, + 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, + 0x12, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x74, + 0x79, 0x70, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x20, 0x0a, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, + 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x64, 0x65, + 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x28, 0x0a, 0x0f, 0x70, 0x61, 0x72, + 0x65, 0x6e, 0x74, 0x5f, 0x73, 0x63, 0x6f, 0x70, 0x65, 0x5f, 0x69, 0x64, 0x18, 0x05, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x0f, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x5f, 0x73, 0x63, 0x6f, 0x70, 0x65, + 0x5f, 0x69, 0x64, 0x22, 0xe0, 0x03, 0x0a, 0x05, 0x53, 0x63, 0x6f, 0x70, 0x65, 0x12, 0x0e, 0x0a, + 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x43, 0x0a, + 0x05, 0x73, 0x63, 0x6f, 0x70, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2d, 0x2e, 0x63, + 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x65, 0x72, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x72, 0x65, + 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, 0x2e, 0x73, 0x63, 0x6f, 0x70, 0x65, 0x73, 0x2e, 0x76, + 0x31, 0x2e, 0x53, 0x63, 0x6f, 0x70, 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x05, 0x73, 0x63, 0x6f, + 0x70, 0x65, 0x12, 0x46, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, + 0x32, 0x1c, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, + 0x75, 0x66, 0x2e, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x42, 0x14, + 0xa0, 0xda, 0x29, 0x01, 0xc2, 0xdd, 0x29, 0x0c, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x04, + 0x6e, 0x61, 0x6d, 0x65, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x62, 0x0a, 0x0b, 0x64, 0x65, + 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, + 0x1c, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, + 0x66, 0x2e, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x42, 0x22, 0xa0, + 0xda, 0x29, 0x01, 0xc2, 0xdd, 0x29, 0x1a, 0x0a, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, + 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, + 0x6e, 0x52, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x3e, + 0x0a, 0x0c, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x05, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, + 0x52, 0x0c, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x12, 0x3e, + 0x0a, 0x0c, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x64, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x06, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, + 0x52, 0x0c, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x64, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x12, 0x3c, + 0x0a, 0x08, 0x64, 0x69, 0x73, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0b, + 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, + 0x75, 0x66, 0x2e, 0x42, 0x6f, 0x6f, 0x6c, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x42, 0x04, 0xa0, 0xda, + 0x29, 0x01, 0x52, 0x08, 0x64, 0x69, 0x73, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x12, 0x18, 0x0a, 0x07, + 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x08, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x07, 0x76, + 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x42, 0x55, 0x5a, 0x53, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, + 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x68, 0x61, 0x73, 0x68, 0x69, 0x63, 0x6f, 0x72, 0x70, 0x2f, 0x77, + 0x61, 0x74, 0x63, 0x68, 0x74, 0x6f, 0x77, 0x65, 0x72, 0x2f, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, + 0x61, 0x6c, 0x2f, 0x67, 0x65, 0x6e, 0x2f, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x65, + 0x72, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, 0x2f, + 0x73, 0x63, 0x6f, 0x70, 0x65, 0x73, 0x3b, 0x73, 0x63, 0x6f, 0x70, 0x65, 0x73, 0x62, 0x06, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( diff --git a/internal/gen/controller/api/resources/users/user.pb.go b/internal/gen/controller/api/resources/users/user.pb.go index 7b1ee9d68..1450fc6c5 100644 --- a/internal/gen/controller/api/resources/users/user.pb.go +++ b/internal/gen/controller/api/resources/users/user.pb.go @@ -53,6 +53,10 @@ type User struct { UpdatedTime *timestamp.Timestamp `protobuf:"bytes,6,opt,name=updated_time,proto3" json:"updated_time,omitempty"` // Whether the resource is disabled Disabled *wrappers.BoolValue `protobuf:"bytes,7,opt,name=disabled,proto3" json:"disabled,omitempty"` + // The version can be used in subsequent write requests to ensure this + // resource has not changed and to fail the write if it has. + // Output only. + Version uint32 `protobuf:"varint,8,opt,name=version,proto3" json:"version,omitempty"` } func (x *User) Reset() { @@ -136,6 +140,13 @@ func (x *User) GetDisabled() *wrappers.BoolValue { return nil } +func (x *User) GetVersion() uint32 { + if x != nil { + return x.Version + } + return 0 +} + var File_controller_api_resources_users_v1_user_proto protoreflect.FileDescriptor var file_controller_api_resources_users_v1_user_proto_rawDesc = []byte{ @@ -151,43 +162,45 @@ var file_controller_api_resources_users_v1_user_proto_rawDesc = []byte{ 0x74, 0x6f, 0x1a, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x65, 0x72, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, 0x2f, 0x73, 0x63, 0x6f, 0x70, 0x65, 0x73, 0x2f, 0x76, 0x31, 0x2f, 0x73, 0x63, 0x6f, 0x70, 0x65, 0x2e, 0x70, 0x72, 0x6f, - 0x74, 0x6f, 0x1a, 0x28, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x65, 0x72, 0x2f, 0x63, + 0x74, 0x6f, 0x1a, 0x2a, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x65, 0x72, 0x2f, 0x63, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x5f, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2f, 0x76, 0x31, - 0x2f, 0x6d, 0x61, 0x73, 0x6b, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xb7, 0x03, 0x0a, - 0x04, 0x55, 0x73, 0x65, 0x72, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x43, 0x0a, 0x05, 0x73, 0x63, 0x6f, 0x70, 0x65, 0x18, 0x02, - 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2d, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x65, - 0x72, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, 0x2e, - 0x73, 0x63, 0x6f, 0x70, 0x65, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x63, 0x6f, 0x70, 0x65, 0x49, - 0x6e, 0x66, 0x6f, 0x52, 0x05, 0x73, 0x63, 0x6f, 0x70, 0x65, 0x12, 0x42, 0x0a, 0x04, 0x6e, 0x61, - 0x6d, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, - 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x53, 0x74, 0x72, 0x69, 0x6e, - 0x67, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x42, 0x10, 0xc2, 0xdd, 0x29, 0x0c, 0x0a, 0x04, 0x6e, 0x61, - 0x6d, 0x65, 0x12, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x5e, - 0x0a, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x04, 0x20, - 0x01, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, - 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x56, 0x61, 0x6c, 0x75, - 0x65, 0x42, 0x1e, 0xc2, 0xdd, 0x29, 0x1a, 0x0a, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, - 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, - 0x6e, 0x52, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x3e, - 0x0a, 0x0c, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x05, - 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, - 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, - 0x52, 0x0c, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x12, 0x3e, - 0x0a, 0x0c, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x64, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x06, - 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, - 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, - 0x52, 0x0c, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x64, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x12, 0x36, - 0x0a, 0x08, 0x64, 0x69, 0x73, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0b, - 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, - 0x75, 0x66, 0x2e, 0x42, 0x6f, 0x6f, 0x6c, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, 0x08, 0x64, 0x69, - 0x73, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x42, 0x53, 0x5a, 0x51, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, - 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x68, 0x61, 0x73, 0x68, 0x69, 0x63, 0x6f, 0x72, 0x70, 0x2f, 0x77, - 0x61, 0x74, 0x63, 0x68, 0x74, 0x6f, 0x77, 0x65, 0x72, 0x2f, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, - 0x61, 0x6c, 0x2f, 0x67, 0x65, 0x6e, 0x2f, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x65, - 0x72, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, 0x2f, - 0x75, 0x73, 0x65, 0x72, 0x73, 0x3b, 0x75, 0x73, 0x65, 0x72, 0x73, 0x62, 0x06, 0x70, 0x72, 0x6f, - 0x74, 0x6f, 0x33, + 0x2f, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xdf, + 0x03, 0x0a, 0x04, 0x55, 0x73, 0x65, 0x72, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x43, 0x0a, 0x05, 0x73, 0x63, 0x6f, 0x70, 0x65, + 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2d, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, + 0x6c, 0x65, 0x72, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, + 0x73, 0x2e, 0x73, 0x63, 0x6f, 0x70, 0x65, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x63, 0x6f, 0x70, + 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x05, 0x73, 0x63, 0x6f, 0x70, 0x65, 0x12, 0x46, 0x0a, 0x04, + 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x67, 0x6f, 0x6f, + 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x53, 0x74, 0x72, + 0x69, 0x6e, 0x67, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x42, 0x14, 0xa0, 0xda, 0x29, 0x01, 0xc2, 0xdd, + 0x29, 0x0c, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x52, 0x04, + 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x62, 0x0a, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, + 0x69, 0x6f, 0x6e, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x67, 0x6f, 0x6f, 0x67, + 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x53, 0x74, 0x72, 0x69, + 0x6e, 0x67, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x42, 0x22, 0xa0, 0xda, 0x29, 0x01, 0xc2, 0xdd, 0x29, + 0x1a, 0x0a, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x0b, + 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x0b, 0x64, 0x65, 0x73, + 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x3e, 0x0a, 0x0c, 0x63, 0x72, 0x65, 0x61, + 0x74, 0x65, 0x64, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, + 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, + 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x0c, 0x63, 0x72, 0x65, 0x61, + 0x74, 0x65, 0x64, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x12, 0x3e, 0x0a, 0x0c, 0x75, 0x70, 0x64, 0x61, + 0x74, 0x65, 0x64, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, + 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, + 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x0c, 0x75, 0x70, 0x64, 0x61, + 0x74, 0x65, 0x64, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x12, 0x3c, 0x0a, 0x08, 0x64, 0x69, 0x73, 0x61, + 0x62, 0x6c, 0x65, 0x64, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, + 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x42, 0x6f, 0x6f, + 0x6c, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x42, 0x04, 0xa0, 0xda, 0x29, 0x01, 0x52, 0x08, 0x64, 0x69, + 0x73, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x12, 0x18, 0x0a, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, + 0x6e, 0x18, 0x08, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, + 0x42, 0x53, 0x5a, 0x51, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x68, + 0x61, 0x73, 0x68, 0x69, 0x63, 0x6f, 0x72, 0x70, 0x2f, 0x77, 0x61, 0x74, 0x63, 0x68, 0x74, 0x6f, + 0x77, 0x65, 0x72, 0x2f, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x2f, 0x67, 0x65, 0x6e, + 0x2f, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x65, 0x72, 0x2f, 0x61, 0x70, 0x69, 0x2f, + 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, 0x2f, 0x75, 0x73, 0x65, 0x72, 0x73, 0x3b, + 0x75, 0x73, 0x65, 0x72, 0x73, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( diff --git a/internal/gen/controller/api/services/auth_method_service.pb.go b/internal/gen/controller/api/services/auth_method_service.pb.go index e856874f4..27ef3856d 100644 --- a/internal/gen/controller/api/services/auth_method_service.pb.go +++ b/internal/gen/controller/api/services/auth_method_service.pb.go @@ -10,7 +10,7 @@ import ( context "context" proto "github.com/golang/protobuf/proto" _ "github.com/grpc-ecosystem/grpc-gateway/v2/protoc-gen-openapiv2/options" - auth "github.com/hashicorp/watchtower/internal/gen/controller/api/resources/auth" + authmethods "github.com/hashicorp/watchtower/internal/gen/controller/api/resources/authmethods" _ "google.golang.org/genproto/googleapis/api/annotations" field_mask "google.golang.org/genproto/protobuf/field_mask" grpc "google.golang.org/grpc" @@ -93,7 +93,7 @@ type GetAuthMethodResponse struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - Item *auth.AuthMethod `protobuf:"bytes,1,opt,name=item,proto3" json:"item,omitempty"` + Item *authmethods.AuthMethod `protobuf:"bytes,1,opt,name=item,proto3" json:"item,omitempty"` } func (x *GetAuthMethodResponse) Reset() { @@ -128,7 +128,7 @@ func (*GetAuthMethodResponse) Descriptor() ([]byte, []int) { return file_controller_api_services_v1_auth_method_service_proto_rawDescGZIP(), []int{1} } -func (x *GetAuthMethodResponse) GetItem() *auth.AuthMethod { +func (x *GetAuthMethodResponse) GetItem() *authmethods.AuthMethod { if x != nil { return x.Item } @@ -187,7 +187,7 @@ type ListAuthMethodsResponse struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - Items []*auth.AuthMethod `protobuf:"bytes,1,rep,name=items,proto3" json:"items,omitempty"` + Items []*authmethods.AuthMethod `protobuf:"bytes,1,rep,name=items,proto3" json:"items,omitempty"` } func (x *ListAuthMethodsResponse) Reset() { @@ -222,7 +222,7 @@ func (*ListAuthMethodsResponse) Descriptor() ([]byte, []int) { return file_controller_api_services_v1_auth_method_service_proto_rawDescGZIP(), []int{3} } -func (x *ListAuthMethodsResponse) GetItems() []*auth.AuthMethod { +func (x *ListAuthMethodsResponse) GetItems() []*authmethods.AuthMethod { if x != nil { return x.Items } @@ -234,7 +234,7 @@ type CreateAuthMethodRequest struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - Item *auth.AuthMethod `protobuf:"bytes,1,opt,name=item,proto3" json:"item,omitempty"` + Item *authmethods.AuthMethod `protobuf:"bytes,1,opt,name=item,proto3" json:"item,omitempty"` } func (x *CreateAuthMethodRequest) Reset() { @@ -269,7 +269,7 @@ func (*CreateAuthMethodRequest) Descriptor() ([]byte, []int) { return file_controller_api_services_v1_auth_method_service_proto_rawDescGZIP(), []int{4} } -func (x *CreateAuthMethodRequest) GetItem() *auth.AuthMethod { +func (x *CreateAuthMethodRequest) GetItem() *authmethods.AuthMethod { if x != nil { return x.Item } @@ -281,8 +281,8 @@ type CreateAuthMethodResponse struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - Uri string `protobuf:"bytes,1,opt,name=uri,proto3" json:"uri,omitempty"` - Item *auth.AuthMethod `protobuf:"bytes,2,opt,name=item,proto3" json:"item,omitempty"` + Uri string `protobuf:"bytes,1,opt,name=uri,proto3" json:"uri,omitempty"` + Item *authmethods.AuthMethod `protobuf:"bytes,2,opt,name=item,proto3" json:"item,omitempty"` } func (x *CreateAuthMethodResponse) Reset() { @@ -324,7 +324,7 @@ func (x *CreateAuthMethodResponse) GetUri() string { return "" } -func (x *CreateAuthMethodResponse) GetItem() *auth.AuthMethod { +func (x *CreateAuthMethodResponse) GetItem() *authmethods.AuthMethod { if x != nil { return x.Item } @@ -336,9 +336,9 @@ type UpdateAuthMethodRequest struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` - Item *auth.AuthMethod `protobuf:"bytes,2,opt,name=item,proto3" json:"item,omitempty"` - UpdateMask *field_mask.FieldMask `protobuf:"bytes,3,opt,name=update_mask,json=updateMask,proto3" json:"update_mask,omitempty"` + Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` + Item *authmethods.AuthMethod `protobuf:"bytes,2,opt,name=item,proto3" json:"item,omitempty"` + UpdateMask *field_mask.FieldMask `protobuf:"bytes,3,opt,name=update_mask,json=updateMask,proto3" json:"update_mask,omitempty"` } func (x *UpdateAuthMethodRequest) Reset() { @@ -380,7 +380,7 @@ func (x *UpdateAuthMethodRequest) GetId() string { return "" } -func (x *UpdateAuthMethodRequest) GetItem() *auth.AuthMethod { +func (x *UpdateAuthMethodRequest) GetItem() *authmethods.AuthMethod { if x != nil { return x.Item } @@ -399,7 +399,7 @@ type UpdateAuthMethodResponse struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - Item *auth.AuthMethod `protobuf:"bytes,1,opt,name=item,proto3" json:"item,omitempty"` + Item *authmethods.AuthMethod `protobuf:"bytes,1,opt,name=item,proto3" json:"item,omitempty"` } func (x *UpdateAuthMethodResponse) Reset() { @@ -434,7 +434,7 @@ func (*UpdateAuthMethodResponse) Descriptor() ([]byte, []int) { return file_controller_api_services_v1_auth_method_service_proto_rawDescGZIP(), []int{7} } -func (x *UpdateAuthMethodResponse) GetItem() *auth.AuthMethod { +func (x *UpdateAuthMethodResponse) GetItem() *authmethods.AuthMethod { if x != nil { return x.Item } @@ -550,132 +550,135 @@ var file_controller_api_services_v1_auth_method_service_proto_rawDesc = []byte{ 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x20, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x5f, 0x6d, 0x61, 0x73, 0x6b, 0x2e, 0x70, 0x72, 0x6f, - 0x74, 0x6f, 0x1a, 0x32, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x65, 0x72, 0x2f, 0x61, + 0x74, 0x6f, 0x1a, 0x39, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x65, 0x72, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, 0x2f, 0x61, 0x75, 0x74, - 0x68, 0x2f, 0x76, 0x31, 0x2f, 0x61, 0x75, 0x74, 0x68, 0x5f, 0x6d, 0x65, 0x74, 0x68, 0x6f, 0x64, - 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x3a, 0x0a, 0x14, 0x47, 0x65, 0x74, 0x41, 0x75, 0x74, - 0x68, 0x4d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x0e, - 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x12, - 0x0a, 0x04, 0x76, 0x69, 0x65, 0x77, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x76, 0x69, - 0x65, 0x77, 0x22, 0x59, 0x0a, 0x15, 0x47, 0x65, 0x74, 0x41, 0x75, 0x74, 0x68, 0x4d, 0x65, 0x74, - 0x68, 0x6f, 0x64, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x40, 0x0a, 0x04, 0x69, - 0x74, 0x65, 0x6d, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2c, 0x2e, 0x63, 0x6f, 0x6e, 0x74, - 0x72, 0x6f, 0x6c, 0x6c, 0x65, 0x72, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x72, 0x65, 0x73, 0x6f, 0x75, - 0x72, 0x63, 0x65, 0x73, 0x2e, 0x61, 0x75, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x2e, 0x41, 0x75, 0x74, - 0x68, 0x4d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x52, 0x04, 0x69, 0x74, 0x65, 0x6d, 0x22, 0x2c, 0x0a, - 0x16, 0x4c, 0x69, 0x73, 0x74, 0x41, 0x75, 0x74, 0x68, 0x4d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x73, - 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x76, 0x69, 0x65, 0x77, 0x18, - 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x76, 0x69, 0x65, 0x77, 0x22, 0x5d, 0x0a, 0x17, 0x4c, + 0x68, 0x6d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x73, 0x2f, 0x76, 0x31, 0x2f, 0x61, 0x75, 0x74, 0x68, + 0x5f, 0x6d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x3a, 0x0a, + 0x14, 0x47, 0x65, 0x74, 0x41, 0x75, 0x74, 0x68, 0x4d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x52, 0x65, + 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x76, 0x69, 0x65, 0x77, 0x18, 0x02, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x04, 0x76, 0x69, 0x65, 0x77, 0x22, 0x60, 0x0a, 0x15, 0x47, 0x65, 0x74, + 0x41, 0x75, 0x74, 0x68, 0x4d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, + 0x73, 0x65, 0x12, 0x47, 0x0a, 0x04, 0x69, 0x74, 0x65, 0x6d, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, + 0x32, 0x33, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x65, 0x72, 0x2e, 0x61, 0x70, + 0x69, 0x2e, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, 0x2e, 0x61, 0x75, 0x74, 0x68, + 0x6d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x41, 0x75, 0x74, 0x68, 0x4d, + 0x65, 0x74, 0x68, 0x6f, 0x64, 0x52, 0x04, 0x69, 0x74, 0x65, 0x6d, 0x22, 0x2c, 0x0a, 0x16, 0x4c, 0x69, 0x73, 0x74, 0x41, 0x75, 0x74, 0x68, 0x4d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x73, 0x52, 0x65, - 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x42, 0x0a, 0x05, 0x69, 0x74, 0x65, 0x6d, 0x73, 0x18, - 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x2c, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x6c, - 0x65, 0x72, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, - 0x2e, 0x61, 0x75, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x2e, 0x41, 0x75, 0x74, 0x68, 0x4d, 0x65, 0x74, - 0x68, 0x6f, 0x64, 0x52, 0x05, 0x69, 0x74, 0x65, 0x6d, 0x73, 0x22, 0x5b, 0x0a, 0x17, 0x43, 0x72, - 0x65, 0x61, 0x74, 0x65, 0x41, 0x75, 0x74, 0x68, 0x4d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x52, 0x65, - 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x40, 0x0a, 0x04, 0x69, 0x74, 0x65, 0x6d, 0x18, 0x01, 0x20, - 0x01, 0x28, 0x0b, 0x32, 0x2c, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x65, 0x72, + 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x76, 0x69, 0x65, 0x77, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x04, 0x76, 0x69, 0x65, 0x77, 0x22, 0x64, 0x0a, 0x17, 0x4c, 0x69, 0x73, + 0x74, 0x41, 0x75, 0x74, 0x68, 0x4d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x73, 0x52, 0x65, 0x73, 0x70, + 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x49, 0x0a, 0x05, 0x69, 0x74, 0x65, 0x6d, 0x73, 0x18, 0x01, 0x20, + 0x03, 0x28, 0x0b, 0x32, 0x33, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x65, 0x72, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, 0x2e, 0x61, - 0x75, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x2e, 0x41, 0x75, 0x74, 0x68, 0x4d, 0x65, 0x74, 0x68, 0x6f, - 0x64, 0x52, 0x04, 0x69, 0x74, 0x65, 0x6d, 0x22, 0x6e, 0x0a, 0x18, 0x43, 0x72, 0x65, 0x61, 0x74, - 0x65, 0x41, 0x75, 0x74, 0x68, 0x4d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x52, 0x65, 0x73, 0x70, 0x6f, - 0x6e, 0x73, 0x65, 0x12, 0x10, 0x0a, 0x03, 0x75, 0x72, 0x69, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, - 0x52, 0x03, 0x75, 0x72, 0x69, 0x12, 0x40, 0x0a, 0x04, 0x69, 0x74, 0x65, 0x6d, 0x18, 0x02, 0x20, - 0x01, 0x28, 0x0b, 0x32, 0x2c, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x65, 0x72, - 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, 0x2e, 0x61, - 0x75, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x2e, 0x41, 0x75, 0x74, 0x68, 0x4d, 0x65, 0x74, 0x68, 0x6f, - 0x64, 0x52, 0x04, 0x69, 0x74, 0x65, 0x6d, 0x22, 0xa8, 0x01, 0x0a, 0x17, 0x55, 0x70, 0x64, 0x61, - 0x74, 0x65, 0x41, 0x75, 0x74, 0x68, 0x4d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x52, 0x65, 0x71, 0x75, - 0x65, 0x73, 0x74, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x02, 0x69, 0x64, 0x12, 0x40, 0x0a, 0x04, 0x69, 0x74, 0x65, 0x6d, 0x18, 0x02, 0x20, 0x01, 0x28, - 0x0b, 0x32, 0x2c, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x65, 0x72, 0x2e, 0x61, - 0x70, 0x69, 0x2e, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, 0x2e, 0x61, 0x75, 0x74, - 0x68, 0x2e, 0x76, 0x31, 0x2e, 0x41, 0x75, 0x74, 0x68, 0x4d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x52, - 0x04, 0x69, 0x74, 0x65, 0x6d, 0x12, 0x3b, 0x0a, 0x0b, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x5f, - 0x6d, 0x61, 0x73, 0x6b, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, - 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x46, 0x69, 0x65, - 0x6c, 0x64, 0x4d, 0x61, 0x73, 0x6b, 0x52, 0x0a, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x4d, 0x61, - 0x73, 0x6b, 0x22, 0x5c, 0x0a, 0x18, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x41, 0x75, 0x74, 0x68, - 0x4d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x40, - 0x0a, 0x04, 0x69, 0x74, 0x65, 0x6d, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2c, 0x2e, 0x63, - 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x65, 0x72, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x72, 0x65, - 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, 0x2e, 0x61, 0x75, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x2e, - 0x41, 0x75, 0x74, 0x68, 0x4d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x52, 0x04, 0x69, 0x74, 0x65, 0x6d, - 0x22, 0x29, 0x0a, 0x17, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x41, 0x75, 0x74, 0x68, 0x4d, 0x65, - 0x74, 0x68, 0x6f, 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x0e, 0x0a, 0x02, 0x69, - 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x22, 0x34, 0x0a, 0x18, 0x44, - 0x65, 0x6c, 0x65, 0x74, 0x65, 0x41, 0x75, 0x74, 0x68, 0x4d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x52, - 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x65, 0x78, 0x69, 0x73, 0x74, - 0x65, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x52, 0x07, 0x65, 0x78, 0x69, 0x73, 0x74, 0x65, - 0x64, 0x32, 0xee, 0x07, 0x0a, 0x11, 0x41, 0x75, 0x74, 0x68, 0x4d, 0x65, 0x74, 0x68, 0x6f, 0x64, - 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0xbf, 0x01, 0x0a, 0x0d, 0x47, 0x65, 0x74, 0x41, - 0x75, 0x74, 0x68, 0x4d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x12, 0x30, 0x2e, 0x63, 0x6f, 0x6e, 0x74, + 0x75, 0x74, 0x68, 0x6d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x41, 0x75, + 0x74, 0x68, 0x4d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x52, 0x05, 0x69, 0x74, 0x65, 0x6d, 0x73, 0x22, + 0x62, 0x0a, 0x17, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x41, 0x75, 0x74, 0x68, 0x4d, 0x65, 0x74, + 0x68, 0x6f, 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x47, 0x0a, 0x04, 0x69, 0x74, + 0x65, 0x6d, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x33, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x72, + 0x6f, 0x6c, 0x6c, 0x65, 0x72, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, + 0x63, 0x65, 0x73, 0x2e, 0x61, 0x75, 0x74, 0x68, 0x6d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x73, 0x2e, + 0x76, 0x31, 0x2e, 0x41, 0x75, 0x74, 0x68, 0x4d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x52, 0x04, 0x69, + 0x74, 0x65, 0x6d, 0x22, 0x75, 0x0a, 0x18, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x41, 0x75, 0x74, + 0x68, 0x4d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, + 0x10, 0x0a, 0x03, 0x75, 0x72, 0x69, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x75, 0x72, + 0x69, 0x12, 0x47, 0x0a, 0x04, 0x69, 0x74, 0x65, 0x6d, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, + 0x33, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x65, 0x72, 0x2e, 0x61, 0x70, 0x69, + 0x2e, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, 0x2e, 0x61, 0x75, 0x74, 0x68, 0x6d, + 0x65, 0x74, 0x68, 0x6f, 0x64, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x41, 0x75, 0x74, 0x68, 0x4d, 0x65, + 0x74, 0x68, 0x6f, 0x64, 0x52, 0x04, 0x69, 0x74, 0x65, 0x6d, 0x22, 0xaf, 0x01, 0x0a, 0x17, 0x55, + 0x70, 0x64, 0x61, 0x74, 0x65, 0x41, 0x75, 0x74, 0x68, 0x4d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x52, + 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x47, 0x0a, 0x04, 0x69, 0x74, 0x65, 0x6d, 0x18, 0x02, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x33, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x65, + 0x72, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, 0x2e, + 0x61, 0x75, 0x74, 0x68, 0x6d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x41, + 0x75, 0x74, 0x68, 0x4d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x52, 0x04, 0x69, 0x74, 0x65, 0x6d, 0x12, + 0x3b, 0x0a, 0x0b, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x5f, 0x6d, 0x61, 0x73, 0x6b, 0x18, 0x03, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x4d, 0x61, 0x73, 0x6b, + 0x52, 0x0a, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x4d, 0x61, 0x73, 0x6b, 0x22, 0x63, 0x0a, 0x18, + 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x41, 0x75, 0x74, 0x68, 0x4d, 0x65, 0x74, 0x68, 0x6f, 0x64, + 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x47, 0x0a, 0x04, 0x69, 0x74, 0x65, 0x6d, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x33, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, + 0x6c, 0x65, 0x72, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, + 0x73, 0x2e, 0x61, 0x75, 0x74, 0x68, 0x6d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x73, 0x2e, 0x76, 0x31, + 0x2e, 0x41, 0x75, 0x74, 0x68, 0x4d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x52, 0x04, 0x69, 0x74, 0x65, + 0x6d, 0x22, 0x29, 0x0a, 0x17, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x41, 0x75, 0x74, 0x68, 0x4d, + 0x65, 0x74, 0x68, 0x6f, 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x0e, 0x0a, 0x02, + 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x22, 0x34, 0x0a, 0x18, + 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x41, 0x75, 0x74, 0x68, 0x4d, 0x65, 0x74, 0x68, 0x6f, 0x64, + 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x65, 0x78, 0x69, 0x73, + 0x74, 0x65, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x52, 0x07, 0x65, 0x78, 0x69, 0x73, 0x74, + 0x65, 0x64, 0x32, 0xee, 0x07, 0x0a, 0x11, 0x41, 0x75, 0x74, 0x68, 0x4d, 0x65, 0x74, 0x68, 0x6f, + 0x64, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0xbf, 0x01, 0x0a, 0x0d, 0x47, 0x65, 0x74, + 0x41, 0x75, 0x74, 0x68, 0x4d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x12, 0x30, 0x2e, 0x63, 0x6f, 0x6e, + 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x65, 0x72, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x73, 0x65, 0x72, 0x76, + 0x69, 0x63, 0x65, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x41, 0x75, 0x74, 0x68, 0x4d, + 0x65, 0x74, 0x68, 0x6f, 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x31, 0x2e, 0x63, + 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x65, 0x72, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x73, 0x65, + 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x41, 0x75, 0x74, + 0x68, 0x4d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, + 0x49, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x26, 0x12, 0x1e, 0x2f, 0x76, 0x31, 0x2f, 0x73, 0x63, 0x6f, + 0x70, 0x65, 0x73, 0x2f, 0x2a, 0x2f, 0x61, 0x75, 0x74, 0x68, 0x2d, 0x6d, 0x65, 0x74, 0x68, 0x6f, + 0x64, 0x73, 0x2f, 0x7b, 0x69, 0x64, 0x7d, 0x62, 0x04, 0x69, 0x74, 0x65, 0x6d, 0x92, 0x41, 0x1a, + 0x12, 0x18, 0x47, 0x65, 0x74, 0x73, 0x20, 0x61, 0x20, 0x73, 0x69, 0x6e, 0x67, 0x6c, 0x65, 0x20, + 0x41, 0x75, 0x74, 0x68, 0x4d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x12, 0xb7, 0x01, 0x0a, 0x0f, 0x4c, + 0x69, 0x73, 0x74, 0x41, 0x75, 0x74, 0x68, 0x4d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x73, 0x12, 0x32, + 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x65, 0x72, 0x2e, 0x61, 0x70, 0x69, 0x2e, + 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x4c, 0x69, 0x73, 0x74, + 0x41, 0x75, 0x74, 0x68, 0x4d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, + 0x73, 0x74, 0x1a, 0x33, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x65, 0x72, 0x2e, + 0x61, 0x70, 0x69, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x2e, 0x76, 0x31, 0x2e, + 0x4c, 0x69, 0x73, 0x74, 0x41, 0x75, 0x74, 0x68, 0x4d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x73, 0x52, + 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x3b, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x1b, 0x12, + 0x19, 0x2f, 0x76, 0x31, 0x2f, 0x73, 0x63, 0x6f, 0x70, 0x65, 0x73, 0x2f, 0x2a, 0x2f, 0x61, 0x75, + 0x74, 0x68, 0x2d, 0x6d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x73, 0x92, 0x41, 0x17, 0x12, 0x15, 0x4c, + 0x69, 0x73, 0x74, 0x73, 0x20, 0x61, 0x6c, 0x6c, 0x20, 0x41, 0x75, 0x74, 0x68, 0x4d, 0x65, 0x74, + 0x68, 0x6f, 0x64, 0x73, 0x12, 0xcc, 0x01, 0x0a, 0x10, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x41, + 0x75, 0x74, 0x68, 0x4d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x12, 0x33, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x65, 0x72, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, - 0x63, 0x65, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x41, 0x75, 0x74, 0x68, 0x4d, 0x65, - 0x74, 0x68, 0x6f, 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x31, 0x2e, 0x63, 0x6f, - 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x65, 0x72, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x73, 0x65, 0x72, - 0x76, 0x69, 0x63, 0x65, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x41, 0x75, 0x74, 0x68, - 0x4d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x49, - 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x26, 0x12, 0x1e, 0x2f, 0x76, 0x31, 0x2f, 0x73, 0x63, 0x6f, 0x70, - 0x65, 0x73, 0x2f, 0x2a, 0x2f, 0x61, 0x75, 0x74, 0x68, 0x2d, 0x6d, 0x65, 0x74, 0x68, 0x6f, 0x64, - 0x73, 0x2f, 0x7b, 0x69, 0x64, 0x7d, 0x62, 0x04, 0x69, 0x74, 0x65, 0x6d, 0x92, 0x41, 0x1a, 0x12, - 0x18, 0x47, 0x65, 0x74, 0x73, 0x20, 0x61, 0x20, 0x73, 0x69, 0x6e, 0x67, 0x6c, 0x65, 0x20, 0x41, - 0x75, 0x74, 0x68, 0x4d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x12, 0xb7, 0x01, 0x0a, 0x0f, 0x4c, 0x69, - 0x73, 0x74, 0x41, 0x75, 0x74, 0x68, 0x4d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x73, 0x12, 0x32, 0x2e, - 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x65, 0x72, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x73, - 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x41, - 0x75, 0x74, 0x68, 0x4d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, - 0x74, 0x1a, 0x33, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x65, 0x72, 0x2e, 0x61, - 0x70, 0x69, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x4c, - 0x69, 0x73, 0x74, 0x41, 0x75, 0x74, 0x68, 0x4d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x73, 0x52, 0x65, - 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x3b, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x1b, 0x12, 0x19, - 0x2f, 0x76, 0x31, 0x2f, 0x73, 0x63, 0x6f, 0x70, 0x65, 0x73, 0x2f, 0x2a, 0x2f, 0x61, 0x75, 0x74, - 0x68, 0x2d, 0x6d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x73, 0x92, 0x41, 0x17, 0x12, 0x15, 0x4c, 0x69, - 0x73, 0x74, 0x73, 0x20, 0x61, 0x6c, 0x6c, 0x20, 0x41, 0x75, 0x74, 0x68, 0x4d, 0x65, 0x74, 0x68, - 0x6f, 0x64, 0x73, 0x12, 0xcc, 0x01, 0x0a, 0x10, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x41, 0x75, + 0x63, 0x65, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x41, 0x75, 0x74, + 0x68, 0x4d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x34, + 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x65, 0x72, 0x2e, 0x61, 0x70, 0x69, 0x2e, + 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x72, 0x65, 0x61, + 0x74, 0x65, 0x41, 0x75, 0x74, 0x68, 0x4d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x52, 0x65, 0x73, 0x70, + 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x4d, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x27, 0x22, 0x19, 0x2f, 0x76, + 0x31, 0x2f, 0x73, 0x63, 0x6f, 0x70, 0x65, 0x73, 0x2f, 0x2a, 0x2f, 0x61, 0x75, 0x74, 0x68, 0x2d, + 0x6d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x73, 0x3a, 0x04, 0x69, 0x74, 0x65, 0x6d, 0x62, 0x04, 0x69, + 0x74, 0x65, 0x6d, 0x92, 0x41, 0x1d, 0x12, 0x1b, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x73, 0x20, + 0x61, 0x20, 0x73, 0x69, 0x6e, 0x67, 0x6c, 0x65, 0x20, 0x41, 0x75, 0x74, 0x68, 0x4d, 0x65, 0x74, + 0x68, 0x6f, 0x64, 0x12, 0xcb, 0x01, 0x0a, 0x10, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x41, 0x75, 0x74, 0x68, 0x4d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x12, 0x33, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x65, 0x72, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, - 0x65, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x41, 0x75, 0x74, 0x68, + 0x65, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x41, 0x75, 0x74, 0x68, 0x4d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x34, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x65, 0x72, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x73, - 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, + 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x41, 0x75, 0x74, 0x68, 0x4d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x52, 0x65, 0x73, 0x70, 0x6f, - 0x6e, 0x73, 0x65, 0x22, 0x4d, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x27, 0x22, 0x19, 0x2f, 0x76, 0x31, + 0x6e, 0x73, 0x65, 0x22, 0x4c, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x2c, 0x32, 0x1e, 0x2f, 0x76, 0x31, 0x2f, 0x73, 0x63, 0x6f, 0x70, 0x65, 0x73, 0x2f, 0x2a, 0x2f, 0x61, 0x75, 0x74, 0x68, 0x2d, 0x6d, - 0x65, 0x74, 0x68, 0x6f, 0x64, 0x73, 0x3a, 0x04, 0x69, 0x74, 0x65, 0x6d, 0x62, 0x04, 0x69, 0x74, - 0x65, 0x6d, 0x92, 0x41, 0x1d, 0x12, 0x1b, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x73, 0x20, 0x61, - 0x20, 0x73, 0x69, 0x6e, 0x67, 0x6c, 0x65, 0x20, 0x41, 0x75, 0x74, 0x68, 0x4d, 0x65, 0x74, 0x68, - 0x6f, 0x64, 0x12, 0xcb, 0x01, 0x0a, 0x10, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x41, 0x75, 0x74, - 0x68, 0x4d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x12, 0x33, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, - 0x6c, 0x6c, 0x65, 0x72, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, - 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x41, 0x75, 0x74, 0x68, 0x4d, - 0x65, 0x74, 0x68, 0x6f, 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x34, 0x2e, 0x63, - 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x65, 0x72, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x73, 0x65, - 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, - 0x41, 0x75, 0x74, 0x68, 0x4d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, - 0x73, 0x65, 0x22, 0x4c, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x2c, 0x32, 0x1e, 0x2f, 0x76, 0x31, 0x2f, - 0x73, 0x63, 0x6f, 0x70, 0x65, 0x73, 0x2f, 0x2a, 0x2f, 0x61, 0x75, 0x74, 0x68, 0x2d, 0x6d, 0x65, - 0x74, 0x68, 0x6f, 0x64, 0x73, 0x2f, 0x7b, 0x69, 0x64, 0x7d, 0x3a, 0x04, 0x69, 0x74, 0x65, 0x6d, - 0x62, 0x04, 0x69, 0x74, 0x65, 0x6d, 0x92, 0x41, 0x17, 0x12, 0x15, 0x55, 0x70, 0x64, 0x61, 0x74, - 0x65, 0x73, 0x20, 0x61, 0x6e, 0x20, 0x41, 0x75, 0x74, 0x68, 0x4d, 0x65, 0x74, 0x68, 0x6f, 0x64, - 0x12, 0xbf, 0x01, 0x0a, 0x10, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x41, 0x75, 0x74, 0x68, 0x4d, - 0x65, 0x74, 0x68, 0x6f, 0x64, 0x12, 0x33, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x6c, - 0x65, 0x72, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x2e, - 0x76, 0x31, 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x41, 0x75, 0x74, 0x68, 0x4d, 0x65, 0x74, - 0x68, 0x6f, 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x34, 0x2e, 0x63, 0x6f, 0x6e, - 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x65, 0x72, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x73, 0x65, 0x72, 0x76, - 0x69, 0x63, 0x65, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x41, 0x75, - 0x74, 0x68, 0x4d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, - 0x22, 0x40, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x20, 0x2a, 0x1e, 0x2f, 0x76, 0x31, 0x2f, 0x73, 0x63, - 0x6f, 0x70, 0x65, 0x73, 0x2f, 0x2a, 0x2f, 0x61, 0x75, 0x74, 0x68, 0x2d, 0x6d, 0x65, 0x74, 0x68, - 0x6f, 0x64, 0x73, 0x2f, 0x7b, 0x69, 0x64, 0x7d, 0x92, 0x41, 0x17, 0x12, 0x15, 0x44, 0x65, 0x6c, - 0x65, 0x74, 0x65, 0x73, 0x20, 0x61, 0x6e, 0x20, 0x41, 0x75, 0x74, 0x68, 0x4d, 0x65, 0x74, 0x68, - 0x6f, 0x64, 0x42, 0x4f, 0x5a, 0x4d, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, - 0x2f, 0x68, 0x61, 0x73, 0x68, 0x69, 0x63, 0x6f, 0x72, 0x70, 0x2f, 0x77, 0x61, 0x74, 0x63, 0x68, - 0x74, 0x6f, 0x77, 0x65, 0x72, 0x2f, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x2f, 0x67, - 0x65, 0x6e, 0x2f, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x65, 0x72, 0x2f, 0x61, 0x70, - 0x69, 0x2f, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x3b, 0x73, 0x65, 0x72, 0x76, 0x69, - 0x63, 0x65, 0x73, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x65, 0x74, 0x68, 0x6f, 0x64, 0x73, 0x2f, 0x7b, 0x69, 0x64, 0x7d, 0x3a, 0x04, 0x69, 0x74, 0x65, + 0x6d, 0x62, 0x04, 0x69, 0x74, 0x65, 0x6d, 0x92, 0x41, 0x17, 0x12, 0x15, 0x55, 0x70, 0x64, 0x61, + 0x74, 0x65, 0x73, 0x20, 0x61, 0x6e, 0x20, 0x41, 0x75, 0x74, 0x68, 0x4d, 0x65, 0x74, 0x68, 0x6f, + 0x64, 0x12, 0xbf, 0x01, 0x0a, 0x10, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x41, 0x75, 0x74, 0x68, + 0x4d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x12, 0x33, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, + 0x6c, 0x65, 0x72, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, + 0x2e, 0x76, 0x31, 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x41, 0x75, 0x74, 0x68, 0x4d, 0x65, + 0x74, 0x68, 0x6f, 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x34, 0x2e, 0x63, 0x6f, + 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x65, 0x72, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x73, 0x65, 0x72, + 0x76, 0x69, 0x63, 0x65, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x41, + 0x75, 0x74, 0x68, 0x4d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, + 0x65, 0x22, 0x40, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x20, 0x2a, 0x1e, 0x2f, 0x76, 0x31, 0x2f, 0x73, + 0x63, 0x6f, 0x70, 0x65, 0x73, 0x2f, 0x2a, 0x2f, 0x61, 0x75, 0x74, 0x68, 0x2d, 0x6d, 0x65, 0x74, + 0x68, 0x6f, 0x64, 0x73, 0x2f, 0x7b, 0x69, 0x64, 0x7d, 0x92, 0x41, 0x17, 0x12, 0x15, 0x44, 0x65, + 0x6c, 0x65, 0x74, 0x65, 0x73, 0x20, 0x61, 0x6e, 0x20, 0x41, 0x75, 0x74, 0x68, 0x4d, 0x65, 0x74, + 0x68, 0x6f, 0x64, 0x42, 0x4f, 0x5a, 0x4d, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, + 0x6d, 0x2f, 0x68, 0x61, 0x73, 0x68, 0x69, 0x63, 0x6f, 0x72, 0x70, 0x2f, 0x77, 0x61, 0x74, 0x63, + 0x68, 0x74, 0x6f, 0x77, 0x65, 0x72, 0x2f, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x2f, + 0x67, 0x65, 0x6e, 0x2f, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x65, 0x72, 0x2f, 0x61, + 0x70, 0x69, 0x2f, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x3b, 0x73, 0x65, 0x72, 0x76, + 0x69, 0x63, 0x65, 0x73, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -702,17 +705,17 @@ var file_controller_api_services_v1_auth_method_service_proto_goTypes = []interf (*UpdateAuthMethodResponse)(nil), // 7: controller.api.services.v1.UpdateAuthMethodResponse (*DeleteAuthMethodRequest)(nil), // 8: controller.api.services.v1.DeleteAuthMethodRequest (*DeleteAuthMethodResponse)(nil), // 9: controller.api.services.v1.DeleteAuthMethodResponse - (*auth.AuthMethod)(nil), // 10: controller.api.resources.auth.v1.AuthMethod + (*authmethods.AuthMethod)(nil), // 10: controller.api.resources.authmethods.v1.AuthMethod (*field_mask.FieldMask)(nil), // 11: google.protobuf.FieldMask } var file_controller_api_services_v1_auth_method_service_proto_depIdxs = []int32{ - 10, // 0: controller.api.services.v1.GetAuthMethodResponse.item:type_name -> controller.api.resources.auth.v1.AuthMethod - 10, // 1: controller.api.services.v1.ListAuthMethodsResponse.items:type_name -> controller.api.resources.auth.v1.AuthMethod - 10, // 2: controller.api.services.v1.CreateAuthMethodRequest.item:type_name -> controller.api.resources.auth.v1.AuthMethod - 10, // 3: controller.api.services.v1.CreateAuthMethodResponse.item:type_name -> controller.api.resources.auth.v1.AuthMethod - 10, // 4: controller.api.services.v1.UpdateAuthMethodRequest.item:type_name -> controller.api.resources.auth.v1.AuthMethod + 10, // 0: controller.api.services.v1.GetAuthMethodResponse.item:type_name -> controller.api.resources.authmethods.v1.AuthMethod + 10, // 1: controller.api.services.v1.ListAuthMethodsResponse.items:type_name -> controller.api.resources.authmethods.v1.AuthMethod + 10, // 2: controller.api.services.v1.CreateAuthMethodRequest.item:type_name -> controller.api.resources.authmethods.v1.AuthMethod + 10, // 3: controller.api.services.v1.CreateAuthMethodResponse.item:type_name -> controller.api.resources.authmethods.v1.AuthMethod + 10, // 4: controller.api.services.v1.UpdateAuthMethodRequest.item:type_name -> controller.api.resources.authmethods.v1.AuthMethod 11, // 5: controller.api.services.v1.UpdateAuthMethodRequest.update_mask:type_name -> google.protobuf.FieldMask - 10, // 6: controller.api.services.v1.UpdateAuthMethodResponse.item:type_name -> controller.api.resources.auth.v1.AuthMethod + 10, // 6: controller.api.services.v1.UpdateAuthMethodResponse.item:type_name -> controller.api.resources.authmethods.v1.AuthMethod 0, // 7: controller.api.services.v1.AuthMethodService.GetAuthMethod:input_type -> controller.api.services.v1.GetAuthMethodRequest 2, // 8: controller.api.services.v1.AuthMethodService.ListAuthMethods:input_type -> controller.api.services.v1.ListAuthMethodsRequest 4, // 9: controller.api.services.v1.AuthMethodService.CreateAuthMethod:input_type -> controller.api.services.v1.CreateAuthMethodRequest diff --git a/internal/gen/controller/api/services/authaccount_service.pb.go b/internal/gen/controller/api/services/authaccount_service.pb.go index f933e65a4..17a90087a 100644 --- a/internal/gen/controller/api/services/authaccount_service.pb.go +++ b/internal/gen/controller/api/services/authaccount_service.pb.go @@ -11,7 +11,7 @@ import ( proto "github.com/golang/protobuf/proto" _ "github.com/golang/protobuf/ptypes/wrappers" _ "github.com/grpc-ecosystem/grpc-gateway/v2/protoc-gen-openapiv2/options" - auth "github.com/hashicorp/watchtower/internal/gen/controller/api/resources/auth" + authmethods "github.com/hashicorp/watchtower/internal/gen/controller/api/resources/authmethods" _ "google.golang.org/genproto/googleapis/api/annotations" field_mask "google.golang.org/genproto/protobuf/field_mask" grpc "google.golang.org/grpc" @@ -102,7 +102,7 @@ type GetAccountResponse struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - Item *auth.Account `protobuf:"bytes,1,opt,name=item,proto3" json:"item,omitempty"` + Item *authmethods.Account `protobuf:"bytes,1,opt,name=item,proto3" json:"item,omitempty"` } func (x *GetAccountResponse) Reset() { @@ -137,7 +137,7 @@ func (*GetAccountResponse) Descriptor() ([]byte, []int) { return file_controller_api_services_v1_authaccount_service_proto_rawDescGZIP(), []int{1} } -func (x *GetAccountResponse) GetItem() *auth.Account { +func (x *GetAccountResponse) GetItem() *authmethods.Account { if x != nil { return x.Item } @@ -204,7 +204,7 @@ type ListAccountsResponse struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - Items []*auth.Account `protobuf:"bytes,1,rep,name=items,proto3" json:"items,omitempty"` + Items []*authmethods.Account `protobuf:"bytes,1,rep,name=items,proto3" json:"items,omitempty"` } func (x *ListAccountsResponse) Reset() { @@ -239,7 +239,7 @@ func (*ListAccountsResponse) Descriptor() ([]byte, []int) { return file_controller_api_services_v1_authaccount_service_proto_rawDescGZIP(), []int{3} } -func (x *ListAccountsResponse) GetItems() []*auth.Account { +func (x *ListAccountsResponse) GetItems() []*authmethods.Account { if x != nil { return x.Items } @@ -251,8 +251,8 @@ type CreateAccountRequest struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - AuthMethodId string `protobuf:"bytes,1,opt,name=auth_method_id,json=authMethodId,proto3" json:"auth_method_id,omitempty"` - Item *auth.Account `protobuf:"bytes,2,opt,name=item,proto3" json:"item,omitempty"` + AuthMethodId string `protobuf:"bytes,1,opt,name=auth_method_id,json=authMethodId,proto3" json:"auth_method_id,omitempty"` + Item *authmethods.Account `protobuf:"bytes,2,opt,name=item,proto3" json:"item,omitempty"` } func (x *CreateAccountRequest) Reset() { @@ -294,7 +294,7 @@ func (x *CreateAccountRequest) GetAuthMethodId() string { return "" } -func (x *CreateAccountRequest) GetItem() *auth.Account { +func (x *CreateAccountRequest) GetItem() *authmethods.Account { if x != nil { return x.Item } @@ -306,8 +306,8 @@ type CreateAccountResponse struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - Uri string `protobuf:"bytes,1,opt,name=uri,proto3" json:"uri,omitempty"` - Item *auth.Account `protobuf:"bytes,2,opt,name=item,proto3" json:"item,omitempty"` + Uri string `protobuf:"bytes,1,opt,name=uri,proto3" json:"uri,omitempty"` + Item *authmethods.Account `protobuf:"bytes,2,opt,name=item,proto3" json:"item,omitempty"` } func (x *CreateAccountResponse) Reset() { @@ -349,7 +349,7 @@ func (x *CreateAccountResponse) GetUri() string { return "" } -func (x *CreateAccountResponse) GetItem() *auth.Account { +func (x *CreateAccountResponse) GetItem() *authmethods.Account { if x != nil { return x.Item } @@ -363,7 +363,7 @@ type UpdateAccountRequest struct { AuthMethodId string `protobuf:"bytes,1,opt,name=auth_method_id,json=authMethodId,proto3" json:"auth_method_id,omitempty"` Id string `protobuf:"bytes,2,opt,name=id,proto3" json:"id,omitempty"` - Item *auth.Account `protobuf:"bytes,3,opt,name=item,proto3" json:"item,omitempty"` + Item *authmethods.Account `protobuf:"bytes,3,opt,name=item,proto3" json:"item,omitempty"` UpdateMask *field_mask.FieldMask `protobuf:"bytes,4,opt,name=update_mask,json=updateMask,proto3" json:"update_mask,omitempty"` } @@ -413,7 +413,7 @@ func (x *UpdateAccountRequest) GetId() string { return "" } -func (x *UpdateAccountRequest) GetItem() *auth.Account { +func (x *UpdateAccountRequest) GetItem() *authmethods.Account { if x != nil { return x.Item } @@ -432,7 +432,7 @@ type UpdateAccountResponse struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - Item *auth.Account `protobuf:"bytes,1,opt,name=item,proto3" json:"item,omitempty"` + Item *authmethods.Account `protobuf:"bytes,1,opt,name=item,proto3" json:"item,omitempty"` } func (x *UpdateAccountResponse) Reset() { @@ -467,7 +467,7 @@ func (*UpdateAccountResponse) Descriptor() ([]byte, []int) { return file_controller_api_services_v1_authaccount_service_proto_rawDescGZIP(), []int{7} } -func (x *UpdateAccountResponse) GetItem() *auth.Account { +func (x *UpdateAccountResponse) GetItem() *authmethods.Account { if x != nil { return x.Item } @@ -593,149 +593,152 @@ var file_controller_api_services_v1_authaccount_service_proto_rawDesc = []byte{ 0x66, 0x2f, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x5f, 0x6d, 0x61, 0x73, 0x6b, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x77, 0x72, 0x61, 0x70, 0x70, 0x65, 0x72, 0x73, 0x2e, 0x70, 0x72, 0x6f, - 0x74, 0x6f, 0x1a, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x65, 0x72, 0x2f, 0x61, + 0x74, 0x6f, 0x1a, 0x35, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x65, 0x72, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, 0x2f, 0x61, 0x75, 0x74, - 0x68, 0x2f, 0x76, 0x31, 0x2f, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x2e, 0x70, 0x72, 0x6f, - 0x74, 0x6f, 0x22, 0x5d, 0x0a, 0x11, 0x47, 0x65, 0x74, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, - 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x24, 0x0a, 0x0e, 0x61, 0x75, 0x74, 0x68, 0x5f, - 0x6d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x0c, 0x61, 0x75, 0x74, 0x68, 0x4d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x49, 0x64, 0x12, 0x0e, 0x0a, - 0x02, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x12, 0x0a, - 0x04, 0x76, 0x69, 0x65, 0x77, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x76, 0x69, 0x65, - 0x77, 0x22, 0x53, 0x0a, 0x12, 0x47, 0x65, 0x74, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x52, - 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x3d, 0x0a, 0x04, 0x69, 0x74, 0x65, 0x6d, 0x18, - 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x29, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x6c, - 0x65, 0x72, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, - 0x2e, 0x61, 0x75, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x2e, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, - 0x52, 0x04, 0x69, 0x74, 0x65, 0x6d, 0x22, 0x4f, 0x0a, 0x13, 0x4c, 0x69, 0x73, 0x74, 0x41, 0x63, - 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x24, 0x0a, - 0x0e, 0x61, 0x75, 0x74, 0x68, 0x5f, 0x6d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x5f, 0x69, 0x64, 0x18, - 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x61, 0x75, 0x74, 0x68, 0x4d, 0x65, 0x74, 0x68, 0x6f, - 0x64, 0x49, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x76, 0x69, 0x65, 0x77, 0x18, 0x02, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x04, 0x76, 0x69, 0x65, 0x77, 0x22, 0x57, 0x0a, 0x14, 0x4c, 0x69, 0x73, 0x74, 0x41, - 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, - 0x3f, 0x0a, 0x05, 0x69, 0x74, 0x65, 0x6d, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x29, - 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x65, 0x72, 0x2e, 0x61, 0x70, 0x69, 0x2e, - 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, 0x2e, 0x61, 0x75, 0x74, 0x68, 0x2e, 0x76, - 0x31, 0x2e, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x52, 0x05, 0x69, 0x74, 0x65, 0x6d, 0x73, - 0x22, 0x7b, 0x0a, 0x14, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, - 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x24, 0x0a, 0x0e, 0x61, 0x75, 0x74, 0x68, - 0x5f, 0x6d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, - 0x52, 0x0c, 0x61, 0x75, 0x74, 0x68, 0x4d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x49, 0x64, 0x12, 0x3d, - 0x0a, 0x04, 0x69, 0x74, 0x65, 0x6d, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x29, 0x2e, 0x63, + 0x68, 0x6d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x73, 0x2f, 0x76, 0x31, 0x2f, 0x61, 0x63, 0x63, 0x6f, + 0x75, 0x6e, 0x74, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x5d, 0x0a, 0x11, 0x47, 0x65, 0x74, + 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x24, + 0x0a, 0x0e, 0x61, 0x75, 0x74, 0x68, 0x5f, 0x6d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x5f, 0x69, 0x64, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x61, 0x75, 0x74, 0x68, 0x4d, 0x65, 0x74, 0x68, + 0x6f, 0x64, 0x49, 0x64, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x02, 0x69, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x76, 0x69, 0x65, 0x77, 0x18, 0x03, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x04, 0x76, 0x69, 0x65, 0x77, 0x22, 0x5a, 0x0a, 0x12, 0x47, 0x65, 0x74, 0x41, + 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x44, + 0x0a, 0x04, 0x69, 0x74, 0x65, 0x6d, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x30, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x65, 0x72, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x72, 0x65, - 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, 0x2e, 0x61, 0x75, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x2e, - 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x52, 0x04, 0x69, 0x74, 0x65, 0x6d, 0x22, 0x68, 0x0a, - 0x15, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x52, 0x65, - 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x10, 0x0a, 0x03, 0x75, 0x72, 0x69, 0x18, 0x01, 0x20, - 0x01, 0x28, 0x09, 0x52, 0x03, 0x75, 0x72, 0x69, 0x12, 0x3d, 0x0a, 0x04, 0x69, 0x74, 0x65, 0x6d, - 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x29, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, - 0x6c, 0x65, 0x72, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, - 0x73, 0x2e, 0x61, 0x75, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x2e, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, - 0x74, 0x52, 0x04, 0x69, 0x74, 0x65, 0x6d, 0x22, 0xc8, 0x01, 0x0a, 0x14, 0x55, 0x70, 0x64, 0x61, - 0x74, 0x65, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, - 0x12, 0x24, 0x0a, 0x0e, 0x61, 0x75, 0x74, 0x68, 0x5f, 0x6d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x5f, - 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x61, 0x75, 0x74, 0x68, 0x4d, 0x65, - 0x74, 0x68, 0x6f, 0x64, 0x49, 0x64, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, - 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x3d, 0x0a, 0x04, 0x69, 0x74, 0x65, 0x6d, 0x18, 0x03, - 0x20, 0x01, 0x28, 0x0b, 0x32, 0x29, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x65, + 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, 0x2e, 0x61, 0x75, 0x74, 0x68, 0x6d, 0x65, 0x74, 0x68, + 0x6f, 0x64, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x52, 0x04, + 0x69, 0x74, 0x65, 0x6d, 0x22, 0x4f, 0x0a, 0x13, 0x4c, 0x69, 0x73, 0x74, 0x41, 0x63, 0x63, 0x6f, + 0x75, 0x6e, 0x74, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x24, 0x0a, 0x0e, 0x61, + 0x75, 0x74, 0x68, 0x5f, 0x6d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x0c, 0x61, 0x75, 0x74, 0x68, 0x4d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x49, + 0x64, 0x12, 0x12, 0x0a, 0x04, 0x76, 0x69, 0x65, 0x77, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x04, 0x76, 0x69, 0x65, 0x77, 0x22, 0x5e, 0x0a, 0x14, 0x4c, 0x69, 0x73, 0x74, 0x41, 0x63, 0x63, + 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x46, 0x0a, + 0x05, 0x69, 0x74, 0x65, 0x6d, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x30, 0x2e, 0x63, + 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x65, 0x72, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x72, 0x65, + 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, 0x2e, 0x61, 0x75, 0x74, 0x68, 0x6d, 0x65, 0x74, 0x68, + 0x6f, 0x64, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x52, 0x05, + 0x69, 0x74, 0x65, 0x6d, 0x73, 0x22, 0x82, 0x01, 0x0a, 0x14, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, + 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x24, + 0x0a, 0x0e, 0x61, 0x75, 0x74, 0x68, 0x5f, 0x6d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x5f, 0x69, 0x64, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x61, 0x75, 0x74, 0x68, 0x4d, 0x65, 0x74, 0x68, + 0x6f, 0x64, 0x49, 0x64, 0x12, 0x44, 0x0a, 0x04, 0x69, 0x74, 0x65, 0x6d, 0x18, 0x02, 0x20, 0x01, + 0x28, 0x0b, 0x32, 0x30, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x65, 0x72, 0x2e, + 0x61, 0x70, 0x69, 0x2e, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, 0x2e, 0x61, 0x75, + 0x74, 0x68, 0x6d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x41, 0x63, 0x63, + 0x6f, 0x75, 0x6e, 0x74, 0x52, 0x04, 0x69, 0x74, 0x65, 0x6d, 0x22, 0x6f, 0x0a, 0x15, 0x43, 0x72, + 0x65, 0x61, 0x74, 0x65, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, + 0x6e, 0x73, 0x65, 0x12, 0x10, 0x0a, 0x03, 0x75, 0x72, 0x69, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x03, 0x75, 0x72, 0x69, 0x12, 0x44, 0x0a, 0x04, 0x69, 0x74, 0x65, 0x6d, 0x18, 0x02, 0x20, + 0x01, 0x28, 0x0b, 0x32, 0x30, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x65, 0x72, + 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, 0x2e, 0x61, + 0x75, 0x74, 0x68, 0x6d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x41, 0x63, + 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x52, 0x04, 0x69, 0x74, 0x65, 0x6d, 0x22, 0xcf, 0x01, 0x0a, 0x14, + 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x52, 0x65, 0x71, + 0x75, 0x65, 0x73, 0x74, 0x12, 0x24, 0x0a, 0x0e, 0x61, 0x75, 0x74, 0x68, 0x5f, 0x6d, 0x65, 0x74, + 0x68, 0x6f, 0x64, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x61, 0x75, + 0x74, 0x68, 0x4d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x49, 0x64, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, + 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x44, 0x0a, 0x04, 0x69, 0x74, + 0x65, 0x6d, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x30, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x72, + 0x6f, 0x6c, 0x6c, 0x65, 0x72, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, + 0x63, 0x65, 0x73, 0x2e, 0x61, 0x75, 0x74, 0x68, 0x6d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x73, 0x2e, + 0x76, 0x31, 0x2e, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x52, 0x04, 0x69, 0x74, 0x65, 0x6d, + 0x12, 0x3b, 0x0a, 0x0b, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x5f, 0x6d, 0x61, 0x73, 0x6b, 0x18, + 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x4d, 0x61, 0x73, + 0x6b, 0x52, 0x0a, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x4d, 0x61, 0x73, 0x6b, 0x22, 0x5d, 0x0a, + 0x15, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x52, 0x65, + 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x44, 0x0a, 0x04, 0x69, 0x74, 0x65, 0x6d, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x30, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x65, 0x72, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, 0x2e, - 0x61, 0x75, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x2e, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x52, - 0x04, 0x69, 0x74, 0x65, 0x6d, 0x12, 0x3b, 0x0a, 0x0b, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x5f, - 0x6d, 0x61, 0x73, 0x6b, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, - 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x46, 0x69, 0x65, - 0x6c, 0x64, 0x4d, 0x61, 0x73, 0x6b, 0x52, 0x0a, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x4d, 0x61, - 0x73, 0x6b, 0x22, 0x56, 0x0a, 0x15, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x41, 0x63, 0x63, 0x6f, - 0x75, 0x6e, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x3d, 0x0a, 0x04, 0x69, - 0x74, 0x65, 0x6d, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x29, 0x2e, 0x63, 0x6f, 0x6e, 0x74, - 0x72, 0x6f, 0x6c, 0x6c, 0x65, 0x72, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x72, 0x65, 0x73, 0x6f, 0x75, - 0x72, 0x63, 0x65, 0x73, 0x2e, 0x61, 0x75, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x2e, 0x41, 0x63, 0x63, - 0x6f, 0x75, 0x6e, 0x74, 0x52, 0x04, 0x69, 0x74, 0x65, 0x6d, 0x22, 0x4c, 0x0a, 0x14, 0x44, 0x65, - 0x6c, 0x65, 0x74, 0x65, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, - 0x73, 0x74, 0x12, 0x24, 0x0a, 0x0e, 0x61, 0x75, 0x74, 0x68, 0x5f, 0x6d, 0x65, 0x74, 0x68, 0x6f, - 0x64, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x61, 0x75, 0x74, 0x68, - 0x4d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x49, 0x64, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x02, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x22, 0x31, 0x0a, 0x15, 0x44, 0x65, 0x6c, 0x65, - 0x74, 0x65, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, - 0x65, 0x12, 0x18, 0x0a, 0x07, 0x65, 0x78, 0x69, 0x73, 0x74, 0x65, 0x64, 0x18, 0x01, 0x20, 0x01, - 0x28, 0x08, 0x52, 0x07, 0x65, 0x78, 0x69, 0x73, 0x74, 0x65, 0x64, 0x32, 0xec, 0x08, 0x0a, 0x0e, - 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0xcd, - 0x01, 0x0a, 0x0a, 0x47, 0x65, 0x74, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x2d, 0x2e, - 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x65, 0x72, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x73, - 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x41, 0x63, - 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2e, 0x2e, 0x63, - 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x65, 0x72, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x73, 0x65, - 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x41, 0x63, 0x63, - 0x6f, 0x75, 0x6e, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x60, 0x82, 0xd3, - 0xe4, 0x93, 0x02, 0x40, 0x12, 0x38, 0x2f, 0x76, 0x31, 0x2f, 0x73, 0x63, 0x6f, 0x70, 0x65, 0x73, - 0x2f, 0x2a, 0x2f, 0x61, 0x75, 0x74, 0x68, 0x2d, 0x6d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x73, 0x2f, - 0x7b, 0x61, 0x75, 0x74, 0x68, 0x5f, 0x6d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x5f, 0x69, 0x64, 0x7d, - 0x2f, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x2f, 0x7b, 0x69, 0x64, 0x7d, 0x62, 0x04, - 0x69, 0x74, 0x65, 0x6d, 0x92, 0x41, 0x17, 0x12, 0x15, 0x47, 0x65, 0x74, 0x73, 0x20, 0x61, 0x20, - 0x73, 0x69, 0x6e, 0x67, 0x6c, 0x65, 0x20, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0xe0, - 0x01, 0x0a, 0x0c, 0x4c, 0x69, 0x73, 0x74, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x12, - 0x2f, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x65, 0x72, 0x2e, 0x61, 0x70, 0x69, - 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x4c, 0x69, 0x73, - 0x74, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, - 0x1a, 0x30, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x65, 0x72, 0x2e, 0x61, 0x70, - 0x69, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x4c, 0x69, - 0x73, 0x74, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, - 0x73, 0x65, 0x22, 0x6d, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x35, 0x12, 0x33, 0x2f, 0x76, 0x31, 0x2f, - 0x73, 0x63, 0x6f, 0x70, 0x65, 0x73, 0x2f, 0x2a, 0x2f, 0x61, 0x75, 0x74, 0x68, 0x2d, 0x6d, 0x65, - 0x74, 0x68, 0x6f, 0x64, 0x73, 0x2f, 0x7b, 0x61, 0x75, 0x74, 0x68, 0x5f, 0x6d, 0x65, 0x74, 0x68, - 0x6f, 0x64, 0x5f, 0x69, 0x64, 0x7d, 0x2f, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x92, - 0x41, 0x2f, 0x12, 0x2d, 0x4c, 0x69, 0x73, 0x74, 0x73, 0x20, 0x61, 0x6c, 0x6c, 0x20, 0x61, 0x63, - 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x20, 0x69, 0x6e, 0x20, 0x61, 0x20, 0x73, 0x70, 0x65, 0x63, - 0x69, 0x66, 0x69, 0x63, 0x20, 0x61, 0x75, 0x74, 0x68, 0x20, 0x6d, 0x65, 0x74, 0x68, 0x6f, 0x64, - 0x2e, 0x12, 0xf8, 0x01, 0x0a, 0x0d, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x41, 0x63, 0x63, 0x6f, - 0x75, 0x6e, 0x74, 0x12, 0x30, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x65, 0x72, - 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x2e, 0x76, 0x31, - 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x52, 0x65, - 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x31, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x6c, + 0x61, 0x75, 0x74, 0x68, 0x6d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x41, + 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x52, 0x04, 0x69, 0x74, 0x65, 0x6d, 0x22, 0x4c, 0x0a, 0x14, + 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x52, 0x65, 0x71, + 0x75, 0x65, 0x73, 0x74, 0x12, 0x24, 0x0a, 0x0e, 0x61, 0x75, 0x74, 0x68, 0x5f, 0x6d, 0x65, 0x74, + 0x68, 0x6f, 0x64, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x61, 0x75, + 0x74, 0x68, 0x4d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x49, 0x64, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, + 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x22, 0x31, 0x0a, 0x15, 0x44, 0x65, + 0x6c, 0x65, 0x74, 0x65, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, + 0x6e, 0x73, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x65, 0x78, 0x69, 0x73, 0x74, 0x65, 0x64, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x08, 0x52, 0x07, 0x65, 0x78, 0x69, 0x73, 0x74, 0x65, 0x64, 0x32, 0xec, 0x08, + 0x0a, 0x0e, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, + 0x12, 0xcd, 0x01, 0x0a, 0x0a, 0x47, 0x65, 0x74, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x12, + 0x2d, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x65, 0x72, 0x2e, 0x61, 0x70, 0x69, + 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x65, 0x74, + 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2e, + 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x65, 0x72, 0x2e, 0x61, 0x70, 0x69, 0x2e, + 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x41, + 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x60, + 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x40, 0x12, 0x38, 0x2f, 0x76, 0x31, 0x2f, 0x73, 0x63, 0x6f, 0x70, + 0x65, 0x73, 0x2f, 0x2a, 0x2f, 0x61, 0x75, 0x74, 0x68, 0x2d, 0x6d, 0x65, 0x74, 0x68, 0x6f, 0x64, + 0x73, 0x2f, 0x7b, 0x61, 0x75, 0x74, 0x68, 0x5f, 0x6d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x5f, 0x69, + 0x64, 0x7d, 0x2f, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x2f, 0x7b, 0x69, 0x64, 0x7d, + 0x62, 0x04, 0x69, 0x74, 0x65, 0x6d, 0x92, 0x41, 0x17, 0x12, 0x15, 0x47, 0x65, 0x74, 0x73, 0x20, + 0x61, 0x20, 0x73, 0x69, 0x6e, 0x67, 0x6c, 0x65, 0x20, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, + 0x12, 0xe0, 0x01, 0x0a, 0x0c, 0x4c, 0x69, 0x73, 0x74, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, + 0x73, 0x12, 0x2f, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x65, 0x72, 0x2e, 0x61, + 0x70, 0x69, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x4c, + 0x69, 0x73, 0x74, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, + 0x73, 0x74, 0x1a, 0x30, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x65, 0x72, 0x2e, + 0x61, 0x70, 0x69, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x2e, 0x76, 0x31, 0x2e, + 0x4c, 0x69, 0x73, 0x74, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x52, 0x65, 0x73, 0x70, + 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x6d, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x35, 0x12, 0x33, 0x2f, 0x76, + 0x31, 0x2f, 0x73, 0x63, 0x6f, 0x70, 0x65, 0x73, 0x2f, 0x2a, 0x2f, 0x61, 0x75, 0x74, 0x68, 0x2d, + 0x6d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x73, 0x2f, 0x7b, 0x61, 0x75, 0x74, 0x68, 0x5f, 0x6d, 0x65, + 0x74, 0x68, 0x6f, 0x64, 0x5f, 0x69, 0x64, 0x7d, 0x2f, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, + 0x73, 0x92, 0x41, 0x2f, 0x12, 0x2d, 0x4c, 0x69, 0x73, 0x74, 0x73, 0x20, 0x61, 0x6c, 0x6c, 0x20, + 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x20, 0x69, 0x6e, 0x20, 0x61, 0x20, 0x73, 0x70, + 0x65, 0x63, 0x69, 0x66, 0x69, 0x63, 0x20, 0x61, 0x75, 0x74, 0x68, 0x20, 0x6d, 0x65, 0x74, 0x68, + 0x6f, 0x64, 0x2e, 0x12, 0xf8, 0x01, 0x0a, 0x0d, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x41, 0x63, + 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x30, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x65, 0x72, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, - 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x81, 0x01, 0x82, 0xd3, 0xe4, 0x93, 0x02, - 0x41, 0x22, 0x33, 0x2f, 0x76, 0x31, 0x2f, 0x73, 0x63, 0x6f, 0x70, 0x65, 0x73, 0x2f, 0x2a, 0x2f, - 0x61, 0x75, 0x74, 0x68, 0x2d, 0x6d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x73, 0x2f, 0x7b, 0x61, 0x75, - 0x74, 0x68, 0x5f, 0x6d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x5f, 0x69, 0x64, 0x7d, 0x2f, 0x61, 0x63, - 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x3a, 0x04, 0x69, 0x74, 0x65, 0x6d, 0x62, 0x04, 0x69, 0x74, - 0x65, 0x6d, 0x92, 0x41, 0x37, 0x12, 0x35, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x73, 0x20, 0x61, - 0x20, 0x73, 0x69, 0x6e, 0x67, 0x6c, 0x65, 0x20, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x20, - 0x69, 0x6e, 0x20, 0x74, 0x68, 0x65, 0x20, 0x70, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x64, 0x20, - 0x61, 0x75, 0x74, 0x68, 0x20, 0x6d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x2e, 0x12, 0xda, 0x01, 0x0a, - 0x0d, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x30, - 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x65, 0x72, 0x2e, 0x61, 0x70, 0x69, 0x2e, - 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x55, 0x70, 0x64, 0x61, - 0x74, 0x65, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, - 0x1a, 0x31, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x65, 0x72, 0x2e, 0x61, 0x70, + 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x31, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, + 0x6c, 0x6c, 0x65, 0x72, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, + 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x41, 0x63, 0x63, 0x6f, 0x75, + 0x6e, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x81, 0x01, 0x82, 0xd3, 0xe4, + 0x93, 0x02, 0x41, 0x22, 0x33, 0x2f, 0x76, 0x31, 0x2f, 0x73, 0x63, 0x6f, 0x70, 0x65, 0x73, 0x2f, + 0x2a, 0x2f, 0x61, 0x75, 0x74, 0x68, 0x2d, 0x6d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x73, 0x2f, 0x7b, + 0x61, 0x75, 0x74, 0x68, 0x5f, 0x6d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x5f, 0x69, 0x64, 0x7d, 0x2f, + 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x3a, 0x04, 0x69, 0x74, 0x65, 0x6d, 0x62, 0x04, + 0x69, 0x74, 0x65, 0x6d, 0x92, 0x41, 0x37, 0x12, 0x35, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x73, + 0x20, 0x61, 0x20, 0x73, 0x69, 0x6e, 0x67, 0x6c, 0x65, 0x20, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, + 0x74, 0x20, 0x69, 0x6e, 0x20, 0x74, 0x68, 0x65, 0x20, 0x70, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, + 0x64, 0x20, 0x61, 0x75, 0x74, 0x68, 0x20, 0x6d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x2e, 0x12, 0xda, + 0x01, 0x0a, 0x0d, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, + 0x12, 0x30, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x65, 0x72, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x55, 0x70, - 0x64, 0x61, 0x74, 0x65, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, - 0x6e, 0x73, 0x65, 0x22, 0x64, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x46, 0x32, 0x38, 0x2f, 0x76, 0x31, - 0x2f, 0x73, 0x63, 0x6f, 0x70, 0x65, 0x73, 0x2f, 0x2a, 0x2f, 0x61, 0x75, 0x74, 0x68, 0x2d, 0x6d, - 0x65, 0x74, 0x68, 0x6f, 0x64, 0x73, 0x2f, 0x7b, 0x61, 0x75, 0x74, 0x68, 0x5f, 0x6d, 0x65, 0x74, - 0x68, 0x6f, 0x64, 0x5f, 0x69, 0x64, 0x7d, 0x2f, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x73, - 0x2f, 0x7b, 0x69, 0x64, 0x7d, 0x3a, 0x04, 0x69, 0x74, 0x65, 0x6d, 0x62, 0x04, 0x69, 0x74, 0x65, - 0x6d, 0x92, 0x41, 0x15, 0x12, 0x13, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x73, 0x20, 0x61, 0x6e, - 0x20, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x2e, 0x12, 0xce, 0x01, 0x0a, 0x0d, 0x44, 0x65, - 0x6c, 0x65, 0x74, 0x65, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x30, 0x2e, 0x63, 0x6f, - 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x65, 0x72, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x73, 0x65, 0x72, - 0x76, 0x69, 0x63, 0x65, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x41, - 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x31, 0x2e, + 0x64, 0x61, 0x74, 0x65, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, + 0x73, 0x74, 0x1a, 0x31, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x65, 0x72, 0x2e, + 0x61, 0x70, 0x69, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x2e, 0x76, 0x31, 0x2e, + 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x52, 0x65, 0x73, + 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x64, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x46, 0x32, 0x38, 0x2f, + 0x76, 0x31, 0x2f, 0x73, 0x63, 0x6f, 0x70, 0x65, 0x73, 0x2f, 0x2a, 0x2f, 0x61, 0x75, 0x74, 0x68, + 0x2d, 0x6d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x73, 0x2f, 0x7b, 0x61, 0x75, 0x74, 0x68, 0x5f, 0x6d, + 0x65, 0x74, 0x68, 0x6f, 0x64, 0x5f, 0x69, 0x64, 0x7d, 0x2f, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, + 0x74, 0x73, 0x2f, 0x7b, 0x69, 0x64, 0x7d, 0x3a, 0x04, 0x69, 0x74, 0x65, 0x6d, 0x62, 0x04, 0x69, + 0x74, 0x65, 0x6d, 0x92, 0x41, 0x15, 0x12, 0x13, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x73, 0x20, + 0x61, 0x6e, 0x20, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x2e, 0x12, 0xce, 0x01, 0x0a, 0x0d, + 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x30, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x65, 0x72, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74, - 0x65, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, - 0x22, 0x58, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x3a, 0x2a, 0x38, 0x2f, 0x76, 0x31, 0x2f, 0x73, 0x63, - 0x6f, 0x70, 0x65, 0x73, 0x2f, 0x2a, 0x2f, 0x61, 0x75, 0x74, 0x68, 0x2d, 0x6d, 0x65, 0x74, 0x68, - 0x6f, 0x64, 0x73, 0x2f, 0x7b, 0x61, 0x75, 0x74, 0x68, 0x5f, 0x6d, 0x65, 0x74, 0x68, 0x6f, 0x64, - 0x5f, 0x69, 0x64, 0x7d, 0x2f, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x2f, 0x7b, 0x69, - 0x64, 0x7d, 0x92, 0x41, 0x15, 0x12, 0x13, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x73, 0x20, 0x61, - 0x6e, 0x20, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x2e, 0x42, 0x4f, 0x5a, 0x4d, 0x67, 0x69, - 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x68, 0x61, 0x73, 0x68, 0x69, 0x63, 0x6f, - 0x72, 0x70, 0x2f, 0x77, 0x61, 0x74, 0x63, 0x68, 0x74, 0x6f, 0x77, 0x65, 0x72, 0x2f, 0x69, 0x6e, - 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x2f, 0x67, 0x65, 0x6e, 0x2f, 0x63, 0x6f, 0x6e, 0x74, 0x72, - 0x6f, 0x6c, 0x6c, 0x65, 0x72, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, - 0x65, 0x73, 0x3b, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x62, 0x06, 0x70, 0x72, 0x6f, - 0x74, 0x6f, 0x33, + 0x65, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, + 0x31, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x65, 0x72, 0x2e, 0x61, 0x70, 0x69, + 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x44, 0x65, 0x6c, + 0x65, 0x74, 0x65, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, + 0x73, 0x65, 0x22, 0x58, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x3a, 0x2a, 0x38, 0x2f, 0x76, 0x31, 0x2f, + 0x73, 0x63, 0x6f, 0x70, 0x65, 0x73, 0x2f, 0x2a, 0x2f, 0x61, 0x75, 0x74, 0x68, 0x2d, 0x6d, 0x65, + 0x74, 0x68, 0x6f, 0x64, 0x73, 0x2f, 0x7b, 0x61, 0x75, 0x74, 0x68, 0x5f, 0x6d, 0x65, 0x74, 0x68, + 0x6f, 0x64, 0x5f, 0x69, 0x64, 0x7d, 0x2f, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x2f, + 0x7b, 0x69, 0x64, 0x7d, 0x92, 0x41, 0x15, 0x12, 0x13, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x73, + 0x20, 0x61, 0x6e, 0x20, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x2e, 0x42, 0x4f, 0x5a, 0x4d, + 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x68, 0x61, 0x73, 0x68, 0x69, + 0x63, 0x6f, 0x72, 0x70, 0x2f, 0x77, 0x61, 0x74, 0x63, 0x68, 0x74, 0x6f, 0x77, 0x65, 0x72, 0x2f, + 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x2f, 0x67, 0x65, 0x6e, 0x2f, 0x63, 0x6f, 0x6e, + 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x65, 0x72, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x73, 0x65, 0x72, 0x76, + 0x69, 0x63, 0x65, 0x73, 0x3b, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x62, 0x06, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -762,17 +765,17 @@ var file_controller_api_services_v1_authaccount_service_proto_goTypes = []interf (*UpdateAccountResponse)(nil), // 7: controller.api.services.v1.UpdateAccountResponse (*DeleteAccountRequest)(nil), // 8: controller.api.services.v1.DeleteAccountRequest (*DeleteAccountResponse)(nil), // 9: controller.api.services.v1.DeleteAccountResponse - (*auth.Account)(nil), // 10: controller.api.resources.auth.v1.Account + (*authmethods.Account)(nil), // 10: controller.api.resources.authmethods.v1.Account (*field_mask.FieldMask)(nil), // 11: google.protobuf.FieldMask } var file_controller_api_services_v1_authaccount_service_proto_depIdxs = []int32{ - 10, // 0: controller.api.services.v1.GetAccountResponse.item:type_name -> controller.api.resources.auth.v1.Account - 10, // 1: controller.api.services.v1.ListAccountsResponse.items:type_name -> controller.api.resources.auth.v1.Account - 10, // 2: controller.api.services.v1.CreateAccountRequest.item:type_name -> controller.api.resources.auth.v1.Account - 10, // 3: controller.api.services.v1.CreateAccountResponse.item:type_name -> controller.api.resources.auth.v1.Account - 10, // 4: controller.api.services.v1.UpdateAccountRequest.item:type_name -> controller.api.resources.auth.v1.Account + 10, // 0: controller.api.services.v1.GetAccountResponse.item:type_name -> controller.api.resources.authmethods.v1.Account + 10, // 1: controller.api.services.v1.ListAccountsResponse.items:type_name -> controller.api.resources.authmethods.v1.Account + 10, // 2: controller.api.services.v1.CreateAccountRequest.item:type_name -> controller.api.resources.authmethods.v1.Account + 10, // 3: controller.api.services.v1.CreateAccountResponse.item:type_name -> controller.api.resources.authmethods.v1.Account + 10, // 4: controller.api.services.v1.UpdateAccountRequest.item:type_name -> controller.api.resources.authmethods.v1.Account 11, // 5: controller.api.services.v1.UpdateAccountRequest.update_mask:type_name -> google.protobuf.FieldMask - 10, // 6: controller.api.services.v1.UpdateAccountResponse.item:type_name -> controller.api.resources.auth.v1.Account + 10, // 6: controller.api.services.v1.UpdateAccountResponse.item:type_name -> controller.api.resources.authmethods.v1.Account 0, // 7: controller.api.services.v1.AccountService.GetAccount:input_type -> controller.api.services.v1.GetAccountRequest 2, // 8: controller.api.services.v1.AccountService.ListAccounts:input_type -> controller.api.services.v1.ListAccountsRequest 4, // 9: controller.api.services.v1.AccountService.CreateAccount:input_type -> controller.api.services.v1.CreateAccountRequest diff --git a/internal/gen/controller/api/services/group_service.pb.go b/internal/gen/controller/api/services/group_service.pb.go index f6247e6ac..ce6178d38 100644 --- a/internal/gen/controller/api/services/group_service.pb.go +++ b/internal/gen/controller/api/services/group_service.pb.go @@ -9,7 +9,7 @@ package services import ( context "context" proto "github.com/golang/protobuf/proto" - wrappers "github.com/golang/protobuf/ptypes/wrappers" + _ "github.com/golang/protobuf/ptypes/wrappers" _ "github.com/grpc-ecosystem/grpc-gateway/v2/protoc-gen-openapiv2/options" groups "github.com/hashicorp/watchtower/internal/gen/controller/api/resources/groups" _ "github.com/hashicorp/watchtower/internal/gen/controller/api/resources/scopes" @@ -339,8 +339,9 @@ type UpdateGroupRequest struct { unknownFields protoimpl.UnknownFields Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` - Item *groups.Group `protobuf:"bytes,2,opt,name=item,proto3" json:"item,omitempty"` - UpdateMask *field_mask.FieldMask `protobuf:"bytes,3,opt,name=update_mask,json=updateMask,proto3" json:"update_mask,omitempty"` + Version uint32 `protobuf:"varint,2,opt,name=version,proto3" json:"version,omitempty"` + Item *groups.Group `protobuf:"bytes,3,opt,name=item,proto3" json:"item,omitempty"` + UpdateMask *field_mask.FieldMask `protobuf:"bytes,4,opt,name=update_mask,json=updateMask,proto3" json:"update_mask,omitempty"` } func (x *UpdateGroupRequest) Reset() { @@ -382,6 +383,13 @@ func (x *UpdateGroupRequest) GetId() string { return "" } +func (x *UpdateGroupRequest) GetVersion() uint32 { + if x != nil { + return x.Version + } + return 0 +} + func (x *UpdateGroupRequest) GetItem() *groups.Group { if x != nil { return x.Item @@ -545,8 +553,8 @@ type AddGroupMembersRequest struct { Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` // The version ensures the group hasn't changed since it was last retrieved and if // it has the request will fail. - Version *wrappers.UInt32Value `protobuf:"bytes,2,opt,name=version,proto3" json:"version,omitempty"` - MemberIds []string `protobuf:"bytes,3,rep,name=member_ids,proto3" json:"member_ids,omitempty"` + Version uint32 `protobuf:"varint,2,opt,name=version,proto3" json:"version,omitempty"` + MemberIds []string `protobuf:"bytes,3,rep,name=member_ids,proto3" json:"member_ids,omitempty"` } func (x *AddGroupMembersRequest) Reset() { @@ -588,11 +596,11 @@ func (x *AddGroupMembersRequest) GetId() string { return "" } -func (x *AddGroupMembersRequest) GetVersion() *wrappers.UInt32Value { +func (x *AddGroupMembersRequest) GetVersion() uint32 { if x != nil { return x.Version } - return nil + return 0 } func (x *AddGroupMembersRequest) GetMemberIds() []string { @@ -657,8 +665,8 @@ type SetGroupMembersRequest struct { Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` // The version ensures the group hasn't changed since it was last retrieved and if // it has the request will fail. - Version *wrappers.UInt32Value `protobuf:"bytes,2,opt,name=version,proto3" json:"version,omitempty"` - MemberIds []string `protobuf:"bytes,3,rep,name=member_ids,proto3" json:"member_ids,omitempty"` + Version uint32 `protobuf:"varint,2,opt,name=version,proto3" json:"version,omitempty"` + MemberIds []string `protobuf:"bytes,3,rep,name=member_ids,proto3" json:"member_ids,omitempty"` } func (x *SetGroupMembersRequest) Reset() { @@ -700,11 +708,11 @@ func (x *SetGroupMembersRequest) GetId() string { return "" } -func (x *SetGroupMembersRequest) GetVersion() *wrappers.UInt32Value { +func (x *SetGroupMembersRequest) GetVersion() uint32 { if x != nil { return x.Version } - return nil + return 0 } func (x *SetGroupMembersRequest) GetMemberIds() []string { @@ -769,8 +777,8 @@ type RemoveGroupMembersRequest struct { Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` // The version ensures the group hasn't changed since it was last retrieved and if // it has the request will fail. - Version *wrappers.UInt32Value `protobuf:"bytes,2,opt,name=version,proto3" json:"version,omitempty"` - MemberIds []string `protobuf:"bytes,3,rep,name=member_ids,proto3" json:"member_ids,omitempty"` + Version uint32 `protobuf:"varint,2,opt,name=version,proto3" json:"version,omitempty"` + MemberIds []string `protobuf:"bytes,3,rep,name=member_ids,proto3" json:"member_ids,omitempty"` } func (x *RemoveGroupMembersRequest) Reset() { @@ -812,11 +820,11 @@ func (x *RemoveGroupMembersRequest) GetId() string { return "" } -func (x *RemoveGroupMembersRequest) GetVersion() *wrappers.UInt32Value { +func (x *RemoveGroupMembersRequest) GetVersion() uint32 { if x != nil { return x.Version } - return nil + return 0 } func (x *RemoveGroupMembersRequest) GetMemberIds() []string { @@ -924,177 +932,173 @@ var file_controller_api_services_v1_group_service_proto_rawDesc = []byte{ 0x28, 0x0b, 0x32, 0x29, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x65, 0x72, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, 0x2e, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x52, 0x04, 0x69, - 0x74, 0x65, 0x6d, 0x22, 0xa0, 0x01, 0x0a, 0x12, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x47, 0x72, + 0x74, 0x65, 0x6d, 0x22, 0xba, 0x01, 0x0a, 0x12, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, - 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x3d, 0x0a, 0x04, 0x69, 0x74, - 0x65, 0x6d, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x29, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x72, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x18, 0x0a, 0x07, 0x76, 0x65, + 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x07, 0x76, 0x65, 0x72, + 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x3d, 0x0a, 0x04, 0x69, 0x74, 0x65, 0x6d, 0x18, 0x03, 0x20, 0x01, + 0x28, 0x0b, 0x32, 0x29, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x65, 0x72, 0x2e, + 0x61, 0x70, 0x69, 0x2e, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, 0x2e, 0x67, 0x72, + 0x6f, 0x75, 0x70, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x52, 0x04, 0x69, + 0x74, 0x65, 0x6d, 0x12, 0x3b, 0x0a, 0x0b, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x5f, 0x6d, 0x61, + 0x73, 0x6b, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, + 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x46, 0x69, 0x65, 0x6c, 0x64, + 0x4d, 0x61, 0x73, 0x6b, 0x52, 0x0a, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x4d, 0x61, 0x73, 0x6b, + 0x22, 0x54, 0x0a, 0x13, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x52, + 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x3d, 0x0a, 0x04, 0x69, 0x74, 0x65, 0x6d, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x29, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x6c, + 0x65, 0x72, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, + 0x2e, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x72, 0x6f, 0x75, 0x70, + 0x52, 0x04, 0x69, 0x74, 0x65, 0x6d, 0x22, 0x24, 0x0a, 0x12, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, + 0x47, 0x72, 0x6f, 0x75, 0x70, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x0e, 0x0a, 0x02, + 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x22, 0x2f, 0x0a, 0x13, + 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x52, 0x65, 0x73, 0x70, 0x6f, + 0x6e, 0x73, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x65, 0x78, 0x69, 0x73, 0x74, 0x65, 0x64, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x08, 0x52, 0x07, 0x65, 0x78, 0x69, 0x73, 0x74, 0x65, 0x64, 0x22, 0x62, 0x0a, + 0x16, 0x41, 0x64, 0x64, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x4d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x73, + 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x18, 0x0a, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, + 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, + 0x6e, 0x12, 0x1e, 0x0a, 0x0a, 0x6d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x5f, 0x69, 0x64, 0x73, 0x18, + 0x03, 0x20, 0x03, 0x28, 0x09, 0x52, 0x0a, 0x6d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x5f, 0x69, 0x64, + 0x73, 0x22, 0x58, 0x0a, 0x17, 0x41, 0x64, 0x64, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x4d, 0x65, 0x6d, + 0x62, 0x65, 0x72, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x3d, 0x0a, 0x04, + 0x69, 0x74, 0x65, 0x6d, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x29, 0x2e, 0x63, 0x6f, 0x6e, + 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x65, 0x72, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x72, 0x65, 0x73, 0x6f, + 0x75, 0x72, 0x63, 0x65, 0x73, 0x2e, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x73, 0x2e, 0x76, 0x31, 0x2e, + 0x47, 0x72, 0x6f, 0x75, 0x70, 0x52, 0x04, 0x69, 0x74, 0x65, 0x6d, 0x22, 0x62, 0x0a, 0x16, 0x53, + 0x65, 0x74, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x4d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x73, 0x52, 0x65, + 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x18, 0x0a, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, + 0x18, 0x02, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, + 0x1e, 0x0a, 0x0a, 0x6d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x5f, 0x69, 0x64, 0x73, 0x18, 0x03, 0x20, + 0x03, 0x28, 0x09, 0x52, 0x0a, 0x6d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x5f, 0x69, 0x64, 0x73, 0x22, + 0x58, 0x0a, 0x17, 0x53, 0x65, 0x74, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x4d, 0x65, 0x6d, 0x62, 0x65, + 0x72, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x3d, 0x0a, 0x04, 0x69, 0x74, + 0x65, 0x6d, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x29, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x65, 0x72, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, 0x2e, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x72, - 0x6f, 0x75, 0x70, 0x52, 0x04, 0x69, 0x74, 0x65, 0x6d, 0x12, 0x3b, 0x0a, 0x0b, 0x75, 0x70, 0x64, - 0x61, 0x74, 0x65, 0x5f, 0x6d, 0x61, 0x73, 0x6b, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, - 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, - 0x2e, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x4d, 0x61, 0x73, 0x6b, 0x52, 0x0a, 0x75, 0x70, 0x64, 0x61, - 0x74, 0x65, 0x4d, 0x61, 0x73, 0x6b, 0x22, 0x54, 0x0a, 0x13, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, - 0x47, 0x72, 0x6f, 0x75, 0x70, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x3d, 0x0a, - 0x04, 0x69, 0x74, 0x65, 0x6d, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x29, 0x2e, 0x63, 0x6f, - 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x65, 0x72, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x72, 0x65, 0x73, - 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, 0x2e, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x73, 0x2e, 0x76, 0x31, - 0x2e, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x52, 0x04, 0x69, 0x74, 0x65, 0x6d, 0x22, 0x24, 0x0a, 0x12, - 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x52, 0x65, 0x71, 0x75, 0x65, - 0x73, 0x74, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, - 0x69, 0x64, 0x22, 0x2f, 0x0a, 0x13, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x47, 0x72, 0x6f, 0x75, - 0x70, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x65, 0x78, 0x69, - 0x73, 0x74, 0x65, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x52, 0x07, 0x65, 0x78, 0x69, 0x73, - 0x74, 0x65, 0x64, 0x22, 0x80, 0x01, 0x0a, 0x16, 0x41, 0x64, 0x64, 0x47, 0x72, 0x6f, 0x75, 0x70, - 0x4d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x0e, - 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x36, - 0x0a, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, - 0x1c, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, - 0x66, 0x2e, 0x55, 0x49, 0x6e, 0x74, 0x33, 0x32, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, 0x07, 0x76, - 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x1e, 0x0a, 0x0a, 0x6d, 0x65, 0x6d, 0x62, 0x65, 0x72, - 0x5f, 0x69, 0x64, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x09, 0x52, 0x0a, 0x6d, 0x65, 0x6d, 0x62, - 0x65, 0x72, 0x5f, 0x69, 0x64, 0x73, 0x22, 0x58, 0x0a, 0x17, 0x41, 0x64, 0x64, 0x47, 0x72, 0x6f, - 0x75, 0x70, 0x4d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, - 0x65, 0x12, 0x3d, 0x0a, 0x04, 0x69, 0x74, 0x65, 0x6d, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, - 0x29, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x65, 0x72, 0x2e, 0x61, 0x70, 0x69, - 0x2e, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, 0x2e, 0x67, 0x72, 0x6f, 0x75, 0x70, - 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x52, 0x04, 0x69, 0x74, 0x65, 0x6d, - 0x22, 0x80, 0x01, 0x0a, 0x16, 0x53, 0x65, 0x74, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x4d, 0x65, 0x6d, - 0x62, 0x65, 0x72, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x0e, 0x0a, 0x02, 0x69, - 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x36, 0x0a, 0x07, 0x76, - 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x67, - 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x55, - 0x49, 0x6e, 0x74, 0x33, 0x32, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, 0x07, 0x76, 0x65, 0x72, 0x73, - 0x69, 0x6f, 0x6e, 0x12, 0x1e, 0x0a, 0x0a, 0x6d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x5f, 0x69, 0x64, - 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x09, 0x52, 0x0a, 0x6d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x5f, - 0x69, 0x64, 0x73, 0x22, 0x58, 0x0a, 0x17, 0x53, 0x65, 0x74, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x4d, + 0x6f, 0x75, 0x70, 0x52, 0x04, 0x69, 0x74, 0x65, 0x6d, 0x22, 0x65, 0x0a, 0x19, 0x52, 0x65, 0x6d, + 0x6f, 0x76, 0x65, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x4d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x73, 0x52, + 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x18, 0x0a, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, + 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, + 0x12, 0x1e, 0x0a, 0x0a, 0x6d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x5f, 0x69, 0x64, 0x73, 0x18, 0x03, + 0x20, 0x03, 0x28, 0x09, 0x52, 0x0a, 0x6d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x5f, 0x69, 0x64, 0x73, + 0x22, 0x5b, 0x0a, 0x1a, 0x52, 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x4d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x3d, 0x0a, 0x04, 0x69, 0x74, 0x65, 0x6d, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x29, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x65, 0x72, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, 0x2e, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x73, 0x2e, 0x76, - 0x31, 0x2e, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x52, 0x04, 0x69, 0x74, 0x65, 0x6d, 0x22, 0x83, 0x01, - 0x0a, 0x19, 0x52, 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x4d, 0x65, 0x6d, - 0x62, 0x65, 0x72, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x0e, 0x0a, 0x02, 0x69, - 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x36, 0x0a, 0x07, 0x76, - 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x67, - 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x55, - 0x49, 0x6e, 0x74, 0x33, 0x32, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, 0x07, 0x76, 0x65, 0x72, 0x73, - 0x69, 0x6f, 0x6e, 0x12, 0x1e, 0x0a, 0x0a, 0x6d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x5f, 0x69, 0x64, - 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x09, 0x52, 0x0a, 0x6d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x5f, - 0x69, 0x64, 0x73, 0x22, 0x5b, 0x0a, 0x1a, 0x52, 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x47, 0x72, 0x6f, - 0x75, 0x70, 0x4d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, - 0x65, 0x12, 0x3d, 0x0a, 0x04, 0x69, 0x74, 0x65, 0x6d, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, - 0x29, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x65, 0x72, 0x2e, 0x61, 0x70, 0x69, - 0x2e, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, 0x2e, 0x67, 0x72, 0x6f, 0x75, 0x70, - 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x52, 0x04, 0x69, 0x74, 0x65, 0x6d, - 0x32, 0xda, 0x0c, 0x0a, 0x0c, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, - 0x65, 0x12, 0xa5, 0x01, 0x0a, 0x08, 0x47, 0x65, 0x74, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x12, 0x2b, - 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x65, 0x72, 0x2e, 0x61, 0x70, 0x69, 0x2e, - 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x47, - 0x72, 0x6f, 0x75, 0x70, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2c, 0x2e, 0x63, 0x6f, + 0x31, 0x2e, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x52, 0x04, 0x69, 0x74, 0x65, 0x6d, 0x32, 0xda, 0x0c, + 0x0a, 0x0c, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0xa5, + 0x01, 0x0a, 0x08, 0x47, 0x65, 0x74, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x12, 0x2b, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x65, 0x72, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x47, 0x72, 0x6f, 0x75, - 0x70, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x3e, 0x82, 0xd3, 0xe4, 0x93, 0x02, - 0x20, 0x12, 0x18, 0x2f, 0x76, 0x31, 0x2f, 0x73, 0x63, 0x6f, 0x70, 0x65, 0x73, 0x2f, 0x2a, 0x2f, - 0x67, 0x72, 0x6f, 0x75, 0x70, 0x73, 0x2f, 0x7b, 0x69, 0x64, 0x7d, 0x62, 0x04, 0x69, 0x74, 0x65, - 0x6d, 0x92, 0x41, 0x15, 0x12, 0x13, 0x47, 0x65, 0x74, 0x73, 0x20, 0x61, 0x20, 0x73, 0x69, 0x6e, - 0x67, 0x6c, 0x65, 0x20, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x12, 0x9d, 0x01, 0x0a, 0x0a, 0x4c, 0x69, - 0x73, 0x74, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x73, 0x12, 0x2d, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x72, + 0x70, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2c, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x65, 0x72, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, - 0x65, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x73, - 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2e, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, - 0x6c, 0x6c, 0x65, 0x72, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, - 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x73, 0x52, - 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x30, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x15, 0x12, + 0x65, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x52, 0x65, + 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x3e, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x20, 0x12, 0x18, + 0x2f, 0x76, 0x31, 0x2f, 0x73, 0x63, 0x6f, 0x70, 0x65, 0x73, 0x2f, 0x2a, 0x2f, 0x67, 0x72, 0x6f, + 0x75, 0x70, 0x73, 0x2f, 0x7b, 0x69, 0x64, 0x7d, 0x62, 0x04, 0x69, 0x74, 0x65, 0x6d, 0x92, 0x41, + 0x15, 0x12, 0x13, 0x47, 0x65, 0x74, 0x73, 0x20, 0x61, 0x20, 0x73, 0x69, 0x6e, 0x67, 0x6c, 0x65, + 0x20, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x12, 0x9d, 0x01, 0x0a, 0x0a, 0x4c, 0x69, 0x73, 0x74, 0x47, + 0x72, 0x6f, 0x75, 0x70, 0x73, 0x12, 0x2d, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x6c, + 0x65, 0x72, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x2e, + 0x76, 0x31, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x73, 0x52, 0x65, 0x71, + 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2e, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x65, + 0x72, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x2e, 0x76, + 0x31, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x73, 0x52, 0x65, 0x73, 0x70, + 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x30, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x15, 0x12, 0x13, 0x2f, 0x76, + 0x31, 0x2f, 0x73, 0x63, 0x6f, 0x70, 0x65, 0x73, 0x2f, 0x2a, 0x2f, 0x67, 0x72, 0x6f, 0x75, 0x70, + 0x73, 0x92, 0x41, 0x12, 0x12, 0x10, 0x4c, 0x69, 0x73, 0x74, 0x73, 0x20, 0x61, 0x6c, 0x6c, 0x20, + 0x47, 0x72, 0x6f, 0x75, 0x70, 0x73, 0x12, 0xb2, 0x01, 0x0a, 0x0b, 0x43, 0x72, 0x65, 0x61, 0x74, + 0x65, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x12, 0x2e, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, + 0x6c, 0x65, 0x72, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, + 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x52, + 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2f, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, + 0x6c, 0x65, 0x72, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, + 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x52, + 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x42, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x21, 0x22, 0x13, 0x2f, 0x76, 0x31, 0x2f, 0x73, 0x63, 0x6f, 0x70, 0x65, 0x73, 0x2f, 0x2a, 0x2f, 0x67, 0x72, - 0x6f, 0x75, 0x70, 0x73, 0x92, 0x41, 0x12, 0x12, 0x10, 0x4c, 0x69, 0x73, 0x74, 0x73, 0x20, 0x61, - 0x6c, 0x6c, 0x20, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x73, 0x12, 0xb2, 0x01, 0x0a, 0x0b, 0x43, 0x72, - 0x65, 0x61, 0x74, 0x65, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x12, 0x2e, 0x2e, 0x63, 0x6f, 0x6e, 0x74, - 0x72, 0x6f, 0x6c, 0x6c, 0x65, 0x72, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, - 0x63, 0x65, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x47, 0x72, 0x6f, - 0x75, 0x70, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2f, 0x2e, 0x63, 0x6f, 0x6e, 0x74, - 0x72, 0x6f, 0x6c, 0x6c, 0x65, 0x72, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, - 0x63, 0x65, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x47, 0x72, 0x6f, - 0x75, 0x70, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x42, 0x82, 0xd3, 0xe4, 0x93, - 0x02, 0x21, 0x22, 0x13, 0x2f, 0x76, 0x31, 0x2f, 0x73, 0x63, 0x6f, 0x70, 0x65, 0x73, 0x2f, 0x2a, - 0x2f, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x73, 0x3a, 0x04, 0x69, 0x74, 0x65, 0x6d, 0x62, 0x04, 0x69, - 0x74, 0x65, 0x6d, 0x92, 0x41, 0x18, 0x12, 0x16, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x73, 0x20, - 0x61, 0x20, 0x73, 0x69, 0x6e, 0x67, 0x6c, 0x65, 0x20, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x12, 0xb0, - 0x01, 0x0a, 0x0b, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x12, 0x2e, + 0x6f, 0x75, 0x70, 0x73, 0x3a, 0x04, 0x69, 0x74, 0x65, 0x6d, 0x62, 0x04, 0x69, 0x74, 0x65, 0x6d, + 0x92, 0x41, 0x18, 0x12, 0x16, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x73, 0x20, 0x61, 0x20, 0x73, + 0x69, 0x6e, 0x67, 0x6c, 0x65, 0x20, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x12, 0xb0, 0x01, 0x0a, 0x0b, + 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x12, 0x2e, 0x2e, 0x63, 0x6f, + 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x65, 0x72, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x73, 0x65, 0x72, + 0x76, 0x69, 0x63, 0x65, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x47, + 0x72, 0x6f, 0x75, 0x70, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2f, 0x2e, 0x63, 0x6f, + 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x65, 0x72, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x73, 0x65, 0x72, + 0x76, 0x69, 0x63, 0x65, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x47, + 0x72, 0x6f, 0x75, 0x70, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x40, 0x82, 0xd3, + 0xe4, 0x93, 0x02, 0x26, 0x32, 0x18, 0x2f, 0x76, 0x31, 0x2f, 0x73, 0x63, 0x6f, 0x70, 0x65, 0x73, + 0x2f, 0x2a, 0x2f, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x73, 0x2f, 0x7b, 0x69, 0x64, 0x7d, 0x3a, 0x04, + 0x69, 0x74, 0x65, 0x6d, 0x62, 0x04, 0x69, 0x74, 0x65, 0x6d, 0x92, 0x41, 0x11, 0x12, 0x0f, 0x55, + 0x70, 0x64, 0x61, 0x74, 0x65, 0x73, 0x20, 0x61, 0x20, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x12, 0xa4, + 0x01, 0x0a, 0x0b, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x12, 0x2e, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x65, 0x72, 0x2e, 0x61, 0x70, 0x69, 0x2e, - 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x55, 0x70, 0x64, 0x61, + 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2f, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x65, 0x72, 0x2e, 0x61, 0x70, 0x69, 0x2e, - 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x55, 0x70, 0x64, 0x61, + 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, - 0x40, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x26, 0x32, 0x18, 0x2f, 0x76, 0x31, 0x2f, 0x73, 0x63, 0x6f, + 0x34, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x1a, 0x2a, 0x18, 0x2f, 0x76, 0x31, 0x2f, 0x73, 0x63, 0x6f, 0x70, 0x65, 0x73, 0x2f, 0x2a, 0x2f, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x73, 0x2f, 0x7b, 0x69, 0x64, - 0x7d, 0x3a, 0x04, 0x69, 0x74, 0x65, 0x6d, 0x62, 0x04, 0x69, 0x74, 0x65, 0x6d, 0x92, 0x41, 0x11, - 0x12, 0x0f, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x73, 0x20, 0x61, 0x20, 0x47, 0x72, 0x6f, 0x75, - 0x70, 0x12, 0xa4, 0x01, 0x0a, 0x0b, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x47, 0x72, 0x6f, 0x75, - 0x70, 0x12, 0x2e, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x65, 0x72, 0x2e, 0x61, - 0x70, 0x69, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x44, - 0x65, 0x6c, 0x65, 0x74, 0x65, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, - 0x74, 0x1a, 0x2f, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x65, 0x72, 0x2e, 0x61, - 0x70, 0x69, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x44, - 0x65, 0x6c, 0x65, 0x74, 0x65, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, - 0x73, 0x65, 0x22, 0x34, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x1a, 0x2a, 0x18, 0x2f, 0x76, 0x31, 0x2f, - 0x73, 0x63, 0x6f, 0x70, 0x65, 0x73, 0x2f, 0x2a, 0x2f, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x73, 0x2f, - 0x7b, 0x69, 0x64, 0x7d, 0x92, 0x41, 0x11, 0x12, 0x0f, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x73, - 0x20, 0x61, 0x20, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x12, 0xd6, 0x01, 0x0a, 0x0f, 0x41, 0x64, 0x64, - 0x47, 0x72, 0x6f, 0x75, 0x70, 0x4d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x73, 0x12, 0x32, 0x2e, 0x63, - 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x65, 0x72, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x73, 0x65, - 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x41, 0x64, 0x64, 0x47, 0x72, 0x6f, - 0x75, 0x70, 0x4d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, - 0x1a, 0x33, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x65, 0x72, 0x2e, 0x61, 0x70, - 0x69, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x41, 0x64, - 0x64, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x4d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x73, 0x52, 0x65, 0x73, - 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x5a, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x2f, 0x22, 0x24, 0x2f, - 0x76, 0x31, 0x2f, 0x73, 0x63, 0x6f, 0x70, 0x65, 0x73, 0x2f, 0x2a, 0x2f, 0x67, 0x72, 0x6f, 0x75, - 0x70, 0x73, 0x2f, 0x7b, 0x69, 0x64, 0x7d, 0x3a, 0x61, 0x64, 0x64, 0x2d, 0x6d, 0x65, 0x6d, 0x62, - 0x65, 0x72, 0x73, 0x3a, 0x01, 0x2a, 0x62, 0x04, 0x69, 0x74, 0x65, 0x6d, 0x92, 0x41, 0x22, 0x12, - 0x20, 0x41, 0x64, 0x64, 0x73, 0x20, 0x55, 0x73, 0x65, 0x72, 0x73, 0x20, 0x61, 0x73, 0x20, 0x6d, - 0x65, 0x6d, 0x62, 0x65, 0x72, 0x73, 0x20, 0x74, 0x6f, 0x20, 0x61, 0x20, 0x47, 0x72, 0x6f, 0x75, - 0x70, 0x12, 0xa9, 0x02, 0x0a, 0x0f, 0x53, 0x65, 0x74, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x4d, 0x65, - 0x6d, 0x62, 0x65, 0x72, 0x73, 0x12, 0x32, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x6c, - 0x65, 0x72, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x2e, - 0x76, 0x31, 0x2e, 0x53, 0x65, 0x74, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x4d, 0x65, 0x6d, 0x62, 0x65, - 0x72, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x33, 0x2e, 0x63, 0x6f, 0x6e, 0x74, + 0x7d, 0x92, 0x41, 0x11, 0x12, 0x0f, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x73, 0x20, 0x61, 0x20, + 0x47, 0x72, 0x6f, 0x75, 0x70, 0x12, 0xd6, 0x01, 0x0a, 0x0f, 0x41, 0x64, 0x64, 0x47, 0x72, 0x6f, + 0x75, 0x70, 0x4d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x73, 0x12, 0x32, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x65, 0x72, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, - 0x63, 0x65, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x65, 0x74, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x4d, - 0x65, 0x6d, 0x62, 0x65, 0x72, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0xac, - 0x01, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x2f, 0x22, 0x24, 0x2f, 0x76, 0x31, 0x2f, 0x73, 0x63, 0x6f, - 0x70, 0x65, 0x73, 0x2f, 0x2a, 0x2f, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x73, 0x2f, 0x7b, 0x69, 0x64, - 0x7d, 0x3a, 0x73, 0x65, 0x74, 0x2d, 0x6d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x73, 0x3a, 0x01, 0x2a, - 0x62, 0x04, 0x69, 0x74, 0x65, 0x6d, 0x92, 0x41, 0x74, 0x12, 0x72, 0x53, 0x65, 0x74, 0x20, 0x61, - 0x20, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x27, 0x73, 0x20, 0x6d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x73, - 0x20, 0x74, 0x6f, 0x20, 0x65, 0x78, 0x61, 0x63, 0x74, 0x6c, 0x79, 0x20, 0x74, 0x68, 0x65, 0x20, - 0x6c, 0x69, 0x73, 0x74, 0x20, 0x6f, 0x66, 0x20, 0x70, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x64, - 0x20, 0x69, 0x6e, 0x20, 0x74, 0x68, 0x65, 0x20, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x2c, - 0x20, 0x72, 0x65, 0x6d, 0x6f, 0x76, 0x69, 0x6e, 0x67, 0x20, 0x61, 0x6e, 0x79, 0x20, 0x6d, 0x65, - 0x6d, 0x62, 0x65, 0x72, 0x73, 0x20, 0x74, 0x68, 0x61, 0x74, 0x20, 0x61, 0x72, 0x65, 0x20, 0x6e, - 0x6f, 0x74, 0x20, 0x73, 0x70, 0x65, 0x63, 0x69, 0x66, 0x69, 0x65, 0x64, 0x2e, 0x12, 0xed, 0x01, - 0x0a, 0x12, 0x52, 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x4d, 0x65, 0x6d, - 0x62, 0x65, 0x72, 0x73, 0x12, 0x35, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x65, - 0x72, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x2e, 0x76, - 0x31, 0x2e, 0x52, 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x4d, 0x65, 0x6d, - 0x62, 0x65, 0x72, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x36, 0x2e, 0x63, 0x6f, - 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x65, 0x72, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x73, 0x65, 0x72, - 0x76, 0x69, 0x63, 0x65, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x52, 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x47, - 0x72, 0x6f, 0x75, 0x70, 0x4d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, - 0x6e, 0x73, 0x65, 0x22, 0x68, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x32, 0x22, 0x27, 0x2f, 0x76, 0x31, - 0x2f, 0x73, 0x63, 0x6f, 0x70, 0x65, 0x73, 0x2f, 0x2a, 0x2f, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x73, - 0x2f, 0x7b, 0x69, 0x64, 0x7d, 0x3a, 0x72, 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x2d, 0x6d, 0x65, 0x6d, - 0x62, 0x65, 0x72, 0x73, 0x3a, 0x01, 0x2a, 0x62, 0x04, 0x69, 0x74, 0x65, 0x6d, 0x92, 0x41, 0x2d, - 0x12, 0x2b, 0x52, 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x73, 0x20, 0x74, 0x68, 0x65, 0x20, 0x73, 0x70, - 0x65, 0x63, 0x69, 0x66, 0x69, 0x65, 0x64, 0x20, 0x6d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x73, 0x20, - 0x66, 0x72, 0x6f, 0x6d, 0x20, 0x61, 0x20, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x2e, 0x42, 0x4f, 0x5a, - 0x4d, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x68, 0x61, 0x73, 0x68, - 0x69, 0x63, 0x6f, 0x72, 0x70, 0x2f, 0x77, 0x61, 0x74, 0x63, 0x68, 0x74, 0x6f, 0x77, 0x65, 0x72, - 0x2f, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x2f, 0x67, 0x65, 0x6e, 0x2f, 0x63, 0x6f, - 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x65, 0x72, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x73, 0x65, 0x72, - 0x76, 0x69, 0x63, 0x65, 0x73, 0x3b, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x62, 0x06, - 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x63, 0x65, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x41, 0x64, 0x64, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x4d, + 0x65, 0x6d, 0x62, 0x65, 0x72, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x33, 0x2e, + 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x65, 0x72, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x73, + 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x41, 0x64, 0x64, 0x47, 0x72, + 0x6f, 0x75, 0x70, 0x4d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, + 0x73, 0x65, 0x22, 0x5a, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x2f, 0x22, 0x24, 0x2f, 0x76, 0x31, 0x2f, + 0x73, 0x63, 0x6f, 0x70, 0x65, 0x73, 0x2f, 0x2a, 0x2f, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x73, 0x2f, + 0x7b, 0x69, 0x64, 0x7d, 0x3a, 0x61, 0x64, 0x64, 0x2d, 0x6d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x73, + 0x3a, 0x01, 0x2a, 0x62, 0x04, 0x69, 0x74, 0x65, 0x6d, 0x92, 0x41, 0x22, 0x12, 0x20, 0x41, 0x64, + 0x64, 0x73, 0x20, 0x55, 0x73, 0x65, 0x72, 0x73, 0x20, 0x61, 0x73, 0x20, 0x6d, 0x65, 0x6d, 0x62, + 0x65, 0x72, 0x73, 0x20, 0x74, 0x6f, 0x20, 0x61, 0x20, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x12, 0xa9, + 0x02, 0x0a, 0x0f, 0x53, 0x65, 0x74, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x4d, 0x65, 0x6d, 0x62, 0x65, + 0x72, 0x73, 0x12, 0x32, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x65, 0x72, 0x2e, + 0x61, 0x70, 0x69, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x2e, 0x76, 0x31, 0x2e, + 0x53, 0x65, 0x74, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x4d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x73, 0x52, + 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x33, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, + 0x6c, 0x65, 0x72, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, + 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x65, 0x74, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x4d, 0x65, 0x6d, 0x62, + 0x65, 0x72, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0xac, 0x01, 0x82, 0xd3, + 0xe4, 0x93, 0x02, 0x2f, 0x22, 0x24, 0x2f, 0x76, 0x31, 0x2f, 0x73, 0x63, 0x6f, 0x70, 0x65, 0x73, + 0x2f, 0x2a, 0x2f, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x73, 0x2f, 0x7b, 0x69, 0x64, 0x7d, 0x3a, 0x73, + 0x65, 0x74, 0x2d, 0x6d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x73, 0x3a, 0x01, 0x2a, 0x62, 0x04, 0x69, + 0x74, 0x65, 0x6d, 0x92, 0x41, 0x74, 0x12, 0x72, 0x53, 0x65, 0x74, 0x20, 0x61, 0x20, 0x47, 0x72, + 0x6f, 0x75, 0x70, 0x27, 0x73, 0x20, 0x6d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x73, 0x20, 0x74, 0x6f, + 0x20, 0x65, 0x78, 0x61, 0x63, 0x74, 0x6c, 0x79, 0x20, 0x74, 0x68, 0x65, 0x20, 0x6c, 0x69, 0x73, + 0x74, 0x20, 0x6f, 0x66, 0x20, 0x70, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x64, 0x20, 0x69, 0x6e, + 0x20, 0x74, 0x68, 0x65, 0x20, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x2c, 0x20, 0x72, 0x65, + 0x6d, 0x6f, 0x76, 0x69, 0x6e, 0x67, 0x20, 0x61, 0x6e, 0x79, 0x20, 0x6d, 0x65, 0x6d, 0x62, 0x65, + 0x72, 0x73, 0x20, 0x74, 0x68, 0x61, 0x74, 0x20, 0x61, 0x72, 0x65, 0x20, 0x6e, 0x6f, 0x74, 0x20, + 0x73, 0x70, 0x65, 0x63, 0x69, 0x66, 0x69, 0x65, 0x64, 0x2e, 0x12, 0xed, 0x01, 0x0a, 0x12, 0x52, + 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x4d, 0x65, 0x6d, 0x62, 0x65, 0x72, + 0x73, 0x12, 0x35, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x65, 0x72, 0x2e, 0x61, + 0x70, 0x69, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x52, + 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x4d, 0x65, 0x6d, 0x62, 0x65, 0x72, + 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x36, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x72, + 0x6f, 0x6c, 0x6c, 0x65, 0x72, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, + 0x65, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x52, 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x47, 0x72, 0x6f, 0x75, + 0x70, 0x4d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, + 0x22, 0x68, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x32, 0x22, 0x27, 0x2f, 0x76, 0x31, 0x2f, 0x73, 0x63, + 0x6f, 0x70, 0x65, 0x73, 0x2f, 0x2a, 0x2f, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x73, 0x2f, 0x7b, 0x69, + 0x64, 0x7d, 0x3a, 0x72, 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x2d, 0x6d, 0x65, 0x6d, 0x62, 0x65, 0x72, + 0x73, 0x3a, 0x01, 0x2a, 0x62, 0x04, 0x69, 0x74, 0x65, 0x6d, 0x92, 0x41, 0x2d, 0x12, 0x2b, 0x52, + 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x73, 0x20, 0x74, 0x68, 0x65, 0x20, 0x73, 0x70, 0x65, 0x63, 0x69, + 0x66, 0x69, 0x65, 0x64, 0x20, 0x6d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x73, 0x20, 0x66, 0x72, 0x6f, + 0x6d, 0x20, 0x61, 0x20, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x2e, 0x42, 0x4f, 0x5a, 0x4d, 0x67, 0x69, + 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x68, 0x61, 0x73, 0x68, 0x69, 0x63, 0x6f, + 0x72, 0x70, 0x2f, 0x77, 0x61, 0x74, 0x63, 0x68, 0x74, 0x6f, 0x77, 0x65, 0x72, 0x2f, 0x69, 0x6e, + 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x2f, 0x67, 0x65, 0x6e, 0x2f, 0x63, 0x6f, 0x6e, 0x74, 0x72, + 0x6f, 0x6c, 0x6c, 0x65, 0x72, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, + 0x65, 0x73, 0x3b, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x62, 0x06, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x33, } var ( @@ -1129,7 +1133,6 @@ var file_controller_api_services_v1_group_service_proto_goTypes = []interface{}{ (*RemoveGroupMembersResponse)(nil), // 15: controller.api.services.v1.RemoveGroupMembersResponse (*groups.Group)(nil), // 16: controller.api.resources.groups.v1.Group (*field_mask.FieldMask)(nil), // 17: google.protobuf.FieldMask - (*wrappers.UInt32Value)(nil), // 18: google.protobuf.UInt32Value } var file_controller_api_services_v1_group_service_proto_depIdxs = []int32{ 16, // 0: controller.api.services.v1.GetGroupResponse.item:type_name -> controller.api.resources.groups.v1.Group @@ -1139,33 +1142,30 @@ var file_controller_api_services_v1_group_service_proto_depIdxs = []int32{ 16, // 4: controller.api.services.v1.UpdateGroupRequest.item:type_name -> controller.api.resources.groups.v1.Group 17, // 5: controller.api.services.v1.UpdateGroupRequest.update_mask:type_name -> google.protobuf.FieldMask 16, // 6: controller.api.services.v1.UpdateGroupResponse.item:type_name -> controller.api.resources.groups.v1.Group - 18, // 7: controller.api.services.v1.AddGroupMembersRequest.version:type_name -> google.protobuf.UInt32Value - 16, // 8: controller.api.services.v1.AddGroupMembersResponse.item:type_name -> controller.api.resources.groups.v1.Group - 18, // 9: controller.api.services.v1.SetGroupMembersRequest.version:type_name -> google.protobuf.UInt32Value - 16, // 10: controller.api.services.v1.SetGroupMembersResponse.item:type_name -> controller.api.resources.groups.v1.Group - 18, // 11: controller.api.services.v1.RemoveGroupMembersRequest.version:type_name -> google.protobuf.UInt32Value - 16, // 12: controller.api.services.v1.RemoveGroupMembersResponse.item:type_name -> controller.api.resources.groups.v1.Group - 0, // 13: controller.api.services.v1.GroupService.GetGroup:input_type -> controller.api.services.v1.GetGroupRequest - 2, // 14: controller.api.services.v1.GroupService.ListGroups:input_type -> controller.api.services.v1.ListGroupsRequest - 4, // 15: controller.api.services.v1.GroupService.CreateGroup:input_type -> controller.api.services.v1.CreateGroupRequest - 6, // 16: controller.api.services.v1.GroupService.UpdateGroup:input_type -> controller.api.services.v1.UpdateGroupRequest - 8, // 17: controller.api.services.v1.GroupService.DeleteGroup:input_type -> controller.api.services.v1.DeleteGroupRequest - 10, // 18: controller.api.services.v1.GroupService.AddGroupMembers:input_type -> controller.api.services.v1.AddGroupMembersRequest - 12, // 19: controller.api.services.v1.GroupService.SetGroupMembers:input_type -> controller.api.services.v1.SetGroupMembersRequest - 14, // 20: controller.api.services.v1.GroupService.RemoveGroupMembers:input_type -> controller.api.services.v1.RemoveGroupMembersRequest - 1, // 21: controller.api.services.v1.GroupService.GetGroup:output_type -> controller.api.services.v1.GetGroupResponse - 3, // 22: controller.api.services.v1.GroupService.ListGroups:output_type -> controller.api.services.v1.ListGroupsResponse - 5, // 23: controller.api.services.v1.GroupService.CreateGroup:output_type -> controller.api.services.v1.CreateGroupResponse - 7, // 24: controller.api.services.v1.GroupService.UpdateGroup:output_type -> controller.api.services.v1.UpdateGroupResponse - 9, // 25: controller.api.services.v1.GroupService.DeleteGroup:output_type -> controller.api.services.v1.DeleteGroupResponse - 11, // 26: controller.api.services.v1.GroupService.AddGroupMembers:output_type -> controller.api.services.v1.AddGroupMembersResponse - 13, // 27: controller.api.services.v1.GroupService.SetGroupMembers:output_type -> controller.api.services.v1.SetGroupMembersResponse - 15, // 28: controller.api.services.v1.GroupService.RemoveGroupMembers:output_type -> controller.api.services.v1.RemoveGroupMembersResponse - 21, // [21:29] is the sub-list for method output_type - 13, // [13:21] is the sub-list for method input_type - 13, // [13:13] is the sub-list for extension type_name - 13, // [13:13] is the sub-list for extension extendee - 0, // [0:13] is the sub-list for field type_name + 16, // 7: controller.api.services.v1.AddGroupMembersResponse.item:type_name -> controller.api.resources.groups.v1.Group + 16, // 8: controller.api.services.v1.SetGroupMembersResponse.item:type_name -> controller.api.resources.groups.v1.Group + 16, // 9: controller.api.services.v1.RemoveGroupMembersResponse.item:type_name -> controller.api.resources.groups.v1.Group + 0, // 10: controller.api.services.v1.GroupService.GetGroup:input_type -> controller.api.services.v1.GetGroupRequest + 2, // 11: controller.api.services.v1.GroupService.ListGroups:input_type -> controller.api.services.v1.ListGroupsRequest + 4, // 12: controller.api.services.v1.GroupService.CreateGroup:input_type -> controller.api.services.v1.CreateGroupRequest + 6, // 13: controller.api.services.v1.GroupService.UpdateGroup:input_type -> controller.api.services.v1.UpdateGroupRequest + 8, // 14: controller.api.services.v1.GroupService.DeleteGroup:input_type -> controller.api.services.v1.DeleteGroupRequest + 10, // 15: controller.api.services.v1.GroupService.AddGroupMembers:input_type -> controller.api.services.v1.AddGroupMembersRequest + 12, // 16: controller.api.services.v1.GroupService.SetGroupMembers:input_type -> controller.api.services.v1.SetGroupMembersRequest + 14, // 17: controller.api.services.v1.GroupService.RemoveGroupMembers:input_type -> controller.api.services.v1.RemoveGroupMembersRequest + 1, // 18: controller.api.services.v1.GroupService.GetGroup:output_type -> controller.api.services.v1.GetGroupResponse + 3, // 19: controller.api.services.v1.GroupService.ListGroups:output_type -> controller.api.services.v1.ListGroupsResponse + 5, // 20: controller.api.services.v1.GroupService.CreateGroup:output_type -> controller.api.services.v1.CreateGroupResponse + 7, // 21: controller.api.services.v1.GroupService.UpdateGroup:output_type -> controller.api.services.v1.UpdateGroupResponse + 9, // 22: controller.api.services.v1.GroupService.DeleteGroup:output_type -> controller.api.services.v1.DeleteGroupResponse + 11, // 23: controller.api.services.v1.GroupService.AddGroupMembers:output_type -> controller.api.services.v1.AddGroupMembersResponse + 13, // 24: controller.api.services.v1.GroupService.SetGroupMembers:output_type -> controller.api.services.v1.SetGroupMembersResponse + 15, // 25: controller.api.services.v1.GroupService.RemoveGroupMembers:output_type -> controller.api.services.v1.RemoveGroupMembersResponse + 18, // [18:26] is the sub-list for method output_type + 10, // [10:18] is the sub-list for method input_type + 10, // [10:10] is the sub-list for extension type_name + 10, // [10:10] is the sub-list for extension extendee + 0, // [0:10] is the sub-list for field type_name } func init() { file_controller_api_services_v1_group_service_proto_init() } diff --git a/internal/gen/controller/api/services/role_service.pb.go b/internal/gen/controller/api/services/role_service.pb.go index c0672f728..cf9f75c99 100644 --- a/internal/gen/controller/api/services/role_service.pb.go +++ b/internal/gen/controller/api/services/role_service.pb.go @@ -9,7 +9,7 @@ package services import ( context "context" proto "github.com/golang/protobuf/proto" - wrappers "github.com/golang/protobuf/ptypes/wrappers" + _ "github.com/golang/protobuf/ptypes/wrappers" _ "github.com/grpc-ecosystem/grpc-gateway/v2/protoc-gen-openapiv2/options" roles "github.com/hashicorp/watchtower/internal/gen/controller/api/resources/roles" _ "google.golang.org/genproto/googleapis/api/annotations" @@ -339,8 +339,9 @@ type UpdateRoleRequest struct { unknownFields protoimpl.UnknownFields Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` - Item *roles.Role `protobuf:"bytes,2,opt,name=item,proto3" json:"item,omitempty"` - UpdateMask *field_mask.FieldMask `protobuf:"bytes,3,opt,name=update_mask,json=updateMask,proto3" json:"update_mask,omitempty"` + Version uint32 `protobuf:"varint,2,opt,name=version,proto3" json:"version,omitempty"` + Item *roles.Role `protobuf:"bytes,3,opt,name=item,proto3" json:"item,omitempty"` + UpdateMask *field_mask.FieldMask `protobuf:"bytes,4,opt,name=update_mask,json=updateMask,proto3" json:"update_mask,omitempty"` } func (x *UpdateRoleRequest) Reset() { @@ -382,6 +383,13 @@ func (x *UpdateRoleRequest) GetId() string { return "" } +func (x *UpdateRoleRequest) GetVersion() uint32 { + if x != nil { + return x.Version + } + return 0 +} + func (x *UpdateRoleRequest) GetItem() *roles.Role { if x != nil { return x.Item @@ -545,8 +553,8 @@ type AddRolePrincipalsRequest struct { RoleId string `protobuf:"bytes,1,opt,name=role_id,json=roleId,proto3" json:"role_id,omitempty"` // The version ensures the role hasn't changed since it was last retrieved and if // it has the request will fail. - Version *wrappers.UInt32Value `protobuf:"bytes,2,opt,name=version,proto3" json:"version,omitempty"` - PrincipalIds []string `protobuf:"bytes,3,rep,name=principal_ids,proto3" json:"principal_ids,omitempty"` + Version uint32 `protobuf:"varint,2,opt,name=version,proto3" json:"version,omitempty"` + PrincipalIds []string `protobuf:"bytes,3,rep,name=principal_ids,proto3" json:"principal_ids,omitempty"` } func (x *AddRolePrincipalsRequest) Reset() { @@ -588,11 +596,11 @@ func (x *AddRolePrincipalsRequest) GetRoleId() string { return "" } -func (x *AddRolePrincipalsRequest) GetVersion() *wrappers.UInt32Value { +func (x *AddRolePrincipalsRequest) GetVersion() uint32 { if x != nil { return x.Version } - return nil + return 0 } func (x *AddRolePrincipalsRequest) GetPrincipalIds() []string { @@ -657,8 +665,8 @@ type SetRolePrincipalsRequest struct { RoleId string `protobuf:"bytes,1,opt,name=role_id,json=roleId,proto3" json:"role_id,omitempty"` // The version ensures the role hasn't changed since it was last retrieved and if // it has the request will fail. - Version *wrappers.UInt32Value `protobuf:"bytes,2,opt,name=version,proto3" json:"version,omitempty"` - PrincipalIds []string `protobuf:"bytes,3,rep,name=principal_ids,proto3" json:"principal_ids,omitempty"` + Version uint32 `protobuf:"varint,2,opt,name=version,proto3" json:"version,omitempty"` + PrincipalIds []string `protobuf:"bytes,3,rep,name=principal_ids,proto3" json:"principal_ids,omitempty"` } func (x *SetRolePrincipalsRequest) Reset() { @@ -700,11 +708,11 @@ func (x *SetRolePrincipalsRequest) GetRoleId() string { return "" } -func (x *SetRolePrincipalsRequest) GetVersion() *wrappers.UInt32Value { +func (x *SetRolePrincipalsRequest) GetVersion() uint32 { if x != nil { return x.Version } - return nil + return 0 } func (x *SetRolePrincipalsRequest) GetPrincipalIds() []string { @@ -769,8 +777,8 @@ type RemoveRolePrincipalsRequest struct { RoleId string `protobuf:"bytes,1,opt,name=role_id,json=roleId,proto3" json:"role_id,omitempty"` // The version ensures the role hasn't changed since it was last retrieved and if // it has the request will fail. - Version *wrappers.UInt32Value `protobuf:"bytes,2,opt,name=version,proto3" json:"version,omitempty"` - PrincipalIds []string `protobuf:"bytes,3,rep,name=principal_ids,proto3" json:"principal_ids,omitempty"` + Version uint32 `protobuf:"varint,2,opt,name=version,proto3" json:"version,omitempty"` + PrincipalIds []string `protobuf:"bytes,3,rep,name=principal_ids,proto3" json:"principal_ids,omitempty"` } func (x *RemoveRolePrincipalsRequest) Reset() { @@ -812,11 +820,11 @@ func (x *RemoveRolePrincipalsRequest) GetRoleId() string { return "" } -func (x *RemoveRolePrincipalsRequest) GetVersion() *wrappers.UInt32Value { +func (x *RemoveRolePrincipalsRequest) GetVersion() uint32 { if x != nil { return x.Version } - return nil + return 0 } func (x *RemoveRolePrincipalsRequest) GetPrincipalIds() []string { @@ -881,8 +889,8 @@ type AddRoleGrantsRequest struct { RoleId string `protobuf:"bytes,1,opt,name=role_id,json=roleId,proto3" json:"role_id,omitempty"` // The version ensures the role hasn't changed since it was last retrieved and if // it has the request will fail. - Version *wrappers.UInt32Value `protobuf:"bytes,2,opt,name=version,proto3" json:"version,omitempty"` - GrantStrings []string `protobuf:"bytes,3,rep,name=grant_strings,proto3" json:"grant_strings,omitempty"` + Version uint32 `protobuf:"varint,2,opt,name=version,proto3" json:"version,omitempty"` + GrantStrings []string `protobuf:"bytes,3,rep,name=grant_strings,proto3" json:"grant_strings,omitempty"` } func (x *AddRoleGrantsRequest) Reset() { @@ -924,11 +932,11 @@ func (x *AddRoleGrantsRequest) GetRoleId() string { return "" } -func (x *AddRoleGrantsRequest) GetVersion() *wrappers.UInt32Value { +func (x *AddRoleGrantsRequest) GetVersion() uint32 { if x != nil { return x.Version } - return nil + return 0 } func (x *AddRoleGrantsRequest) GetGrantStrings() []string { @@ -993,8 +1001,8 @@ type SetRoleGrantsRequest struct { RoleId string `protobuf:"bytes,1,opt,name=role_id,json=roleId,proto3" json:"role_id,omitempty"` // The version ensures the role hasn't changed since it was last retrieved and if // it has the request will fail. - Version *wrappers.UInt32Value `protobuf:"bytes,2,opt,name=version,proto3" json:"version,omitempty"` - GrantStrings []string `protobuf:"bytes,3,rep,name=grant_strings,proto3" json:"grant_strings,omitempty"` + Version uint32 `protobuf:"varint,2,opt,name=version,proto3" json:"version,omitempty"` + GrantStrings []string `protobuf:"bytes,3,rep,name=grant_strings,proto3" json:"grant_strings,omitempty"` } func (x *SetRoleGrantsRequest) Reset() { @@ -1036,11 +1044,11 @@ func (x *SetRoleGrantsRequest) GetRoleId() string { return "" } -func (x *SetRoleGrantsRequest) GetVersion() *wrappers.UInt32Value { +func (x *SetRoleGrantsRequest) GetVersion() uint32 { if x != nil { return x.Version } - return nil + return 0 } func (x *SetRoleGrantsRequest) GetGrantStrings() []string { @@ -1105,8 +1113,8 @@ type RemoveRoleGrantsRequest struct { RoleId string `protobuf:"bytes,1,opt,name=role_id,json=roleId,proto3" json:"role_id,omitempty"` // The version ensures the role hasn't changed since it was last retrieved and if // it has the request will fail. - Version *wrappers.UInt32Value `protobuf:"bytes,2,opt,name=version,proto3" json:"version,omitempty"` - GrantStrings []string `protobuf:"bytes,3,rep,name=grant_strings,proto3" json:"grant_strings,omitempty"` + Version uint32 `protobuf:"varint,2,opt,name=version,proto3" json:"version,omitempty"` + GrantStrings []string `protobuf:"bytes,3,rep,name=grant_strings,proto3" json:"grant_strings,omitempty"` } func (x *RemoveRoleGrantsRequest) Reset() { @@ -1148,11 +1156,11 @@ func (x *RemoveRoleGrantsRequest) GetRoleId() string { return "" } -func (x *RemoveRoleGrantsRequest) GetVersion() *wrappers.UInt32Value { +func (x *RemoveRoleGrantsRequest) GetVersion() uint32 { if x != nil { return x.Version } - return nil + return 0 } func (x *RemoveRoleGrantsRequest) GetGrantStrings() []string { @@ -1256,107 +1264,97 @@ var file_controller_api_services_v1_role_service_proto_rawDesc = []byte{ 0x01, 0x28, 0x0b, 0x32, 0x27, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x65, 0x72, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, 0x2e, 0x72, 0x6f, 0x6c, 0x65, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x52, 0x6f, 0x6c, 0x65, 0x52, 0x04, 0x69, 0x74, - 0x65, 0x6d, 0x22, 0x9d, 0x01, 0x0a, 0x11, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x52, 0x6f, 0x6c, + 0x65, 0x6d, 0x22, 0xb7, 0x01, 0x0a, 0x11, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x52, 0x6f, 0x6c, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x3b, 0x0a, 0x04, 0x69, 0x74, 0x65, 0x6d, - 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x27, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, - 0x6c, 0x65, 0x72, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, - 0x73, 0x2e, 0x72, 0x6f, 0x6c, 0x65, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x52, 0x6f, 0x6c, 0x65, 0x52, - 0x04, 0x69, 0x74, 0x65, 0x6d, 0x12, 0x3b, 0x0a, 0x0b, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x5f, - 0x6d, 0x61, 0x73, 0x6b, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, - 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x46, 0x69, 0x65, - 0x6c, 0x64, 0x4d, 0x61, 0x73, 0x6b, 0x52, 0x0a, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x4d, 0x61, - 0x73, 0x6b, 0x22, 0x51, 0x0a, 0x12, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x52, 0x6f, 0x6c, 0x65, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x18, 0x0a, 0x07, 0x76, 0x65, 0x72, 0x73, + 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, + 0x6f, 0x6e, 0x12, 0x3b, 0x0a, 0x04, 0x69, 0x74, 0x65, 0x6d, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, + 0x32, 0x27, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x65, 0x72, 0x2e, 0x61, 0x70, + 0x69, 0x2e, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, 0x2e, 0x72, 0x6f, 0x6c, 0x65, + 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x52, 0x6f, 0x6c, 0x65, 0x52, 0x04, 0x69, 0x74, 0x65, 0x6d, 0x12, + 0x3b, 0x0a, 0x0b, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x5f, 0x6d, 0x61, 0x73, 0x6b, 0x18, 0x04, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x4d, 0x61, 0x73, 0x6b, + 0x52, 0x0a, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x4d, 0x61, 0x73, 0x6b, 0x22, 0x51, 0x0a, 0x12, + 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x52, 0x6f, 0x6c, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, + 0x73, 0x65, 0x12, 0x3b, 0x0a, 0x04, 0x69, 0x74, 0x65, 0x6d, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, + 0x32, 0x27, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x65, 0x72, 0x2e, 0x61, 0x70, + 0x69, 0x2e, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, 0x2e, 0x72, 0x6f, 0x6c, 0x65, + 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x52, 0x6f, 0x6c, 0x65, 0x52, 0x04, 0x69, 0x74, 0x65, 0x6d, 0x22, + 0x23, 0x0a, 0x11, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x52, 0x6f, 0x6c, 0x65, 0x52, 0x65, 0x71, + 0x75, 0x65, 0x73, 0x74, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x02, 0x69, 0x64, 0x22, 0x2e, 0x0a, 0x12, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x52, 0x6f, + 0x6c, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x65, 0x78, + 0x69, 0x73, 0x74, 0x65, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x52, 0x07, 0x65, 0x78, 0x69, + 0x73, 0x74, 0x65, 0x64, 0x22, 0x73, 0x0a, 0x18, 0x41, 0x64, 0x64, 0x52, 0x6f, 0x6c, 0x65, 0x50, + 0x72, 0x69, 0x6e, 0x63, 0x69, 0x70, 0x61, 0x6c, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, + 0x12, 0x17, 0x0a, 0x07, 0x72, 0x6f, 0x6c, 0x65, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x06, 0x72, 0x6f, 0x6c, 0x65, 0x49, 0x64, 0x12, 0x18, 0x0a, 0x07, 0x76, 0x65, 0x72, + 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x07, 0x76, 0x65, 0x72, 0x73, + 0x69, 0x6f, 0x6e, 0x12, 0x24, 0x0a, 0x0d, 0x70, 0x72, 0x69, 0x6e, 0x63, 0x69, 0x70, 0x61, 0x6c, + 0x5f, 0x69, 0x64, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x09, 0x52, 0x0d, 0x70, 0x72, 0x69, 0x6e, + 0x63, 0x69, 0x70, 0x61, 0x6c, 0x5f, 0x69, 0x64, 0x73, 0x22, 0x58, 0x0a, 0x19, 0x41, 0x64, 0x64, + 0x52, 0x6f, 0x6c, 0x65, 0x50, 0x72, 0x69, 0x6e, 0x63, 0x69, 0x70, 0x61, 0x6c, 0x73, 0x52, 0x65, + 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x3b, 0x0a, 0x04, 0x69, 0x74, 0x65, 0x6d, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x27, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x65, + 0x72, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, 0x2e, + 0x72, 0x6f, 0x6c, 0x65, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x52, 0x6f, 0x6c, 0x65, 0x52, 0x04, 0x69, + 0x74, 0x65, 0x6d, 0x22, 0x73, 0x0a, 0x18, 0x53, 0x65, 0x74, 0x52, 0x6f, 0x6c, 0x65, 0x50, 0x72, + 0x69, 0x6e, 0x63, 0x69, 0x70, 0x61, 0x6c, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, + 0x17, 0x0a, 0x07, 0x72, 0x6f, 0x6c, 0x65, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x06, 0x72, 0x6f, 0x6c, 0x65, 0x49, 0x64, 0x12, 0x18, 0x0a, 0x07, 0x76, 0x65, 0x72, 0x73, + 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, + 0x6f, 0x6e, 0x12, 0x24, 0x0a, 0x0d, 0x70, 0x72, 0x69, 0x6e, 0x63, 0x69, 0x70, 0x61, 0x6c, 0x5f, + 0x69, 0x64, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x09, 0x52, 0x0d, 0x70, 0x72, 0x69, 0x6e, 0x63, + 0x69, 0x70, 0x61, 0x6c, 0x5f, 0x69, 0x64, 0x73, 0x22, 0x58, 0x0a, 0x19, 0x53, 0x65, 0x74, 0x52, + 0x6f, 0x6c, 0x65, 0x50, 0x72, 0x69, 0x6e, 0x63, 0x69, 0x70, 0x61, 0x6c, 0x73, 0x52, 0x65, 0x73, + 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x3b, 0x0a, 0x04, 0x69, 0x74, 0x65, 0x6d, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x0b, 0x32, 0x27, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x65, 0x72, + 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, 0x2e, 0x72, + 0x6f, 0x6c, 0x65, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x52, 0x6f, 0x6c, 0x65, 0x52, 0x04, 0x69, 0x74, + 0x65, 0x6d, 0x22, 0x76, 0x0a, 0x1b, 0x52, 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x52, 0x6f, 0x6c, 0x65, + 0x50, 0x72, 0x69, 0x6e, 0x63, 0x69, 0x70, 0x61, 0x6c, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, + 0x74, 0x12, 0x17, 0x0a, 0x07, 0x72, 0x6f, 0x6c, 0x65, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x06, 0x72, 0x6f, 0x6c, 0x65, 0x49, 0x64, 0x12, 0x18, 0x0a, 0x07, 0x76, 0x65, + 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x07, 0x76, 0x65, 0x72, + 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x24, 0x0a, 0x0d, 0x70, 0x72, 0x69, 0x6e, 0x63, 0x69, 0x70, 0x61, + 0x6c, 0x5f, 0x69, 0x64, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x09, 0x52, 0x0d, 0x70, 0x72, 0x69, + 0x6e, 0x63, 0x69, 0x70, 0x61, 0x6c, 0x5f, 0x69, 0x64, 0x73, 0x22, 0x5b, 0x0a, 0x1c, 0x52, 0x65, + 0x6d, 0x6f, 0x76, 0x65, 0x52, 0x6f, 0x6c, 0x65, 0x50, 0x72, 0x69, 0x6e, 0x63, 0x69, 0x70, 0x61, + 0x6c, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x3b, 0x0a, 0x04, 0x69, 0x74, + 0x65, 0x6d, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x27, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x72, + 0x6f, 0x6c, 0x6c, 0x65, 0x72, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, + 0x63, 0x65, 0x73, 0x2e, 0x72, 0x6f, 0x6c, 0x65, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x52, 0x6f, 0x6c, + 0x65, 0x52, 0x04, 0x69, 0x74, 0x65, 0x6d, 0x22, 0x6f, 0x0a, 0x14, 0x41, 0x64, 0x64, 0x52, 0x6f, + 0x6c, 0x65, 0x47, 0x72, 0x61, 0x6e, 0x74, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, + 0x17, 0x0a, 0x07, 0x72, 0x6f, 0x6c, 0x65, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x06, 0x72, 0x6f, 0x6c, 0x65, 0x49, 0x64, 0x12, 0x18, 0x0a, 0x07, 0x76, 0x65, 0x72, 0x73, + 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, + 0x6f, 0x6e, 0x12, 0x24, 0x0a, 0x0d, 0x67, 0x72, 0x61, 0x6e, 0x74, 0x5f, 0x73, 0x74, 0x72, 0x69, + 0x6e, 0x67, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x09, 0x52, 0x0d, 0x67, 0x72, 0x61, 0x6e, 0x74, + 0x5f, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x73, 0x22, 0x54, 0x0a, 0x15, 0x41, 0x64, 0x64, 0x52, + 0x6f, 0x6c, 0x65, 0x47, 0x72, 0x61, 0x6e, 0x74, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, + 0x65, 0x12, 0x3b, 0x0a, 0x04, 0x69, 0x74, 0x65, 0x6d, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, + 0x27, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x65, 0x72, 0x2e, 0x61, 0x70, 0x69, + 0x2e, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, 0x2e, 0x72, 0x6f, 0x6c, 0x65, 0x73, + 0x2e, 0x76, 0x31, 0x2e, 0x52, 0x6f, 0x6c, 0x65, 0x52, 0x04, 0x69, 0x74, 0x65, 0x6d, 0x22, 0x6f, + 0x0a, 0x14, 0x53, 0x65, 0x74, 0x52, 0x6f, 0x6c, 0x65, 0x47, 0x72, 0x61, 0x6e, 0x74, 0x73, 0x52, + 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x17, 0x0a, 0x07, 0x72, 0x6f, 0x6c, 0x65, 0x5f, 0x69, + 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x72, 0x6f, 0x6c, 0x65, 0x49, 0x64, 0x12, + 0x18, 0x0a, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0d, + 0x52, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x24, 0x0a, 0x0d, 0x67, 0x72, 0x61, + 0x6e, 0x74, 0x5f, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x09, + 0x52, 0x0d, 0x67, 0x72, 0x61, 0x6e, 0x74, 0x5f, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x73, 0x22, + 0x54, 0x0a, 0x15, 0x53, 0x65, 0x74, 0x52, 0x6f, 0x6c, 0x65, 0x47, 0x72, 0x61, 0x6e, 0x74, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x3b, 0x0a, 0x04, 0x69, 0x74, 0x65, 0x6d, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x27, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x65, 0x72, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, 0x2e, 0x72, 0x6f, 0x6c, 0x65, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x52, 0x6f, 0x6c, 0x65, 0x52, - 0x04, 0x69, 0x74, 0x65, 0x6d, 0x22, 0x23, 0x0a, 0x11, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x52, - 0x6f, 0x6c, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, - 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x22, 0x2e, 0x0a, 0x12, 0x44, 0x65, - 0x6c, 0x65, 0x74, 0x65, 0x52, 0x6f, 0x6c, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, - 0x12, 0x18, 0x0a, 0x07, 0x65, 0x78, 0x69, 0x73, 0x74, 0x65, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, - 0x08, 0x52, 0x07, 0x65, 0x78, 0x69, 0x73, 0x74, 0x65, 0x64, 0x22, 0x91, 0x01, 0x0a, 0x18, 0x41, - 0x64, 0x64, 0x52, 0x6f, 0x6c, 0x65, 0x50, 0x72, 0x69, 0x6e, 0x63, 0x69, 0x70, 0x61, 0x6c, 0x73, - 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x17, 0x0a, 0x07, 0x72, 0x6f, 0x6c, 0x65, 0x5f, - 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x72, 0x6f, 0x6c, 0x65, 0x49, 0x64, - 0x12, 0x36, 0x0a, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, - 0x0b, 0x32, 0x1c, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, - 0x62, 0x75, 0x66, 0x2e, 0x55, 0x49, 0x6e, 0x74, 0x33, 0x32, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, - 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x24, 0x0a, 0x0d, 0x70, 0x72, 0x69, 0x6e, - 0x63, 0x69, 0x70, 0x61, 0x6c, 0x5f, 0x69, 0x64, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x09, 0x52, - 0x0d, 0x70, 0x72, 0x69, 0x6e, 0x63, 0x69, 0x70, 0x61, 0x6c, 0x5f, 0x69, 0x64, 0x73, 0x22, 0x58, - 0x0a, 0x19, 0x41, 0x64, 0x64, 0x52, 0x6f, 0x6c, 0x65, 0x50, 0x72, 0x69, 0x6e, 0x63, 0x69, 0x70, - 0x61, 0x6c, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x3b, 0x0a, 0x04, 0x69, - 0x74, 0x65, 0x6d, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x27, 0x2e, 0x63, 0x6f, 0x6e, 0x74, - 0x72, 0x6f, 0x6c, 0x6c, 0x65, 0x72, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x72, 0x65, 0x73, 0x6f, 0x75, - 0x72, 0x63, 0x65, 0x73, 0x2e, 0x72, 0x6f, 0x6c, 0x65, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x52, 0x6f, - 0x6c, 0x65, 0x52, 0x04, 0x69, 0x74, 0x65, 0x6d, 0x22, 0x91, 0x01, 0x0a, 0x18, 0x53, 0x65, 0x74, - 0x52, 0x6f, 0x6c, 0x65, 0x50, 0x72, 0x69, 0x6e, 0x63, 0x69, 0x70, 0x61, 0x6c, 0x73, 0x52, 0x65, - 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x17, 0x0a, 0x07, 0x72, 0x6f, 0x6c, 0x65, 0x5f, 0x69, 0x64, - 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x72, 0x6f, 0x6c, 0x65, 0x49, 0x64, 0x12, 0x36, - 0x0a, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, - 0x1c, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, - 0x66, 0x2e, 0x55, 0x49, 0x6e, 0x74, 0x33, 0x32, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, 0x07, 0x76, - 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x24, 0x0a, 0x0d, 0x70, 0x72, 0x69, 0x6e, 0x63, 0x69, - 0x70, 0x61, 0x6c, 0x5f, 0x69, 0x64, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x09, 0x52, 0x0d, 0x70, - 0x72, 0x69, 0x6e, 0x63, 0x69, 0x70, 0x61, 0x6c, 0x5f, 0x69, 0x64, 0x73, 0x22, 0x58, 0x0a, 0x19, - 0x53, 0x65, 0x74, 0x52, 0x6f, 0x6c, 0x65, 0x50, 0x72, 0x69, 0x6e, 0x63, 0x69, 0x70, 0x61, 0x6c, - 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x3b, 0x0a, 0x04, 0x69, 0x74, 0x65, - 0x6d, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x27, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, - 0x6c, 0x6c, 0x65, 0x72, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, - 0x65, 0x73, 0x2e, 0x72, 0x6f, 0x6c, 0x65, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x52, 0x6f, 0x6c, 0x65, - 0x52, 0x04, 0x69, 0x74, 0x65, 0x6d, 0x22, 0x94, 0x01, 0x0a, 0x1b, 0x52, 0x65, 0x6d, 0x6f, 0x76, - 0x65, 0x52, 0x6f, 0x6c, 0x65, 0x50, 0x72, 0x69, 0x6e, 0x63, 0x69, 0x70, 0x61, 0x6c, 0x73, 0x52, - 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x17, 0x0a, 0x07, 0x72, 0x6f, 0x6c, 0x65, 0x5f, 0x69, - 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x72, 0x6f, 0x6c, 0x65, 0x49, 0x64, 0x12, - 0x36, 0x0a, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, - 0x32, 0x1c, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, - 0x75, 0x66, 0x2e, 0x55, 0x49, 0x6e, 0x74, 0x33, 0x32, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, 0x07, - 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x24, 0x0a, 0x0d, 0x70, 0x72, 0x69, 0x6e, 0x63, - 0x69, 0x70, 0x61, 0x6c, 0x5f, 0x69, 0x64, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x09, 0x52, 0x0d, - 0x70, 0x72, 0x69, 0x6e, 0x63, 0x69, 0x70, 0x61, 0x6c, 0x5f, 0x69, 0x64, 0x73, 0x22, 0x5b, 0x0a, - 0x1c, 0x52, 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x52, 0x6f, 0x6c, 0x65, 0x50, 0x72, 0x69, 0x6e, 0x63, - 0x69, 0x70, 0x61, 0x6c, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x3b, 0x0a, - 0x04, 0x69, 0x74, 0x65, 0x6d, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x27, 0x2e, 0x63, 0x6f, - 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x65, 0x72, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x72, 0x65, 0x73, - 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, 0x2e, 0x72, 0x6f, 0x6c, 0x65, 0x73, 0x2e, 0x76, 0x31, 0x2e, - 0x52, 0x6f, 0x6c, 0x65, 0x52, 0x04, 0x69, 0x74, 0x65, 0x6d, 0x22, 0x8d, 0x01, 0x0a, 0x14, 0x41, - 0x64, 0x64, 0x52, 0x6f, 0x6c, 0x65, 0x47, 0x72, 0x61, 0x6e, 0x74, 0x73, 0x52, 0x65, 0x71, 0x75, - 0x65, 0x73, 0x74, 0x12, 0x17, 0x0a, 0x07, 0x72, 0x6f, 0x6c, 0x65, 0x5f, 0x69, 0x64, 0x18, 0x01, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x72, 0x6f, 0x6c, 0x65, 0x49, 0x64, 0x12, 0x36, 0x0a, 0x07, - 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1c, 0x2e, - 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, - 0x55, 0x49, 0x6e, 0x74, 0x33, 0x32, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, 0x07, 0x76, 0x65, 0x72, - 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x24, 0x0a, 0x0d, 0x67, 0x72, 0x61, 0x6e, 0x74, 0x5f, 0x73, 0x74, - 0x72, 0x69, 0x6e, 0x67, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x09, 0x52, 0x0d, 0x67, 0x72, 0x61, - 0x6e, 0x74, 0x5f, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x73, 0x22, 0x54, 0x0a, 0x15, 0x41, 0x64, - 0x64, 0x52, 0x6f, 0x6c, 0x65, 0x47, 0x72, 0x61, 0x6e, 0x74, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, - 0x6e, 0x73, 0x65, 0x12, 0x3b, 0x0a, 0x04, 0x69, 0x74, 0x65, 0x6d, 0x18, 0x01, 0x20, 0x01, 0x28, - 0x0b, 0x32, 0x27, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x65, 0x72, 0x2e, 0x61, - 0x70, 0x69, 0x2e, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, 0x2e, 0x72, 0x6f, 0x6c, - 0x65, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x52, 0x6f, 0x6c, 0x65, 0x52, 0x04, 0x69, 0x74, 0x65, 0x6d, - 0x22, 0x8d, 0x01, 0x0a, 0x14, 0x53, 0x65, 0x74, 0x52, 0x6f, 0x6c, 0x65, 0x47, 0x72, 0x61, 0x6e, - 0x74, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x17, 0x0a, 0x07, 0x72, 0x6f, 0x6c, - 0x65, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x72, 0x6f, 0x6c, 0x65, - 0x49, 0x64, 0x12, 0x36, 0x0a, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, - 0x01, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, - 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x55, 0x49, 0x6e, 0x74, 0x33, 0x32, 0x56, 0x61, 0x6c, 0x75, - 0x65, 0x52, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x24, 0x0a, 0x0d, 0x67, 0x72, - 0x61, 0x6e, 0x74, 0x5f, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, - 0x09, 0x52, 0x0d, 0x67, 0x72, 0x61, 0x6e, 0x74, 0x5f, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x73, - 0x22, 0x54, 0x0a, 0x15, 0x53, 0x65, 0x74, 0x52, 0x6f, 0x6c, 0x65, 0x47, 0x72, 0x61, 0x6e, 0x74, - 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x3b, 0x0a, 0x04, 0x69, 0x74, 0x65, - 0x6d, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x27, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, - 0x6c, 0x6c, 0x65, 0x72, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, - 0x65, 0x73, 0x2e, 0x72, 0x6f, 0x6c, 0x65, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x52, 0x6f, 0x6c, 0x65, - 0x52, 0x04, 0x69, 0x74, 0x65, 0x6d, 0x22, 0x90, 0x01, 0x0a, 0x17, 0x52, 0x65, 0x6d, 0x6f, 0x76, - 0x65, 0x52, 0x6f, 0x6c, 0x65, 0x47, 0x72, 0x61, 0x6e, 0x74, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, - 0x73, 0x74, 0x12, 0x17, 0x0a, 0x07, 0x72, 0x6f, 0x6c, 0x65, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, - 0x01, 0x28, 0x09, 0x52, 0x06, 0x72, 0x6f, 0x6c, 0x65, 0x49, 0x64, 0x12, 0x36, 0x0a, 0x07, 0x76, - 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x67, - 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x55, - 0x49, 0x6e, 0x74, 0x33, 0x32, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, 0x07, 0x76, 0x65, 0x72, 0x73, + 0x04, 0x69, 0x74, 0x65, 0x6d, 0x22, 0x72, 0x0a, 0x17, 0x52, 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x52, + 0x6f, 0x6c, 0x65, 0x47, 0x72, 0x61, 0x6e, 0x74, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, + 0x12, 0x17, 0x0a, 0x07, 0x72, 0x6f, 0x6c, 0x65, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x06, 0x72, 0x6f, 0x6c, 0x65, 0x49, 0x64, 0x12, 0x18, 0x0a, 0x07, 0x76, 0x65, 0x72, + 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x24, 0x0a, 0x0d, 0x67, 0x72, 0x61, 0x6e, 0x74, 0x5f, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x09, 0x52, 0x0d, 0x67, 0x72, 0x61, 0x6e, 0x74, 0x5f, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x73, 0x22, 0x57, 0x0a, 0x18, 0x52, 0x65, 0x6d, @@ -1557,7 +1555,6 @@ var file_controller_api_services_v1_role_service_proto_goTypes = []interface{}{ (*RemoveRoleGrantsResponse)(nil), // 21: controller.api.services.v1.RemoveRoleGrantsResponse (*roles.Role)(nil), // 22: controller.api.resources.roles.v1.Role (*field_mask.FieldMask)(nil), // 23: google.protobuf.FieldMask - (*wrappers.UInt32Value)(nil), // 24: google.protobuf.UInt32Value } var file_controller_api_services_v1_role_service_proto_depIdxs = []int32{ 22, // 0: controller.api.services.v1.GetRoleResponse.item:type_name -> controller.api.resources.roles.v1.Role @@ -1567,45 +1564,39 @@ var file_controller_api_services_v1_role_service_proto_depIdxs = []int32{ 22, // 4: controller.api.services.v1.UpdateRoleRequest.item:type_name -> controller.api.resources.roles.v1.Role 23, // 5: controller.api.services.v1.UpdateRoleRequest.update_mask:type_name -> google.protobuf.FieldMask 22, // 6: controller.api.services.v1.UpdateRoleResponse.item:type_name -> controller.api.resources.roles.v1.Role - 24, // 7: controller.api.services.v1.AddRolePrincipalsRequest.version:type_name -> google.protobuf.UInt32Value - 22, // 8: controller.api.services.v1.AddRolePrincipalsResponse.item:type_name -> controller.api.resources.roles.v1.Role - 24, // 9: controller.api.services.v1.SetRolePrincipalsRequest.version:type_name -> google.protobuf.UInt32Value - 22, // 10: controller.api.services.v1.SetRolePrincipalsResponse.item:type_name -> controller.api.resources.roles.v1.Role - 24, // 11: controller.api.services.v1.RemoveRolePrincipalsRequest.version:type_name -> google.protobuf.UInt32Value - 22, // 12: controller.api.services.v1.RemoveRolePrincipalsResponse.item:type_name -> controller.api.resources.roles.v1.Role - 24, // 13: controller.api.services.v1.AddRoleGrantsRequest.version:type_name -> google.protobuf.UInt32Value - 22, // 14: controller.api.services.v1.AddRoleGrantsResponse.item:type_name -> controller.api.resources.roles.v1.Role - 24, // 15: controller.api.services.v1.SetRoleGrantsRequest.version:type_name -> google.protobuf.UInt32Value - 22, // 16: controller.api.services.v1.SetRoleGrantsResponse.item:type_name -> controller.api.resources.roles.v1.Role - 24, // 17: controller.api.services.v1.RemoveRoleGrantsRequest.version:type_name -> google.protobuf.UInt32Value - 22, // 18: controller.api.services.v1.RemoveRoleGrantsResponse.item:type_name -> controller.api.resources.roles.v1.Role - 0, // 19: controller.api.services.v1.RoleService.GetRole:input_type -> controller.api.services.v1.GetRoleRequest - 2, // 20: controller.api.services.v1.RoleService.ListRoles:input_type -> controller.api.services.v1.ListRolesRequest - 4, // 21: controller.api.services.v1.RoleService.CreateRole:input_type -> controller.api.services.v1.CreateRoleRequest - 6, // 22: controller.api.services.v1.RoleService.UpdateRole:input_type -> controller.api.services.v1.UpdateRoleRequest - 8, // 23: controller.api.services.v1.RoleService.DeleteRole:input_type -> controller.api.services.v1.DeleteRoleRequest - 10, // 24: controller.api.services.v1.RoleService.AddRolePrincipals:input_type -> controller.api.services.v1.AddRolePrincipalsRequest - 12, // 25: controller.api.services.v1.RoleService.SetRolePrincipals:input_type -> controller.api.services.v1.SetRolePrincipalsRequest - 14, // 26: controller.api.services.v1.RoleService.RemoveRolePrincipals:input_type -> controller.api.services.v1.RemoveRolePrincipalsRequest - 16, // 27: controller.api.services.v1.RoleService.AddRoleGrants:input_type -> controller.api.services.v1.AddRoleGrantsRequest - 18, // 28: controller.api.services.v1.RoleService.SetRoleGrants:input_type -> controller.api.services.v1.SetRoleGrantsRequest - 20, // 29: controller.api.services.v1.RoleService.RemoveRoleGrants:input_type -> controller.api.services.v1.RemoveRoleGrantsRequest - 1, // 30: controller.api.services.v1.RoleService.GetRole:output_type -> controller.api.services.v1.GetRoleResponse - 3, // 31: controller.api.services.v1.RoleService.ListRoles:output_type -> controller.api.services.v1.ListRolesResponse - 5, // 32: controller.api.services.v1.RoleService.CreateRole:output_type -> controller.api.services.v1.CreateRoleResponse - 7, // 33: controller.api.services.v1.RoleService.UpdateRole:output_type -> controller.api.services.v1.UpdateRoleResponse - 9, // 34: controller.api.services.v1.RoleService.DeleteRole:output_type -> controller.api.services.v1.DeleteRoleResponse - 11, // 35: controller.api.services.v1.RoleService.AddRolePrincipals:output_type -> controller.api.services.v1.AddRolePrincipalsResponse - 13, // 36: controller.api.services.v1.RoleService.SetRolePrincipals:output_type -> controller.api.services.v1.SetRolePrincipalsResponse - 15, // 37: controller.api.services.v1.RoleService.RemoveRolePrincipals:output_type -> controller.api.services.v1.RemoveRolePrincipalsResponse - 17, // 38: controller.api.services.v1.RoleService.AddRoleGrants:output_type -> controller.api.services.v1.AddRoleGrantsResponse - 19, // 39: controller.api.services.v1.RoleService.SetRoleGrants:output_type -> controller.api.services.v1.SetRoleGrantsResponse - 21, // 40: controller.api.services.v1.RoleService.RemoveRoleGrants:output_type -> controller.api.services.v1.RemoveRoleGrantsResponse - 30, // [30:41] is the sub-list for method output_type - 19, // [19:30] is the sub-list for method input_type - 19, // [19:19] is the sub-list for extension type_name - 19, // [19:19] is the sub-list for extension extendee - 0, // [0:19] is the sub-list for field type_name + 22, // 7: controller.api.services.v1.AddRolePrincipalsResponse.item:type_name -> controller.api.resources.roles.v1.Role + 22, // 8: controller.api.services.v1.SetRolePrincipalsResponse.item:type_name -> controller.api.resources.roles.v1.Role + 22, // 9: controller.api.services.v1.RemoveRolePrincipalsResponse.item:type_name -> controller.api.resources.roles.v1.Role + 22, // 10: controller.api.services.v1.AddRoleGrantsResponse.item:type_name -> controller.api.resources.roles.v1.Role + 22, // 11: controller.api.services.v1.SetRoleGrantsResponse.item:type_name -> controller.api.resources.roles.v1.Role + 22, // 12: controller.api.services.v1.RemoveRoleGrantsResponse.item:type_name -> controller.api.resources.roles.v1.Role + 0, // 13: controller.api.services.v1.RoleService.GetRole:input_type -> controller.api.services.v1.GetRoleRequest + 2, // 14: controller.api.services.v1.RoleService.ListRoles:input_type -> controller.api.services.v1.ListRolesRequest + 4, // 15: controller.api.services.v1.RoleService.CreateRole:input_type -> controller.api.services.v1.CreateRoleRequest + 6, // 16: controller.api.services.v1.RoleService.UpdateRole:input_type -> controller.api.services.v1.UpdateRoleRequest + 8, // 17: controller.api.services.v1.RoleService.DeleteRole:input_type -> controller.api.services.v1.DeleteRoleRequest + 10, // 18: controller.api.services.v1.RoleService.AddRolePrincipals:input_type -> controller.api.services.v1.AddRolePrincipalsRequest + 12, // 19: controller.api.services.v1.RoleService.SetRolePrincipals:input_type -> controller.api.services.v1.SetRolePrincipalsRequest + 14, // 20: controller.api.services.v1.RoleService.RemoveRolePrincipals:input_type -> controller.api.services.v1.RemoveRolePrincipalsRequest + 16, // 21: controller.api.services.v1.RoleService.AddRoleGrants:input_type -> controller.api.services.v1.AddRoleGrantsRequest + 18, // 22: controller.api.services.v1.RoleService.SetRoleGrants:input_type -> controller.api.services.v1.SetRoleGrantsRequest + 20, // 23: controller.api.services.v1.RoleService.RemoveRoleGrants:input_type -> controller.api.services.v1.RemoveRoleGrantsRequest + 1, // 24: controller.api.services.v1.RoleService.GetRole:output_type -> controller.api.services.v1.GetRoleResponse + 3, // 25: controller.api.services.v1.RoleService.ListRoles:output_type -> controller.api.services.v1.ListRolesResponse + 5, // 26: controller.api.services.v1.RoleService.CreateRole:output_type -> controller.api.services.v1.CreateRoleResponse + 7, // 27: controller.api.services.v1.RoleService.UpdateRole:output_type -> controller.api.services.v1.UpdateRoleResponse + 9, // 28: controller.api.services.v1.RoleService.DeleteRole:output_type -> controller.api.services.v1.DeleteRoleResponse + 11, // 29: controller.api.services.v1.RoleService.AddRolePrincipals:output_type -> controller.api.services.v1.AddRolePrincipalsResponse + 13, // 30: controller.api.services.v1.RoleService.SetRolePrincipals:output_type -> controller.api.services.v1.SetRolePrincipalsResponse + 15, // 31: controller.api.services.v1.RoleService.RemoveRolePrincipals:output_type -> controller.api.services.v1.RemoveRolePrincipalsResponse + 17, // 32: controller.api.services.v1.RoleService.AddRoleGrants:output_type -> controller.api.services.v1.AddRoleGrantsResponse + 19, // 33: controller.api.services.v1.RoleService.SetRoleGrants:output_type -> controller.api.services.v1.SetRoleGrantsResponse + 21, // 34: controller.api.services.v1.RoleService.RemoveRoleGrants:output_type -> controller.api.services.v1.RemoveRoleGrantsResponse + 24, // [24:35] is the sub-list for method output_type + 13, // [13:24] is the sub-list for method input_type + 13, // [13:13] is the sub-list for extension type_name + 13, // [13:13] is the sub-list for extension extendee + 0, // [0:13] is the sub-list for field type_name } func init() { file_controller_api_services_v1_role_service_proto_init() } diff --git a/internal/gen/controller/api/services/scope_service.pb.go b/internal/gen/controller/api/services/scope_service.pb.go index 0effbe945..a1f56d849 100644 --- a/internal/gen/controller/api/services/scope_service.pb.go +++ b/internal/gen/controller/api/services/scope_service.pb.go @@ -353,8 +353,9 @@ type UpdateScopeRequest struct { unknownFields protoimpl.UnknownFields Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` - Item *scopes.Scope `protobuf:"bytes,2,opt,name=item,proto3" json:"item,omitempty"` - UpdateMask *field_mask.FieldMask `protobuf:"bytes,3,opt,name=update_mask,json=updateMask,proto3" json:"update_mask,omitempty"` + Version uint32 `protobuf:"varint,2,opt,name=version,proto3" json:"version,omitempty"` + Item *scopes.Scope `protobuf:"bytes,3,opt,name=item,proto3" json:"item,omitempty"` + UpdateMask *field_mask.FieldMask `protobuf:"bytes,4,opt,name=update_mask,json=updateMask,proto3" json:"update_mask,omitempty"` } func (x *UpdateScopeRequest) Reset() { @@ -396,6 +397,13 @@ func (x *UpdateScopeRequest) GetId() string { return "" } +func (x *UpdateScopeRequest) GetVersion() uint32 { + if x != nil { + return x.Version + } + return 0 +} + func (x *UpdateScopeRequest) GetItem() *scopes.Scope { if x != nil { return x.Item @@ -600,88 +608,90 @@ var file_controller_api_services_v1_scope_service_proto_rawDesc = []byte{ 0x65, 0x6d, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x29, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x65, 0x72, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, 0x2e, 0x73, 0x63, 0x6f, 0x70, 0x65, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x63, - 0x6f, 0x70, 0x65, 0x52, 0x04, 0x69, 0x74, 0x65, 0x6d, 0x22, 0xa0, 0x01, 0x0a, 0x12, 0x55, 0x70, + 0x6f, 0x70, 0x65, 0x52, 0x04, 0x69, 0x74, 0x65, 0x6d, 0x22, 0xba, 0x01, 0x0a, 0x12, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x53, 0x63, 0x6f, 0x70, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, - 0x12, 0x3d, 0x0a, 0x04, 0x69, 0x74, 0x65, 0x6d, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x29, + 0x12, 0x18, 0x0a, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, + 0x0d, 0x52, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x3d, 0x0a, 0x04, 0x69, 0x74, + 0x65, 0x6d, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x29, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x72, + 0x6f, 0x6c, 0x6c, 0x65, 0x72, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, + 0x63, 0x65, 0x73, 0x2e, 0x73, 0x63, 0x6f, 0x70, 0x65, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x63, + 0x6f, 0x70, 0x65, 0x52, 0x04, 0x69, 0x74, 0x65, 0x6d, 0x12, 0x3b, 0x0a, 0x0b, 0x75, 0x70, 0x64, + 0x61, 0x74, 0x65, 0x5f, 0x6d, 0x61, 0x73, 0x6b, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, + 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, + 0x2e, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x4d, 0x61, 0x73, 0x6b, 0x52, 0x0a, 0x75, 0x70, 0x64, 0x61, + 0x74, 0x65, 0x4d, 0x61, 0x73, 0x6b, 0x22, 0x54, 0x0a, 0x13, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, + 0x53, 0x63, 0x6f, 0x70, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x3d, 0x0a, + 0x04, 0x69, 0x74, 0x65, 0x6d, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x29, 0x2e, 0x63, 0x6f, + 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x65, 0x72, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x72, 0x65, 0x73, + 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, 0x2e, 0x73, 0x63, 0x6f, 0x70, 0x65, 0x73, 0x2e, 0x76, 0x31, + 0x2e, 0x53, 0x63, 0x6f, 0x70, 0x65, 0x52, 0x04, 0x69, 0x74, 0x65, 0x6d, 0x22, 0x24, 0x0a, 0x12, + 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x53, 0x63, 0x6f, 0x70, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, + 0x73, 0x74, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, + 0x69, 0x64, 0x22, 0x2f, 0x0a, 0x13, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x53, 0x63, 0x6f, 0x70, + 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x65, 0x78, 0x69, + 0x73, 0x74, 0x65, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x52, 0x07, 0x65, 0x78, 0x69, 0x73, + 0x74, 0x65, 0x64, 0x32, 0xe9, 0x06, 0x0a, 0x0c, 0x53, 0x63, 0x6f, 0x70, 0x65, 0x53, 0x65, 0x72, + 0x76, 0x69, 0x63, 0x65, 0x12, 0x9c, 0x01, 0x0a, 0x08, 0x47, 0x65, 0x74, 0x53, 0x63, 0x6f, 0x70, + 0x65, 0x12, 0x2b, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x65, 0x72, 0x2e, 0x61, + 0x70, 0x69, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x47, + 0x65, 0x74, 0x53, 0x63, 0x6f, 0x70, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2c, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x65, 0x72, 0x2e, 0x61, 0x70, 0x69, 0x2e, - 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, 0x2e, 0x73, 0x63, 0x6f, 0x70, 0x65, 0x73, - 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x63, 0x6f, 0x70, 0x65, 0x52, 0x04, 0x69, 0x74, 0x65, 0x6d, 0x12, - 0x3b, 0x0a, 0x0b, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x5f, 0x6d, 0x61, 0x73, 0x6b, 0x18, 0x03, - 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, - 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x4d, 0x61, 0x73, 0x6b, - 0x52, 0x0a, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x4d, 0x61, 0x73, 0x6b, 0x22, 0x54, 0x0a, 0x13, - 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x53, 0x63, 0x6f, 0x70, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, - 0x6e, 0x73, 0x65, 0x12, 0x3d, 0x0a, 0x04, 0x69, 0x74, 0x65, 0x6d, 0x18, 0x01, 0x20, 0x01, 0x28, - 0x0b, 0x32, 0x29, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x65, 0x72, 0x2e, 0x61, - 0x70, 0x69, 0x2e, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, 0x2e, 0x73, 0x63, 0x6f, - 0x70, 0x65, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x63, 0x6f, 0x70, 0x65, 0x52, 0x04, 0x69, 0x74, - 0x65, 0x6d, 0x22, 0x24, 0x0a, 0x12, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x53, 0x63, 0x6f, 0x70, - 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x22, 0x2f, 0x0a, 0x13, 0x44, 0x65, 0x6c, 0x65, - 0x74, 0x65, 0x53, 0x63, 0x6f, 0x70, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, - 0x18, 0x0a, 0x07, 0x65, 0x78, 0x69, 0x73, 0x74, 0x65, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, - 0x52, 0x07, 0x65, 0x78, 0x69, 0x73, 0x74, 0x65, 0x64, 0x32, 0xe9, 0x06, 0x0a, 0x0c, 0x53, 0x63, - 0x6f, 0x70, 0x65, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x9c, 0x01, 0x0a, 0x08, 0x47, - 0x65, 0x74, 0x53, 0x63, 0x6f, 0x70, 0x65, 0x12, 0x2b, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, - 0x6c, 0x6c, 0x65, 0x72, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, - 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x53, 0x63, 0x6f, 0x70, 0x65, 0x52, 0x65, 0x71, - 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2c, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x65, - 0x72, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x2e, 0x76, - 0x31, 0x2e, 0x47, 0x65, 0x74, 0x53, 0x63, 0x6f, 0x70, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, - 0x73, 0x65, 0x22, 0x35, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x17, 0x12, 0x0f, 0x2f, 0x76, 0x31, 0x2f, - 0x73, 0x63, 0x6f, 0x70, 0x65, 0x73, 0x2f, 0x7b, 0x69, 0x64, 0x7d, 0x62, 0x04, 0x69, 0x74, 0x65, - 0x6d, 0x92, 0x41, 0x15, 0x12, 0x13, 0x47, 0x65, 0x74, 0x73, 0x20, 0x61, 0x20, 0x73, 0x69, 0x6e, - 0x67, 0x6c, 0x65, 0x20, 0x53, 0x63, 0x6f, 0x70, 0x65, 0x12, 0xc5, 0x01, 0x0a, 0x0a, 0x4c, 0x69, - 0x73, 0x74, 0x53, 0x63, 0x6f, 0x70, 0x65, 0x73, 0x12, 0x2d, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x72, - 0x6f, 0x6c, 0x6c, 0x65, 0x72, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, - 0x65, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x53, 0x63, 0x6f, 0x70, 0x65, 0x73, - 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2e, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, - 0x6c, 0x6c, 0x65, 0x72, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, - 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x53, 0x63, 0x6f, 0x70, 0x65, 0x73, 0x52, - 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x58, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x0c, 0x12, - 0x0a, 0x2f, 0x76, 0x31, 0x2f, 0x73, 0x63, 0x6f, 0x70, 0x65, 0x73, 0x92, 0x41, 0x43, 0x12, 0x41, - 0x4c, 0x69, 0x73, 0x74, 0x73, 0x20, 0x61, 0x6c, 0x6c, 0x20, 0x53, 0x63, 0x6f, 0x70, 0x65, 0x73, - 0x20, 0x77, 0x69, 0x74, 0x68, 0x69, 0x6e, 0x20, 0x74, 0x68, 0x65, 0x20, 0x73, 0x63, 0x6f, 0x70, - 0x65, 0x20, 0x6f, 0x66, 0x20, 0x74, 0x68, 0x65, 0x20, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x20, 0x6d, - 0x61, 0x6b, 0x69, 0x6e, 0x67, 0x20, 0x74, 0x68, 0x65, 0x20, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, - 0x74, 0x12, 0xa9, 0x01, 0x0a, 0x0b, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x53, 0x63, 0x6f, 0x70, - 0x65, 0x12, 0x2e, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x65, 0x72, 0x2e, 0x61, - 0x70, 0x69, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x43, - 0x72, 0x65, 0x61, 0x74, 0x65, 0x53, 0x63, 0x6f, 0x70, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, - 0x74, 0x1a, 0x2f, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x65, 0x72, 0x2e, 0x61, - 0x70, 0x69, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x43, - 0x72, 0x65, 0x61, 0x74, 0x65, 0x53, 0x63, 0x6f, 0x70, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, - 0x73, 0x65, 0x22, 0x39, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x18, 0x22, 0x0a, 0x2f, 0x76, 0x31, 0x2f, - 0x73, 0x63, 0x6f, 0x70, 0x65, 0x73, 0x3a, 0x04, 0x69, 0x74, 0x65, 0x6d, 0x62, 0x04, 0x69, 0x74, - 0x65, 0x6d, 0x92, 0x41, 0x18, 0x12, 0x16, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x73, 0x20, 0x61, - 0x20, 0x73, 0x69, 0x6e, 0x67, 0x6c, 0x65, 0x20, 0x53, 0x63, 0x6f, 0x70, 0x65, 0x12, 0xa7, 0x01, - 0x0a, 0x0b, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x53, 0x63, 0x6f, 0x70, 0x65, 0x12, 0x2e, 0x2e, - 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x65, 0x72, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x73, - 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, - 0x65, 0x53, 0x63, 0x6f, 0x70, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2f, 0x2e, - 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x65, 0x72, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x73, - 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, - 0x65, 0x53, 0x63, 0x6f, 0x70, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x37, - 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x1d, 0x32, 0x0f, 0x2f, 0x76, 0x31, 0x2f, 0x73, 0x63, 0x6f, 0x70, - 0x65, 0x73, 0x2f, 0x7b, 0x69, 0x64, 0x7d, 0x3a, 0x04, 0x69, 0x74, 0x65, 0x6d, 0x62, 0x04, 0x69, - 0x74, 0x65, 0x6d, 0x92, 0x41, 0x11, 0x12, 0x0f, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x73, 0x20, - 0x61, 0x20, 0x53, 0x63, 0x6f, 0x70, 0x65, 0x12, 0x9b, 0x01, 0x0a, 0x0b, 0x44, 0x65, 0x6c, 0x65, + 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x53, + 0x63, 0x6f, 0x70, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x35, 0x82, 0xd3, + 0xe4, 0x93, 0x02, 0x17, 0x12, 0x0f, 0x2f, 0x76, 0x31, 0x2f, 0x73, 0x63, 0x6f, 0x70, 0x65, 0x73, + 0x2f, 0x7b, 0x69, 0x64, 0x7d, 0x62, 0x04, 0x69, 0x74, 0x65, 0x6d, 0x92, 0x41, 0x15, 0x12, 0x13, + 0x47, 0x65, 0x74, 0x73, 0x20, 0x61, 0x20, 0x73, 0x69, 0x6e, 0x67, 0x6c, 0x65, 0x20, 0x53, 0x63, + 0x6f, 0x70, 0x65, 0x12, 0xc5, 0x01, 0x0a, 0x0a, 0x4c, 0x69, 0x73, 0x74, 0x53, 0x63, 0x6f, 0x70, + 0x65, 0x73, 0x12, 0x2d, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x65, 0x72, 0x2e, + 0x61, 0x70, 0x69, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x2e, 0x76, 0x31, 0x2e, + 0x4c, 0x69, 0x73, 0x74, 0x53, 0x63, 0x6f, 0x70, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, + 0x74, 0x1a, 0x2e, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x65, 0x72, 0x2e, 0x61, + 0x70, 0x69, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x4c, + 0x69, 0x73, 0x74, 0x53, 0x63, 0x6f, 0x70, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, + 0x65, 0x22, 0x58, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x0c, 0x12, 0x0a, 0x2f, 0x76, 0x31, 0x2f, 0x73, + 0x63, 0x6f, 0x70, 0x65, 0x73, 0x92, 0x41, 0x43, 0x12, 0x41, 0x4c, 0x69, 0x73, 0x74, 0x73, 0x20, + 0x61, 0x6c, 0x6c, 0x20, 0x53, 0x63, 0x6f, 0x70, 0x65, 0x73, 0x20, 0x77, 0x69, 0x74, 0x68, 0x69, + 0x6e, 0x20, 0x74, 0x68, 0x65, 0x20, 0x73, 0x63, 0x6f, 0x70, 0x65, 0x20, 0x6f, 0x66, 0x20, 0x74, + 0x68, 0x65, 0x20, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x20, 0x6d, 0x61, 0x6b, 0x69, 0x6e, 0x67, 0x20, + 0x74, 0x68, 0x65, 0x20, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0xa9, 0x01, 0x0a, 0x0b, + 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x53, 0x63, 0x6f, 0x70, 0x65, 0x12, 0x2e, 0x2e, 0x63, 0x6f, + 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x65, 0x72, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x73, 0x65, 0x72, + 0x76, 0x69, 0x63, 0x65, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x53, + 0x63, 0x6f, 0x70, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2f, 0x2e, 0x63, 0x6f, + 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x65, 0x72, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x73, 0x65, 0x72, + 0x76, 0x69, 0x63, 0x65, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x53, + 0x63, 0x6f, 0x70, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x39, 0x82, 0xd3, + 0xe4, 0x93, 0x02, 0x18, 0x22, 0x0a, 0x2f, 0x76, 0x31, 0x2f, 0x73, 0x63, 0x6f, 0x70, 0x65, 0x73, + 0x3a, 0x04, 0x69, 0x74, 0x65, 0x6d, 0x62, 0x04, 0x69, 0x74, 0x65, 0x6d, 0x92, 0x41, 0x18, 0x12, + 0x16, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x73, 0x20, 0x61, 0x20, 0x73, 0x69, 0x6e, 0x67, 0x6c, + 0x65, 0x20, 0x53, 0x63, 0x6f, 0x70, 0x65, 0x12, 0xa7, 0x01, 0x0a, 0x0b, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x53, 0x63, 0x6f, 0x70, 0x65, 0x12, 0x2e, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x65, 0x72, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, - 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x53, 0x63, 0x6f, 0x70, 0x65, + 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x53, 0x63, 0x6f, 0x70, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2f, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x65, 0x72, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, - 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x53, 0x63, 0x6f, 0x70, 0x65, - 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x2b, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x11, - 0x2a, 0x0f, 0x2f, 0x76, 0x31, 0x2f, 0x73, 0x63, 0x6f, 0x70, 0x65, 0x73, 0x2f, 0x7b, 0x69, 0x64, - 0x7d, 0x92, 0x41, 0x11, 0x12, 0x0f, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x73, 0x20, 0x61, 0x20, - 0x53, 0x63, 0x6f, 0x70, 0x65, 0x42, 0x4f, 0x5a, 0x4d, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, - 0x63, 0x6f, 0x6d, 0x2f, 0x68, 0x61, 0x73, 0x68, 0x69, 0x63, 0x6f, 0x72, 0x70, 0x2f, 0x77, 0x61, - 0x74, 0x63, 0x68, 0x74, 0x6f, 0x77, 0x65, 0x72, 0x2f, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x61, - 0x6c, 0x2f, 0x67, 0x65, 0x6e, 0x2f, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x65, 0x72, - 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x3b, 0x73, 0x65, - 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x53, 0x63, 0x6f, 0x70, 0x65, + 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x37, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x1d, + 0x32, 0x0f, 0x2f, 0x76, 0x31, 0x2f, 0x73, 0x63, 0x6f, 0x70, 0x65, 0x73, 0x2f, 0x7b, 0x69, 0x64, + 0x7d, 0x3a, 0x04, 0x69, 0x74, 0x65, 0x6d, 0x62, 0x04, 0x69, 0x74, 0x65, 0x6d, 0x92, 0x41, 0x11, + 0x12, 0x0f, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x73, 0x20, 0x61, 0x20, 0x53, 0x63, 0x6f, 0x70, + 0x65, 0x12, 0x9b, 0x01, 0x0a, 0x0b, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x53, 0x63, 0x6f, 0x70, + 0x65, 0x12, 0x2e, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x65, 0x72, 0x2e, 0x61, + 0x70, 0x69, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x44, + 0x65, 0x6c, 0x65, 0x74, 0x65, 0x53, 0x63, 0x6f, 0x70, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, + 0x74, 0x1a, 0x2f, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x65, 0x72, 0x2e, 0x61, + 0x70, 0x69, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x44, + 0x65, 0x6c, 0x65, 0x74, 0x65, 0x53, 0x63, 0x6f, 0x70, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, + 0x73, 0x65, 0x22, 0x2b, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x11, 0x2a, 0x0f, 0x2f, 0x76, 0x31, 0x2f, + 0x73, 0x63, 0x6f, 0x70, 0x65, 0x73, 0x2f, 0x7b, 0x69, 0x64, 0x7d, 0x92, 0x41, 0x11, 0x12, 0x0f, + 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x73, 0x20, 0x61, 0x20, 0x53, 0x63, 0x6f, 0x70, 0x65, 0x42, + 0x4f, 0x5a, 0x4d, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x68, 0x61, + 0x73, 0x68, 0x69, 0x63, 0x6f, 0x72, 0x70, 0x2f, 0x77, 0x61, 0x74, 0x63, 0x68, 0x74, 0x6f, 0x77, + 0x65, 0x72, 0x2f, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x2f, 0x67, 0x65, 0x6e, 0x2f, + 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x65, 0x72, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x73, + 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x3b, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, + 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( diff --git a/internal/gen/controller/api/services/user_service.pb.go b/internal/gen/controller/api/services/user_service.pb.go index 4077c7b20..e101d8143 100644 --- a/internal/gen/controller/api/services/user_service.pb.go +++ b/internal/gen/controller/api/services/user_service.pb.go @@ -337,8 +337,9 @@ type UpdateUserRequest struct { unknownFields protoimpl.UnknownFields Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` - Item *users.User `protobuf:"bytes,2,opt,name=item,proto3" json:"item,omitempty"` - UpdateMask *field_mask.FieldMask `protobuf:"bytes,3,opt,name=update_mask,json=updateMask,proto3" json:"update_mask,omitempty"` + Version uint32 `protobuf:"varint,2,opt,name=version,proto3" json:"version,omitempty"` + Item *users.User `protobuf:"bytes,3,opt,name=item,proto3" json:"item,omitempty"` + UpdateMask *field_mask.FieldMask `protobuf:"bytes,4,opt,name=update_mask,json=updateMask,proto3" json:"update_mask,omitempty"` } func (x *UpdateUserRequest) Reset() { @@ -380,6 +381,13 @@ func (x *UpdateUserRequest) GetId() string { return "" } +func (x *UpdateUserRequest) GetVersion() uint32 { + if x != nil { + return x.Version + } + return 0 +} + func (x *UpdateUserRequest) GetItem() *users.User { if x != nil { return x.Item @@ -580,86 +588,87 @@ var file_controller_api_services_v1_user_service_proto_rawDesc = []byte{ 0x01, 0x28, 0x0b, 0x32, 0x27, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x65, 0x72, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, 0x2e, 0x75, 0x73, 0x65, 0x72, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x55, 0x73, 0x65, 0x72, 0x52, 0x04, 0x69, 0x74, - 0x65, 0x6d, 0x22, 0x9d, 0x01, 0x0a, 0x11, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x55, 0x73, 0x65, + 0x65, 0x6d, 0x22, 0xb7, 0x01, 0x0a, 0x11, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x55, 0x73, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x3b, 0x0a, 0x04, 0x69, 0x74, 0x65, 0x6d, - 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x27, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, - 0x6c, 0x65, 0x72, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, - 0x73, 0x2e, 0x75, 0x73, 0x65, 0x72, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x55, 0x73, 0x65, 0x72, 0x52, - 0x04, 0x69, 0x74, 0x65, 0x6d, 0x12, 0x3b, 0x0a, 0x0b, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x5f, - 0x6d, 0x61, 0x73, 0x6b, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, - 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x46, 0x69, 0x65, - 0x6c, 0x64, 0x4d, 0x61, 0x73, 0x6b, 0x52, 0x0a, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x4d, 0x61, - 0x73, 0x6b, 0x22, 0x51, 0x0a, 0x12, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x55, 0x73, 0x65, 0x72, - 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x3b, 0x0a, 0x04, 0x69, 0x74, 0x65, 0x6d, - 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x27, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, - 0x6c, 0x65, 0x72, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, - 0x73, 0x2e, 0x75, 0x73, 0x65, 0x72, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x55, 0x73, 0x65, 0x72, 0x52, - 0x04, 0x69, 0x74, 0x65, 0x6d, 0x22, 0x23, 0x0a, 0x11, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x55, - 0x73, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, - 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x22, 0x2e, 0x0a, 0x12, 0x44, 0x65, - 0x6c, 0x65, 0x74, 0x65, 0x55, 0x73, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, - 0x12, 0x18, 0x0a, 0x07, 0x65, 0x78, 0x69, 0x73, 0x74, 0x65, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, - 0x08, 0x52, 0x07, 0x65, 0x78, 0x69, 0x73, 0x74, 0x65, 0x64, 0x32, 0xcb, 0x06, 0x0a, 0x0b, 0x55, - 0x73, 0x65, 0x72, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0xa0, 0x01, 0x0a, 0x07, 0x47, - 0x65, 0x74, 0x55, 0x73, 0x65, 0x72, 0x12, 0x2a, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, - 0x6c, 0x65, 0x72, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, - 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x55, 0x73, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, - 0x73, 0x74, 0x1a, 0x2b, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x65, 0x72, 0x2e, - 0x61, 0x70, 0x69, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x2e, 0x76, 0x31, 0x2e, - 0x47, 0x65, 0x74, 0x55, 0x73, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, - 0x3c, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x1f, 0x12, 0x17, 0x2f, 0x76, 0x31, 0x2f, 0x73, 0x63, 0x6f, - 0x70, 0x65, 0x73, 0x2f, 0x2a, 0x2f, 0x75, 0x73, 0x65, 0x72, 0x73, 0x2f, 0x7b, 0x69, 0x64, 0x7d, - 0x62, 0x04, 0x69, 0x74, 0x65, 0x6d, 0x92, 0x41, 0x14, 0x12, 0x12, 0x47, 0x65, 0x74, 0x73, 0x20, - 0x61, 0x20, 0x73, 0x69, 0x6e, 0x67, 0x6c, 0x65, 0x20, 0x55, 0x73, 0x65, 0x72, 0x12, 0x98, 0x01, - 0x0a, 0x09, 0x4c, 0x69, 0x73, 0x74, 0x55, 0x73, 0x65, 0x72, 0x73, 0x12, 0x2c, 0x2e, 0x63, 0x6f, - 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x65, 0x72, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x73, 0x65, 0x72, - 0x76, 0x69, 0x63, 0x65, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x55, 0x73, 0x65, - 0x72, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2d, 0x2e, 0x63, 0x6f, 0x6e, 0x74, - 0x72, 0x6f, 0x6c, 0x6c, 0x65, 0x72, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, - 0x63, 0x65, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x55, 0x73, 0x65, 0x72, 0x73, - 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x2e, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x14, - 0x12, 0x12, 0x2f, 0x76, 0x31, 0x2f, 0x73, 0x63, 0x6f, 0x70, 0x65, 0x73, 0x2f, 0x2a, 0x2f, 0x75, - 0x73, 0x65, 0x72, 0x73, 0x92, 0x41, 0x11, 0x12, 0x0f, 0x4c, 0x69, 0x73, 0x74, 0x73, 0x20, 0x61, - 0x6c, 0x6c, 0x20, 0x55, 0x73, 0x65, 0x72, 0x73, 0x12, 0xad, 0x01, 0x0a, 0x0a, 0x43, 0x72, 0x65, - 0x61, 0x74, 0x65, 0x55, 0x73, 0x65, 0x72, 0x12, 0x2d, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, - 0x6c, 0x6c, 0x65, 0x72, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, - 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x55, 0x73, 0x65, 0x72, 0x52, - 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2e, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, - 0x6c, 0x65, 0x72, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, - 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x55, 0x73, 0x65, 0x72, 0x52, 0x65, - 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x40, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x20, 0x22, 0x12, - 0x2f, 0x76, 0x31, 0x2f, 0x73, 0x63, 0x6f, 0x70, 0x65, 0x73, 0x2f, 0x2a, 0x2f, 0x75, 0x73, 0x65, - 0x72, 0x73, 0x3a, 0x04, 0x69, 0x74, 0x65, 0x6d, 0x62, 0x04, 0x69, 0x74, 0x65, 0x6d, 0x92, 0x41, - 0x17, 0x12, 0x15, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x73, 0x20, 0x61, 0x20, 0x73, 0x69, 0x6e, - 0x67, 0x6c, 0x65, 0x20, 0x55, 0x73, 0x65, 0x72, 0x12, 0xab, 0x01, 0x0a, 0x0a, 0x55, 0x70, 0x64, - 0x61, 0x74, 0x65, 0x55, 0x73, 0x65, 0x72, 0x12, 0x2d, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, - 0x6c, 0x6c, 0x65, 0x72, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, - 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x55, 0x73, 0x65, 0x72, 0x52, - 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2e, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, - 0x6c, 0x65, 0x72, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, - 0x2e, 0x76, 0x31, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x55, 0x73, 0x65, 0x72, 0x52, 0x65, - 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x3e, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x25, 0x32, 0x17, - 0x2f, 0x76, 0x31, 0x2f, 0x73, 0x63, 0x6f, 0x70, 0x65, 0x73, 0x2f, 0x2a, 0x2f, 0x75, 0x73, 0x65, - 0x72, 0x73, 0x2f, 0x7b, 0x69, 0x64, 0x7d, 0x3a, 0x04, 0x69, 0x74, 0x65, 0x6d, 0x62, 0x04, 0x69, - 0x74, 0x65, 0x6d, 0x92, 0x41, 0x10, 0x12, 0x0e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x73, 0x20, - 0x61, 0x20, 0x55, 0x73, 0x65, 0x72, 0x12, 0x9f, 0x01, 0x0a, 0x0a, 0x44, 0x65, 0x6c, 0x65, 0x74, - 0x65, 0x55, 0x73, 0x65, 0x72, 0x12, 0x2d, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x6c, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x18, 0x0a, 0x07, 0x76, 0x65, 0x72, 0x73, + 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, + 0x6f, 0x6e, 0x12, 0x3b, 0x0a, 0x04, 0x69, 0x74, 0x65, 0x6d, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, + 0x32, 0x27, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x65, 0x72, 0x2e, 0x61, 0x70, + 0x69, 0x2e, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, 0x2e, 0x75, 0x73, 0x65, 0x72, + 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x55, 0x73, 0x65, 0x72, 0x52, 0x04, 0x69, 0x74, 0x65, 0x6d, 0x12, + 0x3b, 0x0a, 0x0b, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x5f, 0x6d, 0x61, 0x73, 0x6b, 0x18, 0x04, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x4d, 0x61, 0x73, 0x6b, + 0x52, 0x0a, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x4d, 0x61, 0x73, 0x6b, 0x22, 0x51, 0x0a, 0x12, + 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x55, 0x73, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, + 0x73, 0x65, 0x12, 0x3b, 0x0a, 0x04, 0x69, 0x74, 0x65, 0x6d, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, + 0x32, 0x27, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x65, 0x72, 0x2e, 0x61, 0x70, + 0x69, 0x2e, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, 0x2e, 0x75, 0x73, 0x65, 0x72, + 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x55, 0x73, 0x65, 0x72, 0x52, 0x04, 0x69, 0x74, 0x65, 0x6d, 0x22, + 0x23, 0x0a, 0x11, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x55, 0x73, 0x65, 0x72, 0x52, 0x65, 0x71, + 0x75, 0x65, 0x73, 0x74, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x02, 0x69, 0x64, 0x22, 0x2e, 0x0a, 0x12, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x55, 0x73, + 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x65, 0x78, + 0x69, 0x73, 0x74, 0x65, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x52, 0x07, 0x65, 0x78, 0x69, + 0x73, 0x74, 0x65, 0x64, 0x32, 0xcb, 0x06, 0x0a, 0x0b, 0x55, 0x73, 0x65, 0x72, 0x53, 0x65, 0x72, + 0x76, 0x69, 0x63, 0x65, 0x12, 0xa0, 0x01, 0x0a, 0x07, 0x47, 0x65, 0x74, 0x55, 0x73, 0x65, 0x72, + 0x12, 0x2a, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x65, 0x72, 0x2e, 0x61, 0x70, + 0x69, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x65, + 0x74, 0x55, 0x73, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2b, 0x2e, 0x63, + 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x65, 0x72, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x73, 0x65, + 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x55, 0x73, 0x65, + 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x3c, 0x82, 0xd3, 0xe4, 0x93, 0x02, + 0x1f, 0x12, 0x17, 0x2f, 0x76, 0x31, 0x2f, 0x73, 0x63, 0x6f, 0x70, 0x65, 0x73, 0x2f, 0x2a, 0x2f, + 0x75, 0x73, 0x65, 0x72, 0x73, 0x2f, 0x7b, 0x69, 0x64, 0x7d, 0x62, 0x04, 0x69, 0x74, 0x65, 0x6d, + 0x92, 0x41, 0x14, 0x12, 0x12, 0x47, 0x65, 0x74, 0x73, 0x20, 0x61, 0x20, 0x73, 0x69, 0x6e, 0x67, + 0x6c, 0x65, 0x20, 0x55, 0x73, 0x65, 0x72, 0x12, 0x98, 0x01, 0x0a, 0x09, 0x4c, 0x69, 0x73, 0x74, + 0x55, 0x73, 0x65, 0x72, 0x73, 0x12, 0x2c, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x65, 0x72, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x2e, - 0x76, 0x31, 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x55, 0x73, 0x65, 0x72, 0x52, 0x65, 0x71, - 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2e, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x65, - 0x72, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x2e, 0x76, - 0x31, 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x55, 0x73, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, - 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x32, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x19, 0x2a, 0x17, 0x2f, 0x76, - 0x31, 0x2f, 0x73, 0x63, 0x6f, 0x70, 0x65, 0x73, 0x2f, 0x2a, 0x2f, 0x75, 0x73, 0x65, 0x72, 0x73, - 0x2f, 0x7b, 0x69, 0x64, 0x7d, 0x92, 0x41, 0x10, 0x12, 0x0e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, - 0x73, 0x20, 0x61, 0x20, 0x55, 0x73, 0x65, 0x72, 0x42, 0x4f, 0x5a, 0x4d, 0x67, 0x69, 0x74, 0x68, - 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x68, 0x61, 0x73, 0x68, 0x69, 0x63, 0x6f, 0x72, 0x70, - 0x2f, 0x77, 0x61, 0x74, 0x63, 0x68, 0x74, 0x6f, 0x77, 0x65, 0x72, 0x2f, 0x69, 0x6e, 0x74, 0x65, - 0x72, 0x6e, 0x61, 0x6c, 0x2f, 0x67, 0x65, 0x6e, 0x2f, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, - 0x6c, 0x65, 0x72, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, - 0x3b, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, - 0x33, + 0x76, 0x31, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x55, 0x73, 0x65, 0x72, 0x73, 0x52, 0x65, 0x71, 0x75, + 0x65, 0x73, 0x74, 0x1a, 0x2d, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x65, 0x72, + 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x2e, 0x76, 0x31, + 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x55, 0x73, 0x65, 0x72, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, + 0x73, 0x65, 0x22, 0x2e, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x14, 0x12, 0x12, 0x2f, 0x76, 0x31, 0x2f, + 0x73, 0x63, 0x6f, 0x70, 0x65, 0x73, 0x2f, 0x2a, 0x2f, 0x75, 0x73, 0x65, 0x72, 0x73, 0x92, 0x41, + 0x11, 0x12, 0x0f, 0x4c, 0x69, 0x73, 0x74, 0x73, 0x20, 0x61, 0x6c, 0x6c, 0x20, 0x55, 0x73, 0x65, + 0x72, 0x73, 0x12, 0xad, 0x01, 0x0a, 0x0a, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x55, 0x73, 0x65, + 0x72, 0x12, 0x2d, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x65, 0x72, 0x2e, 0x61, + 0x70, 0x69, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x43, + 0x72, 0x65, 0x61, 0x74, 0x65, 0x55, 0x73, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, + 0x1a, 0x2e, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x65, 0x72, 0x2e, 0x61, 0x70, + 0x69, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x72, + 0x65, 0x61, 0x74, 0x65, 0x55, 0x73, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, + 0x22, 0x40, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x20, 0x22, 0x12, 0x2f, 0x76, 0x31, 0x2f, 0x73, 0x63, + 0x6f, 0x70, 0x65, 0x73, 0x2f, 0x2a, 0x2f, 0x75, 0x73, 0x65, 0x72, 0x73, 0x3a, 0x04, 0x69, 0x74, + 0x65, 0x6d, 0x62, 0x04, 0x69, 0x74, 0x65, 0x6d, 0x92, 0x41, 0x17, 0x12, 0x15, 0x43, 0x72, 0x65, + 0x61, 0x74, 0x65, 0x73, 0x20, 0x61, 0x20, 0x73, 0x69, 0x6e, 0x67, 0x6c, 0x65, 0x20, 0x55, 0x73, + 0x65, 0x72, 0x12, 0xab, 0x01, 0x0a, 0x0a, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x55, 0x73, 0x65, + 0x72, 0x12, 0x2d, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x65, 0x72, 0x2e, 0x61, + 0x70, 0x69, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x55, + 0x70, 0x64, 0x61, 0x74, 0x65, 0x55, 0x73, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, + 0x1a, 0x2e, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x65, 0x72, 0x2e, 0x61, 0x70, + 0x69, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x55, 0x70, + 0x64, 0x61, 0x74, 0x65, 0x55, 0x73, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, + 0x22, 0x3e, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x25, 0x32, 0x17, 0x2f, 0x76, 0x31, 0x2f, 0x73, 0x63, + 0x6f, 0x70, 0x65, 0x73, 0x2f, 0x2a, 0x2f, 0x75, 0x73, 0x65, 0x72, 0x73, 0x2f, 0x7b, 0x69, 0x64, + 0x7d, 0x3a, 0x04, 0x69, 0x74, 0x65, 0x6d, 0x62, 0x04, 0x69, 0x74, 0x65, 0x6d, 0x92, 0x41, 0x10, + 0x12, 0x0e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x73, 0x20, 0x61, 0x20, 0x55, 0x73, 0x65, 0x72, + 0x12, 0x9f, 0x01, 0x0a, 0x0a, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x55, 0x73, 0x65, 0x72, 0x12, + 0x2d, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x65, 0x72, 0x2e, 0x61, 0x70, 0x69, + 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x44, 0x65, 0x6c, + 0x65, 0x74, 0x65, 0x55, 0x73, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2e, + 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x65, 0x72, 0x2e, 0x61, 0x70, 0x69, 0x2e, + 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x44, 0x65, 0x6c, 0x65, + 0x74, 0x65, 0x55, 0x73, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x32, + 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x19, 0x2a, 0x17, 0x2f, 0x76, 0x31, 0x2f, 0x73, 0x63, 0x6f, 0x70, + 0x65, 0x73, 0x2f, 0x2a, 0x2f, 0x75, 0x73, 0x65, 0x72, 0x73, 0x2f, 0x7b, 0x69, 0x64, 0x7d, 0x92, + 0x41, 0x10, 0x12, 0x0e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x73, 0x20, 0x61, 0x20, 0x55, 0x73, + 0x65, 0x72, 0x42, 0x4f, 0x5a, 0x4d, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, + 0x2f, 0x68, 0x61, 0x73, 0x68, 0x69, 0x63, 0x6f, 0x72, 0x70, 0x2f, 0x77, 0x61, 0x74, 0x63, 0x68, + 0x74, 0x6f, 0x77, 0x65, 0x72, 0x2f, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x2f, 0x67, + 0x65, 0x6e, 0x2f, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x65, 0x72, 0x2f, 0x61, 0x70, + 0x69, 0x2f, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x3b, 0x73, 0x65, 0x72, 0x76, 0x69, + 0x63, 0x65, 0x73, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( diff --git a/internal/gen/controller/protooptions/masks.pb.go b/internal/gen/controller/protooptions/masks.pb.go deleted file mode 100644 index f6a118759..000000000 --- a/internal/gen/controller/protooptions/masks.pb.go +++ /dev/null @@ -1,198 +0,0 @@ -// Code generated by protoc-gen-go. DO NOT EDIT. -// versions: -// protoc-gen-go v1.25.0 -// protoc v3.12.3 -// source: controller/custom_options/v1/masks.proto - -package protooptions - -import ( - proto "github.com/golang/protobuf/proto" - descriptor "github.com/golang/protobuf/protoc-gen-go/descriptor" - protoreflect "google.golang.org/protobuf/reflect/protoreflect" - protoimpl "google.golang.org/protobuf/runtime/protoimpl" - reflect "reflect" - sync "sync" -) - -const ( - // Verify that this generated code is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) - // Verify that runtime/protoimpl is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) -) - -// This is a compile-time assertion that a sufficiently up-to-date version -// of the legacy proto package is being used. -const _ = proto.ProtoPackageIsVersion4 - -type MaskMapping struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - This string `protobuf:"bytes,1,opt,name=this,proto3" json:"this,omitempty"` - That string `protobuf:"bytes,2,opt,name=that,proto3" json:"that,omitempty"` -} - -func (x *MaskMapping) Reset() { - *x = MaskMapping{} - if protoimpl.UnsafeEnabled { - mi := &file_controller_custom_options_v1_masks_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *MaskMapping) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*MaskMapping) ProtoMessage() {} - -func (x *MaskMapping) ProtoReflect() protoreflect.Message { - mi := &file_controller_custom_options_v1_masks_proto_msgTypes[0] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use MaskMapping.ProtoReflect.Descriptor instead. -func (*MaskMapping) Descriptor() ([]byte, []int) { - return file_controller_custom_options_v1_masks_proto_rawDescGZIP(), []int{0} -} - -func (x *MaskMapping) GetThis() string { - if x != nil { - return x.This - } - return "" -} - -func (x *MaskMapping) GetThat() string { - if x != nil { - return x.That - } - return "" -} - -var file_controller_custom_options_v1_masks_proto_extTypes = []protoimpl.ExtensionInfo{ - { - ExtendedType: (*descriptor.FieldOptions)(nil), - ExtensionType: (*MaskMapping)(nil), - Field: 85464, - Name: "controller.custom_options.v1.mask_mapping", - Tag: "bytes,85464,opt,name=mask_mapping", - Filename: "controller/custom_options/v1/masks.proto", - }, -} - -// Extension fields to descriptor.FieldOptions. -var ( - // mask_mapping is an option which tags a field with the expected field mask used by a companion proto if applied - // on the field this option is for. The value of this option should be for the field name itself and not for - // the json name. - // - // optional controller.custom_options.v1.MaskMapping mask_mapping = 85464; - E_MaskMapping = &file_controller_custom_options_v1_masks_proto_extTypes[0] -) - -var File_controller_custom_options_v1_masks_proto protoreflect.FileDescriptor - -var file_controller_custom_options_v1_masks_proto_rawDesc = []byte{ - 0x0a, 0x28, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x65, 0x72, 0x2f, 0x63, 0x75, 0x73, - 0x74, 0x6f, 0x6d, 0x5f, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2f, 0x76, 0x31, 0x2f, 0x6d, - 0x61, 0x73, 0x6b, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x1c, 0x63, 0x6f, 0x6e, 0x74, - 0x72, 0x6f, 0x6c, 0x6c, 0x65, 0x72, 0x2e, 0x63, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x5f, 0x6f, 0x70, - 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x76, 0x31, 0x1a, 0x20, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, - 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, - 0x70, 0x74, 0x6f, 0x72, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x35, 0x0a, 0x0b, 0x4d, 0x61, - 0x73, 0x6b, 0x4d, 0x61, 0x70, 0x70, 0x69, 0x6e, 0x67, 0x12, 0x12, 0x0a, 0x04, 0x74, 0x68, 0x69, - 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x74, 0x68, 0x69, 0x73, 0x12, 0x12, 0x0a, - 0x04, 0x74, 0x68, 0x61, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x74, 0x68, 0x61, - 0x74, 0x3a, 0x6d, 0x0a, 0x0c, 0x6d, 0x61, 0x73, 0x6b, 0x5f, 0x6d, 0x61, 0x70, 0x70, 0x69, 0x6e, - 0x67, 0x12, 0x1d, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, - 0x62, 0x75, 0x66, 0x2e, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, - 0x18, 0xd8, 0x9b, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x29, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x72, - 0x6f, 0x6c, 0x6c, 0x65, 0x72, 0x2e, 0x63, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x5f, 0x6f, 0x70, 0x74, - 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x61, 0x73, 0x6b, 0x4d, 0x61, 0x70, 0x70, - 0x69, 0x6e, 0x67, 0x52, 0x0b, 0x6d, 0x61, 0x73, 0x6b, 0x4d, 0x61, 0x70, 0x70, 0x69, 0x6e, 0x67, - 0x42, 0x53, 0x5a, 0x51, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x68, - 0x61, 0x73, 0x68, 0x69, 0x63, 0x6f, 0x72, 0x70, 0x2f, 0x77, 0x61, 0x74, 0x63, 0x68, 0x74, 0x6f, - 0x77, 0x65, 0x72, 0x2f, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x2f, 0x67, 0x65, 0x6e, - 0x2f, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x65, 0x72, 0x2f, 0x70, 0x72, 0x6f, 0x74, - 0x6f, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x3b, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x6f, 0x70, - 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, -} - -var ( - file_controller_custom_options_v1_masks_proto_rawDescOnce sync.Once - file_controller_custom_options_v1_masks_proto_rawDescData = file_controller_custom_options_v1_masks_proto_rawDesc -) - -func file_controller_custom_options_v1_masks_proto_rawDescGZIP() []byte { - file_controller_custom_options_v1_masks_proto_rawDescOnce.Do(func() { - file_controller_custom_options_v1_masks_proto_rawDescData = protoimpl.X.CompressGZIP(file_controller_custom_options_v1_masks_proto_rawDescData) - }) - return file_controller_custom_options_v1_masks_proto_rawDescData -} - -var file_controller_custom_options_v1_masks_proto_msgTypes = make([]protoimpl.MessageInfo, 1) -var file_controller_custom_options_v1_masks_proto_goTypes = []interface{}{ - (*MaskMapping)(nil), // 0: controller.custom_options.v1.MaskMapping - (*descriptor.FieldOptions)(nil), // 1: google.protobuf.FieldOptions -} -var file_controller_custom_options_v1_masks_proto_depIdxs = []int32{ - 1, // 0: controller.custom_options.v1.mask_mapping:extendee -> google.protobuf.FieldOptions - 0, // 1: controller.custom_options.v1.mask_mapping:type_name -> controller.custom_options.v1.MaskMapping - 2, // [2:2] is the sub-list for method output_type - 2, // [2:2] is the sub-list for method input_type - 1, // [1:2] is the sub-list for extension type_name - 0, // [0:1] is the sub-list for extension extendee - 0, // [0:0] is the sub-list for field type_name -} - -func init() { file_controller_custom_options_v1_masks_proto_init() } -func file_controller_custom_options_v1_masks_proto_init() { - if File_controller_custom_options_v1_masks_proto != nil { - return - } - if !protoimpl.UnsafeEnabled { - file_controller_custom_options_v1_masks_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*MaskMapping); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - } - type x struct{} - out := protoimpl.TypeBuilder{ - File: protoimpl.DescBuilder{ - GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: file_controller_custom_options_v1_masks_proto_rawDesc, - NumEnums: 0, - NumMessages: 1, - NumExtensions: 1, - NumServices: 0, - }, - GoTypes: file_controller_custom_options_v1_masks_proto_goTypes, - DependencyIndexes: file_controller_custom_options_v1_masks_proto_depIdxs, - MessageInfos: file_controller_custom_options_v1_masks_proto_msgTypes, - ExtensionInfos: file_controller_custom_options_v1_masks_proto_extTypes, - }.Build() - File_controller_custom_options_v1_masks_proto = out.File - file_controller_custom_options_v1_masks_proto_rawDesc = nil - file_controller_custom_options_v1_masks_proto_goTypes = nil - file_controller_custom_options_v1_masks_proto_depIdxs = nil -} diff --git a/internal/gen/controller/protooptions/options.pb.go b/internal/gen/controller/protooptions/options.pb.go new file mode 100644 index 000000000..7dec18cac --- /dev/null +++ b/internal/gen/controller/protooptions/options.pb.go @@ -0,0 +1,218 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.25.0 +// protoc v3.12.3 +// source: controller/custom_options/v1/options.proto + +package protooptions + +import ( + proto "github.com/golang/protobuf/proto" + descriptor "github.com/golang/protobuf/protoc-gen-go/descriptor" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + reflect "reflect" + sync "sync" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +// This is a compile-time assertion that a sufficiently up-to-date version +// of the legacy proto package is being used. +const _ = proto.ProtoPackageIsVersion4 + +type MaskMapping struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + This string `protobuf:"bytes,1,opt,name=this,proto3" json:"this,omitempty"` + That string `protobuf:"bytes,2,opt,name=that,proto3" json:"that,omitempty"` +} + +func (x *MaskMapping) Reset() { + *x = MaskMapping{} + if protoimpl.UnsafeEnabled { + mi := &file_controller_custom_options_v1_options_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *MaskMapping) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*MaskMapping) ProtoMessage() {} + +func (x *MaskMapping) ProtoReflect() protoreflect.Message { + mi := &file_controller_custom_options_v1_options_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use MaskMapping.ProtoReflect.Descriptor instead. +func (*MaskMapping) Descriptor() ([]byte, []int) { + return file_controller_custom_options_v1_options_proto_rawDescGZIP(), []int{0} +} + +func (x *MaskMapping) GetThis() string { + if x != nil { + return x.This + } + return "" +} + +func (x *MaskMapping) GetThat() string { + if x != nil { + return x.That + } + return "" +} + +var file_controller_custom_options_v1_options_proto_extTypes = []protoimpl.ExtensionInfo{ + { + ExtendedType: (*descriptor.FieldOptions)(nil), + ExtensionType: (*MaskMapping)(nil), + Field: 85464, + Name: "controller.custom_options.v1.mask_mapping", + Tag: "bytes,85464,opt,name=mask_mapping", + Filename: "controller/custom_options/v1/options.proto", + }, + { + ExtendedType: (*descriptor.FieldOptions)(nil), + ExtensionType: (*bool)(nil), + Field: 85412, + Name: "controller.custom_options.v1.generate_sdk_option", + Tag: "varint,85412,opt,name=generate_sdk_option", + Filename: "controller/custom_options/v1/options.proto", + }, +} + +// Extension fields to descriptor.FieldOptions. +var ( + // mask_mapping is an option which tags a field with the expected field mask + // used by a companion proto if applied on the field this option is for. + // The value of this option should be for the field name itself and not for + // the json name. + // + // optional controller.custom_options.v1.MaskMapping mask_mapping = 85464; + E_MaskMapping = &file_controller_custom_options_v1_options_proto_extTypes[0] + // generate_sdk_option is a directive used when generating the SDK to + // indicate that an option should be created for the field + // + // optional bool generate_sdk_option = 85412; + E_GenerateSdkOption = &file_controller_custom_options_v1_options_proto_extTypes[1] +) + +var File_controller_custom_options_v1_options_proto protoreflect.FileDescriptor + +var file_controller_custom_options_v1_options_proto_rawDesc = []byte{ + 0x0a, 0x2a, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x65, 0x72, 0x2f, 0x63, 0x75, 0x73, + 0x74, 0x6f, 0x6d, 0x5f, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2f, 0x76, 0x31, 0x2f, 0x6f, + 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x1c, 0x63, 0x6f, + 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x65, 0x72, 0x2e, 0x63, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x5f, + 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x76, 0x31, 0x1a, 0x20, 0x67, 0x6f, 0x6f, 0x67, + 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x64, 0x65, 0x73, 0x63, + 0x72, 0x69, 0x70, 0x74, 0x6f, 0x72, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x35, 0x0a, 0x0b, + 0x4d, 0x61, 0x73, 0x6b, 0x4d, 0x61, 0x70, 0x70, 0x69, 0x6e, 0x67, 0x12, 0x12, 0x0a, 0x04, 0x74, + 0x68, 0x69, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x74, 0x68, 0x69, 0x73, 0x12, + 0x12, 0x0a, 0x04, 0x74, 0x68, 0x61, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x74, + 0x68, 0x61, 0x74, 0x3a, 0x6d, 0x0a, 0x0c, 0x6d, 0x61, 0x73, 0x6b, 0x5f, 0x6d, 0x61, 0x70, 0x70, + 0x69, 0x6e, 0x67, 0x12, 0x1d, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x4f, 0x70, 0x74, 0x69, 0x6f, + 0x6e, 0x73, 0x18, 0xd8, 0x9b, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x29, 0x2e, 0x63, 0x6f, 0x6e, + 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x65, 0x72, 0x2e, 0x63, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x5f, 0x6f, + 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x61, 0x73, 0x6b, 0x4d, 0x61, + 0x70, 0x70, 0x69, 0x6e, 0x67, 0x52, 0x0b, 0x6d, 0x61, 0x73, 0x6b, 0x4d, 0x61, 0x70, 0x70, 0x69, + 0x6e, 0x67, 0x3a, 0x4f, 0x0a, 0x13, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x65, 0x5f, 0x73, + 0x64, 0x6b, 0x5f, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x1d, 0x2e, 0x67, 0x6f, 0x6f, 0x67, + 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x46, 0x69, 0x65, 0x6c, + 0x64, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0xa4, 0x9b, 0x05, 0x20, 0x01, 0x28, 0x08, + 0x52, 0x11, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x65, 0x53, 0x64, 0x6b, 0x4f, 0x70, 0x74, + 0x69, 0x6f, 0x6e, 0x42, 0x53, 0x5a, 0x51, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, + 0x6d, 0x2f, 0x68, 0x61, 0x73, 0x68, 0x69, 0x63, 0x6f, 0x72, 0x70, 0x2f, 0x77, 0x61, 0x74, 0x63, + 0x68, 0x74, 0x6f, 0x77, 0x65, 0x72, 0x2f, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x2f, + 0x67, 0x65, 0x6e, 0x2f, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x65, 0x72, 0x2f, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x3b, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_controller_custom_options_v1_options_proto_rawDescOnce sync.Once + file_controller_custom_options_v1_options_proto_rawDescData = file_controller_custom_options_v1_options_proto_rawDesc +) + +func file_controller_custom_options_v1_options_proto_rawDescGZIP() []byte { + file_controller_custom_options_v1_options_proto_rawDescOnce.Do(func() { + file_controller_custom_options_v1_options_proto_rawDescData = protoimpl.X.CompressGZIP(file_controller_custom_options_v1_options_proto_rawDescData) + }) + return file_controller_custom_options_v1_options_proto_rawDescData +} + +var file_controller_custom_options_v1_options_proto_msgTypes = make([]protoimpl.MessageInfo, 1) +var file_controller_custom_options_v1_options_proto_goTypes = []interface{}{ + (*MaskMapping)(nil), // 0: controller.custom_options.v1.MaskMapping + (*descriptor.FieldOptions)(nil), // 1: google.protobuf.FieldOptions +} +var file_controller_custom_options_v1_options_proto_depIdxs = []int32{ + 1, // 0: controller.custom_options.v1.mask_mapping:extendee -> google.protobuf.FieldOptions + 1, // 1: controller.custom_options.v1.generate_sdk_option:extendee -> google.protobuf.FieldOptions + 0, // 2: controller.custom_options.v1.mask_mapping:type_name -> controller.custom_options.v1.MaskMapping + 3, // [3:3] is the sub-list for method output_type + 3, // [3:3] is the sub-list for method input_type + 2, // [2:3] is the sub-list for extension type_name + 0, // [0:2] is the sub-list for extension extendee + 0, // [0:0] is the sub-list for field type_name +} + +func init() { file_controller_custom_options_v1_options_proto_init() } +func file_controller_custom_options_v1_options_proto_init() { + if File_controller_custom_options_v1_options_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_controller_custom_options_v1_options_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*MaskMapping); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_controller_custom_options_v1_options_proto_rawDesc, + NumEnums: 0, + NumMessages: 1, + NumExtensions: 2, + NumServices: 0, + }, + GoTypes: file_controller_custom_options_v1_options_proto_goTypes, + DependencyIndexes: file_controller_custom_options_v1_options_proto_depIdxs, + MessageInfos: file_controller_custom_options_v1_options_proto_msgTypes, + ExtensionInfos: file_controller_custom_options_v1_options_proto_extTypes, + }.Build() + File_controller_custom_options_v1_options_proto = out.File + file_controller_custom_options_v1_options_proto_rawDesc = nil + file_controller_custom_options_v1_options_proto_goTypes = nil + file_controller_custom_options_v1_options_proto_depIdxs = nil +} diff --git a/internal/gen/controller/protooptions/testing.pb.go b/internal/gen/controller/protooptions/testing.pb.go index c0a029808..b7da67cd9 100644 --- a/internal/gen/controller/protooptions/testing.pb.go +++ b/internal/gen/controller/protooptions/testing.pb.go @@ -372,109 +372,110 @@ var file_controller_custom_options_v1_testing_proto_rawDesc = []byte{ 0x74, 0x6f, 0x6d, 0x5f, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2f, 0x76, 0x31, 0x2f, 0x74, 0x65, 0x73, 0x74, 0x69, 0x6e, 0x67, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x1c, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x65, 0x72, 0x2e, 0x63, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x5f, - 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x76, 0x31, 0x1a, 0x28, 0x63, 0x6f, 0x6e, 0x74, + 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x76, 0x31, 0x1a, 0x2a, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x65, 0x72, 0x2f, 0x63, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x5f, 0x6f, 0x70, - 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2f, 0x76, 0x31, 0x2f, 0x6d, 0x61, 0x73, 0x6b, 0x73, 0x2e, 0x70, - 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xa4, 0x02, 0x0a, 0x08, 0x54, 0x65, 0x73, 0x74, 0x42, 0x61, 0x73, - 0x65, 0x12, 0x43, 0x0a, 0x0b, 0x66, 0x69, 0x72, 0x73, 0x74, 0x5f, 0x66, 0x69, 0x65, 0x6c, 0x64, - 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x22, 0xc2, 0xdd, 0x29, 0x1e, 0x0a, 0x0b, 0x66, 0x69, - 0x72, 0x73, 0x74, 0x5f, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x12, 0x0f, 0x4f, 0x74, 0x68, 0x65, 0x72, - 0x46, 0x69, 0x72, 0x73, 0x74, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x52, 0x0a, 0x66, 0x69, 0x72, 0x73, - 0x74, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x12, 0x62, 0x0a, 0x12, 0x53, 0x74, 0x72, 0x61, 0x6e, 0x67, - 0x65, 0x46, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x18, 0x02, 0x20, 0x01, - 0x28, 0x09, 0x42, 0x32, 0xc2, 0xdd, 0x29, 0x2e, 0x0a, 0x18, 0x73, 0x74, 0x72, 0x61, 0x6e, 0x67, - 0x6c, 0x79, 0x5f, 0x66, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x74, 0x65, 0x64, 0x5f, 0x66, 0x69, 0x65, - 0x6c, 0x64, 0x12, 0x12, 0x6f, 0x74, 0x68, 0x65, 0x72, 0x5f, 0x73, 0x65, 0x63, 0x6f, 0x6e, 0x64, - 0x5f, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x52, 0x12, 0x53, 0x74, 0x72, 0x61, 0x6e, 0x67, 0x65, 0x46, - 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x12, 0x4e, 0x0a, 0x1e, 0x66, 0x69, - 0x65, 0x6c, 0x64, 0x5f, 0x77, 0x69, 0x74, 0x68, 0x5f, 0x64, 0x69, 0x66, 0x66, 0x65, 0x72, 0x65, - 0x6e, 0x74, 0x5f, 0x6a, 0x73, 0x6f, 0x6e, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x03, 0x20, 0x01, - 0x28, 0x09, 0x42, 0x1b, 0xc2, 0xdd, 0x29, 0x17, 0x0a, 0x06, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x33, - 0x12, 0x0d, 0x6f, 0x74, 0x68, 0x65, 0x72, 0x5f, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x5f, 0x33, 0x52, - 0x09, 0x6a, 0x73, 0x6f, 0x6e, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x1f, 0x0a, 0x0b, 0x65, 0x78, - 0x74, 0x72, 0x61, 0x5f, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x0a, 0x65, 0x78, 0x74, 0x72, 0x61, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x22, 0xc6, 0x02, 0x0a, 0x17, - 0x54, 0x65, 0x73, 0x74, 0x50, 0x72, 0x6f, 0x70, 0x65, 0x72, 0x6c, 0x79, 0x4e, 0x61, 0x6d, 0x65, - 0x64, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x73, 0x12, 0x4e, 0x0a, 0x11, 0x6f, 0x74, 0x68, 0x65, 0x72, - 0x5f, 0x66, 0x69, 0x72, 0x73, 0x74, 0x5f, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x18, 0x01, 0x20, 0x01, - 0x28, 0x09, 0x42, 0x22, 0xc2, 0xdd, 0x29, 0x1e, 0x0a, 0x0f, 0x4f, 0x74, 0x68, 0x65, 0x72, 0x46, - 0x69, 0x72, 0x73, 0x74, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x12, 0x0b, 0x66, 0x69, 0x72, 0x73, 0x74, - 0x5f, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x52, 0x0f, 0x6f, 0x74, 0x68, 0x65, 0x72, 0x46, 0x69, 0x72, - 0x73, 0x74, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x12, 0x60, 0x0a, 0x12, 0x6f, 0x74, 0x68, 0x65, 0x72, - 0x5f, 0x73, 0x65, 0x63, 0x6f, 0x6e, 0x64, 0x5f, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x18, 0x02, 0x20, - 0x01, 0x28, 0x09, 0x42, 0x32, 0xc2, 0xdd, 0x29, 0x2e, 0x0a, 0x12, 0x6f, 0x74, 0x68, 0x65, 0x72, - 0x5f, 0x73, 0x65, 0x63, 0x6f, 0x6e, 0x64, 0x5f, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x12, 0x18, 0x73, - 0x74, 0x72, 0x61, 0x6e, 0x67, 0x6c, 0x79, 0x5f, 0x66, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x74, 0x65, - 0x64, 0x5f, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x52, 0x10, 0x6f, 0x74, 0x68, 0x65, 0x72, 0x53, 0x65, - 0x63, 0x6f, 0x6e, 0x64, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x12, 0x49, 0x0a, 0x11, 0x6f, 0x74, 0x68, - 0x65, 0x72, 0x5f, 0x74, 0x68, 0x69, 0x72, 0x64, 0x5f, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x18, 0x03, - 0x20, 0x01, 0x28, 0x09, 0x42, 0x1b, 0xc2, 0xdd, 0x29, 0x17, 0x0a, 0x0d, 0x6f, 0x74, 0x68, 0x65, - 0x72, 0x5f, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x5f, 0x33, 0x12, 0x06, 0x66, 0x69, 0x65, 0x6c, 0x64, - 0x33, 0x52, 0x11, 0x6f, 0x74, 0x68, 0x65, 0x72, 0x5f, 0x74, 0x68, 0x69, 0x72, 0x64, 0x5f, 0x66, - 0x69, 0x65, 0x6c, 0x64, 0x12, 0x2e, 0x0a, 0x13, 0x61, 0x6e, 0x6f, 0x74, 0x68, 0x65, 0x72, 0x5f, + 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2f, 0x76, 0x31, 0x2f, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, + 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xa4, 0x02, 0x0a, 0x08, 0x54, 0x65, 0x73, 0x74, 0x42, + 0x61, 0x73, 0x65, 0x12, 0x43, 0x0a, 0x0b, 0x66, 0x69, 0x72, 0x73, 0x74, 0x5f, 0x66, 0x69, 0x65, + 0x6c, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x22, 0xc2, 0xdd, 0x29, 0x1e, 0x0a, 0x0b, + 0x66, 0x69, 0x72, 0x73, 0x74, 0x5f, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x12, 0x0f, 0x4f, 0x74, 0x68, + 0x65, 0x72, 0x46, 0x69, 0x72, 0x73, 0x74, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x52, 0x0a, 0x66, 0x69, + 0x72, 0x73, 0x74, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x12, 0x62, 0x0a, 0x12, 0x53, 0x74, 0x72, 0x61, + 0x6e, 0x67, 0x65, 0x46, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x18, 0x02, + 0x20, 0x01, 0x28, 0x09, 0x42, 0x32, 0xc2, 0xdd, 0x29, 0x2e, 0x0a, 0x18, 0x73, 0x74, 0x72, 0x61, + 0x6e, 0x67, 0x6c, 0x79, 0x5f, 0x66, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x74, 0x65, 0x64, 0x5f, 0x66, + 0x69, 0x65, 0x6c, 0x64, 0x12, 0x12, 0x6f, 0x74, 0x68, 0x65, 0x72, 0x5f, 0x73, 0x65, 0x63, 0x6f, + 0x6e, 0x64, 0x5f, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x52, 0x12, 0x53, 0x74, 0x72, 0x61, 0x6e, 0x67, + 0x65, 0x46, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x12, 0x4e, 0x0a, 0x1e, + 0x66, 0x69, 0x65, 0x6c, 0x64, 0x5f, 0x77, 0x69, 0x74, 0x68, 0x5f, 0x64, 0x69, 0x66, 0x66, 0x65, + 0x72, 0x65, 0x6e, 0x74, 0x5f, 0x6a, 0x73, 0x6f, 0x6e, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x03, + 0x20, 0x01, 0x28, 0x09, 0x42, 0x1b, 0xc2, 0xdd, 0x29, 0x17, 0x0a, 0x06, 0x66, 0x69, 0x65, 0x6c, + 0x64, 0x33, 0x12, 0x0d, 0x6f, 0x74, 0x68, 0x65, 0x72, 0x5f, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x5f, + 0x33, 0x52, 0x09, 0x6a, 0x73, 0x6f, 0x6e, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x1f, 0x0a, 0x0b, 0x65, 0x78, 0x74, 0x72, 0x61, 0x5f, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x11, 0x61, 0x6e, 0x6f, 0x74, 0x68, 0x65, 0x72, 0x45, 0x78, 0x74, 0x72, 0x61, 0x46, - 0x69, 0x65, 0x6c, 0x64, 0x22, 0xcd, 0x02, 0x0a, 0x11, 0x54, 0x65, 0x73, 0x74, 0x4e, 0x61, 0x6d, - 0x65, 0x44, 0x6f, 0x65, 0x73, 0x6e, 0x74, 0x4d, 0x61, 0x70, 0x12, 0x4d, 0x0a, 0x10, 0x66, 0x69, - 0x72, 0x73, 0x74, 0x5f, 0x64, 0x6f, 0x65, 0x73, 0x6e, 0x74, 0x5f, 0x6d, 0x61, 0x70, 0x18, 0x01, - 0x20, 0x01, 0x28, 0x09, 0x42, 0x23, 0xc2, 0xdd, 0x29, 0x1f, 0x0a, 0x10, 0x66, 0x69, 0x72, 0x73, - 0x74, 0x5f, 0x64, 0x6f, 0x65, 0x73, 0x6e, 0x74, 0x5f, 0x6d, 0x61, 0x70, 0x12, 0x0b, 0x66, 0x69, - 0x72, 0x73, 0x74, 0x5f, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x52, 0x0e, 0x66, 0x69, 0x72, 0x73, 0x74, - 0x44, 0x6f, 0x65, 0x73, 0x6e, 0x74, 0x4d, 0x61, 0x70, 0x12, 0x57, 0x0a, 0x11, 0x73, 0x65, 0x63, - 0x6f, 0x6e, 0x64, 0x5f, 0x64, 0x6f, 0x65, 0x73, 0x6e, 0x74, 0x5f, 0x6d, 0x61, 0x70, 0x18, 0x02, - 0x20, 0x01, 0x28, 0x09, 0x42, 0x2b, 0xc2, 0xdd, 0x29, 0x27, 0x0a, 0x11, 0x73, 0x65, 0x63, 0x6f, - 0x6e, 0x64, 0x5f, 0x64, 0x6f, 0x65, 0x73, 0x6e, 0x74, 0x5f, 0x6d, 0x61, 0x70, 0x12, 0x12, 0x53, - 0x74, 0x72, 0x61, 0x6e, 0x67, 0x65, 0x46, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x46, 0x69, 0x65, 0x6c, - 0x64, 0x52, 0x0f, 0x73, 0x65, 0x63, 0x6f, 0x6e, 0x64, 0x44, 0x6f, 0x65, 0x73, 0x6e, 0x74, 0x4d, - 0x61, 0x70, 0x12, 0x60, 0x0a, 0x10, 0x74, 0x68, 0x69, 0x72, 0x64, 0x5f, 0x64, 0x6f, 0x65, 0x73, - 0x6e, 0x74, 0x5f, 0x6d, 0x61, 0x70, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x42, 0x36, 0xc2, 0xdd, - 0x29, 0x32, 0x0a, 0x10, 0x74, 0x68, 0x69, 0x72, 0x64, 0x5f, 0x64, 0x6f, 0x65, 0x73, 0x6e, 0x74, - 0x5f, 0x6d, 0x61, 0x70, 0x12, 0x1e, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x5f, 0x77, 0x69, 0x74, 0x68, - 0x5f, 0x64, 0x69, 0x66, 0x66, 0x65, 0x72, 0x65, 0x6e, 0x74, 0x5f, 0x6a, 0x73, 0x6f, 0x6e, 0x5f, - 0x6e, 0x61, 0x6d, 0x65, 0x52, 0x0e, 0x74, 0x68, 0x69, 0x72, 0x64, 0x44, 0x6f, 0x65, 0x73, 0x6e, - 0x74, 0x4d, 0x61, 0x70, 0x12, 0x2e, 0x0a, 0x13, 0x61, 0x6e, 0x6f, 0x74, 0x68, 0x65, 0x72, 0x5f, - 0x65, 0x78, 0x74, 0x72, 0x61, 0x5f, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x11, 0x61, 0x6e, 0x6f, 0x74, 0x68, 0x65, 0x72, 0x45, 0x78, 0x74, 0x72, 0x61, 0x46, - 0x69, 0x65, 0x6c, 0x64, 0x22, 0xc7, 0x01, 0x0a, 0x13, 0x54, 0x65, 0x73, 0x74, 0x4e, 0x6f, 0x74, - 0x45, 0x6e, 0x6f, 0x75, 0x67, 0x68, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x73, 0x12, 0x4e, 0x0a, 0x11, - 0x6f, 0x74, 0x68, 0x65, 0x72, 0x5f, 0x66, 0x69, 0x72, 0x73, 0x74, 0x5f, 0x66, 0x69, 0x65, 0x6c, - 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x22, 0xc2, 0xdd, 0x29, 0x1e, 0x0a, 0x0f, 0x4f, - 0x74, 0x68, 0x65, 0x72, 0x46, 0x69, 0x72, 0x73, 0x74, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x12, 0x0b, - 0x66, 0x69, 0x72, 0x73, 0x74, 0x5f, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x52, 0x0f, 0x6f, 0x74, 0x68, - 0x65, 0x72, 0x46, 0x69, 0x72, 0x73, 0x74, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x12, 0x60, 0x0a, 0x12, - 0x6f, 0x74, 0x68, 0x65, 0x72, 0x5f, 0x73, 0x65, 0x63, 0x6f, 0x6e, 0x64, 0x5f, 0x66, 0x69, 0x65, - 0x6c, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x42, 0x32, 0xc2, 0xdd, 0x29, 0x2e, 0x0a, 0x12, - 0x6f, 0x74, 0x68, 0x65, 0x72, 0x5f, 0x73, 0x65, 0x63, 0x6f, 0x6e, 0x64, 0x5f, 0x66, 0x69, 0x65, - 0x6c, 0x64, 0x12, 0x18, 0x73, 0x74, 0x72, 0x61, 0x6e, 0x67, 0x6c, 0x79, 0x5f, 0x66, 0x6f, 0x72, - 0x6d, 0x61, 0x74, 0x74, 0x65, 0x64, 0x5f, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x52, 0x10, 0x6f, 0x74, - 0x68, 0x65, 0x72, 0x53, 0x65, 0x63, 0x6f, 0x6e, 0x64, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x22, 0xd2, - 0x02, 0x0a, 0x15, 0x54, 0x65, 0x73, 0x74, 0x4d, 0x61, 0x6e, 0x79, 0x54, 0x6f, 0x4f, 0x6e, 0x65, - 0x4d, 0x61, 0x70, 0x70, 0x69, 0x6e, 0x67, 0x73, 0x12, 0x4e, 0x0a, 0x11, 0x6f, 0x74, 0x68, 0x65, - 0x72, 0x5f, 0x66, 0x69, 0x72, 0x73, 0x74, 0x5f, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x18, 0x01, 0x20, - 0x01, 0x28, 0x09, 0x42, 0x22, 0xc2, 0xdd, 0x29, 0x1e, 0x0a, 0x0f, 0x4f, 0x74, 0x68, 0x65, 0x72, - 0x46, 0x69, 0x72, 0x73, 0x74, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x12, 0x0b, 0x66, 0x69, 0x72, 0x73, - 0x74, 0x5f, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x52, 0x0f, 0x6f, 0x74, 0x68, 0x65, 0x72, 0x46, 0x69, - 0x72, 0x73, 0x74, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x12, 0x60, 0x0a, 0x12, 0x6f, 0x74, 0x68, 0x65, - 0x72, 0x5f, 0x73, 0x65, 0x63, 0x6f, 0x6e, 0x64, 0x5f, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x18, 0x02, - 0x20, 0x01, 0x28, 0x09, 0x42, 0x32, 0xc2, 0xdd, 0x29, 0x2e, 0x0a, 0x12, 0x6f, 0x74, 0x68, 0x65, - 0x72, 0x5f, 0x73, 0x65, 0x63, 0x6f, 0x6e, 0x64, 0x5f, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x12, 0x18, - 0x73, 0x74, 0x72, 0x61, 0x6e, 0x67, 0x6c, 0x79, 0x5f, 0x66, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x74, - 0x65, 0x64, 0x5f, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x52, 0x10, 0x6f, 0x74, 0x68, 0x65, 0x72, 0x53, - 0x65, 0x63, 0x6f, 0x6e, 0x64, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x12, 0x47, 0x0a, 0x11, 0x6f, 0x74, - 0x68, 0x65, 0x72, 0x5f, 0x74, 0x68, 0x69, 0x72, 0x64, 0x5f, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x18, - 0x03, 0x20, 0x01, 0x28, 0x09, 0x42, 0x1b, 0xc2, 0xdd, 0x29, 0x17, 0x0a, 0x0d, 0x6f, 0x74, 0x68, - 0x65, 0x72, 0x5f, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x5f, 0x33, 0x12, 0x06, 0x66, 0x69, 0x65, 0x6c, - 0x64, 0x33, 0x52, 0x0f, 0x6f, 0x74, 0x68, 0x65, 0x72, 0x54, 0x68, 0x69, 0x72, 0x64, 0x46, 0x69, - 0x65, 0x6c, 0x64, 0x12, 0x3e, 0x0a, 0x0b, 0x65, 0x78, 0x74, 0x72, 0x61, 0x5f, 0x66, 0x69, 0x65, - 0x6c, 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x42, 0x1d, 0xc2, 0xdd, 0x29, 0x19, 0x0a, 0x0a, - 0x45, 0x78, 0x74, 0x72, 0x61, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x12, 0x0b, 0x66, 0x69, 0x72, 0x73, - 0x74, 0x5f, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x52, 0x0a, 0x65, 0x78, 0x74, 0x72, 0x61, 0x46, 0x69, - 0x65, 0x6c, 0x64, 0x42, 0x53, 0x5a, 0x51, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, - 0x6d, 0x2f, 0x68, 0x61, 0x73, 0x68, 0x69, 0x63, 0x6f, 0x72, 0x70, 0x2f, 0x77, 0x61, 0x74, 0x63, - 0x68, 0x74, 0x6f, 0x77, 0x65, 0x72, 0x2f, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x2f, - 0x67, 0x65, 0x6e, 0x2f, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x65, 0x72, 0x2f, 0x70, - 0x72, 0x6f, 0x74, 0x6f, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x3b, 0x70, 0x72, 0x6f, 0x74, - 0x6f, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x09, 0x52, 0x0a, 0x65, 0x78, 0x74, 0x72, 0x61, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x22, 0xc6, 0x02, + 0x0a, 0x17, 0x54, 0x65, 0x73, 0x74, 0x50, 0x72, 0x6f, 0x70, 0x65, 0x72, 0x6c, 0x79, 0x4e, 0x61, + 0x6d, 0x65, 0x64, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x73, 0x12, 0x4e, 0x0a, 0x11, 0x6f, 0x74, 0x68, + 0x65, 0x72, 0x5f, 0x66, 0x69, 0x72, 0x73, 0x74, 0x5f, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x09, 0x42, 0x22, 0xc2, 0xdd, 0x29, 0x1e, 0x0a, 0x0f, 0x4f, 0x74, 0x68, 0x65, + 0x72, 0x46, 0x69, 0x72, 0x73, 0x74, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x12, 0x0b, 0x66, 0x69, 0x72, + 0x73, 0x74, 0x5f, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x52, 0x0f, 0x6f, 0x74, 0x68, 0x65, 0x72, 0x46, + 0x69, 0x72, 0x73, 0x74, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x12, 0x60, 0x0a, 0x12, 0x6f, 0x74, 0x68, + 0x65, 0x72, 0x5f, 0x73, 0x65, 0x63, 0x6f, 0x6e, 0x64, 0x5f, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x18, + 0x02, 0x20, 0x01, 0x28, 0x09, 0x42, 0x32, 0xc2, 0xdd, 0x29, 0x2e, 0x0a, 0x12, 0x6f, 0x74, 0x68, + 0x65, 0x72, 0x5f, 0x73, 0x65, 0x63, 0x6f, 0x6e, 0x64, 0x5f, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x12, + 0x18, 0x73, 0x74, 0x72, 0x61, 0x6e, 0x67, 0x6c, 0x79, 0x5f, 0x66, 0x6f, 0x72, 0x6d, 0x61, 0x74, + 0x74, 0x65, 0x64, 0x5f, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x52, 0x10, 0x6f, 0x74, 0x68, 0x65, 0x72, + 0x53, 0x65, 0x63, 0x6f, 0x6e, 0x64, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x12, 0x49, 0x0a, 0x11, 0x6f, + 0x74, 0x68, 0x65, 0x72, 0x5f, 0x74, 0x68, 0x69, 0x72, 0x64, 0x5f, 0x66, 0x69, 0x65, 0x6c, 0x64, + 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x42, 0x1b, 0xc2, 0xdd, 0x29, 0x17, 0x0a, 0x0d, 0x6f, 0x74, + 0x68, 0x65, 0x72, 0x5f, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x5f, 0x33, 0x12, 0x06, 0x66, 0x69, 0x65, + 0x6c, 0x64, 0x33, 0x52, 0x11, 0x6f, 0x74, 0x68, 0x65, 0x72, 0x5f, 0x74, 0x68, 0x69, 0x72, 0x64, + 0x5f, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x12, 0x2e, 0x0a, 0x13, 0x61, 0x6e, 0x6f, 0x74, 0x68, 0x65, + 0x72, 0x5f, 0x65, 0x78, 0x74, 0x72, 0x61, 0x5f, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x18, 0x04, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x11, 0x61, 0x6e, 0x6f, 0x74, 0x68, 0x65, 0x72, 0x45, 0x78, 0x74, 0x72, + 0x61, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x22, 0xcd, 0x02, 0x0a, 0x11, 0x54, 0x65, 0x73, 0x74, 0x4e, + 0x61, 0x6d, 0x65, 0x44, 0x6f, 0x65, 0x73, 0x6e, 0x74, 0x4d, 0x61, 0x70, 0x12, 0x4d, 0x0a, 0x10, + 0x66, 0x69, 0x72, 0x73, 0x74, 0x5f, 0x64, 0x6f, 0x65, 0x73, 0x6e, 0x74, 0x5f, 0x6d, 0x61, 0x70, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x23, 0xc2, 0xdd, 0x29, 0x1f, 0x0a, 0x10, 0x66, 0x69, + 0x72, 0x73, 0x74, 0x5f, 0x64, 0x6f, 0x65, 0x73, 0x6e, 0x74, 0x5f, 0x6d, 0x61, 0x70, 0x12, 0x0b, + 0x66, 0x69, 0x72, 0x73, 0x74, 0x5f, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x52, 0x0e, 0x66, 0x69, 0x72, + 0x73, 0x74, 0x44, 0x6f, 0x65, 0x73, 0x6e, 0x74, 0x4d, 0x61, 0x70, 0x12, 0x57, 0x0a, 0x11, 0x73, + 0x65, 0x63, 0x6f, 0x6e, 0x64, 0x5f, 0x64, 0x6f, 0x65, 0x73, 0x6e, 0x74, 0x5f, 0x6d, 0x61, 0x70, + 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x42, 0x2b, 0xc2, 0xdd, 0x29, 0x27, 0x0a, 0x11, 0x73, 0x65, + 0x63, 0x6f, 0x6e, 0x64, 0x5f, 0x64, 0x6f, 0x65, 0x73, 0x6e, 0x74, 0x5f, 0x6d, 0x61, 0x70, 0x12, + 0x12, 0x53, 0x74, 0x72, 0x61, 0x6e, 0x67, 0x65, 0x46, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x46, 0x69, + 0x65, 0x6c, 0x64, 0x52, 0x0f, 0x73, 0x65, 0x63, 0x6f, 0x6e, 0x64, 0x44, 0x6f, 0x65, 0x73, 0x6e, + 0x74, 0x4d, 0x61, 0x70, 0x12, 0x60, 0x0a, 0x10, 0x74, 0x68, 0x69, 0x72, 0x64, 0x5f, 0x64, 0x6f, + 0x65, 0x73, 0x6e, 0x74, 0x5f, 0x6d, 0x61, 0x70, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x42, 0x36, + 0xc2, 0xdd, 0x29, 0x32, 0x0a, 0x10, 0x74, 0x68, 0x69, 0x72, 0x64, 0x5f, 0x64, 0x6f, 0x65, 0x73, + 0x6e, 0x74, 0x5f, 0x6d, 0x61, 0x70, 0x12, 0x1e, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x5f, 0x77, 0x69, + 0x74, 0x68, 0x5f, 0x64, 0x69, 0x66, 0x66, 0x65, 0x72, 0x65, 0x6e, 0x74, 0x5f, 0x6a, 0x73, 0x6f, + 0x6e, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x52, 0x0e, 0x74, 0x68, 0x69, 0x72, 0x64, 0x44, 0x6f, 0x65, + 0x73, 0x6e, 0x74, 0x4d, 0x61, 0x70, 0x12, 0x2e, 0x0a, 0x13, 0x61, 0x6e, 0x6f, 0x74, 0x68, 0x65, + 0x72, 0x5f, 0x65, 0x78, 0x74, 0x72, 0x61, 0x5f, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x18, 0x04, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x11, 0x61, 0x6e, 0x6f, 0x74, 0x68, 0x65, 0x72, 0x45, 0x78, 0x74, 0x72, + 0x61, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x22, 0xc7, 0x01, 0x0a, 0x13, 0x54, 0x65, 0x73, 0x74, 0x4e, + 0x6f, 0x74, 0x45, 0x6e, 0x6f, 0x75, 0x67, 0x68, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x73, 0x12, 0x4e, + 0x0a, 0x11, 0x6f, 0x74, 0x68, 0x65, 0x72, 0x5f, 0x66, 0x69, 0x72, 0x73, 0x74, 0x5f, 0x66, 0x69, + 0x65, 0x6c, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x22, 0xc2, 0xdd, 0x29, 0x1e, 0x0a, + 0x0f, 0x4f, 0x74, 0x68, 0x65, 0x72, 0x46, 0x69, 0x72, 0x73, 0x74, 0x46, 0x69, 0x65, 0x6c, 0x64, + 0x12, 0x0b, 0x66, 0x69, 0x72, 0x73, 0x74, 0x5f, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x52, 0x0f, 0x6f, + 0x74, 0x68, 0x65, 0x72, 0x46, 0x69, 0x72, 0x73, 0x74, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x12, 0x60, + 0x0a, 0x12, 0x6f, 0x74, 0x68, 0x65, 0x72, 0x5f, 0x73, 0x65, 0x63, 0x6f, 0x6e, 0x64, 0x5f, 0x66, + 0x69, 0x65, 0x6c, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x42, 0x32, 0xc2, 0xdd, 0x29, 0x2e, + 0x0a, 0x12, 0x6f, 0x74, 0x68, 0x65, 0x72, 0x5f, 0x73, 0x65, 0x63, 0x6f, 0x6e, 0x64, 0x5f, 0x66, + 0x69, 0x65, 0x6c, 0x64, 0x12, 0x18, 0x73, 0x74, 0x72, 0x61, 0x6e, 0x67, 0x6c, 0x79, 0x5f, 0x66, + 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x74, 0x65, 0x64, 0x5f, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x52, 0x10, + 0x6f, 0x74, 0x68, 0x65, 0x72, 0x53, 0x65, 0x63, 0x6f, 0x6e, 0x64, 0x46, 0x69, 0x65, 0x6c, 0x64, + 0x22, 0xd2, 0x02, 0x0a, 0x15, 0x54, 0x65, 0x73, 0x74, 0x4d, 0x61, 0x6e, 0x79, 0x54, 0x6f, 0x4f, + 0x6e, 0x65, 0x4d, 0x61, 0x70, 0x70, 0x69, 0x6e, 0x67, 0x73, 0x12, 0x4e, 0x0a, 0x11, 0x6f, 0x74, + 0x68, 0x65, 0x72, 0x5f, 0x66, 0x69, 0x72, 0x73, 0x74, 0x5f, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x22, 0xc2, 0xdd, 0x29, 0x1e, 0x0a, 0x0f, 0x4f, 0x74, 0x68, + 0x65, 0x72, 0x46, 0x69, 0x72, 0x73, 0x74, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x12, 0x0b, 0x66, 0x69, + 0x72, 0x73, 0x74, 0x5f, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x52, 0x0f, 0x6f, 0x74, 0x68, 0x65, 0x72, + 0x46, 0x69, 0x72, 0x73, 0x74, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x12, 0x60, 0x0a, 0x12, 0x6f, 0x74, + 0x68, 0x65, 0x72, 0x5f, 0x73, 0x65, 0x63, 0x6f, 0x6e, 0x64, 0x5f, 0x66, 0x69, 0x65, 0x6c, 0x64, + 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x42, 0x32, 0xc2, 0xdd, 0x29, 0x2e, 0x0a, 0x12, 0x6f, 0x74, + 0x68, 0x65, 0x72, 0x5f, 0x73, 0x65, 0x63, 0x6f, 0x6e, 0x64, 0x5f, 0x66, 0x69, 0x65, 0x6c, 0x64, + 0x12, 0x18, 0x73, 0x74, 0x72, 0x61, 0x6e, 0x67, 0x6c, 0x79, 0x5f, 0x66, 0x6f, 0x72, 0x6d, 0x61, + 0x74, 0x74, 0x65, 0x64, 0x5f, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x52, 0x10, 0x6f, 0x74, 0x68, 0x65, + 0x72, 0x53, 0x65, 0x63, 0x6f, 0x6e, 0x64, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x12, 0x47, 0x0a, 0x11, + 0x6f, 0x74, 0x68, 0x65, 0x72, 0x5f, 0x74, 0x68, 0x69, 0x72, 0x64, 0x5f, 0x66, 0x69, 0x65, 0x6c, + 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x42, 0x1b, 0xc2, 0xdd, 0x29, 0x17, 0x0a, 0x0d, 0x6f, + 0x74, 0x68, 0x65, 0x72, 0x5f, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x5f, 0x33, 0x12, 0x06, 0x66, 0x69, + 0x65, 0x6c, 0x64, 0x33, 0x52, 0x0f, 0x6f, 0x74, 0x68, 0x65, 0x72, 0x54, 0x68, 0x69, 0x72, 0x64, + 0x46, 0x69, 0x65, 0x6c, 0x64, 0x12, 0x3e, 0x0a, 0x0b, 0x65, 0x78, 0x74, 0x72, 0x61, 0x5f, 0x66, + 0x69, 0x65, 0x6c, 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x42, 0x1d, 0xc2, 0xdd, 0x29, 0x19, + 0x0a, 0x0a, 0x45, 0x78, 0x74, 0x72, 0x61, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x12, 0x0b, 0x66, 0x69, + 0x72, 0x73, 0x74, 0x5f, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x52, 0x0a, 0x65, 0x78, 0x74, 0x72, 0x61, + 0x46, 0x69, 0x65, 0x6c, 0x64, 0x42, 0x53, 0x5a, 0x51, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, + 0x63, 0x6f, 0x6d, 0x2f, 0x68, 0x61, 0x73, 0x68, 0x69, 0x63, 0x6f, 0x72, 0x70, 0x2f, 0x77, 0x61, + 0x74, 0x63, 0x68, 0x74, 0x6f, 0x77, 0x65, 0x72, 0x2f, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x61, + 0x6c, 0x2f, 0x67, 0x65, 0x6e, 0x2f, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x65, 0x72, + 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x3b, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x33, } var ( @@ -510,7 +511,7 @@ func file_controller_custom_options_v1_testing_proto_init() { if File_controller_custom_options_v1_testing_proto != nil { return } - file_controller_custom_options_v1_masks_proto_init() + file_controller_custom_options_v1_options_proto_init() if !protoimpl.UnsafeEnabled { file_controller_custom_options_v1_testing_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*TestBase); i { diff --git a/internal/host/static/store/static.pb.go b/internal/host/static/store/static.pb.go index e377c9846..76ac1bf10 100644 --- a/internal/host/static/store/static.pb.go +++ b/internal/host/static/store/static.pb.go @@ -411,80 +411,80 @@ var file_controller_storage_host_static_store_v1_static_proto_rawDesc = []byte{ 0x2f, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x65, 0x72, 0x2f, 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x2f, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x2f, 0x76, 0x31, 0x2f, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, - 0x1a, 0x28, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x65, 0x72, 0x2f, 0x63, 0x75, 0x73, - 0x74, 0x6f, 0x6d, 0x5f, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2f, 0x76, 0x31, 0x2f, 0x6d, - 0x61, 0x73, 0x6b, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xc7, 0x02, 0x0a, 0x0b, 0x48, - 0x6f, 0x73, 0x74, 0x43, 0x61, 0x74, 0x61, 0x6c, 0x6f, 0x67, 0x12, 0x1b, 0x0a, 0x09, 0x70, 0x75, - 0x62, 0x6c, 0x69, 0x63, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x70, - 0x75, 0x62, 0x6c, 0x69, 0x63, 0x49, 0x64, 0x12, 0x4b, 0x0a, 0x0b, 0x63, 0x72, 0x65, 0x61, 0x74, - 0x65, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2a, 0x2e, 0x63, - 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x65, 0x72, 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, - 0x65, 0x2e, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x2e, 0x76, 0x31, 0x2e, 0x54, - 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x0a, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, - 0x54, 0x69, 0x6d, 0x65, 0x12, 0x4b, 0x0a, 0x0b, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x5f, 0x74, - 0x69, 0x6d, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2a, 0x2e, 0x63, 0x6f, 0x6e, 0x74, + 0x1a, 0x2a, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x65, 0x72, 0x2f, 0x63, 0x75, 0x73, + 0x74, 0x6f, 0x6d, 0x5f, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2f, 0x76, 0x31, 0x2f, 0x6f, + 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xc7, 0x02, 0x0a, + 0x0b, 0x48, 0x6f, 0x73, 0x74, 0x43, 0x61, 0x74, 0x61, 0x6c, 0x6f, 0x67, 0x12, 0x1b, 0x0a, 0x09, + 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x08, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x49, 0x64, 0x12, 0x4b, 0x0a, 0x0b, 0x63, 0x72, 0x65, + 0x61, 0x74, 0x65, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2a, + 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x65, 0x72, 0x2e, 0x73, 0x74, 0x6f, 0x72, + 0x61, 0x67, 0x65, 0x2e, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x2e, 0x76, 0x31, + 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x0a, 0x63, 0x72, 0x65, 0x61, + 0x74, 0x65, 0x54, 0x69, 0x6d, 0x65, 0x12, 0x4b, 0x0a, 0x0b, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, + 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2a, 0x2e, 0x63, 0x6f, + 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x65, 0x72, 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, + 0x2e, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x2e, 0x76, 0x31, 0x2e, 0x54, 0x69, + 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x0a, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x54, + 0x69, 0x6d, 0x65, 0x12, 0x24, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, + 0x09, 0x42, 0x10, 0xc2, 0xdd, 0x29, 0x0c, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x04, 0x6e, + 0x61, 0x6d, 0x65, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x40, 0x0a, 0x0b, 0x64, 0x65, 0x73, + 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x42, 0x1e, + 0xc2, 0xdd, 0x29, 0x1a, 0x0a, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, + 0x6e, 0x12, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x0b, + 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x19, 0x0a, 0x08, 0x73, + 0x63, 0x6f, 0x70, 0x65, 0x5f, 0x69, 0x64, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x73, + 0x63, 0x6f, 0x70, 0x65, 0x49, 0x64, 0x22, 0xc2, 0x02, 0x0a, 0x04, 0x48, 0x6f, 0x73, 0x74, 0x12, + 0x1b, 0x0a, 0x09, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x08, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x49, 0x64, 0x12, 0x4b, 0x0a, 0x0b, + 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, + 0x0b, 0x32, 0x2a, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x65, 0x72, 0x2e, 0x73, + 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x2e, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, + 0x2e, 0x76, 0x31, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x0a, 0x63, + 0x72, 0x65, 0x61, 0x74, 0x65, 0x54, 0x69, 0x6d, 0x65, 0x12, 0x4b, 0x0a, 0x0b, 0x75, 0x70, 0x64, + 0x61, 0x74, 0x65, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2a, + 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x65, 0x72, 0x2e, 0x73, 0x74, 0x6f, 0x72, + 0x61, 0x67, 0x65, 0x2e, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x2e, 0x76, 0x31, + 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x0a, 0x75, 0x70, 0x64, 0x61, + 0x74, 0x65, 0x54, 0x69, 0x6d, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x04, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x20, 0x0a, 0x0b, 0x64, 0x65, + 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x33, 0x0a, 0x16, + 0x73, 0x74, 0x61, 0x74, 0x69, 0x63, 0x5f, 0x68, 0x6f, 0x73, 0x74, 0x5f, 0x63, 0x61, 0x74, 0x61, + 0x6c, 0x6f, 0x67, 0x5f, 0x69, 0x64, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x13, 0x73, 0x74, + 0x61, 0x74, 0x69, 0x63, 0x48, 0x6f, 0x73, 0x74, 0x43, 0x61, 0x74, 0x61, 0x6c, 0x6f, 0x67, 0x49, + 0x64, 0x12, 0x18, 0x0a, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x07, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x22, 0xab, 0x02, 0x0a, 0x07, + 0x48, 0x6f, 0x73, 0x74, 0x53, 0x65, 0x74, 0x12, 0x1b, 0x0a, 0x09, 0x70, 0x75, 0x62, 0x6c, 0x69, + 0x63, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x70, 0x75, 0x62, 0x6c, + 0x69, 0x63, 0x49, 0x64, 0x12, 0x4b, 0x0a, 0x0b, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x5f, 0x74, + 0x69, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2a, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x65, 0x72, 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x2e, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x2e, 0x76, 0x31, 0x2e, 0x54, 0x69, 0x6d, 0x65, - 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x0a, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x54, 0x69, 0x6d, - 0x65, 0x12, 0x24, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x42, - 0x10, 0xc2, 0xdd, 0x29, 0x0c, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x04, 0x6e, 0x61, 0x6d, - 0x65, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x40, 0x0a, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, - 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x42, 0x1e, 0xc2, 0xdd, - 0x29, 0x1a, 0x0a, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x12, - 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x0b, 0x64, 0x65, - 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x19, 0x0a, 0x08, 0x73, 0x63, 0x6f, - 0x70, 0x65, 0x5f, 0x69, 0x64, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x73, 0x63, 0x6f, - 0x70, 0x65, 0x49, 0x64, 0x22, 0xc2, 0x02, 0x0a, 0x04, 0x48, 0x6f, 0x73, 0x74, 0x12, 0x1b, 0x0a, - 0x09, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, - 0x52, 0x08, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x49, 0x64, 0x12, 0x4b, 0x0a, 0x0b, 0x63, 0x72, - 0x65, 0x61, 0x74, 0x65, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, - 0x2a, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x65, 0x72, 0x2e, 0x73, 0x74, 0x6f, - 0x72, 0x61, 0x67, 0x65, 0x2e, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x2e, 0x76, - 0x31, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x0a, 0x63, 0x72, 0x65, - 0x61, 0x74, 0x65, 0x54, 0x69, 0x6d, 0x65, 0x12, 0x4b, 0x0a, 0x0b, 0x75, 0x70, 0x64, 0x61, 0x74, - 0x65, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2a, 0x2e, 0x63, - 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x65, 0x72, 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, - 0x65, 0x2e, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x2e, 0x76, 0x31, 0x2e, 0x54, - 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x0a, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, - 0x54, 0x69, 0x6d, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x04, 0x20, 0x01, - 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x20, 0x0a, 0x0b, 0x64, 0x65, 0x73, 0x63, - 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x64, - 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x33, 0x0a, 0x16, 0x73, 0x74, - 0x61, 0x74, 0x69, 0x63, 0x5f, 0x68, 0x6f, 0x73, 0x74, 0x5f, 0x63, 0x61, 0x74, 0x61, 0x6c, 0x6f, - 0x67, 0x5f, 0x69, 0x64, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x13, 0x73, 0x74, 0x61, 0x74, - 0x69, 0x63, 0x48, 0x6f, 0x73, 0x74, 0x43, 0x61, 0x74, 0x61, 0x6c, 0x6f, 0x67, 0x49, 0x64, 0x12, - 0x18, 0x0a, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x07, 0x20, 0x01, 0x28, 0x09, - 0x52, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x22, 0xab, 0x02, 0x0a, 0x07, 0x48, 0x6f, - 0x73, 0x74, 0x53, 0x65, 0x74, 0x12, 0x1b, 0x0a, 0x09, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x5f, - 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, - 0x49, 0x64, 0x12, 0x4b, 0x0a, 0x0b, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x5f, 0x74, 0x69, 0x6d, - 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2a, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, - 0x6c, 0x6c, 0x65, 0x72, 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x2e, 0x74, 0x69, 0x6d, - 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x2e, 0x76, 0x31, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, - 0x61, 0x6d, 0x70, 0x52, 0x0a, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x54, 0x69, 0x6d, 0x65, 0x12, - 0x4b, 0x0a, 0x0b, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x03, - 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2a, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x65, - 0x72, 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x2e, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, - 0x61, 0x6d, 0x70, 0x2e, 0x76, 0x31, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, - 0x52, 0x0a, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x54, 0x69, 0x6d, 0x65, 0x12, 0x12, 0x0a, 0x04, - 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, - 0x12, 0x20, 0x0a, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x18, - 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, - 0x6f, 0x6e, 0x12, 0x33, 0x0a, 0x16, 0x73, 0x74, 0x61, 0x74, 0x69, 0x63, 0x5f, 0x68, 0x6f, 0x73, - 0x74, 0x5f, 0x63, 0x61, 0x74, 0x61, 0x6c, 0x6f, 0x67, 0x5f, 0x69, 0x64, 0x18, 0x06, 0x20, 0x01, - 0x28, 0x09, 0x52, 0x13, 0x73, 0x74, 0x61, 0x74, 0x69, 0x63, 0x48, 0x6f, 0x73, 0x74, 0x43, 0x61, - 0x74, 0x61, 0x6c, 0x6f, 0x67, 0x49, 0x64, 0x22, 0x62, 0x0a, 0x0d, 0x48, 0x6f, 0x73, 0x74, 0x53, - 0x65, 0x74, 0x4d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x12, 0x2b, 0x0a, 0x12, 0x73, 0x74, 0x61, 0x74, - 0x69, 0x63, 0x5f, 0x68, 0x6f, 0x73, 0x74, 0x5f, 0x73, 0x65, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x01, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x0f, 0x73, 0x74, 0x61, 0x74, 0x69, 0x63, 0x48, 0x6f, 0x73, 0x74, - 0x53, 0x65, 0x74, 0x49, 0x64, 0x12, 0x24, 0x0a, 0x0e, 0x73, 0x74, 0x61, 0x74, 0x69, 0x63, 0x5f, - 0x68, 0x6f, 0x73, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x73, - 0x74, 0x61, 0x74, 0x69, 0x63, 0x48, 0x6f, 0x73, 0x74, 0x49, 0x64, 0x42, 0x42, 0x5a, 0x40, 0x67, - 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x68, 0x61, 0x73, 0x68, 0x69, 0x63, - 0x6f, 0x72, 0x70, 0x2f, 0x77, 0x61, 0x74, 0x63, 0x68, 0x74, 0x6f, 0x77, 0x65, 0x72, 0x2f, 0x69, - 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x2f, 0x68, 0x6f, 0x73, 0x74, 0x2f, 0x73, 0x74, 0x61, - 0x74, 0x69, 0x63, 0x2f, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x3b, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x62, - 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x0a, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x54, 0x69, 0x6d, + 0x65, 0x12, 0x4b, 0x0a, 0x0b, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x5f, 0x74, 0x69, 0x6d, 0x65, + 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2a, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, + 0x6c, 0x65, 0x72, 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x2e, 0x74, 0x69, 0x6d, 0x65, + 0x73, 0x74, 0x61, 0x6d, 0x70, 0x2e, 0x76, 0x31, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, + 0x6d, 0x70, 0x52, 0x0a, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x54, 0x69, 0x6d, 0x65, 0x12, 0x12, + 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, + 0x6d, 0x65, 0x12, 0x20, 0x0a, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, + 0x6e, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, + 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x33, 0x0a, 0x16, 0x73, 0x74, 0x61, 0x74, 0x69, 0x63, 0x5f, 0x68, + 0x6f, 0x73, 0x74, 0x5f, 0x63, 0x61, 0x74, 0x61, 0x6c, 0x6f, 0x67, 0x5f, 0x69, 0x64, 0x18, 0x06, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x13, 0x73, 0x74, 0x61, 0x74, 0x69, 0x63, 0x48, 0x6f, 0x73, 0x74, + 0x43, 0x61, 0x74, 0x61, 0x6c, 0x6f, 0x67, 0x49, 0x64, 0x22, 0x62, 0x0a, 0x0d, 0x48, 0x6f, 0x73, + 0x74, 0x53, 0x65, 0x74, 0x4d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x12, 0x2b, 0x0a, 0x12, 0x73, 0x74, + 0x61, 0x74, 0x69, 0x63, 0x5f, 0x68, 0x6f, 0x73, 0x74, 0x5f, 0x73, 0x65, 0x74, 0x5f, 0x69, 0x64, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0f, 0x73, 0x74, 0x61, 0x74, 0x69, 0x63, 0x48, 0x6f, + 0x73, 0x74, 0x53, 0x65, 0x74, 0x49, 0x64, 0x12, 0x24, 0x0a, 0x0e, 0x73, 0x74, 0x61, 0x74, 0x69, + 0x63, 0x5f, 0x68, 0x6f, 0x73, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x0c, 0x73, 0x74, 0x61, 0x74, 0x69, 0x63, 0x48, 0x6f, 0x73, 0x74, 0x49, 0x64, 0x42, 0x42, 0x5a, + 0x40, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x68, 0x61, 0x73, 0x68, + 0x69, 0x63, 0x6f, 0x72, 0x70, 0x2f, 0x77, 0x61, 0x74, 0x63, 0x68, 0x74, 0x6f, 0x77, 0x65, 0x72, + 0x2f, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x2f, 0x68, 0x6f, 0x73, 0x74, 0x2f, 0x73, + 0x74, 0x61, 0x74, 0x69, 0x63, 0x2f, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x3b, 0x73, 0x74, 0x6f, 0x72, + 0x65, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( diff --git a/internal/iam/auth_account.go b/internal/iam/auth_account.go index 552521350..3ab8133be 100644 --- a/internal/iam/auth_account.go +++ b/internal/iam/auth_account.go @@ -22,7 +22,7 @@ type AuthAccount struct { tableName string `gorm:"-"` } -var _ Clonable = (*AuthAccount)(nil) +var _ Cloneable = (*AuthAccount)(nil) var _ db.VetForWriter = (*AuthAccount)(nil) var _ oplog.ReplayableMessage = (*AuthAccount)(nil) diff --git a/internal/iam/group.go b/internal/iam/group.go index ea3fbb1a8..b274bbccd 100644 --- a/internal/iam/group.go +++ b/internal/iam/group.go @@ -22,9 +22,9 @@ type Group struct { tableName string `gorm:"-"` } -// ensure that Group implements the interfaces of: Resource, Clonable, and db.VetForWriter. +// ensure that Group implements the interfaces of: Resource, Cloneable, and db.VetForWriter. var _ Resource = (*Group)(nil) -var _ Clonable = (*Group)(nil) +var _ Cloneable = (*Group)(nil) var _ db.VetForWriter = (*Group)(nil) // NewGroup creates a new in memory group with a scope (project/org) diff --git a/internal/iam/group_member.go b/internal/iam/group_member.go index 8c523a9d0..b941ff426 100644 --- a/internal/iam/group_member.go +++ b/internal/iam/group_member.go @@ -60,8 +60,8 @@ type GroupMemberUser struct { tableName string `gorm:"-"` } -// ensure that GroupMember implements the interfaces of: Clonable, db.VetForWriter -var _ Clonable = (*GroupMemberUser)(nil) +// ensure that GroupMember implements the interfaces of: Cloneable, db.VetForWriter +var _ Cloneable = (*GroupMemberUser)(nil) var _ db.VetForWriter = (*GroupMemberUser)(nil) // NewGroupMemberUser creates a new in memory user member of the group. No diff --git a/internal/iam/principal_role.go b/internal/iam/principal_role.go index 7a131e19f..fbbf69d7d 100644 --- a/internal/iam/principal_role.go +++ b/internal/iam/principal_role.go @@ -65,9 +65,9 @@ type UserRole struct { tableName string `gorm:"-"` } -// ensure that UserRole implements the interfaces of: Clonable and +// ensure that UserRole implements the interfaces of: Cloneable and // db.VetForWriter -var _ Clonable = (*UserRole)(nil) +var _ Cloneable = (*UserRole)(nil) var _ db.VetForWriter = (*UserRole)(nil) // NewUserRole creates a new user role in memory. No options are supported @@ -138,9 +138,9 @@ type GroupRole struct { tableName string `gorm:"-"` } -// ensure that GroupRole implements the interfaces of: Clonable and +// ensure that GroupRole implements the interfaces of: Cloneable and // db.VetForWriter -var _ Clonable = (*GroupRole)(nil) +var _ Cloneable = (*GroupRole)(nil) var _ db.VetForWriter = (*GroupRole)(nil) // NewGroupRole creates a new group role in memory. No options are supported diff --git a/internal/iam/repository.go b/internal/iam/repository.go index fc02420a8..94a35ba5f 100644 --- a/internal/iam/repository.go +++ b/internal/iam/repository.go @@ -68,9 +68,9 @@ func (r *Repository) create(ctx context.Context, resource Resource, opt ...Optio if resource == nil { return nil, errors.New("error creating resource that is nil") } - resourceCloner, ok := resource.(Clonable) + resourceCloner, ok := resource.(Cloneable) if !ok { - return nil, errors.New("error resource is not clonable for create") + return nil, errors.New("error resource is not Cloneable for create") } metadata, err := r.stdMetadata(ctx, resource) if err != nil { @@ -96,13 +96,16 @@ func (r *Repository) create(ctx context.Context, resource Resource, opt ...Optio } // update will update an iam resource in the db repository with an oplog entry -func (r *Repository) update(ctx context.Context, resource Resource, fieldMaskPaths []string, setToNullPaths []string, opt ...Option) (Resource, int, error) { +func (r *Repository) update(ctx context.Context, resource Resource, version uint32, fieldMaskPaths []string, setToNullPaths []string, opt ...Option) (Resource, int, error) { + if version == 0 { + return nil, db.NoRowsAffected, errors.New("resource version cannot be zero during update") + } if resource == nil { return nil, db.NoRowsAffected, errors.New("error updating resource that is nil") } - resourceCloner, ok := resource.(Clonable) + resourceCloner, ok := resource.(Cloneable) if !ok { - return nil, db.NoRowsAffected, errors.New("error resource is not clonable for update") + return nil, db.NoRowsAffected, errors.New("error resource is not Cloneable for update") } metadata, err := r.stdMetadata(ctx, resource) if err != nil { @@ -110,7 +113,10 @@ func (r *Repository) update(ctx context.Context, resource Resource, fieldMaskPat } metadata["op-type"] = []string{oplog.OpType_OP_TYPE_UPDATE.String()} - dbOpts := []db.Option{db.WithOplog(r.wrapper, metadata)} + dbOpts := []db.Option{ + db.WithOplog(r.wrapper, metadata), + db.WithVersion(&version), + } opts := getOpts(opt...) if opts.withSkipVetForWrite { dbOpts = append(dbOpts, db.WithSkipVetForWrite(true)) @@ -147,9 +153,9 @@ func (r *Repository) delete(ctx context.Context, resource Resource, opt ...Optio if resource == nil { return db.NoRowsAffected, errors.New("error deleting resource that is nil") } - resourceCloner, ok := resource.(Clonable) + resourceCloner, ok := resource.(Cloneable) if !ok { - return db.NoRowsAffected, errors.New("error resource is not clonable for delete") + return db.NoRowsAffected, errors.New("error resource is not Cloneable for delete") } metadata, err := r.stdMetadata(ctx, resource) if err != nil { diff --git a/internal/iam/repository_group.go b/internal/iam/repository_group.go index dab50be50..83403942c 100644 --- a/internal/iam/repository_group.go +++ b/internal/iam/repository_group.go @@ -46,7 +46,7 @@ func (r *Repository) CreateGroup(ctx context.Context, group *Group, opt ...Optio // be updated. Fields will be set to NULL if the field is a zero value and // included in fieldMask. Name and Description are the only updatable fields, // If no updatable fields are included in the fieldMaskPaths, then an error is returned. -func (r *Repository) UpdateGroup(ctx context.Context, group *Group, fieldMaskPaths []string, opt ...Option) (*Group, []*GroupMember, int, error) { +func (r *Repository) UpdateGroup(ctx context.Context, group *Group, version uint32, fieldMaskPaths []string, opt ...Option) (*Group, []*GroupMember, int, error) { if group == nil { return nil, nil, db.NoRowsAffected, fmt.Errorf("update group: missing group %w", db.ErrNilParameter) } @@ -85,7 +85,7 @@ func (r *Repository) UpdateGroup(ctx context.Context, group *Group, fieldMaskPat func(read db.Reader, w db.Writer) error { var err error g := group.Clone().(*Group) - resource, rowsUpdated, err = r.update(ctx, g, dbMask, nullFields) + resource, rowsUpdated, err = r.update(ctx, g, version, dbMask, nullFields) if err != nil { return err } diff --git a/internal/iam/repository_group_test.go b/internal/iam/repository_group_test.go index 65a59168a..ee21e4711 100644 --- a/internal/iam/repository_group_test.go +++ b/internal/iam/repository_group_test.go @@ -396,11 +396,11 @@ func TestRepository_UpdateGroup(t *testing.T) { } for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { - assert := assert.New(t) + assert, require := assert.New(t), require.New(t) if tt.wantDup { g := TestGroup(t, conn, org.PublicId) g.Name = tt.args.name - _, _, _, err := repo.UpdateGroup(context.Background(), g, tt.args.fieldMaskPaths, tt.args.opt...) + _, _, _, err := repo.UpdateGroup(context.Background(), g, g.Version, tt.args.fieldMaskPaths, tt.args.opt...) assert.NoError(err) } @@ -414,6 +414,7 @@ func TestRepository_UpdateGroup(t *testing.T) { updateGrp.ScopeId = tt.args.ScopeId updateGrp.Name = tt.args.name updateGrp.Description = tt.args.description + updateGrp.Version = u.Version var groupAfterUpdate *Group var updatedRows int @@ -421,12 +422,12 @@ func TestRepository_UpdateGroup(t *testing.T) { if tt.directUpdate { g := updateGrp.Clone() var resource interface{} - resource, updatedRows, err = repo.update(context.Background(), g.(*Group), tt.args.fieldMaskPaths, nil, tt.args.opt...) + resource, updatedRows, err = repo.update(context.Background(), g.(*Group), updateGrp.Version, tt.args.fieldMaskPaths, nil, tt.args.opt...) if err == nil { groupAfterUpdate = resource.(*Group) } } else { - groupAfterUpdate, _, updatedRows, err = repo.UpdateGroup(context.Background(), &updateGrp, tt.args.fieldMaskPaths, tt.args.opt...) + groupAfterUpdate, _, updatedRows, err = repo.UpdateGroup(context.Background(), &updateGrp, updateGrp.Version, tt.args.fieldMaskPaths, tt.args.opt...) } if tt.wantErr { assert.Error(err) @@ -450,7 +451,7 @@ func TestRepository_UpdateGroup(t *testing.T) { assert.NotEqual(u.UpdateTime, groupAfterUpdate.UpdateTime) } foundGrp, _, err := repo.LookupGroup(context.Background(), u.PublicId) - assert.NoError(err) + require.NoError(err) assert.True(proto.Equal(groupAfterUpdate, foundGrp)) dbassert := dbassert.New(t, rw) if tt.args.name == "" { diff --git a/internal/iam/repository_role.go b/internal/iam/repository_role.go index b140ec8f8..806e725f4 100644 --- a/internal/iam/repository_role.go +++ b/internal/iam/repository_role.go @@ -46,7 +46,7 @@ func (r *Repository) CreateRole(ctx context.Context, role *Role, opt ...Option) // included in fieldMask. Name, Description, and GrantScopeId are the only // updatable fields, If no updatable fields are included in the fieldMaskPaths, // then an error is returned. -func (r *Repository) UpdateRole(ctx context.Context, role *Role, fieldMaskPaths []string, opt ...Option) (*Role, []PrincipalRole, []*RoleGrant, int, error) { +func (r *Repository) UpdateRole(ctx context.Context, role *Role, version uint32, fieldMaskPaths []string, opt ...Option) (*Role, []PrincipalRole, []*RoleGrant, int, error) { if role == nil { return nil, nil, nil, db.NoRowsAffected, fmt.Errorf("update role: missing role %w", db.ErrNilParameter) } @@ -88,7 +88,7 @@ func (r *Repository) UpdateRole(ctx context.Context, role *Role, fieldMaskPaths func(read db.Reader, w db.Writer) error { var err error c := role.Clone().(*Role) - resource, rowsUpdated, err = r.update(ctx, c, dbMask, nullFields) + resource, rowsUpdated, err = r.update(ctx, c, version, dbMask, nullFields) if err != nil { return err } diff --git a/internal/iam/repository_role_test.go b/internal/iam/repository_role_test.go index 9ae05f144..a2bd6e0ed 100644 --- a/internal/iam/repository_role_test.go +++ b/internal/iam/repository_role_test.go @@ -390,7 +390,7 @@ func TestRepository_UpdateRole(t *testing.T) { _ = TestUserRole(t, conn, r.GetPublicId(), u.GetPublicId()) _ = TestRoleGrant(t, conn, r.GetPublicId(), "id=*;actions=*") r.Name = tt.args.name - _, _, _, _, err := repo.UpdateRole(context.Background(), r, tt.args.fieldMaskPaths, tt.args.opt...) + _, _, _, _, err := repo.UpdateRole(context.Background(), r, r.Version, tt.args.fieldMaskPaths, tt.args.opt...) assert.NoError(err) } @@ -422,7 +422,7 @@ func TestRepository_UpdateRole(t *testing.T) { updateRole.Name = tt.args.name updateRole.Description = tt.args.description - roleAfterUpdate, principals, grants, updatedRows, err := repo.UpdateRole(context.Background(), &updateRole, tt.args.fieldMaskPaths, tt.args.opt...) + roleAfterUpdate, principals, grants, updatedRows, err := repo.UpdateRole(context.Background(), &updateRole, r.Version, tt.args.fieldMaskPaths, tt.args.opt...) if tt.wantErr { assert.Error(err) if tt.wantIsError != nil { diff --git a/internal/iam/repository_scope.go b/internal/iam/repository_scope.go index 95bd67bd3..1b9959f46 100644 --- a/internal/iam/repository_scope.go +++ b/internal/iam/repository_scope.go @@ -62,7 +62,7 @@ func (r *Repository) CreateScope(ctx context.Context, s *Scope, opt ...Option) ( // included in fieldMask. Name and Description are the only updatable fields, // and everything else is ignored. If no updatable fields are included in the // fieldMaskPaths, then an error is returned. -func (r *Repository) UpdateScope(ctx context.Context, scope *Scope, fieldMaskPaths []string, opt ...Option) (*Scope, int, error) { +func (r *Repository) UpdateScope(ctx context.Context, scope *Scope, version uint32, fieldMaskPaths []string, opt ...Option) (*Scope, int, error) { if scope == nil { return nil, db.NoRowsAffected, fmt.Errorf("update scope: missing scope: %w", db.ErrNilParameter) } @@ -85,7 +85,7 @@ func (r *Repository) UpdateScope(ctx context.Context, scope *Scope, fieldMaskPat return nil, db.NoRowsAffected, fmt.Errorf("update scope: %w", db.ErrEmptyFieldMask) } - resource, rowsUpdated, err := r.update(ctx, scope, dbMask, nullFields) + resource, rowsUpdated, err := r.update(ctx, scope, version, dbMask, nullFields) if err != nil { if db.IsUniqueError(err) { return nil, db.NoRowsAffected, fmt.Errorf("update scope: %s name %s already exists: %w", scope.PublicId, scope.Name, db.ErrNotUnique) diff --git a/internal/iam/repository_scope_test.go b/internal/iam/repository_scope_test.go index d1e2a61c0..b28bbe1e1 100644 --- a/internal/iam/repository_scope_test.go +++ b/internal/iam/repository_scope_test.go @@ -132,19 +132,21 @@ func Test_Repository_Scope_Update(t *testing.T) { foundScope, err := repo.LookupScope(context.Background(), s.PublicId) require.NoError(err) + assert.Empty(foundScope.GetDescription()) // should be "" after update in db assert.True(proto.Equal(foundScope, s)) err = db.TestVerifyOplog(t, rw, s.PublicId, db.WithOperation(oplog.OpType_OP_TYPE_CREATE), db.WithCreateNotBefore(10*time.Second)) require.NoError(err) - s.Name = id + s.Name = "foo" + id s.Description = "desc-id" // not in the field mask paths - s, updatedRows, err := repo.UpdateScope(context.Background(), s, []string{"Name"}) + s, updatedRows, err := repo.UpdateScope(context.Background(), s, 1, []string{"Name"}) require.NoError(err) assert.Equal(1, updatedRows) require.NotNil(s) - assert.Equal(s.GetName(), id) - assert.Empty(foundScope.GetDescription()) // should be "" after update in db + assert.Equal("foo"+id, s.GetName()) + // TODO: This isn't empty because of ICU-490 -- when that is resolved, fix this + //assert.Empty(s.GetDescription()) foundScope, err = repo.LookupScope(context.Background(), s.PublicId) require.NoError(err) @@ -153,6 +155,15 @@ func Test_Repository_Scope_Update(t *testing.T) { err = db.TestVerifyOplog(t, rw, s.PublicId, db.WithOperation(oplog.OpType_OP_TYPE_UPDATE), db.WithCreateNotBefore(10*time.Second)) assert.NoError(err) + + s.Name = "test2" + s.Description = "desc-id-2" + s, updatedRows, err = repo.UpdateScope(context.Background(), s, 2, []string{"Name", "Description"}) + require.NoError(err) + assert.Equal(1, updatedRows) + require.NotNil(s) + assert.Equal("test2", s.GetName()) + assert.Equal("desc-id-2", s.GetDescription()) }) t.Run("bad-parent-scope", func(t *testing.T) { assert, require := assert.New(t), require.New(t) @@ -172,7 +183,7 @@ func Test_Repository_Scope_Update(t *testing.T) { require.NotNil(project) project.ParentId = project.PublicId - project, updatedRows, err := repo.UpdateScope(context.Background(), project, []string{"ParentId"}) + project, updatedRows, err := repo.UpdateScope(context.Background(), project, 1, []string{"ParentId"}) require.Error(err) assert.Nil(project) assert.Equal(0, updatedRows) @@ -415,7 +426,7 @@ func TestRepository_UpdateScope(t *testing.T) { if tt.args.scope != nil { tt.args.scope.PublicId = org.PublicId } - updatedScope, rowsUpdated, err := r.UpdateScope(context.Background(), tt.args.scope, tt.args.fieldMaskPaths, tt.args.opt...) + updatedScope, rowsUpdated, err := r.UpdateScope(context.Background(), tt.args.scope, 1, tt.args.fieldMaskPaths, tt.args.opt...) if tt.wantErr { require.Error(err) assert.Equal(tt.wantUpdatedRows, rowsUpdated) @@ -455,7 +466,7 @@ func TestRepository_UpdateScope(t *testing.T) { _ = testOrg(t, conn, id, id) org2 := testOrg(t, conn, "dup-"+id, id) org2.Name = id - updatedScope, rowsUpdated, err := r.UpdateScope(context.Background(), org2, []string{"Name"}) + updatedScope, rowsUpdated, err := r.UpdateScope(context.Background(), org2, 1, []string{"Name"}) require.Error(err) assert.Equal(0, rowsUpdated, "updated rows should be 0") assert.Nil(updatedScope, "scope should be nil") diff --git a/internal/iam/repository_test.go b/internal/iam/repository_test.go index c9b7f19e9..be1486924 100644 --- a/internal/iam/repository_test.go +++ b/internal/iam/repository_test.go @@ -306,7 +306,7 @@ func TestRepository_update(t *testing.T) { if tt.args.resource != nil { tt.args.resource.(*Scope).PublicId = org.PublicId } - updatedResource, rowsUpdated, err := r.update(context.Background(), tt.args.resource, tt.args.fieldMaskPaths, tt.args.setToNullPaths, tt.args.opt...) + updatedResource, rowsUpdated, err := r.update(context.Background(), tt.args.resource, 1, tt.args.fieldMaskPaths, tt.args.setToNullPaths, tt.args.opt...) if tt.wantErr { require.Error(err) assert.Equal(tt.wantUpdatedRows, rowsUpdated) diff --git a/internal/iam/repository_user.go b/internal/iam/repository_user.go index 498423a58..3959aca9b 100644 --- a/internal/iam/repository_user.go +++ b/internal/iam/repository_user.go @@ -41,7 +41,7 @@ func (r *Repository) CreateUser(ctx context.Context, user *User, opt ...Option) // be updated. Fields will be set to NULL if the field is a zero value and // included in fieldMask. Name and Description are the only updatable fields, // If no updatable fields are included in the fieldMaskPaths, then an error is returned. -func (r *Repository) UpdateUser(ctx context.Context, user *User, fieldMaskPaths []string, opt ...Option) (*User, int, error) { +func (r *Repository) UpdateUser(ctx context.Context, user *User, version uint32, fieldMaskPaths []string, opt ...Option) (*User, int, error) { if user == nil { return nil, db.NoRowsAffected, fmt.Errorf("update user: missing user %w", db.ErrNilParameter) } @@ -69,7 +69,7 @@ func (r *Repository) UpdateUser(ctx context.Context, user *User, fieldMaskPaths } u := user.Clone() - resource, rowsUpdated, err := r.update(ctx, u.(*User), dbMask, nullFields, opt...) + resource, rowsUpdated, err := r.update(ctx, u.(*User), version, dbMask, nullFields, opt...) if err != nil { if db.IsUniqueError(err) { return nil, db.NoRowsAffected, fmt.Errorf("update user: user %s already exists in org %s", user.Name, user.ScopeId) diff --git a/internal/iam/repository_user_test.go b/internal/iam/repository_user_test.go index b28e802f3..9533e8c90 100644 --- a/internal/iam/repository_user_test.go +++ b/internal/iam/repository_user_test.go @@ -300,7 +300,7 @@ func TestRepository_UpdateUser(t *testing.T) { if tt.wantDup { u := TestUser(t, conn, org.PublicId, tt.newUserOpts...) u.Name = tt.args.name - _, _, err := repo.UpdateUser(context.Background(), u, tt.args.fieldMaskPaths, tt.args.opt...) + _, _, err := repo.UpdateUser(context.Background(), u, 1, tt.args.fieldMaskPaths, tt.args.opt...) require.NoError(err) } @@ -321,12 +321,12 @@ func TestRepository_UpdateUser(t *testing.T) { if tt.directUpdate { u := updateUser.Clone() var resource interface{} - resource, updatedRows, err = repo.update(context.Background(), u.(*User), tt.args.fieldMaskPaths, nil, tt.args.opt...) + resource, updatedRows, err = repo.update(context.Background(), u.(*User), 1, tt.args.fieldMaskPaths, nil, tt.args.opt...) if err == nil { userAfterUpdate = resource.(*User) } } else { - userAfterUpdate, updatedRows, err = repo.UpdateUser(context.Background(), &updateUser, tt.args.fieldMaskPaths, tt.args.opt...) + userAfterUpdate, updatedRows, err = repo.UpdateUser(context.Background(), &updateUser, 1, tt.args.fieldMaskPaths, tt.args.opt...) } if tt.wantErr { require.Error(err) diff --git a/internal/iam/resource.go b/internal/iam/resource.go index 3d6e3de2f..8e80aa322 100644 --- a/internal/iam/resource.go +++ b/internal/iam/resource.go @@ -35,7 +35,7 @@ type Resource interface { Actions() map[string]action.Type } -type Clonable interface { +type Cloneable interface { Clone() interface{} } diff --git a/internal/iam/role.go b/internal/iam/role.go index c557e2ebb..f7e02ffca 100644 --- a/internal/iam/role.go +++ b/internal/iam/role.go @@ -23,9 +23,9 @@ type Role struct { tableName string `gorm:"-"` } -// ensure that Role implements the interfaces of: Resource, Clonable, and db.VetForWriter. +// ensure that Role implements the interfaces of: Resource, Cloneable, and db.VetForWriter. var _ Resource = (*Role)(nil) -var _ Clonable = (*Role)(nil) +var _ Cloneable = (*Role)(nil) var _ db.VetForWriter = (*Role)(nil) // NewRole creates a new in memory role with a scope (project/org) diff --git a/internal/iam/role_grant.go b/internal/iam/role_grant.go index f2ca195b8..c5431d643 100644 --- a/internal/iam/role_grant.go +++ b/internal/iam/role_grant.go @@ -19,8 +19,8 @@ type RoleGrant struct { tableName string `gorm:"-"` } -// ensure that RoleGrant implements the interfaces of: Clonable and db.VetForWriter -var _ Clonable = (*RoleGrant)(nil) +// ensure that RoleGrant implements the interfaces of: Cloneable and db.VetForWriter +var _ Cloneable = (*RoleGrant)(nil) var _ db.VetForWriter = (*RoleGrant)(nil) // NewRoleGrant creates a new in memory role grant diff --git a/internal/iam/scope.go b/internal/iam/scope.go index 86e80fbd8..0623e06d5 100644 --- a/internal/iam/scope.go +++ b/internal/iam/scope.go @@ -28,10 +28,10 @@ type Scope struct { tableName string `gorm:"-"` } -// ensure that Scope implements the interfaces of: Resource, Clonable, and db.VetForWriter +// ensure that Scope implements the interfaces of: Resource, Cloneable, and db.VetForWriter var _ Resource = (*Scope)(nil) var _ db.VetForWriter = (*Scope)(nil) -var _ Clonable = (*Scope)(nil) +var _ Cloneable = (*Scope)(nil) func NewOrg(opt ...Option) (*Scope, error) { global := allocScope() diff --git a/internal/iam/store/group.pb.go b/internal/iam/store/group.pb.go index ad513529c..22d4020c9 100644 --- a/internal/iam/store/group.pb.go +++ b/internal/iam/store/group.pb.go @@ -161,38 +161,38 @@ var file_controller_storage_iam_store_v1_group_proto_rawDesc = []byte{ 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x2b, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x65, 0x72, 0x2f, 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x2f, 0x69, 0x61, 0x6d, 0x2f, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x2f, 0x76, 0x31, - 0x2f, 0x73, 0x63, 0x6f, 0x70, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x28, 0x63, 0x6f, + 0x2f, 0x73, 0x63, 0x6f, 0x70, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x2a, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x65, 0x72, 0x2f, 0x63, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x5f, - 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2f, 0x76, 0x31, 0x2f, 0x6d, 0x61, 0x73, 0x6b, 0x73, - 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xf7, 0x02, 0x0a, 0x05, 0x47, 0x72, 0x6f, 0x75, 0x70, - 0x12, 0x1b, 0x0a, 0x09, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, - 0x01, 0x28, 0x09, 0x52, 0x08, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x49, 0x64, 0x12, 0x4b, 0x0a, - 0x0b, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, - 0x28, 0x0b, 0x32, 0x2a, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x65, 0x72, 0x2e, - 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x2e, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, - 0x70, 0x2e, 0x76, 0x31, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x0a, - 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x54, 0x69, 0x6d, 0x65, 0x12, 0x4b, 0x0a, 0x0b, 0x75, 0x70, - 0x64, 0x61, 0x74, 0x65, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, - 0x2a, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x65, 0x72, 0x2e, 0x73, 0x74, 0x6f, - 0x72, 0x61, 0x67, 0x65, 0x2e, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x2e, 0x76, - 0x31, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x0a, 0x75, 0x70, 0x64, - 0x61, 0x74, 0x65, 0x54, 0x69, 0x6d, 0x65, 0x12, 0x24, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, - 0x04, 0x20, 0x01, 0x28, 0x09, 0x42, 0x10, 0xc2, 0xdd, 0x29, 0x0c, 0x0a, 0x04, 0x6e, 0x61, 0x6d, - 0x65, 0x12, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x40, 0x0a, - 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x05, 0x20, 0x01, - 0x28, 0x09, 0x42, 0x1e, 0xc2, 0xdd, 0x29, 0x1a, 0x0a, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, - 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, - 0x6f, 0x6e, 0x52, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x12, - 0x19, 0x0a, 0x08, 0x73, 0x63, 0x6f, 0x70, 0x65, 0x5f, 0x69, 0x64, 0x18, 0x06, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x07, 0x73, 0x63, 0x6f, 0x70, 0x65, 0x49, 0x64, 0x12, 0x1a, 0x0a, 0x08, 0x64, 0x69, - 0x73, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x18, 0x07, 0x20, 0x01, 0x28, 0x08, 0x52, 0x08, 0x64, 0x69, - 0x73, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x12, 0x18, 0x0a, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, - 0x6e, 0x18, 0x08, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, - 0x42, 0x3a, 0x5a, 0x38, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x68, - 0x61, 0x73, 0x68, 0x69, 0x63, 0x6f, 0x72, 0x70, 0x2f, 0x77, 0x61, 0x74, 0x63, 0x68, 0x74, 0x6f, - 0x77, 0x65, 0x72, 0x2f, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x2f, 0x69, 0x61, 0x6d, - 0x2f, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x3b, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x62, 0x06, 0x70, 0x72, - 0x6f, 0x74, 0x6f, 0x33, + 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2f, 0x76, 0x31, 0x2f, 0x6f, 0x70, 0x74, 0x69, 0x6f, + 0x6e, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xf7, 0x02, 0x0a, 0x05, 0x47, 0x72, 0x6f, + 0x75, 0x70, 0x12, 0x1b, 0x0a, 0x09, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x5f, 0x69, 0x64, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x49, 0x64, 0x12, + 0x4b, 0x0a, 0x0b, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x02, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2a, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x65, + 0x72, 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x2e, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, + 0x61, 0x6d, 0x70, 0x2e, 0x76, 0x31, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, + 0x52, 0x0a, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x54, 0x69, 0x6d, 0x65, 0x12, 0x4b, 0x0a, 0x0b, + 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, + 0x0b, 0x32, 0x2a, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x65, 0x72, 0x2e, 0x73, + 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x2e, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, + 0x2e, 0x76, 0x31, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x0a, 0x75, + 0x70, 0x64, 0x61, 0x74, 0x65, 0x54, 0x69, 0x6d, 0x65, 0x12, 0x24, 0x0a, 0x04, 0x6e, 0x61, 0x6d, + 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x42, 0x10, 0xc2, 0xdd, 0x29, 0x0c, 0x0a, 0x04, 0x6e, + 0x61, 0x6d, 0x65, 0x12, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, + 0x40, 0x0a, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x05, + 0x20, 0x01, 0x28, 0x09, 0x42, 0x1e, 0xc2, 0xdd, 0x29, 0x1a, 0x0a, 0x0b, 0x64, 0x65, 0x73, 0x63, + 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, + 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, + 0x6e, 0x12, 0x19, 0x0a, 0x08, 0x73, 0x63, 0x6f, 0x70, 0x65, 0x5f, 0x69, 0x64, 0x18, 0x06, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x07, 0x73, 0x63, 0x6f, 0x70, 0x65, 0x49, 0x64, 0x12, 0x1a, 0x0a, 0x08, + 0x64, 0x69, 0x73, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x18, 0x07, 0x20, 0x01, 0x28, 0x08, 0x52, 0x08, + 0x64, 0x69, 0x73, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x12, 0x18, 0x0a, 0x07, 0x76, 0x65, 0x72, 0x73, + 0x69, 0x6f, 0x6e, 0x18, 0x08, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, + 0x6f, 0x6e, 0x42, 0x3a, 0x5a, 0x38, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, + 0x2f, 0x68, 0x61, 0x73, 0x68, 0x69, 0x63, 0x6f, 0x72, 0x70, 0x2f, 0x77, 0x61, 0x74, 0x63, 0x68, + 0x74, 0x6f, 0x77, 0x65, 0x72, 0x2f, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x2f, 0x69, + 0x61, 0x6d, 0x2f, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x3b, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x62, 0x06, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( diff --git a/internal/iam/store/role.pb.go b/internal/iam/store/role.pb.go index d818d599c..cd5317254 100644 --- a/internal/iam/store/role.pb.go +++ b/internal/iam/store/role.pb.go @@ -172,42 +172,42 @@ var file_controller_storage_iam_store_v1_role_proto_rawDesc = []byte{ 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x2b, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x65, 0x72, 0x2f, 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x2f, 0x69, 0x61, 0x6d, 0x2f, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x2f, 0x76, 0x31, 0x2f, - 0x73, 0x63, 0x6f, 0x70, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x28, 0x63, 0x6f, 0x6e, + 0x73, 0x63, 0x6f, 0x70, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x2a, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x65, 0x72, 0x2f, 0x63, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x5f, 0x6f, - 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2f, 0x76, 0x31, 0x2f, 0x6d, 0x61, 0x73, 0x6b, 0x73, 0x2e, - 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xc0, 0x03, 0x0a, 0x04, 0x52, 0x6f, 0x6c, 0x65, 0x12, 0x1b, - 0x0a, 0x09, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x08, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x49, 0x64, 0x12, 0x4b, 0x0a, 0x0b, 0x63, - 0x72, 0x65, 0x61, 0x74, 0x65, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, - 0x32, 0x2a, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x65, 0x72, 0x2e, 0x73, 0x74, - 0x6f, 0x72, 0x61, 0x67, 0x65, 0x2e, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x2e, - 0x76, 0x31, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x0a, 0x63, 0x72, - 0x65, 0x61, 0x74, 0x65, 0x54, 0x69, 0x6d, 0x65, 0x12, 0x4b, 0x0a, 0x0b, 0x75, 0x70, 0x64, 0x61, - 0x74, 0x65, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2a, 0x2e, - 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x65, 0x72, 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x61, - 0x67, 0x65, 0x2e, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x2e, 0x76, 0x31, 0x2e, - 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x0a, 0x75, 0x70, 0x64, 0x61, 0x74, - 0x65, 0x54, 0x69, 0x6d, 0x65, 0x12, 0x24, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x05, 0x20, - 0x01, 0x28, 0x09, 0x42, 0x10, 0xc2, 0xdd, 0x29, 0x0c, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, - 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x40, 0x0a, 0x0b, 0x64, - 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, - 0x42, 0x1e, 0xc2, 0xdd, 0x29, 0x1a, 0x0a, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, - 0x69, 0x6f, 0x6e, 0x12, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, - 0x52, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x19, 0x0a, - 0x08, 0x73, 0x63, 0x6f, 0x70, 0x65, 0x5f, 0x69, 0x64, 0x18, 0x07, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x07, 0x73, 0x63, 0x6f, 0x70, 0x65, 0x49, 0x64, 0x12, 0x1a, 0x0a, 0x08, 0x64, 0x69, 0x73, 0x61, - 0x62, 0x6c, 0x65, 0x64, 0x18, 0x08, 0x20, 0x01, 0x28, 0x08, 0x52, 0x08, 0x64, 0x69, 0x73, 0x61, - 0x62, 0x6c, 0x65, 0x64, 0x12, 0x18, 0x0a, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, - 0x09, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x48, - 0x0a, 0x0e, 0x67, 0x72, 0x61, 0x6e, 0x74, 0x5f, 0x73, 0x63, 0x6f, 0x70, 0x65, 0x5f, 0x69, 0x64, - 0x18, 0x0a, 0x20, 0x01, 0x28, 0x09, 0x42, 0x22, 0xc2, 0xdd, 0x29, 0x1e, 0x0a, 0x0c, 0x47, 0x72, - 0x61, 0x6e, 0x74, 0x53, 0x63, 0x6f, 0x70, 0x65, 0x49, 0x64, 0x12, 0x0e, 0x67, 0x72, 0x61, 0x6e, - 0x74, 0x5f, 0x73, 0x63, 0x6f, 0x70, 0x65, 0x5f, 0x69, 0x64, 0x52, 0x0c, 0x67, 0x72, 0x61, 0x6e, - 0x74, 0x53, 0x63, 0x6f, 0x70, 0x65, 0x49, 0x64, 0x42, 0x3a, 0x5a, 0x38, 0x67, 0x69, 0x74, 0x68, - 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x68, 0x61, 0x73, 0x68, 0x69, 0x63, 0x6f, 0x72, 0x70, - 0x2f, 0x77, 0x61, 0x74, 0x63, 0x68, 0x74, 0x6f, 0x77, 0x65, 0x72, 0x2f, 0x69, 0x6e, 0x74, 0x65, - 0x72, 0x6e, 0x61, 0x6c, 0x2f, 0x69, 0x61, 0x6d, 0x2f, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x3b, 0x73, - 0x74, 0x6f, 0x72, 0x65, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2f, 0x76, 0x31, 0x2f, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, + 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xc0, 0x03, 0x0a, 0x04, 0x52, 0x6f, 0x6c, 0x65, + 0x12, 0x1b, 0x0a, 0x09, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x08, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x49, 0x64, 0x12, 0x4b, 0x0a, + 0x0b, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, + 0x28, 0x0b, 0x32, 0x2a, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x65, 0x72, 0x2e, + 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x2e, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, + 0x70, 0x2e, 0x76, 0x31, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x0a, + 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x54, 0x69, 0x6d, 0x65, 0x12, 0x4b, 0x0a, 0x0b, 0x75, 0x70, + 0x64, 0x61, 0x74, 0x65, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, + 0x2a, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x65, 0x72, 0x2e, 0x73, 0x74, 0x6f, + 0x72, 0x61, 0x67, 0x65, 0x2e, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x2e, 0x76, + 0x31, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x0a, 0x75, 0x70, 0x64, + 0x61, 0x74, 0x65, 0x54, 0x69, 0x6d, 0x65, 0x12, 0x24, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, + 0x05, 0x20, 0x01, 0x28, 0x09, 0x42, 0x10, 0xc2, 0xdd, 0x29, 0x0c, 0x0a, 0x04, 0x6e, 0x61, 0x6d, + 0x65, 0x12, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x40, 0x0a, + 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x06, 0x20, 0x01, + 0x28, 0x09, 0x42, 0x1e, 0xc2, 0xdd, 0x29, 0x1a, 0x0a, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, + 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, + 0x6f, 0x6e, 0x52, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x12, + 0x19, 0x0a, 0x08, 0x73, 0x63, 0x6f, 0x70, 0x65, 0x5f, 0x69, 0x64, 0x18, 0x07, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x07, 0x73, 0x63, 0x6f, 0x70, 0x65, 0x49, 0x64, 0x12, 0x1a, 0x0a, 0x08, 0x64, 0x69, + 0x73, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x18, 0x08, 0x20, 0x01, 0x28, 0x08, 0x52, 0x08, 0x64, 0x69, + 0x73, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x12, 0x18, 0x0a, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, + 0x6e, 0x18, 0x09, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, + 0x12, 0x48, 0x0a, 0x0e, 0x67, 0x72, 0x61, 0x6e, 0x74, 0x5f, 0x73, 0x63, 0x6f, 0x70, 0x65, 0x5f, + 0x69, 0x64, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x09, 0x42, 0x22, 0xc2, 0xdd, 0x29, 0x1e, 0x0a, 0x0c, + 0x47, 0x72, 0x61, 0x6e, 0x74, 0x53, 0x63, 0x6f, 0x70, 0x65, 0x49, 0x64, 0x12, 0x0e, 0x67, 0x72, + 0x61, 0x6e, 0x74, 0x5f, 0x73, 0x63, 0x6f, 0x70, 0x65, 0x5f, 0x69, 0x64, 0x52, 0x0c, 0x67, 0x72, + 0x61, 0x6e, 0x74, 0x53, 0x63, 0x6f, 0x70, 0x65, 0x49, 0x64, 0x42, 0x3a, 0x5a, 0x38, 0x67, 0x69, + 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x68, 0x61, 0x73, 0x68, 0x69, 0x63, 0x6f, + 0x72, 0x70, 0x2f, 0x77, 0x61, 0x74, 0x63, 0x68, 0x74, 0x6f, 0x77, 0x65, 0x72, 0x2f, 0x69, 0x6e, + 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x2f, 0x69, 0x61, 0x6d, 0x2f, 0x73, 0x74, 0x6f, 0x72, 0x65, + 0x3b, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( diff --git a/internal/iam/store/scope.pb.go b/internal/iam/store/scope.pb.go index c67504288..45faa4c81 100644 --- a/internal/iam/store/scope.pb.go +++ b/internal/iam/store/scope.pb.go @@ -53,6 +53,9 @@ type Scope struct { // description of scope // @inject_tag: `gorm:"default:null"` Description string `protobuf:"bytes,7,opt,name=description,proto3" json:"description,omitempty" gorm:"default:null"` + // version allows optimistic locking of the scope + // @inject_tag: `gorm:"default:null"` + Version uint32 `protobuf:"varint,8,opt,name=version,proto3" json:"version,omitempty" gorm:"default:null"` } func (x *Scope) Reset() { @@ -136,6 +139,13 @@ func (x *Scope) GetDescription() string { return "" } +func (x *Scope) GetVersion() uint32 { + if x != nil { + return x.Version + } + return 0 +} + var File_controller_storage_iam_store_v1_scope_proto protoreflect.FileDescriptor var file_controller_storage_iam_store_v1_scope_proto_rawDesc = []byte{ @@ -143,39 +153,41 @@ var file_controller_storage_iam_store_v1_scope_proto_rawDesc = []byte{ 0x72, 0x61, 0x67, 0x65, 0x2f, 0x69, 0x61, 0x6d, 0x2f, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x2f, 0x76, 0x31, 0x2f, 0x73, 0x63, 0x6f, 0x70, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x1f, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x65, 0x72, 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, - 0x65, 0x2e, 0x69, 0x61, 0x6d, 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x31, 0x1a, 0x28, + 0x65, 0x2e, 0x69, 0x61, 0x6d, 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x31, 0x1a, 0x2a, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x65, 0x72, 0x2f, 0x63, 0x75, 0x73, 0x74, 0x6f, - 0x6d, 0x5f, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2f, 0x76, 0x31, 0x2f, 0x6d, 0x61, 0x73, - 0x6b, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x2f, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, - 0x6c, 0x6c, 0x65, 0x72, 0x2f, 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x2f, 0x74, 0x69, 0x6d, - 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x2f, 0x76, 0x31, 0x2f, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, - 0x61, 0x6d, 0x70, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xd7, 0x02, 0x0a, 0x05, 0x53, 0x63, - 0x6f, 0x70, 0x65, 0x12, 0x1b, 0x0a, 0x09, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x5f, 0x69, 0x64, - 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x49, 0x64, - 0x12, 0x4b, 0x0a, 0x0b, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x18, - 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2a, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x6c, - 0x65, 0x72, 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x2e, 0x74, 0x69, 0x6d, 0x65, 0x73, - 0x74, 0x61, 0x6d, 0x70, 0x2e, 0x76, 0x31, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, - 0x70, 0x52, 0x0a, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x54, 0x69, 0x6d, 0x65, 0x12, 0x4b, 0x0a, - 0x0b, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x03, 0x20, 0x01, - 0x28, 0x0b, 0x32, 0x2a, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x65, 0x72, 0x2e, - 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x2e, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, - 0x70, 0x2e, 0x76, 0x31, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x0a, - 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x54, 0x69, 0x6d, 0x65, 0x12, 0x24, 0x0a, 0x04, 0x6e, 0x61, - 0x6d, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x42, 0x10, 0xc2, 0xdd, 0x29, 0x0c, 0x0a, 0x04, - 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, - 0x12, 0x12, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, - 0x74, 0x79, 0x70, 0x65, 0x12, 0x1b, 0x0a, 0x09, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x5f, 0x69, - 0x64, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x49, - 0x64, 0x12, 0x40, 0x0a, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, - 0x18, 0x07, 0x20, 0x01, 0x28, 0x09, 0x42, 0x1e, 0xc2, 0xdd, 0x29, 0x1a, 0x0a, 0x0b, 0x64, 0x65, - 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, - 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, - 0x69, 0x6f, 0x6e, 0x42, 0x3a, 0x5a, 0x38, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, - 0x6d, 0x2f, 0x68, 0x61, 0x73, 0x68, 0x69, 0x63, 0x6f, 0x72, 0x70, 0x2f, 0x77, 0x61, 0x74, 0x63, - 0x68, 0x74, 0x6f, 0x77, 0x65, 0x72, 0x2f, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x2f, - 0x69, 0x61, 0x6d, 0x2f, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x3b, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x62, - 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x6d, 0x5f, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2f, 0x76, 0x31, 0x2f, 0x6f, 0x70, 0x74, + 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x2f, 0x63, 0x6f, 0x6e, 0x74, + 0x72, 0x6f, 0x6c, 0x6c, 0x65, 0x72, 0x2f, 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x2f, 0x74, + 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x2f, 0x76, 0x31, 0x2f, 0x74, 0x69, 0x6d, 0x65, + 0x73, 0x74, 0x61, 0x6d, 0x70, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xf1, 0x02, 0x0a, 0x05, + 0x53, 0x63, 0x6f, 0x70, 0x65, 0x12, 0x1b, 0x0a, 0x09, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x5f, + 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, + 0x49, 0x64, 0x12, 0x4b, 0x0a, 0x0b, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x5f, 0x74, 0x69, 0x6d, + 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2a, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, + 0x6c, 0x6c, 0x65, 0x72, 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x2e, 0x74, 0x69, 0x6d, + 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x2e, 0x76, 0x31, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, + 0x61, 0x6d, 0x70, 0x52, 0x0a, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x54, 0x69, 0x6d, 0x65, 0x12, + 0x4b, 0x0a, 0x0b, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x03, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2a, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x65, + 0x72, 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x2e, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, + 0x61, 0x6d, 0x70, 0x2e, 0x76, 0x31, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, + 0x52, 0x0a, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x54, 0x69, 0x6d, 0x65, 0x12, 0x24, 0x0a, 0x04, + 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x42, 0x10, 0xc2, 0xdd, 0x29, 0x0c, + 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x52, 0x04, 0x6e, 0x61, + 0x6d, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x12, 0x1b, 0x0a, 0x09, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, + 0x5f, 0x69, 0x64, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x70, 0x61, 0x72, 0x65, 0x6e, + 0x74, 0x49, 0x64, 0x12, 0x40, 0x0a, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, + 0x6f, 0x6e, 0x18, 0x07, 0x20, 0x01, 0x28, 0x09, 0x42, 0x1e, 0xc2, 0xdd, 0x29, 0x1a, 0x0a, 0x0b, + 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x0b, 0x64, 0x65, 0x73, + 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, + 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x18, 0x0a, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, + 0x18, 0x08, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x42, + 0x3a, 0x5a, 0x38, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x68, 0x61, + 0x73, 0x68, 0x69, 0x63, 0x6f, 0x72, 0x70, 0x2f, 0x77, 0x61, 0x74, 0x63, 0x68, 0x74, 0x6f, 0x77, + 0x65, 0x72, 0x2f, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x2f, 0x69, 0x61, 0x6d, 0x2f, + 0x73, 0x74, 0x6f, 0x72, 0x65, 0x3b, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x62, 0x06, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x33, } var ( diff --git a/internal/iam/store/user.pb.go b/internal/iam/store/user.pb.go index 41e5e4e46..1e873118b 100644 --- a/internal/iam/store/user.pb.go +++ b/internal/iam/store/user.pb.go @@ -54,6 +54,9 @@ type User struct { // disabled is by default false and allows a User to be marked disabled. // @inject_tag: `gorm:"default:null"` Disabled bool `protobuf:"varint,7,opt,name=disabled,proto3" json:"disabled,omitempty" gorm:"default:null"` + // version allows optimistic locking of the user + // @inject_tag: `gorm:"default:null"` + Version uint32 `protobuf:"varint,8,opt,name=version,proto3" json:"version,omitempty" gorm:"default:null"` } func (x *User) Reset() { @@ -137,6 +140,13 @@ func (x *User) GetDisabled() bool { return false } +func (x *User) GetVersion() uint32 { + if x != nil { + return x.Version + } + return 0 +} + var File_controller_storage_iam_store_v1_user_proto protoreflect.FileDescriptor var file_controller_storage_iam_store_v1_user_proto_rawDesc = []byte{ @@ -147,36 +157,38 @@ var file_controller_storage_iam_store_v1_user_proto_rawDesc = []byte{ 0x2e, 0x69, 0x61, 0x6d, 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x31, 0x1a, 0x2f, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x65, 0x72, 0x2f, 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x2f, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x2f, 0x76, 0x31, 0x2f, 0x74, - 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x28, + 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x2a, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x65, 0x72, 0x2f, 0x63, 0x75, 0x73, 0x74, 0x6f, - 0x6d, 0x5f, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2f, 0x76, 0x31, 0x2f, 0x6d, 0x61, 0x73, - 0x6b, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xdc, 0x02, 0x0a, 0x04, 0x55, 0x73, 0x65, - 0x72, 0x12, 0x1b, 0x0a, 0x09, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x5f, 0x69, 0x64, 0x18, 0x01, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x49, 0x64, 0x12, 0x4b, - 0x0a, 0x0b, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x02, 0x20, - 0x01, 0x28, 0x0b, 0x32, 0x2a, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x65, 0x72, - 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x2e, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, - 0x6d, 0x70, 0x2e, 0x76, 0x31, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, - 0x0a, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x54, 0x69, 0x6d, 0x65, 0x12, 0x4b, 0x0a, 0x0b, 0x75, - 0x70, 0x64, 0x61, 0x74, 0x65, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, - 0x32, 0x2a, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x65, 0x72, 0x2e, 0x73, 0x74, - 0x6f, 0x72, 0x61, 0x67, 0x65, 0x2e, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x2e, - 0x76, 0x31, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x0a, 0x75, 0x70, - 0x64, 0x61, 0x74, 0x65, 0x54, 0x69, 0x6d, 0x65, 0x12, 0x24, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, - 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x42, 0x10, 0xc2, 0xdd, 0x29, 0x0c, 0x0a, 0x04, 0x6e, 0x61, - 0x6d, 0x65, 0x12, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x40, - 0x0a, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x05, 0x20, - 0x01, 0x28, 0x09, 0x42, 0x1e, 0xc2, 0xdd, 0x29, 0x1a, 0x0a, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, - 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, - 0x69, 0x6f, 0x6e, 0x52, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, - 0x12, 0x19, 0x0a, 0x08, 0x73, 0x63, 0x6f, 0x70, 0x65, 0x5f, 0x69, 0x64, 0x18, 0x06, 0x20, 0x01, - 0x28, 0x09, 0x52, 0x07, 0x73, 0x63, 0x6f, 0x70, 0x65, 0x49, 0x64, 0x12, 0x1a, 0x0a, 0x08, 0x64, - 0x69, 0x73, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x18, 0x07, 0x20, 0x01, 0x28, 0x08, 0x52, 0x08, 0x64, - 0x69, 0x73, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x42, 0x3a, 0x5a, 0x38, 0x67, 0x69, 0x74, 0x68, 0x75, - 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x68, 0x61, 0x73, 0x68, 0x69, 0x63, 0x6f, 0x72, 0x70, 0x2f, - 0x77, 0x61, 0x74, 0x63, 0x68, 0x74, 0x6f, 0x77, 0x65, 0x72, 0x2f, 0x69, 0x6e, 0x74, 0x65, 0x72, - 0x6e, 0x61, 0x6c, 0x2f, 0x69, 0x61, 0x6d, 0x2f, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x3b, 0x73, 0x74, - 0x6f, 0x72, 0x65, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x6d, 0x5f, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2f, 0x76, 0x31, 0x2f, 0x6f, 0x70, 0x74, + 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xf6, 0x02, 0x0a, 0x04, 0x55, + 0x73, 0x65, 0x72, 0x12, 0x1b, 0x0a, 0x09, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x5f, 0x69, 0x64, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x49, 0x64, + 0x12, 0x4b, 0x0a, 0x0b, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x18, + 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2a, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x6c, + 0x65, 0x72, 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x2e, 0x74, 0x69, 0x6d, 0x65, 0x73, + 0x74, 0x61, 0x6d, 0x70, 0x2e, 0x76, 0x31, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, + 0x70, 0x52, 0x0a, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x54, 0x69, 0x6d, 0x65, 0x12, 0x4b, 0x0a, + 0x0b, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x03, 0x20, 0x01, + 0x28, 0x0b, 0x32, 0x2a, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x65, 0x72, 0x2e, + 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x2e, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, + 0x70, 0x2e, 0x76, 0x31, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x0a, + 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x54, 0x69, 0x6d, 0x65, 0x12, 0x24, 0x0a, 0x04, 0x6e, 0x61, + 0x6d, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x42, 0x10, 0xc2, 0xdd, 0x29, 0x0c, 0x0a, 0x04, + 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, + 0x12, 0x40, 0x0a, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x18, + 0x05, 0x20, 0x01, 0x28, 0x09, 0x42, 0x1e, 0xc2, 0xdd, 0x29, 0x1a, 0x0a, 0x0b, 0x64, 0x65, 0x73, + 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, + 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, + 0x6f, 0x6e, 0x12, 0x19, 0x0a, 0x08, 0x73, 0x63, 0x6f, 0x70, 0x65, 0x5f, 0x69, 0x64, 0x18, 0x06, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x73, 0x63, 0x6f, 0x70, 0x65, 0x49, 0x64, 0x12, 0x1a, 0x0a, + 0x08, 0x64, 0x69, 0x73, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x18, 0x07, 0x20, 0x01, 0x28, 0x08, 0x52, + 0x08, 0x64, 0x69, 0x73, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x12, 0x18, 0x0a, 0x07, 0x76, 0x65, 0x72, + 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x08, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x07, 0x76, 0x65, 0x72, 0x73, + 0x69, 0x6f, 0x6e, 0x42, 0x3a, 0x5a, 0x38, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, + 0x6d, 0x2f, 0x68, 0x61, 0x73, 0x68, 0x69, 0x63, 0x6f, 0x72, 0x70, 0x2f, 0x77, 0x61, 0x74, 0x63, + 0x68, 0x74, 0x6f, 0x77, 0x65, 0x72, 0x2f, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x2f, + 0x69, 0x61, 0x6d, 0x2f, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x3b, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x62, + 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( diff --git a/internal/iam/user.go b/internal/iam/user.go index 0b5f7a395..041f7d53e 100644 --- a/internal/iam/user.go +++ b/internal/iam/user.go @@ -22,9 +22,9 @@ type User struct { tableName string `gorm:"-"` } -// ensure that User implements the interfaces of: Resource, Clonable and db.VetForWriter +// ensure that User implements the interfaces of: Resource, Cloneable and db.VetForWriter var _ Resource = (*User)(nil) -var _ Clonable = (*User)(nil) +var _ Cloneable = (*User)(nil) var _ db.VetForWriter = (*User)(nil) // NewUser creates a new in memory user and allows options: diff --git a/internal/proto/local/controller/api/resources/auth/v1/account.proto b/internal/proto/local/controller/api/resources/authmethods/v1/account.proto similarity index 65% rename from internal/proto/local/controller/api/resources/auth/v1/account.proto rename to internal/proto/local/controller/api/resources/authmethods/v1/account.proto index fffb2d68a..0afbcbed5 100644 --- a/internal/proto/local/controller/api/resources/auth/v1/account.proto +++ b/internal/proto/local/controller/api/resources/authmethods/v1/account.proto @@ -1,14 +1,14 @@ syntax = "proto3"; -package controller.api.resources.auth.v1; +package controller.api.resources.authmethods.v1; -option go_package = "github.com/hashicorp/watchtower/internal/gen/controller/api/resources/auth;auth"; +option go_package = "github.com/hashicorp/watchtower/internal/gen/controller/api/resources/authmethods;authmethods"; import "google/protobuf/timestamp.proto"; import "google/protobuf/wrappers.proto"; import "google/protobuf/struct.proto"; import "controller/api/resources/scopes/v1/scope.proto"; -import "controller/custom_options/v1/masks.proto"; +import "controller/custom_options/v1/options.proto"; // Account contains all fields related to an auth Account resource message Account { @@ -25,10 +25,10 @@ message Account { string auth_method_id = 3 [json_name="auth_method_id"]; // Optional name for identification purposes - google.protobuf.StringValue name = 4 [(custom_options.v1.mask_mapping) = {this:"name" that: "name"}]; + google.protobuf.StringValue name = 4 [(custom_options.v1.generate_sdk_option) = true, (custom_options.v1.mask_mapping) = {this:"name" that: "name"}]; // Optional user-set descripton for identification purposes - google.protobuf.StringValue description = 5 [(custom_options.v1.mask_mapping) = {this:"description" that: "description"}]; + google.protobuf.StringValue description = 5 [(custom_options.v1.generate_sdk_option) = true, (custom_options.v1.mask_mapping) = {this:"description" that: "description"}]; // The time this resource was created // Output only. @@ -39,18 +39,18 @@ message Account { google.protobuf.Timestamp updated_time = 7 [json_name="updated_time"]; // Whether the resource is disabled - google.protobuf.BoolValue disabled = 8; + google.protobuf.BoolValue disabled = 8 [(custom_options.v1.generate_sdk_option) = true]; // The type of this account. Possible values are: "password", "oidc". string type = 9; // The attributes that are applicable for the specific Account type. - google.protobuf.Struct attributes = 10; + google.protobuf.Struct attributes = 10 [(custom_options.v1.generate_sdk_option) = true]; } message PasswordAccountAttributes { // The username of this account. This is unique per auth method. - string username = 1; + string username = 1 [(custom_options.v1.generate_sdk_option) = true]; // The password for this account. - google.protobuf.StringValue password = 2; + google.protobuf.StringValue password = 2 [(custom_options.v1.generate_sdk_option) = true]; } diff --git a/internal/proto/local/controller/api/resources/auth/v1/auth_method.proto b/internal/proto/local/controller/api/resources/authmethods/v1/auth_method.proto similarity index 63% rename from internal/proto/local/controller/api/resources/auth/v1/auth_method.proto rename to internal/proto/local/controller/api/resources/authmethods/v1/auth_method.proto index efb863975..d0bc6f38c 100644 --- a/internal/proto/local/controller/api/resources/auth/v1/auth_method.proto +++ b/internal/proto/local/controller/api/resources/authmethods/v1/auth_method.proto @@ -1,14 +1,14 @@ syntax = "proto3"; -package controller.api.resources.auth.v1; +package controller.api.resources.authmethods.v1; -option go_package = "github.com/hashicorp/watchtower/internal/gen/controller/api/resources/auth;auth"; +option go_package = "github.com/hashicorp/watchtower/internal/gen/controller/api/resources/authmethods;authmethods"; import "google/protobuf/timestamp.proto"; import "google/protobuf/wrappers.proto"; import "google/protobuf/struct.proto"; import "controller/api/resources/scopes/v1/scope.proto"; -import "controller/custom_options/v1/masks.proto"; +import "controller/custom_options/v1/options.proto"; // AuthMethod contains all fields related to a AuthMethod resource message AuthMethod { @@ -21,10 +21,10 @@ message AuthMethod { resources.scopes.v1.ScopeInfo scope = 2; // Optional name for identification purposes - google.protobuf.StringValue name = 3 [(custom_options.v1.mask_mapping) = {this:"name" that: "name"}]; + google.protobuf.StringValue name = 3 [(custom_options.v1.generate_sdk_option) = true, (custom_options.v1.mask_mapping) = {this:"name" that: "name"}]; // Optional user-set descripton for identification purposes - google.protobuf.StringValue description = 4 [(custom_options.v1.mask_mapping) = {this:"description" that: "description"}]; + google.protobuf.StringValue description = 4 [(custom_options.v1.generate_sdk_option) = true, (custom_options.v1.mask_mapping) = {this:"description" that: "description"}]; // The time this resource was created // Output only. @@ -35,16 +35,16 @@ message AuthMethod { google.protobuf.Timestamp updated_time = 6 [json_name="updated_time"]; // The auth method type. This can be "password" or "oidc". - string type = 7; + string type = 7 [(custom_options.v1.generate_sdk_option) = true]; // The attributes that are applied for the specific Auth Method type. - google.protobuf.Struct attributes = 8; + google.protobuf.Struct attributes = 8 [(custom_options.v1.generate_sdk_option) = true]; } message PasswordAuthMethodAttributes { // The minimum length allowed for user names for accounts in this auth method. - uint32 min_user_name_length = 1; + uint32 min_user_name_length = 1 [(custom_options.v1.generate_sdk_option) = true]; // The minimum length allowed for passwords for accounts in this auth method. - uint32 min_password_length = 2; + uint32 min_password_length = 2 [(custom_options.v1.generate_sdk_option) = true]; } \ No newline at end of file diff --git a/internal/proto/local/controller/api/resources/groups/v1/group.proto b/internal/proto/local/controller/api/resources/groups/v1/group.proto index d553d8a4e..8b7fcdee7 100644 --- a/internal/proto/local/controller/api/resources/groups/v1/group.proto +++ b/internal/proto/local/controller/api/resources/groups/v1/group.proto @@ -7,7 +7,7 @@ option go_package = "github.com/hashicorp/watchtower/internal/gen/controller/api import "google/protobuf/timestamp.proto"; import "google/protobuf/wrappers.proto"; import "controller/api/resources/scopes/v1/scope.proto"; -import "controller/custom_options/v1/masks.proto"; +import "controller/custom_options/v1/options.proto"; message Member { // The ID of the member. @@ -34,10 +34,10 @@ message Group { resources.scopes.v1.ScopeInfo scope = 2; // Optional name for identification purposes - google.protobuf.StringValue name = 3 [(custom_options.v1.mask_mapping) = {this:"name" that: "name"}]; + google.protobuf.StringValue name = 3 [(custom_options.v1.generate_sdk_option) = true, (custom_options.v1.mask_mapping) = {this:"name" that: "name"}]; // Optional user-set descripton for identification purposes - google.protobuf.StringValue description = 4 [(custom_options.v1.mask_mapping) = {this:"description" that: "description"}]; + google.protobuf.StringValue description = 4 [(custom_options.v1.generate_sdk_option) = true, (custom_options.v1.mask_mapping) = {this:"description" that: "description"}]; // The time this resource was created // Output only. @@ -48,9 +48,9 @@ message Group { google.protobuf.Timestamp updated_time = 6 [json_name="updated_time"]; // Whether the resource is disabled - google.protobuf.BoolValue disabled = 7; + google.protobuf.BoolValue disabled = 7 [(custom_options.v1.generate_sdk_option) = true]; - // The version can be used in subsiquent write requests to ensure this resource + // The version can be used in subsequent write requests to ensure this resource // has not changed and to fail the write if it has. // Output only. uint32 version = 8; diff --git a/internal/proto/local/controller/api/resources/hosts/v1/host.proto b/internal/proto/local/controller/api/resources/hosts/v1/host.proto index b78689f37..1a8ccfacf 100644 --- a/internal/proto/local/controller/api/resources/hosts/v1/host.proto +++ b/internal/proto/local/controller/api/resources/hosts/v1/host.proto @@ -7,6 +7,7 @@ option go_package = "github.com/hashicorp/watchtower/internal/gen/controller/api import "google/protobuf/timestamp.proto"; import "google/protobuf/wrappers.proto"; import "controller/api/resources/scopes/v1/scope.proto"; +import "controller/custom_options/v1/options.proto"; // Host contains all fields related to a Host resource message Host { @@ -22,10 +23,10 @@ message Host { google.protobuf.StringValue type = 3; // Optional name for identification purposes - google.protobuf.StringValue name = 4; + google.protobuf.StringValue name = 4 [(custom_options.v1.generate_sdk_option) = true]; // Optional user-set description for identification purposes - google.protobuf.StringValue description = 5; + google.protobuf.StringValue description = 5 [(custom_options.v1.generate_sdk_option) = true]; // The time this resource was created // Output only. @@ -36,8 +37,8 @@ message Host { google.protobuf.Timestamp updated_time = 7 [json_name="updated_time"]; // Whether the host is disabled - google.protobuf.BoolValue disabled = 8; + google.protobuf.BoolValue disabled = 8 [(custom_options.v1.generate_sdk_option) = true]; // The address (DNS or IP name) used to reach the host - google.protobuf.StringValue address = 9; + google.protobuf.StringValue address = 9 [(custom_options.v1.generate_sdk_option) = true]; } diff --git a/internal/proto/local/controller/api/resources/hosts/v1/host_catalog.proto b/internal/proto/local/controller/api/resources/hosts/v1/host_catalog.proto index 2481651a1..397c86699 100644 --- a/internal/proto/local/controller/api/resources/hosts/v1/host_catalog.proto +++ b/internal/proto/local/controller/api/resources/hosts/v1/host_catalog.proto @@ -8,7 +8,7 @@ import "google/protobuf/timestamp.proto"; import "google/protobuf/wrappers.proto"; import "google/protobuf/struct.proto"; import "controller/api/resources/scopes/v1/scope.proto"; -import "controller/custom_options/v1/masks.proto"; +import "controller/custom_options/v1/options.proto"; // HostCatalog manages Hosts and HostSets message HostCatalog { @@ -21,13 +21,13 @@ message HostCatalog { resources.scopes.v1.ScopeInfo scope = 2; // The type of the resource, to help differentiate schemas - google.protobuf.StringValue type = 3; + google.protobuf.StringValue type = 3 [(custom_options.v1.generate_sdk_option) = true]; // Optional name for identification purposes - google.protobuf.StringValue name = 4 [(custom_options.v1.mask_mapping) = {this:"name" that: "name"}]; + google.protobuf.StringValue name = 4 [(custom_options.v1.generate_sdk_option) = true, (custom_options.v1.mask_mapping) = {this:"name" that: "name"}]; // Optional user-set description for identification purposes - google.protobuf.StringValue description = 5 [(custom_options.v1.mask_mapping) = {this:"description" that: "description"}]; + google.protobuf.StringValue description = 5 [(custom_options.v1.generate_sdk_option) = true, (custom_options.v1.mask_mapping) = {this:"description" that: "description"}]; // The time this resource was created // Output only. @@ -38,10 +38,10 @@ message HostCatalog { google.protobuf.Timestamp updated_time = 7 [json_name="updated_time"]; // Whether the catalog is disabled - google.protobuf.BoolValue disabled = 8; + google.protobuf.BoolValue disabled = 8 [(custom_options.v1.generate_sdk_option) = true]; // Attributes specific to the catalog type - google.protobuf.Struct attributes = 9; + google.protobuf.Struct attributes = 9 [(custom_options.v1.generate_sdk_option) = true]; } message StaticHostCatalogDetails { diff --git a/internal/proto/local/controller/api/resources/hosts/v1/host_set.proto b/internal/proto/local/controller/api/resources/hosts/v1/host_set.proto index 26b7a2cd6..6dc072efc 100644 --- a/internal/proto/local/controller/api/resources/hosts/v1/host_set.proto +++ b/internal/proto/local/controller/api/resources/hosts/v1/host_set.proto @@ -8,6 +8,7 @@ import "google/protobuf/timestamp.proto"; import "google/protobuf/wrappers.proto"; import "controller/api/resources/hosts/v1/host.proto"; import "controller/api/resources/scopes/v1/scope.proto"; +import "controller/custom_options/v1/options.proto"; // HostSet is a collection of Hosts created and managed by a HostCatalog message HostSet { @@ -20,13 +21,13 @@ message HostSet { resources.scopes.v1.ScopeInfo scope = 2; // The type of the resource, to help differentiate schemas - google.protobuf.StringValue type = 3; + google.protobuf.StringValue type = 3 [(custom_options.v1.generate_sdk_option) = true]; // Optional name for identification purposes - google.protobuf.StringValue name = 4; + google.protobuf.StringValue name = 4 [(custom_options.v1.generate_sdk_option) = true]; // Optional user-set description for identification purposes - google.protobuf.StringValue description = 5; + google.protobuf.StringValue description = 5 [(custom_options.v1.generate_sdk_option) = true]; // The time this resource was created // Output only. @@ -37,7 +38,7 @@ message HostSet { google.protobuf.Timestamp updated_time = 7 [json_name="updated_time"]; // Whether the host set is disabled - google.protobuf.BoolValue disabled = 8; + google.protobuf.BoolValue disabled = 8 [(custom_options.v1.generate_sdk_option) = true]; // The total count of hosts in this host set // Output only. diff --git a/internal/proto/local/controller/api/resources/roles/v1/role.proto b/internal/proto/local/controller/api/resources/roles/v1/role.proto index aa0df357e..d2a88f13b 100644 --- a/internal/proto/local/controller/api/resources/roles/v1/role.proto +++ b/internal/proto/local/controller/api/resources/roles/v1/role.proto @@ -7,7 +7,7 @@ option go_package = "github.com/hashicorp/watchtower/internal/gen/controller/api import "google/protobuf/timestamp.proto"; import "google/protobuf/wrappers.proto"; import "controller/api/resources/scopes/v1/scope.proto"; -import "controller/custom_options/v1/masks.proto"; +import "controller/custom_options/v1/options.proto"; message Principal { // The ID of the principal. @@ -62,10 +62,10 @@ message Role { resources.scopes.v1.ScopeInfo scope = 2; // Optional name for identification purposes - google.protobuf.StringValue name = 3 [(custom_options.v1.mask_mapping) = {this:"name" that: "name"}]; + google.protobuf.StringValue name = 3 [(custom_options.v1.generate_sdk_option) = true, (custom_options.v1.mask_mapping) = {this:"name" that: "name"}]; // Optional user-set description for identification purposes - google.protobuf.StringValue description = 4 [(custom_options.v1.mask_mapping) = {this:"description" that: "description"}]; + google.protobuf.StringValue description = 4 [(custom_options.v1.generate_sdk_option) = true, (custom_options.v1.mask_mapping) = {this:"description" that: "description"}]; // The time this resource was created // Output only. @@ -76,16 +76,16 @@ message Role { google.protobuf.Timestamp updated_time = 6 [json_name="updated_time"]; // Whether the resource is disabled - google.protobuf.BoolValue disabled = 7; + google.protobuf.BoolValue disabled = 7 [(custom_options.v1.generate_sdk_option) = true]; // The scope the grants will apply to. If the role is at the global scope, // this can be an org or project. If the role is at an org // scope, this can be a project within the org. It is invalid for // this to be anything other than the role's scope when the role's scope is // a project. - google.protobuf.StringValue grant_scope_id = 8 [json_name="grant_scope_id", (custom_options.v1.mask_mapping) = {this:"grant_scope_id" that: "GrantScopeId"}]; + google.protobuf.StringValue grant_scope_id = 8 [json_name="grant_scope_id", (custom_options.v1.generate_sdk_option) = true, (custom_options.v1.mask_mapping) = {this:"grant_scope_id" that: "GrantScopeId"}]; - // The version can be used in subsiquent write requests to ensure this resource + // The version can be used in subsequent write requests to ensure this resource // has not changed and to fail the write if it has. // Output only. uint32 version = 9; diff --git a/internal/proto/local/controller/api/resources/scopes/v1/scope.proto b/internal/proto/local/controller/api/resources/scopes/v1/scope.proto index 3a6451ca5..2525de9df 100644 --- a/internal/proto/local/controller/api/resources/scopes/v1/scope.proto +++ b/internal/proto/local/controller/api/resources/scopes/v1/scope.proto @@ -6,7 +6,7 @@ option go_package = "github.com/hashicorp/watchtower/internal/gen/controller/api import "google/protobuf/timestamp.proto"; import "google/protobuf/wrappers.proto"; -import "controller/custom_options/v1/masks.proto"; +import "controller/custom_options/v1/options.proto"; message ScopeInfo { // The ID of the Scope @@ -41,10 +41,10 @@ message Scope { ScopeInfo scope = 2; // Optional name for identification purposes - google.protobuf.StringValue name = 3 [(custom_options.v1.mask_mapping) = {this: "name" that: "name"}]; + google.protobuf.StringValue name = 3 [(custom_options.v1.generate_sdk_option) = true, (custom_options.v1.mask_mapping) = {this: "name" that: "name"}]; // Optional user-set descripton for identification purposes - google.protobuf.StringValue description = 4 [(custom_options.v1.mask_mapping) = {this: "description" that: "description"}]; + google.protobuf.StringValue description = 4 [(custom_options.v1.generate_sdk_option) = true, (custom_options.v1.mask_mapping) = {this: "description" that: "description"}]; // The time this resource was created // Output only. @@ -55,5 +55,10 @@ message Scope { google.protobuf.Timestamp updated_time = 6 [json_name="updated_time"]; // Whether the resource is disabled - google.protobuf.BoolValue disabled = 7; + google.protobuf.BoolValue disabled = 7 [(custom_options.v1.generate_sdk_option) = true]; + + // The version can be used in subsequent write requests to ensure this + // resource has not changed and to fail the write if it has. + // Output only. + uint32 version = 8; } diff --git a/internal/proto/local/controller/api/resources/users/v1/user.proto b/internal/proto/local/controller/api/resources/users/v1/user.proto index 5740adefa..c1026c2be 100644 --- a/internal/proto/local/controller/api/resources/users/v1/user.proto +++ b/internal/proto/local/controller/api/resources/users/v1/user.proto @@ -7,7 +7,7 @@ option go_package = "github.com/hashicorp/watchtower/internal/gen/controller/api import "google/protobuf/timestamp.proto"; import "google/protobuf/wrappers.proto"; import "controller/api/resources/scopes/v1/scope.proto"; -import "controller/custom_options/v1/masks.proto"; +import "controller/custom_options/v1/options.proto"; // User contains all fields related to a User resource message User { @@ -20,10 +20,10 @@ message User { resources.scopes.v1.ScopeInfo scope = 2; // Optional name for identification purposes - google.protobuf.StringValue name = 3 [(custom_options.v1.mask_mapping) = {this:"name" that: "name"}]; + google.protobuf.StringValue name = 3 [(custom_options.v1.generate_sdk_option) = true, (custom_options.v1.mask_mapping) = {this:"name" that: "name"}]; // Optional user-set descripton for identification purposes - google.protobuf.StringValue description = 4 [(custom_options.v1.mask_mapping) = {this:"description" that: "description"}]; + google.protobuf.StringValue description = 4 [(custom_options.v1.generate_sdk_option) = true, (custom_options.v1.mask_mapping) = {this:"description" that: "description"}]; // The time this resource was created // Output only. @@ -34,5 +34,10 @@ message User { google.protobuf.Timestamp updated_time = 6 [json_name="updated_time"]; // Whether the resource is disabled - google.protobuf.BoolValue disabled = 7; + google.protobuf.BoolValue disabled = 7 [(custom_options.v1.generate_sdk_option) = true]; + + // The version can be used in subsequent write requests to ensure this + // resource has not changed and to fail the write if it has. + // Output only. + uint32 version = 8; } diff --git a/internal/proto/local/controller/api/services/v1/auth_method_service.proto b/internal/proto/local/controller/api/services/v1/auth_method_service.proto index bd58d730c..5845b267b 100644 --- a/internal/proto/local/controller/api/services/v1/auth_method_service.proto +++ b/internal/proto/local/controller/api/services/v1/auth_method_service.proto @@ -7,7 +7,7 @@ option go_package = "github.com/hashicorp/watchtower/internal/gen/controller/api import "protoc-gen-openapiv2/options/annotations.proto"; import "google/api/annotations.proto"; import "google/protobuf/field_mask.proto"; -import "controller/api/resources/auth/v1/auth_method.proto"; +import "controller/api/resources/authmethods/v1/auth_method.proto"; service AuthMethodService { // GetAuthMethod returns a stored AuthMethod if present. The provided request @@ -93,7 +93,7 @@ message GetAuthMethodRequest { } message GetAuthMethodResponse { - resources.auth.v1.AuthMethod item = 1; + resources.authmethods.v1.AuthMethod item = 1; } message ListAuthMethodsRequest { @@ -101,26 +101,26 @@ message ListAuthMethodsRequest { } message ListAuthMethodsResponse { - repeated resources.auth.v1.AuthMethod items = 1; + repeated resources.authmethods.v1.AuthMethod items = 1; } message CreateAuthMethodRequest { - resources.auth.v1.AuthMethod item = 1; + resources.authmethods.v1.AuthMethod item = 1; } message CreateAuthMethodResponse { string uri = 1; - resources.auth.v1.AuthMethod item = 2; + resources.authmethods.v1.AuthMethod item = 2; } message UpdateAuthMethodRequest { string id = 1; - resources.auth.v1.AuthMethod item = 2; + resources.authmethods.v1.AuthMethod item = 2; google.protobuf.FieldMask update_mask = 3; } message UpdateAuthMethodResponse { - resources.auth.v1.AuthMethod item = 1; + resources.authmethods.v1.AuthMethod item = 1; } message DeleteAuthMethodRequest { diff --git a/internal/proto/local/controller/api/services/v1/authaccount_service.proto b/internal/proto/local/controller/api/services/v1/authaccount_service.proto index 78af05048..49fc7573e 100644 --- a/internal/proto/local/controller/api/services/v1/authaccount_service.proto +++ b/internal/proto/local/controller/api/services/v1/authaccount_service.proto @@ -8,7 +8,7 @@ import "protoc-gen-openapiv2/options/annotations.proto"; import "google/api/annotations.proto"; import "google/protobuf/field_mask.proto"; import "google/protobuf/wrappers.proto"; -import "controller/api/resources/auth/v1/account.proto"; +import "controller/api/resources/authmethods/v1/account.proto"; service AccountService { @@ -96,7 +96,7 @@ message GetAccountRequest { } message GetAccountResponse { - resources.auth.v1.Account item = 1; + resources.authmethods.v1.Account item = 1; } message ListAccountsRequest { @@ -105,28 +105,28 @@ message ListAccountsRequest { } message ListAccountsResponse { - repeated resources.auth.v1.Account items = 1; + repeated resources.authmethods.v1.Account items = 1; } message CreateAccountRequest { string auth_method_id = 1; - resources.auth.v1.Account item = 2; + resources.authmethods.v1.Account item = 2; } message CreateAccountResponse { string uri = 1; - resources.auth.v1.Account item = 2; + resources.authmethods.v1.Account item = 2; } message UpdateAccountRequest { string auth_method_id = 1; string id = 2; - resources.auth.v1.Account item = 3; + resources.authmethods.v1.Account item = 3; google.protobuf.FieldMask update_mask = 4; } message UpdateAccountResponse { - resources.auth.v1.Account item = 1; + resources.authmethods.v1.Account item = 1; } message DeleteAccountRequest { diff --git a/internal/proto/local/controller/api/services/v1/group_service.proto b/internal/proto/local/controller/api/services/v1/group_service.proto index 75bf2d89a..89779b95b 100644 --- a/internal/proto/local/controller/api/services/v1/group_service.proto +++ b/internal/proto/local/controller/api/services/v1/group_service.proto @@ -164,8 +164,9 @@ message CreateGroupResponse { message UpdateGroupRequest { string id = 1; - resources.groups.v1.Group item = 2; - google.protobuf.FieldMask update_mask = 3; + uint32 version = 2; + resources.groups.v1.Group item = 3; + google.protobuf.FieldMask update_mask = 4; } message UpdateGroupResponse { @@ -184,7 +185,7 @@ message AddGroupMembersRequest { string id = 1; // The version ensures the group hasn't changed since it was last retrieved and if // it has the request will fail. - google.protobuf.UInt32Value version = 2; + uint32 version = 2; repeated string member_ids = 3 [json_name="member_ids"]; } @@ -196,7 +197,7 @@ message SetGroupMembersRequest { string id = 1; // The version ensures the group hasn't changed since it was last retrieved and if // it has the request will fail. - google.protobuf.UInt32Value version = 2; + uint32 version = 2; repeated string member_ids = 3 [json_name="member_ids"]; } @@ -208,7 +209,7 @@ message RemoveGroupMembersRequest { string id = 1; // The version ensures the group hasn't changed since it was last retrieved and if // it has the request will fail. - google.protobuf.UInt32Value version = 2; + uint32 version = 2; repeated string member_ids = 3 [json_name="member_ids"]; } diff --git a/internal/proto/local/controller/api/services/v1/role_service.proto b/internal/proto/local/controller/api/services/v1/role_service.proto index 75a303040..0670f93e0 100644 --- a/internal/proto/local/controller/api/services/v1/role_service.proto +++ b/internal/proto/local/controller/api/services/v1/role_service.proto @@ -213,8 +213,9 @@ message CreateRoleResponse { // TODO: Add versions to Update and Delete role requests. message UpdateRoleRequest { string id = 1; - resources.roles.v1.Role item = 2; - google.protobuf.FieldMask update_mask = 3; + uint32 version = 2; + resources.roles.v1.Role item = 3; + google.protobuf.FieldMask update_mask = 4; } message UpdateRoleResponse { @@ -233,7 +234,7 @@ message AddRolePrincipalsRequest { string role_id = 1; // The version ensures the role hasn't changed since it was last retrieved and if // it has the request will fail. - google.protobuf.UInt32Value version = 2; + uint32 version = 2; repeated string principal_ids = 3 [json_name="principal_ids"]; } @@ -245,7 +246,7 @@ message SetRolePrincipalsRequest { string role_id = 1; // The version ensures the role hasn't changed since it was last retrieved and if // it has the request will fail. - google.protobuf.UInt32Value version = 2; + uint32 version = 2; repeated string principal_ids = 3 [json_name="principal_ids"]; } @@ -257,7 +258,7 @@ message RemoveRolePrincipalsRequest { string role_id = 1; // The version ensures the role hasn't changed since it was last retrieved and if // it has the request will fail. - google.protobuf.UInt32Value version = 2; + uint32 version = 2; repeated string principal_ids = 3 [json_name="principal_ids"]; } @@ -269,7 +270,7 @@ message AddRoleGrantsRequest { string role_id = 1; // The version ensures the role hasn't changed since it was last retrieved and if // it has the request will fail. - google.protobuf.UInt32Value version = 2; + uint32 version = 2; repeated string grant_strings = 3 [json_name="grant_strings"]; } @@ -281,7 +282,7 @@ message SetRoleGrantsRequest { string role_id = 1; // The version ensures the role hasn't changed since it was last retrieved and if // it has the request will fail. - google.protobuf.UInt32Value version = 2; + uint32 version = 2; repeated string grant_strings = 3 [json_name="grant_strings"]; } @@ -293,7 +294,7 @@ message RemoveRoleGrantsRequest { string role_id = 1; // The version ensures the role hasn't changed since it was last retrieved and if // it has the request will fail. - google.protobuf.UInt32Value version = 2; + uint32 version = 2; repeated string grant_strings = 3 [json_name="grant_strings"]; } diff --git a/internal/proto/local/controller/api/services/v1/scope_service.proto b/internal/proto/local/controller/api/services/v1/scope_service.proto index 59f4ae286..75d5eea19 100644 --- a/internal/proto/local/controller/api/services/v1/scope_service.proto +++ b/internal/proto/local/controller/api/services/v1/scope_service.proto @@ -116,8 +116,9 @@ message CreateScopeResponse { message UpdateScopeRequest { string id = 1; - resources.scopes.v1.Scope item = 2; - google.protobuf.FieldMask update_mask = 3; + uint32 version = 2; + resources.scopes.v1.Scope item = 3; + google.protobuf.FieldMask update_mask = 4; } message UpdateScopeResponse { diff --git a/internal/proto/local/controller/api/services/v1/user_service.proto b/internal/proto/local/controller/api/services/v1/user_service.proto index 32ac348f9..d179439e2 100644 --- a/internal/proto/local/controller/api/services/v1/user_service.proto +++ b/internal/proto/local/controller/api/services/v1/user_service.proto @@ -116,8 +116,9 @@ message CreateUserResponse { message UpdateUserRequest { string id = 1; - resources.users.v1.User item = 2; - google.protobuf.FieldMask update_mask = 3; + uint32 version = 2; + resources.users.v1.User item = 3; + google.protobuf.FieldMask update_mask = 4; } message UpdateUserResponse { diff --git a/internal/proto/local/controller/custom_options/v1/masks.proto b/internal/proto/local/controller/custom_options/v1/options.proto similarity index 56% rename from internal/proto/local/controller/custom_options/v1/masks.proto rename to internal/proto/local/controller/custom_options/v1/options.proto index 6da06c6f3..aee9d662c 100644 --- a/internal/proto/local/controller/custom_options/v1/masks.proto +++ b/internal/proto/local/controller/custom_options/v1/options.proto @@ -6,10 +6,15 @@ import "google/protobuf/descriptor.proto"; option go_package = "github.com/hashicorp/watchtower/internal/gen/controller/protooptions;protooptions"; extend google.protobuf.FieldOptions { - // mask_mapping is an option which tags a field with the expected field mask used by a companion proto if applied - // on the field this option is for. The value of this option should be for the field name itself and not for + // mask_mapping is an option which tags a field with the expected field mask + // used by a companion proto if applied on the field this option is for. + // The value of this option should be for the field name itself and not for // the json name. MaskMapping mask_mapping = 85464; + + // generate_sdk_option is a directive used when generating the SDK to + // indicate that an option should be created for the field + bool generate_sdk_option = 85412; } message MaskMapping { diff --git a/internal/proto/local/controller/custom_options/v1/testing.proto b/internal/proto/local/controller/custom_options/v1/testing.proto index 96deadcc9..3e955cc75 100644 --- a/internal/proto/local/controller/custom_options/v1/testing.proto +++ b/internal/proto/local/controller/custom_options/v1/testing.proto @@ -3,7 +3,7 @@ package controller.custom_options.v1; option go_package = "github.com/hashicorp/watchtower/internal/gen/controller/protooptions;protooptions"; -import "controller/custom_options/v1/masks.proto"; +import "controller/custom_options/v1/options.proto"; message TestBase { string first_field = 1 [(mask_mapping) = {this: "first_field" that: "OtherFirstField"}]; diff --git a/internal/proto/local/controller/storage/auth/password/store/v1/password.proto b/internal/proto/local/controller/storage/auth/password/store/v1/password.proto index 9a65a0b69..f6b65c319 100644 --- a/internal/proto/local/controller/storage/auth/password/store/v1/password.proto +++ b/internal/proto/local/controller/storage/auth/password/store/v1/password.proto @@ -5,7 +5,7 @@ package controller.storage.auth.password.store.v1; option go_package = "github.com/hashicorp/watchtower/internal/auth/password/store;store"; import "controller/storage/timestamp/v1/timestamp.proto"; -import "controller/custom_options/v1/masks.proto"; +import "controller/custom_options/v1/options.proto"; message AuthMethod { // @inject_tag: `gorm:"primary_key"` diff --git a/internal/proto/local/controller/storage/host/static/store/v1/static.proto b/internal/proto/local/controller/storage/host/static/store/v1/static.proto index 8e07c867b..11bc2aa6f 100644 --- a/internal/proto/local/controller/storage/host/static/store/v1/static.proto +++ b/internal/proto/local/controller/storage/host/static/store/v1/static.proto @@ -6,7 +6,7 @@ package controller.storage.host.static.store.v1; option go_package = "github.com/hashicorp/watchtower/internal/host/static/store;store"; import "controller/storage/timestamp/v1/timestamp.proto"; -import "controller/custom_options/v1/masks.proto"; +import "controller/custom_options/v1/options.proto"; message HostCatalog { // public_is is a surrogate key suitable for use in a public API. diff --git a/internal/proto/local/controller/storage/iam/store/v1/group.proto b/internal/proto/local/controller/storage/iam/store/v1/group.proto index fa9cfe346..832c93887 100644 --- a/internal/proto/local/controller/storage/iam/store/v1/group.proto +++ b/internal/proto/local/controller/storage/iam/store/v1/group.proto @@ -5,7 +5,7 @@ option go_package = "github.com/hashicorp/watchtower/internal/iam/store;store"; import "controller/storage/timestamp/v1/timestamp.proto"; import "controller/storage/iam/store/v1/scope.proto"; -import "controller/custom_options/v1/masks.proto"; +import "controller/custom_options/v1/options.proto"; message Group { // public_id is used to access the Group via an API diff --git a/internal/proto/local/controller/storage/iam/store/v1/role.proto b/internal/proto/local/controller/storage/iam/store/v1/role.proto index b75e69284..1c585b605 100644 --- a/internal/proto/local/controller/storage/iam/store/v1/role.proto +++ b/internal/proto/local/controller/storage/iam/store/v1/role.proto @@ -5,7 +5,7 @@ option go_package = "github.com/hashicorp/watchtower/internal/iam/store;store"; import "controller/storage/timestamp/v1/timestamp.proto"; import "controller/storage/iam/store/v1/scope.proto"; -import "controller/custom_options/v1/masks.proto"; +import "controller/custom_options/v1/options.proto"; message Role { // public_id is used to access the Role via an API diff --git a/internal/proto/local/controller/storage/iam/store/v1/scope.proto b/internal/proto/local/controller/storage/iam/store/v1/scope.proto index dbe759b99..2f92a270c 100644 --- a/internal/proto/local/controller/storage/iam/store/v1/scope.proto +++ b/internal/proto/local/controller/storage/iam/store/v1/scope.proto @@ -3,7 +3,7 @@ syntax = "proto3"; package controller.storage.iam.store.v1; option go_package = "github.com/hashicorp/watchtower/internal/iam/store;store"; -import "controller/custom_options/v1/masks.proto"; +import "controller/custom_options/v1/options.proto"; import "controller/storage/timestamp/v1/timestamp.proto"; message Scope { @@ -34,4 +34,8 @@ message Scope { // description of scope // @inject_tag: `gorm:"default:null"` string description = 7 [(custom_options.v1.mask_mapping) = {this: "description" that: "description"}]; + + // version allows optimistic locking of the scope + // @inject_tag: `gorm:"default:null"` + uint32 version = 8; } diff --git a/internal/proto/local/controller/storage/iam/store/v1/user.proto b/internal/proto/local/controller/storage/iam/store/v1/user.proto index 0f4886c54..8c5f0b0ca 100644 --- a/internal/proto/local/controller/storage/iam/store/v1/user.proto +++ b/internal/proto/local/controller/storage/iam/store/v1/user.proto @@ -4,7 +4,7 @@ package controller.storage.iam.store.v1; option go_package = "github.com/hashicorp/watchtower/internal/iam/store;store"; import "controller/storage/timestamp/v1/timestamp.proto"; -import "controller/custom_options/v1/masks.proto"; +import "controller/custom_options/v1/options.proto"; message User { // public_id is used to access the User via an API @@ -35,4 +35,8 @@ message User { // disabled is by default false and allows a User to be marked disabled. // @inject_tag: `gorm:"default:null"` bool disabled = 7; + + // version allows optimistic locking of the user + // @inject_tag: `gorm:"default:null"` + uint32 version = 8; } \ No newline at end of file diff --git a/internal/servers/controller/cors_test.go b/internal/servers/controller/cors_test.go index 12f8fc327..695ab20ce 100644 --- a/internal/servers/controller/cors_test.go +++ b/internal/servers/controller/cors_test.go @@ -10,7 +10,6 @@ import ( "github.com/stretchr/testify/require" "github.com/hashicorp/go-retryablehttp" - "github.com/hashicorp/watchtower/api/scopes" "github.com/hashicorp/watchtower/internal/cmd/config" ) @@ -196,7 +195,7 @@ func TestHandler_CORS(t *testing.T) { if c.provideScopeId { scopeId = "o_1234567890" if c.method == http.MethodPost { - body = &scopes.Scope{} + body = map[string]interface{}{} } } req, err = client.NewRequest(tc.Context(), c.method, "scopes", body) diff --git a/internal/servers/controller/handlers/accounts/account_service.go b/internal/servers/controller/handlers/accounts/account_service.go index 0abe93b02..06d2d0791 100644 --- a/internal/servers/controller/handlers/accounts/account_service.go +++ b/internal/servers/controller/handlers/accounts/account_service.go @@ -11,7 +11,7 @@ import ( "github.com/hashicorp/watchtower/internal/auth/password" "github.com/hashicorp/watchtower/internal/auth/password/store" "github.com/hashicorp/watchtower/internal/db" - pb "github.com/hashicorp/watchtower/internal/gen/controller/api/resources/auth" + pb "github.com/hashicorp/watchtower/internal/gen/controller/api/resources/authmethods" pbs "github.com/hashicorp/watchtower/internal/gen/controller/api/services" "github.com/hashicorp/watchtower/internal/servers/controller/handlers" "google.golang.org/grpc/codes" diff --git a/internal/servers/controller/handlers/accounts/account_service_test.go b/internal/servers/controller/handlers/accounts/account_service_test.go index 6a04568f9..d8d3a7dc9 100644 --- a/internal/servers/controller/handlers/accounts/account_service_test.go +++ b/internal/servers/controller/handlers/accounts/account_service_test.go @@ -11,7 +11,7 @@ import ( "github.com/hashicorp/watchtower/internal/auth/password" "github.com/hashicorp/watchtower/internal/authtoken" "github.com/hashicorp/watchtower/internal/db" - pb "github.com/hashicorp/watchtower/internal/gen/controller/api/resources/auth" + pb "github.com/hashicorp/watchtower/internal/gen/controller/api/resources/authmethods" "github.com/hashicorp/watchtower/internal/gen/controller/api/resources/scopes" pbs "github.com/hashicorp/watchtower/internal/gen/controller/api/services" "github.com/hashicorp/watchtower/internal/iam" diff --git a/internal/servers/controller/handlers/authmethods/authmethod_service.go b/internal/servers/controller/handlers/authmethods/authmethod_service.go index 150fb81e2..4030037fb 100644 --- a/internal/servers/controller/handlers/authmethods/authmethod_service.go +++ b/internal/servers/controller/handlers/authmethods/authmethod_service.go @@ -11,7 +11,7 @@ import ( "github.com/hashicorp/watchtower/internal/auth/password" "github.com/hashicorp/watchtower/internal/auth/password/store" "github.com/hashicorp/watchtower/internal/db" - pb "github.com/hashicorp/watchtower/internal/gen/controller/api/resources/auth" + pb "github.com/hashicorp/watchtower/internal/gen/controller/api/resources/authmethods" pbs "github.com/hashicorp/watchtower/internal/gen/controller/api/services" "github.com/hashicorp/watchtower/internal/servers/controller/handlers" "google.golang.org/grpc/codes" diff --git a/internal/servers/controller/handlers/authmethods/authmethod_service_test.go b/internal/servers/controller/handlers/authmethods/authmethod_service_test.go index 1596b5225..6d2ca67e9 100644 --- a/internal/servers/controller/handlers/authmethods/authmethod_service_test.go +++ b/internal/servers/controller/handlers/authmethods/authmethod_service_test.go @@ -10,7 +10,7 @@ import ( "github.com/hashicorp/watchtower/internal/auth" "github.com/hashicorp/watchtower/internal/auth/password" "github.com/hashicorp/watchtower/internal/db" - pb "github.com/hashicorp/watchtower/internal/gen/controller/api/resources/auth" + pb "github.com/hashicorp/watchtower/internal/gen/controller/api/resources/authmethods" "github.com/hashicorp/watchtower/internal/gen/controller/api/resources/scopes" pbs "github.com/hashicorp/watchtower/internal/gen/controller/api/services" "github.com/hashicorp/watchtower/internal/iam" diff --git a/internal/servers/controller/handlers/groups/group_service.go b/internal/servers/controller/handlers/groups/group_service.go index 3a74c0d68..ec8fd34d9 100644 --- a/internal/servers/controller/handlers/groups/group_service.go +++ b/internal/servers/controller/handlers/groups/group_service.go @@ -108,7 +108,7 @@ func (s Service) UpdateGroup(ctx context.Context, req *pbs.UpdateGroupRequest) ( if err := validateUpdateRequest(req); err != nil { return nil, err } - u, err := s.updateInRepo(ctx, authResults.Scope.GetId(), req.GetId(), req.GetUpdateMask().GetPaths(), req.GetItem()) + u, err := s.updateInRepo(ctx, authResults.Scope.GetId(), req.GetId(), req.GetVersion(), req.GetUpdateMask().GetPaths(), req.GetItem()) if err != nil { return nil, err } @@ -141,7 +141,7 @@ func (s Service) AddGroupMembers(ctx context.Context, req *pbs.AddGroupMembersRe if err := validateAddGroupMembersRequest(req); err != nil { return nil, err } - g, err := s.addMembersInRepo(ctx, req.GetId(), req.GetMemberIds(), req.GetVersion().GetValue()) + g, err := s.addMembersInRepo(ctx, req.GetId(), req.GetMemberIds(), req.GetVersion()) if err != nil { return nil, err } @@ -157,7 +157,7 @@ func (s Service) SetGroupMembers(ctx context.Context, req *pbs.SetGroupMembersRe if err := validateSetGroupMembersRequest(req); err != nil { return nil, err } - g, err := s.setMembersInRepo(ctx, req.GetId(), req.GetMemberIds(), req.GetVersion().GetValue()) + g, err := s.setMembersInRepo(ctx, req.GetId(), req.GetMemberIds(), req.GetVersion()) if err != nil { return nil, err } @@ -173,7 +173,7 @@ func (s Service) RemoveGroupMembers(ctx context.Context, req *pbs.RemoveGroupMem if err := validateRemoveGroupMembersRequest(req); err != nil { return nil, err } - g, err := s.removeMembersInRepo(ctx, req.GetId(), req.GetMemberIds(), req.GetVersion().GetValue()) + g, err := s.removeMembersInRepo(ctx, req.GetId(), req.GetMemberIds(), req.GetVersion()) if err != nil { return nil, err } @@ -224,7 +224,7 @@ func (s Service) createInRepo(ctx context.Context, scopeId string, item *pb.Grou return toProto(out, nil), nil } -func (s Service) updateInRepo(ctx context.Context, scopeId, id string, mask []string, item *pb.Group) (*pb.Group, error) { +func (s Service) updateInRepo(ctx context.Context, scopeId, id string, version uint32, mask []string, item *pb.Group) (*pb.Group, error) { var opts []iam.Option if desc := item.GetDescription(); desc != nil { opts = append(opts, iam.WithDescription(desc.GetValue())) @@ -232,11 +232,11 @@ func (s Service) updateInRepo(ctx context.Context, scopeId, id string, mask []st if name := item.GetName(); name != nil { opts = append(opts, iam.WithName(name.GetValue())) } - u, err := iam.NewGroup(scopeId, opts...) + g, err := iam.NewGroup(scopeId, opts...) if err != nil { return nil, status.Errorf(codes.Internal, "Unable to build group for update: %v.", err) } - u.PublicId = id + g.PublicId = id dbMask := maskManager.Translate(mask) if len(dbMask) == 0 { return nil, handlers.InvalidArgumentErrorf("No valid fields included in the update mask.", map[string]string{"update_mask": "No valid paths provided in the update mask."}) @@ -245,7 +245,7 @@ func (s Service) updateInRepo(ctx context.Context, scopeId, id string, mask []st if err != nil { return nil, err } - out, m, rowsUpdated, err := repo.UpdateGroup(ctx, u, dbMask) + out, m, rowsUpdated, err := repo.UpdateGroup(ctx, g, version, dbMask) if err != nil { return nil, status.Errorf(codes.Internal, "Unable to update group: %v.", err) } @@ -456,7 +456,7 @@ func validateAddGroupMembersRequest(req *pbs.AddGroupMembersRequest) error { if !validId(req.GetId(), iam.GroupPrefix+"_") { badFields["id"] = "Incorrectly formatted identifier." } - if req.GetVersion() == nil { + if req.GetVersion() == 0 { badFields["version"] = "Required field." } if len(req.GetMemberIds()) == 0 { @@ -473,7 +473,7 @@ func validateSetGroupMembersRequest(req *pbs.SetGroupMembersRequest) error { if !validId(req.GetId(), iam.GroupPrefix+"_") { badFields["id"] = "Incorrectly formatted identifier." } - if req.GetVersion() == nil { + if req.GetVersion() == 0 { badFields["version"] = "Required field." } if len(badFields) > 0 { @@ -487,7 +487,7 @@ func validateRemoveGroupMembersRequest(req *pbs.RemoveGroupMembersRequest) error if !validId(req.GetId(), iam.GroupPrefix+"_") { badFields["id"] = "Incorrectly formatted identifier." } - if req.GetVersion() == nil { + if req.GetVersion() == 0 { badFields["version"] = "Required field." } if len(req.GetMemberIds()) == 0 { diff --git a/internal/servers/controller/handlers/groups/group_service_test.go b/internal/servers/controller/handlers/groups/group_service_test.go index b3d69fdfc..eb1aed7ed 100644 --- a/internal/servers/controller/handlers/groups/group_service_test.go +++ b/internal/servers/controller/handlers/groups/group_service_test.go @@ -534,13 +534,23 @@ func TestUpdate(t *testing.T) { pg := iam.TestGroup(t, conn, p.GetPublicId(), iam.WithDescription("default"), iam.WithName("default")) _ = iam.TestGroupMember(t, conn, pg.GetPublicId(), u.GetPublicId()) - resetGroups := func() { + var ogVersion uint32 = 1 + var pgVersion uint32 = 1 + + resetGroups := func(proj bool) { repo, err := repoFn() require.NoError(err, "Couldn't get a new repo") - og, _, _, err = repo.UpdateGroup(context.Background(), og, []string{"Name", "Description"}) - require.NoError(err, "Failed to reset the group") - pg, _, _, err = repo.UpdateGroup(context.Background(), pg, []string{"Name", "Description"}) - require.NoError(err, "Failed to reset the group") + if proj { + pgVersion++ + pg, _, _, err = repo.UpdateGroup(context.Background(), pg, pgVersion, []string{"Name", "Description"}) + require.NoError(err, "Failed to reset the group") + pgVersion++ + } else { + ogVersion++ + og, _, _, err = repo.UpdateGroup(context.Background(), og, ogVersion, []string{"Name", "Description"}) + require.NoError(err, "Failed to reset the group") + ogVersion++ + } } created, err := ptypes.Timestamp(og.GetCreateTime().GetTimestamp()) @@ -868,14 +878,32 @@ func TestUpdate(t *testing.T) { } for _, tc := range cases { t.Run(tc.name, func(t *testing.T) { - defer resetGroups() + ver := ogVersion + if tc.req.Id == pg.PublicId { + ver = pgVersion + } + tc.req.Version = ver + assert := assert.New(t) req := proto.Clone(toMerge).(*pbs.UpdateGroupRequest) proto.Merge(req, tc.req) + // Test with bad version (too high, too low) + req.Version = ver + 2 + _, gErr := tested.UpdateGroup(auth.DisabledAuthTestContext(auth.WithScopeId(tc.scopeId)), req) + require.Error(gErr) + req.Version = ver - 1 + _, gErr = tested.UpdateGroup(auth.DisabledAuthTestContext(auth.WithScopeId(tc.scopeId)), req) + require.Error(gErr) + req.Version = ver + got, gErr := tested.UpdateGroup(auth.DisabledAuthTestContext(auth.WithScopeId(tc.scopeId)), req) assert.Equal(tc.errCode, status.Code(gErr), "UpdateGroup(%+v) got error %v, wanted %v", req, gErr, tc.errCode) + if tc.errCode == codes.OK { + defer resetGroups(req.Id == pg.PublicId) + } + if got != nil { assert.NotNilf(tc.res, "Expected UpdateGroup response to be nil, but was %v", got) gotUpdateTime, err := ptypes.Timestamp(got.GetItem().GetUpdatedTime()) @@ -885,8 +913,9 @@ func TestUpdate(t *testing.T) { // Clear all values which are hard to compare against. got.Item.UpdatedTime, tc.res.Item.UpdatedTime = nil, nil - // TODO: Figure out the best way to test version updates. - got.Item.Version = 0 + + assert.Equal(ver+1, got.GetItem().GetVersion()) + tc.res.Item.Version = ver + 1 } assert.Empty(cmp.Diff(got, tc.res, protocmp.Transform()), "UpdateGroup(%q) got response %q, wanted %q", req, got, tc.res) }) @@ -950,7 +979,7 @@ func TestAddMember(t *testing.T) { tc.setup(grp) req := &pbs.AddGroupMembersRequest{ Id: grp.GetPublicId(), - Version: &wrapperspb.UInt32Value{Value: grp.GetVersion()}, + Version: grp.GetVersion(), MemberIds: tc.addUsers, } @@ -979,7 +1008,7 @@ func TestAddMember(t *testing.T) { name: "Bad Group Id", req: &pbs.AddGroupMembersRequest{ Id: "bad id", - Version: &wrapperspb.UInt32Value{Value: grp.GetVersion()}, + Version: grp.GetVersion(), }, errCode: codes.InvalidArgument, }, @@ -1051,7 +1080,7 @@ func TestSetMember(t *testing.T) { tc.setup(grp) req := &pbs.SetGroupMembersRequest{ Id: grp.GetPublicId(), - Version: &wrapperspb.UInt32Value{Value: grp.GetVersion()}, + Version: grp.GetVersion(), MemberIds: tc.setUsers, } @@ -1080,7 +1109,7 @@ func TestSetMember(t *testing.T) { name: "Bad Group Id", req: &pbs.SetGroupMembersRequest{ Id: "bad id", - Version: &wrapperspb.UInt32Value{Value: grp.GetVersion()}, + Version: grp.GetVersion(), }, errCode: codes.InvalidArgument, }, @@ -1160,7 +1189,7 @@ func TestRemoveMember(t *testing.T) { tc.setup(grp) req := &pbs.RemoveGroupMembersRequest{ Id: grp.GetPublicId(), - Version: &wrapperspb.UInt32Value{Value: grp.GetVersion()}, + Version: grp.GetVersion(), MemberIds: tc.removeUsers, } @@ -1189,7 +1218,7 @@ func TestRemoveMember(t *testing.T) { name: "Bad Group Id", req: &pbs.AddGroupMembersRequest{ Id: "bad id", - Version: &wrapperspb.UInt32Value{Value: grp.GetVersion()}, + Version: grp.GetVersion(), }, errCode: codes.InvalidArgument, }, diff --git a/internal/servers/controller/handlers/roles/role_service.go b/internal/servers/controller/handlers/roles/role_service.go index d3767f6a4..359a38c64 100644 --- a/internal/servers/controller/handlers/roles/role_service.go +++ b/internal/servers/controller/handlers/roles/role_service.go @@ -110,7 +110,7 @@ func (s Service) UpdateRole(ctx context.Context, req *pbs.UpdateRoleRequest) (*p if err := validateUpdateRequest(req, authResults.Scope); err != nil { return nil, err } - u, err := s.updateInRepo(ctx, authResults.Scope.GetId(), req.GetId(), req.GetUpdateMask().GetPaths(), req.GetItem()) + u, err := s.updateInRepo(ctx, authResults.Scope.GetId(), req.GetId(), req.GetVersion(), req.GetUpdateMask().GetPaths(), req.GetItem()) if err != nil { return nil, err } @@ -143,7 +143,7 @@ func (s Service) AddRolePrincipals(ctx context.Context, req *pbs.AddRolePrincipa if err := validateAddRolePrincipalsRequest(req); err != nil { return nil, err } - r, err := s.addPrinciplesInRepo(ctx, req.GetRoleId(), req.GetPrincipalIds(), req.GetVersion().GetValue()) + r, err := s.addPrinciplesInRepo(ctx, req.GetRoleId(), req.GetPrincipalIds(), req.GetVersion()) if err != nil { return nil, err } @@ -160,7 +160,7 @@ func (s Service) SetRolePrincipals(ctx context.Context, req *pbs.SetRolePrincipa if err := validateSetRolePrincipalsRequest(req); err != nil { return nil, err } - r, err := s.setPrinciplesInRepo(ctx, req.GetRoleId(), req.GetPrincipalIds(), req.GetVersion().GetValue()) + r, err := s.setPrinciplesInRepo(ctx, req.GetRoleId(), req.GetPrincipalIds(), req.GetVersion()) if err != nil { return nil, err } @@ -177,7 +177,7 @@ func (s Service) RemoveRolePrincipals(ctx context.Context, req *pbs.RemoveRolePr if err := validateRemoveRolePrincipalsRequest(req); err != nil { return nil, err } - r, err := s.removePrinciplesInRepo(ctx, req.GetRoleId(), req.GetPrincipalIds(), req.GetVersion().GetValue()) + r, err := s.removePrinciplesInRepo(ctx, req.GetRoleId(), req.GetPrincipalIds(), req.GetVersion()) if err != nil { return nil, err } @@ -194,7 +194,7 @@ func (s Service) AddRoleGrants(ctx context.Context, req *pbs.AddRoleGrantsReques if err := validateAddRoleGrantsRequest(req); err != nil { return nil, err } - r, err := s.addGrantsInRepo(ctx, req.GetRoleId(), req.GetGrantStrings(), req.GetVersion().GetValue()) + r, err := s.addGrantsInRepo(ctx, req.GetRoleId(), req.GetGrantStrings(), req.GetVersion()) if err != nil { return nil, err } @@ -211,7 +211,7 @@ func (s Service) SetRoleGrants(ctx context.Context, req *pbs.SetRoleGrantsReques if err := validateSetRoleGrantsRequest(req); err != nil { return nil, err } - r, err := s.setGrantsInRepo(ctx, req.GetRoleId(), req.GetGrantStrings(), req.GetVersion().GetValue()) + r, err := s.setGrantsInRepo(ctx, req.GetRoleId(), req.GetGrantStrings(), req.GetVersion()) if err != nil { return nil, err } @@ -228,7 +228,7 @@ func (s Service) RemoveRoleGrants(ctx context.Context, req *pbs.RemoveRoleGrants if err := validateRemoveRoleGrantsRequest(req); err != nil { return nil, err } - r, err := s.removeGrantsInRepo(ctx, req.GetRoleId(), req.GetGrantStrings(), req.GetVersion().GetValue()) + r, err := s.removeGrantsInRepo(ctx, req.GetRoleId(), req.GetGrantStrings(), req.GetVersion()) if err != nil { return nil, err } @@ -283,7 +283,7 @@ func (s Service) createInRepo(ctx context.Context, scopeId string, item *pb.Role return toProto(out, nil, nil), nil } -func (s Service) updateInRepo(ctx context.Context, scopeId, id string, mask []string, item *pb.Role) (*pb.Role, error) { +func (s Service) updateInRepo(ctx context.Context, scopeId, id string, version uint32, mask []string, item *pb.Role) (*pb.Role, error) { var opts []iam.Option if desc := item.GetDescription(); desc != nil { opts = append(opts, iam.WithDescription(desc.GetValue())) @@ -308,7 +308,7 @@ func (s Service) updateInRepo(ctx context.Context, scopeId, id string, mask []st if err != nil { return nil, err } - out, pr, gr, rowsUpdated, err := repo.UpdateRole(ctx, u, dbMask) + out, pr, gr, rowsUpdated, err := repo.UpdateRole(ctx, u, version, dbMask) if err != nil { return nil, status.Errorf(codes.Internal, "Unable to update role: %v.", err) } @@ -638,7 +638,7 @@ func validateAddRolePrincipalsRequest(req *pbs.AddRolePrincipalsRequest) error { if !validId(req.GetRoleId(), iam.RolePrefix+"_") { badFields["id"] = "Incorrectly formatted identifier." } - if req.GetVersion() == nil { + if req.GetVersion() == 0 { badFields["version"] = "Required field." } if len(req.GetPrincipalIds()) == 0 { @@ -655,7 +655,7 @@ func validateSetRolePrincipalsRequest(req *pbs.SetRolePrincipalsRequest) error { if !validId(req.GetRoleId(), iam.RolePrefix+"_") { badFields["id"] = "Incorrectly formatted identifier." } - if req.GetVersion() == nil { + if req.GetVersion() == 0 { badFields["version"] = "Required field." } if len(badFields) > 0 { @@ -669,7 +669,7 @@ func validateRemoveRolePrincipalsRequest(req *pbs.RemoveRolePrincipalsRequest) e if !validId(req.GetRoleId(), iam.RolePrefix+"_") { badFields["id"] = "Incorrectly formatted identifier." } - if req.GetVersion() == nil { + if req.GetVersion() == 0 { badFields["version"] = "Required field." } if len(req.GetPrincipalIds()) == 0 { @@ -686,7 +686,7 @@ func validateAddRoleGrantsRequest(req *pbs.AddRoleGrantsRequest) error { if !validId(req.GetRoleId(), iam.RolePrefix+"_") { badFields["id"] = "Incorrectly formatted identifier." } - if req.GetVersion() == nil { + if req.GetVersion() == 0 { badFields["version"] = "Required field." } if len(req.GetGrantStrings()) == 0 { @@ -703,7 +703,7 @@ func validateSetRoleGrantsRequest(req *pbs.SetRoleGrantsRequest) error { if !validId(req.GetRoleId(), iam.RolePrefix+"_") { badFields["id"] = "Incorrectly formatted identifier." } - if req.GetVersion() == nil { + if req.GetVersion() == 0 { badFields["version"] = "Required field." } if len(badFields) > 0 { @@ -717,7 +717,7 @@ func validateRemoveRoleGrantsRequest(req *pbs.RemoveRoleGrantsRequest) error { if !validId(req.GetRoleId(), iam.RolePrefix+"_") { badFields["id"] = "Incorrectly formatted identifier." } - if req.GetVersion() == nil { + if req.GetVersion() == 0 { badFields["version"] = "Required field." } if len(req.GetGrantStrings()) == 0 { diff --git a/internal/servers/controller/handlers/roles/role_service_test.go b/internal/servers/controller/handlers/roles/role_service_test.go index 5689f0ccc..a298d3eec 100644 --- a/internal/servers/controller/handlers/roles/role_service_test.go +++ b/internal/servers/controller/handlers/roles/role_service_test.go @@ -530,16 +530,26 @@ func TestUpdate(t *testing.T) { ScopeId: u.GetScopeId(), } + var orVersion uint32 = 1 + var prVersion uint32 = 1 + tested, err := roles.NewService(repoFn) require.NoError(t, err, "Error when getting new role service.") - resetRoles := func() { + resetRoles := func(proj bool) { repo, err := repoFn() require.NoError(t, err, "Couldn't get a new repo") - or, _, _, _, err = repo.UpdateRole(context.Background(), or, []string{"Name", "Description"}) - require.NoError(t, err, "Failed to reset the role") - pr, _, _, _, err = repo.UpdateRole(context.Background(), pr, []string{"Name", "Description"}) - require.NoError(t, err, "Failed to reset the role") + if proj { + prVersion++ + pr, _, _, _, err = repo.UpdateRole(context.Background(), pr, prVersion, []string{"Name", "Description"}) + require.NoError(t, err, "Failed to reset the role") + prVersion++ + } else { + orVersion++ + or, _, _, _, err = repo.UpdateRole(context.Background(), or, orVersion, []string{"Name", "Description"}) + require.NoError(t, err, "Failed to reset the role") + orVersion++ + } } created, err := ptypes.Timestamp(or.GetCreateTime().GetTimestamp()) @@ -805,7 +815,6 @@ func TestUpdate(t *testing.T) { { name: "Cant change Id", req: &pbs.UpdateRoleRequest{ - Id: or.GetPublicId(), UpdateMask: &field_mask.FieldMask{ Paths: []string{"id"}, }, @@ -872,14 +881,32 @@ func TestUpdate(t *testing.T) { } for _, tc := range cases { t.Run(tc.name, func(t *testing.T) { - defer resetRoles() + ver := orVersion + if tc.req.Id == pr.PublicId { + ver = prVersion + } + tc.req.Version = ver + assert, require := assert.New(t), require.New(t) req := proto.Clone(toMerge).(*pbs.UpdateRoleRequest) proto.Merge(req, tc.req) + // Test with bad version (too high, too low) + req.Version = ver + 2 + _, gErr := tested.UpdateRole(auth.DisabledAuthTestContext(auth.WithScopeId(tc.scopeId)), req) + require.Error(gErr) + req.Version = ver - 1 + _, gErr = tested.UpdateRole(auth.DisabledAuthTestContext(auth.WithScopeId(tc.scopeId)), req) + require.Error(gErr) + req.Version = ver + got, gErr := tested.UpdateRole(auth.DisabledAuthTestContext(auth.WithScopeId(tc.scopeId)), req) assert.Equal(tc.errCode, status.Code(gErr), "UpdateRole(%+v) got error %v, wanted %v", req, gErr, tc.errCode) + if tc.errCode == codes.OK { + defer resetRoles(req.Id == pr.PublicId) + } + if got != nil { assert.NotNilf(tc.res, "Expected UpdateRole response to be nil, but was %v", got) gotUpdateTime, err := ptypes.Timestamp(got.GetItem().GetUpdatedTime()) @@ -890,8 +917,8 @@ func TestUpdate(t *testing.T) { // Clear all values which are hard to compare against. got.Item.UpdatedTime, tc.res.Item.UpdatedTime = nil, nil - // TODO: Figure out the best way to test versions when updating roles - got.GetItem().Version = 0 + assert.Equal(ver+1, got.GetItem().GetVersion()) + tc.res.Item.Version = ver + 1 } assert.Empty(cmp.Diff(got, tc.res, protocmp.Transform()), "UpdateRole(%q) got response\n%q,\nwanted\n%q", req, got, tc.res) }) @@ -974,7 +1001,7 @@ func TestAddPrincipal(t *testing.T) { tc.setup(role) req := &pbs.AddRolePrincipalsRequest{ RoleId: role.GetPublicId(), - Version: &wrapperspb.UInt32Value{Value: role.GetVersion()}, + Version: role.GetVersion(), PrincipalIds: append(tc.addUsers, tc.addGroups...), } @@ -1003,7 +1030,7 @@ func TestAddPrincipal(t *testing.T) { name: "Bad Role Id", req: &pbs.AddRolePrincipalsRequest{ RoleId: "bad id", - Version: &wrapperspb.UInt32Value{Value: role.GetVersion()}, + Version: role.GetVersion(), }, errCode: codes.InvalidArgument, }, @@ -1094,7 +1121,7 @@ func TestSetPrincipal(t *testing.T) { tc.setup(role) req := &pbs.SetRolePrincipalsRequest{ RoleId: role.GetPublicId(), - Version: &wrapperspb.UInt32Value{Value: role.GetVersion()}, + Version: role.GetVersion(), PrincipalIds: append(tc.setUsers, tc.setGroups...), } @@ -1123,7 +1150,7 @@ func TestSetPrincipal(t *testing.T) { name: "Bad Role Id", req: &pbs.SetRolePrincipalsRequest{ RoleId: "bad id", - Version: &wrapperspb.UInt32Value{Value: role.GetVersion()}, + Version: role.GetVersion(), }, errCode: codes.InvalidArgument, }, @@ -1232,7 +1259,7 @@ func TestRemovePrincipal(t *testing.T) { tc.setup(role) req := &pbs.RemoveRolePrincipalsRequest{ RoleId: role.GetPublicId(), - Version: &wrapperspb.UInt32Value{Value: role.GetVersion()}, + Version: role.GetVersion(), PrincipalIds: append(tc.removeUsers, tc.removeGroups...), } @@ -1261,7 +1288,7 @@ func TestRemovePrincipal(t *testing.T) { name: "Bad Role Id", req: &pbs.AddRolePrincipalsRequest{ RoleId: "bad id", - Version: &wrapperspb.UInt32Value{Value: role.GetVersion()}, + Version: role.GetVersion(), }, errCode: codes.InvalidArgument, }, @@ -1341,7 +1368,7 @@ func TestAddGrants(t *testing.T) { } req := &pbs.AddRoleGrantsRequest{ RoleId: role.GetPublicId(), - Version: &wrapperspb.UInt32Value{Value: role.GetVersion()}, + Version: role.GetVersion(), } scopeId := o.GetPublicId() if o != scope { @@ -1371,7 +1398,7 @@ func TestAddGrants(t *testing.T) { req: &pbs.AddRoleGrantsRequest{ RoleId: "bad id", GrantStrings: []string{"id=*;actions=create"}, - Version: &wrapperspb.UInt32Value{Value: role.GetVersion()}, + Version: role.GetVersion(), }, errCode: codes.InvalidArgument, }, @@ -1439,7 +1466,7 @@ func TestSetGrants(t *testing.T) { } req := &pbs.SetRoleGrantsRequest{ RoleId: role.GetPublicId(), - Version: &wrapperspb.UInt32Value{Value: role.GetVersion()}, + Version: role.GetVersion(), } scopeId := o.GetPublicId() if o != scope { @@ -1471,7 +1498,7 @@ func TestSetGrants(t *testing.T) { req: &pbs.SetRoleGrantsRequest{ RoleId: "bad id", GrantStrings: []string{"id=*;actions=create"}, - Version: &wrapperspb.UInt32Value{Value: role.GetVersion()}, + Version: role.GetVersion(), }, errCode: codes.InvalidArgument, }, @@ -1538,7 +1565,7 @@ func TestRemoveGrants(t *testing.T) { } req := &pbs.RemoveRoleGrantsRequest{ RoleId: role.GetPublicId(), - Version: &wrapperspb.UInt32Value{Value: role.GetVersion()}, + Version: role.GetVersion(), } scopeId := o.GetPublicId() if o != scope { @@ -1571,7 +1598,7 @@ func TestRemoveGrants(t *testing.T) { req: &pbs.RemoveRoleGrantsRequest{ RoleId: "bad id", GrantStrings: []string{"id=*;actions=create"}, - Version: &wrapperspb.UInt32Value{Value: role.GetVersion()}, + Version: role.GetVersion(), }, errCode: codes.InvalidArgument, }, diff --git a/internal/servers/controller/handlers/scopes/scope_service.go b/internal/servers/controller/handlers/scopes/scope_service.go index 0e2223947..403168aa6 100644 --- a/internal/servers/controller/handlers/scopes/scope_service.go +++ b/internal/servers/controller/handlers/scopes/scope_service.go @@ -126,7 +126,7 @@ func (s Service) UpdateScope(ctx context.Context, req *pbs.UpdateScopeRequest) ( if err := validateUpdateRequest(req); err != nil { return nil, err } - p, err := s.updateInRepo(ctx, authResults.Scope, req.GetId(), req.GetUpdateMask().GetPaths(), req.GetItem()) + p, err := s.updateInRepo(ctx, authResults.Scope, req.GetId(), req.GetVersion(), req.GetUpdateMask().GetPaths(), req.GetItem()) if err != nil { return nil, err } @@ -199,7 +199,7 @@ func (s Service) createInRepo(ctx context.Context, parentScope *scopes.ScopeInfo return ToProto(out), nil } -func (s Service) updateInRepo(ctx context.Context, parentScope *scopes.ScopeInfo, scopeId string, mask []string, item *pb.Scope) (*pb.Scope, error) { +func (s Service) updateInRepo(ctx context.Context, parentScope *scopes.ScopeInfo, scopeId string, version uint32, mask []string, item *pb.Scope) (*pb.Scope, error) { var opts []iam.Option if desc := item.GetDescription(); desc != nil { opts = append(opts, iam.WithDescription(desc.GetValue())) @@ -227,7 +227,7 @@ func (s Service) updateInRepo(ctx context.Context, parentScope *scopes.ScopeInfo if err != nil { return nil, err } - out, rowsUpdated, err := repo.UpdateScope(ctx, iamScope, dbMask) + out, rowsUpdated, err := repo.UpdateScope(ctx, iamScope, version, dbMask) if err != nil { return nil, status.Errorf(codes.Internal, "Unable to update project: %v.", err) } @@ -289,6 +289,7 @@ func ToProto(in *iam.Scope) *pb.Scope { Id: in.GetPublicId(), CreatedTime: in.GetCreateTime().GetTimestamp(), UpdatedTime: in.GetUpdateTime().GetTimestamp(), + Version: in.GetVersion(), } if in.GetDescription() != "" { out.Description = &wrapperspb.StringValue{Value: in.GetDescription()} diff --git a/internal/servers/controller/handlers/scopes/scope_service_test.go b/internal/servers/controller/handlers/scopes/scope_service_test.go index 6f7a70bef..67ef550b5 100644 --- a/internal/servers/controller/handlers/scopes/scope_service_test.go +++ b/internal/servers/controller/handlers/scopes/scope_service_test.go @@ -41,14 +41,14 @@ func createDefaultScopesAndRepo(t *testing.T) (*iam.Scope, *iam.Scope, func() (* oRes.Description = "defaultProj" repo, err := repoFn() require.NoError(t, err) - oRes, _, err = repo.UpdateScope(context.Background(), oRes, []string{"Name", "Description"}) + oRes, _, err = repo.UpdateScope(context.Background(), oRes, 1, []string{"Name", "Description"}) require.NoError(t, err) pRes.Name = "defaultProj" pRes.Description = "defaultProj" repo, err = repoFn() require.NoError(t, err) - pRes, _, err = repo.UpdateScope(context.Background(), pRes, []string{"Name", "Description"}) + pRes, _, err = repo.UpdateScope(context.Background(), pRes, 1, []string{"Name", "Description"}) require.NoError(t, err) return oRes, pRes, repoFn } @@ -66,6 +66,7 @@ func TestGet(t *testing.T) { Description: &wrapperspb.StringValue{Value: org.GetDescription()}, CreatedTime: org.CreateTime.GetTimestamp(), UpdatedTime: org.UpdateTime.GetTimestamp(), + Version: 2, } pScope := &pb.Scope{ @@ -75,6 +76,7 @@ func TestGet(t *testing.T) { Description: &wrapperspb.StringValue{Value: proj.GetDescription()}, CreatedTime: proj.CreateTime.GetTimestamp(), UpdatedTime: proj.UpdateTime.GetTimestamp(), + Version: 2, } cases := []struct { @@ -140,7 +142,7 @@ func TestGet(t *testing.T) { got, gErr := s.GetScope(auth.DisabledAuthTestContext(auth.WithScopeId(tc.scopeId)), req) assert.Equal(tc.errCode, status.Code(gErr), "GetScope(%+v) got error\n%v, wanted\n%v", req, gErr, tc.errCode) - assert.Empty(cmp.Diff(got, tc.res, protocmp.Transform()), "GetScope(%q) got response\n%q, wanted\n%q", req, got, tc.res) + assert.Empty(cmp.Diff(tc.res, got, protocmp.Transform()), "GetScope(%q) got response\n%q, wanted\n%q", req, got, tc.res) }) } } @@ -216,6 +218,7 @@ func TestList(t *testing.T) { Scope: globalScope, CreatedTime: o.GetCreateTime().GetTimestamp(), UpdatedTime: o.GetUpdateTime().GetTimestamp(), + Version: 1, }) } wantOrgs = append(wantOrgs, initialOrgs...) @@ -232,6 +235,7 @@ func TestList(t *testing.T) { Scope: &pb.ScopeInfo{Id: oWithProjects.GetPublicId(), Type: scope.Org.String()}, CreatedTime: p.GetCreateTime().GetTimestamp(), UpdatedTime: p.GetUpdateTime().GetTimestamp(), + Version: 1, }) } scopes.SortScopes(wantProjects) @@ -418,6 +422,7 @@ func TestCreate(t *testing.T) { Scope: &pb.ScopeInfo{Id: defaultOrg.GetPublicId(), Type: scope.Org.String()}, Name: &wrapperspb.StringValue{Value: "name"}, Description: &wrapperspb.StringValue{Value: "desc"}, + Version: 1, }, }, errCode: codes.OK, @@ -438,6 +443,7 @@ func TestCreate(t *testing.T) { Scope: &pb.ScopeInfo{Id: scope.Global.String(), Type: scope.Global.String()}, Name: &wrapperspb.StringValue{Value: "name"}, Description: &wrapperspb.StringValue{Value: "desc"}, + Version: 1, }, }, errCode: codes.OK, @@ -513,18 +519,25 @@ func TestUpdate(t *testing.T) { tested, err := scopes.NewService(repoFn) require.NoError(err, "Error when getting new project service.") + var orgVersion uint32 = 2 + var projVersion uint32 = 2 + resetOrg := func() { + orgVersion++ repo, err := repoFn() require.NoError(err, "Couldn't get a new repo") - org, _, err = repo.UpdateScope(context.Background(), org, []string{"Name", "Description"}) + org, _, err = repo.UpdateScope(context.Background(), org, orgVersion, []string{"Name", "Description"}) require.NoError(err, "Failed to reset the org") + orgVersion++ } resetProject := func() { + projVersion++ repo, err := repoFn() require.NoError(err, "Couldn't get a new repo") - proj, _, err = repo.UpdateScope(context.Background(), proj, []string{"Name", "Description"}) + proj, _, err = repo.UpdateScope(context.Background(), proj, projVersion, []string{"Name", "Description"}) require.NoError(err, "Failed to reset the project") + projVersion++ } projCreated, err := ptypes.Timestamp(proj.GetCreateTime().GetTimestamp()) @@ -801,15 +814,27 @@ func TestUpdate(t *testing.T) { } for _, tc := range cases { t.Run(tc.name, func(t *testing.T) { - defer resetProject() - defer resetOrg() + ver := orgVersion + if tc.req.Id == proj.PublicId { + ver = projVersion + } + tc.req.Version = ver + assert := assert.New(t) var req *pbs.UpdateScopeRequest switch tc.scopeId { case scope.Global.String(): req = proto.Clone(orgToMerge).(*pbs.UpdateScopeRequest) + if tc.errCode == codes.OK { + defer resetOrg() + } default: + ver = projVersion + tc.req.Version = ver req = proto.Clone(projToMerge).(*pbs.UpdateScopeRequest) + if tc.errCode == codes.OK { + defer resetProject() + } } proto.Merge(req, tc.req) @@ -825,6 +850,9 @@ func TestUpdate(t *testing.T) { // Clear all values which are hard to compare against. got.Item.UpdatedTime, tc.res.Item.UpdatedTime = nil, nil + + assert.Equal(ver+1, got.GetItem().GetVersion()) + tc.res.Item.Version = ver + 1 } assert.Empty(cmp.Diff(got, tc.res, protocmp.Transform()), "UpdateScope(%q) got response\n%q, wanted\n%q", req, got, tc.res) }) diff --git a/internal/servers/controller/handlers/users/user_service.go b/internal/servers/controller/handlers/users/user_service.go index 07a235624..99fd8c4f1 100644 --- a/internal/servers/controller/handlers/users/user_service.go +++ b/internal/servers/controller/handlers/users/user_service.go @@ -108,7 +108,7 @@ func (s Service) UpdateUser(ctx context.Context, req *pbs.UpdateUserRequest) (*p if err := validateUpdateRequest(req); err != nil { return nil, err } - u, err := s.updateInRepo(ctx, authResults.Scope.GetId(), req.GetId(), req.GetUpdateMask().GetPaths(), req.GetItem()) + u, err := s.updateInRepo(ctx, authResults.Scope.GetId(), req.GetId(), req.GetVersion(), req.GetUpdateMask().GetPaths(), req.GetItem()) if err != nil { return nil, err } @@ -176,7 +176,7 @@ func (s Service) createInRepo(ctx context.Context, orgId string, item *pb.User) return toProto(out), nil } -func (s Service) updateInRepo(ctx context.Context, orgId, id string, mask []string, item *pb.User) (*pb.User, error) { +func (s Service) updateInRepo(ctx context.Context, orgId, id string, version uint32, mask []string, item *pb.User) (*pb.User, error) { var opts []iam.Option if desc := item.GetDescription(); desc != nil { opts = append(opts, iam.WithDescription(desc.GetValue())) @@ -197,7 +197,7 @@ func (s Service) updateInRepo(ctx context.Context, orgId, id string, mask []stri if err != nil { return nil, err } - out, rowsUpdated, err := repo.UpdateUser(ctx, u, dbMask) + out, rowsUpdated, err := repo.UpdateUser(ctx, u, version, dbMask) if err != nil { return nil, status.Errorf(codes.Internal, "Unable to update user: %v.", err) } @@ -243,6 +243,7 @@ func toProto(in *iam.User) *pb.User { Id: in.GetPublicId(), CreatedTime: in.GetCreateTime().GetTimestamp(), UpdatedTime: in.GetUpdateTime().GetTimestamp(), + Version: in.GetVersion(), } if in.GetDescription() != "" { out.Description = &wrapperspb.StringValue{Value: in.GetDescription()} diff --git a/internal/servers/controller/handlers/users/user_service_test.go b/internal/servers/controller/handlers/users/user_service_test.go index 03df0873e..c11a5c563 100644 --- a/internal/servers/controller/handlers/users/user_service_test.go +++ b/internal/servers/controller/handlers/users/user_service_test.go @@ -56,6 +56,7 @@ func TestGet(t *testing.T) { Description: &wrapperspb.StringValue{Value: u.GetDescription()}, CreatedTime: u.CreateTime.GetTimestamp(), UpdatedTime: u.UpdateTime.GetTimestamp(), + Version: 1, } cases := []struct { @@ -129,6 +130,7 @@ func TestList(t *testing.T) { Scope: &scopes.ScopeInfo{Id: u.GetScopeId(), Type: scope.Org.String()}, CreatedTime: u.GetCreateTime().GetTimestamp(), UpdatedTime: u.GetUpdateTime().GetTimestamp(), + Version: 1, }) } @@ -262,6 +264,7 @@ func TestCreate(t *testing.T) { Scope: &scopes.ScopeInfo{Id: defaultUser.GetScopeId(), Type: scope.Org.String()}, Name: &wrapperspb.StringValue{Value: "name"}, Description: &wrapperspb.StringValue{Value: "desc"}, + Version: 1, }, }, errCode: codes.OK, @@ -324,22 +327,25 @@ func TestCreate(t *testing.T) { } func TestUpdate(t *testing.T) { - require := require.New(t) u, repoFn := createDefaultUserAndRepo(t) tested, err := users.NewService(repoFn) - require.NoError(err, "Error when getting new user service.") + require.NoError(t, err, "Error when getting new user service.") + + created, err := ptypes.Timestamp(u.GetCreateTime().GetTimestamp()) + require.NoError(t, err, "Error converting proto to timestamp") + toMerge := &pbs.UpdateUserRequest{ + Id: u.GetPublicId(), + } + + var version uint32 = 1 resetUser := func() { repo, err := repoFn() - require.NoError(err, "Couldn't get a new repo") - u, _, err = repo.UpdateUser(context.Background(), u, []string{"Name", "Description"}) - require.NoError(err, "Failed to reset the user") - } - - created, err := ptypes.Timestamp(u.GetCreateTime().GetTimestamp()) - require.NoError(err, "Error converting proto to timestamp") - toMerge := &pbs.UpdateUserRequest{ - Id: u.GetPublicId(), + require.NoError(t, err, "Couldn't get a new repo") + version++ // From the test case that resulted in calling this + u, _, err = repo.UpdateUser(context.Background(), u, version, []string{"Name", "Description"}) + require.NoError(t, err, "Failed to reset the user") + version++ } cases := []struct { @@ -548,13 +554,27 @@ func TestUpdate(t *testing.T) { } for _, tc := range cases { t.Run(tc.name, func(t *testing.T) { - defer resetUser() - assert := assert.New(t) + tc.req.Version = version + + assert, require := assert.New(t), require.New(t) req := proto.Clone(toMerge).(*pbs.UpdateUserRequest) proto.Merge(req, tc.req) + // Test with bad version (too high, too low) + req.Version = version + 2 + _, gErr := tested.UpdateUser(auth.DisabledAuthTestContext(auth.WithScopeId(u.GetScopeId())), req) + require.Error(gErr) + req.Version = version - 1 + _, gErr = tested.UpdateUser(auth.DisabledAuthTestContext(auth.WithScopeId(u.GetScopeId())), req) + require.Error(gErr) + req.Version = version + got, gErr := tested.UpdateUser(auth.DisabledAuthTestContext(auth.WithScopeId(u.GetScopeId())), req) - assert.Equal(tc.errCode, status.Code(gErr), "UpdateUser(%+v) got error %v, wanted %v", req, gErr, tc.errCode) + require.Equal(tc.errCode, status.Code(gErr), "UpdateUser(%+v) got error %v, wanted %v", req, gErr, tc.errCode) + + if tc.errCode == codes.OK { + defer resetUser() + } if got != nil { assert.NotNilf(tc.res, "Expected UpdateUser response to be nil, but was %v", got) @@ -565,8 +585,10 @@ func TestUpdate(t *testing.T) { // Clear all values which are hard to compare against. got.Item.UpdatedTime, tc.res.Item.UpdatedTime = nil, nil + assert.Equal(version+1, got.GetItem().GetVersion()) + tc.res.Item.Version = version + 1 } - assert.Empty(cmp.Diff(got, tc.res, protocmp.Transform()), "UpdateUser(%q) got response %q, wanted %q", req, got, tc.res) + assert.Empty(cmp.Diff(tc.res, got, protocmp.Transform()), "UpdateUser(%q) got response %q, wanted %q", req, got, tc.res) }) } }