From 13d9c7f0f88659c731d33976a0ea3478cc3faeb2 Mon Sep 17 00:00:00 2001 From: Denis Kirillov Date: Tue, 18 Jun 2024 09:41:30 +0300 Subject: [PATCH] [#406] Remove control api Signed-off-by: Denis Kirillov --- CHANGELOG.md | 1 + cmd/s3-gw/app.go | 77 +- cmd/s3-gw/app_settings.go | 24 - config/config.env | 6 - config/config.yaml | 9 - docs/configuration.md | 19 - internal/frostfs/policy/storage.go | 12 +- internal/logs/logs.go | 9 - pkg/service/control/client/client.go | 184 -- pkg/service/control/server/server.go | 352 ---- pkg/service/control/service.pb.go | 1951 --------------------- pkg/service/control/service.proto | 206 --- pkg/service/control/service_frostfs.pb.go | 955 ---------- pkg/service/control/service_grpc.pb.go | 249 --- 14 files changed, 7 insertions(+), 4047 deletions(-) delete mode 100644 pkg/service/control/client/client.go delete mode 100644 pkg/service/control/server/server.go delete mode 100644 pkg/service/control/service.pb.go delete mode 100644 pkg/service/control/service.proto delete mode 100644 pkg/service/control/service_frostfs.pb.go delete mode 100644 pkg/service/control/service_grpc.pb.go diff --git a/CHANGELOG.md b/CHANGELOG.md index 35c0209..487ba9f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -23,6 +23,7 @@ This document outlines major changes between releases. - Support updated naming in native policy JSON (#385) ### Removed +- Remove control api (#406) ## [0.29.0] - Zemu - 2024-05-27 diff --git a/cmd/s3-gw/app.go b/cmd/s3-gw/app.go index d8e22af..3f72695 100644 --- a/cmd/s3-gw/app.go +++ b/cmd/s3-gw/app.go @@ -7,7 +7,6 @@ import ( "errors" "fmt" "io" - "net" "net/http" "os" "os/signal" @@ -38,8 +37,6 @@ import ( "git.frostfs.info/TrueCloudLab/frostfs-s3-gw/internal/version" "git.frostfs.info/TrueCloudLab/frostfs-s3-gw/internal/wallet" "git.frostfs.info/TrueCloudLab/frostfs-s3-gw/metrics" - "git.frostfs.info/TrueCloudLab/frostfs-s3-gw/pkg/service/control" - controlSvc "git.frostfs.info/TrueCloudLab/frostfs-s3-gw/pkg/service/control/server" "git.frostfs.info/TrueCloudLab/frostfs-s3-gw/pkg/service/tree" "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/netmap" "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/pool" @@ -77,8 +74,6 @@ type ( unbindServers []ServerInfo mu sync.RWMutex - controlAPI *grpc.Server - metrics *metrics.AppMetrics bucketResolver *resolver.BucketResolver services []*Service @@ -108,7 +103,6 @@ type ( aclEnabled bool namespaceHeader string defaultNamespaces []string - authorizedControlAPIKeys [][]byte policyDenyByDefault bool sourceIPHeader string retryMaxAttempts int @@ -151,7 +145,7 @@ func newApp(ctx context.Context, log *Logger, v *viper.Viper) *App { webDone: make(chan struct{}, 1), wrkDone: make(chan struct{}, 1), - settings: newAppSettings(log, v, key), + settings: newAppSettings(log, v), } app.init(ctx) @@ -165,7 +159,6 @@ func (a *App) init(ctx context.Context) { a.initPolicyStorage(ctx) a.initAPI(ctx) a.initMetrics() - a.initControlAPI() a.initServers(ctx) a.initTracing(ctx) } @@ -209,7 +202,7 @@ func (a *App) initLayer(ctx context.Context) { } } -func newAppSettings(log *Logger, v *viper.Viper, key *keys.PrivateKey) *appSettings { +func newAppSettings(log *Logger, v *viper.Viper) *appSettings { settings := &appSettings{ logLevel: log.lvl, maxClient: newMaxClients(v), @@ -225,12 +218,12 @@ func newAppSettings(log *Logger, v *viper.Viper, key *keys.PrivateKey) *appSetti settings.resolveZoneList = v.GetStringSlice(cfgResolveBucketDeny) } - settings.update(v, log.logger, key) + settings.update(v, log.logger) return settings } -func (s *appSettings) update(v *viper.Viper, log *zap.Logger, key *keys.PrivateKey) { +func (s *appSettings) update(v *viper.Viper, log *zap.Logger) { s.updateNamespacesSettings(v, log) s.useDefaultXMLNamespace(v.GetBool(cfgKludgeUseDefaultXMLNS)) s.setACLEnabled(v.GetBool(cfgKludgeACLEnabled)) @@ -238,7 +231,6 @@ func (s *appSettings) update(v *viper.Viper, log *zap.Logger, key *keys.PrivateK s.setClientCut(v.GetBool(cfgClientCut)) s.setBufferMaxSizeForPut(v.GetUint64(cfgBufferMaxSizeForPut)) s.setMD5Enabled(v.GetBool(cfgMD5Enabled)) - s.setAuthorizedControlAPIKeys(append(fetchAuthorizedKeys(log, v), key.PublicKey())) s.setPolicyDenyByDefault(v.GetBool(cfgPolicyDenyByDefault)) s.setSourceIPHeader(v.GetString(cfgSourceIPHeader)) s.setRetryMaxAttempts(fetchRetryMaxAttempts(v)) @@ -408,23 +400,6 @@ func (s *appSettings) isDefaultNamespace(ns string) bool { return slices.Contains(namespaces, ns) } -func (s *appSettings) FetchRawKeys() [][]byte { - s.mu.RLock() - defer s.mu.RUnlock() - return s.authorizedControlAPIKeys -} - -func (s *appSettings) setAuthorizedControlAPIKeys(keys keys.PublicKeys) { - rawPubs := make([][]byte, len(keys)) - for i := range keys { - rawPubs[i] = keys[i].Bytes() - } - - s.mu.Lock() - s.authorizedControlAPIKeys = rawPubs - s.mu.Unlock() -} - func (s *appSettings) ResolveNamespaceAlias(namespace string) string { if s.isDefaultNamespace(namespace) { return defaultNamespace @@ -498,18 +473,6 @@ func (a *App) initAPI(ctx context.Context) { a.initHandler() } -func (a *App) initControlAPI() { - svc := controlSvc.New( - controlSvc.WithSettings(a.settings), - controlSvc.WithLogger(a.log), - controlSvc.WithChainStorage(a.policyStorage.LocalStorage()), - ) - - a.controlAPI = grpc.NewServer() - - control.RegisterControlServiceServer(a.controlAPI, svc) -} - func (a *App) initMetrics() { cfg := metrics.AppMetricsConfig{ Logger: a.log, @@ -796,16 +759,6 @@ func (a *App) Serve(ctx context.Context) { a.scheduleReconnect(ctx, srv) } - go func() { - address := a.cfg.GetString(cfgControlGRPCEndpoint) - a.log.Info(logs.StartingControlAPI, zap.String("address", address)) - if listener, err := net.Listen("tcp", address); err != nil { - a.log.Fatal(logs.ListenAndServe, zap.Error(err)) - } else if err = a.controlAPI.Serve(listener); err != nil { - a.log.Fatal(logs.ListenAndServe, zap.Error(err)) - } - }() - sigs := make(chan os.Signal, 1) signal.Notify(sigs, syscall.SIGHUP) @@ -824,7 +777,6 @@ LOOP: a.log.Info(logs.StoppingServer, zap.Error(srv.Shutdown(ctx))) - a.stopControlAPI() a.metrics.Shutdown() a.stopServices() a.shutdownTracing() @@ -836,25 +788,6 @@ func shutdownContext() (context.Context, context.CancelFunc) { return context.WithTimeout(context.Background(), defaultShutdownTimeout) } -func (a *App) stopControlAPI() { - ctx, cancel := shutdownContext() - defer cancel() - - go func() { - a.controlAPI.GracefulStop() - cancel() - }() - - <-ctx.Done() - - if errors.Is(ctx.Err(), context.DeadlineExceeded) { - a.log.Info(logs.ControlAPICannotShutdownGracefully) - a.controlAPI.Stop() - } - - a.log.Info(logs.ControlAPIServiceStopped) -} - func (a *App) configReload(ctx context.Context) { a.log.Info(logs.SIGHUPConfigReloadStarted) @@ -896,7 +829,7 @@ func (a *App) updateSettings() { a.settings.logLevel.SetLevel(lvl) } - a.settings.update(a.cfg, a.log, a.key) + a.settings.update(a.cfg, a.log) } func (a *App) startServices() { diff --git a/cmd/s3-gw/app_settings.go b/cmd/s3-gw/app_settings.go index 3c53550..dc2a336 100644 --- a/cmd/s3-gw/app_settings.go +++ b/cmd/s3-gw/app_settings.go @@ -21,7 +21,6 @@ import ( "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/netmap" "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/pool" "git.frostfs.info/TrueCloudLab/zapjournald" - "github.com/nspcc-dev/neo-go/pkg/crypto/keys" "github.com/spf13/pflag" "github.com/spf13/viper" "github.com/ssgreg/journald" @@ -90,10 +89,6 @@ const ( // Settings. cfgTLSKeyFile = "tls.key_file" cfgTLSCertFile = "tls.cert_file" - // Control API. - cfgControlAuthorizedKeys = "control.authorized_keys" - cfgControlGRPCEndpoint = "control.grpc.endpoint" - // Pool config. cfgConnectTimeout = "connect_timeout" cfgStreamTimeout = "stream_timeout" @@ -693,23 +688,6 @@ func fetchServers(v *viper.Viper, log *zap.Logger) []ServerInfo { return servers } -func fetchAuthorizedKeys(l *zap.Logger, v *viper.Viper) keys.PublicKeys { - strKeys := v.GetStringSlice(cfgControlAuthorizedKeys) - pubs := make(keys.PublicKeys, 0, len(strKeys)) - - for i := range strKeys { - pub, err := keys.NewPublicKeyFromString(strKeys[i]) - if err != nil { - l.Warn(logs.FailedToParsePublicKey, zap.String("key", strKeys[i])) - continue - } - - pubs = append(pubs, pub) - } - - return pubs -} - func newSettings() *viper.Viper { v := viper.New() @@ -768,8 +746,6 @@ func newSettings() *viper.Viper { v.SetDefault(cfgPProfAddress, "localhost:8085") v.SetDefault(cfgPrometheusAddress, "localhost:8086") - v.SetDefault(cfgControlGRPCEndpoint, "localhost:8083") - // frostfs v.SetDefault(cfgBufferMaxSizeForPut, 1024*1024) // 1mb diff --git a/config/config.env b/config/config.env index 14af631..82c0a09 100644 --- a/config/config.env +++ b/config/config.env @@ -36,12 +36,6 @@ S3_GW_SERVER_1_TLS_KEY_FILE=/path/to/tls/key # How often to reconnect to the servers S3_GW_RECONNECT_INTERVAL: 1m -# Control API -# List of hex-encoded public keys that have rights to use the Control Service -S3_GW_CONTROL_AUTHORIZED_KEYS=035839e45d472a3b7769a2a1bd7d54c4ccd4943c3b40f547870e83a8fcbfb3ce11 028f42cfcb74499d7b15b35d9bff260a1c8d27de4f446a627406a382d8961486d6 -# Endpoint that is listened by the Control Service -S3_GW_CONTROL_GRPC_ENDPOINT=localhost:8083 - # Domains to be able to use virtual-hosted-style access to bucket. S3_GW_LISTEN_DOMAINS=s3dev.frostfs.devenv diff --git a/config/config.yaml b/config/config.yaml index 1fc965a..a492f7a 100644 --- a/config/config.yaml +++ b/config/config.yaml @@ -39,15 +39,6 @@ server: cert_file: /path/to/cert key_file: /path/to/key -control: - # List of hex-encoded public keys that have rights to use the Control Service - authorized_keys: - - 035839e45d472a3b7769a2a1bd7d54c4ccd4943c3b40f547870e83a8fcbfb3ce11 - - 028f42cfcb74499d7b15b35d9bff260a1c8d27de4f446a627406a382d8961486d6 - grpc: - # Endpoint that is listened by the Control Service - endpoint: localhost:8083 - # Domains to be able to use virtual-hosted-style access to bucket. listen_domains: - s3dev.frostfs.devenv diff --git a/docs/configuration.md b/docs/configuration.md index d2f41c8..8633908 100644 --- a/docs/configuration.md +++ b/docs/configuration.md @@ -175,7 +175,6 @@ There are some custom types used for brevity: | `peers` | [Nodes configuration](#peers-section) | | `placement_policy` | [Placement policy configuration](#placement_policy-section) | | `server` | [Server configuration](#server-section) | -| `control` | [Control API configuration](#control-section) | | `logger` | [Logger configuration](#logger-section) | | `cache` | [Cache configuration](#cache-section) | | `nats` | [NATS configuration](#nats-section) | @@ -362,24 +361,6 @@ server: | `tls.cert_file` | `string` | yes | | Path to the TLS certificate. | | `tls.key_file` | `string` | yes | | Path to the key. | -### `control` section - -Control API parameters. - -```yaml -control: - authorized_keys: - - 035839e45d472a3b7769a2a1bd7d54c4ccd4943c3b40f547870e83a8fcbfb3ce11 - - 028f42cfcb74499d7b15b35d9bff260a1c8d27de4f446a627406a382d8961486d6 - grpc: - endpoint: localhost:8083 -``` - -| Parameter | Type | SIGHUP reload | Default value | Description | -|-------------------|------------|---------------|------------------|------------------------------------------------------------------------------| -| `authorized_keys` | `[]string` | yes | | List of hex-encoded public keys that have rights to use the Control Service. | -| `grpc.endpoint` | `string` | | `localhost:8083` | Endpoint that is listened by the Control Service. | - ### `logger` section ```yaml diff --git a/internal/frostfs/policy/storage.go b/internal/frostfs/policy/storage.go index 3063691..ae43a55 100644 --- a/internal/frostfs/policy/storage.go +++ b/internal/frostfs/policy/storage.go @@ -7,7 +7,6 @@ import ( cid "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/container/id" "git.frostfs.info/TrueCloudLab/policy-engine/pkg/chain" "git.frostfs.info/TrueCloudLab/policy-engine/pkg/engine" - "git.frostfs.info/TrueCloudLab/policy-engine/pkg/engine/inmemory" "git.frostfs.info/TrueCloudLab/policy-engine/pkg/resource" "go.uber.org/zap" ) @@ -16,8 +15,6 @@ type Storage struct { router engine.ChainRouter morph *MorphRuleChainStorage - - local engine.LocalOverrideStorage } type StorageConfig struct { @@ -43,8 +40,6 @@ type Contract interface { var _ handler.APE = (*Storage)(nil) func NewStorage(cfg StorageConfig) *Storage { - local := inmemory.NewInmemoryLocalStorage() - morph := NewMorphRuleChainStorage(&MorphRuleChainStorageConfig{ Contract: cfg.Contract, Cache: cfg.Cache, @@ -52,9 +47,8 @@ func NewStorage(cfg StorageConfig) *Storage { }) return &Storage{ - router: engine.NewDefaultChainRouterWithLocalOverrides(morph, local), + router: engine.NewDefaultChainRouter(morph), morph: morph, - local: local, } } @@ -62,10 +56,6 @@ func (s *Storage) IsAllowed(name chain.Name, target engine.RequestTarget, r reso return s.router.IsAllowed(name, target, r) } -func (s *Storage) LocalStorage() engine.LocalOverrideStorage { - return s.local -} - func (s *Storage) PutBucketPolicy(ns string, cnrID cid.ID, policy []byte, policyChains []*chain.Chain) error { return s.morph.PutBucketPolicy(ns, cnrID, policy, policyChains) } diff --git a/internal/logs/logs.go b/internal/logs/logs.go index 5a113a8..da9a0d4 100644 --- a/internal/logs/logs.go +++ b/internal/logs/logs.go @@ -22,7 +22,6 @@ const ( ApplicationFinished = "application finished" // Info in ../../cmd/s3-gw/app.go FetchDomainsPrepareToUseAPI = "fetch domains, prepare to use API" // Info in ../../cmd/s3-gw/app.go StartingServer = "starting server" // Info in ../../cmd/s3-gw/app.go - StartingControlAPI = "starting control API server" // Info in ../../cmd/s3-gw/app.go StoppingServer = "stopping server" // Info in ../../cmd/s3-gw/app.go SIGHUPConfigReloadStarted = "SIGHUP config reload started" // Info in ../../cmd/s3-gw/app.go FailedToReloadConfigBecauseItsMissed = "failed to reload config because it's missed" // Warn in ../../cmd/s3-gw/app.go @@ -34,8 +33,6 @@ const ( FailedToAddServer = "failed to add server" // Warn in ../../cmd/s3-gw/app.go AddServer = "add server" // Info in ../../cmd/s3-gw/app.go ResolverNNSWontBeUsedSinceRPCEndpointIsntProvided = "resolver 'nns' won't be used since 'rpc_endpoint' isn't provided" // Warn in ../../cmd/s3-gw/app.go - ControlAPICannotShutdownGracefully = "control API cannot shutdown gracefully, forcing stop" // Info in ../../cmd/s3-gw/app.go - ControlAPIServiceStopped = "control API service stopped" // Info in ../../cmd/s3-gw/app.go InvalidLifetimeUsingDefaultValue = "invalid lifetime, using default value (in seconds)" // Error in ../../cmd/s3-gw/app_settings.go InvalidCacheSizeUsingDefaultValue = "invalid cache size, using default value" // Error in ../../cmd/s3-gw/app_settings.go FailedToParseDefaultLocationConstraint = "failed to parse 'default' location constraint, default one will be used" // Warn in cmd/s3-gw/app_settings.go @@ -44,7 +41,6 @@ const ( FailedToParseLocationConstraint = "failed to parse location constraint, it cannot be used" // Warn in cmd/s3-gw/app_settings.go FailedToParseDefaultCopiesNumbers = "failed to parse 'default' copies numbers, default one will be used" // Warn in cmd/s3-gw/app_settings.go FailedToParseCopiesNumbers = "failed to parse copies numbers, skip" // Warn in cmd/s3-gw/app_settings.go - FailedToParsePublicKey = "failed to parse public key, skip" // Warn in cmd/s3-gw/app_settings.go DefaultNamespacesCannotBeEmpty = "default namespaces cannot be empty, defaults will be used" // Warn in cmd/s3-gw/app_settings.go FailedToParseNamespacesConfig = "failed to unmarshal namespaces config" // Warn in cmd/s3-gw/app_settings.go DefaultNamespaceConfigValuesBeOverwritten = "default namespace config value be overwritten by values from 'namespaces.config'" // Warn in cmd/s3-gw/app_settings.go @@ -129,11 +125,6 @@ const ( FrostfsIDValidationFailed = "FrostfsID validation failed" // Error in ../../api/middleware/auth.go InitFrostfsIDContractFailed = "init frostfsid contract failed" // Fatal in ../../cmd/s3-gw/app.go InitPolicyContractFailed = "init policy contract failed" // Fatal in ../../cmd/s3-gw/app.go - ControlAPIHealthcheck = "healthcheck request" - ControlAPIPutPolicies = "put policies request" - ControlAPIRemovePolicies = "remove policies request" - ControlAPIGetPolicy = "get policy request" - ControlAPIListPolicies = "list policies request" PolicyValidationFailed = "policy validation failed" ServerReconnecting = "reconnecting server..." ServerReconnectedSuccessfully = "server reconnected successfully" diff --git a/pkg/service/control/client/client.go b/pkg/service/control/client/client.go deleted file mode 100644 index ddc67de..0000000 --- a/pkg/service/control/client/client.go +++ /dev/null @@ -1,184 +0,0 @@ -package client - -import ( - "context" - "fmt" - - policycontract "git.frostfs.info/TrueCloudLab/frostfs-contract/policy" - "git.frostfs.info/TrueCloudLab/frostfs-s3-gw/pkg/service/control" - controlSvc "git.frostfs.info/TrueCloudLab/frostfs-s3-gw/pkg/service/control/server" - "git.frostfs.info/TrueCloudLab/policy-engine/pkg/chain" - "github.com/nspcc-dev/neo-go/pkg/crypto/keys" - "go.uber.org/zap" - "google.golang.org/grpc" - "google.golang.org/grpc/credentials/insecure" -) - -type Client struct { - svc control.ControlServiceClient - key *keys.PrivateKey -} - -type Config struct { - Logger *zap.Logger -} - -type PolicyData struct { - Kind policycontract.Kind - Name string - Chain *chain.Chain -} - -type PolicyInfo struct { - Kind policycontract.Kind - Name string - ChainID chain.ID -} - -func kindToTarget(k policycontract.Kind) control.PolicyTarget { - switch k { - case policycontract.Container: - return control.PolicyTarget_CONTAINER - case policycontract.Namespace: - return control.PolicyTarget_NAMESPACE - case 'u': - return control.PolicyTarget_USER - case 'g': - return control.PolicyTarget_GROUP - default: - return control.PolicyTarget_TARGET_UNDEFINED - } -} - -func New(ctx context.Context, addr string, key *keys.PrivateKey) (*Client, error) { - conn, err := grpc.Dial(addr, grpc.WithTransportCredentials(insecure.NewCredentials())) - if err != nil { - return nil, fmt.Errorf("failed to dial s3 gw control api: %w", err) - } - - svc := control.NewControlServiceClient(conn) - - cli := &Client{ - svc: svc, - key: key, - } - - return cli, cli.Healthcheck(ctx) -} - -func (c *Client) Healthcheck(ctx context.Context) error { - req := &control.HealthCheckRequest{} - if err := controlSvc.SignMessage(&c.key.PrivateKey, req); err != nil { - return err - } - - res, err := c.svc.HealthCheck(ctx, req) - if err != nil { - return err - } - - if res.Body.HealthStatus != control.HealthStatus_READY { - return fmt.Errorf("service isn't ready, status: %s", res.Body.HealthStatus) - } - - return nil -} - -func (c *Client) PutPolicies(ctx context.Context, policies []PolicyData) error { - chainDatas := make([]*control.PutPoliciesRequest_ChainData, len(policies)) - for i := range policies { - chainDatas[i] = &control.PutPoliciesRequest_ChainData{ - Target: kindToTarget(policies[i].Kind), - Name: policies[i].Name, - Chain: policies[i].Chain.Bytes(), - } - } - - req := &control.PutPoliciesRequest{ - Body: &control.PutPoliciesRequest_Body{ - ChainDatas: chainDatas, - }, - } - - if err := controlSvc.SignMessage(&c.key.PrivateKey, req); err != nil { - return err - } - - _, err := c.svc.PutPolicies(ctx, req) - return err -} - -func (c *Client) RemovePolicies(ctx context.Context, policies []PolicyInfo) error { - chainInfos := make([]*control.RemovePoliciesRequest_ChainInfo, len(policies)) - for i := range policies { - chainInfos[i] = &control.RemovePoliciesRequest_ChainInfo{ - Target: kindToTarget(policies[i].Kind), - Name: policies[i].Name, - ChainID: []byte(policies[i].ChainID), - } - } - - req := &control.RemovePoliciesRequest{ - Body: &control.RemovePoliciesRequest_Body{ - ChainInfos: chainInfos, - }, - } - - if err := controlSvc.SignMessage(&c.key.PrivateKey, req); err != nil { - return err - } - - _, err := c.svc.RemovePolicies(ctx, req) - return err -} - -func (c *Client) GetPolicy(ctx context.Context, kind policycontract.Kind, name string, chainID chain.ID) (*chain.Chain, error) { - req := &control.GetPolicyRequest{ - Body: &control.GetPolicyRequest_Body{ - Target: kindToTarget(kind), - Name: name, - ChainID: []byte(chainID), - }, - } - - if err := controlSvc.SignMessage(&c.key.PrivateKey, req); err != nil { - return nil, err - } - - resp, err := c.svc.GetPolicy(ctx, req) - if err != nil { - return nil, err - } - - var policyChain chain.Chain - if err = policyChain.DecodeBytes(resp.GetBody().GetChain()); err != nil { - return nil, err - } - - return &policyChain, nil -} - -func (c *Client) ListPolicies(ctx context.Context, kind policycontract.Kind, name string) ([]chain.ID, error) { - req := &control.ListPoliciesRequest{ - Body: &control.ListPoliciesRequest_Body{ - Target: kindToTarget(kind), - Name: name, - }, - } - - if err := controlSvc.SignMessage(&c.key.PrivateKey, req); err != nil { - return nil, err - } - - resp, err := c.svc.ListPolicies(ctx, req) - if err != nil { - return nil, err - } - - res := make([]chain.ID, len(resp.GetBody().GetChainIDs())) - for i, chainID := range resp.GetBody().GetChainIDs() { - res[i] = chain.ID(chainID) - } - - return res, nil -} diff --git a/pkg/service/control/server/server.go b/pkg/service/control/server/server.go deleted file mode 100644 index 07a74a5..0000000 --- a/pkg/service/control/server/server.go +++ /dev/null @@ -1,352 +0,0 @@ -package server - -import ( - "bytes" - "context" - "crypto/ecdsa" - "encoding/hex" - "errors" - "fmt" - - "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/refs" - "git.frostfs.info/TrueCloudLab/frostfs-s3-gw/internal/logs" - "git.frostfs.info/TrueCloudLab/frostfs-s3-gw/pkg/service/control" - frostfscrypto "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/crypto" - frostfsecdsa "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/crypto/ecdsa" - "git.frostfs.info/TrueCloudLab/policy-engine/pkg/chain" - "git.frostfs.info/TrueCloudLab/policy-engine/pkg/engine" - "git.frostfs.info/TrueCloudLab/policy-engine/pkg/engine/inmemory" - "go.uber.org/zap" - "google.golang.org/grpc/codes" - "google.golang.org/grpc/status" -) - -type Server struct { - *cfg -} - -type Settings interface { - ResolveNamespaceAlias(ns string) string - FetchRawKeys() [][]byte -} - -type defaultSettings struct{} - -func (f defaultSettings) FetchRawKeys() [][]byte { return nil } -func (f defaultSettings) ResolveNamespaceAlias(ns string) string { return ns } - -// Option of the Server's constructor. -type Option func(*cfg) - -type cfg struct { - log *zap.Logger - - settings Settings - - chainStorage engine.LocalOverrideStorage -} - -func defaultCfg() *cfg { - return &cfg{ - log: zap.NewNop(), - settings: defaultSettings{}, - chainStorage: inmemory.NewInmemoryLocalStorage(), - } -} - -// New creates, initializes and returns new Server instance. -func New(opts ...Option) *Server { - c := defaultCfg() - - for _, opt := range opts { - opt(c) - } - - c.log = c.log.With(zap.String("service", "control API")) - - return &Server{ - cfg: c, - } -} - -// WithSettings returns option to add settings to use Control service. -func WithSettings(settings Settings) Option { - return func(c *cfg) { - c.settings = settings - } -} - -// WithLogger returns option to set logger. -func WithLogger(log *zap.Logger) Option { - return func(c *cfg) { - c.log = log - } -} - -// WithChainStorage returns option to set logger. -func WithChainStorage(chainStorage engine.LocalOverrideStorage) Option { - return func(c *cfg) { - c.chainStorage = chainStorage - } -} - -// HealthCheck returns health status of the local node. -// -// If request is unsigned or signed by disallowed key, permission error returns. -func (s *Server) HealthCheck(_ context.Context, req *control.HealthCheckRequest) (*control.HealthCheckResponse, error) { - s.log.Info(logs.ControlAPIHealthcheck, zap.String("key", hex.EncodeToString(req.Signature.Key))) - - // verify request - if err := s.isValidRequest(req); err != nil { - return nil, status.Error(codes.PermissionDenied, err.Error()) - } - - resp := &control.HealthCheckResponse{ - Body: &control.HealthCheckResponse_Body{ - HealthStatus: control.HealthStatus_READY, - }, - } - - return resp, nil -} - -// PutPolicies replaces existing policies. -// -// If request is unsigned or signed by disallowed key, permission error returns. -func (s *Server) PutPolicies(_ context.Context, req *control.PutPoliciesRequest) (*control.PutPoliciesResponse, error) { - s.log.Info(logs.ControlAPIPutPolicies, zap.String("key", hex.EncodeToString(req.Signature.Key))) - - // verify request - if err := s.isValidRequest(req); err != nil { - return nil, status.Error(codes.PermissionDenied, err.Error()) - } - - for _, data := range req.GetBody().GetChainDatas() { - if err := s.putPolicy(data); err != nil { - return nil, err - } - } - - return &control.PutPoliciesResponse{}, nil -} - -func (s *Server) putPolicy(data *control.PutPoliciesRequest_ChainData) error { - var overrideChain chain.Chain - if err := overrideChain.DecodeBytes(data.GetChain()); err != nil { - return status.Error(codes.InvalidArgument, fmt.Sprintf("failed to parse body: %s", err.Error())) - } - - if len(overrideChain.ID) == 0 { - return status.Error(codes.InvalidArgument, "missing chain id") - } - - t, err := s.parseTarget(data.Target, data.Name) - if err != nil { - return err - } - - if _, err := s.chainStorage.AddOverride(chain.S3, t, &overrideChain); err != nil { - return status.Error(codes.Internal, err.Error()) - } - - return nil -} - -func (s *Server) parseTarget(target control.PolicyTarget, name string) (engine.Target, error) { - var ( - t engine.Target - err error - ) - switch target { - case control.PolicyTarget_NAMESPACE: - ns := s.settings.ResolveNamespaceAlias(name) - t = engine.NamespaceTarget(ns) - case control.PolicyTarget_CONTAINER: - t = engine.ContainerTarget(name) - case control.PolicyTarget_USER: - t = engine.UserTarget(name) - case control.PolicyTarget_GROUP: - t = engine.GroupTarget(name) - default: - err = status.Error(codes.InvalidArgument, fmt.Sprintf("invalid target: %s", target.String())) - } - return t, err -} - -// RemovePolicies removes existing policies. -// -// If request is unsigned or signed by disallowed key, permission error returns. -func (s *Server) RemovePolicies(_ context.Context, req *control.RemovePoliciesRequest) (*control.RemovePoliciesResponse, error) { - s.log.Info(logs.ControlAPIRemovePolicies, zap.String("key", hex.EncodeToString(req.Signature.Key))) - - // verify request - if err := s.isValidRequest(req); err != nil { - return nil, status.Error(codes.PermissionDenied, err.Error()) - } - - for _, info := range req.GetBody().GetChainInfos() { - if err := s.removePolicy(info); err != nil { - return nil, err - } - } - - return &control.RemovePoliciesResponse{}, nil -} - -func (s *Server) removePolicy(info *control.RemovePoliciesRequest_ChainInfo) error { - t, err := s.parseTarget(info.Target, info.Name) - if err != nil { - return err - } - err = s.chainStorage.RemoveOverride(chain.S3, t, chain.ID(info.GetChainID())) - if err != nil { - if isNotFoundError(err) { - return status.Error(codes.NotFound, err.Error()) - } - return status.Error(codes.InvalidArgument, err.Error()) - } - return nil -} - -// GetPolicy returns existing policy. -// -// If request is unsigned or signed by disallowed key, permission error returns. -func (s *Server) GetPolicy(_ context.Context, req *control.GetPolicyRequest) (*control.GetPolicyResponse, error) { - s.log.Info(logs.ControlAPIGetPolicy, zap.Stringer("target", req.GetBody().GetTarget()), zap.String("name", req.GetBody().GetName()), - zap.Binary("chainId", req.GetBody().GetChainID()), zap.String("key", hex.EncodeToString(req.Signature.Key))) - - t, err := s.parseTarget(req.GetBody().GetTarget(), req.GetBody().GetName()) - if err != nil { - return nil, err - } - - // verify request - if err := s.isValidRequest(req); err != nil { - return nil, status.Error(codes.PermissionDenied, err.Error()) - } - - overrideChain, err := s.chainStorage.GetOverride(chain.S3, t, chain.ID(req.GetBody().GetChainID())) - if err != nil { - return nil, status.Error(codes.InvalidArgument, err.Error()) - } - - return &control.GetPolicyResponse{Body: &control.GetPolicyResponse_Body{Chain: overrideChain.Bytes()}}, nil -} - -// ListPolicies lists existing policies. -// -// If request is unsigned or signed by disallowed key, permission error returns. -func (s *Server) ListPolicies(_ context.Context, req *control.ListPoliciesRequest) (*control.ListPoliciesResponse, error) { - s.log.Info(logs.ControlAPIListPolicies, zap.Stringer("target", req.GetBody().GetTarget()), zap.String("name", req.GetBody().GetName()), - zap.String("key", hex.EncodeToString(req.Signature.Key))) - - t, err := s.parseTarget(req.GetBody().GetTarget(), req.GetBody().GetName()) - if err != nil { - return nil, err - } - - // verify request - if err := s.isValidRequest(req); err != nil { - return nil, status.Error(codes.PermissionDenied, err.Error()) - } - - chains, err := s.chainStorage.ListOverrides(chain.S3, t) - if err != nil { - return nil, status.Error(codes.InvalidArgument, err.Error()) - } - - res := make([][]byte, len(chains)) - for i := range chains { - res[i] = []byte(chains[i].ID) - } - - return &control.ListPoliciesResponse{Body: &control.ListPoliciesResponse_Body{ChainIDs: res}}, nil -} - -// SignedMessage is an interface of Control service message. -type SignedMessage interface { - ReadSignedData([]byte) ([]byte, error) - GetSignature() *control.Signature - SetSignature(*control.Signature) -} - -var errDisallowedKey = errors.New("key is not in the allowed list") -var errMissingSignature = errors.New("missing signature") -var errInvalidSignature = errors.New("invalid signature") - -func (s *Server) isValidRequest(req SignedMessage) error { - sign := req.GetSignature() - if sign == nil { - return errMissingSignature - } - - var ( - key = sign.GetKey() - allowed = false - ) - - // check if key is allowed - for _, authKey := range s.settings.FetchRawKeys() { - if allowed = bytes.Equal(authKey, key); allowed { - break - } - } - - if !allowed { - return errDisallowedKey - } - - // verify signature - binBody, err := req.ReadSignedData(nil) - if err != nil { - return fmt.Errorf("marshal request body: %w", err) - } - - var sigV2 refs.Signature - sigV2.SetKey(sign.GetKey()) - sigV2.SetSign(sign.GetSign()) - sigV2.SetScheme(refs.ECDSA_SHA512) - - var sig frostfscrypto.Signature - if err := sig.ReadFromV2(sigV2); err != nil { - return fmt.Errorf("can't read signature: %w", err) - } - - if !sig.Verify(binBody) { - return errInvalidSignature - } - - return nil -} - -// SignMessage signs Control service message with private key. -func SignMessage(key *ecdsa.PrivateKey, msg SignedMessage) error { - binBody, err := msg.ReadSignedData(nil) - if err != nil { - return fmt.Errorf("marshal request body: %w", err) - } - - var sig frostfscrypto.Signature - - err = sig.Calculate(frostfsecdsa.Signer(*key), binBody) - if err != nil { - return fmt.Errorf("calculate signature: %w", err) - } - - var sigV2 refs.Signature - sig.WriteToV2(&sigV2) - - var sigControl control.Signature - sigControl.Key = sigV2.GetKey() - sigControl.Sign = sigV2.GetSign() - - msg.SetSignature(&sigControl) - - return nil -} - -func isNotFoundError(err error) bool { - return errors.Is(err, engine.ErrChainNameNotFound) || - errors.Is(err, engine.ErrChainNotFound) || - errors.Is(err, engine.ErrResourceNotFound) -} diff --git a/pkg/service/control/service.pb.go b/pkg/service/control/service.pb.go deleted file mode 100644 index 2de2639..0000000 --- a/pkg/service/control/service.pb.go +++ /dev/null @@ -1,1951 +0,0 @@ -// Code generated by protoc-gen-go. DO NOT EDIT. -// versions: -// protoc-gen-go v1.30.0 -// protoc v3.21.12 -// source: pkg/service/control/service.proto - -package control - -import ( - protoreflect "google.golang.org/protobuf/reflect/protoreflect" - protoimpl "google.golang.org/protobuf/runtime/protoimpl" - reflect "reflect" - sync "sync" -) - -const ( - // Verify that this generated code is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) - // Verify that runtime/protoimpl is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) -) - -// Health status of the storage node application. -type HealthStatus int32 - -const ( - // Undefined status, default value. - HealthStatus_HEALTH_STATUS_UNDEFINED HealthStatus = 0 - // Storage node application is starting. - HealthStatus_STARTING HealthStatus = 1 - // Storage node application is started and serves all services. - HealthStatus_READY HealthStatus = 2 - // Storage node application is shutting down. - HealthStatus_SHUTTING_DOWN HealthStatus = 3 -) - -// Enum value maps for HealthStatus. -var ( - HealthStatus_name = map[int32]string{ - 0: "HEALTH_STATUS_UNDEFINED", - 1: "STARTING", - 2: "READY", - 3: "SHUTTING_DOWN", - } - HealthStatus_value = map[string]int32{ - "HEALTH_STATUS_UNDEFINED": 0, - "STARTING": 1, - "READY": 2, - "SHUTTING_DOWN": 3, - } -) - -func (x HealthStatus) Enum() *HealthStatus { - p := new(HealthStatus) - *p = x - return p -} - -func (x HealthStatus) String() string { - return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) -} - -func (HealthStatus) Descriptor() protoreflect.EnumDescriptor { - return file_pkg_service_control_service_proto_enumTypes[0].Descriptor() -} - -func (HealthStatus) Type() protoreflect.EnumType { - return &file_pkg_service_control_service_proto_enumTypes[0] -} - -func (x HealthStatus) Number() protoreflect.EnumNumber { - return protoreflect.EnumNumber(x) -} - -// Deprecated: Use HealthStatus.Descriptor instead. -func (HealthStatus) EnumDescriptor() ([]byte, []int) { - return file_pkg_service_control_service_proto_rawDescGZIP(), []int{0} -} - -// Policy target to store chains. -type PolicyTarget int32 - -const ( - // Undefined target, invalid to use. - PolicyTarget_TARGET_UNDEFINED PolicyTarget = 0 - // Container target for bucket policies. - PolicyTarget_CONTAINER PolicyTarget = 1 - // Namespace target for namespace policies. - PolicyTarget_NAMESPACE PolicyTarget = 2 - // User target for namespace user policies. - PolicyTarget_USER PolicyTarget = 3 - // Group target for namespace target policies. - PolicyTarget_GROUP PolicyTarget = 4 -) - -// Enum value maps for PolicyTarget. -var ( - PolicyTarget_name = map[int32]string{ - 0: "TARGET_UNDEFINED", - 1: "CONTAINER", - 2: "NAMESPACE", - 3: "USER", - 4: "GROUP", - } - PolicyTarget_value = map[string]int32{ - "TARGET_UNDEFINED": 0, - "CONTAINER": 1, - "NAMESPACE": 2, - "USER": 3, - "GROUP": 4, - } -) - -func (x PolicyTarget) Enum() *PolicyTarget { - p := new(PolicyTarget) - *p = x - return p -} - -func (x PolicyTarget) String() string { - return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) -} - -func (PolicyTarget) Descriptor() protoreflect.EnumDescriptor { - return file_pkg_service_control_service_proto_enumTypes[1].Descriptor() -} - -func (PolicyTarget) Type() protoreflect.EnumType { - return &file_pkg_service_control_service_proto_enumTypes[1] -} - -func (x PolicyTarget) Number() protoreflect.EnumNumber { - return protoreflect.EnumNumber(x) -} - -// Deprecated: Use PolicyTarget.Descriptor instead. -func (PolicyTarget) EnumDescriptor() ([]byte, []int) { - return file_pkg_service_control_service_proto_rawDescGZIP(), []int{1} -} - -// Signature of some message. -type Signature struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // Public key used for signing. - Key []byte `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"` - // Binary signature. - Sign []byte `protobuf:"bytes,2,opt,name=sign,json=signature,proto3" json:"sign,omitempty"` -} - -func (x *Signature) Reset() { - *x = Signature{} - if protoimpl.UnsafeEnabled { - mi := &file_pkg_service_control_service_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *Signature) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*Signature) ProtoMessage() {} - -func (x *Signature) ProtoReflect() protoreflect.Message { - mi := &file_pkg_service_control_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 Signature.ProtoReflect.Descriptor instead. -func (*Signature) Descriptor() ([]byte, []int) { - return file_pkg_service_control_service_proto_rawDescGZIP(), []int{0} -} - -func (x *Signature) GetKey() []byte { - if x != nil { - return x.Key - } - return nil -} - -func (x *Signature) GetSign() []byte { - if x != nil { - return x.Sign - } - return nil -} - -// Health check request. -type HealthCheckRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // Body of health check request message. - Body *HealthCheckRequest_Body `protobuf:"bytes,1,opt,name=body,proto3" json:"body,omitempty"` - // Body signature. - Signature *Signature `protobuf:"bytes,2,opt,name=signature,proto3" json:"signature,omitempty"` -} - -func (x *HealthCheckRequest) Reset() { - *x = HealthCheckRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_pkg_service_control_service_proto_msgTypes[1] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *HealthCheckRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*HealthCheckRequest) ProtoMessage() {} - -func (x *HealthCheckRequest) ProtoReflect() protoreflect.Message { - mi := &file_pkg_service_control_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 HealthCheckRequest.ProtoReflect.Descriptor instead. -func (*HealthCheckRequest) Descriptor() ([]byte, []int) { - return file_pkg_service_control_service_proto_rawDescGZIP(), []int{1} -} - -func (x *HealthCheckRequest) GetBody() *HealthCheckRequest_Body { - if x != nil { - return x.Body - } - return nil -} - -func (x *HealthCheckRequest) GetSignature() *Signature { - if x != nil { - return x.Signature - } - return nil -} - -// Health check response. -type HealthCheckResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // Body of health check response message. - Body *HealthCheckResponse_Body `protobuf:"bytes,1,opt,name=body,proto3" json:"body,omitempty"` - Signature *Signature `protobuf:"bytes,2,opt,name=signature,proto3" json:"signature,omitempty"` -} - -func (x *HealthCheckResponse) Reset() { - *x = HealthCheckResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_pkg_service_control_service_proto_msgTypes[2] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *HealthCheckResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*HealthCheckResponse) ProtoMessage() {} - -func (x *HealthCheckResponse) ProtoReflect() protoreflect.Message { - mi := &file_pkg_service_control_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 HealthCheckResponse.ProtoReflect.Descriptor instead. -func (*HealthCheckResponse) Descriptor() ([]byte, []int) { - return file_pkg_service_control_service_proto_rawDescGZIP(), []int{2} -} - -func (x *HealthCheckResponse) GetBody() *HealthCheckResponse_Body { - if x != nil { - return x.Body - } - return nil -} - -func (x *HealthCheckResponse) GetSignature() *Signature { - if x != nil { - return x.Signature - } - return nil -} - -// Put policies request. -type PutPoliciesRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Body *PutPoliciesRequest_Body `protobuf:"bytes,1,opt,name=body,proto3" json:"body,omitempty"` - // Body signature. - Signature *Signature `protobuf:"bytes,2,opt,name=signature,proto3" json:"signature,omitempty"` -} - -func (x *PutPoliciesRequest) Reset() { - *x = PutPoliciesRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_pkg_service_control_service_proto_msgTypes[3] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *PutPoliciesRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*PutPoliciesRequest) ProtoMessage() {} - -func (x *PutPoliciesRequest) ProtoReflect() protoreflect.Message { - mi := &file_pkg_service_control_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 PutPoliciesRequest.ProtoReflect.Descriptor instead. -func (*PutPoliciesRequest) Descriptor() ([]byte, []int) { - return file_pkg_service_control_service_proto_rawDescGZIP(), []int{3} -} - -func (x *PutPoliciesRequest) GetBody() *PutPoliciesRequest_Body { - if x != nil { - return x.Body - } - return nil -} - -func (x *PutPoliciesRequest) GetSignature() *Signature { - if x != nil { - return x.Signature - } - return nil -} - -// Put policies response. -type PutPoliciesResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Body *PutPoliciesResponse_Body `protobuf:"bytes,1,opt,name=body,proto3" json:"body,omitempty"` - Signature *Signature `protobuf:"bytes,2,opt,name=signature,proto3" json:"signature,omitempty"` -} - -func (x *PutPoliciesResponse) Reset() { - *x = PutPoliciesResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_pkg_service_control_service_proto_msgTypes[4] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *PutPoliciesResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*PutPoliciesResponse) ProtoMessage() {} - -func (x *PutPoliciesResponse) ProtoReflect() protoreflect.Message { - mi := &file_pkg_service_control_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 PutPoliciesResponse.ProtoReflect.Descriptor instead. -func (*PutPoliciesResponse) Descriptor() ([]byte, []int) { - return file_pkg_service_control_service_proto_rawDescGZIP(), []int{4} -} - -func (x *PutPoliciesResponse) GetBody() *PutPoliciesResponse_Body { - if x != nil { - return x.Body - } - return nil -} - -func (x *PutPoliciesResponse) GetSignature() *Signature { - if x != nil { - return x.Signature - } - return nil -} - -// Remove policies request. -type RemovePoliciesRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Body *RemovePoliciesRequest_Body `protobuf:"bytes,1,opt,name=body,proto3" json:"body,omitempty"` - // Body signature. - Signature *Signature `protobuf:"bytes,2,opt,name=signature,proto3" json:"signature,omitempty"` -} - -func (x *RemovePoliciesRequest) Reset() { - *x = RemovePoliciesRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_pkg_service_control_service_proto_msgTypes[5] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *RemovePoliciesRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*RemovePoliciesRequest) ProtoMessage() {} - -func (x *RemovePoliciesRequest) ProtoReflect() protoreflect.Message { - mi := &file_pkg_service_control_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 RemovePoliciesRequest.ProtoReflect.Descriptor instead. -func (*RemovePoliciesRequest) Descriptor() ([]byte, []int) { - return file_pkg_service_control_service_proto_rawDescGZIP(), []int{5} -} - -func (x *RemovePoliciesRequest) GetBody() *RemovePoliciesRequest_Body { - if x != nil { - return x.Body - } - return nil -} - -func (x *RemovePoliciesRequest) GetSignature() *Signature { - if x != nil { - return x.Signature - } - return nil -} - -// Remove policies response. -type RemovePoliciesResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Body *RemovePoliciesResponse_Body `protobuf:"bytes,1,opt,name=body,proto3" json:"body,omitempty"` - Signature *Signature `protobuf:"bytes,2,opt,name=signature,proto3" json:"signature,omitempty"` -} - -func (x *RemovePoliciesResponse) Reset() { - *x = RemovePoliciesResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_pkg_service_control_service_proto_msgTypes[6] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *RemovePoliciesResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*RemovePoliciesResponse) ProtoMessage() {} - -func (x *RemovePoliciesResponse) ProtoReflect() protoreflect.Message { - mi := &file_pkg_service_control_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 RemovePoliciesResponse.ProtoReflect.Descriptor instead. -func (*RemovePoliciesResponse) Descriptor() ([]byte, []int) { - return file_pkg_service_control_service_proto_rawDescGZIP(), []int{6} -} - -func (x *RemovePoliciesResponse) GetBody() *RemovePoliciesResponse_Body { - if x != nil { - return x.Body - } - return nil -} - -func (x *RemovePoliciesResponse) GetSignature() *Signature { - if x != nil { - return x.Signature - } - return nil -} - -// Get policy request. -type GetPolicyRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Body *GetPolicyRequest_Body `protobuf:"bytes,1,opt,name=body,proto3" json:"body,omitempty"` - // Body signature. - Signature *Signature `protobuf:"bytes,2,opt,name=signature,proto3" json:"signature,omitempty"` -} - -func (x *GetPolicyRequest) Reset() { - *x = GetPolicyRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_pkg_service_control_service_proto_msgTypes[7] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *GetPolicyRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GetPolicyRequest) ProtoMessage() {} - -func (x *GetPolicyRequest) ProtoReflect() protoreflect.Message { - mi := &file_pkg_service_control_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 GetPolicyRequest.ProtoReflect.Descriptor instead. -func (*GetPolicyRequest) Descriptor() ([]byte, []int) { - return file_pkg_service_control_service_proto_rawDescGZIP(), []int{7} -} - -func (x *GetPolicyRequest) GetBody() *GetPolicyRequest_Body { - if x != nil { - return x.Body - } - return nil -} - -func (x *GetPolicyRequest) GetSignature() *Signature { - if x != nil { - return x.Signature - } - return nil -} - -// Get policy response. -type GetPolicyResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Body *GetPolicyResponse_Body `protobuf:"bytes,1,opt,name=body,proto3" json:"body,omitempty"` - Signature *Signature `protobuf:"bytes,2,opt,name=signature,proto3" json:"signature,omitempty"` -} - -func (x *GetPolicyResponse) Reset() { - *x = GetPolicyResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_pkg_service_control_service_proto_msgTypes[8] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *GetPolicyResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GetPolicyResponse) ProtoMessage() {} - -func (x *GetPolicyResponse) ProtoReflect() protoreflect.Message { - mi := &file_pkg_service_control_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 GetPolicyResponse.ProtoReflect.Descriptor instead. -func (*GetPolicyResponse) Descriptor() ([]byte, []int) { - return file_pkg_service_control_service_proto_rawDescGZIP(), []int{8} -} - -func (x *GetPolicyResponse) GetBody() *GetPolicyResponse_Body { - if x != nil { - return x.Body - } - return nil -} - -func (x *GetPolicyResponse) GetSignature() *Signature { - if x != nil { - return x.Signature - } - return nil -} - -// List policies request. -type ListPoliciesRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Body *ListPoliciesRequest_Body `protobuf:"bytes,1,opt,name=body,proto3" json:"body,omitempty"` - // Body signature. - Signature *Signature `protobuf:"bytes,2,opt,name=signature,proto3" json:"signature,omitempty"` -} - -func (x *ListPoliciesRequest) Reset() { - *x = ListPoliciesRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_pkg_service_control_service_proto_msgTypes[9] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ListPoliciesRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ListPoliciesRequest) ProtoMessage() {} - -func (x *ListPoliciesRequest) ProtoReflect() protoreflect.Message { - mi := &file_pkg_service_control_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 ListPoliciesRequest.ProtoReflect.Descriptor instead. -func (*ListPoliciesRequest) Descriptor() ([]byte, []int) { - return file_pkg_service_control_service_proto_rawDescGZIP(), []int{9} -} - -func (x *ListPoliciesRequest) GetBody() *ListPoliciesRequest_Body { - if x != nil { - return x.Body - } - return nil -} - -func (x *ListPoliciesRequest) GetSignature() *Signature { - if x != nil { - return x.Signature - } - return nil -} - -// List policies response. -type ListPoliciesResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Body *ListPoliciesResponse_Body `protobuf:"bytes,1,opt,name=body,proto3" json:"body,omitempty"` - Signature *Signature `protobuf:"bytes,2,opt,name=signature,proto3" json:"signature,omitempty"` -} - -func (x *ListPoliciesResponse) Reset() { - *x = ListPoliciesResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_pkg_service_control_service_proto_msgTypes[10] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ListPoliciesResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ListPoliciesResponse) ProtoMessage() {} - -func (x *ListPoliciesResponse) ProtoReflect() protoreflect.Message { - mi := &file_pkg_service_control_service_proto_msgTypes[10] - 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 ListPoliciesResponse.ProtoReflect.Descriptor instead. -func (*ListPoliciesResponse) Descriptor() ([]byte, []int) { - return file_pkg_service_control_service_proto_rawDescGZIP(), []int{10} -} - -func (x *ListPoliciesResponse) GetBody() *ListPoliciesResponse_Body { - if x != nil { - return x.Body - } - return nil -} - -func (x *ListPoliciesResponse) GetSignature() *Signature { - if x != nil { - return x.Signature - } - return nil -} - -type HealthCheckRequest_Body struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields -} - -func (x *HealthCheckRequest_Body) Reset() { - *x = HealthCheckRequest_Body{} - if protoimpl.UnsafeEnabled { - mi := &file_pkg_service_control_service_proto_msgTypes[11] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *HealthCheckRequest_Body) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*HealthCheckRequest_Body) ProtoMessage() {} - -func (x *HealthCheckRequest_Body) ProtoReflect() protoreflect.Message { - mi := &file_pkg_service_control_service_proto_msgTypes[11] - 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 HealthCheckRequest_Body.ProtoReflect.Descriptor instead. -func (*HealthCheckRequest_Body) Descriptor() ([]byte, []int) { - return file_pkg_service_control_service_proto_rawDescGZIP(), []int{1, 0} -} - -// Health check response body -type HealthCheckResponse_Body struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // Health status of storage node application. - HealthStatus HealthStatus `protobuf:"varint,1,opt,name=health_status,json=healthStatus,proto3,enum=s3gw.control.HealthStatus" json:"health_status,omitempty"` -} - -func (x *HealthCheckResponse_Body) Reset() { - *x = HealthCheckResponse_Body{} - if protoimpl.UnsafeEnabled { - mi := &file_pkg_service_control_service_proto_msgTypes[12] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *HealthCheckResponse_Body) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*HealthCheckResponse_Body) ProtoMessage() {} - -func (x *HealthCheckResponse_Body) ProtoReflect() protoreflect.Message { - mi := &file_pkg_service_control_service_proto_msgTypes[12] - 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 HealthCheckResponse_Body.ProtoReflect.Descriptor instead. -func (*HealthCheckResponse_Body) Descriptor() ([]byte, []int) { - return file_pkg_service_control_service_proto_rawDescGZIP(), []int{2, 0} -} - -func (x *HealthCheckResponse_Body) GetHealthStatus() HealthStatus { - if x != nil { - return x.HealthStatus - } - return HealthStatus_HEALTH_STATUS_UNDEFINED -} - -type PutPoliciesRequest_ChainData struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // Policy entity type. - Target PolicyTarget `protobuf:"varint,1,opt,name=target,proto3,enum=s3gw.control.PolicyTarget" json:"target,omitempty"` - // Policy name. - Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` - // Chain rules. - Chain []byte `protobuf:"bytes,3,opt,name=chain,proto3" json:"chain,omitempty"` -} - -func (x *PutPoliciesRequest_ChainData) Reset() { - *x = PutPoliciesRequest_ChainData{} - if protoimpl.UnsafeEnabled { - mi := &file_pkg_service_control_service_proto_msgTypes[13] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *PutPoliciesRequest_ChainData) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*PutPoliciesRequest_ChainData) ProtoMessage() {} - -func (x *PutPoliciesRequest_ChainData) ProtoReflect() protoreflect.Message { - mi := &file_pkg_service_control_service_proto_msgTypes[13] - 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 PutPoliciesRequest_ChainData.ProtoReflect.Descriptor instead. -func (*PutPoliciesRequest_ChainData) Descriptor() ([]byte, []int) { - return file_pkg_service_control_service_proto_rawDescGZIP(), []int{3, 0} -} - -func (x *PutPoliciesRequest_ChainData) GetTarget() PolicyTarget { - if x != nil { - return x.Target - } - return PolicyTarget_TARGET_UNDEFINED -} - -func (x *PutPoliciesRequest_ChainData) GetName() string { - if x != nil { - return x.Name - } - return "" -} - -func (x *PutPoliciesRequest_ChainData) GetChain() []byte { - if x != nil { - return x.Chain - } - return nil -} - -type PutPoliciesRequest_Body struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - ChainDatas []*PutPoliciesRequest_ChainData `protobuf:"bytes,1,rep,name=chainDatas,proto3" json:"chainDatas,omitempty"` -} - -func (x *PutPoliciesRequest_Body) Reset() { - *x = PutPoliciesRequest_Body{} - if protoimpl.UnsafeEnabled { - mi := &file_pkg_service_control_service_proto_msgTypes[14] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *PutPoliciesRequest_Body) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*PutPoliciesRequest_Body) ProtoMessage() {} - -func (x *PutPoliciesRequest_Body) ProtoReflect() protoreflect.Message { - mi := &file_pkg_service_control_service_proto_msgTypes[14] - 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 PutPoliciesRequest_Body.ProtoReflect.Descriptor instead. -func (*PutPoliciesRequest_Body) Descriptor() ([]byte, []int) { - return file_pkg_service_control_service_proto_rawDescGZIP(), []int{3, 1} -} - -func (x *PutPoliciesRequest_Body) GetChainDatas() []*PutPoliciesRequest_ChainData { - if x != nil { - return x.ChainDatas - } - return nil -} - -type PutPoliciesResponse_Body struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields -} - -func (x *PutPoliciesResponse_Body) Reset() { - *x = PutPoliciesResponse_Body{} - if protoimpl.UnsafeEnabled { - mi := &file_pkg_service_control_service_proto_msgTypes[15] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *PutPoliciesResponse_Body) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*PutPoliciesResponse_Body) ProtoMessage() {} - -func (x *PutPoliciesResponse_Body) ProtoReflect() protoreflect.Message { - mi := &file_pkg_service_control_service_proto_msgTypes[15] - 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 PutPoliciesResponse_Body.ProtoReflect.Descriptor instead. -func (*PutPoliciesResponse_Body) Descriptor() ([]byte, []int) { - return file_pkg_service_control_service_proto_rawDescGZIP(), []int{4, 0} -} - -type RemovePoliciesRequest_ChainInfo struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // Policy entity type. - Target PolicyTarget `protobuf:"varint,1,opt,name=target,proto3,enum=s3gw.control.PolicyTarget" json:"target,omitempty"` - // Policy name. - Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` - // Chain id to remove. - ChainID []byte `protobuf:"bytes,3,opt,name=chainID,proto3" json:"chainID,omitempty"` -} - -func (x *RemovePoliciesRequest_ChainInfo) Reset() { - *x = RemovePoliciesRequest_ChainInfo{} - if protoimpl.UnsafeEnabled { - mi := &file_pkg_service_control_service_proto_msgTypes[16] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *RemovePoliciesRequest_ChainInfo) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*RemovePoliciesRequest_ChainInfo) ProtoMessage() {} - -func (x *RemovePoliciesRequest_ChainInfo) ProtoReflect() protoreflect.Message { - mi := &file_pkg_service_control_service_proto_msgTypes[16] - 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 RemovePoliciesRequest_ChainInfo.ProtoReflect.Descriptor instead. -func (*RemovePoliciesRequest_ChainInfo) Descriptor() ([]byte, []int) { - return file_pkg_service_control_service_proto_rawDescGZIP(), []int{5, 0} -} - -func (x *RemovePoliciesRequest_ChainInfo) GetTarget() PolicyTarget { - if x != nil { - return x.Target - } - return PolicyTarget_TARGET_UNDEFINED -} - -func (x *RemovePoliciesRequest_ChainInfo) GetName() string { - if x != nil { - return x.Name - } - return "" -} - -func (x *RemovePoliciesRequest_ChainInfo) GetChainID() []byte { - if x != nil { - return x.ChainID - } - return nil -} - -type RemovePoliciesRequest_Body struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - ChainInfos []*RemovePoliciesRequest_ChainInfo `protobuf:"bytes,1,rep,name=chainInfos,proto3" json:"chainInfos,omitempty"` -} - -func (x *RemovePoliciesRequest_Body) Reset() { - *x = RemovePoliciesRequest_Body{} - if protoimpl.UnsafeEnabled { - mi := &file_pkg_service_control_service_proto_msgTypes[17] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *RemovePoliciesRequest_Body) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*RemovePoliciesRequest_Body) ProtoMessage() {} - -func (x *RemovePoliciesRequest_Body) ProtoReflect() protoreflect.Message { - mi := &file_pkg_service_control_service_proto_msgTypes[17] - 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 RemovePoliciesRequest_Body.ProtoReflect.Descriptor instead. -func (*RemovePoliciesRequest_Body) Descriptor() ([]byte, []int) { - return file_pkg_service_control_service_proto_rawDescGZIP(), []int{5, 1} -} - -func (x *RemovePoliciesRequest_Body) GetChainInfos() []*RemovePoliciesRequest_ChainInfo { - if x != nil { - return x.ChainInfos - } - return nil -} - -type RemovePoliciesResponse_Body struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields -} - -func (x *RemovePoliciesResponse_Body) Reset() { - *x = RemovePoliciesResponse_Body{} - if protoimpl.UnsafeEnabled { - mi := &file_pkg_service_control_service_proto_msgTypes[18] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *RemovePoliciesResponse_Body) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*RemovePoliciesResponse_Body) ProtoMessage() {} - -func (x *RemovePoliciesResponse_Body) ProtoReflect() protoreflect.Message { - mi := &file_pkg_service_control_service_proto_msgTypes[18] - 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 RemovePoliciesResponse_Body.ProtoReflect.Descriptor instead. -func (*RemovePoliciesResponse_Body) Descriptor() ([]byte, []int) { - return file_pkg_service_control_service_proto_rawDescGZIP(), []int{6, 0} -} - -type GetPolicyRequest_Body struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // Policy entity type. - Target PolicyTarget `protobuf:"varint,1,opt,name=target,proto3,enum=s3gw.control.PolicyTarget" json:"target,omitempty"` - // Policy name. - Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` - // Chain id to get. - ChainID []byte `protobuf:"bytes,3,opt,name=chainID,proto3" json:"chainID,omitempty"` -} - -func (x *GetPolicyRequest_Body) Reset() { - *x = GetPolicyRequest_Body{} - if protoimpl.UnsafeEnabled { - mi := &file_pkg_service_control_service_proto_msgTypes[19] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *GetPolicyRequest_Body) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GetPolicyRequest_Body) ProtoMessage() {} - -func (x *GetPolicyRequest_Body) ProtoReflect() protoreflect.Message { - mi := &file_pkg_service_control_service_proto_msgTypes[19] - 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 GetPolicyRequest_Body.ProtoReflect.Descriptor instead. -func (*GetPolicyRequest_Body) Descriptor() ([]byte, []int) { - return file_pkg_service_control_service_proto_rawDescGZIP(), []int{7, 0} -} - -func (x *GetPolicyRequest_Body) GetTarget() PolicyTarget { - if x != nil { - return x.Target - } - return PolicyTarget_TARGET_UNDEFINED -} - -func (x *GetPolicyRequest_Body) GetName() string { - if x != nil { - return x.Name - } - return "" -} - -func (x *GetPolicyRequest_Body) GetChainID() []byte { - if x != nil { - return x.ChainID - } - return nil -} - -type GetPolicyResponse_Body struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // Chain rules. - Chain []byte `protobuf:"bytes,1,opt,name=chain,proto3" json:"chain,omitempty"` -} - -func (x *GetPolicyResponse_Body) Reset() { - *x = GetPolicyResponse_Body{} - if protoimpl.UnsafeEnabled { - mi := &file_pkg_service_control_service_proto_msgTypes[20] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *GetPolicyResponse_Body) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GetPolicyResponse_Body) ProtoMessage() {} - -func (x *GetPolicyResponse_Body) ProtoReflect() protoreflect.Message { - mi := &file_pkg_service_control_service_proto_msgTypes[20] - 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 GetPolicyResponse_Body.ProtoReflect.Descriptor instead. -func (*GetPolicyResponse_Body) Descriptor() ([]byte, []int) { - return file_pkg_service_control_service_proto_rawDescGZIP(), []int{8, 0} -} - -func (x *GetPolicyResponse_Body) GetChain() []byte { - if x != nil { - return x.Chain - } - return nil -} - -type ListPoliciesRequest_Body struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // Policy entity type. - Target PolicyTarget `protobuf:"varint,1,opt,name=target,proto3,enum=s3gw.control.PolicyTarget" json:"target,omitempty"` - // Policy name. - Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` -} - -func (x *ListPoliciesRequest_Body) Reset() { - *x = ListPoliciesRequest_Body{} - if protoimpl.UnsafeEnabled { - mi := &file_pkg_service_control_service_proto_msgTypes[21] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ListPoliciesRequest_Body) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ListPoliciesRequest_Body) ProtoMessage() {} - -func (x *ListPoliciesRequest_Body) ProtoReflect() protoreflect.Message { - mi := &file_pkg_service_control_service_proto_msgTypes[21] - 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 ListPoliciesRequest_Body.ProtoReflect.Descriptor instead. -func (*ListPoliciesRequest_Body) Descriptor() ([]byte, []int) { - return file_pkg_service_control_service_proto_rawDescGZIP(), []int{9, 0} -} - -func (x *ListPoliciesRequest_Body) GetTarget() PolicyTarget { - if x != nil { - return x.Target - } - return PolicyTarget_TARGET_UNDEFINED -} - -func (x *ListPoliciesRequest_Body) GetName() string { - if x != nil { - return x.Name - } - return "" -} - -type ListPoliciesResponse_Body struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // Chain ids. - ChainIDs [][]byte `protobuf:"bytes,1,rep,name=chainIDs,proto3" json:"chainIDs,omitempty"` -} - -func (x *ListPoliciesResponse_Body) Reset() { - *x = ListPoliciesResponse_Body{} - if protoimpl.UnsafeEnabled { - mi := &file_pkg_service_control_service_proto_msgTypes[22] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ListPoliciesResponse_Body) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ListPoliciesResponse_Body) ProtoMessage() {} - -func (x *ListPoliciesResponse_Body) ProtoReflect() protoreflect.Message { - mi := &file_pkg_service_control_service_proto_msgTypes[22] - 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 ListPoliciesResponse_Body.ProtoReflect.Descriptor instead. -func (*ListPoliciesResponse_Body) Descriptor() ([]byte, []int) { - return file_pkg_service_control_service_proto_rawDescGZIP(), []int{10, 0} -} - -func (x *ListPoliciesResponse_Body) GetChainIDs() [][]byte { - if x != nil { - return x.ChainIDs - } - return nil -} - -var File_pkg_service_control_service_proto protoreflect.FileDescriptor - -var file_pkg_service_control_service_proto_rawDesc = []byte{ - 0x0a, 0x21, 0x70, 0x6b, 0x67, 0x2f, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2f, 0x63, 0x6f, - 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x2f, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x70, 0x72, - 0x6f, 0x74, 0x6f, 0x12, 0x0c, 0x73, 0x33, 0x67, 0x77, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, - 0x6c, 0x22, 0x36, 0x0a, 0x09, 0x53, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x12, 0x10, - 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x03, 0x6b, 0x65, 0x79, - 0x12, 0x17, 0x0a, 0x04, 0x73, 0x69, 0x67, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x09, - 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x22, 0x8e, 0x01, 0x0a, 0x12, 0x48, 0x65, - 0x61, 0x6c, 0x74, 0x68, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, - 0x12, 0x39, 0x0a, 0x04, 0x62, 0x6f, 0x64, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x25, - 0x2e, 0x73, 0x33, 0x67, 0x77, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x2e, 0x48, 0x65, - 0x61, 0x6c, 0x74, 0x68, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, - 0x2e, 0x42, 0x6f, 0x64, 0x79, 0x52, 0x04, 0x62, 0x6f, 0x64, 0x79, 0x12, 0x35, 0x0a, 0x09, 0x73, - 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x17, - 0x2e, 0x73, 0x33, 0x67, 0x77, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x2e, 0x53, 0x69, - 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x52, 0x09, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, - 0x72, 0x65, 0x1a, 0x06, 0x0a, 0x04, 0x42, 0x6f, 0x64, 0x79, 0x22, 0xd1, 0x01, 0x0a, 0x13, 0x48, - 0x65, 0x61, 0x6c, 0x74, 0x68, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, - 0x73, 0x65, 0x12, 0x3a, 0x0a, 0x04, 0x62, 0x6f, 0x64, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, - 0x32, 0x26, 0x2e, 0x73, 0x33, 0x67, 0x77, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x2e, - 0x48, 0x65, 0x61, 0x6c, 0x74, 0x68, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x52, 0x65, 0x73, 0x70, 0x6f, - 0x6e, 0x73, 0x65, 0x2e, 0x42, 0x6f, 0x64, 0x79, 0x52, 0x04, 0x62, 0x6f, 0x64, 0x79, 0x12, 0x35, - 0x0a, 0x09, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, - 0x0b, 0x32, 0x17, 0x2e, 0x73, 0x33, 0x67, 0x77, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, - 0x2e, 0x53, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x52, 0x09, 0x73, 0x69, 0x67, 0x6e, - 0x61, 0x74, 0x75, 0x72, 0x65, 0x1a, 0x47, 0x0a, 0x04, 0x42, 0x6f, 0x64, 0x79, 0x12, 0x3f, 0x0a, - 0x0d, 0x68, 0x65, 0x61, 0x6c, 0x74, 0x68, 0x5f, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x01, - 0x20, 0x01, 0x28, 0x0e, 0x32, 0x1a, 0x2e, 0x73, 0x33, 0x67, 0x77, 0x2e, 0x63, 0x6f, 0x6e, 0x74, - 0x72, 0x6f, 0x6c, 0x2e, 0x48, 0x65, 0x61, 0x6c, 0x74, 0x68, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, - 0x52, 0x0c, 0x68, 0x65, 0x61, 0x6c, 0x74, 0x68, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x22, 0xc5, - 0x02, 0x0a, 0x12, 0x50, 0x75, 0x74, 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x69, 0x65, 0x73, 0x52, 0x65, - 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x39, 0x0a, 0x04, 0x62, 0x6f, 0x64, 0x79, 0x18, 0x01, 0x20, - 0x01, 0x28, 0x0b, 0x32, 0x25, 0x2e, 0x73, 0x33, 0x67, 0x77, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x72, - 0x6f, 0x6c, 0x2e, 0x50, 0x75, 0x74, 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x69, 0x65, 0x73, 0x52, 0x65, - 0x71, 0x75, 0x65, 0x73, 0x74, 0x2e, 0x42, 0x6f, 0x64, 0x79, 0x52, 0x04, 0x62, 0x6f, 0x64, 0x79, - 0x12, 0x35, 0x0a, 0x09, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x18, 0x02, 0x20, - 0x01, 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x73, 0x33, 0x67, 0x77, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x72, - 0x6f, 0x6c, 0x2e, 0x53, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x52, 0x09, 0x73, 0x69, - 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x1a, 0x69, 0x0a, 0x09, 0x43, 0x68, 0x61, 0x69, 0x6e, - 0x44, 0x61, 0x74, 0x61, 0x12, 0x32, 0x0a, 0x06, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x18, 0x01, - 0x20, 0x01, 0x28, 0x0e, 0x32, 0x1a, 0x2e, 0x73, 0x33, 0x67, 0x77, 0x2e, 0x63, 0x6f, 0x6e, 0x74, - 0x72, 0x6f, 0x6c, 0x2e, 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x54, 0x61, 0x72, 0x67, 0x65, 0x74, - 0x52, 0x06, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, - 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x14, 0x0a, 0x05, - 0x63, 0x68, 0x61, 0x69, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x05, 0x63, 0x68, 0x61, - 0x69, 0x6e, 0x1a, 0x52, 0x0a, 0x04, 0x42, 0x6f, 0x64, 0x79, 0x12, 0x4a, 0x0a, 0x0a, 0x63, 0x68, - 0x61, 0x69, 0x6e, 0x44, 0x61, 0x74, 0x61, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x2a, - 0x2e, 0x73, 0x33, 0x67, 0x77, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x2e, 0x50, 0x75, - 0x74, 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x69, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, - 0x2e, 0x43, 0x68, 0x61, 0x69, 0x6e, 0x44, 0x61, 0x74, 0x61, 0x52, 0x0a, 0x63, 0x68, 0x61, 0x69, - 0x6e, 0x44, 0x61, 0x74, 0x61, 0x73, 0x22, 0x90, 0x01, 0x0a, 0x13, 0x50, 0x75, 0x74, 0x50, 0x6f, - 0x6c, 0x69, 0x63, 0x69, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x3a, - 0x0a, 0x04, 0x62, 0x6f, 0x64, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x26, 0x2e, 0x73, - 0x33, 0x67, 0x77, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x2e, 0x50, 0x75, 0x74, 0x50, - 0x6f, 0x6c, 0x69, 0x63, 0x69, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x2e, - 0x42, 0x6f, 0x64, 0x79, 0x52, 0x04, 0x62, 0x6f, 0x64, 0x79, 0x12, 0x35, 0x0a, 0x09, 0x73, 0x69, - 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x17, 0x2e, - 0x73, 0x33, 0x67, 0x77, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x2e, 0x53, 0x69, 0x67, - 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x52, 0x09, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, - 0x65, 0x1a, 0x06, 0x0a, 0x04, 0x42, 0x6f, 0x64, 0x79, 0x22, 0xd2, 0x02, 0x0a, 0x15, 0x52, 0x65, - 0x6d, 0x6f, 0x76, 0x65, 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x69, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, - 0x65, 0x73, 0x74, 0x12, 0x3c, 0x0a, 0x04, 0x62, 0x6f, 0x64, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, - 0x0b, 0x32, 0x28, 0x2e, 0x73, 0x33, 0x67, 0x77, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, - 0x2e, 0x52, 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x69, 0x65, 0x73, 0x52, - 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x2e, 0x42, 0x6f, 0x64, 0x79, 0x52, 0x04, 0x62, 0x6f, 0x64, - 0x79, 0x12, 0x35, 0x0a, 0x09, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x18, 0x02, - 0x20, 0x01, 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x73, 0x33, 0x67, 0x77, 0x2e, 0x63, 0x6f, 0x6e, 0x74, - 0x72, 0x6f, 0x6c, 0x2e, 0x53, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x52, 0x09, 0x73, - 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x1a, 0x6d, 0x0a, 0x09, 0x43, 0x68, 0x61, 0x69, - 0x6e, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x32, 0x0a, 0x06, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x18, - 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x1a, 0x2e, 0x73, 0x33, 0x67, 0x77, 0x2e, 0x63, 0x6f, 0x6e, - 0x74, 0x72, 0x6f, 0x6c, 0x2e, 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x54, 0x61, 0x72, 0x67, 0x65, - 0x74, 0x52, 0x06, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, - 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x18, 0x0a, - 0x07, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x49, 0x44, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x07, - 0x63, 0x68, 0x61, 0x69, 0x6e, 0x49, 0x44, 0x1a, 0x55, 0x0a, 0x04, 0x42, 0x6f, 0x64, 0x79, 0x12, - 0x4d, 0x0a, 0x0a, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x49, 0x6e, 0x66, 0x6f, 0x73, 0x18, 0x01, 0x20, - 0x03, 0x28, 0x0b, 0x32, 0x2d, 0x2e, 0x73, 0x33, 0x67, 0x77, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x72, - 0x6f, 0x6c, 0x2e, 0x52, 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x69, 0x65, - 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x2e, 0x43, 0x68, 0x61, 0x69, 0x6e, 0x49, 0x6e, - 0x66, 0x6f, 0x52, 0x0a, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x49, 0x6e, 0x66, 0x6f, 0x73, 0x22, 0x96, - 0x01, 0x0a, 0x16, 0x52, 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x69, 0x65, - 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x3d, 0x0a, 0x04, 0x62, 0x6f, 0x64, - 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x29, 0x2e, 0x73, 0x33, 0x67, 0x77, 0x2e, 0x63, - 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x2e, 0x52, 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x50, 0x6f, 0x6c, - 0x69, 0x63, 0x69, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x2e, 0x42, 0x6f, - 0x64, 0x79, 0x52, 0x04, 0x62, 0x6f, 0x64, 0x79, 0x12, 0x35, 0x0a, 0x09, 0x73, 0x69, 0x67, 0x6e, - 0x61, 0x74, 0x75, 0x72, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x73, 0x33, - 0x67, 0x77, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x2e, 0x53, 0x69, 0x67, 0x6e, 0x61, - 0x74, 0x75, 0x72, 0x65, 0x52, 0x09, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x1a, - 0x06, 0x0a, 0x04, 0x42, 0x6f, 0x64, 0x79, 0x22, 0xec, 0x01, 0x0a, 0x10, 0x47, 0x65, 0x74, 0x50, - 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x37, 0x0a, 0x04, - 0x62, 0x6f, 0x64, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x23, 0x2e, 0x73, 0x33, 0x67, - 0x77, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x2e, 0x47, 0x65, 0x74, 0x50, 0x6f, 0x6c, - 0x69, 0x63, 0x79, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x2e, 0x42, 0x6f, 0x64, 0x79, 0x52, - 0x04, 0x62, 0x6f, 0x64, 0x79, 0x12, 0x35, 0x0a, 0x09, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, - 0x72, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x73, 0x33, 0x67, 0x77, 0x2e, - 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x2e, 0x53, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, - 0x65, 0x52, 0x09, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x1a, 0x68, 0x0a, 0x04, - 0x42, 0x6f, 0x64, 0x79, 0x12, 0x32, 0x0a, 0x06, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x18, 0x01, - 0x20, 0x01, 0x28, 0x0e, 0x32, 0x1a, 0x2e, 0x73, 0x33, 0x67, 0x77, 0x2e, 0x63, 0x6f, 0x6e, 0x74, - 0x72, 0x6f, 0x6c, 0x2e, 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x54, 0x61, 0x72, 0x67, 0x65, 0x74, - 0x52, 0x06, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, - 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x18, 0x0a, 0x07, - 0x63, 0x68, 0x61, 0x69, 0x6e, 0x49, 0x44, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x07, 0x63, - 0x68, 0x61, 0x69, 0x6e, 0x49, 0x44, 0x22, 0xa2, 0x01, 0x0a, 0x11, 0x47, 0x65, 0x74, 0x50, 0x6f, - 0x6c, 0x69, 0x63, 0x79, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x38, 0x0a, 0x04, - 0x62, 0x6f, 0x64, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x24, 0x2e, 0x73, 0x33, 0x67, - 0x77, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x2e, 0x47, 0x65, 0x74, 0x50, 0x6f, 0x6c, - 0x69, 0x63, 0x79, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x2e, 0x42, 0x6f, 0x64, 0x79, - 0x52, 0x04, 0x62, 0x6f, 0x64, 0x79, 0x12, 0x35, 0x0a, 0x09, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, - 0x75, 0x72, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x73, 0x33, 0x67, 0x77, - 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x2e, 0x53, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, - 0x72, 0x65, 0x52, 0x09, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x1a, 0x1c, 0x0a, - 0x04, 0x42, 0x6f, 0x64, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x18, 0x01, - 0x20, 0x01, 0x28, 0x0c, 0x52, 0x05, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x22, 0xd8, 0x01, 0x0a, 0x13, - 0x4c, 0x69, 0x73, 0x74, 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x69, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, - 0x65, 0x73, 0x74, 0x12, 0x3a, 0x0a, 0x04, 0x62, 0x6f, 0x64, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, - 0x0b, 0x32, 0x26, 0x2e, 0x73, 0x33, 0x67, 0x77, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, - 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x69, 0x65, 0x73, 0x52, 0x65, 0x71, - 0x75, 0x65, 0x73, 0x74, 0x2e, 0x42, 0x6f, 0x64, 0x79, 0x52, 0x04, 0x62, 0x6f, 0x64, 0x79, 0x12, - 0x35, 0x0a, 0x09, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x18, 0x02, 0x20, 0x01, - 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x73, 0x33, 0x67, 0x77, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, - 0x6c, 0x2e, 0x53, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x52, 0x09, 0x73, 0x69, 0x67, - 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x1a, 0x4e, 0x0a, 0x04, 0x42, 0x6f, 0x64, 0x79, 0x12, 0x32, - 0x0a, 0x06, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x1a, - 0x2e, 0x73, 0x33, 0x67, 0x77, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x2e, 0x50, 0x6f, - 0x6c, 0x69, 0x63, 0x79, 0x54, 0x61, 0x72, 0x67, 0x65, 0x74, 0x52, 0x06, 0x74, 0x61, 0x72, 0x67, - 0x65, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, - 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x22, 0xae, 0x01, 0x0a, 0x14, 0x4c, 0x69, 0x73, 0x74, 0x50, - 0x6f, 0x6c, 0x69, 0x63, 0x69, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, - 0x3b, 0x0a, 0x04, 0x62, 0x6f, 0x64, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x27, 0x2e, - 0x73, 0x33, 0x67, 0x77, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x2e, 0x4c, 0x69, 0x73, - 0x74, 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x69, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, - 0x65, 0x2e, 0x42, 0x6f, 0x64, 0x79, 0x52, 0x04, 0x62, 0x6f, 0x64, 0x79, 0x12, 0x35, 0x0a, 0x09, - 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, - 0x17, 0x2e, 0x73, 0x33, 0x67, 0x77, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x2e, 0x53, - 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x52, 0x09, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, - 0x75, 0x72, 0x65, 0x1a, 0x22, 0x0a, 0x04, 0x42, 0x6f, 0x64, 0x79, 0x12, 0x1a, 0x0a, 0x08, 0x63, - 0x68, 0x61, 0x69, 0x6e, 0x49, 0x44, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0c, 0x52, 0x08, 0x63, - 0x68, 0x61, 0x69, 0x6e, 0x49, 0x44, 0x73, 0x2a, 0x57, 0x0a, 0x0c, 0x48, 0x65, 0x61, 0x6c, 0x74, - 0x68, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x1b, 0x0a, 0x17, 0x48, 0x45, 0x41, 0x4c, 0x54, - 0x48, 0x5f, 0x53, 0x54, 0x41, 0x54, 0x55, 0x53, 0x5f, 0x55, 0x4e, 0x44, 0x45, 0x46, 0x49, 0x4e, - 0x45, 0x44, 0x10, 0x00, 0x12, 0x0c, 0x0a, 0x08, 0x53, 0x54, 0x41, 0x52, 0x54, 0x49, 0x4e, 0x47, - 0x10, 0x01, 0x12, 0x09, 0x0a, 0x05, 0x52, 0x45, 0x41, 0x44, 0x59, 0x10, 0x02, 0x12, 0x11, 0x0a, - 0x0d, 0x53, 0x48, 0x55, 0x54, 0x54, 0x49, 0x4e, 0x47, 0x5f, 0x44, 0x4f, 0x57, 0x4e, 0x10, 0x03, - 0x2a, 0x57, 0x0a, 0x0c, 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x54, 0x61, 0x72, 0x67, 0x65, 0x74, - 0x12, 0x14, 0x0a, 0x10, 0x54, 0x41, 0x52, 0x47, 0x45, 0x54, 0x5f, 0x55, 0x4e, 0x44, 0x45, 0x46, - 0x49, 0x4e, 0x45, 0x44, 0x10, 0x00, 0x12, 0x0d, 0x0a, 0x09, 0x43, 0x4f, 0x4e, 0x54, 0x41, 0x49, - 0x4e, 0x45, 0x52, 0x10, 0x01, 0x12, 0x0d, 0x0a, 0x09, 0x4e, 0x41, 0x4d, 0x45, 0x53, 0x50, 0x41, - 0x43, 0x45, 0x10, 0x02, 0x12, 0x08, 0x0a, 0x04, 0x55, 0x53, 0x45, 0x52, 0x10, 0x03, 0x12, 0x09, - 0x0a, 0x05, 0x47, 0x52, 0x4f, 0x55, 0x50, 0x10, 0x04, 0x32, 0xba, 0x03, 0x0a, 0x0e, 0x43, 0x6f, - 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x52, 0x0a, 0x0b, - 0x48, 0x65, 0x61, 0x6c, 0x74, 0x68, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x12, 0x20, 0x2e, 0x73, 0x33, - 0x67, 0x77, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x2e, 0x48, 0x65, 0x61, 0x6c, 0x74, - 0x68, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x21, 0x2e, - 0x73, 0x33, 0x67, 0x77, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x2e, 0x48, 0x65, 0x61, - 0x6c, 0x74, 0x68, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, - 0x12, 0x52, 0x0a, 0x0b, 0x50, 0x75, 0x74, 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x69, 0x65, 0x73, 0x12, - 0x20, 0x2e, 0x73, 0x33, 0x67, 0x77, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x2e, 0x50, - 0x75, 0x74, 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x69, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, - 0x74, 0x1a, 0x21, 0x2e, 0x73, 0x33, 0x67, 0x77, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, - 0x2e, 0x50, 0x75, 0x74, 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x69, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, - 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x5b, 0x0a, 0x0e, 0x52, 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x50, 0x6f, - 0x6c, 0x69, 0x63, 0x69, 0x65, 0x73, 0x12, 0x23, 0x2e, 0x73, 0x33, 0x67, 0x77, 0x2e, 0x63, 0x6f, - 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x2e, 0x52, 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x50, 0x6f, 0x6c, 0x69, - 0x63, 0x69, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x24, 0x2e, 0x73, 0x33, - 0x67, 0x77, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x2e, 0x52, 0x65, 0x6d, 0x6f, 0x76, - 0x65, 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x69, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, - 0x65, 0x12, 0x4c, 0x0a, 0x09, 0x47, 0x65, 0x74, 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x12, 0x1e, - 0x2e, 0x73, 0x33, 0x67, 0x77, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x2e, 0x47, 0x65, - 0x74, 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1f, - 0x2e, 0x73, 0x33, 0x67, 0x77, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x2e, 0x47, 0x65, - 0x74, 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, - 0x55, 0x0a, 0x0c, 0x4c, 0x69, 0x73, 0x74, 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x69, 0x65, 0x73, 0x12, - 0x21, 0x2e, 0x73, 0x33, 0x67, 0x77, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x2e, 0x4c, - 0x69, 0x73, 0x74, 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x69, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, - 0x73, 0x74, 0x1a, 0x22, 0x2e, 0x73, 0x33, 0x67, 0x77, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, - 0x6c, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x69, 0x65, 0x73, 0x52, 0x65, - 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x42, 0x41, 0x5a, 0x3f, 0x67, 0x69, 0x74, 0x2e, 0x66, 0x72, - 0x6f, 0x73, 0x74, 0x66, 0x73, 0x2e, 0x69, 0x6e, 0x66, 0x6f, 0x2f, 0x54, 0x72, 0x75, 0x65, 0x43, - 0x6c, 0x6f, 0x75, 0x64, 0x4c, 0x61, 0x62, 0x2f, 0x66, 0x72, 0x6f, 0x73, 0x74, 0x66, 0x73, 0x2d, - 0x73, 0x33, 0x2d, 0x67, 0x77, 0x2f, 0x70, 0x6b, 0x67, 0x2f, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, - 0x65, 0x2f, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, - 0x33, -} - -var ( - file_pkg_service_control_service_proto_rawDescOnce sync.Once - file_pkg_service_control_service_proto_rawDescData = file_pkg_service_control_service_proto_rawDesc -) - -func file_pkg_service_control_service_proto_rawDescGZIP() []byte { - file_pkg_service_control_service_proto_rawDescOnce.Do(func() { - file_pkg_service_control_service_proto_rawDescData = protoimpl.X.CompressGZIP(file_pkg_service_control_service_proto_rawDescData) - }) - return file_pkg_service_control_service_proto_rawDescData -} - -var file_pkg_service_control_service_proto_enumTypes = make([]protoimpl.EnumInfo, 2) -var file_pkg_service_control_service_proto_msgTypes = make([]protoimpl.MessageInfo, 23) -var file_pkg_service_control_service_proto_goTypes = []interface{}{ - (HealthStatus)(0), // 0: s3gw.control.HealthStatus - (PolicyTarget)(0), // 1: s3gw.control.PolicyTarget - (*Signature)(nil), // 2: s3gw.control.Signature - (*HealthCheckRequest)(nil), // 3: s3gw.control.HealthCheckRequest - (*HealthCheckResponse)(nil), // 4: s3gw.control.HealthCheckResponse - (*PutPoliciesRequest)(nil), // 5: s3gw.control.PutPoliciesRequest - (*PutPoliciesResponse)(nil), // 6: s3gw.control.PutPoliciesResponse - (*RemovePoliciesRequest)(nil), // 7: s3gw.control.RemovePoliciesRequest - (*RemovePoliciesResponse)(nil), // 8: s3gw.control.RemovePoliciesResponse - (*GetPolicyRequest)(nil), // 9: s3gw.control.GetPolicyRequest - (*GetPolicyResponse)(nil), // 10: s3gw.control.GetPolicyResponse - (*ListPoliciesRequest)(nil), // 11: s3gw.control.ListPoliciesRequest - (*ListPoliciesResponse)(nil), // 12: s3gw.control.ListPoliciesResponse - (*HealthCheckRequest_Body)(nil), // 13: s3gw.control.HealthCheckRequest.Body - (*HealthCheckResponse_Body)(nil), // 14: s3gw.control.HealthCheckResponse.Body - (*PutPoliciesRequest_ChainData)(nil), // 15: s3gw.control.PutPoliciesRequest.ChainData - (*PutPoliciesRequest_Body)(nil), // 16: s3gw.control.PutPoliciesRequest.Body - (*PutPoliciesResponse_Body)(nil), // 17: s3gw.control.PutPoliciesResponse.Body - (*RemovePoliciesRequest_ChainInfo)(nil), // 18: s3gw.control.RemovePoliciesRequest.ChainInfo - (*RemovePoliciesRequest_Body)(nil), // 19: s3gw.control.RemovePoliciesRequest.Body - (*RemovePoliciesResponse_Body)(nil), // 20: s3gw.control.RemovePoliciesResponse.Body - (*GetPolicyRequest_Body)(nil), // 21: s3gw.control.GetPolicyRequest.Body - (*GetPolicyResponse_Body)(nil), // 22: s3gw.control.GetPolicyResponse.Body - (*ListPoliciesRequest_Body)(nil), // 23: s3gw.control.ListPoliciesRequest.Body - (*ListPoliciesResponse_Body)(nil), // 24: s3gw.control.ListPoliciesResponse.Body -} -var file_pkg_service_control_service_proto_depIdxs = []int32{ - 13, // 0: s3gw.control.HealthCheckRequest.body:type_name -> s3gw.control.HealthCheckRequest.Body - 2, // 1: s3gw.control.HealthCheckRequest.signature:type_name -> s3gw.control.Signature - 14, // 2: s3gw.control.HealthCheckResponse.body:type_name -> s3gw.control.HealthCheckResponse.Body - 2, // 3: s3gw.control.HealthCheckResponse.signature:type_name -> s3gw.control.Signature - 16, // 4: s3gw.control.PutPoliciesRequest.body:type_name -> s3gw.control.PutPoliciesRequest.Body - 2, // 5: s3gw.control.PutPoliciesRequest.signature:type_name -> s3gw.control.Signature - 17, // 6: s3gw.control.PutPoliciesResponse.body:type_name -> s3gw.control.PutPoliciesResponse.Body - 2, // 7: s3gw.control.PutPoliciesResponse.signature:type_name -> s3gw.control.Signature - 19, // 8: s3gw.control.RemovePoliciesRequest.body:type_name -> s3gw.control.RemovePoliciesRequest.Body - 2, // 9: s3gw.control.RemovePoliciesRequest.signature:type_name -> s3gw.control.Signature - 20, // 10: s3gw.control.RemovePoliciesResponse.body:type_name -> s3gw.control.RemovePoliciesResponse.Body - 2, // 11: s3gw.control.RemovePoliciesResponse.signature:type_name -> s3gw.control.Signature - 21, // 12: s3gw.control.GetPolicyRequest.body:type_name -> s3gw.control.GetPolicyRequest.Body - 2, // 13: s3gw.control.GetPolicyRequest.signature:type_name -> s3gw.control.Signature - 22, // 14: s3gw.control.GetPolicyResponse.body:type_name -> s3gw.control.GetPolicyResponse.Body - 2, // 15: s3gw.control.GetPolicyResponse.signature:type_name -> s3gw.control.Signature - 23, // 16: s3gw.control.ListPoliciesRequest.body:type_name -> s3gw.control.ListPoliciesRequest.Body - 2, // 17: s3gw.control.ListPoliciesRequest.signature:type_name -> s3gw.control.Signature - 24, // 18: s3gw.control.ListPoliciesResponse.body:type_name -> s3gw.control.ListPoliciesResponse.Body - 2, // 19: s3gw.control.ListPoliciesResponse.signature:type_name -> s3gw.control.Signature - 0, // 20: s3gw.control.HealthCheckResponse.Body.health_status:type_name -> s3gw.control.HealthStatus - 1, // 21: s3gw.control.PutPoliciesRequest.ChainData.target:type_name -> s3gw.control.PolicyTarget - 15, // 22: s3gw.control.PutPoliciesRequest.Body.chainDatas:type_name -> s3gw.control.PutPoliciesRequest.ChainData - 1, // 23: s3gw.control.RemovePoliciesRequest.ChainInfo.target:type_name -> s3gw.control.PolicyTarget - 18, // 24: s3gw.control.RemovePoliciesRequest.Body.chainInfos:type_name -> s3gw.control.RemovePoliciesRequest.ChainInfo - 1, // 25: s3gw.control.GetPolicyRequest.Body.target:type_name -> s3gw.control.PolicyTarget - 1, // 26: s3gw.control.ListPoliciesRequest.Body.target:type_name -> s3gw.control.PolicyTarget - 3, // 27: s3gw.control.ControlService.HealthCheck:input_type -> s3gw.control.HealthCheckRequest - 5, // 28: s3gw.control.ControlService.PutPolicies:input_type -> s3gw.control.PutPoliciesRequest - 7, // 29: s3gw.control.ControlService.RemovePolicies:input_type -> s3gw.control.RemovePoliciesRequest - 9, // 30: s3gw.control.ControlService.GetPolicy:input_type -> s3gw.control.GetPolicyRequest - 11, // 31: s3gw.control.ControlService.ListPolicies:input_type -> s3gw.control.ListPoliciesRequest - 4, // 32: s3gw.control.ControlService.HealthCheck:output_type -> s3gw.control.HealthCheckResponse - 6, // 33: s3gw.control.ControlService.PutPolicies:output_type -> s3gw.control.PutPoliciesResponse - 8, // 34: s3gw.control.ControlService.RemovePolicies:output_type -> s3gw.control.RemovePoliciesResponse - 10, // 35: s3gw.control.ControlService.GetPolicy:output_type -> s3gw.control.GetPolicyResponse - 12, // 36: s3gw.control.ControlService.ListPolicies:output_type -> s3gw.control.ListPoliciesResponse - 32, // [32:37] is the sub-list for method output_type - 27, // [27:32] is the sub-list for method input_type - 27, // [27:27] is the sub-list for extension type_name - 27, // [27:27] is the sub-list for extension extendee - 0, // [0:27] is the sub-list for field type_name -} - -func init() { file_pkg_service_control_service_proto_init() } -func file_pkg_service_control_service_proto_init() { - if File_pkg_service_control_service_proto != nil { - return - } - if !protoimpl.UnsafeEnabled { - file_pkg_service_control_service_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Signature); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_pkg_service_control_service_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*HealthCheckRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_pkg_service_control_service_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*HealthCheckResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_pkg_service_control_service_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*PutPoliciesRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_pkg_service_control_service_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*PutPoliciesResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_pkg_service_control_service_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*RemovePoliciesRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_pkg_service_control_service_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*RemovePoliciesResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_pkg_service_control_service_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*GetPolicyRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_pkg_service_control_service_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*GetPolicyResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_pkg_service_control_service_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ListPoliciesRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_pkg_service_control_service_proto_msgTypes[10].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ListPoliciesResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_pkg_service_control_service_proto_msgTypes[11].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*HealthCheckRequest_Body); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_pkg_service_control_service_proto_msgTypes[12].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*HealthCheckResponse_Body); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_pkg_service_control_service_proto_msgTypes[13].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*PutPoliciesRequest_ChainData); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_pkg_service_control_service_proto_msgTypes[14].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*PutPoliciesRequest_Body); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_pkg_service_control_service_proto_msgTypes[15].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*PutPoliciesResponse_Body); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_pkg_service_control_service_proto_msgTypes[16].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*RemovePoliciesRequest_ChainInfo); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_pkg_service_control_service_proto_msgTypes[17].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*RemovePoliciesRequest_Body); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_pkg_service_control_service_proto_msgTypes[18].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*RemovePoliciesResponse_Body); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_pkg_service_control_service_proto_msgTypes[19].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*GetPolicyRequest_Body); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_pkg_service_control_service_proto_msgTypes[20].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*GetPolicyResponse_Body); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_pkg_service_control_service_proto_msgTypes[21].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ListPoliciesRequest_Body); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_pkg_service_control_service_proto_msgTypes[22].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ListPoliciesResponse_Body); 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_pkg_service_control_service_proto_rawDesc, - NumEnums: 2, - NumMessages: 23, - NumExtensions: 0, - NumServices: 1, - }, - GoTypes: file_pkg_service_control_service_proto_goTypes, - DependencyIndexes: file_pkg_service_control_service_proto_depIdxs, - EnumInfos: file_pkg_service_control_service_proto_enumTypes, - MessageInfos: file_pkg_service_control_service_proto_msgTypes, - }.Build() - File_pkg_service_control_service_proto = out.File - file_pkg_service_control_service_proto_rawDesc = nil - file_pkg_service_control_service_proto_goTypes = nil - file_pkg_service_control_service_proto_depIdxs = nil -} diff --git a/pkg/service/control/service.proto b/pkg/service/control/service.proto deleted file mode 100644 index 2bf3e96..0000000 --- a/pkg/service/control/service.proto +++ /dev/null @@ -1,206 +0,0 @@ -syntax = "proto3"; - -package s3gw.control; - -option go_package = "git.frostfs.info/TrueCloudLab/frostfs-s3-gw/pkg/service/control"; - -// `ControlService` provides an interface for internal work with the storage node. -service ControlService { - // Performs health check of the storage node. - rpc HealthCheck (HealthCheckRequest) returns (HealthCheckResponse); - - rpc PutPolicies (PutPoliciesRequest) returns (PutPoliciesResponse); - - rpc RemovePolicies (RemovePoliciesRequest) returns (RemovePoliciesResponse); - - rpc GetPolicy (GetPolicyRequest) returns (GetPolicyResponse); - - rpc ListPolicies (ListPoliciesRequest) returns (ListPoliciesResponse); -} - -// Signature of some message. -message Signature { - // Public key used for signing. - bytes key = 1 [json_name = "key"]; - - // Binary signature. - bytes sign = 2 [json_name = "signature"]; -} - -// Health check request. -message HealthCheckRequest { - message Body { - } - - // Body of health check request message. - Body body = 1; - - // Body signature. - Signature signature = 2; -} - -// Health check response. -message HealthCheckResponse { - // Health check response body - message Body { - // Health status of storage node application. - HealthStatus health_status = 1; - } - - // Body of health check response message. - Body body = 1; - - Signature signature = 2; -} - - -// Health status of the storage node application. -enum HealthStatus { - // Undefined status, default value. - HEALTH_STATUS_UNDEFINED = 0; - - // Storage node application is starting. - STARTING = 1; - - // Storage node application is started and serves all services. - READY = 2; - - // Storage node application is shutting down. - SHUTTING_DOWN = 3; -} - -// Policy target to store chains. -enum PolicyTarget { - // Undefined target, invalid to use. - TARGET_UNDEFINED = 0; - - // Container target for bucket policies. - CONTAINER = 1; - - // Namespace target for namespace policies. - NAMESPACE = 2; - - // User target for namespace user policies. - USER = 3; - - // Group target for namespace target policies. - GROUP = 4; -} - -// Put policies request. -message PutPoliciesRequest { - message ChainData { - // Policy entity type. - PolicyTarget target = 1; - // Policy name. - string name = 2; - // Chain rules. - bytes chain = 3; - } - - message Body { - repeated ChainData chainDatas = 1; - } - - Body body = 1; - - // Body signature. - Signature signature = 2; -} - -// Put policies response. -message PutPoliciesResponse { - message Body { - } - - Body body = 1; - - Signature signature = 2; -} - -// Remove policies request. -message RemovePoliciesRequest { - message ChainInfo { - // Policy entity type. - PolicyTarget target = 1; - // Policy name. - string name = 2; - // Chain id to remove. - bytes chainID = 3; - } - - message Body { - repeated ChainInfo chainInfos = 1; - } - - Body body = 1; - - // Body signature. - Signature signature = 2; -} - -// Remove policies response. -message RemovePoliciesResponse { - message Body { - } - - Body body = 1; - - Signature signature = 2; -} - -// Get policy request. -message GetPolicyRequest { - message Body { - // Policy entity type. - PolicyTarget target = 1; - // Policy name. - string name = 2; - // Chain id to get. - bytes chainID = 3; - } - - Body body = 1; - - // Body signature. - Signature signature = 2; -} - -// Get policy response. -message GetPolicyResponse { - message Body { - // Chain rules. - bytes chain = 1; - } - - Body body = 1; - - Signature signature = 2; -} - -// List policies request. -message ListPoliciesRequest { - message Body { - // Policy entity type. - PolicyTarget target = 1; - // Policy name. - string name = 2; - } - - Body body = 1; - - // Body signature. - Signature signature = 2; -} - -// List policies response. -message ListPoliciesResponse { - message Body { - // Chain ids. - repeated bytes chainIDs = 1; - } - - Body body = 1; - - Signature signature = 2; -} diff --git a/pkg/service/control/service_frostfs.pb.go b/pkg/service/control/service_frostfs.pb.go deleted file mode 100644 index 8807713..0000000 --- a/pkg/service/control/service_frostfs.pb.go +++ /dev/null @@ -1,955 +0,0 @@ -// Code generated by protoc-gen-go-frostfs. DO NOT EDIT. - -package control - -import "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/util/proto" - -// StableSize returns the size of x in protobuf format. -// -// Structures with the same field values have the same binary size. -func (x *Signature) StableSize() (size int) { - if x == nil { - return 0 - } - size += proto.BytesSize(1, x.Key) - size += proto.BytesSize(2, x.Sign) - return size -} - -// StableMarshal marshals x in protobuf binary format with stable field order. -// -// If buffer length is less than x.StableSize(), new buffer is allocated. -// -// Returns any error encountered which did not allow writing the data completely. -// Otherwise, returns the buffer in which the data is written. -// -// Structures with the same field values have the same binary format. -func (x *Signature) StableMarshal(buf []byte) []byte { - if x == nil { - return []byte{} - } - if buf == nil { - buf = make([]byte, x.StableSize()) - } - var offset int - offset += proto.BytesMarshal(1, buf[offset:], x.Key) - offset += proto.BytesMarshal(2, buf[offset:], x.Sign) - return buf -} - -// StableSize returns the size of x in protobuf format. -// -// Structures with the same field values have the same binary size. -func (x *HealthCheckRequest_Body) StableSize() (size int) { - if x == nil { - return 0 - } - return size -} - -// StableMarshal marshals x in protobuf binary format with stable field order. -// -// If buffer length is less than x.StableSize(), new buffer is allocated. -// -// Returns any error encountered which did not allow writing the data completely. -// Otherwise, returns the buffer in which the data is written. -// -// Structures with the same field values have the same binary format. -func (x *HealthCheckRequest_Body) StableMarshal(buf []byte) []byte { - return buf -} - -// StableSize returns the size of x in protobuf format. -// -// Structures with the same field values have the same binary size. -func (x *HealthCheckRequest) StableSize() (size int) { - if x == nil { - return 0 - } - size += proto.NestedStructureSize(1, x.Body) - size += proto.NestedStructureSize(2, x.Signature) - return size -} - -// StableMarshal marshals x in protobuf binary format with stable field order. -// -// If buffer length is less than x.StableSize(), new buffer is allocated. -// -// Returns any error encountered which did not allow writing the data completely. -// Otherwise, returns the buffer in which the data is written. -// -// Structures with the same field values have the same binary format. -func (x *HealthCheckRequest) StableMarshal(buf []byte) []byte { - if x == nil { - return []byte{} - } - if buf == nil { - buf = make([]byte, x.StableSize()) - } - var offset int - offset += proto.NestedStructureMarshal(1, buf[offset:], x.Body) - offset += proto.NestedStructureMarshal(2, buf[offset:], x.Signature) - return buf -} - -// ReadSignedData fills buf with signed data of x. -// If buffer length is less than x.SignedDataSize(), new buffer is allocated. -// -// Returns any error encountered which did not allow writing the data completely. -// Otherwise, returns the buffer in which the data is written. -// -// Structures with the same field values have the same signed data. -func (x *HealthCheckRequest) SignedDataSize() int { - return x.GetBody().StableSize() -} - -// SignedDataSize returns size of the request signed data in bytes. -// -// Structures with the same field values have the same signed data size. -func (x *HealthCheckRequest) ReadSignedData(buf []byte) ([]byte, error) { - return x.GetBody().StableMarshal(buf), nil -} - -func (x *HealthCheckRequest) SetSignature(sig *Signature) { - x.Signature = sig -} - -// StableSize returns the size of x in protobuf format. -// -// Structures with the same field values have the same binary size. -func (x *HealthCheckResponse_Body) StableSize() (size int) { - if x == nil { - return 0 - } - size += proto.EnumSize(1, int32(x.HealthStatus)) - return size -} - -// StableMarshal marshals x in protobuf binary format with stable field order. -// -// If buffer length is less than x.StableSize(), new buffer is allocated. -// -// Returns any error encountered which did not allow writing the data completely. -// Otherwise, returns the buffer in which the data is written. -// -// Structures with the same field values have the same binary format. -func (x *HealthCheckResponse_Body) StableMarshal(buf []byte) []byte { - if x == nil { - return []byte{} - } - if buf == nil { - buf = make([]byte, x.StableSize()) - } - var offset int - offset += proto.EnumMarshal(1, buf[offset:], int32(x.HealthStatus)) - return buf -} - -// StableSize returns the size of x in protobuf format. -// -// Structures with the same field values have the same binary size. -func (x *HealthCheckResponse) StableSize() (size int) { - if x == nil { - return 0 - } - size += proto.NestedStructureSize(1, x.Body) - size += proto.NestedStructureSize(2, x.Signature) - return size -} - -// StableMarshal marshals x in protobuf binary format with stable field order. -// -// If buffer length is less than x.StableSize(), new buffer is allocated. -// -// Returns any error encountered which did not allow writing the data completely. -// Otherwise, returns the buffer in which the data is written. -// -// Structures with the same field values have the same binary format. -func (x *HealthCheckResponse) StableMarshal(buf []byte) []byte { - if x == nil { - return []byte{} - } - if buf == nil { - buf = make([]byte, x.StableSize()) - } - var offset int - offset += proto.NestedStructureMarshal(1, buf[offset:], x.Body) - offset += proto.NestedStructureMarshal(2, buf[offset:], x.Signature) - return buf -} - -// ReadSignedData fills buf with signed data of x. -// If buffer length is less than x.SignedDataSize(), new buffer is allocated. -// -// Returns any error encountered which did not allow writing the data completely. -// Otherwise, returns the buffer in which the data is written. -// -// Structures with the same field values have the same signed data. -func (x *HealthCheckResponse) SignedDataSize() int { - return x.GetBody().StableSize() -} - -// SignedDataSize returns size of the request signed data in bytes. -// -// Structures with the same field values have the same signed data size. -func (x *HealthCheckResponse) ReadSignedData(buf []byte) ([]byte, error) { - return x.GetBody().StableMarshal(buf), nil -} - -func (x *HealthCheckResponse) SetSignature(sig *Signature) { - x.Signature = sig -} - -// StableSize returns the size of x in protobuf format. -// -// Structures with the same field values have the same binary size. -func (x *PutPoliciesRequest_ChainData) StableSize() (size int) { - if x == nil { - return 0 - } - size += proto.EnumSize(1, int32(x.Target)) - size += proto.StringSize(2, x.Name) - size += proto.BytesSize(3, x.Chain) - return size -} - -// StableMarshal marshals x in protobuf binary format with stable field order. -// -// If buffer length is less than x.StableSize(), new buffer is allocated. -// -// Returns any error encountered which did not allow writing the data completely. -// Otherwise, returns the buffer in which the data is written. -// -// Structures with the same field values have the same binary format. -func (x *PutPoliciesRequest_ChainData) StableMarshal(buf []byte) []byte { - if x == nil { - return []byte{} - } - if buf == nil { - buf = make([]byte, x.StableSize()) - } - var offset int - offset += proto.EnumMarshal(1, buf[offset:], int32(x.Target)) - offset += proto.StringMarshal(2, buf[offset:], x.Name) - offset += proto.BytesMarshal(3, buf[offset:], x.Chain) - return buf -} - -// StableSize returns the size of x in protobuf format. -// -// Structures with the same field values have the same binary size. -func (x *PutPoliciesRequest_Body) StableSize() (size int) { - if x == nil { - return 0 - } - for i := range x.ChainDatas { - size += proto.NestedStructureSize(1, x.ChainDatas[i]) - } - return size -} - -// StableMarshal marshals x in protobuf binary format with stable field order. -// -// If buffer length is less than x.StableSize(), new buffer is allocated. -// -// Returns any error encountered which did not allow writing the data completely. -// Otherwise, returns the buffer in which the data is written. -// -// Structures with the same field values have the same binary format. -func (x *PutPoliciesRequest_Body) StableMarshal(buf []byte) []byte { - if x == nil { - return []byte{} - } - if buf == nil { - buf = make([]byte, x.StableSize()) - } - var offset int - for i := range x.ChainDatas { - offset += proto.NestedStructureMarshal(1, buf[offset:], x.ChainDatas[i]) - } - return buf -} - -// StableSize returns the size of x in protobuf format. -// -// Structures with the same field values have the same binary size. -func (x *PutPoliciesRequest) StableSize() (size int) { - if x == nil { - return 0 - } - size += proto.NestedStructureSize(1, x.Body) - size += proto.NestedStructureSize(2, x.Signature) - return size -} - -// StableMarshal marshals x in protobuf binary format with stable field order. -// -// If buffer length is less than x.StableSize(), new buffer is allocated. -// -// Returns any error encountered which did not allow writing the data completely. -// Otherwise, returns the buffer in which the data is written. -// -// Structures with the same field values have the same binary format. -func (x *PutPoliciesRequest) StableMarshal(buf []byte) []byte { - if x == nil { - return []byte{} - } - if buf == nil { - buf = make([]byte, x.StableSize()) - } - var offset int - offset += proto.NestedStructureMarshal(1, buf[offset:], x.Body) - offset += proto.NestedStructureMarshal(2, buf[offset:], x.Signature) - return buf -} - -// ReadSignedData fills buf with signed data of x. -// If buffer length is less than x.SignedDataSize(), new buffer is allocated. -// -// Returns any error encountered which did not allow writing the data completely. -// Otherwise, returns the buffer in which the data is written. -// -// Structures with the same field values have the same signed data. -func (x *PutPoliciesRequest) SignedDataSize() int { - return x.GetBody().StableSize() -} - -// SignedDataSize returns size of the request signed data in bytes. -// -// Structures with the same field values have the same signed data size. -func (x *PutPoliciesRequest) ReadSignedData(buf []byte) ([]byte, error) { - return x.GetBody().StableMarshal(buf), nil -} - -func (x *PutPoliciesRequest) SetSignature(sig *Signature) { - x.Signature = sig -} - -// StableSize returns the size of x in protobuf format. -// -// Structures with the same field values have the same binary size. -func (x *PutPoliciesResponse_Body) StableSize() (size int) { - if x == nil { - return 0 - } - return size -} - -// StableMarshal marshals x in protobuf binary format with stable field order. -// -// If buffer length is less than x.StableSize(), new buffer is allocated. -// -// Returns any error encountered which did not allow writing the data completely. -// Otherwise, returns the buffer in which the data is written. -// -// Structures with the same field values have the same binary format. -func (x *PutPoliciesResponse_Body) StableMarshal(buf []byte) []byte { - return buf -} - -// StableSize returns the size of x in protobuf format. -// -// Structures with the same field values have the same binary size. -func (x *PutPoliciesResponse) StableSize() (size int) { - if x == nil { - return 0 - } - size += proto.NestedStructureSize(1, x.Body) - size += proto.NestedStructureSize(2, x.Signature) - return size -} - -// StableMarshal marshals x in protobuf binary format with stable field order. -// -// If buffer length is less than x.StableSize(), new buffer is allocated. -// -// Returns any error encountered which did not allow writing the data completely. -// Otherwise, returns the buffer in which the data is written. -// -// Structures with the same field values have the same binary format. -func (x *PutPoliciesResponse) StableMarshal(buf []byte) []byte { - if x == nil { - return []byte{} - } - if buf == nil { - buf = make([]byte, x.StableSize()) - } - var offset int - offset += proto.NestedStructureMarshal(1, buf[offset:], x.Body) - offset += proto.NestedStructureMarshal(2, buf[offset:], x.Signature) - return buf -} - -// ReadSignedData fills buf with signed data of x. -// If buffer length is less than x.SignedDataSize(), new buffer is allocated. -// -// Returns any error encountered which did not allow writing the data completely. -// Otherwise, returns the buffer in which the data is written. -// -// Structures with the same field values have the same signed data. -func (x *PutPoliciesResponse) SignedDataSize() int { - return x.GetBody().StableSize() -} - -// SignedDataSize returns size of the request signed data in bytes. -// -// Structures with the same field values have the same signed data size. -func (x *PutPoliciesResponse) ReadSignedData(buf []byte) ([]byte, error) { - return x.GetBody().StableMarshal(buf), nil -} - -func (x *PutPoliciesResponse) SetSignature(sig *Signature) { - x.Signature = sig -} - -// StableSize returns the size of x in protobuf format. -// -// Structures with the same field values have the same binary size. -func (x *RemovePoliciesRequest_ChainInfo) StableSize() (size int) { - if x == nil { - return 0 - } - size += proto.EnumSize(1, int32(x.Target)) - size += proto.StringSize(2, x.Name) - size += proto.BytesSize(3, x.ChainID) - return size -} - -// StableMarshal marshals x in protobuf binary format with stable field order. -// -// If buffer length is less than x.StableSize(), new buffer is allocated. -// -// Returns any error encountered which did not allow writing the data completely. -// Otherwise, returns the buffer in which the data is written. -// -// Structures with the same field values have the same binary format. -func (x *RemovePoliciesRequest_ChainInfo) StableMarshal(buf []byte) []byte { - if x == nil { - return []byte{} - } - if buf == nil { - buf = make([]byte, x.StableSize()) - } - var offset int - offset += proto.EnumMarshal(1, buf[offset:], int32(x.Target)) - offset += proto.StringMarshal(2, buf[offset:], x.Name) - offset += proto.BytesMarshal(3, buf[offset:], x.ChainID) - return buf -} - -// StableSize returns the size of x in protobuf format. -// -// Structures with the same field values have the same binary size. -func (x *RemovePoliciesRequest_Body) StableSize() (size int) { - if x == nil { - return 0 - } - for i := range x.ChainInfos { - size += proto.NestedStructureSize(1, x.ChainInfos[i]) - } - return size -} - -// StableMarshal marshals x in protobuf binary format with stable field order. -// -// If buffer length is less than x.StableSize(), new buffer is allocated. -// -// Returns any error encountered which did not allow writing the data completely. -// Otherwise, returns the buffer in which the data is written. -// -// Structures with the same field values have the same binary format. -func (x *RemovePoliciesRequest_Body) StableMarshal(buf []byte) []byte { - if x == nil { - return []byte{} - } - if buf == nil { - buf = make([]byte, x.StableSize()) - } - var offset int - for i := range x.ChainInfos { - offset += proto.NestedStructureMarshal(1, buf[offset:], x.ChainInfos[i]) - } - return buf -} - -// StableSize returns the size of x in protobuf format. -// -// Structures with the same field values have the same binary size. -func (x *RemovePoliciesRequest) StableSize() (size int) { - if x == nil { - return 0 - } - size += proto.NestedStructureSize(1, x.Body) - size += proto.NestedStructureSize(2, x.Signature) - return size -} - -// StableMarshal marshals x in protobuf binary format with stable field order. -// -// If buffer length is less than x.StableSize(), new buffer is allocated. -// -// Returns any error encountered which did not allow writing the data completely. -// Otherwise, returns the buffer in which the data is written. -// -// Structures with the same field values have the same binary format. -func (x *RemovePoliciesRequest) StableMarshal(buf []byte) []byte { - if x == nil { - return []byte{} - } - if buf == nil { - buf = make([]byte, x.StableSize()) - } - var offset int - offset += proto.NestedStructureMarshal(1, buf[offset:], x.Body) - offset += proto.NestedStructureMarshal(2, buf[offset:], x.Signature) - return buf -} - -// ReadSignedData fills buf with signed data of x. -// If buffer length is less than x.SignedDataSize(), new buffer is allocated. -// -// Returns any error encountered which did not allow writing the data completely. -// Otherwise, returns the buffer in which the data is written. -// -// Structures with the same field values have the same signed data. -func (x *RemovePoliciesRequest) SignedDataSize() int { - return x.GetBody().StableSize() -} - -// SignedDataSize returns size of the request signed data in bytes. -// -// Structures with the same field values have the same signed data size. -func (x *RemovePoliciesRequest) ReadSignedData(buf []byte) ([]byte, error) { - return x.GetBody().StableMarshal(buf), nil -} - -func (x *RemovePoliciesRequest) SetSignature(sig *Signature) { - x.Signature = sig -} - -// StableSize returns the size of x in protobuf format. -// -// Structures with the same field values have the same binary size. -func (x *RemovePoliciesResponse_Body) StableSize() (size int) { - if x == nil { - return 0 - } - return size -} - -// StableMarshal marshals x in protobuf binary format with stable field order. -// -// If buffer length is less than x.StableSize(), new buffer is allocated. -// -// Returns any error encountered which did not allow writing the data completely. -// Otherwise, returns the buffer in which the data is written. -// -// Structures with the same field values have the same binary format. -func (x *RemovePoliciesResponse_Body) StableMarshal(buf []byte) []byte { - return buf -} - -// StableSize returns the size of x in protobuf format. -// -// Structures with the same field values have the same binary size. -func (x *RemovePoliciesResponse) StableSize() (size int) { - if x == nil { - return 0 - } - size += proto.NestedStructureSize(1, x.Body) - size += proto.NestedStructureSize(2, x.Signature) - return size -} - -// StableMarshal marshals x in protobuf binary format with stable field order. -// -// If buffer length is less than x.StableSize(), new buffer is allocated. -// -// Returns any error encountered which did not allow writing the data completely. -// Otherwise, returns the buffer in which the data is written. -// -// Structures with the same field values have the same binary format. -func (x *RemovePoliciesResponse) StableMarshal(buf []byte) []byte { - if x == nil { - return []byte{} - } - if buf == nil { - buf = make([]byte, x.StableSize()) - } - var offset int - offset += proto.NestedStructureMarshal(1, buf[offset:], x.Body) - offset += proto.NestedStructureMarshal(2, buf[offset:], x.Signature) - return buf -} - -// ReadSignedData fills buf with signed data of x. -// If buffer length is less than x.SignedDataSize(), new buffer is allocated. -// -// Returns any error encountered which did not allow writing the data completely. -// Otherwise, returns the buffer in which the data is written. -// -// Structures with the same field values have the same signed data. -func (x *RemovePoliciesResponse) SignedDataSize() int { - return x.GetBody().StableSize() -} - -// SignedDataSize returns size of the request signed data in bytes. -// -// Structures with the same field values have the same signed data size. -func (x *RemovePoliciesResponse) ReadSignedData(buf []byte) ([]byte, error) { - return x.GetBody().StableMarshal(buf), nil -} - -func (x *RemovePoliciesResponse) SetSignature(sig *Signature) { - x.Signature = sig -} - -// StableSize returns the size of x in protobuf format. -// -// Structures with the same field values have the same binary size. -func (x *GetPolicyRequest_Body) StableSize() (size int) { - if x == nil { - return 0 - } - size += proto.EnumSize(1, int32(x.Target)) - size += proto.StringSize(2, x.Name) - size += proto.BytesSize(3, x.ChainID) - return size -} - -// StableMarshal marshals x in protobuf binary format with stable field order. -// -// If buffer length is less than x.StableSize(), new buffer is allocated. -// -// Returns any error encountered which did not allow writing the data completely. -// Otherwise, returns the buffer in which the data is written. -// -// Structures with the same field values have the same binary format. -func (x *GetPolicyRequest_Body) StableMarshal(buf []byte) []byte { - if x == nil { - return []byte{} - } - if buf == nil { - buf = make([]byte, x.StableSize()) - } - var offset int - offset += proto.EnumMarshal(1, buf[offset:], int32(x.Target)) - offset += proto.StringMarshal(2, buf[offset:], x.Name) - offset += proto.BytesMarshal(3, buf[offset:], x.ChainID) - return buf -} - -// StableSize returns the size of x in protobuf format. -// -// Structures with the same field values have the same binary size. -func (x *GetPolicyRequest) StableSize() (size int) { - if x == nil { - return 0 - } - size += proto.NestedStructureSize(1, x.Body) - size += proto.NestedStructureSize(2, x.Signature) - return size -} - -// StableMarshal marshals x in protobuf binary format with stable field order. -// -// If buffer length is less than x.StableSize(), new buffer is allocated. -// -// Returns any error encountered which did not allow writing the data completely. -// Otherwise, returns the buffer in which the data is written. -// -// Structures with the same field values have the same binary format. -func (x *GetPolicyRequest) StableMarshal(buf []byte) []byte { - if x == nil { - return []byte{} - } - if buf == nil { - buf = make([]byte, x.StableSize()) - } - var offset int - offset += proto.NestedStructureMarshal(1, buf[offset:], x.Body) - offset += proto.NestedStructureMarshal(2, buf[offset:], x.Signature) - return buf -} - -// ReadSignedData fills buf with signed data of x. -// If buffer length is less than x.SignedDataSize(), new buffer is allocated. -// -// Returns any error encountered which did not allow writing the data completely. -// Otherwise, returns the buffer in which the data is written. -// -// Structures with the same field values have the same signed data. -func (x *GetPolicyRequest) SignedDataSize() int { - return x.GetBody().StableSize() -} - -// SignedDataSize returns size of the request signed data in bytes. -// -// Structures with the same field values have the same signed data size. -func (x *GetPolicyRequest) ReadSignedData(buf []byte) ([]byte, error) { - return x.GetBody().StableMarshal(buf), nil -} - -func (x *GetPolicyRequest) SetSignature(sig *Signature) { - x.Signature = sig -} - -// StableSize returns the size of x in protobuf format. -// -// Structures with the same field values have the same binary size. -func (x *GetPolicyResponse_Body) StableSize() (size int) { - if x == nil { - return 0 - } - size += proto.BytesSize(1, x.Chain) - return size -} - -// StableMarshal marshals x in protobuf binary format with stable field order. -// -// If buffer length is less than x.StableSize(), new buffer is allocated. -// -// Returns any error encountered which did not allow writing the data completely. -// Otherwise, returns the buffer in which the data is written. -// -// Structures with the same field values have the same binary format. -func (x *GetPolicyResponse_Body) StableMarshal(buf []byte) []byte { - if x == nil { - return []byte{} - } - if buf == nil { - buf = make([]byte, x.StableSize()) - } - var offset int - offset += proto.BytesMarshal(1, buf[offset:], x.Chain) - return buf -} - -// StableSize returns the size of x in protobuf format. -// -// Structures with the same field values have the same binary size. -func (x *GetPolicyResponse) StableSize() (size int) { - if x == nil { - return 0 - } - size += proto.NestedStructureSize(1, x.Body) - size += proto.NestedStructureSize(2, x.Signature) - return size -} - -// StableMarshal marshals x in protobuf binary format with stable field order. -// -// If buffer length is less than x.StableSize(), new buffer is allocated. -// -// Returns any error encountered which did not allow writing the data completely. -// Otherwise, returns the buffer in which the data is written. -// -// Structures with the same field values have the same binary format. -func (x *GetPolicyResponse) StableMarshal(buf []byte) []byte { - if x == nil { - return []byte{} - } - if buf == nil { - buf = make([]byte, x.StableSize()) - } - var offset int - offset += proto.NestedStructureMarshal(1, buf[offset:], x.Body) - offset += proto.NestedStructureMarshal(2, buf[offset:], x.Signature) - return buf -} - -// ReadSignedData fills buf with signed data of x. -// If buffer length is less than x.SignedDataSize(), new buffer is allocated. -// -// Returns any error encountered which did not allow writing the data completely. -// Otherwise, returns the buffer in which the data is written. -// -// Structures with the same field values have the same signed data. -func (x *GetPolicyResponse) SignedDataSize() int { - return x.GetBody().StableSize() -} - -// SignedDataSize returns size of the request signed data in bytes. -// -// Structures with the same field values have the same signed data size. -func (x *GetPolicyResponse) ReadSignedData(buf []byte) ([]byte, error) { - return x.GetBody().StableMarshal(buf), nil -} - -func (x *GetPolicyResponse) SetSignature(sig *Signature) { - x.Signature = sig -} - -// StableSize returns the size of x in protobuf format. -// -// Structures with the same field values have the same binary size. -func (x *ListPoliciesRequest_Body) StableSize() (size int) { - if x == nil { - return 0 - } - size += proto.EnumSize(1, int32(x.Target)) - size += proto.StringSize(2, x.Name) - return size -} - -// StableMarshal marshals x in protobuf binary format with stable field order. -// -// If buffer length is less than x.StableSize(), new buffer is allocated. -// -// Returns any error encountered which did not allow writing the data completely. -// Otherwise, returns the buffer in which the data is written. -// -// Structures with the same field values have the same binary format. -func (x *ListPoliciesRequest_Body) StableMarshal(buf []byte) []byte { - if x == nil { - return []byte{} - } - if buf == nil { - buf = make([]byte, x.StableSize()) - } - var offset int - offset += proto.EnumMarshal(1, buf[offset:], int32(x.Target)) - offset += proto.StringMarshal(2, buf[offset:], x.Name) - return buf -} - -// StableSize returns the size of x in protobuf format. -// -// Structures with the same field values have the same binary size. -func (x *ListPoliciesRequest) StableSize() (size int) { - if x == nil { - return 0 - } - size += proto.NestedStructureSize(1, x.Body) - size += proto.NestedStructureSize(2, x.Signature) - return size -} - -// StableMarshal marshals x in protobuf binary format with stable field order. -// -// If buffer length is less than x.StableSize(), new buffer is allocated. -// -// Returns any error encountered which did not allow writing the data completely. -// Otherwise, returns the buffer in which the data is written. -// -// Structures with the same field values have the same binary format. -func (x *ListPoliciesRequest) StableMarshal(buf []byte) []byte { - if x == nil { - return []byte{} - } - if buf == nil { - buf = make([]byte, x.StableSize()) - } - var offset int - offset += proto.NestedStructureMarshal(1, buf[offset:], x.Body) - offset += proto.NestedStructureMarshal(2, buf[offset:], x.Signature) - return buf -} - -// ReadSignedData fills buf with signed data of x. -// If buffer length is less than x.SignedDataSize(), new buffer is allocated. -// -// Returns any error encountered which did not allow writing the data completely. -// Otherwise, returns the buffer in which the data is written. -// -// Structures with the same field values have the same signed data. -func (x *ListPoliciesRequest) SignedDataSize() int { - return x.GetBody().StableSize() -} - -// SignedDataSize returns size of the request signed data in bytes. -// -// Structures with the same field values have the same signed data size. -func (x *ListPoliciesRequest) ReadSignedData(buf []byte) ([]byte, error) { - return x.GetBody().StableMarshal(buf), nil -} - -func (x *ListPoliciesRequest) SetSignature(sig *Signature) { - x.Signature = sig -} - -// StableSize returns the size of x in protobuf format. -// -// Structures with the same field values have the same binary size. -func (x *ListPoliciesResponse_Body) StableSize() (size int) { - if x == nil { - return 0 - } - size += proto.RepeatedBytesSize(1, x.ChainIDs) - return size -} - -// StableMarshal marshals x in protobuf binary format with stable field order. -// -// If buffer length is less than x.StableSize(), new buffer is allocated. -// -// Returns any error encountered which did not allow writing the data completely. -// Otherwise, returns the buffer in which the data is written. -// -// Structures with the same field values have the same binary format. -func (x *ListPoliciesResponse_Body) StableMarshal(buf []byte) []byte { - if x == nil { - return []byte{} - } - if buf == nil { - buf = make([]byte, x.StableSize()) - } - var offset int - offset += proto.RepeatedBytesMarshal(1, buf[offset:], x.ChainIDs) - return buf -} - -// StableSize returns the size of x in protobuf format. -// -// Structures with the same field values have the same binary size. -func (x *ListPoliciesResponse) StableSize() (size int) { - if x == nil { - return 0 - } - size += proto.NestedStructureSize(1, x.Body) - size += proto.NestedStructureSize(2, x.Signature) - return size -} - -// StableMarshal marshals x in protobuf binary format with stable field order. -// -// If buffer length is less than x.StableSize(), new buffer is allocated. -// -// Returns any error encountered which did not allow writing the data completely. -// Otherwise, returns the buffer in which the data is written. -// -// Structures with the same field values have the same binary format. -func (x *ListPoliciesResponse) StableMarshal(buf []byte) []byte { - if x == nil { - return []byte{} - } - if buf == nil { - buf = make([]byte, x.StableSize()) - } - var offset int - offset += proto.NestedStructureMarshal(1, buf[offset:], x.Body) - offset += proto.NestedStructureMarshal(2, buf[offset:], x.Signature) - return buf -} - -// ReadSignedData fills buf with signed data of x. -// If buffer length is less than x.SignedDataSize(), new buffer is allocated. -// -// Returns any error encountered which did not allow writing the data completely. -// Otherwise, returns the buffer in which the data is written. -// -// Structures with the same field values have the same signed data. -func (x *ListPoliciesResponse) SignedDataSize() int { - return x.GetBody().StableSize() -} - -// SignedDataSize returns size of the request signed data in bytes. -// -// Structures with the same field values have the same signed data size. -func (x *ListPoliciesResponse) ReadSignedData(buf []byte) ([]byte, error) { - return x.GetBody().StableMarshal(buf), nil -} - -func (x *ListPoliciesResponse) SetSignature(sig *Signature) { - x.Signature = sig -} diff --git a/pkg/service/control/service_grpc.pb.go b/pkg/service/control/service_grpc.pb.go deleted file mode 100644 index 17efe12..0000000 --- a/pkg/service/control/service_grpc.pb.go +++ /dev/null @@ -1,249 +0,0 @@ -// Code generated by protoc-gen-go-grpc. DO NOT EDIT. -// versions: -// - protoc-gen-go-grpc v1.2.0 -// - protoc v3.21.12 -// source: pkg/service/control/service.proto - -package control - -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 - -// ControlServiceClient is the client API for ControlService 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 ControlServiceClient interface { - // Performs health check of the storage node. - HealthCheck(ctx context.Context, in *HealthCheckRequest, opts ...grpc.CallOption) (*HealthCheckResponse, error) - PutPolicies(ctx context.Context, in *PutPoliciesRequest, opts ...grpc.CallOption) (*PutPoliciesResponse, error) - RemovePolicies(ctx context.Context, in *RemovePoliciesRequest, opts ...grpc.CallOption) (*RemovePoliciesResponse, error) - GetPolicy(ctx context.Context, in *GetPolicyRequest, opts ...grpc.CallOption) (*GetPolicyResponse, error) - ListPolicies(ctx context.Context, in *ListPoliciesRequest, opts ...grpc.CallOption) (*ListPoliciesResponse, error) -} - -type controlServiceClient struct { - cc grpc.ClientConnInterface -} - -func NewControlServiceClient(cc grpc.ClientConnInterface) ControlServiceClient { - return &controlServiceClient{cc} -} - -func (c *controlServiceClient) HealthCheck(ctx context.Context, in *HealthCheckRequest, opts ...grpc.CallOption) (*HealthCheckResponse, error) { - out := new(HealthCheckResponse) - err := c.cc.Invoke(ctx, "/s3gw.control.ControlService/HealthCheck", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *controlServiceClient) PutPolicies(ctx context.Context, in *PutPoliciesRequest, opts ...grpc.CallOption) (*PutPoliciesResponse, error) { - out := new(PutPoliciesResponse) - err := c.cc.Invoke(ctx, "/s3gw.control.ControlService/PutPolicies", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *controlServiceClient) RemovePolicies(ctx context.Context, in *RemovePoliciesRequest, opts ...grpc.CallOption) (*RemovePoliciesResponse, error) { - out := new(RemovePoliciesResponse) - err := c.cc.Invoke(ctx, "/s3gw.control.ControlService/RemovePolicies", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *controlServiceClient) GetPolicy(ctx context.Context, in *GetPolicyRequest, opts ...grpc.CallOption) (*GetPolicyResponse, error) { - out := new(GetPolicyResponse) - err := c.cc.Invoke(ctx, "/s3gw.control.ControlService/GetPolicy", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *controlServiceClient) ListPolicies(ctx context.Context, in *ListPoliciesRequest, opts ...grpc.CallOption) (*ListPoliciesResponse, error) { - out := new(ListPoliciesResponse) - err := c.cc.Invoke(ctx, "/s3gw.control.ControlService/ListPolicies", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -// ControlServiceServer is the server API for ControlService service. -// All implementations should embed UnimplementedControlServiceServer -// for forward compatibility -type ControlServiceServer interface { - // Performs health check of the storage node. - HealthCheck(context.Context, *HealthCheckRequest) (*HealthCheckResponse, error) - PutPolicies(context.Context, *PutPoliciesRequest) (*PutPoliciesResponse, error) - RemovePolicies(context.Context, *RemovePoliciesRequest) (*RemovePoliciesResponse, error) - GetPolicy(context.Context, *GetPolicyRequest) (*GetPolicyResponse, error) - ListPolicies(context.Context, *ListPoliciesRequest) (*ListPoliciesResponse, error) -} - -// UnimplementedControlServiceServer should be embedded to have forward compatible implementations. -type UnimplementedControlServiceServer struct { -} - -func (UnimplementedControlServiceServer) HealthCheck(context.Context, *HealthCheckRequest) (*HealthCheckResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method HealthCheck not implemented") -} -func (UnimplementedControlServiceServer) PutPolicies(context.Context, *PutPoliciesRequest) (*PutPoliciesResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method PutPolicies not implemented") -} -func (UnimplementedControlServiceServer) RemovePolicies(context.Context, *RemovePoliciesRequest) (*RemovePoliciesResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method RemovePolicies not implemented") -} -func (UnimplementedControlServiceServer) GetPolicy(context.Context, *GetPolicyRequest) (*GetPolicyResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method GetPolicy not implemented") -} -func (UnimplementedControlServiceServer) ListPolicies(context.Context, *ListPoliciesRequest) (*ListPoliciesResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method ListPolicies not implemented") -} - -// UnsafeControlServiceServer may be embedded to opt out of forward compatibility for this service. -// Use of this interface is not recommended, as added methods to ControlServiceServer will -// result in compilation errors. -type UnsafeControlServiceServer interface { - mustEmbedUnimplementedControlServiceServer() -} - -func RegisterControlServiceServer(s grpc.ServiceRegistrar, srv ControlServiceServer) { - s.RegisterService(&ControlService_ServiceDesc, srv) -} - -func _ControlService_HealthCheck_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(HealthCheckRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(ControlServiceServer).HealthCheck(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/s3gw.control.ControlService/HealthCheck", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(ControlServiceServer).HealthCheck(ctx, req.(*HealthCheckRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _ControlService_PutPolicies_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(PutPoliciesRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(ControlServiceServer).PutPolicies(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/s3gw.control.ControlService/PutPolicies", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(ControlServiceServer).PutPolicies(ctx, req.(*PutPoliciesRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _ControlService_RemovePolicies_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(RemovePoliciesRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(ControlServiceServer).RemovePolicies(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/s3gw.control.ControlService/RemovePolicies", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(ControlServiceServer).RemovePolicies(ctx, req.(*RemovePoliciesRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _ControlService_GetPolicy_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(GetPolicyRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(ControlServiceServer).GetPolicy(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/s3gw.control.ControlService/GetPolicy", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(ControlServiceServer).GetPolicy(ctx, req.(*GetPolicyRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _ControlService_ListPolicies_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(ListPoliciesRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(ControlServiceServer).ListPolicies(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/s3gw.control.ControlService/ListPolicies", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(ControlServiceServer).ListPolicies(ctx, req.(*ListPoliciesRequest)) - } - return interceptor(ctx, in, info, handler) -} - -// ControlService_ServiceDesc is the grpc.ServiceDesc for ControlService service. -// It's only intended for direct use with grpc.RegisterService, -// and not to be introspected or modified (even as a copy) -var ControlService_ServiceDesc = grpc.ServiceDesc{ - ServiceName: "s3gw.control.ControlService", - HandlerType: (*ControlServiceServer)(nil), - Methods: []grpc.MethodDesc{ - { - MethodName: "HealthCheck", - Handler: _ControlService_HealthCheck_Handler, - }, - { - MethodName: "PutPolicies", - Handler: _ControlService_PutPolicies_Handler, - }, - { - MethodName: "RemovePolicies", - Handler: _ControlService_RemovePolicies_Handler, - }, - { - MethodName: "GetPolicy", - Handler: _ControlService_GetPolicy_Handler, - }, - { - MethodName: "ListPolicies", - Handler: _ControlService_ListPolicies_Handler, - }, - }, - Streams: []grpc.StreamDesc{}, - Metadata: "pkg/service/control/service.proto", -} -- 2.45.2