diff --git a/Makefile b/Makefile index 5c7931da3..b2cce98d5 100644 --- a/Makefile +++ b/Makefile @@ -212,6 +212,8 @@ protobuild: @protoc-go-inject-tag -input=./internal/gen/controller/api/services/host_catalog_service.pb.go @protoc-go-inject-tag -input=./sdk/pbs/controller/api/resources/hostsets/host_set.pb.go @protoc-go-inject-tag -input=./internal/gen/controller/api/services/host_set_service.pb.go + @protoc-go-inject-tag -input=./sdk/pbs/controller/api/resources/storagebuckets/storage_bucket.pb.go + @protoc-go-inject-tag -input=./internal/gen/controller/api/services/storage_bucket_service.pb.go @protoc-go-inject-tag -input=./sdk/pbs/controller/api/resources/authtokens/authtoken.pb.go @protoc-go-inject-tag -input=./internal/gen/controller/api/services/authtokens_service.pb.go @protoc-go-inject-tag -input=./sdk/pbs/controller/api/resources/managedgroups/managed_group.pb.go diff --git a/api/storagebuckets/option.gen.go b/api/storagebuckets/option.gen.go new file mode 100644 index 000000000..da32bdb0e --- /dev/null +++ b/api/storagebuckets/option.gen.go @@ -0,0 +1,188 @@ +// Copyright (c) HashiCorp, Inc. +// SPDX-License-Identifier: MPL-2.0 + +package storagebuckets + +import ( + "fmt" + "strconv" + "strings" + + "github.com/hashicorp/boundary/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 { + postMap map[string]interface{} + queryMap map[string]string + withAutomaticVersioning bool + withSkipCurlOutput bool + withFilter string + withRecursive bool +} + +func getDefaultOptions() options { + return options{ + postMap: make(map[string]interface{}), + queryMap: make(map[string]string), + } +} + +func getOpts(opt ...Option) (options, []api.Option) { + opts := getDefaultOptions() + for _, o := range opt { + if o != nil { + o(&opts) + } + } + var apiOpts []api.Option + if opts.withSkipCurlOutput { + apiOpts = append(apiOpts, api.WithSkipCurlOutput(true)) + } + if opts.withFilter != "" { + opts.queryMap["filter"] = opts.withFilter + } + if opts.withRecursive { + opts.queryMap["recursive"] = strconv.FormatBool(opts.withRecursive) + } + return opts, apiOpts +} + +// 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(enable bool) Option { + return func(o *options) { + o.withAutomaticVersioning = enable + } +} + +// WithSkipCurlOutput tells the API to not use the current call for cURL output. +// Useful for when we need to look up versions. +func WithSkipCurlOutput(skip bool) Option { + return func(o *options) { + o.withSkipCurlOutput = true + } +} + +// WithFilter tells the API to filter the items returned using the provided +// filter term. The filter should be in a format supported by +// hashicorp/go-bexpr. +func WithFilter(filter string) Option { + return func(o *options) { + o.withFilter = strings.TrimSpace(filter) + } +} + +// WithRecursive tells the API to use recursion for listing operations on this +// resource +func WithRecursive(recurse bool) Option { + return func(o *options) { + o.withRecursive = true + } +} + +func WithAttributes(inAttributes map[string]interface{}) Option { + return func(o *options) { + o.postMap["attributes"] = inAttributes + } +} + +func DefaultAttributes() Option { + return func(o *options) { + o.postMap["attributes"] = nil + } +} + +func WithBucketName(inBucketName string) Option { + return func(o *options) { + o.postMap["bucket_name"] = inBucketName + } +} + +func DefaultBucketName() Option { + return func(o *options) { + o.postMap["bucket_name"] = nil + } +} + +func WithBucketPrefix(inBucketPrefix string) Option { + return func(o *options) { + o.postMap["bucket_prefix"] = inBucketPrefix + } +} + +func DefaultBucketPrefix() Option { + return func(o *options) { + o.postMap["bucket_prefix"] = nil + } +} + +func WithDescription(inDescription string) Option { + return func(o *options) { + o.postMap["description"] = inDescription + } +} + +func DefaultDescription() Option { + return func(o *options) { + o.postMap["description"] = nil + } +} + +func WithName(inName string) Option { + return func(o *options) { + o.postMap["name"] = inName + } +} + +func DefaultName() Option { + return func(o *options) { + o.postMap["name"] = nil + } +} + +func WithPluginId(inPluginId string) Option { + return func(o *options) { + o.postMap["plugin_id"] = inPluginId + } +} + +func WithPluginName(inPluginName string) Option { + return func(o *options) { + o.queryMap["plugin_name"] = fmt.Sprintf("%v", inPluginName) + } +} + +func WithSecrets(inSecrets map[string]interface{}) Option { + return func(o *options) { + o.postMap["secrets"] = inSecrets + } +} + +func DefaultSecrets() Option { + return func(o *options) { + o.postMap["secrets"] = nil + } +} + +func WithWorkerFilter(inWorkerFilter string) Option { + return func(o *options) { + o.postMap["worker_filter"] = inWorkerFilter + } +} + +func DefaultWorkerFilter() Option { + return func(o *options) { + o.postMap["worker_filter"] = nil + } +} diff --git a/api/storagebuckets/storage_bucket.gen.go b/api/storagebuckets/storage_bucket.gen.go new file mode 100644 index 000000000..ec627853f --- /dev/null +++ b/api/storagebuckets/storage_bucket.gen.go @@ -0,0 +1,327 @@ +// Code generated by "make api"; DO NOT EDIT. +package storagebuckets + +import ( + "context" + "errors" + "fmt" + "net/url" + "time" + + "github.com/hashicorp/boundary/api" + "github.com/hashicorp/boundary/api/plugins" + "github.com/hashicorp/boundary/api/scopes" +) + +type StorageBucket struct { + Id string `json:"id,omitempty"` + ScopeId string `json:"scope_id,omitempty"` + Scope *scopes.ScopeInfo `json:"scope,omitempty"` + PluginId string `json:"plugin_id,omitempty"` + Plugin *plugins.PluginInfo `json:"plugin,omitempty"` + Name string `json:"name,omitempty"` + Description string `json:"description,omitempty"` + BucketName string `json:"bucket_name,omitempty"` + BucketPrefix string `json:"bucket_prefix,omitempty"` + CreatedTime time.Time `json:"created_time,omitempty"` + UpdatedTime time.Time `json:"updated_time,omitempty"` + Version uint32 `json:"version,omitempty"` + Attributes map[string]interface{} `json:"attributes,omitempty"` + Secrets map[string]interface{} `json:"secrets,omitempty"` + SecretsHmac string `json:"secrets_hmac,omitempty"` + WorkerFilter string `json:"worker_filter,omitempty"` + AuthorizedActions []string `json:"authorized_actions,omitempty"` + + response *api.Response +} + +type StorageBucketReadResult struct { + Item *StorageBucket + response *api.Response +} + +func (n StorageBucketReadResult) GetItem() *StorageBucket { + return n.Item +} + +func (n StorageBucketReadResult) GetResponse() *api.Response { + return n.response +} + +type StorageBucketCreateResult = StorageBucketReadResult +type StorageBucketUpdateResult = StorageBucketReadResult + +type StorageBucketDeleteResult struct { + response *api.Response +} + +// GetItem will always be nil for StorageBucketDeleteResult +func (n StorageBucketDeleteResult) GetItem() interface{} { + return nil +} + +func (n StorageBucketDeleteResult) GetResponse() *api.Response { + return n.response +} + +type StorageBucketListResult struct { + Items []*StorageBucket + response *api.Response +} + +func (n StorageBucketListResult) GetItems() []*StorageBucket { + return n.Items +} + +func (n StorageBucketListResult) GetResponse() *api.Response { + return n.response +} + +// Client is a client for this collection +type Client struct { + client *api.Client +} + +// Creates a new client for this collection. The submitted API client is cloned; +// modifications to it after generating this client will not have effect. If you +// need to make changes to the underlying API client, use ApiClient() to access +// it. +func NewClient(c *api.Client) *Client { + return &Client{client: c.Clone()} +} + +// ApiClient returns the underlying API client +func (c *Client) ApiClient() *api.Client { + return c.client +} + +func (c *Client) Create(ctx context.Context, scopeId string, opt ...Option) (*StorageBucketCreateResult, error) { + if scopeId == "" { + return nil, fmt.Errorf("empty scopeId value passed into Create request") + } + + opts, apiOpts := getOpts(opt...) + + if c.client == nil { + return nil, fmt.Errorf("nil client") + } + + opts.postMap["scope_id"] = scopeId + + req, err := c.client.NewRequest(ctx, "POST", "storage-buckets", opts.postMap, apiOpts...) + if err != nil { + return nil, fmt.Errorf("error creating Create request: %w", err) + } + + if len(opts.queryMap) > 0 { + q := url.Values{} + for k, v := range opts.queryMap { + q.Add(k, v) + } + req.URL.RawQuery = q.Encode() + } + + resp, err := c.client.Do(req) + if err != nil { + return nil, fmt.Errorf("error performing client request during Create call: %w", err) + } + + target := new(StorageBucketCreateResult) + target.Item = new(StorageBucket) + apiErr, err := resp.Decode(target.Item) + if err != nil { + return nil, fmt.Errorf("error decoding Create response: %w", err) + } + if apiErr != nil { + return nil, apiErr + } + target.response = resp + return target, nil +} + +func (c *Client) Read(ctx context.Context, id string, opt ...Option) (*StorageBucketReadResult, error) { + if id == "" { + return nil, fmt.Errorf("empty id value passed into Read request") + } + if c.client == nil { + return nil, fmt.Errorf("nil client") + } + + opts, apiOpts := getOpts(opt...) + + req, err := c.client.NewRequest(ctx, "GET", fmt.Sprintf("storage-buckets/%s", url.PathEscape(id)), nil, apiOpts...) + if err != nil { + return nil, fmt.Errorf("error creating Read request: %w", err) + } + + if len(opts.queryMap) > 0 { + q := url.Values{} + for k, v := range opts.queryMap { + q.Add(k, v) + } + req.URL.RawQuery = q.Encode() + } + + resp, err := c.client.Do(req, apiOpts...) + if err != nil { + return nil, fmt.Errorf("error performing client request during Read call: %w", err) + } + + target := new(StorageBucketReadResult) + target.Item = new(StorageBucket) + apiErr, err := resp.Decode(target.Item) + if err != nil { + return nil, fmt.Errorf("error decoding Read response: %w", err) + } + if apiErr != nil { + return nil, apiErr + } + target.response = resp + return target, nil +} + +func (c *Client) Update(ctx context.Context, id string, version uint32, opt ...Option) (*StorageBucketUpdateResult, error) { + if id == "" { + return nil, fmt.Errorf("empty id value passed into Update request") + } + if c.client == nil { + return nil, fmt.Errorf("nil client") + } + + opts, apiOpts := getOpts(opt...) + + if version == 0 { + if !opts.withAutomaticVersioning { + return nil, errors.New("zero version number passed into Update request and automatic versioning not specified") + } + existingTarget, existingErr := c.Read(ctx, id, append([]Option{WithSkipCurlOutput(true)}, opt...)...) + if existingErr != nil { + if api.AsServerError(existingErr) != nil { + return nil, fmt.Errorf("error from controller when performing initial check-and-set read: %w", existingErr) + } + return nil, fmt.Errorf("error performing initial check-and-set read: %w", existingErr) + } + if existingTarget == nil { + return nil, errors.New("nil resource response found when performing initial check-and-set read") + } + if existingTarget.Item == nil { + return nil, errors.New("nil resource found when performing initial check-and-set read") + } + version = existingTarget.Item.Version + } + + opts.postMap["version"] = version + + req, err := c.client.NewRequest(ctx, "PATCH", fmt.Sprintf("storage-buckets/%s", url.PathEscape(id)), opts.postMap, apiOpts...) + if err != nil { + return nil, fmt.Errorf("error creating Update request: %w", err) + } + + if len(opts.queryMap) > 0 { + q := url.Values{} + for k, v := range opts.queryMap { + q.Add(k, v) + } + req.URL.RawQuery = q.Encode() + } + + resp, err := c.client.Do(req) + if err != nil { + return nil, fmt.Errorf("error performing client request during Update call: %w", err) + } + + target := new(StorageBucketUpdateResult) + target.Item = new(StorageBucket) + apiErr, err := resp.Decode(target.Item) + if err != nil { + return nil, fmt.Errorf("error decoding Update response: %w", err) + } + if apiErr != nil { + return nil, apiErr + } + target.response = resp + return target, nil +} + +func (c *Client) Delete(ctx context.Context, id string, opt ...Option) (*StorageBucketDeleteResult, error) { + if id == "" { + return nil, fmt.Errorf("empty id value passed into Delete request") + } + if c.client == nil { + return nil, fmt.Errorf("nil client") + } + + opts, apiOpts := getOpts(opt...) + + req, err := c.client.NewRequest(ctx, "DELETE", fmt.Sprintf("storage-buckets/%s", url.PathEscape(id)), nil, apiOpts...) + if err != nil { + return nil, fmt.Errorf("error creating Delete request: %w", err) + } + + if len(opts.queryMap) > 0 { + q := url.Values{} + for k, v := range opts.queryMap { + q.Add(k, v) + } + req.URL.RawQuery = q.Encode() + } + + resp, err := c.client.Do(req) + if err != nil { + return nil, fmt.Errorf("error performing client request during Delete call: %w", err) + } + + apiErr, err := resp.Decode(nil) + if err != nil { + return nil, fmt.Errorf("error decoding Delete response: %w", err) + } + if apiErr != nil { + return nil, apiErr + } + + target := &StorageBucketDeleteResult{ + response: resp, + } + return target, nil +} + +func (c *Client) List(ctx context.Context, scopeId string, opt ...Option) (*StorageBucketListResult, error) { + if scopeId == "" { + return nil, fmt.Errorf("empty scopeId value passed into List request") + } + if c.client == nil { + return nil, fmt.Errorf("nil client") + } + + opts, apiOpts := getOpts(opt...) + opts.queryMap["scope_id"] = scopeId + + req, err := c.client.NewRequest(ctx, "GET", "storage-buckets", nil, apiOpts...) + if err != nil { + return nil, fmt.Errorf("error creating List request: %w", err) + } + + if len(opts.queryMap) > 0 { + q := url.Values{} + for k, v := range opts.queryMap { + q.Add(k, v) + } + req.URL.RawQuery = q.Encode() + } + + resp, err := c.client.Do(req) + if err != nil { + return nil, fmt.Errorf("error performing client request during List call: %w", err) + } + + target := new(StorageBucketListResult) + apiErr, err := resp.Decode(target) + if err != nil { + return nil, fmt.Errorf("error decoding List response: %w", err) + } + if apiErr != nil { + return nil, apiErr + } + target.response = resp + return target, nil +} diff --git a/globals/fields.go b/globals/fields.go index d26a237a6..cbc6b10d1 100644 --- a/globals/fields.go +++ b/globals/fields.go @@ -99,4 +99,5 @@ const ( TotalCountField = "total_count" DirectlyConnectedDownstreamWorkersField = "directly_connected_downstream_workers" AttributesAddressField = "attributes.address" + SecretsField = "secrets" ) diff --git a/globals/prefixes.go b/globals/prefixes.go index 2fc53f1d5..a810719e8 100644 --- a/globals/prefixes.go +++ b/globals/prefixes.go @@ -152,6 +152,7 @@ var prefixToResourceType = map[string]resource.Type{ TcpTargetPrefix: resource.Target, SshTargetPrefix: resource.Target, WorkerPrefix: resource.Worker, + PluginStorageBucketPrefix: resource.StorageBucket, } // ResourceTypeFromPrefix takes in a resource ID (or a prefix) and returns the diff --git a/internal/api/genapi/input.go b/internal/api/genapi/input.go index a9a4a20c9..033357ed7 100644 --- a/internal/api/genapi/input.go +++ b/internal/api/genapi/input.go @@ -22,6 +22,7 @@ import ( "github.com/hashicorp/boundary/sdk/pbs/controller/api/resources/roles" "github.com/hashicorp/boundary/sdk/pbs/controller/api/resources/scopes" "github.com/hashicorp/boundary/sdk/pbs/controller/api/resources/sessions" + "github.com/hashicorp/boundary/sdk/pbs/controller/api/resources/storagebuckets" "github.com/hashicorp/boundary/sdk/pbs/controller/api/resources/targets" "github.com/hashicorp/boundary/sdk/pbs/controller/api/resources/users" "github.com/hashicorp/boundary/sdk/pbs/controller/api/resources/workers" @@ -705,6 +706,39 @@ var inputStructs = []*structInfo{ createResponseTypes: []string{CreateResponseType, ReadResponseType, UpdateResponseType, DeleteResponseType, ListResponseType}, }, + // Storage related resources + { + inProto: &storagebuckets.StorageBucket{}, + outFile: "storagebuckets/storage_bucket.gen.go", + templates: []*template.Template{ + clientTemplate, + commonCreateTemplate, + readTemplate, + updateTemplate, + deleteTemplate, + listTemplate, + }, + extraFields: []fieldInfo{ + { + Name: "PluginName", + ProtoName: "plugin_name", + FieldType: "string", + SkipDefault: true, + Query: true, + }, + }, + fieldOverrides: []fieldInfo{ + { + Name: "PluginId", + SkipDefault: true, + }, + }, + pluralResourceName: "storage-buckets", + versionEnabled: true, + createResponseTypes: []string{CreateResponseType, ReadResponseType, UpdateResponseType, DeleteResponseType, ListResponseType}, + recursiveListing: true, + }, + // Host related resources { inProto: &hostcatalogs.HostCatalog{}, diff --git a/internal/daemon/controller/common/common.go b/internal/daemon/controller/common/common.go index 5d422e4ad..6f25bc71b 100644 --- a/internal/daemon/controller/common/common.go +++ b/internal/daemon/controller/common/common.go @@ -15,22 +15,24 @@ import ( "github.com/hashicorp/boundary/internal/plugin" "github.com/hashicorp/boundary/internal/server" "github.com/hashicorp/boundary/internal/session" + pluginstorage "github.com/hashicorp/boundary/internal/storage/plugin" ) type ( - AuthTokenRepoFactory = oidc.AuthTokenRepoFactory - VaultCredentialRepoFactory = func() (*vault.Repository, error) - StaticCredentialRepoFactory = func() (*credstatic.Repository, error) - IamRepoFactory = iam.IamRepoFactory - OidcAuthRepoFactory = oidc.OidcRepoFactory - LdapAuthRepoFactory = ldap.RepoFactory - PasswordAuthRepoFactory func() (*password.Repository, error) - ServersRepoFactory func() (*server.Repository, error) - StaticRepoFactory func() (*static.Repository, error) - PluginHostRepoFactory func() (*pluginhost.Repository, error) - HostPluginRepoFactory func() (*plugin.Repository, error) - ConnectionRepoFactory func() (*session.ConnectionRepository, error) - WorkerAuthRepoStorageFactory func() (*server.WorkerAuthRepositoryStorage, error) + AuthTokenRepoFactory = oidc.AuthTokenRepoFactory + VaultCredentialRepoFactory = func() (*vault.Repository, error) + StaticCredentialRepoFactory = func() (*credstatic.Repository, error) + IamRepoFactory = iam.IamRepoFactory + OidcAuthRepoFactory = oidc.OidcRepoFactory + LdapAuthRepoFactory = ldap.RepoFactory + PasswordAuthRepoFactory func() (*password.Repository, error) + ServersRepoFactory func() (*server.Repository, error) + StaticRepoFactory func() (*static.Repository, error) + PluginHostRepoFactory func() (*pluginhost.Repository, error) + PluginRepoFactory func() (*plugin.Repository, error) + ConnectionRepoFactory func() (*session.ConnectionRepository, error) + WorkerAuthRepoStorageFactory func() (*server.WorkerAuthRepositoryStorage, error) + PluginStorageBucketRepoFactory func() (*pluginstorage.Repository, error) ) // Downstreamers provides at least a minimum interface that must be met by a diff --git a/internal/daemon/controller/controller.go b/internal/daemon/controller/controller.go index a71a99f5e..8829a8479 100644 --- a/internal/daemon/controller/controller.go +++ b/internal/daemon/controller/controller.go @@ -41,6 +41,7 @@ import ( "github.com/hashicorp/boundary/internal/server" serversjob "github.com/hashicorp/boundary/internal/server/job" "github.com/hashicorp/boundary/internal/session" + pluginstorage "github.com/hashicorp/boundary/internal/storage/plugin" "github.com/hashicorp/boundary/internal/target" "github.com/hashicorp/boundary/internal/types/scope" host_plugin_assets "github.com/hashicorp/boundary/plugins/host" @@ -118,21 +119,22 @@ type Controller struct { apiGrpcGatewayTicket string // Repo factory methods - AuthTokenRepoFn common.AuthTokenRepoFactory - VaultCredentialRepoFn common.VaultCredentialRepoFactory - StaticCredentialRepoFn common.StaticCredentialRepoFactory - IamRepoFn common.IamRepoFactory - OidcRepoFn common.OidcAuthRepoFactory - LdapRepoFn common.LdapAuthRepoFactory - PasswordAuthRepoFn common.PasswordAuthRepoFactory - ServersRepoFn common.ServersRepoFactory - SessionRepoFn session.RepositoryFactory - ConnectionRepoFn common.ConnectionRepoFactory - StaticHostRepoFn common.StaticRepoFactory - PluginHostRepoFn common.PluginHostRepoFactory - HostPluginRepoFn common.HostPluginRepoFactory - TargetRepoFn target.RepositoryFactory - WorkerAuthRepoStorageFn common.WorkerAuthRepoStorageFactory + AuthTokenRepoFn common.AuthTokenRepoFactory + VaultCredentialRepoFn common.VaultCredentialRepoFactory + StaticCredentialRepoFn common.StaticCredentialRepoFactory + IamRepoFn common.IamRepoFactory + OidcRepoFn common.OidcAuthRepoFactory + LdapRepoFn common.LdapAuthRepoFactory + PasswordAuthRepoFn common.PasswordAuthRepoFactory + ServersRepoFn common.ServersRepoFactory + SessionRepoFn session.RepositoryFactory + ConnectionRepoFn common.ConnectionRepoFactory + StaticHostRepoFn common.StaticRepoFactory + PluginHostRepoFn common.PluginHostRepoFactory + PluginStorageBucketRepoFn common.PluginStorageBucketRepoFactory + PluginRepoFn common.PluginRepoFactory + TargetRepoFn target.RepositoryFactory + WorkerAuthRepoStorageFn common.WorkerAuthRepoStorageFactory scheduler *scheduler.Scheduler @@ -261,8 +263,7 @@ func New(ctx context.Context, conf *Config) (*Controller, error) { plugin.WithDescription("Provides an initial loopback storage and host plugin in Boundary"), plugin.WithPublicId(conf.DevLoopbackPluginId), } - // TODO(storage): Register loopback as storage supported - if _, err = conf.RegisterPlugin(ctx, "loopback", plg, []plugin.PluginType{plugin.PluginTypeHost}, opts...); err != nil { + if _, err = conf.RegisterPlugin(ctx, "loopback", plg, []plugin.PluginType{plugin.PluginTypeHost, plugin.PluginTypeStorage}, opts...); err != nil { return nil, err } case base.EnabledPluginHostAzure: @@ -376,9 +377,12 @@ func New(ctx context.Context, conf *Config) (*Controller, error) { c.PluginHostRepoFn = func() (*pluginhost.Repository, error) { return pluginhost.NewRepository(dbase, dbase, c.kms, c.scheduler, c.conf.HostPlugins) } - c.HostPluginRepoFn = func() (*plugin.Repository, error) { + c.PluginRepoFn = func() (*plugin.Repository, error) { return plugin.NewRepository(ctx, dbase, dbase, c.kms) } + c.PluginStorageBucketRepoFn = func() (*pluginstorage.Repository, error) { + return pluginstorage.NewRepository(ctx, dbase, dbase, c.kms) + } c.AuthTokenRepoFn = func() (*authtoken.Repository, error) { return authtoken.NewRepository(dbase, dbase, c.kms, authtoken.WithTokenTimeToLiveDuration(c.conf.RawConfig.Controller.AuthTokenTimeToLiveDuration), diff --git a/internal/daemon/controller/handler.go b/internal/daemon/controller/handler.go index 99a4f7eb0..d4c9ebf7b 100644 --- a/internal/daemon/controller/handler.go +++ b/internal/daemon/controller/handler.go @@ -36,6 +36,7 @@ import ( "github.com/hashicorp/boundary/internal/daemon/controller/handlers/roles" "github.com/hashicorp/boundary/internal/daemon/controller/handlers/scopes" "github.com/hashicorp/boundary/internal/daemon/controller/handlers/sessions" + "github.com/hashicorp/boundary/internal/daemon/controller/handlers/storage_buckets" "github.com/hashicorp/boundary/internal/daemon/controller/handlers/targets" "github.com/hashicorp/boundary/internal/daemon/controller/handlers/users" "github.com/hashicorp/boundary/internal/daemon/controller/handlers/workers" @@ -133,7 +134,7 @@ func (c *Controller) registerGrpcServices(s *grpc.Server) error { currentServices := s.GetServiceInfo() if _, ok := currentServices[services.HostCatalogService_ServiceDesc.ServiceName]; !ok { - hcs, err := host_catalogs.NewService(c.StaticHostRepoFn, c.PluginHostRepoFn, c.HostPluginRepoFn, c.IamRepoFn) + hcs, err := host_catalogs.NewService(c.StaticHostRepoFn, c.PluginHostRepoFn, c.PluginRepoFn, c.IamRepoFn) if err != nil { return fmt.Errorf("failed to create host catalog handler service: %w", err) } @@ -188,6 +189,18 @@ func (c *Controller) registerGrpcServices(s *grpc.Server) error { } services.RegisterUserServiceServer(s, us) } + if _, ok := currentServices[services.StorageBucketService_ServiceDesc.ServiceName]; !ok { + sbs, err := storage_buckets.NewServiceFn( + c.baseContext, + c.PluginStorageBucketRepoFn, + c.IamRepoFn, + c.PluginRepoFn, + c.ControllerExtension) + if err != nil { + return fmt.Errorf("failed to create storage bucket handler service: %w", err) + } + services.RegisterStorageBucketServiceServer(s, sbs) + } if _, ok := currentServices[services.TargetService_ServiceDesc.ServiceName]; !ok { ts, err := targets.NewService( c.baseContext, @@ -332,6 +345,9 @@ func registerGrpcGatewayEndpoints(ctx context.Context, gwMux *runtime.ServeMux, if err := services.RegisterSessionRecordingServiceHandlerFromEndpoint(ctx, gwMux, gatewayTarget, dialOptions); err != nil { return fmt.Errorf("failed to register session recording service handler: %w", err) } + if err := services.RegisterStorageBucketServiceHandlerFromEndpoint(ctx, gwMux, gatewayTarget, dialOptions); err != nil { + return fmt.Errorf("failed to register storage bucket handler: %w", err) + } return nil } diff --git a/internal/daemon/controller/handler_test.go b/internal/daemon/controller/handler_test.go index c9b73b6c5..3833c0a47 100644 --- a/internal/daemon/controller/handler_test.go +++ b/internal/daemon/controller/handler_test.go @@ -132,6 +132,8 @@ func TestHandleImplementedPaths(t *testing.T) { "v1/scopes/someid", "v1/sessions", "v1/sessions/someid", + "v1/storage-buckets", + "v1/storage-buckets/someid", "v1/targets", "v1/targets/someid", "v1/users", @@ -148,6 +150,7 @@ func TestHandleImplementedPaths(t *testing.T) { "v1/hosts", "v1/roles", "v1/scopes", + "v1/storage-buckets", "v1/targets", "v1/users", @@ -190,6 +193,7 @@ func TestHandleImplementedPaths(t *testing.T) { "v1/hosts/someid", "v1/roles/someid", "v1/scopes/someid", + "v1/storage-buckets/someid", "v1/targets/someid", "v1/users/someid", }, @@ -203,6 +207,7 @@ func TestHandleImplementedPaths(t *testing.T) { "v1/hosts/someid", "v1/roles/someid", "v1/scopes/someid", + "v1/storage-buckets/someid", "v1/targets/someid", "v1/users/someid", }, diff --git a/internal/daemon/controller/handlers/host_catalogs/host_catalog_service.go b/internal/daemon/controller/handlers/host_catalogs/host_catalog_service.go index f663a7d3a..87a6d399d 100644 --- a/internal/daemon/controller/handlers/host_catalogs/host_catalog_service.go +++ b/internal/daemon/controller/handlers/host_catalogs/host_catalog_service.go @@ -88,7 +88,7 @@ type Service struct { staticRepoFn common.StaticRepoFactory pluginHostRepoFn common.PluginHostRepoFactory - pluginRepoFn common.HostPluginRepoFactory + pluginRepoFn common.PluginRepoFactory iamRepoFn common.IamRepoFactory } @@ -96,7 +96,7 @@ var _ pbs.HostCatalogServiceServer = (*Service)(nil) // NewService returns a host catalog Service which handles host catalog related requests to boundary and uses the provided // repositories for storage and retrieval. -func NewService(repoFn common.StaticRepoFactory, pluginHostRepoFn common.PluginHostRepoFactory, hostPluginRepoFn common.HostPluginRepoFactory, iamRepoFn common.IamRepoFactory) (Service, error) { +func NewService(repoFn common.StaticRepoFactory, pluginHostRepoFn common.PluginHostRepoFactory, hostPluginRepoFn common.PluginRepoFactory, iamRepoFn common.IamRepoFactory) (Service, error) { const op = "host_catalogs.NewService" if repoFn == nil { return Service{}, errors.NewDeprecated(errors.InvalidParameter, op, "missing static repository") diff --git a/internal/daemon/controller/handlers/scopes/scope_service.go b/internal/daemon/controller/handlers/scopes/scope_service.go index c5cba363e..65e3596a2 100644 --- a/internal/daemon/controller/handlers/scopes/scope_service.go +++ b/internal/daemon/controller/handlers/scopes/scope_service.go @@ -21,6 +21,7 @@ import ( "github.com/hashicorp/boundary/internal/daemon/controller/handlers/host_catalogs" "github.com/hashicorp/boundary/internal/daemon/controller/handlers/roles" "github.com/hashicorp/boundary/internal/daemon/controller/handlers/sessions" + "github.com/hashicorp/boundary/internal/daemon/controller/handlers/storage_buckets" "github.com/hashicorp/boundary/internal/daemon/controller/handlers/targets" "github.com/hashicorp/boundary/internal/daemon/controller/handlers/users" "github.com/hashicorp/boundary/internal/daemon/controller/handlers/workers" @@ -67,22 +68,24 @@ var ( scopeCollectionTypeMapMap = map[string]map[resource.Type]action.ActionSet{ scope.Global.String(): { - resource.AuthMethod: authmethods.CollectionActions, - resource.AuthToken: authtokens.CollectionActions, - resource.Group: groups.CollectionActions, - resource.Role: roles.CollectionActions, - resource.Scope: CollectionActions, - resource.User: users.CollectionActions, - resource.Worker: workers.CollectionActions, + resource.AuthMethod: authmethods.CollectionActions, + resource.StorageBucket: storage_buckets.CollectionActions, + resource.AuthToken: authtokens.CollectionActions, + resource.Group: groups.CollectionActions, + resource.Role: roles.CollectionActions, + resource.Scope: CollectionActions, + resource.User: users.CollectionActions, + resource.Worker: workers.CollectionActions, }, scope.Org.String(): { - resource.AuthMethod: authmethods.CollectionActions, - resource.AuthToken: authtokens.CollectionActions, - resource.Group: groups.CollectionActions, - resource.Role: roles.CollectionActions, - resource.Scope: CollectionActions, - resource.User: users.CollectionActions, + resource.AuthMethod: authmethods.CollectionActions, + resource.StorageBucket: storage_buckets.CollectionActions, + resource.AuthToken: authtokens.CollectionActions, + resource.Group: groups.CollectionActions, + resource.Role: roles.CollectionActions, + resource.Scope: CollectionActions, + resource.User: users.CollectionActions, }, scope.Project.String(): { diff --git a/internal/daemon/controller/handlers/storage_buckets/storage_bucket_service.go b/internal/daemon/controller/handlers/storage_buckets/storage_bucket_service.go new file mode 100644 index 000000000..1fcc8520b --- /dev/null +++ b/internal/daemon/controller/handlers/storage_buckets/storage_bucket_service.go @@ -0,0 +1,74 @@ +// Copyright (c) HashiCorp, Inc. +// SPDX-License-Identifier: MPL-2.0 + +package storage_buckets + +import ( + "context" + + "github.com/hashicorp/boundary/internal/daemon/controller/common" + pbs "github.com/hashicorp/boundary/internal/gen/controller/api/services" + "github.com/hashicorp/boundary/internal/globals" + "github.com/hashicorp/boundary/internal/types/action" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/status" +) + +var ( + // IdActions contains the set of actions that can be performed on + // individual resources + IdActions = action.ActionSet{ + action.NoOp, + action.Read, + action.Update, + action.Delete, + } + + // CollectionActions contains the set of actions that can be performed on + // this collection + CollectionActions = action.ActionSet{ + action.Create, + action.List, + } +) + +// NewServiceFn returns a storage bucket service which is not implemented in OSS +var NewServiceFn = func(ctx context.Context, + pluginStorageRepoFn common.PluginStorageBucketRepoFactory, + iamRepoFn common.IamRepoFactory, + pluginRepoFn common.PluginRepoFactory, + controllerExt globals.ControllerExtension, +) (pbs.StorageBucketServiceServer, error) { + return Service{}, nil +} + +type Service struct { + pbs.UnsafeStorageBucketServiceServer +} + +var _ pbs.StorageBucketServiceServer = (*Service)(nil) + +// ListStorageBuckets implements the interface pbs.StorageBucketServiceServer. +func (s Service) ListStorageBuckets(ctx context.Context, req *pbs.ListStorageBucketsRequest) (*pbs.ListStorageBucketsResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "storage buckets are an Enterprise-only feature") +} + +// GetStorageBucket implements the interface pbs.StorageBucketServiceServer. +func (s Service) GetStorageBucket(ctx context.Context, req *pbs.GetStorageBucketRequest) (*pbs.GetStorageBucketResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "storage buckets are an Enterprise-only feature") +} + +// CreateStorageBucket implements the interface pbs.StorageBucketServiceServer. +func (s Service) CreateStorageBucket(ctx context.Context, req *pbs.CreateStorageBucketRequest) (*pbs.CreateStorageBucketResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "storage buckets are an Enterprise-only feature") +} + +// UpdateStorageBucket implements the interface pbs.StorageBucketServiceServer. +func (s Service) UpdateStorageBucket(ctx context.Context, req *pbs.UpdateStorageBucketRequest) (*pbs.UpdateStorageBucketResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "storage buckets are an Enterprise-only feature") +} + +// DeleteStorageBucket implements the interface pbs.StorageBucketServiceServer. +func (s Service) DeleteStorageBucket(ctx context.Context, req *pbs.DeleteStorageBucketRequest) (*pbs.DeleteStorageBucketResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "storage buckets are an Enterprise-only feature") +} diff --git a/internal/daemon/controller/handlers/storage_buckets/storage_bucket_service_test.go b/internal/daemon/controller/handlers/storage_buckets/storage_bucket_service_test.go new file mode 100644 index 000000000..181feaaa5 --- /dev/null +++ b/internal/daemon/controller/handlers/storage_buckets/storage_bucket_service_test.go @@ -0,0 +1,62 @@ +// Copyright (c) HashiCorp, Inc. +// SPDX-License-Identifier: MPL-2.0 + +package storage_buckets + +import ( + "context" + "testing" + + pbs "github.com/hashicorp/boundary/internal/gen/controller/api/services" + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/status" +) + +func TestService(t *testing.T) { + t.Parallel() + ctx := context.Background() + assert, require := assert.New(t), require.New(t) + s := Service{} + + gotCreate, err := s.CreateStorageBucket(ctx, &pbs.CreateStorageBucketRequest{}) + require.Nil(gotCreate) + require.Error(err) + gotStatus, ok := status.FromError(err) + require.True(ok) + assert.Equal(gotStatus.Code(), codes.Unimplemented) + assert.Equal(gotStatus.Message(), "storage buckets are an Enterprise-only feature") + + gotUpdate, err := s.UpdateStorageBucket(ctx, &pbs.UpdateStorageBucketRequest{}) + require.Nil(gotUpdate) + require.Error(err) + gotStatus, ok = status.FromError(err) + require.True(ok) + assert.Equal(gotStatus.Code(), codes.Unimplemented) + assert.Equal(gotStatus.Message(), "storage buckets are an Enterprise-only feature") + + gotGet, err := s.GetStorageBucket(ctx, &pbs.GetStorageBucketRequest{}) + require.Nil(gotGet) + require.Error(err) + gotStatus, ok = status.FromError(err) + require.True(ok) + assert.Equal(gotStatus.Code(), codes.Unimplemented) + assert.Equal(gotStatus.Message(), "storage buckets are an Enterprise-only feature") + + gotDelete, err := s.DeleteStorageBucket(ctx, &pbs.DeleteStorageBucketRequest{}) + require.Nil(gotDelete) + require.Error(err) + gotStatus, ok = status.FromError(err) + require.True(ok) + assert.Equal(gotStatus.Code(), codes.Unimplemented) + assert.Equal(gotStatus.Message(), "storage buckets are an Enterprise-only feature") + + got, err := s.ListStorageBuckets(ctx, &pbs.ListStorageBucketsRequest{}) + require.Nil(got) + require.Error(err) + gotStatus, ok = status.FromError(err) + require.True(ok) + assert.Equal(gotStatus.Code(), codes.Unimplemented) + assert.Equal(gotStatus.Message(), "storage buckets are an Enterprise-only feature") +} diff --git a/internal/gen/controller.swagger.json b/internal/gen/controller.swagger.json index 2d40e357c..3932f9228 100644 --- a/internal/gen/controller.swagger.json +++ b/internal/gen/controller.swagger.json @@ -50,6 +50,9 @@ { "name": "controller.api.services.v1.SessionService" }, + { + "name": "controller.api.services.v1.StorageBucketService" + }, { "name": "controller.api.services.v1.TargetService" }, @@ -2956,6 +2959,160 @@ ] } }, + "/v1/storage-buckets": { + "get": { + "summary": "Gets a list of Storage Buckets.", + "operationId": "StorageBucketService_ListStorageBuckets", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/controller.api.services.v1.ListStorageBucketsResponse" + } + } + }, + "parameters": [ + { + "name": "scope_id", + "in": "query", + "required": false, + "type": "string" + }, + { + "name": "recursive", + "in": "query", + "required": false, + "type": "boolean" + }, + { + "name": "filter", + "in": "query", + "required": false, + "type": "string" + } + ], + "tags": [ + "controller.api.services.v1.StorageBucketService" + ] + }, + "post": { + "summary": "Creates a Storage Bucket", + "operationId": "StorageBucketService_CreateStorageBucket", + "responses": { + "200": { + "description": "", + "schema": { + "$ref": "#/definitions/controller.api.resources.storagebuckets.v1.StorageBucket" + } + } + }, + "parameters": [ + { + "name": "item", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/controller.api.resources.storagebuckets.v1.StorageBucket" + } + }, + { + "name": "plugin_name", + "description": "As an alternative to providing the plugin id in the provided StorageBucket,\nthis field can be used to lookup the plugin using its name.", + "in": "query", + "required": false, + "type": "string" + } + ], + "tags": [ + "controller.api.services.v1.StorageBucketService" + ] + } + }, + "/v1/storage-buckets/{id}": { + "get": { + "summary": "Gets a single Storage Bucket.", + "operationId": "StorageBucketService_GetStorageBucket", + "responses": { + "200": { + "description": "", + "schema": { + "$ref": "#/definitions/controller.api.resources.storagebuckets.v1.StorageBucket" + } + } + }, + "parameters": [ + { + "name": "id", + "in": "path", + "required": true, + "type": "string" + } + ], + "tags": [ + "controller.api.services.v1.StorageBucketService" + ] + }, + "delete": { + "summary": "Deletes a Storage Bucket", + "operationId": "StorageBucketService_DeleteStorageBucket", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/controller.api.services.v1.DeleteStorageBucketResponse" + } + } + }, + "parameters": [ + { + "name": "id", + "in": "path", + "required": true, + "type": "string" + } + ], + "tags": [ + "controller.api.services.v1.StorageBucketService" + ] + }, + "patch": { + "summary": "Updates a Storage Bucket", + "operationId": "StorageBucketService_UpdateStorageBucket", + "responses": { + "200": { + "description": "", + "schema": { + "$ref": "#/definitions/controller.api.resources.storagebuckets.v1.StorageBucket" + } + } + }, + "parameters": [ + { + "name": "id", + "in": "path", + "required": true, + "type": "string" + }, + { + "name": "item", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/controller.api.resources.storagebuckets.v1.StorageBucket" + } + }, + { + "name": "update_mask", + "in": "query", + "required": false, + "type": "string" + } + ], + "tags": [ + "controller.api.services.v1.StorageBucketService" + ] + } + }, "/v1/targets": { "get": { "summary": "Lists all Targets.", @@ -5759,6 +5916,93 @@ } } }, + "controller.api.resources.storagebuckets.v1.StorageBucket": { + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "Output only. The ID of the storage bucket.", + "readOnly": true + }, + "scope_id": { + "type": "string", + "description": "The ID of the Scope of which this storage bucket is a part." + }, + "scope": { + "$ref": "#/definitions/controller.api.resources.scopes.v1.ScopeInfo", + "description": "Output only. Scope information for this resource.", + "readOnly": true + }, + "plugin_id": { + "type": "string", + "description": "The ID of the plugin of which this storage bucket is created." + }, + "plugin": { + "$ref": "#/definitions/controller.api.resources.plugins.v1.PluginInfo", + "description": "Output only. Plugin information for this resource.", + "readOnly": true + }, + "name": { + "type": "string", + "description": "Optional name for identification purposes." + }, + "description": { + "type": "string", + "description": "Optional user-set description for identification purposes." + }, + "bucket_name": { + "type": "string", + "description": "The name of the bucket within the external object store service." + }, + "bucket_prefix": { + "type": "string", + "description": "The prefix used to organize the data held within the external object store." + }, + "created_time": { + "type": "string", + "format": "date-time", + "description": "Output only. The time this resource was created.", + "readOnly": true + }, + "updated_time": { + "type": "string", + "format": "date-time", + "description": "Output only. The time this resource was last updated.", + "readOnly": true + }, + "version": { + "type": "integer", + "format": "int64", + "description": "Version is used in mutation requests, after the initial creation, to ensure this resource has not changed.\nThe mutation will fail if the version does not match the latest known good version." + }, + "attributes": { + "type": "object", + "description": "Attributes specific to the catalog type." + }, + "secrets": { + "type": "object", + "description": "Secrets specific to the storage bucket type. These are never output." + }, + "secrets_hmac": { + "type": "string", + "description": "Output only. The HMAC of the last secrets supplied via the API, if any.", + "readOnly": true + }, + "worker_filter": { + "type": "string", + "title": "Filters to the worker(s) that can handle requests for this storage bucket" + }, + "authorized_actions": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Output only. The available actions on this resource for this user.", + "readOnly": true + } + }, + "title": "StorageBucket manages external object stores" + }, "controller.api.resources.targets.v1.CredentialSource": { "type": "object", "properties": { @@ -6589,6 +6833,17 @@ } } }, + "controller.api.services.v1.CreateStorageBucketResponse": { + "type": "object", + "properties": { + "uri": { + "type": "string" + }, + "item": { + "$ref": "#/definitions/controller.api.resources.storagebuckets.v1.StorageBucket" + } + } + }, "controller.api.services.v1.CreateTargetResponse": { "type": "object", "properties": { @@ -6661,6 +6916,9 @@ "controller.api.services.v1.DeleteScopeResponse": { "type": "object" }, + "controller.api.services.v1.DeleteStorageBucketResponse": { + "type": "object" + }, "controller.api.services.v1.DeleteTargetResponse": { "type": "object" }, @@ -6811,6 +7069,14 @@ } } }, + "controller.api.services.v1.GetStorageBucketResponse": { + "type": "object", + "properties": { + "item": { + "$ref": "#/definitions/controller.api.resources.storagebuckets.v1.StorageBucket" + } + } + }, "controller.api.services.v1.GetTargetResponse": { "type": "object", "properties": { @@ -7023,6 +7289,17 @@ } } }, + "controller.api.services.v1.ListStorageBucketsResponse": { + "type": "object", + "properties": { + "items": { + "type": "array", + "items": { + "$ref": "#/definitions/controller.api.resources.storagebuckets.v1.StorageBucket" + } + } + } + }, "controller.api.services.v1.ListTargetsResponse": { "type": "object", "properties": { @@ -7318,6 +7595,14 @@ } } }, + "controller.api.services.v1.UpdateStorageBucketResponse": { + "type": "object", + "properties": { + "item": { + "$ref": "#/definitions/controller.api.resources.storagebuckets.v1.StorageBucket" + } + } + }, "controller.api.services.v1.UpdateTargetResponse": { "type": "object", "properties": { diff --git a/internal/gen/controller/api/services/storage_bucket_service.pb.go b/internal/gen/controller/api/services/storage_bucket_service.pb.go new file mode 100644 index 000000000..21242bf49 --- /dev/null +++ b/internal/gen/controller/api/services/storage_bucket_service.pb.go @@ -0,0 +1,899 @@ +// Copyright (c) HashiCorp, Inc. +// SPDX-License-Identifier: MPL-2.0 + +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.30.0 +// protoc (unknown) +// source: controller/api/services/v1/storage_bucket_service.proto + +package services + +import ( + _ "github.com/grpc-ecosystem/grpc-gateway/v2/protoc-gen-openapiv2/options" + storagebuckets "github.com/hashicorp/boundary/sdk/pbs/controller/api/resources/storagebuckets" + _ "github.com/hashicorp/boundary/sdk/pbs/controller/protooptions" + _ "google.golang.org/genproto/googleapis/api/annotations" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + fieldmaskpb "google.golang.org/protobuf/types/known/fieldmaskpb" + 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) +) + +type GetStorageBucketRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty" class:"public"` // @gotags: `class:"public"` +} + +func (x *GetStorageBucketRequest) Reset() { + *x = GetStorageBucketRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_controller_api_services_v1_storage_bucket_service_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *GetStorageBucketRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetStorageBucketRequest) ProtoMessage() {} + +func (x *GetStorageBucketRequest) ProtoReflect() protoreflect.Message { + mi := &file_controller_api_services_v1_storage_bucket_service_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 GetStorageBucketRequest.ProtoReflect.Descriptor instead. +func (*GetStorageBucketRequest) Descriptor() ([]byte, []int) { + return file_controller_api_services_v1_storage_bucket_service_proto_rawDescGZIP(), []int{0} +} + +func (x *GetStorageBucketRequest) GetId() string { + if x != nil { + return x.Id + } + return "" +} + +type GetStorageBucketResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Item *storagebuckets.StorageBucket `protobuf:"bytes,1,opt,name=item,proto3" json:"item,omitempty"` +} + +func (x *GetStorageBucketResponse) Reset() { + *x = GetStorageBucketResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_controller_api_services_v1_storage_bucket_service_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *GetStorageBucketResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetStorageBucketResponse) ProtoMessage() {} + +func (x *GetStorageBucketResponse) ProtoReflect() protoreflect.Message { + mi := &file_controller_api_services_v1_storage_bucket_service_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 GetStorageBucketResponse.ProtoReflect.Descriptor instead. +func (*GetStorageBucketResponse) Descriptor() ([]byte, []int) { + return file_controller_api_services_v1_storage_bucket_service_proto_rawDescGZIP(), []int{1} +} + +func (x *GetStorageBucketResponse) GetItem() *storagebuckets.StorageBucket { + if x != nil { + return x.Item + } + return nil +} + +type ListStorageBucketsRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + ScopeId string `protobuf:"bytes,1,opt,name=scope_id,proto3" json:"scope_id,omitempty" class:"public"` // @gotags: `class:"public"` + Recursive bool `protobuf:"varint,20,opt,name=recursive,proto3" json:"recursive,omitempty" class:"public"` // @gotags: `class:"public"` + Filter string `protobuf:"bytes,30,opt,name=filter,proto3" json:"filter,omitempty" class:"public"` // @gotags: `class:"public"` +} + +func (x *ListStorageBucketsRequest) Reset() { + *x = ListStorageBucketsRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_controller_api_services_v1_storage_bucket_service_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ListStorageBucketsRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ListStorageBucketsRequest) ProtoMessage() {} + +func (x *ListStorageBucketsRequest) ProtoReflect() protoreflect.Message { + mi := &file_controller_api_services_v1_storage_bucket_service_proto_msgTypes[2] + 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 ListStorageBucketsRequest.ProtoReflect.Descriptor instead. +func (*ListStorageBucketsRequest) Descriptor() ([]byte, []int) { + return file_controller_api_services_v1_storage_bucket_service_proto_rawDescGZIP(), []int{2} +} + +func (x *ListStorageBucketsRequest) GetScopeId() string { + if x != nil { + return x.ScopeId + } + return "" +} + +func (x *ListStorageBucketsRequest) GetRecursive() bool { + if x != nil { + return x.Recursive + } + return false +} + +func (x *ListStorageBucketsRequest) GetFilter() string { + if x != nil { + return x.Filter + } + return "" +} + +type ListStorageBucketsResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Items []*storagebuckets.StorageBucket `protobuf:"bytes,1,rep,name=items,proto3" json:"items,omitempty"` +} + +func (x *ListStorageBucketsResponse) Reset() { + *x = ListStorageBucketsResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_controller_api_services_v1_storage_bucket_service_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ListStorageBucketsResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ListStorageBucketsResponse) ProtoMessage() {} + +func (x *ListStorageBucketsResponse) ProtoReflect() protoreflect.Message { + mi := &file_controller_api_services_v1_storage_bucket_service_proto_msgTypes[3] + 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 ListStorageBucketsResponse.ProtoReflect.Descriptor instead. +func (*ListStorageBucketsResponse) Descriptor() ([]byte, []int) { + return file_controller_api_services_v1_storage_bucket_service_proto_rawDescGZIP(), []int{3} +} + +func (x *ListStorageBucketsResponse) GetItems() []*storagebuckets.StorageBucket { + if x != nil { + return x.Items + } + return nil +} + +type CreateStorageBucketRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Item *storagebuckets.StorageBucket `protobuf:"bytes,1,opt,name=item,proto3" json:"item,omitempty"` + // As an alternative to providing the plugin id in the provided StorageBucket, + // this field can be used to lookup the plugin using its name. + PluginName string `protobuf:"bytes,2,opt,name=plugin_name,proto3" json:"plugin_name,omitempty" class:"public"` // @gotags: `class:"public"` +} + +func (x *CreateStorageBucketRequest) Reset() { + *x = CreateStorageBucketRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_controller_api_services_v1_storage_bucket_service_proto_msgTypes[4] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *CreateStorageBucketRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*CreateStorageBucketRequest) ProtoMessage() {} + +func (x *CreateStorageBucketRequest) ProtoReflect() protoreflect.Message { + mi := &file_controller_api_services_v1_storage_bucket_service_proto_msgTypes[4] + 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 CreateStorageBucketRequest.ProtoReflect.Descriptor instead. +func (*CreateStorageBucketRequest) Descriptor() ([]byte, []int) { + return file_controller_api_services_v1_storage_bucket_service_proto_rawDescGZIP(), []int{4} +} + +func (x *CreateStorageBucketRequest) GetItem() *storagebuckets.StorageBucket { + if x != nil { + return x.Item + } + return nil +} + +func (x *CreateStorageBucketRequest) GetPluginName() string { + if x != nil { + return x.PluginName + } + return "" +} + +type CreateStorageBucketResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Uri string `protobuf:"bytes,1,opt,name=uri,proto3" json:"uri,omitempty" class:"public"` // @gotags: `class:"public"` + Item *storagebuckets.StorageBucket `protobuf:"bytes,2,opt,name=item,proto3" json:"item,omitempty"` +} + +func (x *CreateStorageBucketResponse) Reset() { + *x = CreateStorageBucketResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_controller_api_services_v1_storage_bucket_service_proto_msgTypes[5] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *CreateStorageBucketResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*CreateStorageBucketResponse) ProtoMessage() {} + +func (x *CreateStorageBucketResponse) ProtoReflect() protoreflect.Message { + mi := &file_controller_api_services_v1_storage_bucket_service_proto_msgTypes[5] + 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 CreateStorageBucketResponse.ProtoReflect.Descriptor instead. +func (*CreateStorageBucketResponse) Descriptor() ([]byte, []int) { + return file_controller_api_services_v1_storage_bucket_service_proto_rawDescGZIP(), []int{5} +} + +func (x *CreateStorageBucketResponse) GetUri() string { + if x != nil { + return x.Uri + } + return "" +} + +func (x *CreateStorageBucketResponse) GetItem() *storagebuckets.StorageBucket { + if x != nil { + return x.Item + } + return nil +} + +type UpdateStorageBucketRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty" class:"public"` // @gotags: `class:"public"` + Item *storagebuckets.StorageBucket `protobuf:"bytes,2,opt,name=item,proto3" json:"item,omitempty"` + UpdateMask *fieldmaskpb.FieldMask `protobuf:"bytes,3,opt,name=update_mask,json=updateMask,proto3" json:"update_mask,omitempty"` +} + +func (x *UpdateStorageBucketRequest) Reset() { + *x = UpdateStorageBucketRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_controller_api_services_v1_storage_bucket_service_proto_msgTypes[6] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *UpdateStorageBucketRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*UpdateStorageBucketRequest) ProtoMessage() {} + +func (x *UpdateStorageBucketRequest) ProtoReflect() protoreflect.Message { + mi := &file_controller_api_services_v1_storage_bucket_service_proto_msgTypes[6] + 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 UpdateStorageBucketRequest.ProtoReflect.Descriptor instead. +func (*UpdateStorageBucketRequest) Descriptor() ([]byte, []int) { + return file_controller_api_services_v1_storage_bucket_service_proto_rawDescGZIP(), []int{6} +} + +func (x *UpdateStorageBucketRequest) GetId() string { + if x != nil { + return x.Id + } + return "" +} + +func (x *UpdateStorageBucketRequest) GetItem() *storagebuckets.StorageBucket { + if x != nil { + return x.Item + } + return nil +} + +func (x *UpdateStorageBucketRequest) GetUpdateMask() *fieldmaskpb.FieldMask { + if x != nil { + return x.UpdateMask + } + return nil +} + +type UpdateStorageBucketResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Item *storagebuckets.StorageBucket `protobuf:"bytes,1,opt,name=item,proto3" json:"item,omitempty"` +} + +func (x *UpdateStorageBucketResponse) Reset() { + *x = UpdateStorageBucketResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_controller_api_services_v1_storage_bucket_service_proto_msgTypes[7] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *UpdateStorageBucketResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*UpdateStorageBucketResponse) ProtoMessage() {} + +func (x *UpdateStorageBucketResponse) ProtoReflect() protoreflect.Message { + mi := &file_controller_api_services_v1_storage_bucket_service_proto_msgTypes[7] + 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 UpdateStorageBucketResponse.ProtoReflect.Descriptor instead. +func (*UpdateStorageBucketResponse) Descriptor() ([]byte, []int) { + return file_controller_api_services_v1_storage_bucket_service_proto_rawDescGZIP(), []int{7} +} + +func (x *UpdateStorageBucketResponse) GetItem() *storagebuckets.StorageBucket { + if x != nil { + return x.Item + } + return nil +} + +type DeleteStorageBucketRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty" class:"public"` // @gotags: `class:"public"` +} + +func (x *DeleteStorageBucketRequest) Reset() { + *x = DeleteStorageBucketRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_controller_api_services_v1_storage_bucket_service_proto_msgTypes[8] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *DeleteStorageBucketRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*DeleteStorageBucketRequest) ProtoMessage() {} + +func (x *DeleteStorageBucketRequest) ProtoReflect() protoreflect.Message { + mi := &file_controller_api_services_v1_storage_bucket_service_proto_msgTypes[8] + 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 DeleteStorageBucketRequest.ProtoReflect.Descriptor instead. +func (*DeleteStorageBucketRequest) Descriptor() ([]byte, []int) { + return file_controller_api_services_v1_storage_bucket_service_proto_rawDescGZIP(), []int{8} +} + +func (x *DeleteStorageBucketRequest) GetId() string { + if x != nil { + return x.Id + } + return "" +} + +type DeleteStorageBucketResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *DeleteStorageBucketResponse) Reset() { + *x = DeleteStorageBucketResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_controller_api_services_v1_storage_bucket_service_proto_msgTypes[9] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *DeleteStorageBucketResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*DeleteStorageBucketResponse) ProtoMessage() {} + +func (x *DeleteStorageBucketResponse) ProtoReflect() protoreflect.Message { + mi := &file_controller_api_services_v1_storage_bucket_service_proto_msgTypes[9] + 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 DeleteStorageBucketResponse.ProtoReflect.Descriptor instead. +func (*DeleteStorageBucketResponse) Descriptor() ([]byte, []int) { + return file_controller_api_services_v1_storage_bucket_service_proto_rawDescGZIP(), []int{9} +} + +var File_controller_api_services_v1_storage_bucket_service_proto protoreflect.FileDescriptor + +var file_controller_api_services_v1_storage_bucket_service_proto_rawDesc = []byte{ + 0x0a, 0x37, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x65, 0x72, 0x2f, 0x61, 0x70, 0x69, + 0x2f, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x2f, 0x76, 0x31, 0x2f, 0x73, 0x74, 0x6f, + 0x72, 0x61, 0x67, 0x65, 0x5f, 0x62, 0x75, 0x63, 0x6b, 0x65, 0x74, 0x5f, 0x73, 0x65, 0x72, 0x76, + 0x69, 0x63, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x1a, 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, 0x1a, 0x3f, 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, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x62, 0x75, 0x63, 0x6b, 0x65, 0x74, 0x73, 0x2f, 0x76, + 0x31, 0x2f, 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x5f, 0x62, 0x75, 0x63, 0x6b, 0x65, 0x74, + 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, 0x1a, 0x1c, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x61, + 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, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x2d, 0x67, 0x65, 0x6e, 0x2d, 0x6f, + 0x70, 0x65, 0x6e, 0x61, 0x70, 0x69, 0x76, 0x32, 0x2f, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, + 0x2f, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x22, 0x29, 0x0a, 0x17, 0x47, 0x65, 0x74, 0x53, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, + 0x42, 0x75, 0x63, 0x6b, 0x65, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x0e, 0x0a, + 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x22, 0x69, 0x0a, + 0x18, 0x47, 0x65, 0x74, 0x53, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x42, 0x75, 0x63, 0x6b, 0x65, + 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x4d, 0x0a, 0x04, 0x69, 0x74, 0x65, + 0x6d, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x39, 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, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x62, 0x75, 0x63, 0x6b, 0x65, 0x74, + 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x42, 0x75, 0x63, 0x6b, + 0x65, 0x74, 0x52, 0x04, 0x69, 0x74, 0x65, 0x6d, 0x22, 0x6d, 0x0a, 0x19, 0x4c, 0x69, 0x73, 0x74, + 0x53, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x42, 0x75, 0x63, 0x6b, 0x65, 0x74, 0x73, 0x52, 0x65, + 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1a, 0x0a, 0x08, 0x73, 0x63, 0x6f, 0x70, 0x65, 0x5f, 0x69, + 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x73, 0x63, 0x6f, 0x70, 0x65, 0x5f, 0x69, + 0x64, 0x12, 0x1c, 0x0a, 0x09, 0x72, 0x65, 0x63, 0x75, 0x72, 0x73, 0x69, 0x76, 0x65, 0x18, 0x14, + 0x20, 0x01, 0x28, 0x08, 0x52, 0x09, 0x72, 0x65, 0x63, 0x75, 0x72, 0x73, 0x69, 0x76, 0x65, 0x12, + 0x16, 0x0a, 0x06, 0x66, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x18, 0x1e, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x06, 0x66, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x22, 0x6d, 0x0a, 0x1a, 0x4c, 0x69, 0x73, 0x74, 0x53, + 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x42, 0x75, 0x63, 0x6b, 0x65, 0x74, 0x73, 0x52, 0x65, 0x73, + 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x4f, 0x0a, 0x05, 0x69, 0x74, 0x65, 0x6d, 0x73, 0x18, 0x01, + 0x20, 0x03, 0x28, 0x0b, 0x32, 0x39, 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, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x62, 0x75, 0x63, 0x6b, 0x65, 0x74, 0x73, 0x2e, 0x76, + 0x31, 0x2e, 0x53, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x42, 0x75, 0x63, 0x6b, 0x65, 0x74, 0x52, + 0x05, 0x69, 0x74, 0x65, 0x6d, 0x73, 0x22, 0x8d, 0x01, 0x0a, 0x1a, 0x43, 0x72, 0x65, 0x61, 0x74, + 0x65, 0x53, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x42, 0x75, 0x63, 0x6b, 0x65, 0x74, 0x52, 0x65, + 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x4d, 0x0a, 0x04, 0x69, 0x74, 0x65, 0x6d, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x0b, 0x32, 0x39, 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, + 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x62, 0x75, 0x63, 0x6b, 0x65, 0x74, 0x73, 0x2e, 0x76, 0x31, + 0x2e, 0x53, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x42, 0x75, 0x63, 0x6b, 0x65, 0x74, 0x52, 0x04, + 0x69, 0x74, 0x65, 0x6d, 0x12, 0x20, 0x0a, 0x0b, 0x70, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x5f, 0x6e, + 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x70, 0x6c, 0x75, 0x67, 0x69, + 0x6e, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x22, 0x7e, 0x0a, 0x1b, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, + 0x53, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x42, 0x75, 0x63, 0x6b, 0x65, 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, 0x4d, 0x0a, 0x04, 0x69, 0x74, 0x65, 0x6d, 0x18, + 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x39, 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, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x62, 0x75, 0x63, 0x6b, 0x65, 0x74, 0x73, 0x2e, + 0x76, 0x31, 0x2e, 0x53, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x42, 0x75, 0x63, 0x6b, 0x65, 0x74, + 0x52, 0x04, 0x69, 0x74, 0x65, 0x6d, 0x22, 0xb8, 0x01, 0x0a, 0x1a, 0x55, 0x70, 0x64, 0x61, 0x74, + 0x65, 0x53, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x42, 0x75, 0x63, 0x6b, 0x65, 0x74, 0x52, 0x65, + 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x4d, 0x0a, 0x04, 0x69, 0x74, 0x65, 0x6d, 0x18, 0x02, 0x20, + 0x01, 0x28, 0x0b, 0x32, 0x39, 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, + 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x62, 0x75, 0x63, 0x6b, 0x65, 0x74, 0x73, 0x2e, 0x76, 0x31, + 0x2e, 0x53, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x42, 0x75, 0x63, 0x6b, 0x65, 0x74, 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, 0x6c, 0x0a, 0x1b, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x53, 0x74, 0x6f, 0x72, 0x61, + 0x67, 0x65, 0x42, 0x75, 0x63, 0x6b, 0x65, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, + 0x12, 0x4d, 0x0a, 0x04, 0x69, 0x74, 0x65, 0x6d, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x39, + 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, 0x74, 0x6f, 0x72, 0x61, 0x67, + 0x65, 0x62, 0x75, 0x63, 0x6b, 0x65, 0x74, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x74, 0x6f, 0x72, + 0x61, 0x67, 0x65, 0x42, 0x75, 0x63, 0x6b, 0x65, 0x74, 0x52, 0x04, 0x69, 0x74, 0x65, 0x6d, 0x22, + 0x2c, 0x0a, 0x1a, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x53, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, + 0x42, 0x75, 0x63, 0x6b, 0x65, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x0e, 0x0a, + 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x22, 0x1d, 0x0a, + 0x1b, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x53, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x42, 0x75, + 0x63, 0x6b, 0x65, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x32, 0x92, 0x08, 0x0a, + 0x14, 0x53, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x42, 0x75, 0x63, 0x6b, 0x65, 0x74, 0x53, 0x65, + 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0xc7, 0x01, 0x0a, 0x10, 0x47, 0x65, 0x74, 0x53, 0x74, 0x6f, + 0x72, 0x61, 0x67, 0x65, 0x42, 0x75, 0x63, 0x6b, 0x65, 0x74, 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, 0x53, 0x74, 0x6f, 0x72, 0x61, + 0x67, 0x65, 0x42, 0x75, 0x63, 0x6b, 0x65, 0x74, 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, 0x47, 0x65, 0x74, + 0x53, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x42, 0x75, 0x63, 0x6b, 0x65, 0x74, 0x52, 0x65, 0x73, + 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x48, 0x92, 0x41, 0x1f, 0x12, 0x1d, 0x47, 0x65, 0x74, 0x73, + 0x20, 0x61, 0x20, 0x73, 0x69, 0x6e, 0x67, 0x6c, 0x65, 0x20, 0x53, 0x74, 0x6f, 0x72, 0x61, 0x67, + 0x65, 0x20, 0x42, 0x75, 0x63, 0x6b, 0x65, 0x74, 0x2e, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x20, 0x62, + 0x04, 0x69, 0x74, 0x65, 0x6d, 0x12, 0x18, 0x2f, 0x76, 0x31, 0x2f, 0x73, 0x74, 0x6f, 0x72, 0x61, + 0x67, 0x65, 0x2d, 0x62, 0x75, 0x63, 0x6b, 0x65, 0x74, 0x73, 0x2f, 0x7b, 0x69, 0x64, 0x7d, 0x12, + 0xc4, 0x01, 0x0a, 0x12, 0x4c, 0x69, 0x73, 0x74, 0x53, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x42, + 0x75, 0x63, 0x6b, 0x65, 0x74, 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, 0x4c, 0x69, 0x73, 0x74, 0x53, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x42, + 0x75, 0x63, 0x6b, 0x65, 0x74, 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, 0x4c, 0x69, 0x73, 0x74, 0x53, + 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x42, 0x75, 0x63, 0x6b, 0x65, 0x74, 0x73, 0x52, 0x65, 0x73, + 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x3f, 0x92, 0x41, 0x21, 0x12, 0x1f, 0x47, 0x65, 0x74, 0x73, + 0x20, 0x61, 0x20, 0x6c, 0x69, 0x73, 0x74, 0x20, 0x6f, 0x66, 0x20, 0x53, 0x74, 0x6f, 0x72, 0x61, + 0x67, 0x65, 0x20, 0x42, 0x75, 0x63, 0x6b, 0x65, 0x74, 0x73, 0x2e, 0x82, 0xd3, 0xe4, 0x93, 0x02, + 0x15, 0x12, 0x13, 0x2f, 0x76, 0x31, 0x2f, 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x2d, 0x62, + 0x75, 0x63, 0x6b, 0x65, 0x74, 0x73, 0x12, 0xcc, 0x01, 0x0a, 0x13, 0x43, 0x72, 0x65, 0x61, 0x74, + 0x65, 0x53, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x42, 0x75, 0x63, 0x6b, 0x65, 0x74, 0x12, 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, 0x43, 0x72, 0x65, 0x61, + 0x74, 0x65, 0x53, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x42, 0x75, 0x63, 0x6b, 0x65, 0x74, 0x52, + 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x37, 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, 0x74, 0x6f, 0x72, 0x61, 0x67, + 0x65, 0x42, 0x75, 0x63, 0x6b, 0x65, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, + 0x44, 0x92, 0x41, 0x1a, 0x12, 0x18, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x73, 0x20, 0x61, 0x20, + 0x53, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x20, 0x42, 0x75, 0x63, 0x6b, 0x65, 0x74, 0x82, 0xd3, + 0xe4, 0x93, 0x02, 0x21, 0x3a, 0x04, 0x69, 0x74, 0x65, 0x6d, 0x62, 0x04, 0x69, 0x74, 0x65, 0x6d, + 0x22, 0x13, 0x2f, 0x76, 0x31, 0x2f, 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x2d, 0x62, 0x75, + 0x63, 0x6b, 0x65, 0x74, 0x73, 0x12, 0xd1, 0x01, 0x0a, 0x13, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, + 0x53, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x42, 0x75, 0x63, 0x6b, 0x65, 0x74, 0x12, 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, 0x55, 0x70, 0x64, 0x61, 0x74, + 0x65, 0x53, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x42, 0x75, 0x63, 0x6b, 0x65, 0x74, 0x52, 0x65, + 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x37, 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, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, + 0x42, 0x75, 0x63, 0x6b, 0x65, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x49, + 0x92, 0x41, 0x1a, 0x12, 0x18, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x73, 0x20, 0x61, 0x20, 0x53, + 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x20, 0x42, 0x75, 0x63, 0x6b, 0x65, 0x74, 0x82, 0xd3, 0xe4, + 0x93, 0x02, 0x26, 0x3a, 0x04, 0x69, 0x74, 0x65, 0x6d, 0x62, 0x04, 0x69, 0x74, 0x65, 0x6d, 0x32, + 0x18, 0x2f, 0x76, 0x31, 0x2f, 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x2d, 0x62, 0x75, 0x63, + 0x6b, 0x65, 0x74, 0x73, 0x2f, 0x7b, 0x69, 0x64, 0x7d, 0x12, 0xc5, 0x01, 0x0a, 0x13, 0x44, 0x65, + 0x6c, 0x65, 0x74, 0x65, 0x53, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x42, 0x75, 0x63, 0x6b, 0x65, + 0x74, 0x12, 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, 0x44, + 0x65, 0x6c, 0x65, 0x74, 0x65, 0x53, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x42, 0x75, 0x63, 0x6b, + 0x65, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x37, 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, 0x74, 0x6f, + 0x72, 0x61, 0x67, 0x65, 0x42, 0x75, 0x63, 0x6b, 0x65, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, + 0x73, 0x65, 0x22, 0x3d, 0x92, 0x41, 0x1a, 0x12, 0x18, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x73, + 0x20, 0x61, 0x20, 0x53, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x20, 0x42, 0x75, 0x63, 0x6b, 0x65, + 0x74, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x1a, 0x2a, 0x18, 0x2f, 0x76, 0x31, 0x2f, 0x73, 0x74, 0x6f, + 0x72, 0x61, 0x67, 0x65, 0x2d, 0x62, 0x75, 0x63, 0x6b, 0x65, 0x74, 0x73, 0x2f, 0x7b, 0x69, 0x64, + 0x7d, 0x42, 0x58, 0xa2, 0xe3, 0x29, 0x07, 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x5a, 0x4b, + 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x68, 0x61, 0x73, 0x68, 0x69, + 0x63, 0x6f, 0x72, 0x70, 0x2f, 0x62, 0x6f, 0x75, 0x6e, 0x64, 0x61, 0x72, 0x79, 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 ( + file_controller_api_services_v1_storage_bucket_service_proto_rawDescOnce sync.Once + file_controller_api_services_v1_storage_bucket_service_proto_rawDescData = file_controller_api_services_v1_storage_bucket_service_proto_rawDesc +) + +func file_controller_api_services_v1_storage_bucket_service_proto_rawDescGZIP() []byte { + file_controller_api_services_v1_storage_bucket_service_proto_rawDescOnce.Do(func() { + file_controller_api_services_v1_storage_bucket_service_proto_rawDescData = protoimpl.X.CompressGZIP(file_controller_api_services_v1_storage_bucket_service_proto_rawDescData) + }) + return file_controller_api_services_v1_storage_bucket_service_proto_rawDescData +} + +var file_controller_api_services_v1_storage_bucket_service_proto_msgTypes = make([]protoimpl.MessageInfo, 10) +var file_controller_api_services_v1_storage_bucket_service_proto_goTypes = []interface{}{ + (*GetStorageBucketRequest)(nil), // 0: controller.api.services.v1.GetStorageBucketRequest + (*GetStorageBucketResponse)(nil), // 1: controller.api.services.v1.GetStorageBucketResponse + (*ListStorageBucketsRequest)(nil), // 2: controller.api.services.v1.ListStorageBucketsRequest + (*ListStorageBucketsResponse)(nil), // 3: controller.api.services.v1.ListStorageBucketsResponse + (*CreateStorageBucketRequest)(nil), // 4: controller.api.services.v1.CreateStorageBucketRequest + (*CreateStorageBucketResponse)(nil), // 5: controller.api.services.v1.CreateStorageBucketResponse + (*UpdateStorageBucketRequest)(nil), // 6: controller.api.services.v1.UpdateStorageBucketRequest + (*UpdateStorageBucketResponse)(nil), // 7: controller.api.services.v1.UpdateStorageBucketResponse + (*DeleteStorageBucketRequest)(nil), // 8: controller.api.services.v1.DeleteStorageBucketRequest + (*DeleteStorageBucketResponse)(nil), // 9: controller.api.services.v1.DeleteStorageBucketResponse + (*storagebuckets.StorageBucket)(nil), // 10: controller.api.resources.storagebuckets.v1.StorageBucket + (*fieldmaskpb.FieldMask)(nil), // 11: google.protobuf.FieldMask +} +var file_controller_api_services_v1_storage_bucket_service_proto_depIdxs = []int32{ + 10, // 0: controller.api.services.v1.GetStorageBucketResponse.item:type_name -> controller.api.resources.storagebuckets.v1.StorageBucket + 10, // 1: controller.api.services.v1.ListStorageBucketsResponse.items:type_name -> controller.api.resources.storagebuckets.v1.StorageBucket + 10, // 2: controller.api.services.v1.CreateStorageBucketRequest.item:type_name -> controller.api.resources.storagebuckets.v1.StorageBucket + 10, // 3: controller.api.services.v1.CreateStorageBucketResponse.item:type_name -> controller.api.resources.storagebuckets.v1.StorageBucket + 10, // 4: controller.api.services.v1.UpdateStorageBucketRequest.item:type_name -> controller.api.resources.storagebuckets.v1.StorageBucket + 11, // 5: controller.api.services.v1.UpdateStorageBucketRequest.update_mask:type_name -> google.protobuf.FieldMask + 10, // 6: controller.api.services.v1.UpdateStorageBucketResponse.item:type_name -> controller.api.resources.storagebuckets.v1.StorageBucket + 0, // 7: controller.api.services.v1.StorageBucketService.GetStorageBucket:input_type -> controller.api.services.v1.GetStorageBucketRequest + 2, // 8: controller.api.services.v1.StorageBucketService.ListStorageBuckets:input_type -> controller.api.services.v1.ListStorageBucketsRequest + 4, // 9: controller.api.services.v1.StorageBucketService.CreateStorageBucket:input_type -> controller.api.services.v1.CreateStorageBucketRequest + 6, // 10: controller.api.services.v1.StorageBucketService.UpdateStorageBucket:input_type -> controller.api.services.v1.UpdateStorageBucketRequest + 8, // 11: controller.api.services.v1.StorageBucketService.DeleteStorageBucket:input_type -> controller.api.services.v1.DeleteStorageBucketRequest + 1, // 12: controller.api.services.v1.StorageBucketService.GetStorageBucket:output_type -> controller.api.services.v1.GetStorageBucketResponse + 3, // 13: controller.api.services.v1.StorageBucketService.ListStorageBuckets:output_type -> controller.api.services.v1.ListStorageBucketsResponse + 5, // 14: controller.api.services.v1.StorageBucketService.CreateStorageBucket:output_type -> controller.api.services.v1.CreateStorageBucketResponse + 7, // 15: controller.api.services.v1.StorageBucketService.UpdateStorageBucket:output_type -> controller.api.services.v1.UpdateStorageBucketResponse + 9, // 16: controller.api.services.v1.StorageBucketService.DeleteStorageBucket:output_type -> controller.api.services.v1.DeleteStorageBucketResponse + 12, // [12:17] is the sub-list for method output_type + 7, // [7:12] is the sub-list for method input_type + 7, // [7:7] is the sub-list for extension type_name + 7, // [7:7] is the sub-list for extension extendee + 0, // [0:7] is the sub-list for field type_name +} + +func init() { file_controller_api_services_v1_storage_bucket_service_proto_init() } +func file_controller_api_services_v1_storage_bucket_service_proto_init() { + if File_controller_api_services_v1_storage_bucket_service_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_controller_api_services_v1_storage_bucket_service_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GetStorageBucketRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_controller_api_services_v1_storage_bucket_service_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GetStorageBucketResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_controller_api_services_v1_storage_bucket_service_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ListStorageBucketsRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_controller_api_services_v1_storage_bucket_service_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ListStorageBucketsResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_controller_api_services_v1_storage_bucket_service_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*CreateStorageBucketRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_controller_api_services_v1_storage_bucket_service_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*CreateStorageBucketResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_controller_api_services_v1_storage_bucket_service_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*UpdateStorageBucketRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_controller_api_services_v1_storage_bucket_service_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*UpdateStorageBucketResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_controller_api_services_v1_storage_bucket_service_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*DeleteStorageBucketRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_controller_api_services_v1_storage_bucket_service_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*DeleteStorageBucketResponse); 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_services_v1_storage_bucket_service_proto_rawDesc, + NumEnums: 0, + NumMessages: 10, + NumExtensions: 0, + NumServices: 1, + }, + GoTypes: file_controller_api_services_v1_storage_bucket_service_proto_goTypes, + DependencyIndexes: file_controller_api_services_v1_storage_bucket_service_proto_depIdxs, + MessageInfos: file_controller_api_services_v1_storage_bucket_service_proto_msgTypes, + }.Build() + File_controller_api_services_v1_storage_bucket_service_proto = out.File + file_controller_api_services_v1_storage_bucket_service_proto_rawDesc = nil + file_controller_api_services_v1_storage_bucket_service_proto_goTypes = nil + file_controller_api_services_v1_storage_bucket_service_proto_depIdxs = nil +} diff --git a/internal/gen/controller/api/services/storage_bucket_service.pb.gw.go b/internal/gen/controller/api/services/storage_bucket_service.pb.gw.go new file mode 100644 index 000000000..27b9fb979 --- /dev/null +++ b/internal/gen/controller/api/services/storage_bucket_service.pb.gw.go @@ -0,0 +1,660 @@ +// Code generated by protoc-gen-grpc-gateway. DO NOT EDIT. +// source: controller/api/services/v1/storage_bucket_service.proto + +/* +Package services is a reverse proxy. + +It translates gRPC into RESTful JSON APIs. +*/ +package services + +import ( + "context" + "io" + "net/http" + + "github.com/grpc-ecosystem/grpc-gateway/v2/runtime" + "github.com/grpc-ecosystem/grpc-gateway/v2/utilities" + "google.golang.org/grpc" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/grpclog" + "google.golang.org/grpc/metadata" + "google.golang.org/grpc/status" + "google.golang.org/protobuf/proto" +) + +// Suppress "imported and not used" errors +var _ codes.Code +var _ io.Reader +var _ status.Status +var _ = runtime.String +var _ = utilities.NewDoubleArray +var _ = metadata.Join + +func request_StorageBucketService_GetStorageBucket_0(ctx context.Context, marshaler runtime.Marshaler, client StorageBucketServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq GetStorageBucketRequest + var metadata runtime.ServerMetadata + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["id"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "id") + } + + protoReq.Id, err = runtime.String(val) + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "id", err) + } + + msg, err := client.GetStorageBucket(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_StorageBucketService_GetStorageBucket_0(ctx context.Context, marshaler runtime.Marshaler, server StorageBucketServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq GetStorageBucketRequest + var metadata runtime.ServerMetadata + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["id"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "id") + } + + protoReq.Id, err = runtime.String(val) + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "id", err) + } + + msg, err := server.GetStorageBucket(ctx, &protoReq) + return msg, metadata, err + +} + +var ( + filter_StorageBucketService_ListStorageBuckets_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} +) + +func request_StorageBucketService_ListStorageBuckets_0(ctx context.Context, marshaler runtime.Marshaler, client StorageBucketServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq ListStorageBucketsRequest + var metadata runtime.ServerMetadata + + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_StorageBucketService_ListStorageBuckets_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.ListStorageBuckets(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_StorageBucketService_ListStorageBuckets_0(ctx context.Context, marshaler runtime.Marshaler, server StorageBucketServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq ListStorageBucketsRequest + var metadata runtime.ServerMetadata + + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_StorageBucketService_ListStorageBuckets_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := server.ListStorageBuckets(ctx, &protoReq) + return msg, metadata, err + +} + +var ( + filter_StorageBucketService_CreateStorageBucket_0 = &utilities.DoubleArray{Encoding: map[string]int{"item": 0}, Base: []int{1, 1, 0}, Check: []int{0, 1, 2}} +) + +func request_StorageBucketService_CreateStorageBucket_0(ctx context.Context, marshaler runtime.Marshaler, client StorageBucketServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq CreateStorageBucketRequest + var metadata runtime.ServerMetadata + + newReader, berr := utilities.IOReaderFactory(req.Body) + if berr != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) + } + if err := marshaler.NewDecoder(newReader()).Decode(&protoReq.Item); err != nil && err != io.EOF { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_StorageBucketService_CreateStorageBucket_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.CreateStorageBucket(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_StorageBucketService_CreateStorageBucket_0(ctx context.Context, marshaler runtime.Marshaler, server StorageBucketServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq CreateStorageBucketRequest + var metadata runtime.ServerMetadata + + newReader, berr := utilities.IOReaderFactory(req.Body) + if berr != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) + } + if err := marshaler.NewDecoder(newReader()).Decode(&protoReq.Item); err != nil && err != io.EOF { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_StorageBucketService_CreateStorageBucket_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := server.CreateStorageBucket(ctx, &protoReq) + return msg, metadata, err + +} + +var ( + filter_StorageBucketService_UpdateStorageBucket_0 = &utilities.DoubleArray{Encoding: map[string]int{"item": 0, "id": 1}, Base: []int{1, 1, 2, 0, 0}, Check: []int{0, 1, 1, 2, 3}} +) + +func request_StorageBucketService_UpdateStorageBucket_0(ctx context.Context, marshaler runtime.Marshaler, client StorageBucketServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq UpdateStorageBucketRequest + var metadata runtime.ServerMetadata + + newReader, berr := utilities.IOReaderFactory(req.Body) + if berr != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) + } + if err := marshaler.NewDecoder(newReader()).Decode(&protoReq.Item); err != nil && err != io.EOF { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + if protoReq.UpdateMask == nil || len(protoReq.UpdateMask.GetPaths()) == 0 { + if fieldMask, err := runtime.FieldMaskFromRequestBody(newReader(), protoReq.Item); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } else { + protoReq.UpdateMask = fieldMask + } + } + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["id"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "id") + } + + protoReq.Id, err = runtime.String(val) + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "id", err) + } + + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_StorageBucketService_UpdateStorageBucket_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.UpdateStorageBucket(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_StorageBucketService_UpdateStorageBucket_0(ctx context.Context, marshaler runtime.Marshaler, server StorageBucketServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq UpdateStorageBucketRequest + var metadata runtime.ServerMetadata + + newReader, berr := utilities.IOReaderFactory(req.Body) + if berr != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) + } + if err := marshaler.NewDecoder(newReader()).Decode(&protoReq.Item); err != nil && err != io.EOF { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + if protoReq.UpdateMask == nil || len(protoReq.UpdateMask.GetPaths()) == 0 { + if fieldMask, err := runtime.FieldMaskFromRequestBody(newReader(), protoReq.Item); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } else { + protoReq.UpdateMask = fieldMask + } + } + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["id"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "id") + } + + protoReq.Id, err = runtime.String(val) + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "id", err) + } + + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_StorageBucketService_UpdateStorageBucket_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := server.UpdateStorageBucket(ctx, &protoReq) + return msg, metadata, err + +} + +func request_StorageBucketService_DeleteStorageBucket_0(ctx context.Context, marshaler runtime.Marshaler, client StorageBucketServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq DeleteStorageBucketRequest + var metadata runtime.ServerMetadata + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["id"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "id") + } + + protoReq.Id, err = runtime.String(val) + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "id", err) + } + + msg, err := client.DeleteStorageBucket(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_StorageBucketService_DeleteStorageBucket_0(ctx context.Context, marshaler runtime.Marshaler, server StorageBucketServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq DeleteStorageBucketRequest + var metadata runtime.ServerMetadata + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["id"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "id") + } + + protoReq.Id, err = runtime.String(val) + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "id", err) + } + + msg, err := server.DeleteStorageBucket(ctx, &protoReq) + return msg, metadata, err + +} + +// RegisterStorageBucketServiceHandlerServer registers the http handlers for service StorageBucketService to "mux". +// UnaryRPC :call StorageBucketServiceServer directly. +// StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. +// Note that using this registration option will cause many gRPC library features to stop working. Consider using RegisterStorageBucketServiceHandlerFromEndpoint instead. +func RegisterStorageBucketServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux, server StorageBucketServiceServer) error { + + mux.Handle("GET", pattern_StorageBucketService_GetStorageBucket_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + var err error + var annotatedContext context.Context + annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/controller.api.services.v1.StorageBucketService/GetStorageBucket", runtime.WithHTTPPathPattern("/v1/storage-buckets/{id}")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_StorageBucketService_GetStorageBucket_0(annotatedContext, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) + if err != nil { + runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) + return + } + + forward_StorageBucketService_GetStorageBucket_0(annotatedContext, mux, outboundMarshaler, w, req, response_StorageBucketService_GetStorageBucket_0{resp}, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_StorageBucketService_ListStorageBuckets_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + var err error + var annotatedContext context.Context + annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/controller.api.services.v1.StorageBucketService/ListStorageBuckets", runtime.WithHTTPPathPattern("/v1/storage-buckets")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_StorageBucketService_ListStorageBuckets_0(annotatedContext, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) + if err != nil { + runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) + return + } + + forward_StorageBucketService_ListStorageBuckets_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("POST", pattern_StorageBucketService_CreateStorageBucket_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + var err error + var annotatedContext context.Context + annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/controller.api.services.v1.StorageBucketService/CreateStorageBucket", runtime.WithHTTPPathPattern("/v1/storage-buckets")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_StorageBucketService_CreateStorageBucket_0(annotatedContext, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) + if err != nil { + runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) + return + } + + forward_StorageBucketService_CreateStorageBucket_0(annotatedContext, mux, outboundMarshaler, w, req, response_StorageBucketService_CreateStorageBucket_0{resp}, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("PATCH", pattern_StorageBucketService_UpdateStorageBucket_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + var err error + var annotatedContext context.Context + annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/controller.api.services.v1.StorageBucketService/UpdateStorageBucket", runtime.WithHTTPPathPattern("/v1/storage-buckets/{id}")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_StorageBucketService_UpdateStorageBucket_0(annotatedContext, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) + if err != nil { + runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) + return + } + + forward_StorageBucketService_UpdateStorageBucket_0(annotatedContext, mux, outboundMarshaler, w, req, response_StorageBucketService_UpdateStorageBucket_0{resp}, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("DELETE", pattern_StorageBucketService_DeleteStorageBucket_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + var err error + var annotatedContext context.Context + annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/controller.api.services.v1.StorageBucketService/DeleteStorageBucket", runtime.WithHTTPPathPattern("/v1/storage-buckets/{id}")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_StorageBucketService_DeleteStorageBucket_0(annotatedContext, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) + if err != nil { + runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) + return + } + + forward_StorageBucketService_DeleteStorageBucket_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + return nil +} + +// RegisterStorageBucketServiceHandlerFromEndpoint is same as RegisterStorageBucketServiceHandler but +// automatically dials to "endpoint" and closes the connection when "ctx" gets done. +func RegisterStorageBucketServiceHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error) { + conn, err := grpc.Dial(endpoint, opts...) + if err != nil { + return err + } + defer func() { + if err != nil { + if cerr := conn.Close(); cerr != nil { + grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr) + } + return + } + go func() { + <-ctx.Done() + if cerr := conn.Close(); cerr != nil { + grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr) + } + }() + }() + + return RegisterStorageBucketServiceHandler(ctx, mux, conn) +} + +// RegisterStorageBucketServiceHandler registers the http handlers for service StorageBucketService to "mux". +// The handlers forward requests to the grpc endpoint over "conn". +func RegisterStorageBucketServiceHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error { + return RegisterStorageBucketServiceHandlerClient(ctx, mux, NewStorageBucketServiceClient(conn)) +} + +// RegisterStorageBucketServiceHandlerClient registers the http handlers for service StorageBucketService +// to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "StorageBucketServiceClient". +// Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "StorageBucketServiceClient" +// doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in +// "StorageBucketServiceClient" to call the correct interceptors. +func RegisterStorageBucketServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux, client StorageBucketServiceClient) error { + + mux.Handle("GET", pattern_StorageBucketService_GetStorageBucket_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + var err error + var annotatedContext context.Context + annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/controller.api.services.v1.StorageBucketService/GetStorageBucket", runtime.WithHTTPPathPattern("/v1/storage-buckets/{id}")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_StorageBucketService_GetStorageBucket_0(annotatedContext, inboundMarshaler, client, req, pathParams) + annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) + if err != nil { + runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) + return + } + + forward_StorageBucketService_GetStorageBucket_0(annotatedContext, mux, outboundMarshaler, w, req, response_StorageBucketService_GetStorageBucket_0{resp}, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_StorageBucketService_ListStorageBuckets_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + var err error + var annotatedContext context.Context + annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/controller.api.services.v1.StorageBucketService/ListStorageBuckets", runtime.WithHTTPPathPattern("/v1/storage-buckets")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_StorageBucketService_ListStorageBuckets_0(annotatedContext, inboundMarshaler, client, req, pathParams) + annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) + if err != nil { + runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) + return + } + + forward_StorageBucketService_ListStorageBuckets_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("POST", pattern_StorageBucketService_CreateStorageBucket_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + var err error + var annotatedContext context.Context + annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/controller.api.services.v1.StorageBucketService/CreateStorageBucket", runtime.WithHTTPPathPattern("/v1/storage-buckets")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_StorageBucketService_CreateStorageBucket_0(annotatedContext, inboundMarshaler, client, req, pathParams) + annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) + if err != nil { + runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) + return + } + + forward_StorageBucketService_CreateStorageBucket_0(annotatedContext, mux, outboundMarshaler, w, req, response_StorageBucketService_CreateStorageBucket_0{resp}, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("PATCH", pattern_StorageBucketService_UpdateStorageBucket_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + var err error + var annotatedContext context.Context + annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/controller.api.services.v1.StorageBucketService/UpdateStorageBucket", runtime.WithHTTPPathPattern("/v1/storage-buckets/{id}")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_StorageBucketService_UpdateStorageBucket_0(annotatedContext, inboundMarshaler, client, req, pathParams) + annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) + if err != nil { + runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) + return + } + + forward_StorageBucketService_UpdateStorageBucket_0(annotatedContext, mux, outboundMarshaler, w, req, response_StorageBucketService_UpdateStorageBucket_0{resp}, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("DELETE", pattern_StorageBucketService_DeleteStorageBucket_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + var err error + var annotatedContext context.Context + annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/controller.api.services.v1.StorageBucketService/DeleteStorageBucket", runtime.WithHTTPPathPattern("/v1/storage-buckets/{id}")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_StorageBucketService_DeleteStorageBucket_0(annotatedContext, inboundMarshaler, client, req, pathParams) + annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) + if err != nil { + runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) + return + } + + forward_StorageBucketService_DeleteStorageBucket_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + return nil +} + +type response_StorageBucketService_GetStorageBucket_0 struct { + proto.Message +} + +func (m response_StorageBucketService_GetStorageBucket_0) XXX_ResponseBody() interface{} { + response := m.Message.(*GetStorageBucketResponse) + return response.Item +} + +type response_StorageBucketService_CreateStorageBucket_0 struct { + proto.Message +} + +func (m response_StorageBucketService_CreateStorageBucket_0) XXX_ResponseBody() interface{} { + response := m.Message.(*CreateStorageBucketResponse) + return response.Item +} + +type response_StorageBucketService_UpdateStorageBucket_0 struct { + proto.Message +} + +func (m response_StorageBucketService_UpdateStorageBucket_0) XXX_ResponseBody() interface{} { + response := m.Message.(*UpdateStorageBucketResponse) + return response.Item +} + +var ( + pattern_StorageBucketService_GetStorageBucket_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 1, 0, 4, 1, 5, 2}, []string{"v1", "storage-buckets", "id"}, "")) + + pattern_StorageBucketService_ListStorageBuckets_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"v1", "storage-buckets"}, "")) + + pattern_StorageBucketService_CreateStorageBucket_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"v1", "storage-buckets"}, "")) + + pattern_StorageBucketService_UpdateStorageBucket_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 1, 0, 4, 1, 5, 2}, []string{"v1", "storage-buckets", "id"}, "")) + + pattern_StorageBucketService_DeleteStorageBucket_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 1, 0, 4, 1, 5, 2}, []string{"v1", "storage-buckets", "id"}, "")) +) + +var ( + forward_StorageBucketService_GetStorageBucket_0 = runtime.ForwardResponseMessage + + forward_StorageBucketService_ListStorageBuckets_0 = runtime.ForwardResponseMessage + + forward_StorageBucketService_CreateStorageBucket_0 = runtime.ForwardResponseMessage + + forward_StorageBucketService_UpdateStorageBucket_0 = runtime.ForwardResponseMessage + + forward_StorageBucketService_DeleteStorageBucket_0 = runtime.ForwardResponseMessage +) diff --git a/internal/gen/controller/api/services/storage_bucket_service_grpc.pb.go b/internal/gen/controller/api/services/storage_bucket_service_grpc.pb.go new file mode 100644 index 000000000..827f16ac3 --- /dev/null +++ b/internal/gen/controller/api/services/storage_bucket_service_grpc.pb.go @@ -0,0 +1,285 @@ +// Code generated by protoc-gen-go-grpc. DO NOT EDIT. + +package services + +import ( + context "context" + grpc "google.golang.org/grpc" + codes "google.golang.org/grpc/codes" + status "google.golang.org/grpc/status" +) + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the grpc package it is being compiled against. +// Requires gRPC-Go v1.32.0 or later. +const _ = grpc.SupportPackageIsVersion7 + +// StorageBucketServiceClient is the client API for StorageBucketService service. +// +// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. +type StorageBucketServiceClient interface { + // GetStorageBucket returns a stored Storage Bucket if present. The provided + // request must include the ID for the Storage Bucket being retrieved. + // If missing, malformed, or referencing a non-existing resource an error is + // returned. + GetStorageBucket(ctx context.Context, in *GetStorageBucketRequest, opts ...grpc.CallOption) (*GetStorageBucketResponse, error) + // ListStorageBuckets returns a list of stored Storage Buckets which exist inside + // the scope referenced in the request. The request must include the scope + // ID and if it is missing, malformed, or references a non-existing resource + // an error is returned. + ListStorageBuckets(ctx context.Context, in *ListStorageBucketsRequest, opts ...grpc.CallOption) (*ListStorageBucketsResponse, error) + // CreateStorageBucket creates and stores a Storage Bucket in boundary. The + // provided request must include the scope ID in which the Storage Bucket will be + // created. If any of these required fields are missing, malformed, or reference a + // non-existing parent resource an error is returned. + CreateStorageBucket(ctx context.Context, in *CreateStorageBucketRequest, opts ...grpc.CallOption) (*CreateStorageBucketResponse, error) + // UpdateStorageBucket updates an existing Storage Bucket in Boundary. The + // provided Storage Bucket must not have any read only fields set. The update + // mask must be provided and include at least 1 mutable field. To unset a + // field's value include that field name in the update mask and don't set the + // field in the Storage Bucket. + UpdateStorageBucket(ctx context.Context, in *UpdateStorageBucketRequest, opts ...grpc.CallOption) (*UpdateStorageBucketResponse, error) + // DeleteStorageBucket removes a Storage Bucket from Boundary. + // If the provided Storage Bucket ID is malformed or not + // provided DeleteStorageBucket returns an error. + DeleteStorageBucket(ctx context.Context, in *DeleteStorageBucketRequest, opts ...grpc.CallOption) (*DeleteStorageBucketResponse, error) +} + +type storageBucketServiceClient struct { + cc grpc.ClientConnInterface +} + +func NewStorageBucketServiceClient(cc grpc.ClientConnInterface) StorageBucketServiceClient { + return &storageBucketServiceClient{cc} +} + +func (c *storageBucketServiceClient) GetStorageBucket(ctx context.Context, in *GetStorageBucketRequest, opts ...grpc.CallOption) (*GetStorageBucketResponse, error) { + out := new(GetStorageBucketResponse) + err := c.cc.Invoke(ctx, "/controller.api.services.v1.StorageBucketService/GetStorageBucket", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *storageBucketServiceClient) ListStorageBuckets(ctx context.Context, in *ListStorageBucketsRequest, opts ...grpc.CallOption) (*ListStorageBucketsResponse, error) { + out := new(ListStorageBucketsResponse) + err := c.cc.Invoke(ctx, "/controller.api.services.v1.StorageBucketService/ListStorageBuckets", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *storageBucketServiceClient) CreateStorageBucket(ctx context.Context, in *CreateStorageBucketRequest, opts ...grpc.CallOption) (*CreateStorageBucketResponse, error) { + out := new(CreateStorageBucketResponse) + err := c.cc.Invoke(ctx, "/controller.api.services.v1.StorageBucketService/CreateStorageBucket", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *storageBucketServiceClient) UpdateStorageBucket(ctx context.Context, in *UpdateStorageBucketRequest, opts ...grpc.CallOption) (*UpdateStorageBucketResponse, error) { + out := new(UpdateStorageBucketResponse) + err := c.cc.Invoke(ctx, "/controller.api.services.v1.StorageBucketService/UpdateStorageBucket", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *storageBucketServiceClient) DeleteStorageBucket(ctx context.Context, in *DeleteStorageBucketRequest, opts ...grpc.CallOption) (*DeleteStorageBucketResponse, error) { + out := new(DeleteStorageBucketResponse) + err := c.cc.Invoke(ctx, "/controller.api.services.v1.StorageBucketService/DeleteStorageBucket", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// StorageBucketServiceServer is the server API for StorageBucketService service. +// All implementations must embed UnimplementedStorageBucketServiceServer +// for forward compatibility +type StorageBucketServiceServer interface { + // GetStorageBucket returns a stored Storage Bucket if present. The provided + // request must include the ID for the Storage Bucket being retrieved. + // If missing, malformed, or referencing a non-existing resource an error is + // returned. + GetStorageBucket(context.Context, *GetStorageBucketRequest) (*GetStorageBucketResponse, error) + // ListStorageBuckets returns a list of stored Storage Buckets which exist inside + // the scope referenced in the request. The request must include the scope + // ID and if it is missing, malformed, or references a non-existing resource + // an error is returned. + ListStorageBuckets(context.Context, *ListStorageBucketsRequest) (*ListStorageBucketsResponse, error) + // CreateStorageBucket creates and stores a Storage Bucket in boundary. The + // provided request must include the scope ID in which the Storage Bucket will be + // created. If any of these required fields are missing, malformed, or reference a + // non-existing parent resource an error is returned. + CreateStorageBucket(context.Context, *CreateStorageBucketRequest) (*CreateStorageBucketResponse, error) + // UpdateStorageBucket updates an existing Storage Bucket in Boundary. The + // provided Storage Bucket must not have any read only fields set. The update + // mask must be provided and include at least 1 mutable field. To unset a + // field's value include that field name in the update mask and don't set the + // field in the Storage Bucket. + UpdateStorageBucket(context.Context, *UpdateStorageBucketRequest) (*UpdateStorageBucketResponse, error) + // DeleteStorageBucket removes a Storage Bucket from Boundary. + // If the provided Storage Bucket ID is malformed or not + // provided DeleteStorageBucket returns an error. + DeleteStorageBucket(context.Context, *DeleteStorageBucketRequest) (*DeleteStorageBucketResponse, error) + mustEmbedUnimplementedStorageBucketServiceServer() +} + +// UnimplementedStorageBucketServiceServer must be embedded to have forward compatible implementations. +type UnimplementedStorageBucketServiceServer struct { +} + +func (UnimplementedStorageBucketServiceServer) GetStorageBucket(context.Context, *GetStorageBucketRequest) (*GetStorageBucketResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetStorageBucket not implemented") +} +func (UnimplementedStorageBucketServiceServer) ListStorageBuckets(context.Context, *ListStorageBucketsRequest) (*ListStorageBucketsResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method ListStorageBuckets not implemented") +} +func (UnimplementedStorageBucketServiceServer) CreateStorageBucket(context.Context, *CreateStorageBucketRequest) (*CreateStorageBucketResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method CreateStorageBucket not implemented") +} +func (UnimplementedStorageBucketServiceServer) UpdateStorageBucket(context.Context, *UpdateStorageBucketRequest) (*UpdateStorageBucketResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method UpdateStorageBucket not implemented") +} +func (UnimplementedStorageBucketServiceServer) DeleteStorageBucket(context.Context, *DeleteStorageBucketRequest) (*DeleteStorageBucketResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method DeleteStorageBucket not implemented") +} +func (UnimplementedStorageBucketServiceServer) mustEmbedUnimplementedStorageBucketServiceServer() {} + +// UnsafeStorageBucketServiceServer may be embedded to opt out of forward compatibility for this service. +// Use of this interface is not recommended, as added methods to StorageBucketServiceServer will +// result in compilation errors. +type UnsafeStorageBucketServiceServer interface { + mustEmbedUnimplementedStorageBucketServiceServer() +} + +func RegisterStorageBucketServiceServer(s grpc.ServiceRegistrar, srv StorageBucketServiceServer) { + s.RegisterService(&StorageBucketService_ServiceDesc, srv) +} + +func _StorageBucketService_GetStorageBucket_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(GetStorageBucketRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(StorageBucketServiceServer).GetStorageBucket(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/controller.api.services.v1.StorageBucketService/GetStorageBucket", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(StorageBucketServiceServer).GetStorageBucket(ctx, req.(*GetStorageBucketRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _StorageBucketService_ListStorageBuckets_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(ListStorageBucketsRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(StorageBucketServiceServer).ListStorageBuckets(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/controller.api.services.v1.StorageBucketService/ListStorageBuckets", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(StorageBucketServiceServer).ListStorageBuckets(ctx, req.(*ListStorageBucketsRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _StorageBucketService_CreateStorageBucket_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(CreateStorageBucketRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(StorageBucketServiceServer).CreateStorageBucket(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/controller.api.services.v1.StorageBucketService/CreateStorageBucket", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(StorageBucketServiceServer).CreateStorageBucket(ctx, req.(*CreateStorageBucketRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _StorageBucketService_UpdateStorageBucket_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(UpdateStorageBucketRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(StorageBucketServiceServer).UpdateStorageBucket(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/controller.api.services.v1.StorageBucketService/UpdateStorageBucket", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(StorageBucketServiceServer).UpdateStorageBucket(ctx, req.(*UpdateStorageBucketRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _StorageBucketService_DeleteStorageBucket_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(DeleteStorageBucketRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(StorageBucketServiceServer).DeleteStorageBucket(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/controller.api.services.v1.StorageBucketService/DeleteStorageBucket", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(StorageBucketServiceServer).DeleteStorageBucket(ctx, req.(*DeleteStorageBucketRequest)) + } + return interceptor(ctx, in, info, handler) +} + +// StorageBucketService_ServiceDesc is the grpc.ServiceDesc for StorageBucketService service. +// It's only intended for direct use with grpc.RegisterService, +// and not to be introspected or modified (even as a copy) +var StorageBucketService_ServiceDesc = grpc.ServiceDesc{ + ServiceName: "controller.api.services.v1.StorageBucketService", + HandlerType: (*StorageBucketServiceServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "GetStorageBucket", + Handler: _StorageBucketService_GetStorageBucket_Handler, + }, + { + MethodName: "ListStorageBuckets", + Handler: _StorageBucketService_ListStorageBuckets_Handler, + }, + { + MethodName: "CreateStorageBucket", + Handler: _StorageBucketService_CreateStorageBucket_Handler, + }, + { + MethodName: "UpdateStorageBucket", + Handler: _StorageBucketService_UpdateStorageBucket_Handler, + }, + { + MethodName: "DeleteStorageBucket", + Handler: _StorageBucketService_DeleteStorageBucket_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "controller/api/services/v1/storage_bucket_service.proto", +} diff --git a/internal/perms/acl_test.go b/internal/perms/acl_test.go index 92f052e9a..fd1a5dac8 100644 --- a/internal/perms/acl_test.go +++ b/internal/perms/acl_test.go @@ -879,7 +879,7 @@ func Test_AnonRestrictions(t *testing.T) { for _, test := range tests { t.Run(test.name, func(t *testing.T) { require, assert := require.New(t), assert.New(t) - for i := resource.Type(1); i <= resource.Credential; i++ { + for i := resource.Type(1); i <= resource.StorageBucket; i++ { if i == resource.Controller || i == resource.Worker { continue } diff --git a/internal/proto/controller/api/resources/storagebuckets/v1/storage_bucket.proto b/internal/proto/controller/api/resources/storagebuckets/v1/storage_bucket.proto index a497b35df..176ac58af 100644 --- a/internal/proto/controller/api/resources/storagebuckets/v1/storage_bucket.proto +++ b/internal/proto/controller/api/resources/storagebuckets/v1/storage_bucket.proto @@ -6,28 +6,101 @@ syntax = "proto3"; package controller.api.resources.storagebuckets.v1; import "controller/api/resources/plugins/v1/plugin.proto"; +import "controller/api/resources/scopes/v1/scope.proto"; import "controller/custom_options/v1/options.proto"; import "google/protobuf/struct.proto"; +import "google/protobuf/timestamp.proto"; +import "google/protobuf/wrappers.proto"; option go_package = "github.com/hashicorp/boundary/sdk/pbs/controller/api/resources/storagebuckets;storagebuckets"; -// TODO: this definition is not complete and -// is empty because the message is being used in -// plugin/v1/storage_plugin_service.proto // StorageBucket manages external object stores message StorageBucket { - // The name of the resource that is managed by an external object store service. - string bucket_name = 10; // @gotags: `class:"public"` + // Output only. The ID of the storage bucket. + string id = 10; // @gotags: `class:"public"` - // The prefix used to organize the data held within the external object store. - string bucket_prefix = 20; // @gotags: `class:"public"` + // The ID of the Scope of which this storage bucket is a part. + string scope_id = 20 [json_name = "scope_id"]; // @gotags: `class:"public"` - // Attributes specific to the storage bucket type. - google.protobuf.Struct attributes = 30 [(custom_options.v1.generate_sdk_option) = true]; // @gotags: `class:"public"` + // Output only. Scope information for this resource. + resources.scopes.v1.ScopeInfo scope = 30; // @gotags: `class:"public"` - // Secrets specific to the storage bucket type. These are never output. - google.protobuf.Struct secrets = 40 [(custom_options.v1.generate_sdk_option) = true]; + // The ID of the plugin of which this storage bucket is created. + string plugin_id = 34 [ + json_name = "plugin_id", + (custom_options.v1.generate_sdk_option) = true + ]; // @gotags: `class:"public"` // Output only. Plugin information for this resource. - resources.plugins.v1.PluginInfo plugin = 50; + resources.plugins.v1.PluginInfo plugin = 35; // @gotags: `class:"public"` + + // Optional name for identification purposes. + google.protobuf.StringValue name = 40 [ + (custom_options.v1.generate_sdk_option) = true, + (custom_options.v1.mask_mapping) = { + this: "name" + that: "Name" + } + ]; // @gotags: `class:"public"` + + // Optional user-set description for identification purposes. + google.protobuf.StringValue description = 50 [ + (custom_options.v1.generate_sdk_option) = true, + (custom_options.v1.mask_mapping) = { + this: "description" + that: "Description" + } + ]; // @gotags: `class:"public"` + + // The name of the bucket within the external object store service. + string bucket_name = 60 [ + json_name = "bucket_name", + (custom_options.v1.generate_sdk_option) = true, + (custom_options.v1.mask_mapping) = { + this: "bucket_name" + that: "BucketName" + } + ]; // @gotags: `class:"public"` + + // The prefix used to organize the data held within the external object store. + string bucket_prefix = 70 [ + json_name = "bucket_prefix", + (custom_options.v1.generate_sdk_option) = true, + (custom_options.v1.mask_mapping) = { + this: "bucket_prefix" + that: "BucketPrefix" + } + ]; // @gotags: `class:"public"` + + // Output only. The time this resource was created. + google.protobuf.Timestamp created_time = 80 [json_name = "created_time"]; // @gotags: `class:"public"` + + // Output only. The time this resource was last updated. + google.protobuf.Timestamp updated_time = 90 [json_name = "updated_time"]; // @gotags: `class:"secret"` + + // Version is used in mutation requests, after the initial creation, to ensure this resource has not changed. + // The mutation will fail if the version does not match the latest known good version. + uint32 version = 100; // @gotags: `class:"public"` + + // Attributes specific to the catalog type. + google.protobuf.Struct attributes = 120 [(custom_options.v1.generate_sdk_option) = true]; // @gotags: `class:"public"` + + // Secrets specific to the storage bucket type. These are never output. + google.protobuf.Struct secrets = 130 [(custom_options.v1.generate_sdk_option) = true]; // @gotags: `class:"public"` + + // Output only. The HMAC of the last secrets supplied via the API, if any. + string secrets_hmac = 140; // @gotags: `class:"public"` + + // Filters to the worker(s) that can handle requests for this storage bucket + string worker_filter = 150 [ + json_name = "worker_filter", + (custom_options.v1.generate_sdk_option) = true, + (custom_options.v1.mask_mapping) = { + this: "worker_filter" + that: "WorkerFilter" + } + ]; // @gotags: `class:"public"` + + // Output only. The available actions on this resource for this user. + repeated string authorized_actions = 300 [json_name = "authorized_actions"]; // @gotags: `class:"public"` } diff --git a/internal/proto/controller/api/services/v1/storage_bucket_service.proto b/internal/proto/controller/api/services/v1/storage_bucket_service.proto new file mode 100644 index 000000000..e0f003b45 --- /dev/null +++ b/internal/proto/controller/api/services/v1/storage_bucket_service.proto @@ -0,0 +1,119 @@ +// Copyright (c) HashiCorp, Inc. +// SPDX-License-Identifier: MPL-2.0 + +syntax = "proto3"; + +package controller.api.services.v1; + +import "controller/api/resources/storagebuckets/v1/storage_bucket.proto"; +import "controller/custom_options/v1/options.proto"; +import "google/api/annotations.proto"; +import "google/protobuf/field_mask.proto"; +import "protoc-gen-openapiv2/options/annotations.proto"; + +option go_package = "github.com/hashicorp/boundary/internal/gen/controller/api/services;services"; +option (custom_options.v1.domain) = "storage"; + +service StorageBucketService { + // GetStorageBucket returns a stored Storage Bucket if present. The provided + // request must include the ID for the Storage Bucket being retrieved. + // If missing, malformed, or referencing a non-existing resource an error is + // returned. + rpc GetStorageBucket(GetStorageBucketRequest) returns (GetStorageBucketResponse) { + option (google.api.http) = { + get: "/v1/storage-buckets/{id}" + response_body: "item" + }; + option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = {summary: "Gets a single Storage Bucket."}; + } + + // ListStorageBuckets returns a list of stored Storage Buckets which exist inside + // the scope referenced in the request. The request must include the scope + // ID and if it is missing, malformed, or references a non-existing resource + // an error is returned. + rpc ListStorageBuckets(ListStorageBucketsRequest) returns (ListStorageBucketsResponse) { + option (google.api.http) = {get: "/v1/storage-buckets"}; + option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = {summary: "Gets a list of Storage Buckets."}; + } + + // CreateStorageBucket creates and stores a Storage Bucket in boundary. The + // provided request must include the scope ID in which the Storage Bucket will be + // created. If any of these required fields are missing, malformed, or reference a + // non-existing parent resource an error is returned. + rpc CreateStorageBucket(CreateStorageBucketRequest) returns (CreateStorageBucketResponse) { + option (google.api.http) = { + post: "/v1/storage-buckets" + body: "item" + response_body: "item" + }; + option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = {summary: "Creates a Storage Bucket"}; + } + + // UpdateStorageBucket updates an existing Storage Bucket in Boundary. The + // provided Storage Bucket must not have any read only fields set. The update + // mask must be provided and include at least 1 mutable field. To unset a + // field's value include that field name in the update mask and don't set the + // field in the Storage Bucket. + rpc UpdateStorageBucket(UpdateStorageBucketRequest) returns (UpdateStorageBucketResponse) { + option (google.api.http) = { + patch: "/v1/storage-buckets/{id}" + body: "item" + response_body: "item" + }; + option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = {summary: "Updates a Storage Bucket"}; + } + + // DeleteStorageBucket removes a Storage Bucket from Boundary. + // If the provided Storage Bucket ID is malformed or not + // provided DeleteStorageBucket returns an error. + rpc DeleteStorageBucket(DeleteStorageBucketRequest) returns (DeleteStorageBucketResponse) { + option (google.api.http) = {delete: "/v1/storage-buckets/{id}"}; + option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = {summary: "Deletes a Storage Bucket"}; + } +} + +message GetStorageBucketRequest { + string id = 1; // @gotags: `class:"public"` +} + +message GetStorageBucketResponse { + api.resources.storagebuckets.v1.StorageBucket item = 1; +} + +message ListStorageBucketsRequest { + string scope_id = 1 [json_name = "scope_id"]; // @gotags: `class:"public"` + bool recursive = 20 [json_name = "recursive"]; // @gotags: `class:"public"` + string filter = 30 [json_name = "filter"]; // @gotags: `class:"public"` +} + +message ListStorageBucketsResponse { + repeated api.resources.storagebuckets.v1.StorageBucket items = 1; +} + +message CreateStorageBucketRequest { + api.resources.storagebuckets.v1.StorageBucket item = 1; + // As an alternative to providing the plugin id in the provided StorageBucket, + // this field can be used to lookup the plugin using its name. + string plugin_name = 2 [json_name = "plugin_name"]; // @gotags: `class:"public"` +} + +message CreateStorageBucketResponse { + string uri = 1; // @gotags: `class:"public"` + api.resources.storagebuckets.v1.StorageBucket item = 2; +} + +message UpdateStorageBucketRequest { + string id = 1; // @gotags: `class:"public"` + api.resources.storagebuckets.v1.StorageBucket item = 2; + google.protobuf.FieldMask update_mask = 3; +} + +message UpdateStorageBucketResponse { + api.resources.storagebuckets.v1.StorageBucket item = 1; +} + +message DeleteStorageBucketRequest { + string id = 1; // @gotags: `class:"public"` +} + +message DeleteStorageBucketResponse {} diff --git a/internal/proto/controller/storage/storage/plugin/store/v1/storage.proto b/internal/proto/controller/storage/storage/plugin/store/v1/storage.proto index 22303f33b..c6df465fe 100644 --- a/internal/proto/controller/storage/storage/plugin/store/v1/storage.proto +++ b/internal/proto/controller/storage/storage/plugin/store/v1/storage.proto @@ -52,14 +52,23 @@ message StorageBucket { // The name of the external storage bucket (as opposed to the name within boundary) // @inject_tag: `gorm:"not_null"` - string bucket_name = 9; + string bucket_name = 9 [(custom_options.v1.mask_mapping) = { + this: "BucketName" + that: "bucket_name" + }]; // @inject_tag: `gorm:"default:null"` - string bucket_prefix = 10; + string bucket_prefix = 10 [(custom_options.v1.mask_mapping) = { + this: "BucketPrefix" + that: "bucket_prefix" + }]; // A boolean expression that allows filtering the workers that can handle a storage buckets // @inject_tag: `gorm:"not_null"` - string worker_filter = 11; + string worker_filter = 11 [(custom_options.v1.mask_mapping) = { + this: "WorkerFilter" + that: "worker_filter" + }]; // attributes is a json formatted field. // @inject_tag: `gorm:"not_null"` diff --git a/internal/storage/plugin/store/storage.pb.go b/internal/storage/plugin/store/storage.pb.go index 0f0bf6b4d..6cf06a971 100644 --- a/internal/storage/plugin/store/storage.pb.go +++ b/internal/storage/plugin/store/storage.pb.go @@ -291,7 +291,7 @@ var file_controller_storage_storage_plugin_store_v1_storage_proto_rawDesc = []by 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, 0xae, 0x04, 0x0a, 0x0d, 0x53, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x42, + 0x6f, 0x74, 0x6f, 0x22, 0x93, 0x05, 0x0a, 0x0d, 0x53, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x42, 0x75, 0x63, 0x6b, 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, 0x19, 0x0a, 0x08, 0x73, 0x63, 0x6f, 0x70, 0x65, 0x5f, 0x69, 0x64, 0x18, 0x02, @@ -315,32 +315,38 @@ var file_controller_storage_storage_plugin_store_v1_storage_proto_rawDesc = []by 0x18, 0x0a, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x1b, 0x0a, 0x09, 0x70, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x5f, 0x69, 0x64, 0x18, 0x08, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x70, 0x6c, - 0x75, 0x67, 0x69, 0x6e, 0x49, 0x64, 0x12, 0x1f, 0x0a, 0x0b, 0x62, 0x75, 0x63, 0x6b, 0x65, 0x74, - 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x09, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x62, 0x75, 0x63, - 0x6b, 0x65, 0x74, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x23, 0x0a, 0x0d, 0x62, 0x75, 0x63, 0x6b, 0x65, - 0x74, 0x5f, 0x70, 0x72, 0x65, 0x66, 0x69, 0x78, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, - 0x62, 0x75, 0x63, 0x6b, 0x65, 0x74, 0x50, 0x72, 0x65, 0x66, 0x69, 0x78, 0x12, 0x23, 0x0a, 0x0d, - 0x77, 0x6f, 0x72, 0x6b, 0x65, 0x72, 0x5f, 0x66, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x18, 0x0b, 0x20, - 0x01, 0x28, 0x09, 0x52, 0x0c, 0x77, 0x6f, 0x72, 0x6b, 0x65, 0x72, 0x46, 0x69, 0x6c, 0x74, 0x65, - 0x72, 0x12, 0x1e, 0x0a, 0x0a, 0x61, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x73, 0x18, - 0x0c, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x0a, 0x61, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, - 0x73, 0x12, 0x21, 0x0a, 0x0c, 0x73, 0x65, 0x63, 0x72, 0x65, 0x74, 0x73, 0x5f, 0x68, 0x6d, 0x61, - 0x63, 0x18, 0x0d, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x0b, 0x73, 0x65, 0x63, 0x72, 0x65, 0x74, 0x73, - 0x48, 0x6d, 0x61, 0x63, 0x22, 0x91, 0x01, 0x0a, 0x13, 0x53, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, - 0x42, 0x75, 0x63, 0x6b, 0x65, 0x74, 0x53, 0x65, 0x63, 0x72, 0x65, 0x74, 0x12, 0x2a, 0x0a, 0x11, - 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x5f, 0x62, 0x75, 0x63, 0x6b, 0x65, 0x74, 0x5f, 0x69, - 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0f, 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, - 0x42, 0x75, 0x63, 0x6b, 0x65, 0x74, 0x49, 0x64, 0x12, 0x18, 0x0a, 0x07, 0x73, 0x65, 0x63, 0x72, - 0x65, 0x74, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x07, 0x73, 0x65, 0x63, 0x72, 0x65, - 0x74, 0x73, 0x12, 0x1d, 0x0a, 0x0a, 0x63, 0x74, 0x5f, 0x73, 0x65, 0x63, 0x72, 0x65, 0x74, 0x73, - 0x18, 0x03, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x09, 0x63, 0x74, 0x53, 0x65, 0x63, 0x72, 0x65, 0x74, - 0x73, 0x12, 0x15, 0x0a, 0x06, 0x6b, 0x65, 0x79, 0x5f, 0x69, 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x05, 0x6b, 0x65, 0x79, 0x49, 0x64, 0x42, 0x43, 0x5a, 0x41, 0x67, 0x69, 0x74, 0x68, - 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x68, 0x61, 0x73, 0x68, 0x69, 0x63, 0x6f, 0x72, 0x70, - 0x2f, 0x62, 0x6f, 0x75, 0x6e, 0x64, 0x61, 0x72, 0x79, 0x2f, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, - 0x61, 0x6c, 0x2f, 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x2f, 0x70, 0x6c, 0x75, 0x67, 0x69, - 0x6e, 0x2f, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x3b, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x62, 0x06, 0x70, - 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x75, 0x67, 0x69, 0x6e, 0x49, 0x64, 0x12, 0x3e, 0x0a, 0x0b, 0x62, 0x75, 0x63, 0x6b, 0x65, 0x74, + 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x09, 0x20, 0x01, 0x28, 0x09, 0x42, 0x1d, 0xc2, 0xdd, 0x29, + 0x19, 0x0a, 0x0a, 0x42, 0x75, 0x63, 0x6b, 0x65, 0x74, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x0b, 0x62, + 0x75, 0x63, 0x6b, 0x65, 0x74, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x52, 0x0a, 0x62, 0x75, 0x63, 0x6b, + 0x65, 0x74, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x46, 0x0a, 0x0d, 0x62, 0x75, 0x63, 0x6b, 0x65, 0x74, + 0x5f, 0x70, 0x72, 0x65, 0x66, 0x69, 0x78, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x09, 0x42, 0x21, 0xc2, + 0xdd, 0x29, 0x1d, 0x0a, 0x0c, 0x42, 0x75, 0x63, 0x6b, 0x65, 0x74, 0x50, 0x72, 0x65, 0x66, 0x69, + 0x78, 0x12, 0x0d, 0x62, 0x75, 0x63, 0x6b, 0x65, 0x74, 0x5f, 0x70, 0x72, 0x65, 0x66, 0x69, 0x78, + 0x52, 0x0c, 0x62, 0x75, 0x63, 0x6b, 0x65, 0x74, 0x50, 0x72, 0x65, 0x66, 0x69, 0x78, 0x12, 0x46, + 0x0a, 0x0d, 0x77, 0x6f, 0x72, 0x6b, 0x65, 0x72, 0x5f, 0x66, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x18, + 0x0b, 0x20, 0x01, 0x28, 0x09, 0x42, 0x21, 0xc2, 0xdd, 0x29, 0x1d, 0x0a, 0x0c, 0x57, 0x6f, 0x72, + 0x6b, 0x65, 0x72, 0x46, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x12, 0x0d, 0x77, 0x6f, 0x72, 0x6b, 0x65, + 0x72, 0x5f, 0x66, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x52, 0x0c, 0x77, 0x6f, 0x72, 0x6b, 0x65, 0x72, + 0x46, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x12, 0x1e, 0x0a, 0x0a, 0x61, 0x74, 0x74, 0x72, 0x69, 0x62, + 0x75, 0x74, 0x65, 0x73, 0x18, 0x0c, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x0a, 0x61, 0x74, 0x74, 0x72, + 0x69, 0x62, 0x75, 0x74, 0x65, 0x73, 0x12, 0x21, 0x0a, 0x0c, 0x73, 0x65, 0x63, 0x72, 0x65, 0x74, + 0x73, 0x5f, 0x68, 0x6d, 0x61, 0x63, 0x18, 0x0d, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x0b, 0x73, 0x65, + 0x63, 0x72, 0x65, 0x74, 0x73, 0x48, 0x6d, 0x61, 0x63, 0x22, 0x91, 0x01, 0x0a, 0x13, 0x53, 0x74, + 0x6f, 0x72, 0x61, 0x67, 0x65, 0x42, 0x75, 0x63, 0x6b, 0x65, 0x74, 0x53, 0x65, 0x63, 0x72, 0x65, + 0x74, 0x12, 0x2a, 0x0a, 0x11, 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x5f, 0x62, 0x75, 0x63, + 0x6b, 0x65, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0f, 0x73, 0x74, + 0x6f, 0x72, 0x61, 0x67, 0x65, 0x42, 0x75, 0x63, 0x6b, 0x65, 0x74, 0x49, 0x64, 0x12, 0x18, 0x0a, + 0x07, 0x73, 0x65, 0x63, 0x72, 0x65, 0x74, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x07, + 0x73, 0x65, 0x63, 0x72, 0x65, 0x74, 0x73, 0x12, 0x1d, 0x0a, 0x0a, 0x63, 0x74, 0x5f, 0x73, 0x65, + 0x63, 0x72, 0x65, 0x74, 0x73, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x09, 0x63, 0x74, 0x53, + 0x65, 0x63, 0x72, 0x65, 0x74, 0x73, 0x12, 0x15, 0x0a, 0x06, 0x6b, 0x65, 0x79, 0x5f, 0x69, 0x64, + 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x6b, 0x65, 0x79, 0x49, 0x64, 0x42, 0x43, 0x5a, + 0x41, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x68, 0x61, 0x73, 0x68, + 0x69, 0x63, 0x6f, 0x72, 0x70, 0x2f, 0x62, 0x6f, 0x75, 0x6e, 0x64, 0x61, 0x72, 0x79, 0x2f, 0x69, + 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x2f, 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x2f, + 0x70, 0x6c, 0x75, 0x67, 0x69, 0x6e, 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/storage/storage.go b/internal/storage/storage.go index 204b56479..574f2430e 100644 --- a/internal/storage/storage.go +++ b/internal/storage/storage.go @@ -8,20 +8,25 @@ import ( "io" "io/fs" + "github.com/hashicorp/boundary/internal/boundary" + "github.com/hashicorp/boundary/sdk/pbs/controller/api/resources/storagebuckets" plgpb "github.com/hashicorp/boundary/sdk/pbs/plugin" ) // RecordingStorage can be used to create a FS usable for session recording. type RecordingStorage interface { - NewLocalFS(ctx context.Context, bucket Bucket, _ ...Option) (FS, error) - NewRemoteFS(ctx context.Context, bucket Bucket, _ ...Option) (FS, error) + NewLocalFS(ctx context.Context, bucket *storagebuckets.StorageBucket, _ ...Option) (FS, error) + NewRemoteFS(ctx context.Context, bucket *storagebuckets.StorageBucket, _ ...Option) (FS, error) PluginClients() map[string]plgpb.StoragePluginServiceClient } // Bucket is a resource that represents a bucket in an external object store type Bucket interface { + boundary.Resource + GetScopeId() string GetBucketName() string GetBucketPrefix() string + GetWorkerFilter() string } // FS is a filesystem for creating or reading files and containers. diff --git a/internal/types/resource/resource.go b/internal/types/resource/resource.go index 24e3a4538..46041fa49 100644 --- a/internal/types/resource/resource.go +++ b/internal/types/resource/resource.go @@ -29,6 +29,7 @@ const ( CredentialStore CredentialLibrary Credential + StorageBucket // NOTE: When adding a new type, be sure to update: // // * The Grant.validateType function and test @@ -65,6 +66,7 @@ func (r Type) String() string { "credential-store", "credential-library", "credential", + "storage-bucket", }[r] } @@ -98,6 +100,7 @@ var Map = map[string]Type{ CredentialStore.String(): CredentialStore, CredentialLibrary.String(): CredentialLibrary, Credential.String(): Credential, + StorageBucket.String(): StorageBucket, } // Parent returns the parent type for a given type; if there is no parent, it @@ -138,6 +141,7 @@ func TopLevelType(typ Type) bool { Session, Target, User, + StorageBucket, Worker: return true } diff --git a/internal/types/resource/resource_test.go b/internal/types/resource/resource_test.go index d502a1030..37042a3ce 100644 --- a/internal/types/resource/resource_test.go +++ b/internal/types/resource/resource_test.go @@ -101,6 +101,11 @@ func Test_Resource(t *testing.T) { want: ManagedGroup, parent: AuthMethod, }, + { + typeString: "storage-bucket", + want: StorageBucket, + topLevelType: true, + }, { typeString: "credential-store", want: CredentialStore, diff --git a/sdk/pbs/controller/api/resources/storagebuckets/storage_bucket.pb.go b/sdk/pbs/controller/api/resources/storagebuckets/storage_bucket.pb.go index 1596b869f..69aeb6530 100644 --- a/sdk/pbs/controller/api/resources/storagebuckets/storage_bucket.pb.go +++ b/sdk/pbs/controller/api/resources/storagebuckets/storage_bucket.pb.go @@ -11,10 +11,13 @@ package storagebuckets import ( plugins "github.com/hashicorp/boundary/sdk/pbs/controller/api/resources/plugins" + scopes "github.com/hashicorp/boundary/sdk/pbs/controller/api/resources/scopes" _ "github.com/hashicorp/boundary/sdk/pbs/controller/protooptions" protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoimpl "google.golang.org/protobuf/runtime/protoimpl" structpb "google.golang.org/protobuf/types/known/structpb" + timestamppb "google.golang.org/protobuf/types/known/timestamppb" + wrapperspb "google.golang.org/protobuf/types/known/wrapperspb" reflect "reflect" sync "sync" ) @@ -26,25 +29,47 @@ const ( _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) ) -// TODO: this definition is not complete and -// is empty because the message is being used in -// plugin/v1/storage_plugin_service.proto // StorageBucket manages external object stores type StorageBucket struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - // The name of the resource that is managed by an external object store service. - BucketName string `protobuf:"bytes,10,opt,name=bucket_name,json=bucketName,proto3" json:"bucket_name,omitempty"` // @gotags: `class:"public"` - // The prefix used to organize the data held within the external object store. - BucketPrefix string `protobuf:"bytes,20,opt,name=bucket_prefix,json=bucketPrefix,proto3" json:"bucket_prefix,omitempty"` // @gotags: `class:"public"` - // Attributes specific to the storage bucket type. - Attributes *structpb.Struct `protobuf:"bytes,30,opt,name=attributes,proto3" json:"attributes,omitempty"` // @gotags: `class:"public"` - // Secrets specific to the storage bucket type. These are never output. - Secrets *structpb.Struct `protobuf:"bytes,40,opt,name=secrets,proto3" json:"secrets,omitempty"` + // Output only. The ID of the storage bucket. + Id string `protobuf:"bytes,10,opt,name=id,proto3" json:"id,omitempty" class:"public"` // @gotags: `class:"public"` + // The ID of the Scope of which this storage bucket is a part. + ScopeId string `protobuf:"bytes,20,opt,name=scope_id,proto3" json:"scope_id,omitempty" class:"public"` // @gotags: `class:"public"` + // Output only. Scope information for this resource. + Scope *scopes.ScopeInfo `protobuf:"bytes,30,opt,name=scope,proto3" json:"scope,omitempty" class:"public"` // @gotags: `class:"public"` + // The ID of the plugin of which this storage bucket is created. + PluginId string `protobuf:"bytes,34,opt,name=plugin_id,proto3" json:"plugin_id,omitempty" class:"public"` // @gotags: `class:"public"` // Output only. Plugin information for this resource. - Plugin *plugins.PluginInfo `protobuf:"bytes,50,opt,name=plugin,proto3" json:"plugin,omitempty"` + Plugin *plugins.PluginInfo `protobuf:"bytes,35,opt,name=plugin,proto3" json:"plugin,omitempty" class:"public"` // @gotags: `class:"public"` + // Optional name for identification purposes. + Name *wrapperspb.StringValue `protobuf:"bytes,40,opt,name=name,proto3" json:"name,omitempty" class:"public"` // @gotags: `class:"public"` + // Optional user-set description for identification purposes. + Description *wrapperspb.StringValue `protobuf:"bytes,50,opt,name=description,proto3" json:"description,omitempty" class:"public"` // @gotags: `class:"public"` + // The name of the bucket within the external object store service. + BucketName string `protobuf:"bytes,60,opt,name=bucket_name,proto3" json:"bucket_name,omitempty" class:"public"` // @gotags: `class:"public"` + // The prefix used to organize the data held within the external object store. + BucketPrefix string `protobuf:"bytes,70,opt,name=bucket_prefix,proto3" json:"bucket_prefix,omitempty" class:"public"` // @gotags: `class:"public"` + // Output only. The time this resource was created. + CreatedTime *timestamppb.Timestamp `protobuf:"bytes,80,opt,name=created_time,proto3" json:"created_time,omitempty" class:"public"` // @gotags: `class:"public"` + // Output only. The time this resource was last updated. + UpdatedTime *timestamppb.Timestamp `protobuf:"bytes,90,opt,name=updated_time,proto3" json:"updated_time,omitempty" class:"secret"` // @gotags: `class:"secret"` + // Version is used in mutation requests, after the initial creation, to ensure this resource has not changed. + // The mutation will fail if the version does not match the latest known good version. + Version uint32 `protobuf:"varint,100,opt,name=version,proto3" json:"version,omitempty" class:"public"` // @gotags: `class:"public"` + // Attributes specific to the catalog type. + Attributes *structpb.Struct `protobuf:"bytes,120,opt,name=attributes,proto3" json:"attributes,omitempty" class:"public"` // @gotags: `class:"public"` + // Secrets specific to the storage bucket type. These are never output. + Secrets *structpb.Struct `protobuf:"bytes,130,opt,name=secrets,proto3" json:"secrets,omitempty" class:"public"` // @gotags: `class:"public"` + // Output only. The HMAC of the last secrets supplied via the API, if any. + SecretsHmac string `protobuf:"bytes,140,opt,name=secrets_hmac,json=secretsHmac,proto3" json:"secrets_hmac,omitempty" class:"public"` // @gotags: `class:"public"` + // Filters to the worker(s) that can handle requests for this storage bucket + WorkerFilter string `protobuf:"bytes,150,opt,name=worker_filter,proto3" json:"worker_filter,omitempty" class:"public"` // @gotags: `class:"public"` + // Output only. The available actions on this resource for this user. + AuthorizedActions []string `protobuf:"bytes,300,rep,name=authorized_actions,proto3" json:"authorized_actions,omitempty" class:"public"` // @gotags: `class:"public"` } func (x *StorageBucket) Reset() { @@ -79,6 +104,55 @@ func (*StorageBucket) Descriptor() ([]byte, []int) { return file_controller_api_resources_storagebuckets_v1_storage_bucket_proto_rawDescGZIP(), []int{0} } +func (x *StorageBucket) GetId() string { + if x != nil { + return x.Id + } + return "" +} + +func (x *StorageBucket) GetScopeId() string { + if x != nil { + return x.ScopeId + } + return "" +} + +func (x *StorageBucket) GetScope() *scopes.ScopeInfo { + if x != nil { + return x.Scope + } + return nil +} + +func (x *StorageBucket) GetPluginId() string { + if x != nil { + return x.PluginId + } + return "" +} + +func (x *StorageBucket) GetPlugin() *plugins.PluginInfo { + if x != nil { + return x.Plugin + } + return nil +} + +func (x *StorageBucket) GetName() *wrapperspb.StringValue { + if x != nil { + return x.Name + } + return nil +} + +func (x *StorageBucket) GetDescription() *wrapperspb.StringValue { + if x != nil { + return x.Description + } + return nil +} + func (x *StorageBucket) GetBucketName() string { if x != nil { return x.BucketName @@ -93,6 +167,27 @@ func (x *StorageBucket) GetBucketPrefix() string { return "" } +func (x *StorageBucket) GetCreatedTime() *timestamppb.Timestamp { + if x != nil { + return x.CreatedTime + } + return nil +} + +func (x *StorageBucket) GetUpdatedTime() *timestamppb.Timestamp { + if x != nil { + return x.UpdatedTime + } + return nil +} + +func (x *StorageBucket) GetVersion() uint32 { + if x != nil { + return x.Version + } + return 0 +} + func (x *StorageBucket) GetAttributes() *structpb.Struct { if x != nil { return x.Attributes @@ -107,9 +202,23 @@ func (x *StorageBucket) GetSecrets() *structpb.Struct { return nil } -func (x *StorageBucket) GetPlugin() *plugins.PluginInfo { +func (x *StorageBucket) GetSecretsHmac() string { if x != nil { - return x.Plugin + return x.SecretsHmac + } + return "" +} + +func (x *StorageBucket) GetWorkerFilter() string { + if x != nil { + return x.WorkerFilter + } + return "" +} + +func (x *StorageBucket) GetAuthorizedActions() []string { + if x != nil { + return x.AuthorizedActions } return nil } @@ -127,35 +236,87 @@ var file_controller_api_resources_storagebuckets_v1_storage_bucket_proto_rawDesc 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x65, 0x72, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, 0x2f, 0x70, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x73, 0x2f, 0x76, 0x31, 0x2f, 0x70, 0x6c, 0x75, 0x67, 0x69, 0x6e, 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, 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, 0x22, 0x96, 0x02, 0x0a, 0x0d, 0x53, 0x74, - 0x6f, 0x72, 0x61, 0x67, 0x65, 0x42, 0x75, 0x63, 0x6b, 0x65, 0x74, 0x12, 0x1f, 0x0a, 0x0b, 0x62, - 0x75, 0x63, 0x6b, 0x65, 0x74, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x09, - 0x52, 0x0a, 0x62, 0x75, 0x63, 0x6b, 0x65, 0x74, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x23, 0x0a, 0x0d, - 0x62, 0x75, 0x63, 0x6b, 0x65, 0x74, 0x5f, 0x70, 0x72, 0x65, 0x66, 0x69, 0x78, 0x18, 0x14, 0x20, - 0x01, 0x28, 0x09, 0x52, 0x0c, 0x62, 0x75, 0x63, 0x6b, 0x65, 0x74, 0x50, 0x72, 0x65, 0x66, 0x69, - 0x78, 0x12, 0x3d, 0x0a, 0x0a, 0x61, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x73, 0x18, - 0x1e, 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, - 0x12, 0x37, 0x0a, 0x07, 0x73, 0x65, 0x63, 0x72, 0x65, 0x74, 0x73, 0x18, 0x28, 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, 0x07, 0x73, 0x65, 0x63, 0x72, 0x65, 0x74, 0x73, 0x12, 0x47, 0x0a, 0x06, 0x70, 0x6c, 0x75, - 0x67, 0x69, 0x6e, 0x18, 0x32, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2f, 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, 0x70, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x73, 0x2e, 0x76, 0x31, 0x2e, - 0x50, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x06, 0x70, 0x6c, 0x75, 0x67, - 0x69, 0x6e, 0x42, 0x5e, 0x5a, 0x5c, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, - 0x2f, 0x68, 0x61, 0x73, 0x68, 0x69, 0x63, 0x6f, 0x72, 0x70, 0x2f, 0x62, 0x6f, 0x75, 0x6e, 0x64, - 0x61, 0x72, 0x79, 0x2f, 0x73, 0x64, 0x6b, 0x2f, 0x70, 0x62, 0x73, 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, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x62, 0x75, 0x63, 0x6b, - 0x65, 0x74, 0x73, 0x3b, 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x62, 0x75, 0x63, 0x6b, 0x65, - 0x74, 0x73, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x75, 0x63, 0x74, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 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, 0x22, 0xe1, 0x07, 0x0a, 0x0d, 0x53, + 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x42, 0x75, 0x63, 0x6b, 0x65, 0x74, 0x12, 0x0e, 0x0a, 0x02, + 0x69, 0x64, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x1a, 0x0a, 0x08, + 0x73, 0x63, 0x6f, 0x70, 0x65, 0x5f, 0x69, 0x64, 0x18, 0x14, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, + 0x73, 0x63, 0x6f, 0x70, 0x65, 0x5f, 0x69, 0x64, 0x12, 0x43, 0x0a, 0x05, 0x73, 0x63, 0x6f, 0x70, + 0x65, 0x18, 0x1e, 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, 0x22, 0x0a, + 0x09, 0x70, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x5f, 0x69, 0x64, 0x18, 0x22, 0x20, 0x01, 0x28, 0x09, + 0x42, 0x04, 0xa0, 0xda, 0x29, 0x01, 0x52, 0x09, 0x70, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x5f, 0x69, + 0x64, 0x12, 0x47, 0x0a, 0x06, 0x70, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x18, 0x23, 0x20, 0x01, 0x28, + 0x0b, 0x32, 0x2f, 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, 0x70, 0x6c, 0x75, + 0x67, 0x69, 0x6e, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x50, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x49, 0x6e, + 0x66, 0x6f, 0x52, 0x06, 0x70, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x12, 0x46, 0x0a, 0x04, 0x6e, 0x61, + 0x6d, 0x65, 0x18, 0x28, 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, 0x4e, 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, 0x32, 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, 0x44, 0x65, + 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, + 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x43, 0x0a, 0x0b, 0x62, 0x75, 0x63, 0x6b, 0x65, 0x74, + 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x3c, 0x20, 0x01, 0x28, 0x09, 0x42, 0x21, 0xa0, 0xda, 0x29, + 0x01, 0xc2, 0xdd, 0x29, 0x19, 0x0a, 0x0b, 0x62, 0x75, 0x63, 0x6b, 0x65, 0x74, 0x5f, 0x6e, 0x61, + 0x6d, 0x65, 0x12, 0x0a, 0x42, 0x75, 0x63, 0x6b, 0x65, 0x74, 0x4e, 0x61, 0x6d, 0x65, 0x52, 0x0b, + 0x62, 0x75, 0x63, 0x6b, 0x65, 0x74, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x4b, 0x0a, 0x0d, 0x62, + 0x75, 0x63, 0x6b, 0x65, 0x74, 0x5f, 0x70, 0x72, 0x65, 0x66, 0x69, 0x78, 0x18, 0x46, 0x20, 0x01, + 0x28, 0x09, 0x42, 0x25, 0xa0, 0xda, 0x29, 0x01, 0xc2, 0xdd, 0x29, 0x1d, 0x0a, 0x0d, 0x62, 0x75, + 0x63, 0x6b, 0x65, 0x74, 0x5f, 0x70, 0x72, 0x65, 0x66, 0x69, 0x78, 0x12, 0x0c, 0x42, 0x75, 0x63, + 0x6b, 0x65, 0x74, 0x50, 0x72, 0x65, 0x66, 0x69, 0x78, 0x52, 0x0d, 0x62, 0x75, 0x63, 0x6b, 0x65, + 0x74, 0x5f, 0x70, 0x72, 0x65, 0x66, 0x69, 0x78, 0x12, 0x3e, 0x0a, 0x0c, 0x63, 0x72, 0x65, 0x61, + 0x74, 0x65, 0x64, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x50, 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, 0x5a, 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, 0x07, 0x76, 0x65, 0x72, 0x73, + 0x69, 0x6f, 0x6e, 0x18, 0x64, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, + 0x6f, 0x6e, 0x12, 0x3d, 0x0a, 0x0a, 0x61, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x73, + 0x18, 0x78, 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, 0x12, 0x38, 0x0a, 0x07, 0x73, 0x65, 0x63, 0x72, 0x65, 0x74, 0x73, 0x18, 0x82, 0x01, 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, 0x07, 0x73, 0x65, 0x63, 0x72, 0x65, 0x74, 0x73, 0x12, 0x22, 0x0a, 0x0c, 0x73, + 0x65, 0x63, 0x72, 0x65, 0x74, 0x73, 0x5f, 0x68, 0x6d, 0x61, 0x63, 0x18, 0x8c, 0x01, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x0b, 0x73, 0x65, 0x63, 0x72, 0x65, 0x74, 0x73, 0x48, 0x6d, 0x61, 0x63, 0x12, + 0x4c, 0x0a, 0x0d, 0x77, 0x6f, 0x72, 0x6b, 0x65, 0x72, 0x5f, 0x66, 0x69, 0x6c, 0x74, 0x65, 0x72, + 0x18, 0x96, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x25, 0xa0, 0xda, 0x29, 0x01, 0xc2, 0xdd, 0x29, + 0x1d, 0x0a, 0x0d, 0x77, 0x6f, 0x72, 0x6b, 0x65, 0x72, 0x5f, 0x66, 0x69, 0x6c, 0x74, 0x65, 0x72, + 0x12, 0x0c, 0x57, 0x6f, 0x72, 0x6b, 0x65, 0x72, 0x46, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x52, 0x0d, + 0x77, 0x6f, 0x72, 0x6b, 0x65, 0x72, 0x5f, 0x66, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x12, 0x2f, 0x0a, + 0x12, 0x61, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x7a, 0x65, 0x64, 0x5f, 0x61, 0x63, 0x74, 0x69, + 0x6f, 0x6e, 0x73, 0x18, 0xac, 0x02, 0x20, 0x03, 0x28, 0x09, 0x52, 0x12, 0x61, 0x75, 0x74, 0x68, + 0x6f, 0x72, 0x69, 0x7a, 0x65, 0x64, 0x5f, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x42, 0x5e, + 0x5a, 0x5c, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x68, 0x61, 0x73, + 0x68, 0x69, 0x63, 0x6f, 0x72, 0x70, 0x2f, 0x62, 0x6f, 0x75, 0x6e, 0x64, 0x61, 0x72, 0x79, 0x2f, + 0x73, 0x64, 0x6b, 0x2f, 0x70, 0x62, 0x73, 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, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x62, 0x75, 0x63, 0x6b, 0x65, 0x74, 0x73, 0x3b, + 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x62, 0x75, 0x63, 0x6b, 0x65, 0x74, 0x73, 0x62, 0x06, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -172,19 +333,27 @@ func file_controller_api_resources_storagebuckets_v1_storage_bucket_proto_rawDes var file_controller_api_resources_storagebuckets_v1_storage_bucket_proto_msgTypes = make([]protoimpl.MessageInfo, 1) var file_controller_api_resources_storagebuckets_v1_storage_bucket_proto_goTypes = []interface{}{ - (*StorageBucket)(nil), // 0: controller.api.resources.storagebuckets.v1.StorageBucket - (*structpb.Struct)(nil), // 1: google.protobuf.Struct - (*plugins.PluginInfo)(nil), // 2: controller.api.resources.plugins.v1.PluginInfo + (*StorageBucket)(nil), // 0: controller.api.resources.storagebuckets.v1.StorageBucket + (*scopes.ScopeInfo)(nil), // 1: controller.api.resources.scopes.v1.ScopeInfo + (*plugins.PluginInfo)(nil), // 2: controller.api.resources.plugins.v1.PluginInfo + (*wrapperspb.StringValue)(nil), // 3: google.protobuf.StringValue + (*timestamppb.Timestamp)(nil), // 4: google.protobuf.Timestamp + (*structpb.Struct)(nil), // 5: google.protobuf.Struct } var file_controller_api_resources_storagebuckets_v1_storage_bucket_proto_depIdxs = []int32{ - 1, // 0: controller.api.resources.storagebuckets.v1.StorageBucket.attributes:type_name -> google.protobuf.Struct - 1, // 1: controller.api.resources.storagebuckets.v1.StorageBucket.secrets:type_name -> google.protobuf.Struct - 2, // 2: controller.api.resources.storagebuckets.v1.StorageBucket.plugin:type_name -> controller.api.resources.plugins.v1.PluginInfo - 3, // [3:3] is the sub-list for method output_type - 3, // [3:3] is the sub-list for method input_type - 3, // [3:3] is the sub-list for extension type_name - 3, // [3:3] is the sub-list for extension extendee - 0, // [0:3] is the sub-list for field type_name + 1, // 0: controller.api.resources.storagebuckets.v1.StorageBucket.scope:type_name -> controller.api.resources.scopes.v1.ScopeInfo + 2, // 1: controller.api.resources.storagebuckets.v1.StorageBucket.plugin:type_name -> controller.api.resources.plugins.v1.PluginInfo + 3, // 2: controller.api.resources.storagebuckets.v1.StorageBucket.name:type_name -> google.protobuf.StringValue + 3, // 3: controller.api.resources.storagebuckets.v1.StorageBucket.description:type_name -> google.protobuf.StringValue + 4, // 4: controller.api.resources.storagebuckets.v1.StorageBucket.created_time:type_name -> google.protobuf.Timestamp + 4, // 5: controller.api.resources.storagebuckets.v1.StorageBucket.updated_time:type_name -> google.protobuf.Timestamp + 5, // 6: controller.api.resources.storagebuckets.v1.StorageBucket.attributes:type_name -> google.protobuf.Struct + 5, // 7: controller.api.resources.storagebuckets.v1.StorageBucket.secrets:type_name -> google.protobuf.Struct + 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 + 8, // [8:8] is the sub-list for extension extendee + 0, // [0:8] is the sub-list for field type_name } func init() { file_controller_api_resources_storagebuckets_v1_storage_bucket_proto_init() }