From c24b74384b61565bf5ed0f1dd914acdc3cf9c66b Mon Sep 17 00:00:00 2001 From: Renuka Fernando Date: Tue, 11 Oct 2022 08:33:59 +0530 Subject: [PATCH 01/22] Move runtime file watcher from server to file provider Signed-off-by: Renuka Fernando --- src/config/file_provider.go | 113 +++++++++++++++++++++++++++++++ src/config/provider.go | 10 +++ src/server/server.go | 5 ++ src/server/server_impl.go | 4 ++ src/service/ratelimit.go | 62 ++++++++--------- src/service_cmd/runner/runner.go | 1 + 6 files changed, 164 insertions(+), 31 deletions(-) create mode 100644 src/config/file_provider.go create mode 100644 src/config/provider.go diff --git a/src/config/file_provider.go b/src/config/file_provider.go new file mode 100644 index 000000000..7c59f93a8 --- /dev/null +++ b/src/config/file_provider.go @@ -0,0 +1,113 @@ +package config + +import ( + "path/filepath" + "strings" + + "github.com/envoyproxy/ratelimit/src/settings" + "github.com/envoyproxy/ratelimit/src/stats" + "github.com/lyft/goruntime/loader" + gostats "github.com/lyft/gostats" + logger "github.com/sirupsen/logrus" +) + +type FileProvider struct { + settings settings.Settings + loader RateLimitConfigLoader + configUpdateEventChan chan *ConfigUpdateEvent + runtime loader.IFace + runtimeUpdateEvent chan int + runtimeWatchRoot bool + rootStore gostats.Store + statsManager stats.Manager +} + +func (p *FileProvider) ConfigUpdateEvent() <-chan *ConfigUpdateEvent { + return p.configUpdateEventChan +} + +func (p *FileProvider) watch() { + p.runtime.AddUpdateCallback(p.runtimeUpdateEvent) + + go func() { + p.sendEvent() + // No exit right now. + for { + logger.Debugf("waiting for runtime update") + <-p.runtimeUpdateEvent + logger.Debugf("got runtime update and reloading config") + p.sendEvent() + } + }() +} + +func (p *FileProvider) sendEvent() { + defer func() { + if e := recover(); e != nil { + p.configUpdateEventChan <- &ConfigUpdateEvent{Err: e} + } + }() + + files := []RateLimitConfigToLoad{} + snapshot := p.runtime.Snapshot() + for _, key := range snapshot.Keys() { + if p.runtimeWatchRoot && !strings.HasPrefix(key, "config.") { + continue + } + + files = append(files, RateLimitConfigToLoad{key, snapshot.Get(key)}) + } + + rlSettings := settings.NewSettings() + newConfig := p.loader.Load(files, p.statsManager, rlSettings.MergeDomainConfigurations) + + p.configUpdateEventChan <- &ConfigUpdateEvent{Config: newConfig} +} + +func (p *FileProvider) setupRuntime() { + loaderOpts := make([]loader.Option, 0, 1) + if p.settings.RuntimeIgnoreDotFiles { + loaderOpts = append(loaderOpts, loader.IgnoreDotFiles) + } else { + loaderOpts = append(loaderOpts, loader.AllowDotFiles) + } + var err error + if p.settings.RuntimeWatchRoot { + p.runtime, err = loader.New2( + p.settings.RuntimePath, + p.settings.RuntimeSubdirectory, + p.rootStore.ScopeWithTags("runtime", p.settings.ExtraTags), + &loader.SymlinkRefresher{RuntimePath: p.settings.RuntimePath}, + loaderOpts...) + } else { + directoryRefresher := &loader.DirectoryRefresher{} + // Adding loader.Remove to the default set of goruntime's FileSystemOps. + directoryRefresher.WatchFileSystemOps(loader.Remove, loader.Write, loader.Create, loader.Chmod) + + p.runtime, err = loader.New2( + filepath.Join(p.settings.RuntimePath, p.settings.RuntimeSubdirectory), + "config", + p.rootStore.ScopeWithTags("runtime", p.settings.ExtraTags), + directoryRefresher, + loaderOpts...) + } + + if err != nil { + panic(err) + } +} + +func NewFileProvider(settings settings.Settings, rootStore gostats.Store, statsManager stats.Manager) RateLimitConfigProvider { + p := &FileProvider{ + settings: settings, + loader: NewRateLimitConfigLoaderImpl(), + configUpdateEventChan: make(chan *ConfigUpdateEvent), + runtimeUpdateEvent: make(chan int), + runtimeWatchRoot: settings.RuntimeWatchRoot, + rootStore: rootStore, + statsManager: statsManager, + } + p.setupRuntime() + go p.watch() + return p +} diff --git a/src/config/provider.go b/src/config/provider.go new file mode 100644 index 000000000..c58a4e617 --- /dev/null +++ b/src/config/provider.go @@ -0,0 +1,10 @@ +package config + +type RateLimitConfigProvider interface { + ConfigUpdateEvent() <-chan *ConfigUpdateEvent +} + +type ConfigUpdateEvent struct { + Config RateLimitConfig + Err any +} diff --git a/src/server/server.go b/src/server/server.go index 46c8ea5d1..86ec9a981 100644 --- a/src/server/server.go +++ b/src/server/server.go @@ -18,6 +18,11 @@ type Server interface { */ Start() + /** + * Returns the root store of the stats tree for the server + */ + Store() stats.Store + /** * Returns the root of the stats tree for the server */ diff --git a/src/server/server_impl.go b/src/server/server_impl.go index d98fc5adc..dea35af95 100644 --- a/src/server/server_impl.go +++ b/src/server/server_impl.go @@ -180,6 +180,10 @@ func (server *server) startGrpc() { server.grpcServer.Serve(lis) } +func (server *server) Store() gostats.Store { + return server.store +} + func (server *server) Scope() gostats.Scope { return server.scope } diff --git a/src/service/ratelimit.go b/src/service/ratelimit.go index 621a83df3..dcc17b397 100644 --- a/src/service/ratelimit.go +++ b/src/service/ratelimit.go @@ -38,6 +38,7 @@ type RateLimitServiceServer interface { type service struct { runtime loader.IFace configLock sync.RWMutex + configUpdateEvent <-chan *config.ConfigUpdateEvent configLoader config.RateLimitConfigLoader config config.RateLimitConfig runtimeUpdateEvent chan int @@ -52,35 +53,24 @@ type service struct { globalShadowMode bool } -func (this *service) reloadConfig(statsManager stats.Manager) { - defer func() { - if e := recover(); e != nil { - configError, ok := e.(config.RateLimitConfigError) - if !ok { - panic(e) - } - - this.stats.ConfigLoadError.Inc() - logger.Errorf("error loading new configuration from runtime: %s", configError.Error()) - } - }() - - files := []config.RateLimitConfigToLoad{} - snapshot := this.runtime.Snapshot() - for _, key := range snapshot.Keys() { - if this.runtimeWatchRoot && !strings.HasPrefix(key, "config.") { - continue +func (this *service) reloadConfig(updateEvent *config.ConfigUpdateEvent) { + if err := updateEvent.Err; err != nil { + configError, ok := err.(config.RateLimitConfigError) + if !ok { + panic(err) } - files = append(files, config.RateLimitConfigToLoad{key, snapshot.Get(key)}) + this.stats.ConfigLoadError.Inc() + logger.Errorf("error loading new configuration from runtime: %s", configError.Error()) + return } - rlSettings := settings.NewSettings() - newConfig := this.configLoader.Load(files, statsManager, rlSettings.MergeDomainConfigurations) this.stats.ConfigLoadSuccess.Inc() this.configLock.Lock() - this.config = newConfig + this.config = updateEvent.Config + + rlSettings := settings.NewSettings() this.globalShadowMode = rlSettings.GlobalShadowMode if rlSettings.RateLimitResponseHeadersEnabled { @@ -312,12 +302,13 @@ func (this *service) GetCurrentConfig() config.RateLimitConfig { return this.config } -func NewService(runtime loader.IFace, cache limiter.RateLimitCache, +func NewService(runtime loader.IFace, cache limiter.RateLimitCache, configProvider config.RateLimitConfigProvider, configLoader config.RateLimitConfigLoader, statsManager stats.Manager, runtimeWatchRoot bool, clock utils.TimeSource, shadowMode bool) RateLimitServiceServer { newService := &service{ runtime: runtime, configLock: sync.RWMutex{}, + configUpdateEvent: configProvider.ConfigUpdateEvent(), configLoader: configLoader, config: nil, runtimeUpdateEvent: make(chan int), @@ -328,18 +319,27 @@ func NewService(runtime loader.IFace, cache limiter.RateLimitCache, customHeaderClock: clock, } - runtime.AddUpdateCallback(newService.runtimeUpdateEvent) - - newService.reloadConfig(statsManager) go func() { - // No exit right now. for { - logger.Debugf("waiting for runtime update") - <-newService.runtimeUpdateEvent - logger.Debugf("got runtime update and reloading config") - newService.reloadConfig(statsManager) + logger.Debugf("waiting for config update") + updateEvent := <-newService.configUpdateEvent + logger.Debugf("got config update and reloading config") + newService.reloadConfig(updateEvent) } }() + // runtime.AddUpdateCallback(newService.runtimeUpdateEvent) + + // newService.reloadConfig(statsManager) + // go func() { + // // No exit right now. + // for { + // logger.Debugf("waiting for runtime update") + // <-newService.runtimeUpdateEvent + // logger.Debugf("got runtime update and reloading config") + // newService.reloadConfig(statsManager) + // } + // }() + return newService } diff --git a/src/service_cmd/runner/runner.go b/src/service_cmd/runner/runner.go index 74a8105e0..d48f7ff68 100644 --- a/src/service_cmd/runner/runner.go +++ b/src/service_cmd/runner/runner.go @@ -119,6 +119,7 @@ func (runner *Runner) Run() { service := ratelimit.NewService( srv.Runtime(), createLimiter(srv, s, localCache, runner.statsManager), + config.NewFileProvider(s, srv.Store(), runner.statsManager), config.NewRateLimitConfigLoaderImpl(), runner.statsManager, s.RuntimeWatchRoot, From 7aeb1e88969d5197fd7aee3e7eab10fa92b0a2de Mon Sep 17 00:00:00 2001 From: Renuka Fernando Date: Tue, 11 Oct 2022 23:06:38 +0530 Subject: [PATCH 02/22] Update unit tests of service Signed-off-by: Renuka Fernando --- examples/ratelimit/config/example.yaml | 18 +-- src/config/file_provider.go | 15 +-- src/config/provider.go | 16 ++- src/service/ratelimit.go | 9 +- test/mocks/config/config.go | 75 ++++++++++++ test/service/ratelimit_test.go | 152 +++++++++++++++++-------- 6 files changed, 211 insertions(+), 74 deletions(-) diff --git a/examples/ratelimit/config/example.yaml b/examples/ratelimit/config/example.yaml index 52cc8e422..d783fe989 100644 --- a/examples/ratelimit/config/example.yaml +++ b/examples/ratelimit/config/example.yaml @@ -1,14 +1,14 @@ --- -domain: rl +domain: foo descriptors: - - key: category - value: account - rate_limit: - replaces: - - name: bkthomps - - name: fake_name - unit: minute - requests_per_unit: 4 + - key: k1 + value: v1 + descriptors: + - key: k2 + value: v2 + rate_limit: + unit: minute + requests_per_unit: 4 - key: source_cluster value: proxy descriptors: diff --git a/src/config/file_provider.go b/src/config/file_provider.go index 7c59f93a8..31368e141 100644 --- a/src/config/file_provider.go +++ b/src/config/file_provider.go @@ -4,17 +4,18 @@ import ( "path/filepath" "strings" - "github.com/envoyproxy/ratelimit/src/settings" - "github.com/envoyproxy/ratelimit/src/stats" "github.com/lyft/goruntime/loader" gostats "github.com/lyft/gostats" logger "github.com/sirupsen/logrus" + + "github.com/envoyproxy/ratelimit/src/settings" + "github.com/envoyproxy/ratelimit/src/stats" ) type FileProvider struct { settings settings.Settings loader RateLimitConfigLoader - configUpdateEventChan chan *ConfigUpdateEvent + configUpdateEventChan chan ConfigUpdateEvent runtime loader.IFace runtimeUpdateEvent chan int runtimeWatchRoot bool @@ -22,7 +23,7 @@ type FileProvider struct { statsManager stats.Manager } -func (p *FileProvider) ConfigUpdateEvent() <-chan *ConfigUpdateEvent { +func (p *FileProvider) ConfigUpdateEvent() <-chan ConfigUpdateEvent { return p.configUpdateEventChan } @@ -44,7 +45,7 @@ func (p *FileProvider) watch() { func (p *FileProvider) sendEvent() { defer func() { if e := recover(); e != nil { - p.configUpdateEventChan <- &ConfigUpdateEvent{Err: e} + p.configUpdateEventChan <- &ConfigUpdateEventImpl{err: e} } }() @@ -61,7 +62,7 @@ func (p *FileProvider) sendEvent() { rlSettings := settings.NewSettings() newConfig := p.loader.Load(files, p.statsManager, rlSettings.MergeDomainConfigurations) - p.configUpdateEventChan <- &ConfigUpdateEvent{Config: newConfig} + p.configUpdateEventChan <- &ConfigUpdateEventImpl{config: newConfig} } func (p *FileProvider) setupRuntime() { @@ -101,7 +102,7 @@ func NewFileProvider(settings settings.Settings, rootStore gostats.Store, statsM p := &FileProvider{ settings: settings, loader: NewRateLimitConfigLoaderImpl(), - configUpdateEventChan: make(chan *ConfigUpdateEvent), + configUpdateEventChan: make(chan ConfigUpdateEvent), runtimeUpdateEvent: make(chan int), runtimeWatchRoot: settings.RuntimeWatchRoot, rootStore: rootStore, diff --git a/src/config/provider.go b/src/config/provider.go index c58a4e617..056490443 100644 --- a/src/config/provider.go +++ b/src/config/provider.go @@ -1,10 +1,18 @@ package config type RateLimitConfigProvider interface { - ConfigUpdateEvent() <-chan *ConfigUpdateEvent + ConfigUpdateEvent() <-chan ConfigUpdateEvent } -type ConfigUpdateEvent struct { - Config RateLimitConfig - Err any +type ConfigUpdateEvent interface { + GetConfig() (config RateLimitConfig, err any) +} + +type ConfigUpdateEventImpl struct { + config RateLimitConfig + err any +} + +func (e *ConfigUpdateEventImpl) GetConfig() (config RateLimitConfig, err any) { + return e.config, e.err } diff --git a/src/service/ratelimit.go b/src/service/ratelimit.go index dcc17b397..4c91c0e68 100644 --- a/src/service/ratelimit.go +++ b/src/service/ratelimit.go @@ -38,7 +38,7 @@ type RateLimitServiceServer interface { type service struct { runtime loader.IFace configLock sync.RWMutex - configUpdateEvent <-chan *config.ConfigUpdateEvent + configUpdateEvent <-chan config.ConfigUpdateEvent configLoader config.RateLimitConfigLoader config config.RateLimitConfig runtimeUpdateEvent chan int @@ -53,8 +53,9 @@ type service struct { globalShadowMode bool } -func (this *service) reloadConfig(updateEvent *config.ConfigUpdateEvent) { - if err := updateEvent.Err; err != nil { +func (this *service) reloadConfig(updateEvent config.ConfigUpdateEvent) { + newConfig, err := updateEvent.GetConfig() + if err != nil { configError, ok := err.(config.RateLimitConfigError) if !ok { panic(err) @@ -68,7 +69,7 @@ func (this *service) reloadConfig(updateEvent *config.ConfigUpdateEvent) { this.stats.ConfigLoadSuccess.Inc() this.configLock.Lock() - this.config = updateEvent.Config + this.config = newConfig rlSettings := settings.NewSettings() this.globalShadowMode = rlSettings.GlobalShadowMode diff --git a/test/mocks/config/config.go b/test/mocks/config/config.go index f5989eb78..fc55c5c98 100644 --- a/test/mocks/config/config.go +++ b/test/mocks/config/config.go @@ -102,3 +102,78 @@ func (mr *MockRateLimitConfigLoaderMockRecorder) Load(arg0, arg1, arg2 interface mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Load", reflect.TypeOf((*MockRateLimitConfigLoader)(nil).Load), arg0, arg1, arg2) } + +// MockRateLimitConfigProvider is a mock of RateLimitConfigProvider interface +type MockRateLimitConfigProvider struct { + ctrl *gomock.Controller + recorder *MockRateLimitConfigProviderMockRecorder +} + +// MockRateLimitConfigProviderMockRecorder is the mock recorder for MockRateLimitConfigProvider +type MockRateLimitConfigProviderMockRecorder struct { + mock *MockRateLimitConfigProvider +} + +// NewMockRateLimitConfigProvider creates a new mock instance +func NewMockRateLimitConfigProvider(ctrl *gomock.Controller) *MockRateLimitConfigProvider { + mock := &MockRateLimitConfigProvider{ctrl: ctrl} + mock.recorder = &MockRateLimitConfigProviderMockRecorder{mock} + return mock +} + +// EXPECT returns an object that allows the caller to indicate expected use +func (m *MockRateLimitConfigProvider) EXPECT() *MockRateLimitConfigProviderMockRecorder { + return m.recorder +} + +// ConfigUpdateEvent mocks base method +func (m *MockRateLimitConfigProvider) ConfigUpdateEvent() <-chan config.ConfigUpdateEvent { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "ConfigUpdateEvent") + ret0, _ := ret[0].(<-chan config.ConfigUpdateEvent) + return ret0 +} + +// ConfigUpdateEvent indicates an expected call of ConfigUpdateEvent +func (mr *MockRateLimitConfigProviderMockRecorder) ConfigUpdateEvent() *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ConfigUpdateEvent", reflect.TypeOf((*MockRateLimitConfigProvider)(nil).ConfigUpdateEvent)) +} + +// MockConfigUpdateEvent is a mock of ConfigUpdateEvent interface +type MockConfigUpdateEvent struct { + ctrl *gomock.Controller + recorder *MockConfigUpdateEventMockRecorder +} + +// MockConfigUpdateEventMockRecorder is the mock recorder for MockConfigUpdateEvent +type MockConfigUpdateEventMockRecorder struct { + mock *MockConfigUpdateEvent +} + +// NewMockConfigUpdateEvent creates a new mock instance +func NewMockConfigUpdateEvent(ctrl *gomock.Controller) *MockConfigUpdateEvent { + mock := &MockConfigUpdateEvent{ctrl: ctrl} + mock.recorder = &MockConfigUpdateEventMockRecorder{mock} + return mock +} + +// EXPECT returns an object that allows the caller to indicate expected use +func (m *MockConfigUpdateEvent) EXPECT() *MockConfigUpdateEventMockRecorder { + return m.recorder +} + +// GetConfig mocks base method +func (m *MockConfigUpdateEvent) GetConfig() (config.RateLimitConfig, any) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "GetConfig") + ret0, _ := ret[0].(config.RateLimitConfig) + ret1, _ := ret[1].(any) + return ret0, ret1 +} + +// GetConfig indicates an expected call of GetConfig +func (mr *MockConfigUpdateEventMockRecorder) GetConfig() *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetConfig", reflect.TypeOf((*MockConfigUpdateEvent)(nil).GetConfig)) +} diff --git a/test/service/ratelimit_test.go b/test/service/ratelimit_test.go index faddbbdbf..ce067cc31 100644 --- a/test/service/ratelimit_test.go +++ b/test/service/ratelimit_test.go @@ -63,6 +63,9 @@ type rateLimitServiceTestSuite struct { runtime *mock_loader.MockIFace snapshot *mock_snapshot.MockIFace cache *mock_limiter.MockRateLimitCache + configProvider *mock_config.MockRateLimitConfigProvider + configUpdateEventChan chan config.ConfigUpdateEvent + configUpdateEvent *mock_config.MockConfigUpdateEvent configLoader *mock_config.MockRateLimitConfigLoader config *mock_config.MockRateLimitConfig runtimeUpdateCallback chan<- int @@ -81,10 +84,13 @@ func commonSetup(t *testing.T) rateLimitServiceTestSuite { ret := rateLimitServiceTestSuite{} ret.assert = assert.New(t) ret.controller = gomock.NewController(t) - ret.runtime = mock_loader.NewMockIFace(ret.controller) - ret.snapshot = mock_snapshot.NewMockIFace(ret.controller) + // ret.runtime = mock_loader.NewMockIFace(ret.controller) + // ret.snapshot = mock_snapshot.NewMockIFace(ret.controller) ret.cache = mock_limiter.NewMockRateLimitCache(ret.controller) - ret.configLoader = mock_config.NewMockRateLimitConfigLoader(ret.controller) + ret.configProvider = mock_config.NewMockRateLimitConfigProvider(ret.controller) + ret.configUpdateEventChan = make(chan config.ConfigUpdateEvent) + ret.configUpdateEvent = mock_config.NewMockConfigUpdateEvent(ret.controller) + // ret.configLoader = mock_config.NewMockRateLimitConfigLoader(ret.controller) ret.config = mock_config.NewMockRateLimitConfig(ret.controller) ret.statStore = gostats.NewStore(gostats.NewNullSink(), false) ret.statsManager = mock_stats.NewMockStatManager(ret.statStore) @@ -92,21 +98,31 @@ func commonSetup(t *testing.T) rateLimitServiceTestSuite { } func (this *rateLimitServiceTestSuite) setupBasicService() ratelimit.RateLimitServiceServer { - this.runtime.EXPECT().AddUpdateCallback(gomock.Any()).Do( - func(callback chan<- int) { - this.runtimeUpdateCallback = callback - }) - this.runtime.EXPECT().Snapshot().Return(this.snapshot).MinTimes(1) - this.snapshot.EXPECT().Keys().Return([]string{"foo", "config.basic_config"}).MinTimes(1) - this.snapshot.EXPECT().Get("config.basic_config").Return("fake_yaml").MinTimes(1) - this.configLoader.EXPECT().Load( - []config.RateLimitConfigToLoad{{Name: "config.basic_config", FileBytes: "fake_yaml"}}, - gomock.Any(), gomock.Any()).Return(this.config) + barrier := newBarrier() + // this.runtime.EXPECT().AddUpdateCallback(gomock.Any()).Do( + // func(callback chan<- int) { + // this.runtimeUpdateCallback = callback + // }) + // this.runtime.EXPECT().Snapshot().Return(this.snapshot).MinTimes(1) + // this.snapshot.EXPECT().Keys().Return([]string{"foo", "config.basic_config"}).MinTimes(1) + // this.snapshot.EXPECT().Get("config.basic_config").Return("fake_yaml").MinTimes(1) + this.configProvider.EXPECT().ConfigUpdateEvent().Return(this.configUpdateEventChan).Times(1) + this.configUpdateEvent.EXPECT().GetConfig().DoAndReturn(func() (config.RateLimitConfig, any) { + barrier.signal() + return this.config, nil + }) + go func() { this.configUpdateEventChan <- this.configUpdateEvent }() // initial config update from provider + + // this.configLoader.EXPECT().Load( + // []config.RateLimitConfigToLoad{{Name: "config.basic_config", FileBytes: "fake_yaml"}}, + // gomock.Any(), gomock.Any()).Return(this.config) // reset exporter before using testSpanExporter.Reset() - return ratelimit.NewService(this.runtime, this.cache, this.configLoader, this.statsManager, true, MockClock{now: int64(2222)}, false) + svc := ratelimit.NewService(this.runtime, this.cache, this.configProvider, this.configLoader, this.statsManager, true, MockClock{now: int64(2222)}, false) + barrier.wait() + return svc } // once a ratelimit service is initiated, the package always fetches a default tracer from otel runtime and it can't be change until a new round of test is run. It is necessary to keep a package level exporter in this test package in order to correctly run the tests. @@ -116,6 +132,7 @@ func TestService(test *testing.T) { t := commonSetup(test) defer t.controller.Finish() service := t.setupBasicService() + barrier := newBarrier() // First request, config should be loaded. request := common.NewRateLimitRequest("test-domain", [][][2]string{{{"hello", "world"}}}, 1) @@ -133,12 +150,16 @@ func TestService(test *testing.T) { response) t.assert.Nil(err) - // Force a config reload. - barrier := newBarrier() - t.configLoader.EXPECT().Load( - []config.RateLimitConfigToLoad{{Name: "config.basic_config", FileBytes: "fake_yaml"}}, gomock.Any(), gomock.Any()).Do( - func([]config.RateLimitConfigToLoad, stats.Manager, bool) { barrier.signal() }).Return(t.config) - t.runtimeUpdateCallback <- 1 + // Force a config reload - config event from config provider. + // t.configLoader.EXPECT().Load( + // []config.RateLimitConfigToLoad{{Name: "config.basic_config", FileBytes: "fake_yaml"}}, gomock.Any(), gomock.Any()).Do( + // func([]config.RateLimitConfigToLoad, stats.Manager, bool) { barrier.signal() }).Return(t.config) + // t.runtimeUpdateCallback <- 1 + t.configUpdateEvent.EXPECT().GetConfig().DoAndReturn(func() (config.RateLimitConfig, any) { + barrier.signal() + return t.config, nil + }) + t.configUpdateEventChan <- t.configUpdateEvent barrier.wait() // Different request. @@ -169,14 +190,19 @@ func TestService(test *testing.T) { t.assert.Nil(err) // Config load failure. - t.configLoader.EXPECT().Load( - []config.RateLimitConfigToLoad{{Name: "config.basic_config", FileBytes: "fake_yaml"}}, gomock.Any(), gomock.Any()).Do( - func([]config.RateLimitConfigToLoad, stats.Manager, bool) { - defer barrier.signal() - panic(config.RateLimitConfigError("load error")) - }) - t.runtimeUpdateCallback <- 1 + t.configUpdateEvent.EXPECT().GetConfig().DoAndReturn(func() (config.RateLimitConfig, any) { + barrier.signal() + return nil, config.RateLimitConfigError("load error") + }) + t.configUpdateEventChan <- t.configUpdateEvent barrier.wait() + // t.configLoader.EXPECT().Load( + // []config.RateLimitConfigToLoad{{Name: "config.basic_config", FileBytes: "fake_yaml"}}, gomock.Any(), gomock.Any()).Do( + // func([]config.RateLimitConfigToLoad, stats.Manager, bool) { + // defer barrier.signal() + // panic(config.RateLimitConfigError("load error")) + // }) + // t.runtimeUpdateCallback <- 1 // Config should still be valid. Also make sure order does not affect results. limits = []*config.RateLimit{ @@ -222,11 +248,17 @@ func TestServiceGlobalShadowMode(test *testing.T) { // Force a config reload. barrier := newBarrier() - t.configLoader.EXPECT().Load( - []config.RateLimitConfigToLoad{{Name: "config.basic_config", FileBytes: "fake_yaml"}}, gomock.Any(), gomock.Any()).Do( - func([]config.RateLimitConfigToLoad, stats.Manager, bool) { barrier.signal() }).Return(t.config) - t.runtimeUpdateCallback <- 1 + t.configUpdateEvent.EXPECT().GetConfig().DoAndReturn(func() (config.RateLimitConfig, any) { + barrier.signal() + return t.config, nil + }) + t.configUpdateEventChan <- t.configUpdateEvent barrier.wait() + // t.configLoader.EXPECT().Load( + // []config.RateLimitConfigToLoad{{Name: "config.basic_config", FileBytes: "fake_yaml"}}, gomock.Any(), gomock.Any()).Do( + // func([]config.RateLimitConfigToLoad, stats.Manager, bool) { barrier.signal() }).Return(t.config) + // t.runtimeUpdateCallback <- 1 + // barrier.wait() // Make a request. request := common.NewRateLimitRequest( @@ -356,11 +388,17 @@ func TestServiceWithCustomRatelimitHeaders(test *testing.T) { // Config reload. barrier := newBarrier() - t.configLoader.EXPECT().Load( - []config.RateLimitConfigToLoad{{Name: "config.basic_config", FileBytes: "fake_yaml"}}, gomock.Any(), gomock.Any()).Do( - func([]config.RateLimitConfigToLoad, stats.Manager, bool) { barrier.signal() }).Return(t.config) - t.runtimeUpdateCallback <- 1 + t.configUpdateEvent.EXPECT().GetConfig().DoAndReturn(func() (config.RateLimitConfig, any) { + barrier.signal() + return t.config, nil + }) + t.configUpdateEventChan <- t.configUpdateEvent barrier.wait() + // t.configLoader.EXPECT().Load( + // []config.RateLimitConfigToLoad{{Name: "config.basic_config", FileBytes: "fake_yaml"}}, gomock.Any(), gomock.Any()).Do( + // func([]config.RateLimitConfigToLoad, stats.Manager, bool) { barrier.signal() }).Return(t.config) + // t.runtimeUpdateCallback <- 1 + // barrier.wait() // Make request request := common.NewRateLimitRequest( @@ -408,11 +446,17 @@ func TestServiceWithDefaultRatelimitHeaders(test *testing.T) { // Config reload. barrier := newBarrier() - t.configLoader.EXPECT().Load( - []config.RateLimitConfigToLoad{{Name: "config.basic_config", FileBytes: "fake_yaml"}}, gomock.Any(), gomock.Any()).Do( - func([]config.RateLimitConfigToLoad, stats.Manager, bool) { barrier.signal() }).Return(t.config) - t.runtimeUpdateCallback <- 1 + t.configUpdateEvent.EXPECT().GetConfig().DoAndReturn(func() (config.RateLimitConfig, any) { + barrier.signal() + return t.config, nil + }) + t.configUpdateEventChan <- t.configUpdateEvent barrier.wait() + // t.configLoader.EXPECT().Load( + // []config.RateLimitConfigToLoad{{Name: "config.basic_config", FileBytes: "fake_yaml"}}, gomock.Any(), gomock.Any()).Do( + // func([]config.RateLimitConfigToLoad, stats.Manager, bool) { barrier.signal() }).Return(t.config) + // t.runtimeUpdateCallback <- 1 + // barrier.wait() // Make request request := common.NewRateLimitRequest( @@ -495,17 +539,25 @@ func TestInitialLoadError(test *testing.T) { t := commonSetup(test) defer t.controller.Finish() - t.runtime.EXPECT().AddUpdateCallback(gomock.Any()).Do( - func(callback chan<- int) { t.runtimeUpdateCallback = callback }) - t.runtime.EXPECT().Snapshot().Return(t.snapshot).MinTimes(1) - t.snapshot.EXPECT().Keys().Return([]string{"foo", "config.basic_config"}).MinTimes(1) - t.snapshot.EXPECT().Get("config.basic_config").Return("fake_yaml").MinTimes(1) - t.configLoader.EXPECT().Load( - []config.RateLimitConfigToLoad{{Name: "config.basic_config", FileBytes: "fake_yaml"}}, gomock.Any(), gomock.Any()).Do( - func([]config.RateLimitConfigToLoad, stats.Manager, bool) { - panic(config.RateLimitConfigError("load error")) - }) - service := ratelimit.NewService(t.runtime, t.cache, t.configLoader, t.statsManager, true, t.mockClock, false) + // t.runtime.EXPECT().AddUpdateCallback(gomock.Any()).Do( + // func(callback chan<- int) { t.runtimeUpdateCallback = callback }) + // t.runtime.EXPECT().Snapshot().Return(t.snapshot).MinTimes(1) + // t.snapshot.EXPECT().Keys().Return([]string{"foo", "config.basic_config"}).MinTimes(1) + // t.snapshot.EXPECT().Get("config.basic_config").Return("fake_yaml").MinTimes(1) + // t.configLoader.EXPECT().Load( + // []config.RateLimitConfigToLoad{{Name: "config.basic_config", FileBytes: "fake_yaml"}}, gomock.Any(), gomock.Any()).Do( + // func([]config.RateLimitConfigToLoad, stats.Manager, bool) { + // panic(config.RateLimitConfigError("load error")) + // }) + t.configProvider.EXPECT().ConfigUpdateEvent().Return(t.configUpdateEventChan).Times(1) + barrier := newBarrier() + t.configUpdateEvent.EXPECT().GetConfig().DoAndReturn(func() (config.RateLimitConfig, any) { + barrier.signal() + return nil, config.RateLimitConfigError("load error") + }) + go func() { t.configUpdateEventChan <- t.configUpdateEvent }() // initial config update from provider + service := ratelimit.NewService(t.runtime, t.cache, t.configProvider, t.configLoader, t.statsManager, true, t.mockClock, false) + barrier.wait() request := common.NewRateLimitRequest("test-domain", [][][2]string{{{"hello", "world"}}}, 1) response, err := service.ShouldRateLimit(context.Background(), request) From df1e1b41bd571bb82a2ac794284c783fca9fa8e8 Mon Sep 17 00:00:00 2001 From: Renuka Fernando Date: Wed, 12 Oct 2022 10:14:10 +0530 Subject: [PATCH 03/22] Add xDS config proto files Signed-off-by: Renuka Fernando --- .../config/ratelimit/v3/rls_conf.proto | 44 ++ .../service/ratelimit/v3/rls_conf_ds.proto | 25 + .../config/ratelimit/v3/rls_conf.pb.go | 525 ++++++++++++++++++ .../service/ratelimit/v3/rls_conf_ds.pb.go | 258 +++++++++ 4 files changed, 852 insertions(+) create mode 100644 api/ratelimit/config/ratelimit/v3/rls_conf.proto create mode 100644 api/ratelimit/service/ratelimit/v3/rls_conf_ds.proto create mode 100644 src/ratelimit/config/ratelimit/v3/rls_conf.pb.go create mode 100644 src/ratelimit/service/ratelimit/v3/rls_conf_ds.pb.go diff --git a/api/ratelimit/config/ratelimit/v3/rls_conf.proto b/api/ratelimit/config/ratelimit/v3/rls_conf.proto new file mode 100644 index 000000000..79e9eea8e --- /dev/null +++ b/api/ratelimit/config/ratelimit/v3/rls_conf.proto @@ -0,0 +1,44 @@ +syntax = "proto3"; + +package ratelimit.config.ratelimit.v3; + +option java_package = "io.envoyproxy.ratelimit.config.ratelimit.v3"; +option java_outer_classname = "RlsConfigProto"; +option java_multiple_files = true; +option go_package = "github.com/envoyproxy/go-control-plane/ratelimit/config/ratelimit/v3;ratelimitv3"; + +// [#protodoc-title: Rate Limit Config Discovery Service (RLS Conf DS)] + +// Rate-limit domain model +message RateLimitConfig { + repeated RateLimitDomainConfig domain_configs = 1; +} + +// Rate-limit domain config model +message RateLimitDomainConfig { + string domain = 1; + repeated RateLimitDescriptor descriptors = 2; +} + +// Rate-limit descriptor model +message RateLimitDescriptor { + string key = 1; + string value = 2; + RateLimitPolicy rate_limit = 3; + repeated RateLimitDescriptor descriptors = 4; + bool shadow_mode = 5; +} + +// Rate-limit policy model +message RateLimitPolicy { + string unit = 1; + uint32 requests_per_unit = 2; + bool unlimited = 3; + string name = 4; + repeated RateLimitReplace replaces = 5; +} + +// Rate-limit replace model +message RateLimitReplace { + string name = 1; +} diff --git a/api/ratelimit/service/ratelimit/v3/rls_conf_ds.proto b/api/ratelimit/service/ratelimit/v3/rls_conf_ds.proto new file mode 100644 index 000000000..3aa6525c7 --- /dev/null +++ b/api/ratelimit/service/ratelimit/v3/rls_conf_ds.proto @@ -0,0 +1,25 @@ +syntax = "proto3"; + +package ratelimit.service.ratelimit.v3; + +import "envoy/service/discovery/v3/discovery.proto"; + +option java_package = "io.envoyproxy.ratelimit.service.config.v3"; +option java_outer_classname = "RlsConfigProto"; +option java_multiple_files = true; +option go_package = "github.com/envoyproxy/go-control-plane/ratelimit/service/config/v3;configv3"; +option java_generic_services = true; + +// [#protodoc-title: Rate Limit Config Discovery Service (RLS Conf DS)] + +// Return list of all rate limit configs that rate limit service should be configured with. +service RateLimitConfigDiscoveryService { + + rpc StreamRlsConfigs(stream envoy.service.discovery.v3.DiscoveryRequest) + returns (stream envoy.service.discovery.v3.DiscoveryResponse) { + } + + rpc FetchRlsConfigs(envoy.service.discovery.v3.DiscoveryRequest) + returns (envoy.service.discovery.v3.DiscoveryResponse) { + } +} diff --git a/src/ratelimit/config/ratelimit/v3/rls_conf.pb.go b/src/ratelimit/config/ratelimit/v3/rls_conf.pb.go new file mode 100644 index 000000000..5ba9876f5 --- /dev/null +++ b/src/ratelimit/config/ratelimit/v3/rls_conf.pb.go @@ -0,0 +1,525 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.25.0-devel +// protoc v3.13.0 +// source: ratelimit/config/ratelimit/v3/rls_conf.proto + +package ratelimitv3 + +import ( + reflect "reflect" + sync "sync" + + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" +) + +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) +) + +// Rate-limit domain model +type RateLimitConfig struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + DomainConfigs []*RateLimitDomainConfig `protobuf:"bytes,1,rep,name=domain_configs,json=domainConfigs,proto3" json:"domain_configs,omitempty"` +} + +func (x *RateLimitConfig) Reset() { + *x = RateLimitConfig{} + if protoimpl.UnsafeEnabled { + mi := &file_ratelimit_config_ratelimit_v3_rls_conf_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *RateLimitConfig) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*RateLimitConfig) ProtoMessage() {} + +func (x *RateLimitConfig) ProtoReflect() protoreflect.Message { + mi := &file_ratelimit_config_ratelimit_v3_rls_conf_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 RateLimitConfig.ProtoReflect.Descriptor instead. +func (*RateLimitConfig) Descriptor() ([]byte, []int) { + return file_ratelimit_config_ratelimit_v3_rls_conf_proto_rawDescGZIP(), []int{0} +} + +func (x *RateLimitConfig) GetDomainConfigs() []*RateLimitDomainConfig { + if x != nil { + return x.DomainConfigs + } + return nil +} + +// Rate-limit domain config model +type RateLimitDomainConfig struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Domain string `protobuf:"bytes,1,opt,name=domain,proto3" json:"domain,omitempty"` + Descriptors []*RateLimitDescriptor `protobuf:"bytes,2,rep,name=descriptors,proto3" json:"descriptors,omitempty"` +} + +func (x *RateLimitDomainConfig) Reset() { + *x = RateLimitDomainConfig{} + if protoimpl.UnsafeEnabled { + mi := &file_ratelimit_config_ratelimit_v3_rls_conf_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *RateLimitDomainConfig) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*RateLimitDomainConfig) ProtoMessage() {} + +func (x *RateLimitDomainConfig) ProtoReflect() protoreflect.Message { + mi := &file_ratelimit_config_ratelimit_v3_rls_conf_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 RateLimitDomainConfig.ProtoReflect.Descriptor instead. +func (*RateLimitDomainConfig) Descriptor() ([]byte, []int) { + return file_ratelimit_config_ratelimit_v3_rls_conf_proto_rawDescGZIP(), []int{1} +} + +func (x *RateLimitDomainConfig) GetDomain() string { + if x != nil { + return x.Domain + } + return "" +} + +func (x *RateLimitDomainConfig) GetDescriptors() []*RateLimitDescriptor { + if x != nil { + return x.Descriptors + } + return nil +} + +// Rate-limit descriptor model +type RateLimitDescriptor struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Key string `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"` + Value string `protobuf:"bytes,2,opt,name=value,proto3" json:"value,omitempty"` + RateLimit *RateLimitPolicy `protobuf:"bytes,3,opt,name=rate_limit,json=rateLimit,proto3" json:"rate_limit,omitempty"` + Descriptors []*RateLimitDescriptor `protobuf:"bytes,4,rep,name=descriptors,proto3" json:"descriptors,omitempty"` + ShadowMode bool `protobuf:"varint,5,opt,name=shadow_mode,json=shadowMode,proto3" json:"shadow_mode,omitempty"` +} + +func (x *RateLimitDescriptor) Reset() { + *x = RateLimitDescriptor{} + if protoimpl.UnsafeEnabled { + mi := &file_ratelimit_config_ratelimit_v3_rls_conf_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *RateLimitDescriptor) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*RateLimitDescriptor) ProtoMessage() {} + +func (x *RateLimitDescriptor) ProtoReflect() protoreflect.Message { + mi := &file_ratelimit_config_ratelimit_v3_rls_conf_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 RateLimitDescriptor.ProtoReflect.Descriptor instead. +func (*RateLimitDescriptor) Descriptor() ([]byte, []int) { + return file_ratelimit_config_ratelimit_v3_rls_conf_proto_rawDescGZIP(), []int{2} +} + +func (x *RateLimitDescriptor) GetKey() string { + if x != nil { + return x.Key + } + return "" +} + +func (x *RateLimitDescriptor) GetValue() string { + if x != nil { + return x.Value + } + return "" +} + +func (x *RateLimitDescriptor) GetRateLimit() *RateLimitPolicy { + if x != nil { + return x.RateLimit + } + return nil +} + +func (x *RateLimitDescriptor) GetDescriptors() []*RateLimitDescriptor { + if x != nil { + return x.Descriptors + } + return nil +} + +func (x *RateLimitDescriptor) GetShadowMode() bool { + if x != nil { + return x.ShadowMode + } + return false +} + +// Rate-limit policy model +type RateLimitPolicy struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Unit string `protobuf:"bytes,1,opt,name=unit,proto3" json:"unit,omitempty"` + RequestsPerUnit uint32 `protobuf:"varint,2,opt,name=requests_per_unit,json=requestsPerUnit,proto3" json:"requests_per_unit,omitempty"` + Unlimited bool `protobuf:"varint,3,opt,name=unlimited,proto3" json:"unlimited,omitempty"` + Name string `protobuf:"bytes,4,opt,name=name,proto3" json:"name,omitempty"` + Replaces []*RateLimitReplace `protobuf:"bytes,5,rep,name=replaces,proto3" json:"replaces,omitempty"` +} + +func (x *RateLimitPolicy) Reset() { + *x = RateLimitPolicy{} + if protoimpl.UnsafeEnabled { + mi := &file_ratelimit_config_ratelimit_v3_rls_conf_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *RateLimitPolicy) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*RateLimitPolicy) ProtoMessage() {} + +func (x *RateLimitPolicy) ProtoReflect() protoreflect.Message { + mi := &file_ratelimit_config_ratelimit_v3_rls_conf_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 RateLimitPolicy.ProtoReflect.Descriptor instead. +func (*RateLimitPolicy) Descriptor() ([]byte, []int) { + return file_ratelimit_config_ratelimit_v3_rls_conf_proto_rawDescGZIP(), []int{3} +} + +func (x *RateLimitPolicy) GetUnit() string { + if x != nil { + return x.Unit + } + return "" +} + +func (x *RateLimitPolicy) GetRequestsPerUnit() uint32 { + if x != nil { + return x.RequestsPerUnit + } + return 0 +} + +func (x *RateLimitPolicy) GetUnlimited() bool { + if x != nil { + return x.Unlimited + } + return false +} + +func (x *RateLimitPolicy) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +func (x *RateLimitPolicy) GetReplaces() []*RateLimitReplace { + if x != nil { + return x.Replaces + } + return nil +} + +// Rate-limit replace model +type RateLimitReplace struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` +} + +func (x *RateLimitReplace) Reset() { + *x = RateLimitReplace{} + if protoimpl.UnsafeEnabled { + mi := &file_ratelimit_config_ratelimit_v3_rls_conf_proto_msgTypes[4] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *RateLimitReplace) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*RateLimitReplace) ProtoMessage() {} + +func (x *RateLimitReplace) ProtoReflect() protoreflect.Message { + mi := &file_ratelimit_config_ratelimit_v3_rls_conf_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 RateLimitReplace.ProtoReflect.Descriptor instead. +func (*RateLimitReplace) Descriptor() ([]byte, []int) { + return file_ratelimit_config_ratelimit_v3_rls_conf_proto_rawDescGZIP(), []int{4} +} + +func (x *RateLimitReplace) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +var File_ratelimit_config_ratelimit_v3_rls_conf_proto protoreflect.FileDescriptor + +var file_ratelimit_config_ratelimit_v3_rls_conf_proto_rawDesc = []byte{ + 0x0a, 0x2c, 0x72, 0x61, 0x74, 0x65, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x2f, 0x63, 0x6f, 0x6e, 0x66, + 0x69, 0x67, 0x2f, 0x72, 0x61, 0x74, 0x65, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x2f, 0x76, 0x33, 0x2f, + 0x72, 0x6c, 0x73, 0x5f, 0x63, 0x6f, 0x6e, 0x66, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x1d, + 0x72, 0x61, 0x74, 0x65, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x2e, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, + 0x2e, 0x72, 0x61, 0x74, 0x65, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x2e, 0x76, 0x33, 0x22, 0x6e, 0x0a, + 0x0f, 0x52, 0x61, 0x74, 0x65, 0x4c, 0x69, 0x6d, 0x69, 0x74, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, + 0x12, 0x5b, 0x0a, 0x0e, 0x64, 0x6f, 0x6d, 0x61, 0x69, 0x6e, 0x5f, 0x63, 0x6f, 0x6e, 0x66, 0x69, + 0x67, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x34, 0x2e, 0x72, 0x61, 0x74, 0x65, 0x6c, + 0x69, 0x6d, 0x69, 0x74, 0x2e, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2e, 0x72, 0x61, 0x74, 0x65, + 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x2e, 0x76, 0x33, 0x2e, 0x52, 0x61, 0x74, 0x65, 0x4c, 0x69, 0x6d, + 0x69, 0x74, 0x44, 0x6f, 0x6d, 0x61, 0x69, 0x6e, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x52, 0x0d, + 0x64, 0x6f, 0x6d, 0x61, 0x69, 0x6e, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x73, 0x22, 0x85, 0x01, + 0x0a, 0x15, 0x52, 0x61, 0x74, 0x65, 0x4c, 0x69, 0x6d, 0x69, 0x74, 0x44, 0x6f, 0x6d, 0x61, 0x69, + 0x6e, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x12, 0x16, 0x0a, 0x06, 0x64, 0x6f, 0x6d, 0x61, 0x69, + 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x64, 0x6f, 0x6d, 0x61, 0x69, 0x6e, 0x12, + 0x54, 0x0a, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x6f, 0x72, 0x73, 0x18, 0x02, + 0x20, 0x03, 0x28, 0x0b, 0x32, 0x32, 0x2e, 0x72, 0x61, 0x74, 0x65, 0x6c, 0x69, 0x6d, 0x69, 0x74, + 0x2e, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2e, 0x72, 0x61, 0x74, 0x65, 0x6c, 0x69, 0x6d, 0x69, + 0x74, 0x2e, 0x76, 0x33, 0x2e, 0x52, 0x61, 0x74, 0x65, 0x4c, 0x69, 0x6d, 0x69, 0x74, 0x44, 0x65, + 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x6f, 0x72, 0x52, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, + 0x70, 0x74, 0x6f, 0x72, 0x73, 0x22, 0x83, 0x02, 0x0a, 0x13, 0x52, 0x61, 0x74, 0x65, 0x4c, 0x69, + 0x6d, 0x69, 0x74, 0x44, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x6f, 0x72, 0x12, 0x10, 0x0a, + 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, + 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, + 0x76, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x4d, 0x0a, 0x0a, 0x72, 0x61, 0x74, 0x65, 0x5f, 0x6c, 0x69, + 0x6d, 0x69, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2e, 0x2e, 0x72, 0x61, 0x74, 0x65, + 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x2e, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2e, 0x72, 0x61, 0x74, + 0x65, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x2e, 0x76, 0x33, 0x2e, 0x52, 0x61, 0x74, 0x65, 0x4c, 0x69, + 0x6d, 0x69, 0x74, 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x52, 0x09, 0x72, 0x61, 0x74, 0x65, 0x4c, + 0x69, 0x6d, 0x69, 0x74, 0x12, 0x54, 0x0a, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, + 0x6f, 0x72, 0x73, 0x18, 0x04, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x32, 0x2e, 0x72, 0x61, 0x74, 0x65, + 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x2e, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2e, 0x72, 0x61, 0x74, + 0x65, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x2e, 0x76, 0x33, 0x2e, 0x52, 0x61, 0x74, 0x65, 0x4c, 0x69, + 0x6d, 0x69, 0x74, 0x44, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x6f, 0x72, 0x52, 0x0b, 0x64, + 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x6f, 0x72, 0x73, 0x12, 0x1f, 0x0a, 0x0b, 0x73, 0x68, + 0x61, 0x64, 0x6f, 0x77, 0x5f, 0x6d, 0x6f, 0x64, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x08, 0x52, + 0x0a, 0x73, 0x68, 0x61, 0x64, 0x6f, 0x77, 0x4d, 0x6f, 0x64, 0x65, 0x22, 0xd0, 0x01, 0x0a, 0x0f, + 0x52, 0x61, 0x74, 0x65, 0x4c, 0x69, 0x6d, 0x69, 0x74, 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x12, + 0x12, 0x0a, 0x04, 0x75, 0x6e, 0x69, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x75, + 0x6e, 0x69, 0x74, 0x12, 0x2a, 0x0a, 0x11, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x73, 0x5f, + 0x70, 0x65, 0x72, 0x5f, 0x75, 0x6e, 0x69, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x0f, + 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x73, 0x50, 0x65, 0x72, 0x55, 0x6e, 0x69, 0x74, 0x12, + 0x1c, 0x0a, 0x09, 0x75, 0x6e, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x65, 0x64, 0x18, 0x03, 0x20, 0x01, + 0x28, 0x08, 0x52, 0x09, 0x75, 0x6e, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x65, 0x64, 0x12, 0x12, 0x0a, + 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, + 0x65, 0x12, 0x4b, 0x0a, 0x08, 0x72, 0x65, 0x70, 0x6c, 0x61, 0x63, 0x65, 0x73, 0x18, 0x05, 0x20, + 0x03, 0x28, 0x0b, 0x32, 0x2f, 0x2e, 0x72, 0x61, 0x74, 0x65, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x2e, + 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2e, 0x72, 0x61, 0x74, 0x65, 0x6c, 0x69, 0x6d, 0x69, 0x74, + 0x2e, 0x76, 0x33, 0x2e, 0x52, 0x61, 0x74, 0x65, 0x4c, 0x69, 0x6d, 0x69, 0x74, 0x52, 0x65, 0x70, + 0x6c, 0x61, 0x63, 0x65, 0x52, 0x08, 0x72, 0x65, 0x70, 0x6c, 0x61, 0x63, 0x65, 0x73, 0x22, 0x26, + 0x0a, 0x10, 0x52, 0x61, 0x74, 0x65, 0x4c, 0x69, 0x6d, 0x69, 0x74, 0x52, 0x65, 0x70, 0x6c, 0x61, + 0x63, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x42, 0x91, 0x01, 0x0a, 0x2b, 0x69, 0x6f, 0x2e, 0x65, 0x6e, + 0x76, 0x6f, 0x79, 0x70, 0x72, 0x6f, 0x78, 0x79, 0x2e, 0x72, 0x61, 0x74, 0x65, 0x6c, 0x69, 0x6d, + 0x69, 0x74, 0x2e, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2e, 0x72, 0x61, 0x74, 0x65, 0x6c, 0x69, + 0x6d, 0x69, 0x74, 0x2e, 0x76, 0x33, 0x42, 0x0e, 0x52, 0x6c, 0x73, 0x43, 0x6f, 0x6e, 0x66, 0x69, + 0x67, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x50, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, + 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x65, 0x6e, 0x76, 0x6f, 0x79, 0x70, 0x72, 0x6f, 0x78, 0x79, 0x2f, + 0x67, 0x6f, 0x2d, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x2d, 0x70, 0x6c, 0x61, 0x6e, 0x65, + 0x2f, 0x72, 0x61, 0x74, 0x65, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x2f, 0x63, 0x6f, 0x6e, 0x66, 0x69, + 0x67, 0x2f, 0x72, 0x61, 0x74, 0x65, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x2f, 0x76, 0x33, 0x3b, 0x72, + 0x61, 0x74, 0x65, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x76, 0x33, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x33, +} + +var ( + file_ratelimit_config_ratelimit_v3_rls_conf_proto_rawDescOnce sync.Once + file_ratelimit_config_ratelimit_v3_rls_conf_proto_rawDescData = file_ratelimit_config_ratelimit_v3_rls_conf_proto_rawDesc +) + +func file_ratelimit_config_ratelimit_v3_rls_conf_proto_rawDescGZIP() []byte { + file_ratelimit_config_ratelimit_v3_rls_conf_proto_rawDescOnce.Do(func() { + file_ratelimit_config_ratelimit_v3_rls_conf_proto_rawDescData = protoimpl.X.CompressGZIP(file_ratelimit_config_ratelimit_v3_rls_conf_proto_rawDescData) + }) + return file_ratelimit_config_ratelimit_v3_rls_conf_proto_rawDescData +} + +var ( + file_ratelimit_config_ratelimit_v3_rls_conf_proto_msgTypes = make([]protoimpl.MessageInfo, 5) + file_ratelimit_config_ratelimit_v3_rls_conf_proto_goTypes = []interface{}{ + (*RateLimitConfig)(nil), // 0: ratelimit.config.ratelimit.v3.RateLimitConfig + (*RateLimitDomainConfig)(nil), // 1: ratelimit.config.ratelimit.v3.RateLimitDomainConfig + (*RateLimitDescriptor)(nil), // 2: ratelimit.config.ratelimit.v3.RateLimitDescriptor + (*RateLimitPolicy)(nil), // 3: ratelimit.config.ratelimit.v3.RateLimitPolicy + (*RateLimitReplace)(nil), // 4: ratelimit.config.ratelimit.v3.RateLimitReplace + } +) + +var file_ratelimit_config_ratelimit_v3_rls_conf_proto_depIdxs = []int32{ + 1, // 0: ratelimit.config.ratelimit.v3.RateLimitConfig.domain_configs:type_name -> ratelimit.config.ratelimit.v3.RateLimitDomainConfig + 2, // 1: ratelimit.config.ratelimit.v3.RateLimitDomainConfig.descriptors:type_name -> ratelimit.config.ratelimit.v3.RateLimitDescriptor + 3, // 2: ratelimit.config.ratelimit.v3.RateLimitDescriptor.rate_limit:type_name -> ratelimit.config.ratelimit.v3.RateLimitPolicy + 2, // 3: ratelimit.config.ratelimit.v3.RateLimitDescriptor.descriptors:type_name -> ratelimit.config.ratelimit.v3.RateLimitDescriptor + 4, // 4: ratelimit.config.ratelimit.v3.RateLimitPolicy.replaces:type_name -> ratelimit.config.ratelimit.v3.RateLimitReplace + 5, // [5:5] is the sub-list for method output_type + 5, // [5:5] is the sub-list for method input_type + 5, // [5:5] is the sub-list for extension type_name + 5, // [5:5] is the sub-list for extension extendee + 0, // [0:5] is the sub-list for field type_name +} + +func init() { file_ratelimit_config_ratelimit_v3_rls_conf_proto_init() } +func file_ratelimit_config_ratelimit_v3_rls_conf_proto_init() { + if File_ratelimit_config_ratelimit_v3_rls_conf_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_ratelimit_config_ratelimit_v3_rls_conf_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*RateLimitConfig); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_ratelimit_config_ratelimit_v3_rls_conf_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*RateLimitDomainConfig); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_ratelimit_config_ratelimit_v3_rls_conf_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*RateLimitDescriptor); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_ratelimit_config_ratelimit_v3_rls_conf_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*RateLimitPolicy); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_ratelimit_config_ratelimit_v3_rls_conf_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*RateLimitReplace); 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_ratelimit_config_ratelimit_v3_rls_conf_proto_rawDesc, + NumEnums: 0, + NumMessages: 5, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_ratelimit_config_ratelimit_v3_rls_conf_proto_goTypes, + DependencyIndexes: file_ratelimit_config_ratelimit_v3_rls_conf_proto_depIdxs, + MessageInfos: file_ratelimit_config_ratelimit_v3_rls_conf_proto_msgTypes, + }.Build() + File_ratelimit_config_ratelimit_v3_rls_conf_proto = out.File + file_ratelimit_config_ratelimit_v3_rls_conf_proto_rawDesc = nil + file_ratelimit_config_ratelimit_v3_rls_conf_proto_goTypes = nil + file_ratelimit_config_ratelimit_v3_rls_conf_proto_depIdxs = nil +} diff --git a/src/ratelimit/service/ratelimit/v3/rls_conf_ds.pb.go b/src/ratelimit/service/ratelimit/v3/rls_conf_ds.pb.go new file mode 100644 index 000000000..b8d95e02d --- /dev/null +++ b/src/ratelimit/service/ratelimit/v3/rls_conf_ds.pb.go @@ -0,0 +1,258 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.25.0-devel +// protoc v3.13.0 +// source: ratelimit/service/ratelimit/v3/rls_conf_ds.proto + +package configv3 + +import ( + context "context" + reflect "reflect" + + v3 "github.com/envoyproxy/go-control-plane/envoy/service/discovery/v3" + grpc "google.golang.org/grpc" + codes "google.golang.org/grpc/codes" + status "google.golang.org/grpc/status" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" +) + +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) +) + +var File_ratelimit_service_ratelimit_v3_rls_conf_ds_proto protoreflect.FileDescriptor + +var file_ratelimit_service_ratelimit_v3_rls_conf_ds_proto_rawDesc = []byte{ + 0x0a, 0x30, 0x72, 0x61, 0x74, 0x65, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x2f, 0x73, 0x65, 0x72, 0x76, + 0x69, 0x63, 0x65, 0x2f, 0x72, 0x61, 0x74, 0x65, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x2f, 0x76, 0x33, + 0x2f, 0x72, 0x6c, 0x73, 0x5f, 0x63, 0x6f, 0x6e, 0x66, 0x5f, 0x64, 0x73, 0x2e, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x12, 0x1e, 0x72, 0x61, 0x74, 0x65, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x2e, 0x73, 0x65, + 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x72, 0x61, 0x74, 0x65, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x2e, + 0x76, 0x33, 0x1a, 0x2a, 0x65, 0x6e, 0x76, 0x6f, 0x79, 0x2f, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, + 0x65, 0x2f, 0x64, 0x69, 0x73, 0x63, 0x6f, 0x76, 0x65, 0x72, 0x79, 0x2f, 0x76, 0x33, 0x2f, 0x64, + 0x69, 0x73, 0x63, 0x6f, 0x76, 0x65, 0x72, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x32, 0x8a, + 0x02, 0x0a, 0x1f, 0x52, 0x61, 0x74, 0x65, 0x4c, 0x69, 0x6d, 0x69, 0x74, 0x43, 0x6f, 0x6e, 0x66, + 0x69, 0x67, 0x44, 0x69, 0x73, 0x63, 0x6f, 0x76, 0x65, 0x72, 0x79, 0x53, 0x65, 0x72, 0x76, 0x69, + 0x63, 0x65, 0x12, 0x75, 0x0a, 0x10, 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x52, 0x6c, 0x73, 0x43, + 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x73, 0x12, 0x2c, 0x2e, 0x65, 0x6e, 0x76, 0x6f, 0x79, 0x2e, 0x73, + 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x64, 0x69, 0x73, 0x63, 0x6f, 0x76, 0x65, 0x72, 0x79, + 0x2e, 0x76, 0x33, 0x2e, 0x44, 0x69, 0x73, 0x63, 0x6f, 0x76, 0x65, 0x72, 0x79, 0x52, 0x65, 0x71, + 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2d, 0x2e, 0x65, 0x6e, 0x76, 0x6f, 0x79, 0x2e, 0x73, 0x65, 0x72, + 0x76, 0x69, 0x63, 0x65, 0x2e, 0x64, 0x69, 0x73, 0x63, 0x6f, 0x76, 0x65, 0x72, 0x79, 0x2e, 0x76, + 0x33, 0x2e, 0x44, 0x69, 0x73, 0x63, 0x6f, 0x76, 0x65, 0x72, 0x79, 0x52, 0x65, 0x73, 0x70, 0x6f, + 0x6e, 0x73, 0x65, 0x22, 0x00, 0x28, 0x01, 0x30, 0x01, 0x12, 0x70, 0x0a, 0x0f, 0x46, 0x65, 0x74, + 0x63, 0x68, 0x52, 0x6c, 0x73, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x73, 0x12, 0x2c, 0x2e, 0x65, + 0x6e, 0x76, 0x6f, 0x79, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x64, 0x69, 0x73, + 0x63, 0x6f, 0x76, 0x65, 0x72, 0x79, 0x2e, 0x76, 0x33, 0x2e, 0x44, 0x69, 0x73, 0x63, 0x6f, 0x76, + 0x65, 0x72, 0x79, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2d, 0x2e, 0x65, 0x6e, 0x76, + 0x6f, 0x79, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x64, 0x69, 0x73, 0x63, 0x6f, + 0x76, 0x65, 0x72, 0x79, 0x2e, 0x76, 0x33, 0x2e, 0x44, 0x69, 0x73, 0x63, 0x6f, 0x76, 0x65, 0x72, + 0x79, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x42, 0x8d, 0x01, 0x0a, 0x29, + 0x69, 0x6f, 0x2e, 0x65, 0x6e, 0x76, 0x6f, 0x79, 0x70, 0x72, 0x6f, 0x78, 0x79, 0x2e, 0x72, 0x61, + 0x74, 0x65, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, + 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2e, 0x76, 0x33, 0x42, 0x0e, 0x52, 0x6c, 0x73, 0x43, 0x6f, + 0x6e, 0x66, 0x69, 0x67, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x4b, 0x67, 0x69, 0x74, + 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x65, 0x6e, 0x76, 0x6f, 0x79, 0x70, 0x72, 0x6f, + 0x78, 0x79, 0x2f, 0x67, 0x6f, 0x2d, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x2d, 0x70, 0x6c, + 0x61, 0x6e, 0x65, 0x2f, 0x72, 0x61, 0x74, 0x65, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x2f, 0x73, 0x65, + 0x72, 0x76, 0x69, 0x63, 0x65, 0x2f, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2f, 0x76, 0x33, 0x3b, + 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x76, 0x33, 0x88, 0x01, 0x01, 0x62, 0x06, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x33, +} + +var file_ratelimit_service_ratelimit_v3_rls_conf_ds_proto_goTypes = []interface{}{ + (*v3.DiscoveryRequest)(nil), // 0: envoy.service.discovery.v3.DiscoveryRequest + (*v3.DiscoveryResponse)(nil), // 1: envoy.service.discovery.v3.DiscoveryResponse +} + +var file_ratelimit_service_ratelimit_v3_rls_conf_ds_proto_depIdxs = []int32{ + 0, // 0: ratelimit.service.ratelimit.v3.RateLimitConfigDiscoveryService.StreamRlsConfigs:input_type -> envoy.service.discovery.v3.DiscoveryRequest + 0, // 1: ratelimit.service.ratelimit.v3.RateLimitConfigDiscoveryService.FetchRlsConfigs:input_type -> envoy.service.discovery.v3.DiscoveryRequest + 1, // 2: ratelimit.service.ratelimit.v3.RateLimitConfigDiscoveryService.StreamRlsConfigs:output_type -> envoy.service.discovery.v3.DiscoveryResponse + 1, // 3: ratelimit.service.ratelimit.v3.RateLimitConfigDiscoveryService.FetchRlsConfigs:output_type -> envoy.service.discovery.v3.DiscoveryResponse + 2, // [2:4] is the sub-list for method output_type + 0, // [0:2] is the sub-list for method input_type + 0, // [0:0] is the sub-list for extension type_name + 0, // [0:0] is the sub-list for extension extendee + 0, // [0:0] is the sub-list for field type_name +} + +func init() { file_ratelimit_service_ratelimit_v3_rls_conf_ds_proto_init() } +func file_ratelimit_service_ratelimit_v3_rls_conf_ds_proto_init() { + if File_ratelimit_service_ratelimit_v3_rls_conf_ds_proto != nil { + return + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_ratelimit_service_ratelimit_v3_rls_conf_ds_proto_rawDesc, + NumEnums: 0, + NumMessages: 0, + NumExtensions: 0, + NumServices: 1, + }, + GoTypes: file_ratelimit_service_ratelimit_v3_rls_conf_ds_proto_goTypes, + DependencyIndexes: file_ratelimit_service_ratelimit_v3_rls_conf_ds_proto_depIdxs, + }.Build() + File_ratelimit_service_ratelimit_v3_rls_conf_ds_proto = out.File + file_ratelimit_service_ratelimit_v3_rls_conf_ds_proto_rawDesc = nil + file_ratelimit_service_ratelimit_v3_rls_conf_ds_proto_goTypes = nil + file_ratelimit_service_ratelimit_v3_rls_conf_ds_proto_depIdxs = nil +} + +// Reference imports to suppress errors if they are not otherwise used. +var ( + _ context.Context + _ grpc.ClientConnInterface +) + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the grpc package it is being compiled against. +const _ = grpc.SupportPackageIsVersion6 + +// RateLimitConfigDiscoveryServiceClient is the client API for RateLimitConfigDiscoveryService service. +// +// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. +type RateLimitConfigDiscoveryServiceClient interface { + StreamRlsConfigs(ctx context.Context, opts ...grpc.CallOption) (RateLimitConfigDiscoveryService_StreamRlsConfigsClient, error) + FetchRlsConfigs(ctx context.Context, in *v3.DiscoveryRequest, opts ...grpc.CallOption) (*v3.DiscoveryResponse, error) +} + +type rateLimitConfigDiscoveryServiceClient struct { + cc grpc.ClientConnInterface +} + +func NewRateLimitConfigDiscoveryServiceClient(cc grpc.ClientConnInterface) RateLimitConfigDiscoveryServiceClient { + return &rateLimitConfigDiscoveryServiceClient{cc} +} + +func (c *rateLimitConfigDiscoveryServiceClient) StreamRlsConfigs(ctx context.Context, opts ...grpc.CallOption) (RateLimitConfigDiscoveryService_StreamRlsConfigsClient, error) { + stream, err := c.cc.NewStream(ctx, &_RateLimitConfigDiscoveryService_serviceDesc.Streams[0], "/ratelimit.service.ratelimit.v3.RateLimitConfigDiscoveryService/StreamRlsConfigs", opts...) + if err != nil { + return nil, err + } + x := &rateLimitConfigDiscoveryServiceStreamRlsConfigsClient{stream} + return x, nil +} + +type RateLimitConfigDiscoveryService_StreamRlsConfigsClient interface { + Send(*v3.DiscoveryRequest) error + Recv() (*v3.DiscoveryResponse, error) + grpc.ClientStream +} + +type rateLimitConfigDiscoveryServiceStreamRlsConfigsClient struct { + grpc.ClientStream +} + +func (x *rateLimitConfigDiscoveryServiceStreamRlsConfigsClient) Send(m *v3.DiscoveryRequest) error { + return x.ClientStream.SendMsg(m) +} + +func (x *rateLimitConfigDiscoveryServiceStreamRlsConfigsClient) Recv() (*v3.DiscoveryResponse, error) { + m := new(v3.DiscoveryResponse) + if err := x.ClientStream.RecvMsg(m); err != nil { + return nil, err + } + return m, nil +} + +func (c *rateLimitConfigDiscoveryServiceClient) FetchRlsConfigs(ctx context.Context, in *v3.DiscoveryRequest, opts ...grpc.CallOption) (*v3.DiscoveryResponse, error) { + out := new(v3.DiscoveryResponse) + err := c.cc.Invoke(ctx, "/ratelimit.service.ratelimit.v3.RateLimitConfigDiscoveryService/FetchRlsConfigs", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// RateLimitConfigDiscoveryServiceServer is the server API for RateLimitConfigDiscoveryService service. +type RateLimitConfigDiscoveryServiceServer interface { + StreamRlsConfigs(RateLimitConfigDiscoveryService_StreamRlsConfigsServer) error + FetchRlsConfigs(context.Context, *v3.DiscoveryRequest) (*v3.DiscoveryResponse, error) +} + +// UnimplementedRateLimitConfigDiscoveryServiceServer can be embedded to have forward compatible implementations. +type UnimplementedRateLimitConfigDiscoveryServiceServer struct{} + +func (*UnimplementedRateLimitConfigDiscoveryServiceServer) StreamRlsConfigs(RateLimitConfigDiscoveryService_StreamRlsConfigsServer) error { + return status.Errorf(codes.Unimplemented, "method StreamRlsConfigs not implemented") +} + +func (*UnimplementedRateLimitConfigDiscoveryServiceServer) FetchRlsConfigs(context.Context, *v3.DiscoveryRequest) (*v3.DiscoveryResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method FetchRlsConfigs not implemented") +} + +func RegisterRateLimitConfigDiscoveryServiceServer(s *grpc.Server, srv RateLimitConfigDiscoveryServiceServer) { + s.RegisterService(&_RateLimitConfigDiscoveryService_serviceDesc, srv) +} + +func _RateLimitConfigDiscoveryService_StreamRlsConfigs_Handler(srv interface{}, stream grpc.ServerStream) error { + return srv.(RateLimitConfigDiscoveryServiceServer).StreamRlsConfigs(&rateLimitConfigDiscoveryServiceStreamRlsConfigsServer{stream}) +} + +type RateLimitConfigDiscoveryService_StreamRlsConfigsServer interface { + Send(*v3.DiscoveryResponse) error + Recv() (*v3.DiscoveryRequest, error) + grpc.ServerStream +} + +type rateLimitConfigDiscoveryServiceStreamRlsConfigsServer struct { + grpc.ServerStream +} + +func (x *rateLimitConfigDiscoveryServiceStreamRlsConfigsServer) Send(m *v3.DiscoveryResponse) error { + return x.ServerStream.SendMsg(m) +} + +func (x *rateLimitConfigDiscoveryServiceStreamRlsConfigsServer) Recv() (*v3.DiscoveryRequest, error) { + m := new(v3.DiscoveryRequest) + if err := x.ServerStream.RecvMsg(m); err != nil { + return nil, err + } + return m, nil +} + +func _RateLimitConfigDiscoveryService_FetchRlsConfigs_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(v3.DiscoveryRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(RateLimitConfigDiscoveryServiceServer).FetchRlsConfigs(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/ratelimit.service.ratelimit.v3.RateLimitConfigDiscoveryService/FetchRlsConfigs", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(RateLimitConfigDiscoveryServiceServer).FetchRlsConfigs(ctx, req.(*v3.DiscoveryRequest)) + } + return interceptor(ctx, in, info, handler) +} + +var _RateLimitConfigDiscoveryService_serviceDesc = grpc.ServiceDesc{ + ServiceName: "ratelimit.service.ratelimit.v3.RateLimitConfigDiscoveryService", + HandlerType: (*RateLimitConfigDiscoveryServiceServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "FetchRlsConfigs", + Handler: _RateLimitConfigDiscoveryService_FetchRlsConfigs_Handler, + }, + }, + Streams: []grpc.StreamDesc{ + { + StreamName: "StreamRlsConfigs", + Handler: _RateLimitConfigDiscoveryService_StreamRlsConfigs_Handler, + ServerStreams: true, + ClientStreams: true, + }, + }, + Metadata: "ratelimit/service/ratelimit/v3/rls_conf_ds.proto", +} From c87441c0aca80d3f1cf11059757f6e0e776f5fb3 Mon Sep 17 00:00:00 2001 From: Renuka Fernando Date: Wed, 12 Oct 2022 10:24:18 +0530 Subject: [PATCH 04/22] Move provider to a new package from config package Signed-off-by: Renuka Fernando --- src/config/provider.go | 18 ----- src/{config => provider}/file_provider.go | 11 +-- src/provider/provider.go | 22 ++++++ src/service/ratelimit.go | 7 +- src/service_cmd/runner/runner.go | 3 +- test/mocks/config/config.go | 75 ------------------- test/mocks/provider/provider.go | 89 +++++++++++++++++++++++ test/service/ratelimit_test.go | 14 ++-- 8 files changed, 131 insertions(+), 108 deletions(-) delete mode 100644 src/config/provider.go rename src/{config => provider}/file_provider.go (90%) create mode 100644 src/provider/provider.go create mode 100644 test/mocks/provider/provider.go diff --git a/src/config/provider.go b/src/config/provider.go deleted file mode 100644 index 056490443..000000000 --- a/src/config/provider.go +++ /dev/null @@ -1,18 +0,0 @@ -package config - -type RateLimitConfigProvider interface { - ConfigUpdateEvent() <-chan ConfigUpdateEvent -} - -type ConfigUpdateEvent interface { - GetConfig() (config RateLimitConfig, err any) -} - -type ConfigUpdateEventImpl struct { - config RateLimitConfig - err any -} - -func (e *ConfigUpdateEventImpl) GetConfig() (config RateLimitConfig, err any) { - return e.config, e.err -} diff --git a/src/config/file_provider.go b/src/provider/file_provider.go similarity index 90% rename from src/config/file_provider.go rename to src/provider/file_provider.go index 31368e141..8206f543b 100644 --- a/src/config/file_provider.go +++ b/src/provider/file_provider.go @@ -1,4 +1,4 @@ -package config +package provider import ( "path/filepath" @@ -8,13 +8,14 @@ import ( gostats "github.com/lyft/gostats" logger "github.com/sirupsen/logrus" + "github.com/envoyproxy/ratelimit/src/config" "github.com/envoyproxy/ratelimit/src/settings" "github.com/envoyproxy/ratelimit/src/stats" ) type FileProvider struct { settings settings.Settings - loader RateLimitConfigLoader + loader config.RateLimitConfigLoader configUpdateEventChan chan ConfigUpdateEvent runtime loader.IFace runtimeUpdateEvent chan int @@ -49,14 +50,14 @@ func (p *FileProvider) sendEvent() { } }() - files := []RateLimitConfigToLoad{} + files := []config.RateLimitConfigToLoad{} snapshot := p.runtime.Snapshot() for _, key := range snapshot.Keys() { if p.runtimeWatchRoot && !strings.HasPrefix(key, "config.") { continue } - files = append(files, RateLimitConfigToLoad{key, snapshot.Get(key)}) + files = append(files, config.RateLimitConfigToLoad{key, snapshot.Get(key)}) } rlSettings := settings.NewSettings() @@ -101,7 +102,7 @@ func (p *FileProvider) setupRuntime() { func NewFileProvider(settings settings.Settings, rootStore gostats.Store, statsManager stats.Manager) RateLimitConfigProvider { p := &FileProvider{ settings: settings, - loader: NewRateLimitConfigLoaderImpl(), + loader: config.NewRateLimitConfigLoaderImpl(), configUpdateEventChan: make(chan ConfigUpdateEvent), runtimeUpdateEvent: make(chan int), runtimeWatchRoot: settings.RuntimeWatchRoot, diff --git a/src/provider/provider.go b/src/provider/provider.go new file mode 100644 index 000000000..e552f0af8 --- /dev/null +++ b/src/provider/provider.go @@ -0,0 +1,22 @@ +package provider + +import ( + "github.com/envoyproxy/ratelimit/src/config" +) + +type RateLimitConfigProvider interface { + ConfigUpdateEvent() <-chan ConfigUpdateEvent +} + +type ConfigUpdateEvent interface { + GetConfig() (config config.RateLimitConfig, err any) +} + +type ConfigUpdateEventImpl struct { + config config.RateLimitConfig + err any +} + +func (e *ConfigUpdateEventImpl) GetConfig() (config config.RateLimitConfig, err any) { + return e.config, e.err +} diff --git a/src/service/ratelimit.go b/src/service/ratelimit.go index 4c91c0e68..122f148d9 100644 --- a/src/service/ratelimit.go +++ b/src/service/ratelimit.go @@ -25,6 +25,7 @@ import ( "github.com/envoyproxy/ratelimit/src/assert" "github.com/envoyproxy/ratelimit/src/config" "github.com/envoyproxy/ratelimit/src/limiter" + "github.com/envoyproxy/ratelimit/src/provider" "github.com/envoyproxy/ratelimit/src/redis" ) @@ -38,7 +39,7 @@ type RateLimitServiceServer interface { type service struct { runtime loader.IFace configLock sync.RWMutex - configUpdateEvent <-chan config.ConfigUpdateEvent + configUpdateEvent <-chan provider.ConfigUpdateEvent configLoader config.RateLimitConfigLoader config config.RateLimitConfig runtimeUpdateEvent chan int @@ -53,7 +54,7 @@ type service struct { globalShadowMode bool } -func (this *service) reloadConfig(updateEvent config.ConfigUpdateEvent) { +func (this *service) reloadConfig(updateEvent provider.ConfigUpdateEvent) { newConfig, err := updateEvent.GetConfig() if err != nil { configError, ok := err.(config.RateLimitConfigError) @@ -303,7 +304,7 @@ func (this *service) GetCurrentConfig() config.RateLimitConfig { return this.config } -func NewService(runtime loader.IFace, cache limiter.RateLimitCache, configProvider config.RateLimitConfigProvider, +func NewService(runtime loader.IFace, cache limiter.RateLimitCache, configProvider provider.RateLimitConfigProvider, configLoader config.RateLimitConfigLoader, statsManager stats.Manager, runtimeWatchRoot bool, clock utils.TimeSource, shadowMode bool) RateLimitServiceServer { newService := &service{ diff --git a/src/service_cmd/runner/runner.go b/src/service_cmd/runner/runner.go index d48f7ff68..a88292632 100644 --- a/src/service_cmd/runner/runner.go +++ b/src/service_cmd/runner/runner.go @@ -10,6 +10,7 @@ import ( "time" "github.com/envoyproxy/ratelimit/src/metrics" + "github.com/envoyproxy/ratelimit/src/provider" "github.com/envoyproxy/ratelimit/src/stats" "github.com/envoyproxy/ratelimit/src/trace" @@ -119,7 +120,7 @@ func (runner *Runner) Run() { service := ratelimit.NewService( srv.Runtime(), createLimiter(srv, s, localCache, runner.statsManager), - config.NewFileProvider(s, srv.Store(), runner.statsManager), + provider.NewFileProvider(s, srv.Store(), runner.statsManager), config.NewRateLimitConfigLoaderImpl(), runner.statsManager, s.RuntimeWatchRoot, diff --git a/test/mocks/config/config.go b/test/mocks/config/config.go index fc55c5c98..f5989eb78 100644 --- a/test/mocks/config/config.go +++ b/test/mocks/config/config.go @@ -102,78 +102,3 @@ func (mr *MockRateLimitConfigLoaderMockRecorder) Load(arg0, arg1, arg2 interface mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Load", reflect.TypeOf((*MockRateLimitConfigLoader)(nil).Load), arg0, arg1, arg2) } - -// MockRateLimitConfigProvider is a mock of RateLimitConfigProvider interface -type MockRateLimitConfigProvider struct { - ctrl *gomock.Controller - recorder *MockRateLimitConfigProviderMockRecorder -} - -// MockRateLimitConfigProviderMockRecorder is the mock recorder for MockRateLimitConfigProvider -type MockRateLimitConfigProviderMockRecorder struct { - mock *MockRateLimitConfigProvider -} - -// NewMockRateLimitConfigProvider creates a new mock instance -func NewMockRateLimitConfigProvider(ctrl *gomock.Controller) *MockRateLimitConfigProvider { - mock := &MockRateLimitConfigProvider{ctrl: ctrl} - mock.recorder = &MockRateLimitConfigProviderMockRecorder{mock} - return mock -} - -// EXPECT returns an object that allows the caller to indicate expected use -func (m *MockRateLimitConfigProvider) EXPECT() *MockRateLimitConfigProviderMockRecorder { - return m.recorder -} - -// ConfigUpdateEvent mocks base method -func (m *MockRateLimitConfigProvider) ConfigUpdateEvent() <-chan config.ConfigUpdateEvent { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "ConfigUpdateEvent") - ret0, _ := ret[0].(<-chan config.ConfigUpdateEvent) - return ret0 -} - -// ConfigUpdateEvent indicates an expected call of ConfigUpdateEvent -func (mr *MockRateLimitConfigProviderMockRecorder) ConfigUpdateEvent() *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ConfigUpdateEvent", reflect.TypeOf((*MockRateLimitConfigProvider)(nil).ConfigUpdateEvent)) -} - -// MockConfigUpdateEvent is a mock of ConfigUpdateEvent interface -type MockConfigUpdateEvent struct { - ctrl *gomock.Controller - recorder *MockConfigUpdateEventMockRecorder -} - -// MockConfigUpdateEventMockRecorder is the mock recorder for MockConfigUpdateEvent -type MockConfigUpdateEventMockRecorder struct { - mock *MockConfigUpdateEvent -} - -// NewMockConfigUpdateEvent creates a new mock instance -func NewMockConfigUpdateEvent(ctrl *gomock.Controller) *MockConfigUpdateEvent { - mock := &MockConfigUpdateEvent{ctrl: ctrl} - mock.recorder = &MockConfigUpdateEventMockRecorder{mock} - return mock -} - -// EXPECT returns an object that allows the caller to indicate expected use -func (m *MockConfigUpdateEvent) EXPECT() *MockConfigUpdateEventMockRecorder { - return m.recorder -} - -// GetConfig mocks base method -func (m *MockConfigUpdateEvent) GetConfig() (config.RateLimitConfig, any) { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "GetConfig") - ret0, _ := ret[0].(config.RateLimitConfig) - ret1, _ := ret[1].(any) - return ret0, ret1 -} - -// GetConfig indicates an expected call of GetConfig -func (mr *MockConfigUpdateEventMockRecorder) GetConfig() *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetConfig", reflect.TypeOf((*MockConfigUpdateEvent)(nil).GetConfig)) -} diff --git a/test/mocks/provider/provider.go b/test/mocks/provider/provider.go new file mode 100644 index 000000000..2d2d4b319 --- /dev/null +++ b/test/mocks/provider/provider.go @@ -0,0 +1,89 @@ +// Code generated by MockGen. DO NOT EDIT. +// Source: /Users/renuka/git/ratelimit/src/provider/provider.go + +// Package mock_provider is a generated GoMock package. +package mock_provider + +import ( + reflect "reflect" + + gomock "github.com/golang/mock/gomock" + + config "github.com/envoyproxy/ratelimit/src/config" + provider "github.com/envoyproxy/ratelimit/src/provider" +) + +// MockRateLimitConfigProvider is a mock of RateLimitConfigProvider interface +type MockRateLimitConfigProvider struct { + ctrl *gomock.Controller + recorder *MockRateLimitConfigProviderMockRecorder +} + +// MockRateLimitConfigProviderMockRecorder is the mock recorder for MockRateLimitConfigProvider +type MockRateLimitConfigProviderMockRecorder struct { + mock *MockRateLimitConfigProvider +} + +// NewMockRateLimitConfigProvider creates a new mock instance +func NewMockRateLimitConfigProvider(ctrl *gomock.Controller) *MockRateLimitConfigProvider { + mock := &MockRateLimitConfigProvider{ctrl: ctrl} + mock.recorder = &MockRateLimitConfigProviderMockRecorder{mock} + return mock +} + +// EXPECT returns an object that allows the caller to indicate expected use +func (m *MockRateLimitConfigProvider) EXPECT() *MockRateLimitConfigProviderMockRecorder { + return m.recorder +} + +// ConfigUpdateEvent mocks base method +func (m *MockRateLimitConfigProvider) ConfigUpdateEvent() <-chan provider.ConfigUpdateEvent { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "ConfigUpdateEvent") + ret0, _ := ret[0].(<-chan provider.ConfigUpdateEvent) + return ret0 +} + +// ConfigUpdateEvent indicates an expected call of ConfigUpdateEvent +func (mr *MockRateLimitConfigProviderMockRecorder) ConfigUpdateEvent() *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ConfigUpdateEvent", reflect.TypeOf((*MockRateLimitConfigProvider)(nil).ConfigUpdateEvent)) +} + +// MockConfigUpdateEvent is a mock of ConfigUpdateEvent interface +type MockConfigUpdateEvent struct { + ctrl *gomock.Controller + recorder *MockConfigUpdateEventMockRecorder +} + +// MockConfigUpdateEventMockRecorder is the mock recorder for MockConfigUpdateEvent +type MockConfigUpdateEventMockRecorder struct { + mock *MockConfigUpdateEvent +} + +// NewMockConfigUpdateEvent creates a new mock instance +func NewMockConfigUpdateEvent(ctrl *gomock.Controller) *MockConfigUpdateEvent { + mock := &MockConfigUpdateEvent{ctrl: ctrl} + mock.recorder = &MockConfigUpdateEventMockRecorder{mock} + return mock +} + +// EXPECT returns an object that allows the caller to indicate expected use +func (m *MockConfigUpdateEvent) EXPECT() *MockConfigUpdateEventMockRecorder { + return m.recorder +} + +// GetConfig mocks base method +func (m *MockConfigUpdateEvent) GetConfig() (config.RateLimitConfig, any) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "GetConfig") + ret0, _ := ret[0].(config.RateLimitConfig) + ret1, _ := ret[1].(any) + return ret0, ret1 +} + +// GetConfig indicates an expected call of GetConfig +func (mr *MockConfigUpdateEventMockRecorder) GetConfig() *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetConfig", reflect.TypeOf((*MockConfigUpdateEvent)(nil).GetConfig)) +} diff --git a/test/service/ratelimit_test.go b/test/service/ratelimit_test.go index ce067cc31..a6bf44f2c 100644 --- a/test/service/ratelimit_test.go +++ b/test/service/ratelimit_test.go @@ -6,6 +6,7 @@ import ( "sync" "testing" + "github.com/envoyproxy/ratelimit/src/provider" "github.com/envoyproxy/ratelimit/src/stats" "github.com/envoyproxy/ratelimit/src/utils" @@ -25,6 +26,7 @@ import ( "github.com/envoyproxy/ratelimit/test/common" mock_config "github.com/envoyproxy/ratelimit/test/mocks/config" mock_limiter "github.com/envoyproxy/ratelimit/test/mocks/limiter" + mock_provider "github.com/envoyproxy/ratelimit/test/mocks/provider" mock_loader "github.com/envoyproxy/ratelimit/test/mocks/runtime/loader" mock_snapshot "github.com/envoyproxy/ratelimit/test/mocks/runtime/snapshot" mock_stats "github.com/envoyproxy/ratelimit/test/mocks/stats" @@ -63,9 +65,9 @@ type rateLimitServiceTestSuite struct { runtime *mock_loader.MockIFace snapshot *mock_snapshot.MockIFace cache *mock_limiter.MockRateLimitCache - configProvider *mock_config.MockRateLimitConfigProvider - configUpdateEventChan chan config.ConfigUpdateEvent - configUpdateEvent *mock_config.MockConfigUpdateEvent + configProvider *mock_provider.MockRateLimitConfigProvider + configUpdateEventChan chan provider.ConfigUpdateEvent + configUpdateEvent *mock_provider.MockConfigUpdateEvent configLoader *mock_config.MockRateLimitConfigLoader config *mock_config.MockRateLimitConfig runtimeUpdateCallback chan<- int @@ -87,9 +89,9 @@ func commonSetup(t *testing.T) rateLimitServiceTestSuite { // ret.runtime = mock_loader.NewMockIFace(ret.controller) // ret.snapshot = mock_snapshot.NewMockIFace(ret.controller) ret.cache = mock_limiter.NewMockRateLimitCache(ret.controller) - ret.configProvider = mock_config.NewMockRateLimitConfigProvider(ret.controller) - ret.configUpdateEventChan = make(chan config.ConfigUpdateEvent) - ret.configUpdateEvent = mock_config.NewMockConfigUpdateEvent(ret.controller) + ret.configProvider = mock_provider.NewMockRateLimitConfigProvider(ret.controller) + ret.configUpdateEventChan = make(chan provider.ConfigUpdateEvent) + ret.configUpdateEvent = mock_provider.NewMockConfigUpdateEvent(ret.controller) // ret.configLoader = mock_config.NewMockRateLimitConfigLoader(ret.controller) ret.config = mock_config.NewMockRateLimitConfig(ret.controller) ret.statStore = gostats.NewStore(gostats.NewNullSink(), false) From dd9a7036c09a15f229ad512ee51659de8f17d2e3 Mon Sep 17 00:00:00 2001 From: Renuka Fernando Date: Wed, 12 Oct 2022 17:50:56 +0530 Subject: [PATCH 05/22] Add config xDS client Signed-off-by: Renuka Fernando --- .../config/ratelimit/v3/rls_conf.proto | 7 +- go.mod | 6 +- go.sum | 30 ++- .../config/ratelimit/v3/rls_conf.pb.go | 232 ++++++------------ .../service/ratelimit/v3/rls_conf_ds.pb.go | 0 src/provider/file_provider.go | 4 +- src/provider/xds_grpc_sotw_provider.go | 211 ++++++++++++++++ src/service_cmd/runner/runner.go | 14 +- src/settings/settings.go | 8 + 9 files changed, 342 insertions(+), 170 deletions(-) rename src/{ => api}/ratelimit/config/ratelimit/v3/rls_conf.pb.go (58%) rename src/{ => api}/ratelimit/service/ratelimit/v3/rls_conf_ds.pb.go (100%) create mode 100644 src/provider/xds_grpc_sotw_provider.go diff --git a/api/ratelimit/config/ratelimit/v3/rls_conf.proto b/api/ratelimit/config/ratelimit/v3/rls_conf.proto index 79e9eea8e..9ae06095b 100644 --- a/api/ratelimit/config/ratelimit/v3/rls_conf.proto +++ b/api/ratelimit/config/ratelimit/v3/rls_conf.proto @@ -9,13 +9,8 @@ option go_package = "github.com/envoyproxy/go-control-plane/ratelimit/config/rat // [#protodoc-title: Rate Limit Config Discovery Service (RLS Conf DS)] -// Rate-limit domain model +// Rate-limit config model message RateLimitConfig { - repeated RateLimitDomainConfig domain_configs = 1; -} - -// Rate-limit domain config model -message RateLimitDomainConfig { string domain = 1; repeated RateLimitDescriptor descriptors = 2; } diff --git a/go.mod b/go.mod index 6036fa968..bbc7bdc19 100644 --- a/go.mod +++ b/go.mod @@ -7,9 +7,11 @@ require ( github.com/bradfitz/gomemcache v0.0.0-20190913173617-a41fca850d0b github.com/coocood/freecache v1.1.0 github.com/envoyproxy/go-control-plane v0.10.1 + github.com/ghodss/yaml v1.0.0 github.com/golang/mock v1.4.4 github.com/golang/protobuf v1.5.2 github.com/gorilla/mux v1.7.4-0.20191121170500-49c01487a141 + github.com/grpc-ecosystem/go-grpc-middleware v1.3.0 github.com/kavu/go_reuseport v1.2.0 github.com/kelseyhightower/envconfig v1.4.0 github.com/lyft/goruntime v0.3.0 @@ -18,7 +20,9 @@ require ( github.com/sirupsen/logrus v1.6.0 github.com/stretchr/testify v1.7.1 golang.org/x/net v0.0.0-20220909164309-bea034e7d591 + google.golang.org/genproto v0.0.0-20211118181313-81c1377c94b1 google.golang.org/grpc v1.45.0 + google.golang.org/protobuf v1.28.0 gopkg.in/yaml.v2 v2.3.0 ) @@ -30,8 +34,6 @@ require ( github.com/grpc-ecosystem/grpc-gateway/v2 v2.7.0 // indirect go.opentelemetry.io/otel/exporters/otlp/internal/retry v1.6.3 // indirect golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1 // indirect - google.golang.org/genproto v0.0.0-20211118181313-81c1377c94b1 // indirect - google.golang.org/protobuf v1.28.0 // indirect gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c // indirect ) diff --git a/go.sum b/go.sum index ce127e131..a84b7dbca 100644 --- a/go.sum +++ b/go.sum @@ -36,12 +36,8 @@ github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03 github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo= github.com/OneOfOne/xxhash v1.2.2 h1:KMrpdQIwFcEqXDklaen+P1axHaj9BSKzvpUUfnHldSE= github.com/OneOfOne/xxhash v1.2.2/go.mod h1:HSdplMjZKSmBqAxg5vPj2TmRDmfkzw+cTzAElWljhcU= -github.com/alicebob/gopher-json v0.0.0-20180125190556-5a6b3ba71ee6 h1:45bxf7AZMwWcqkLzDAQugVEwedisr5nRJ1r+7LYnv0U= -github.com/alicebob/gopher-json v0.0.0-20180125190556-5a6b3ba71ee6/go.mod h1:SGnFV6hVsYE877CKEZ6tDNTjaSXYUk6QqoIK6PrAtcc= github.com/alicebob/gopher-json v0.0.0-20200520072559-a9ecdc9d1d3a h1:HbKu58rmZpUGpz5+4FfNmIU+FmZg2P3Xaj2v2bfNWmk= github.com/alicebob/gopher-json v0.0.0-20200520072559-a9ecdc9d1d3a/go.mod h1:SGnFV6hVsYE877CKEZ6tDNTjaSXYUk6QqoIK6PrAtcc= -github.com/alicebob/miniredis/v2 v2.11.4 h1:GsuyeunTx7EllZBU3/6Ji3dhMQZDpC9rLf1luJ+6M5M= -github.com/alicebob/miniredis/v2 v2.11.4/go.mod h1:VL3UDEfAH59bSa7MuHMuFToxkqyHh69s/WUbYlOAuyg= github.com/alicebob/miniredis/v2 v2.23.0 h1:+lwAJYjvvdIVg6doFHuotFjueJ/7KY10xo/vm3X3Scw= github.com/alicebob/miniredis/v2 v2.23.0/go.mod h1:XNqvJdQJv5mSuVMc0ynneafpnL/zv52acZ6kqeS0t88= github.com/antihax/optional v1.0.0/go.mod h1:uupD/76wgC+ih3iEmQUL+0Ugr19nfwCT1kdvxnR2qWY= @@ -83,15 +79,20 @@ github.com/envoyproxy/protoc-gen-validate v0.1.0 h1:EQciDnbrYxy13PgWoY8AqoxGiPrp github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= github.com/fsnotify/fsnotify v1.4.9 h1:hsms1Qyu0jgnwNXIxa+/V/PDsU6CfLf6CNO8H7IWoS4= github.com/fsnotify/fsnotify v1.4.9/go.mod h1:znqG4EE+3YCdAaPaxE2ZRY/06pZUdp0tY4IgpuI1SZQ= +github.com/ghodss/yaml v1.0.0 h1:wQHKEahhL6wmXdzwWG11gIVCkOv05bNOh+Rxn0yngAk= github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= github.com/go-gl/glfw v0.0.0-20190409004039-e6da0acd62b1/go.mod h1:vR7hzQXu2zJy9AVAgeJqvqgH9Q5CA+iKCZ2gyEVpxRU= github.com/go-gl/glfw/v3.3/glfw v0.0.0-20191125211704-12ad95a8df72/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= github.com/go-gl/glfw/v3.3/glfw v0.0.0-20200222043503-6f7a984d4dc4/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= +github.com/go-kit/kit v0.9.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as= +github.com/go-logfmt/logfmt v0.4.0/go.mod h1:3RMwSq7FuexP4Kalkev3ejPJsZTpXXBr9+V4qmtdjCk= github.com/go-logr/logr v1.2.2/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= github.com/go-logr/logr v1.2.3 h1:2DntVwHkVopvECVRSlL5PSo9eG+cAkDCuckLubN+rq0= github.com/go-logr/logr v1.2.3/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= github.com/go-logr/stdr v1.2.2 h1:hSWxHoqTgW2S2qGc0LTAI563KZ5YKYRhT3MFKZMbjag= github.com/go-logr/stdr v1.2.2/go.mod h1:mMo/vtBO5dYbehREoey6XUKy/eSumjCCveDpRre4VKE= +github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY= +github.com/gogo/protobuf v1.3.2/go.mod h1:P1XiOD3dCwIKUDQYPy72D8LYyHL2YPYrpS2s69NZV8Q= github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= github.com/golang/glog v1.0.0 h1:nfP3RFugxnNRyKgeWd4oI1nYvXpxrx8ck8ZrcizshdQ= github.com/golang/glog v1.0.0/go.mod h1:EWib/APOK0SL3dFbYqvxE3UYd8E6s1ouQ7iEp/0LWV4= @@ -123,8 +124,6 @@ github.com/golang/protobuf v1.4.3/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk= github.com/golang/protobuf v1.5.2 h1:ROPKBNFfQgOUMifHyP+KYbvpjbdoFNs+aK7DXlji0Tw= github.com/golang/protobuf v1.5.2/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= -github.com/gomodule/redigo v1.7.1-0.20190322064113-39e2c31b7ca3 h1:6amM4HsNPOvMLVc2ZnyqrjeQ92YAVWn7T4WBKK87inY= -github.com/gomodule/redigo v1.7.1-0.20190322064113-39e2c31b7ca3/go.mod h1:B4C85qUVwatsJoIUNIfCRsp7qO0iAmpGFZ4EELWSbC4= github.com/google/btree v0.0.0-20180813153112-4030bb1f1f0c/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= github.com/google/btree v1.0.0/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M= @@ -155,6 +154,8 @@ github.com/googleapis/gax-go/v2 v2.0.4/go.mod h1:0Wqv26UfaUD9n4G6kQubkQ+KchISgw+ github.com/googleapis/gax-go/v2 v2.0.5/go.mod h1:DWXyrwAJ9X0FpwwEdw+IPEYBICEFu5mhpdKc/us6bOk= github.com/gorilla/mux v1.7.4-0.20191121170500-49c01487a141 h1:VQjjMh+uElTfioy6GnUrVrTMAiLTNF3xsrAlSwC+g8o= github.com/gorilla/mux v1.7.4-0.20191121170500-49c01487a141/go.mod h1:DVbg23sWSpFRCP0SfiEN6jmj59UnW/n46BH5rLB71So= +github.com/grpc-ecosystem/go-grpc-middleware v1.3.0 h1:+9834+KizmvFV7pXQGSXQTsaWhq2GjuNUt0aUU0YBYw= +github.com/grpc-ecosystem/go-grpc-middleware v1.3.0/go.mod h1:z0ButlSOZa5vEBq9m2m2hlwIgKw+rp3sdCBRoJY+30Y= github.com/grpc-ecosystem/grpc-gateway v1.16.0/go.mod h1:BDjrQk3hbvj6Nolgz8mAMFbcEtjT1g+wF4CSlocrBnw= github.com/grpc-ecosystem/grpc-gateway/v2 v2.7.0 h1:BZHcxBETFHIdVyhyEfOvn/RdU/QGdLI4y34qQGjGWO0= github.com/grpc-ecosystem/grpc-gateway/v2 v2.7.0/go.mod h1:hgWBS7lorOAVIJEQMi4ZsPv9hVvWI6+ch50m39Pf2Ks= @@ -167,9 +168,12 @@ github.com/kavu/go_reuseport v1.2.0 h1:YO+pt6m5Z3WkVH9DjaDJzoSS/0FO2Q8x3CfObxk/i github.com/kavu/go_reuseport v1.2.0/go.mod h1:CG8Ee7ceMFSMnx/xr25Vm0qXaj2Z4i5PWoUx+JZ5/CU= github.com/kelseyhightower/envconfig v1.4.0 h1:Im6hONhd3pLkfDFsbRgu68RDNkGF1r3dvMUtDTo2cv8= github.com/kelseyhightower/envconfig v1.4.0/go.mod h1:cccZRl6mQpaq41TPp5QxidR+Sa3axMbJDNb//FQX6Gg= +github.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI2bnpBCr8= github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= +github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= github.com/konsorten/go-windows-terminal-sequences v1.0.3 h1:CE8S1cTafDpPvMhIxNJKvHsGVBgn1xWYf1NbHQhywc8= github.com/konsorten/go-windows-terminal-sequences v1.0.3/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= +github.com/kr/logfmt v0.0.0-20140226030751-b84e30acd515/go.mod h1:+0opPa2QZZtGFBFZlji/RkVcI2GknAs/DXo4wKdlNEc= github.com/kr/pretty v0.1.0 h1:L/CwN0zerZDmRFUapSPitk6f+Q3+0za1rQkzVuMiMFI= github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= @@ -181,16 +185,20 @@ github.com/lyft/gostats v0.4.1 h1:oR6p4HRCGxt0nUntmZIWmYMgyothBi3eZH2A71vRjsc= github.com/lyft/gostats v0.4.1/go.mod h1:Tpx2xRzz4t+T2Tx0xdVgIoBdR2UMVz+dKnE3X01XSd8= github.com/mediocregopher/radix/v3 v3.8.1 h1:rOkHflVuulFKlwsLY01/M2cM2tWCjDoETcMqKbAWu1M= github.com/mediocregopher/radix/v3 v3.8.1/go.mod h1:8FL3F6UQRXHXIBSPUs5h0RybMF8i4n7wVopoX3x7Bv8= +github.com/opentracing/opentracing-go v1.1.0/go.mod h1:UkNAQd3GIcIGf0SeVgPpRdFStlNbqXla1AfSYxPUl2o= +github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= github.com/rogpeppe/fastuuid v1.2.0/go.mod h1:jVj6XXZzXRy/MSR5jhDC/2q6DgLz+nrA6LYCDYWNEvQ= github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= +github.com/sirupsen/logrus v1.4.2/go.mod h1:tLMulIdttU9McNUspp0xgXVQah82FyeX6MwdIuYE2rE= github.com/sirupsen/logrus v1.6.0 h1:UBcNElsrwanuuMsnGSlYmtmgbb23qDR5dG+6X6Oo89I= github.com/sirupsen/logrus v1.6.0/go.mod h1:7uNnSEd1DgxDLC74fIahvMZmmYsHGZGEOFrfsX/uA88= github.com/spaolacci/murmur3 v0.0.0-20180118202830-f09979ecbc72 h1:qLC7fQah7D6K1B0ujays3HV9gkFtllcxhzImRR7ArPQ= github.com/spaolacci/murmur3 v0.0.0-20180118202830-f09979ecbc72/go.mod h1:JwIasOWyU6f++ZhiEuf87xNszmSA2myDM2Kzu9HwQUA= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= +github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/objx v0.2.0 h1:Hbg2NidpLE8veEBkEZTL3CvlkUIVzuU9jDplZO54c48= github.com/stretchr/objx v0.2.0/go.mod h1:qt09Ya8vawLte6SNmTgCsAVtYtaKzEcn8ATUoHMkEqE= github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= @@ -203,9 +211,8 @@ github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/ github.com/yuin/goldmark v1.1.25/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.1.32/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= +github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.3.5/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k= -github.com/yuin/gopher-lua v0.0.0-20191220021717-ab39c6098bdb h1:ZkM6LRnq40pR1Ox0hTHlnpkcOTuFIDQpZ1IN8rKKhX0= -github.com/yuin/gopher-lua v0.0.0-20191220021717-ab39c6098bdb/go.mod h1:gqRgreBUhTSL0GeU64rtZ3Uq3wtjOa/TB2YfrtkCbVQ= github.com/yuin/gopher-lua v0.0.0-20210529063254-f4c35e4016d9 h1:k/gmLsJDWwWqbLCur2yWnJzwQEKRcAHXo6seXGuSwWw= github.com/yuin/gopher-lua v0.0.0-20210529063254-f4c35e4016d9/go.mod h1:E1AXubJBdNmFERAOucpDIxNzeGfLzg0mYh+UfMWdChA= go.opencensus.io v0.21.0/go.mod h1:mSImk1erAIZhrmZN+AvHh14ztQfjbGwt4TtuofqLduU= @@ -238,8 +245,11 @@ go.opentelemetry.io/proto/otlp v0.7.0/go.mod h1:PqfVotwruBrMGOCsRd/89rSnXhoiJIqe go.opentelemetry.io/proto/otlp v0.15.0/go.mod h1:H7XAot3MsfNsj7EXtrA2q5xSNQ10UqI405h3+duxN4U= go.opentelemetry.io/proto/otlp v0.16.0 h1:WHzDWdXUvbc5bG2ObdrGfaNpQz7ft7QN9HHmJlbiB1E= go.opentelemetry.io/proto/otlp v0.16.0/go.mod h1:H7XAot3MsfNsj7EXtrA2q5xSNQ10UqI405h3+duxN4U= +go.uber.org/atomic v1.4.0/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE= go.uber.org/goleak v1.1.12 h1:gZAh5/EyT/HQwlpkCy6wTpqfH9H8Lz8zbm3dZh+OyzA= go.uber.org/goleak v1.1.12/go.mod h1:cwTWslyiVhfpKIDGSZEM2HlOvcqm+tG4zioyIeLoqMQ= +go.uber.org/multierr v1.1.0/go.mod h1:wR5kodmAFQ0UK8QlbwjlSNy0Z68gJhDJUG5sjR94q/0= +go.uber.org/zap v1.10.0/go.mod h1:vwi/ZaCAaUcBkycHslxD9B2zi4UTXhF60s6SWpuDF0Q= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20190510104115-cbcb75029529/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20190605123033-f99c8df09eb5/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= @@ -321,6 +331,7 @@ golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJ golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20200317015054-43a5402ce75a/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20200625203802-6e8e738ad208/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190204203706-41f3e6584952/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= @@ -407,9 +418,11 @@ golang.org/x/tools v0.0.0-20200501065659-ab2804fb9c9d/go.mod h1:EkVYQZoAsY45+roY golang.org/x/tools v0.0.0-20200512131952-2bc93b1c0c88/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= golang.org/x/tools v0.0.0-20200515010526-7d3b6ebf133d/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= golang.org/x/tools v0.0.0-20200618134242-20370b0cb4b2/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= +golang.org/x/tools v0.0.0-20200619180055-7c47624df98f/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= golang.org/x/tools v0.0.0-20200729194436-6467de6f59a7/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= golang.org/x/tools v0.0.0-20200804011535-6c149bb5ef0d/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= golang.org/x/tools v0.0.0-20200825202427-b303f430e36d/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= +golang.org/x/tools v0.0.0-20210106214847-113979e3529a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/tools v0.1.5/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= @@ -460,6 +473,7 @@ google.golang.org/genproto v0.0.0-20200228133532-8c2c7df3a383/go.mod h1:55QSHmfG google.golang.org/genproto v0.0.0-20200305110556-506484158171/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= google.golang.org/genproto v0.0.0-20200312145019-da6875a35672/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= google.golang.org/genproto v0.0.0-20200331122359-1ee6d9798940/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= +google.golang.org/genproto v0.0.0-20200423170343-7949de9c1215/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= google.golang.org/genproto v0.0.0-20200430143042-b979b6f78d84/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= google.golang.org/genproto v0.0.0-20200511104702-f5ebc3bea380/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= google.golang.org/genproto v0.0.0-20200513103714-09dca8ec2884/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= diff --git a/src/ratelimit/config/ratelimit/v3/rls_conf.pb.go b/src/api/ratelimit/config/ratelimit/v3/rls_conf.pb.go similarity index 58% rename from src/ratelimit/config/ratelimit/v3/rls_conf.pb.go rename to src/api/ratelimit/config/ratelimit/v3/rls_conf.pb.go index 5ba9876f5..f9e68eb4a 100644 --- a/src/ratelimit/config/ratelimit/v3/rls_conf.pb.go +++ b/src/api/ratelimit/config/ratelimit/v3/rls_conf.pb.go @@ -21,13 +21,14 @@ const ( _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) ) -// Rate-limit domain model +// Rate-limit config model type RateLimitConfig struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - DomainConfigs []*RateLimitDomainConfig `protobuf:"bytes,1,rep,name=domain_configs,json=domainConfigs,proto3" json:"domain_configs,omitempty"` + Domain string `protobuf:"bytes,1,opt,name=domain,proto3" json:"domain,omitempty"` + Descriptors []*RateLimitDescriptor `protobuf:"bytes,2,rep,name=descriptors,proto3" json:"descriptors,omitempty"` } func (x *RateLimitConfig) Reset() { @@ -62,63 +63,14 @@ func (*RateLimitConfig) Descriptor() ([]byte, []int) { return file_ratelimit_config_ratelimit_v3_rls_conf_proto_rawDescGZIP(), []int{0} } -func (x *RateLimitConfig) GetDomainConfigs() []*RateLimitDomainConfig { - if x != nil { - return x.DomainConfigs - } - return nil -} - -// Rate-limit domain config model -type RateLimitDomainConfig struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Domain string `protobuf:"bytes,1,opt,name=domain,proto3" json:"domain,omitempty"` - Descriptors []*RateLimitDescriptor `protobuf:"bytes,2,rep,name=descriptors,proto3" json:"descriptors,omitempty"` -} - -func (x *RateLimitDomainConfig) Reset() { - *x = RateLimitDomainConfig{} - if protoimpl.UnsafeEnabled { - mi := &file_ratelimit_config_ratelimit_v3_rls_conf_proto_msgTypes[1] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *RateLimitDomainConfig) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*RateLimitDomainConfig) ProtoMessage() {} - -func (x *RateLimitDomainConfig) ProtoReflect() protoreflect.Message { - mi := &file_ratelimit_config_ratelimit_v3_rls_conf_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 RateLimitDomainConfig.ProtoReflect.Descriptor instead. -func (*RateLimitDomainConfig) Descriptor() ([]byte, []int) { - return file_ratelimit_config_ratelimit_v3_rls_conf_proto_rawDescGZIP(), []int{1} -} - -func (x *RateLimitDomainConfig) GetDomain() string { +func (x *RateLimitConfig) GetDomain() string { if x != nil { return x.Domain } return "" } -func (x *RateLimitDomainConfig) GetDescriptors() []*RateLimitDescriptor { +func (x *RateLimitConfig) GetDescriptors() []*RateLimitDescriptor { if x != nil { return x.Descriptors } @@ -141,7 +93,7 @@ type RateLimitDescriptor struct { func (x *RateLimitDescriptor) Reset() { *x = RateLimitDescriptor{} if protoimpl.UnsafeEnabled { - mi := &file_ratelimit_config_ratelimit_v3_rls_conf_proto_msgTypes[2] + mi := &file_ratelimit_config_ratelimit_v3_rls_conf_proto_msgTypes[1] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -154,7 +106,7 @@ func (x *RateLimitDescriptor) String() string { func (*RateLimitDescriptor) ProtoMessage() {} func (x *RateLimitDescriptor) ProtoReflect() protoreflect.Message { - mi := &file_ratelimit_config_ratelimit_v3_rls_conf_proto_msgTypes[2] + mi := &file_ratelimit_config_ratelimit_v3_rls_conf_proto_msgTypes[1] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -167,7 +119,7 @@ func (x *RateLimitDescriptor) ProtoReflect() protoreflect.Message { // Deprecated: Use RateLimitDescriptor.ProtoReflect.Descriptor instead. func (*RateLimitDescriptor) Descriptor() ([]byte, []int) { - return file_ratelimit_config_ratelimit_v3_rls_conf_proto_rawDescGZIP(), []int{2} + return file_ratelimit_config_ratelimit_v3_rls_conf_proto_rawDescGZIP(), []int{1} } func (x *RateLimitDescriptor) GetKey() string { @@ -221,7 +173,7 @@ type RateLimitPolicy struct { func (x *RateLimitPolicy) Reset() { *x = RateLimitPolicy{} if protoimpl.UnsafeEnabled { - mi := &file_ratelimit_config_ratelimit_v3_rls_conf_proto_msgTypes[3] + mi := &file_ratelimit_config_ratelimit_v3_rls_conf_proto_msgTypes[2] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -234,7 +186,7 @@ func (x *RateLimitPolicy) String() string { func (*RateLimitPolicy) ProtoMessage() {} func (x *RateLimitPolicy) ProtoReflect() protoreflect.Message { - mi := &file_ratelimit_config_ratelimit_v3_rls_conf_proto_msgTypes[3] + mi := &file_ratelimit_config_ratelimit_v3_rls_conf_proto_msgTypes[2] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -247,7 +199,7 @@ func (x *RateLimitPolicy) ProtoReflect() protoreflect.Message { // Deprecated: Use RateLimitPolicy.ProtoReflect.Descriptor instead. func (*RateLimitPolicy) Descriptor() ([]byte, []int) { - return file_ratelimit_config_ratelimit_v3_rls_conf_proto_rawDescGZIP(), []int{3} + return file_ratelimit_config_ratelimit_v3_rls_conf_proto_rawDescGZIP(), []int{2} } func (x *RateLimitPolicy) GetUnit() string { @@ -297,7 +249,7 @@ type RateLimitReplace struct { func (x *RateLimitReplace) Reset() { *x = RateLimitReplace{} if protoimpl.UnsafeEnabled { - mi := &file_ratelimit_config_ratelimit_v3_rls_conf_proto_msgTypes[4] + mi := &file_ratelimit_config_ratelimit_v3_rls_conf_proto_msgTypes[3] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -310,7 +262,7 @@ func (x *RateLimitReplace) String() string { func (*RateLimitReplace) ProtoMessage() {} func (x *RateLimitReplace) ProtoReflect() protoreflect.Message { - mi := &file_ratelimit_config_ratelimit_v3_rls_conf_proto_msgTypes[4] + mi := &file_ratelimit_config_ratelimit_v3_rls_conf_proto_msgTypes[3] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -323,7 +275,7 @@ func (x *RateLimitReplace) ProtoReflect() protoreflect.Message { // Deprecated: Use RateLimitReplace.ProtoReflect.Descriptor instead. func (*RateLimitReplace) Descriptor() ([]byte, []int) { - return file_ratelimit_config_ratelimit_v3_rls_conf_proto_rawDescGZIP(), []int{4} + return file_ratelimit_config_ratelimit_v3_rls_conf_proto_rawDescGZIP(), []int{3} } func (x *RateLimitReplace) GetName() string { @@ -340,65 +292,57 @@ var file_ratelimit_config_ratelimit_v3_rls_conf_proto_rawDesc = []byte{ 0x69, 0x67, 0x2f, 0x72, 0x61, 0x74, 0x65, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x2f, 0x76, 0x33, 0x2f, 0x72, 0x6c, 0x73, 0x5f, 0x63, 0x6f, 0x6e, 0x66, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x1d, 0x72, 0x61, 0x74, 0x65, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x2e, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, - 0x2e, 0x72, 0x61, 0x74, 0x65, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x2e, 0x76, 0x33, 0x22, 0x6e, 0x0a, + 0x2e, 0x72, 0x61, 0x74, 0x65, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x2e, 0x76, 0x33, 0x22, 0x7f, 0x0a, 0x0f, 0x52, 0x61, 0x74, 0x65, 0x4c, 0x69, 0x6d, 0x69, 0x74, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, - 0x12, 0x5b, 0x0a, 0x0e, 0x64, 0x6f, 0x6d, 0x61, 0x69, 0x6e, 0x5f, 0x63, 0x6f, 0x6e, 0x66, 0x69, - 0x67, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x34, 0x2e, 0x72, 0x61, 0x74, 0x65, 0x6c, - 0x69, 0x6d, 0x69, 0x74, 0x2e, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2e, 0x72, 0x61, 0x74, 0x65, - 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x2e, 0x76, 0x33, 0x2e, 0x52, 0x61, 0x74, 0x65, 0x4c, 0x69, 0x6d, - 0x69, 0x74, 0x44, 0x6f, 0x6d, 0x61, 0x69, 0x6e, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x52, 0x0d, - 0x64, 0x6f, 0x6d, 0x61, 0x69, 0x6e, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x73, 0x22, 0x85, 0x01, - 0x0a, 0x15, 0x52, 0x61, 0x74, 0x65, 0x4c, 0x69, 0x6d, 0x69, 0x74, 0x44, 0x6f, 0x6d, 0x61, 0x69, - 0x6e, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x12, 0x16, 0x0a, 0x06, 0x64, 0x6f, 0x6d, 0x61, 0x69, - 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x64, 0x6f, 0x6d, 0x61, 0x69, 0x6e, 0x12, - 0x54, 0x0a, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x6f, 0x72, 0x73, 0x18, 0x02, - 0x20, 0x03, 0x28, 0x0b, 0x32, 0x32, 0x2e, 0x72, 0x61, 0x74, 0x65, 0x6c, 0x69, 0x6d, 0x69, 0x74, - 0x2e, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2e, 0x72, 0x61, 0x74, 0x65, 0x6c, 0x69, 0x6d, 0x69, - 0x74, 0x2e, 0x76, 0x33, 0x2e, 0x52, 0x61, 0x74, 0x65, 0x4c, 0x69, 0x6d, 0x69, 0x74, 0x44, 0x65, - 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x6f, 0x72, 0x52, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, - 0x70, 0x74, 0x6f, 0x72, 0x73, 0x22, 0x83, 0x02, 0x0a, 0x13, 0x52, 0x61, 0x74, 0x65, 0x4c, 0x69, - 0x6d, 0x69, 0x74, 0x44, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x6f, 0x72, 0x12, 0x10, 0x0a, - 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, - 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, - 0x76, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x4d, 0x0a, 0x0a, 0x72, 0x61, 0x74, 0x65, 0x5f, 0x6c, 0x69, - 0x6d, 0x69, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2e, 0x2e, 0x72, 0x61, 0x74, 0x65, - 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x2e, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2e, 0x72, 0x61, 0x74, - 0x65, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x2e, 0x76, 0x33, 0x2e, 0x52, 0x61, 0x74, 0x65, 0x4c, 0x69, - 0x6d, 0x69, 0x74, 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x52, 0x09, 0x72, 0x61, 0x74, 0x65, 0x4c, - 0x69, 0x6d, 0x69, 0x74, 0x12, 0x54, 0x0a, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, - 0x6f, 0x72, 0x73, 0x18, 0x04, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x32, 0x2e, 0x72, 0x61, 0x74, 0x65, - 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x2e, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2e, 0x72, 0x61, 0x74, - 0x65, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x2e, 0x76, 0x33, 0x2e, 0x52, 0x61, 0x74, 0x65, 0x4c, 0x69, - 0x6d, 0x69, 0x74, 0x44, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x6f, 0x72, 0x52, 0x0b, 0x64, - 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x6f, 0x72, 0x73, 0x12, 0x1f, 0x0a, 0x0b, 0x73, 0x68, - 0x61, 0x64, 0x6f, 0x77, 0x5f, 0x6d, 0x6f, 0x64, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x08, 0x52, - 0x0a, 0x73, 0x68, 0x61, 0x64, 0x6f, 0x77, 0x4d, 0x6f, 0x64, 0x65, 0x22, 0xd0, 0x01, 0x0a, 0x0f, - 0x52, 0x61, 0x74, 0x65, 0x4c, 0x69, 0x6d, 0x69, 0x74, 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x12, - 0x12, 0x0a, 0x04, 0x75, 0x6e, 0x69, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x75, - 0x6e, 0x69, 0x74, 0x12, 0x2a, 0x0a, 0x11, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x73, 0x5f, - 0x70, 0x65, 0x72, 0x5f, 0x75, 0x6e, 0x69, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x0f, - 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x73, 0x50, 0x65, 0x72, 0x55, 0x6e, 0x69, 0x74, 0x12, - 0x1c, 0x0a, 0x09, 0x75, 0x6e, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x65, 0x64, 0x18, 0x03, 0x20, 0x01, - 0x28, 0x08, 0x52, 0x09, 0x75, 0x6e, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x65, 0x64, 0x12, 0x12, 0x0a, - 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, - 0x65, 0x12, 0x4b, 0x0a, 0x08, 0x72, 0x65, 0x70, 0x6c, 0x61, 0x63, 0x65, 0x73, 0x18, 0x05, 0x20, - 0x03, 0x28, 0x0b, 0x32, 0x2f, 0x2e, 0x72, 0x61, 0x74, 0x65, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x2e, - 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2e, 0x72, 0x61, 0x74, 0x65, 0x6c, 0x69, 0x6d, 0x69, 0x74, - 0x2e, 0x76, 0x33, 0x2e, 0x52, 0x61, 0x74, 0x65, 0x4c, 0x69, 0x6d, 0x69, 0x74, 0x52, 0x65, 0x70, - 0x6c, 0x61, 0x63, 0x65, 0x52, 0x08, 0x72, 0x65, 0x70, 0x6c, 0x61, 0x63, 0x65, 0x73, 0x22, 0x26, - 0x0a, 0x10, 0x52, 0x61, 0x74, 0x65, 0x4c, 0x69, 0x6d, 0x69, 0x74, 0x52, 0x65, 0x70, 0x6c, 0x61, - 0x63, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, - 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x42, 0x91, 0x01, 0x0a, 0x2b, 0x69, 0x6f, 0x2e, 0x65, 0x6e, - 0x76, 0x6f, 0x79, 0x70, 0x72, 0x6f, 0x78, 0x79, 0x2e, 0x72, 0x61, 0x74, 0x65, 0x6c, 0x69, 0x6d, - 0x69, 0x74, 0x2e, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2e, 0x72, 0x61, 0x74, 0x65, 0x6c, 0x69, - 0x6d, 0x69, 0x74, 0x2e, 0x76, 0x33, 0x42, 0x0e, 0x52, 0x6c, 0x73, 0x43, 0x6f, 0x6e, 0x66, 0x69, - 0x67, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x50, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, - 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x65, 0x6e, 0x76, 0x6f, 0x79, 0x70, 0x72, 0x6f, 0x78, 0x79, 0x2f, - 0x67, 0x6f, 0x2d, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x2d, 0x70, 0x6c, 0x61, 0x6e, 0x65, - 0x2f, 0x72, 0x61, 0x74, 0x65, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x2f, 0x63, 0x6f, 0x6e, 0x66, 0x69, - 0x67, 0x2f, 0x72, 0x61, 0x74, 0x65, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x2f, 0x76, 0x33, 0x3b, 0x72, - 0x61, 0x74, 0x65, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x76, 0x33, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, - 0x6f, 0x33, + 0x12, 0x16, 0x0a, 0x06, 0x64, 0x6f, 0x6d, 0x61, 0x69, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x06, 0x64, 0x6f, 0x6d, 0x61, 0x69, 0x6e, 0x12, 0x54, 0x0a, 0x0b, 0x64, 0x65, 0x73, 0x63, + 0x72, 0x69, 0x70, 0x74, 0x6f, 0x72, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x32, 0x2e, + 0x72, 0x61, 0x74, 0x65, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x2e, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, + 0x2e, 0x72, 0x61, 0x74, 0x65, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x2e, 0x76, 0x33, 0x2e, 0x52, 0x61, + 0x74, 0x65, 0x4c, 0x69, 0x6d, 0x69, 0x74, 0x44, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x6f, + 0x72, 0x52, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x6f, 0x72, 0x73, 0x22, 0x83, + 0x02, 0x0a, 0x13, 0x52, 0x61, 0x74, 0x65, 0x4c, 0x69, 0x6d, 0x69, 0x74, 0x44, 0x65, 0x73, 0x63, + 0x72, 0x69, 0x70, 0x74, 0x6f, 0x72, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, + 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x4d, + 0x0a, 0x0a, 0x72, 0x61, 0x74, 0x65, 0x5f, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x18, 0x03, 0x20, 0x01, + 0x28, 0x0b, 0x32, 0x2e, 0x2e, 0x72, 0x61, 0x74, 0x65, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x2e, 0x63, + 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2e, 0x72, 0x61, 0x74, 0x65, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x2e, + 0x76, 0x33, 0x2e, 0x52, 0x61, 0x74, 0x65, 0x4c, 0x69, 0x6d, 0x69, 0x74, 0x50, 0x6f, 0x6c, 0x69, + 0x63, 0x79, 0x52, 0x09, 0x72, 0x61, 0x74, 0x65, 0x4c, 0x69, 0x6d, 0x69, 0x74, 0x12, 0x54, 0x0a, + 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x6f, 0x72, 0x73, 0x18, 0x04, 0x20, 0x03, + 0x28, 0x0b, 0x32, 0x32, 0x2e, 0x72, 0x61, 0x74, 0x65, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x2e, 0x63, + 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2e, 0x72, 0x61, 0x74, 0x65, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x2e, + 0x76, 0x33, 0x2e, 0x52, 0x61, 0x74, 0x65, 0x4c, 0x69, 0x6d, 0x69, 0x74, 0x44, 0x65, 0x73, 0x63, + 0x72, 0x69, 0x70, 0x74, 0x6f, 0x72, 0x52, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, + 0x6f, 0x72, 0x73, 0x12, 0x1f, 0x0a, 0x0b, 0x73, 0x68, 0x61, 0x64, 0x6f, 0x77, 0x5f, 0x6d, 0x6f, + 0x64, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0a, 0x73, 0x68, 0x61, 0x64, 0x6f, 0x77, + 0x4d, 0x6f, 0x64, 0x65, 0x22, 0xd0, 0x01, 0x0a, 0x0f, 0x52, 0x61, 0x74, 0x65, 0x4c, 0x69, 0x6d, + 0x69, 0x74, 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x12, 0x12, 0x0a, 0x04, 0x75, 0x6e, 0x69, 0x74, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x75, 0x6e, 0x69, 0x74, 0x12, 0x2a, 0x0a, 0x11, + 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x73, 0x5f, 0x70, 0x65, 0x72, 0x5f, 0x75, 0x6e, 0x69, + 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x0f, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, + 0x73, 0x50, 0x65, 0x72, 0x55, 0x6e, 0x69, 0x74, 0x12, 0x1c, 0x0a, 0x09, 0x75, 0x6e, 0x6c, 0x69, + 0x6d, 0x69, 0x74, 0x65, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x08, 0x52, 0x09, 0x75, 0x6e, 0x6c, + 0x69, 0x6d, 0x69, 0x74, 0x65, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x04, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x4b, 0x0a, 0x08, 0x72, 0x65, + 0x70, 0x6c, 0x61, 0x63, 0x65, 0x73, 0x18, 0x05, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x2f, 0x2e, 0x72, + 0x61, 0x74, 0x65, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x2e, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2e, + 0x72, 0x61, 0x74, 0x65, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x2e, 0x76, 0x33, 0x2e, 0x52, 0x61, 0x74, + 0x65, 0x4c, 0x69, 0x6d, 0x69, 0x74, 0x52, 0x65, 0x70, 0x6c, 0x61, 0x63, 0x65, 0x52, 0x08, 0x72, + 0x65, 0x70, 0x6c, 0x61, 0x63, 0x65, 0x73, 0x22, 0x26, 0x0a, 0x10, 0x52, 0x61, 0x74, 0x65, 0x4c, + 0x69, 0x6d, 0x69, 0x74, 0x52, 0x65, 0x70, 0x6c, 0x61, 0x63, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x6e, + 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x42, + 0x91, 0x01, 0x0a, 0x2b, 0x69, 0x6f, 0x2e, 0x65, 0x6e, 0x76, 0x6f, 0x79, 0x70, 0x72, 0x6f, 0x78, + 0x79, 0x2e, 0x72, 0x61, 0x74, 0x65, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x2e, 0x63, 0x6f, 0x6e, 0x66, + 0x69, 0x67, 0x2e, 0x72, 0x61, 0x74, 0x65, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x2e, 0x76, 0x33, 0x42, + 0x0e, 0x52, 0x6c, 0x73, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, + 0x01, 0x5a, 0x50, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x65, 0x6e, + 0x76, 0x6f, 0x79, 0x70, 0x72, 0x6f, 0x78, 0x79, 0x2f, 0x67, 0x6f, 0x2d, 0x63, 0x6f, 0x6e, 0x74, + 0x72, 0x6f, 0x6c, 0x2d, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2f, 0x72, 0x61, 0x74, 0x65, 0x6c, 0x69, + 0x6d, 0x69, 0x74, 0x2f, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2f, 0x72, 0x61, 0x74, 0x65, 0x6c, + 0x69, 0x6d, 0x69, 0x74, 0x2f, 0x76, 0x33, 0x3b, 0x72, 0x61, 0x74, 0x65, 0x6c, 0x69, 0x6d, 0x69, + 0x74, 0x76, 0x33, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -414,27 +358,25 @@ func file_ratelimit_config_ratelimit_v3_rls_conf_proto_rawDescGZIP() []byte { } var ( - file_ratelimit_config_ratelimit_v3_rls_conf_proto_msgTypes = make([]protoimpl.MessageInfo, 5) + file_ratelimit_config_ratelimit_v3_rls_conf_proto_msgTypes = make([]protoimpl.MessageInfo, 4) file_ratelimit_config_ratelimit_v3_rls_conf_proto_goTypes = []interface{}{ - (*RateLimitConfig)(nil), // 0: ratelimit.config.ratelimit.v3.RateLimitConfig - (*RateLimitDomainConfig)(nil), // 1: ratelimit.config.ratelimit.v3.RateLimitDomainConfig - (*RateLimitDescriptor)(nil), // 2: ratelimit.config.ratelimit.v3.RateLimitDescriptor - (*RateLimitPolicy)(nil), // 3: ratelimit.config.ratelimit.v3.RateLimitPolicy - (*RateLimitReplace)(nil), // 4: ratelimit.config.ratelimit.v3.RateLimitReplace + (*RateLimitConfig)(nil), // 0: ratelimit.config.ratelimit.v3.RateLimitConfig + (*RateLimitDescriptor)(nil), // 1: ratelimit.config.ratelimit.v3.RateLimitDescriptor + (*RateLimitPolicy)(nil), // 2: ratelimit.config.ratelimit.v3.RateLimitPolicy + (*RateLimitReplace)(nil), // 3: ratelimit.config.ratelimit.v3.RateLimitReplace } ) var file_ratelimit_config_ratelimit_v3_rls_conf_proto_depIdxs = []int32{ - 1, // 0: ratelimit.config.ratelimit.v3.RateLimitConfig.domain_configs:type_name -> ratelimit.config.ratelimit.v3.RateLimitDomainConfig - 2, // 1: ratelimit.config.ratelimit.v3.RateLimitDomainConfig.descriptors:type_name -> ratelimit.config.ratelimit.v3.RateLimitDescriptor - 3, // 2: ratelimit.config.ratelimit.v3.RateLimitDescriptor.rate_limit:type_name -> ratelimit.config.ratelimit.v3.RateLimitPolicy - 2, // 3: ratelimit.config.ratelimit.v3.RateLimitDescriptor.descriptors:type_name -> ratelimit.config.ratelimit.v3.RateLimitDescriptor - 4, // 4: ratelimit.config.ratelimit.v3.RateLimitPolicy.replaces:type_name -> ratelimit.config.ratelimit.v3.RateLimitReplace - 5, // [5:5] is the sub-list for method output_type - 5, // [5:5] is the sub-list for method input_type - 5, // [5:5] is the sub-list for extension type_name - 5, // [5:5] is the sub-list for extension extendee - 0, // [0:5] is the sub-list for field type_name + 1, // 0: ratelimit.config.ratelimit.v3.RateLimitConfig.descriptors:type_name -> ratelimit.config.ratelimit.v3.RateLimitDescriptor + 2, // 1: ratelimit.config.ratelimit.v3.RateLimitDescriptor.rate_limit:type_name -> ratelimit.config.ratelimit.v3.RateLimitPolicy + 1, // 2: ratelimit.config.ratelimit.v3.RateLimitDescriptor.descriptors:type_name -> ratelimit.config.ratelimit.v3.RateLimitDescriptor + 3, // 3: ratelimit.config.ratelimit.v3.RateLimitPolicy.replaces:type_name -> ratelimit.config.ratelimit.v3.RateLimitReplace + 4, // [4:4] is the sub-list for method output_type + 4, // [4:4] is the sub-list for method input_type + 4, // [4:4] is the sub-list for extension type_name + 4, // [4:4] is the sub-list for extension extendee + 0, // [0:4] is the sub-list for field type_name } func init() { file_ratelimit_config_ratelimit_v3_rls_conf_proto_init() } @@ -456,18 +398,6 @@ func file_ratelimit_config_ratelimit_v3_rls_conf_proto_init() { } } file_ratelimit_config_ratelimit_v3_rls_conf_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*RateLimitDomainConfig); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_ratelimit_config_ratelimit_v3_rls_conf_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*RateLimitDescriptor); i { case 0: return &v.state @@ -479,7 +409,7 @@ func file_ratelimit_config_ratelimit_v3_rls_conf_proto_init() { return nil } } - file_ratelimit_config_ratelimit_v3_rls_conf_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { + file_ratelimit_config_ratelimit_v3_rls_conf_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*RateLimitPolicy); i { case 0: return &v.state @@ -491,7 +421,7 @@ func file_ratelimit_config_ratelimit_v3_rls_conf_proto_init() { return nil } } - file_ratelimit_config_ratelimit_v3_rls_conf_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { + file_ratelimit_config_ratelimit_v3_rls_conf_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*RateLimitReplace); i { case 0: return &v.state @@ -510,7 +440,7 @@ func file_ratelimit_config_ratelimit_v3_rls_conf_proto_init() { GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_ratelimit_config_ratelimit_v3_rls_conf_proto_rawDesc, NumEnums: 0, - NumMessages: 5, + NumMessages: 4, NumExtensions: 0, NumServices: 0, }, diff --git a/src/ratelimit/service/ratelimit/v3/rls_conf_ds.pb.go b/src/api/ratelimit/service/ratelimit/v3/rls_conf_ds.pb.go similarity index 100% rename from src/ratelimit/service/ratelimit/v3/rls_conf_ds.pb.go rename to src/api/ratelimit/service/ratelimit/v3/rls_conf_ds.pb.go diff --git a/src/provider/file_provider.go b/src/provider/file_provider.go index 8206f543b..f2ec72f2b 100644 --- a/src/provider/file_provider.go +++ b/src/provider/file_provider.go @@ -57,7 +57,7 @@ func (p *FileProvider) sendEvent() { continue } - files = append(files, config.RateLimitConfigToLoad{key, snapshot.Get(key)}) + files = append(files, config.RateLimitConfigToLoad{Name: key, FileBytes: snapshot.Get(key)}) } rlSettings := settings.NewSettings() @@ -99,7 +99,7 @@ func (p *FileProvider) setupRuntime() { } } -func NewFileProvider(settings settings.Settings, rootStore gostats.Store, statsManager stats.Manager) RateLimitConfigProvider { +func NewFileProvider(settings settings.Settings, statsManager stats.Manager, rootStore gostats.Store) RateLimitConfigProvider { p := &FileProvider{ settings: settings, loader: config.NewRateLimitConfigLoaderImpl(), diff --git a/src/provider/xds_grpc_sotw_provider.go b/src/provider/xds_grpc_sotw_provider.go new file mode 100644 index 000000000..049a32b94 --- /dev/null +++ b/src/provider/xds_grpc_sotw_provider.go @@ -0,0 +1,211 @@ +package provider + +import ( + "context" + "io" + "strconv" + + core "github.com/envoyproxy/go-control-plane/envoy/config/core/v3" + discovery "github.com/envoyproxy/go-control-plane/envoy/service/discovery/v3" + "github.com/ghodss/yaml" + "github.com/golang/protobuf/ptypes/any" + grpc_retry "github.com/grpc-ecosystem/go-grpc-middleware/retry" + logger "github.com/sirupsen/logrus" + "google.golang.org/genproto/googleapis/rpc/status" + "google.golang.org/grpc" + "google.golang.org/grpc/credentials/insecure" + "google.golang.org/protobuf/proto" + "google.golang.org/protobuf/types/known/anypb" + + "github.com/envoyproxy/ratelimit/src/config" + "github.com/envoyproxy/ratelimit/src/settings" + "github.com/envoyproxy/ratelimit/src/stats" + + "google.golang.org/grpc/codes" + grpcStatus "google.golang.org/grpc/status" + + rls_conf_v3 "github.com/envoyproxy/ratelimit/src/api/ratelimit/config/ratelimit/v3" + rls_svc_v3 "github.com/envoyproxy/ratelimit/src/api/ratelimit/service/ratelimit/v3" +) + +const ( + configTypeURL string = "type.googleapis.com/ratelimit.config.ratelimit.v3.RateLimitConfig" +) + +type XdsGrpcSotwProvider struct { + settings settings.Settings + loader config.RateLimitConfigLoader + configUpdateEventChan chan ConfigUpdateEvent + statsManager stats.Manager + xdsStream rls_svc_v3.RateLimitConfigDiscoveryService_StreamRlsConfigsClient + lastAckedResponse *discovery.DiscoveryResponse + // TODO: (renuka) lastAckedResponse and lastReceivedResponse are equal + lastReceivedResponse *discovery.DiscoveryResponse + // If a connection error occurs, true event would be returned + connectionFaultChannel chan bool +} + +func NewXdsGrpcSotwProvider(settings settings.Settings, statsManager stats.Manager) RateLimitConfigProvider { + return &XdsGrpcSotwProvider{ + settings: settings, + statsManager: statsManager, + configUpdateEventChan: make(chan ConfigUpdateEvent), + loader: config.NewRateLimitConfigLoaderImpl(), + } +} + +func (p *XdsGrpcSotwProvider) ConfigUpdateEvent() <-chan ConfigUpdateEvent { + go p.initXdsClient() + return p.configUpdateEventChan +} + +func (p *XdsGrpcSotwProvider) initXdsClient() { + logger.Info("Starting xDS client connection for rate limit configurations") + conn := p.initializeAndWatch() + for retryTrueReceived := range p.connectionFaultChannel { + if !retryTrueReceived { + continue + } + if conn != nil { + conn.Close() + } + conn = p.initializeAndWatch() + } +} + +func (p *XdsGrpcSotwProvider) initializeAndWatch() *grpc.ClientConn { + conn, err := p.initConnection() + if err != nil { + p.connectionFaultChannel <- true + return conn + } + go p.watchConfigs() + + // TODO: (renuka) check this, no nil for all cases + var lastAppliedVersion string + if p.lastAckedResponse != nil { + // If the connection is interrupted in the middle, we need to apply if the version remains same + lastAppliedVersion = p.lastAckedResponse.VersionInfo + } else { + lastAppliedVersion = "" + } + discoveryRequest := &discovery.DiscoveryRequest{ + Node: &core.Node{Id: p.settings.ConfigGrpcXdsNodeId}, + VersionInfo: lastAppliedVersion, + TypeUrl: configTypeURL, + } + p.xdsStream.Send(discoveryRequest) + return conn +} + +func (p *XdsGrpcSotwProvider) watchConfigs() { + for { + discoveryResponse, err := p.xdsStream.Recv() + if err == io.EOF { + // reinitialize again, if stream ends + logger.Error("EOF is received from xDS Configuration Server") + p.connectionFaultChannel <- true + return + } + if err != nil { + logger.Errorf("Failed to receive the discovery response from xDS Configuration Server: %s", err.Error()) + errStatus, _ := grpcStatus.FromError(err) + if errStatus.Code() == codes.Unavailable { + logger.Errorf("Connection unavailable. errorCode: %s errorMessage: %s", + errStatus.Code().String(), errStatus.Message()) + p.connectionFaultChannel <- true + return + } + logger.Errorf("Error while xDS communication; errorCode: %s errorMessage: %s", + errStatus.Code().String(), errStatus.Message()) + p.nack(errStatus.Message()) + } else { + p.lastReceivedResponse = discoveryResponse + logger.Debugf("Discovery response is received from xDS Configuration Server with response version: %s", discoveryResponse.VersionInfo) + logger.Tracef("Discovery response received from xDS Configuration Server: %v", discoveryResponse) + p.sendConfigs(discoveryResponse.Resources) + } + } +} + +func (p *XdsGrpcSotwProvider) initConnection() (*grpc.ClientConn, error) { + conn, err := p.getGrpcConnection() + if err != nil { + logger.Errorf("Error initializing gRPC connection to xDS Configuration Server: %s", err.Error()) + return nil, err + } + p.xdsStream, err = rls_svc_v3.NewRateLimitConfigDiscoveryServiceClient(conn).StreamRlsConfigs(context.Background()) + if err != nil { + logger.Errorf("Error initializing gRPC stream to xDS Configuration Server: %s", err.Error()) + return nil, err + } + logger.Info("Connection to xDS Configuration Server is successful") + return conn, nil +} + +func (p *XdsGrpcSotwProvider) getGrpcConnection() (*grpc.ClientConn, error) { + backOff := grpc_retry.BackoffLinearWithJitter(p.settings.ConfigGrpcXdsServerConnectRetryInterval, 0.5) + logger.Infof("Dialing xDS Configuration Server: '%s'", p.settings.ConfigGrpcXdsServerUrl) + return grpc.Dial( + p.settings.ConfigGrpcXdsServerUrl, + grpc.WithTransportCredentials(insecure.NewCredentials()), + // grpc.WithTransportCredentials(generateTLSCredentialsForXdsClient()), + grpc.WithBlock(), + grpc.WithStreamInterceptor( + grpc_retry.StreamClientInterceptor(grpc_retry.WithBackoff(backOff)), + )) +} + +func (p *XdsGrpcSotwProvider) sendConfigs(resources []*any.Any) { + conf := make([]config.RateLimitConfigToLoad, 0, len(resources)) + for i, res := range resources { + confPb := &rls_conf_v3.RateLimitConfig{} + err := anypb.UnmarshalTo(res, confPb, proto.UnmarshalOptions{}) // err := ptypes.UnmarshalAny(res, config) + if err != nil { + logger.Errorf("Error while unmarshalling config from xDS Configuration Server: %s", err.Error()) + p.nack(err.Error()) + return + } + + logger.Infof("RENUKA TEST: %v", confPb) + + byteConf, err := yaml.Marshal(confPb) + if err != nil { + logger.Errorf("Error config: %s", err.Error()) + } + // TODO: (renuka) This is temp, have to pass the Yaml instead of string + conf = append(conf, config.RateLimitConfigToLoad{Name: confPb.Domain + strconv.Itoa(i), FileBytes: string(byteConf)}) + } + rlSettings := settings.NewSettings() + rlsConf := p.loader.Load(conf, p.statsManager, rlSettings.MergeDomainConfigurations) + p.configUpdateEventChan <- &ConfigUpdateEventImpl{config: rlsConf} + p.ack() +} + +func (p *XdsGrpcSotwProvider) ack() { + p.lastAckedResponse = p.lastReceivedResponse + discoveryRequest := &discovery.DiscoveryRequest{ + Node: &core.Node{Id: p.settings.ConfigGrpcXdsNodeId}, + VersionInfo: p.lastAckedResponse.VersionInfo, + TypeUrl: configTypeURL, + ResponseNonce: p.lastReceivedResponse.Nonce, + } + p.xdsStream.Send(discoveryRequest) +} + +func (p *XdsGrpcSotwProvider) nack(errorMessage string) { + discoveryRequest := &discovery.DiscoveryRequest{ + Node: &core.Node{Id: p.settings.ConfigGrpcXdsNodeId}, + TypeUrl: configTypeURL, + ErrorDetail: &status.Status{ + Message: errorMessage, + }, + } + if p.lastAckedResponse != nil { + discoveryRequest.VersionInfo = p.lastAckedResponse.VersionInfo + } + if p.lastReceivedResponse != nil { + discoveryRequest.ResponseNonce = p.lastReceivedResponse.Nonce + } + p.xdsStream.Send(discoveryRequest) +} diff --git a/src/service_cmd/runner/runner.go b/src/service_cmd/runner/runner.go index a88292632..768fafd8b 100644 --- a/src/service_cmd/runner/runner.go +++ b/src/service_cmd/runner/runner.go @@ -76,6 +76,18 @@ func createLimiter(srv server.Server, s settings.Settings, localCache *freecache } } +func getProviderImpl(s settings.Settings, statsManager stats.Manager, rootStore gostats.Store) provider.RateLimitConfigProvider { + switch s.ConfigType { + case "FILE": + return provider.NewFileProvider(s, statsManager, rootStore) + case "GRPC_XDS_SOTW": + return provider.NewXdsGrpcSotwProvider(s, statsManager) + default: + logger.Fatalf("Invalid setting for ConfigType: %s", s.ConfigType) + panic("This line should not be reachable") + } +} + func (runner *Runner) Run() { s := runner.settings if s.TracingEnabled { @@ -120,7 +132,7 @@ func (runner *Runner) Run() { service := ratelimit.NewService( srv.Runtime(), createLimiter(srv, s, localCache, runner.statsManager), - provider.NewFileProvider(s, srv.Store(), runner.statsManager), + getProviderImpl(s, runner.statsManager, srv.Store()), config.NewRateLimitConfigLoaderImpl(), runner.statsManager, s.RuntimeWatchRoot, diff --git a/src/settings/settings.go b/src/settings/settings.go index d07315116..5d6c09f66 100644 --- a/src/settings/settings.go +++ b/src/settings/settings.go @@ -46,6 +46,14 @@ type Settings struct { LogLevel string `envconfig:"LOG_LEVEL" default:"WARN"` LogFormat string `envconfig:"LOG_FORMAT" default:"text"` + // Rate limit configuration + // ConfigType is the method of configuring rate limits. Possible values "FILE", "GRPC_XDS_SOTW". + ConfigType string `envconfig:"CONFIG_TYPE" default:"FILE"` + ConfigGrpcXdsNodeId string `envconfig:"CONFIG_GRPC_XDS_NODE_ID" default:"default"` + ConfigGrpcXdsServerUrl string `envconfig:"CONFIG_GRPC_XDS_SERVER_URL" default:"localhost:18000"` + ConfigGrpcXdsServerConnectRetryInterval time.Duration `envconfig:"CONFIG_GRPC_XDS_SERVER_CONNECT_RETRY_INTERVAL" default:"3s"` + ConfigGrpcXdsServerConnectTimeout time.Duration `envconfig:"CONFIG_GRPC_XDS_SERVER_CONNECT_TIMEOUT" default:"3s"` + // Stats-related settings UseStatsd bool `envconfig:"USE_STATSD" default:"true"` StatsdHost string `envconfig:"STATSD_HOST" default:"localhost"` From 9b3d09e3948d3db93b42d0806bf47023ae74f9e2 Mon Sep 17 00:00:00 2001 From: Renuka Fernando Date: Thu, 13 Oct 2022 17:06:34 +0530 Subject: [PATCH 06/22] Remove runtime usage in service Signed-off-by: Renuka Fernando --- src/service/ratelimit.go | 27 ++++++++---------------- src/service_cmd/runner/runner.go | 4 ---- test/service/ratelimit_test.go | 36 +++----------------------------- 3 files changed, 12 insertions(+), 55 deletions(-) diff --git a/src/service/ratelimit.go b/src/service/ratelimit.go index 122f148d9..e1984dfbe 100644 --- a/src/service/ratelimit.go +++ b/src/service/ratelimit.go @@ -18,7 +18,6 @@ import ( core "github.com/envoyproxy/go-control-plane/envoy/config/core/v3" pb "github.com/envoyproxy/go-control-plane/envoy/service/ratelimit/v3" - "github.com/lyft/goruntime/loader" logger "github.com/sirupsen/logrus" "golang.org/x/net/context" @@ -37,15 +36,11 @@ type RateLimitServiceServer interface { } type service struct { - runtime loader.IFace configLock sync.RWMutex configUpdateEvent <-chan provider.ConfigUpdateEvent - configLoader config.RateLimitConfigLoader config config.RateLimitConfig - runtimeUpdateEvent chan int cache limiter.RateLimitCache stats stats.ServiceStats - runtimeWatchRoot bool customHeadersEnabled bool customHeaderLimitHeader string customHeaderRemainingHeader string @@ -304,21 +299,17 @@ func (this *service) GetCurrentConfig() config.RateLimitConfig { return this.config } -func NewService(runtime loader.IFace, cache limiter.RateLimitCache, configProvider provider.RateLimitConfigProvider, - configLoader config.RateLimitConfigLoader, statsManager stats.Manager, runtimeWatchRoot bool, clock utils.TimeSource, shadowMode bool) RateLimitServiceServer { +func NewService(cache limiter.RateLimitCache, configProvider provider.RateLimitConfigProvider, statsManager stats.Manager, + clock utils.TimeSource, shadowMode bool) RateLimitServiceServer { newService := &service{ - runtime: runtime, - configLock: sync.RWMutex{}, - configUpdateEvent: configProvider.ConfigUpdateEvent(), - configLoader: configLoader, - config: nil, - runtimeUpdateEvent: make(chan int), - cache: cache, - stats: statsManager.NewServiceStats(), - runtimeWatchRoot: runtimeWatchRoot, - globalShadowMode: shadowMode, - customHeaderClock: clock, + configLock: sync.RWMutex{}, + configUpdateEvent: configProvider.ConfigUpdateEvent(), + config: nil, + cache: cache, + stats: statsManager.NewServiceStats(), + globalShadowMode: shadowMode, + customHeaderClock: clock, } go func() { diff --git a/src/service_cmd/runner/runner.go b/src/service_cmd/runner/runner.go index 768fafd8b..61f5f1822 100644 --- a/src/service_cmd/runner/runner.go +++ b/src/service_cmd/runner/runner.go @@ -22,7 +22,6 @@ import ( logger "github.com/sirupsen/logrus" - "github.com/envoyproxy/ratelimit/src/config" "github.com/envoyproxy/ratelimit/src/limiter" "github.com/envoyproxy/ratelimit/src/memcached" "github.com/envoyproxy/ratelimit/src/redis" @@ -130,12 +129,9 @@ func (runner *Runner) Run() { runner.mu.Unlock() service := ratelimit.NewService( - srv.Runtime(), createLimiter(srv, s, localCache, runner.statsManager), getProviderImpl(s, runner.statsManager, srv.Store()), - config.NewRateLimitConfigLoaderImpl(), runner.statsManager, - s.RuntimeWatchRoot, utils.NewTimeSourceImpl(), s.GlobalShadowMode, ) diff --git a/test/service/ratelimit_test.go b/test/service/ratelimit_test.go index a6bf44f2c..4e1f0916b 100644 --- a/test/service/ratelimit_test.go +++ b/test/service/ratelimit_test.go @@ -27,8 +27,6 @@ import ( mock_config "github.com/envoyproxy/ratelimit/test/mocks/config" mock_limiter "github.com/envoyproxy/ratelimit/test/mocks/limiter" mock_provider "github.com/envoyproxy/ratelimit/test/mocks/provider" - mock_loader "github.com/envoyproxy/ratelimit/test/mocks/runtime/loader" - mock_snapshot "github.com/envoyproxy/ratelimit/test/mocks/runtime/snapshot" mock_stats "github.com/envoyproxy/ratelimit/test/mocks/stats" ) @@ -62,15 +60,11 @@ func newBarrier() barrier { type rateLimitServiceTestSuite struct { assert *assert.Assertions controller *gomock.Controller - runtime *mock_loader.MockIFace - snapshot *mock_snapshot.MockIFace cache *mock_limiter.MockRateLimitCache configProvider *mock_provider.MockRateLimitConfigProvider configUpdateEventChan chan provider.ConfigUpdateEvent configUpdateEvent *mock_provider.MockConfigUpdateEvent - configLoader *mock_config.MockRateLimitConfigLoader config *mock_config.MockRateLimitConfig - runtimeUpdateCallback chan<- int statsManager stats.Manager statStore gostats.Store mockClock utils.TimeSource @@ -86,8 +80,6 @@ func commonSetup(t *testing.T) rateLimitServiceTestSuite { ret := rateLimitServiceTestSuite{} ret.assert = assert.New(t) ret.controller = gomock.NewController(t) - // ret.runtime = mock_loader.NewMockIFace(ret.controller) - // ret.snapshot = mock_snapshot.NewMockIFace(ret.controller) ret.cache = mock_limiter.NewMockRateLimitCache(ret.controller) ret.configProvider = mock_provider.NewMockRateLimitConfigProvider(ret.controller) ret.configUpdateEventChan = make(chan provider.ConfigUpdateEvent) @@ -101,13 +93,6 @@ func commonSetup(t *testing.T) rateLimitServiceTestSuite { func (this *rateLimitServiceTestSuite) setupBasicService() ratelimit.RateLimitServiceServer { barrier := newBarrier() - // this.runtime.EXPECT().AddUpdateCallback(gomock.Any()).Do( - // func(callback chan<- int) { - // this.runtimeUpdateCallback = callback - // }) - // this.runtime.EXPECT().Snapshot().Return(this.snapshot).MinTimes(1) - // this.snapshot.EXPECT().Keys().Return([]string{"foo", "config.basic_config"}).MinTimes(1) - // this.snapshot.EXPECT().Get("config.basic_config").Return("fake_yaml").MinTimes(1) this.configProvider.EXPECT().ConfigUpdateEvent().Return(this.configUpdateEventChan).Times(1) this.configUpdateEvent.EXPECT().GetConfig().DoAndReturn(func() (config.RateLimitConfig, any) { barrier.signal() @@ -115,15 +100,10 @@ func (this *rateLimitServiceTestSuite) setupBasicService() ratelimit.RateLimitSe }) go func() { this.configUpdateEventChan <- this.configUpdateEvent }() // initial config update from provider - // this.configLoader.EXPECT().Load( - // []config.RateLimitConfigToLoad{{Name: "config.basic_config", FileBytes: "fake_yaml"}}, - // gomock.Any(), gomock.Any()).Return(this.config) - - // reset exporter before using testSpanExporter.Reset() - svc := ratelimit.NewService(this.runtime, this.cache, this.configProvider, this.configLoader, this.statsManager, true, MockClock{now: int64(2222)}, false) - barrier.wait() + svc := ratelimit.NewService(this.cache, this.configProvider, this.statsManager, MockClock{now: int64(2222)}, false) + barrier.wait() // wait for initial config load return svc } @@ -541,16 +521,6 @@ func TestInitialLoadError(test *testing.T) { t := commonSetup(test) defer t.controller.Finish() - // t.runtime.EXPECT().AddUpdateCallback(gomock.Any()).Do( - // func(callback chan<- int) { t.runtimeUpdateCallback = callback }) - // t.runtime.EXPECT().Snapshot().Return(t.snapshot).MinTimes(1) - // t.snapshot.EXPECT().Keys().Return([]string{"foo", "config.basic_config"}).MinTimes(1) - // t.snapshot.EXPECT().Get("config.basic_config").Return("fake_yaml").MinTimes(1) - // t.configLoader.EXPECT().Load( - // []config.RateLimitConfigToLoad{{Name: "config.basic_config", FileBytes: "fake_yaml"}}, gomock.Any(), gomock.Any()).Do( - // func([]config.RateLimitConfigToLoad, stats.Manager, bool) { - // panic(config.RateLimitConfigError("load error")) - // }) t.configProvider.EXPECT().ConfigUpdateEvent().Return(t.configUpdateEventChan).Times(1) barrier := newBarrier() t.configUpdateEvent.EXPECT().GetConfig().DoAndReturn(func() (config.RateLimitConfig, any) { @@ -558,7 +528,7 @@ func TestInitialLoadError(test *testing.T) { return nil, config.RateLimitConfigError("load error") }) go func() { t.configUpdateEventChan <- t.configUpdateEvent }() // initial config update from provider - service := ratelimit.NewService(t.runtime, t.cache, t.configProvider, t.configLoader, t.statsManager, true, t.mockClock, false) + service := ratelimit.NewService(t.cache, t.configProvider, t.statsManager, t.mockClock, false) barrier.wait() request := common.NewRateLimitRequest("test-domain", [][][2]string{{{"hello", "world"}}}, 1) From a3adcc9d04a1cc0b92d688ba2bb1648ccf09b37e Mon Sep 17 00:00:00 2001 From: Renuka Fernando Date: Mon, 17 Oct 2022 18:18:02 +0530 Subject: [PATCH 07/22] Add unit tests for xDS config provider Signed-off-by: Renuka Fernando --- go.mod | 9 +- go.sum | 48 +- .../config/ratelimit/v3/rls_conf.pb.go | 455 ------------------ .../service/ratelimit/v3/rls_conf_ds.pb.go | 258 ---------- src/provider/file_provider.go | 2 + src/provider/provider.go | 1 + src/provider/xds_grpc_sotw_provider.go | 45 +- src/server/server.go | 12 +- src/server/server_impl.go | 57 +-- src/service_cmd/runner/runner.go | 15 +- test/common/xds_sotw.go | 52 ++ test/mocks/provider/provider.go | 12 + test/provider/xds_grpc_sotw_provider_test.go | 175 +++++++ 13 files changed, 321 insertions(+), 820 deletions(-) delete mode 100644 src/api/ratelimit/config/ratelimit/v3/rls_conf.pb.go delete mode 100644 src/api/ratelimit/service/ratelimit/v3/rls_conf_ds.pb.go create mode 100644 test/common/xds_sotw.go create mode 100644 test/provider/xds_grpc_sotw_provider_test.go diff --git a/go.mod b/go.mod index bbc7bdc19..2ff0a2b63 100644 --- a/go.mod +++ b/go.mod @@ -2,6 +2,8 @@ module github.com/envoyproxy/ratelimit go 1.18 +replace github.com/envoyproxy/go-control-plane => /Users/renuka/git/go-control-plane + require ( github.com/alicebob/miniredis/v2 v2.23.0 github.com/bradfitz/gomemcache v0.0.0-20190913173617-a41fca850d0b @@ -20,7 +22,7 @@ require ( github.com/sirupsen/logrus v1.6.0 github.com/stretchr/testify v1.7.1 golang.org/x/net v0.0.0-20220909164309-bea034e7d591 - google.golang.org/genproto v0.0.0-20211118181313-81c1377c94b1 + google.golang.org/genproto v0.0.0-20220329172620-7be39ac1afc7 google.golang.org/grpc v1.45.0 google.golang.org/protobuf v1.28.0 gopkg.in/yaml.v2 v2.3.0 @@ -28,7 +30,8 @@ require ( require ( github.com/cenkalti/backoff/v4 v4.1.2 // indirect - github.com/cncf/xds/go v0.0.0-20211011173535-cb28da3451f1 // indirect + github.com/census-instrumentation/opencensus-proto v0.3.0 // indirect + github.com/cncf/xds/go v0.0.0-20220314180256-7f1daf1720fc // indirect github.com/go-logr/logr v1.2.3 // indirect github.com/go-logr/stdr v1.2.2 // indirect github.com/grpc-ecosystem/grpc-gateway/v2 v2.7.0 // indirect @@ -41,7 +44,7 @@ require ( github.com/alicebob/gopher-json v0.0.0-20200520072559-a9ecdc9d1d3a // indirect github.com/cespare/xxhash v1.1.0 // indirect github.com/davecgh/go-spew v1.1.1 // indirect - github.com/envoyproxy/protoc-gen-validate v0.1.0 // indirect + github.com/envoyproxy/protoc-gen-validate v0.6.7 // indirect github.com/fsnotify/fsnotify v1.4.9 // indirect github.com/google/uuid v1.3.0 github.com/konsorten/go-windows-terminal-sequences v1.0.3 // indirect diff --git a/go.sum b/go.sum index a84b7dbca..fea3aff34 100644 --- a/go.sum +++ b/go.sum @@ -45,7 +45,8 @@ github.com/bradfitz/gomemcache v0.0.0-20190913173617-a41fca850d0b h1:L/QXpzIa3pO github.com/bradfitz/gomemcache v0.0.0-20190913173617-a41fca850d0b/go.mod h1:H0wQNHz2YrLsuXOZozoeDmnHXkNCRmMW0gwFWDfEZDA= github.com/cenkalti/backoff/v4 v4.1.2 h1:6Yo7N8UP2K6LWZnW94DLVSSrbobcWdVzAYOisuDPIFo= github.com/cenkalti/backoff/v4 v4.1.2/go.mod h1:scbssz8iZGpm3xbr14ovlUdkxfGXNInqkPWOWmG2CLw= -github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= +github.com/census-instrumentation/opencensus-proto v0.3.0 h1:t/LhUZLVitR1Ow2YOnduCsavhwFUklBMoGVYUCqmCqk= +github.com/census-instrumentation/opencensus-proto v0.3.0/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= github.com/cespare/xxhash v1.1.0 h1:a6HrQnmkObjyL+Gs60czilIUGqrzKutQD6XZog3p+ko= github.com/cespare/xxhash v1.1.0/go.mod h1:XrSqR1VqqWfGrhpAt58auRo0WTKS1nRRg3ghfAqPWnc= github.com/cespare/xxhash/v2 v2.1.1/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= @@ -56,27 +57,18 @@ github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDk github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f/go.mod h1:M8M6+tZqaGXZJjfX53e64911xZQV5JYwmTeXPW+k8Sc= github.com/cncf/udpa/go v0.0.0-20201120205902-5459f2c99403/go.mod h1:WmhPx2Nbnhtbo57+VJT5O0JRkEi1Wbu0z5j0R8u5Hbk= github.com/cncf/udpa/go v0.0.0-20210930031921-04548b0d99d4/go.mod h1:6pvJx4me5XPnfI9Z40ddWsdw2W/uZgQLFXToKeRcDiI= -github.com/cncf/xds/go v0.0.0-20210312221358-fbca930ec8ed/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= -github.com/cncf/xds/go v0.0.0-20210805033703-aa0b78936158/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= github.com/cncf/xds/go v0.0.0-20210922020428-25de7278fc84/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= -github.com/cncf/xds/go v0.0.0-20211001041855-01bcc9b48dfe/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= -github.com/cncf/xds/go v0.0.0-20211011173535-cb28da3451f1 h1:zH8ljVhhq7yC0MIeUL/IviMtY8hx2mK8cN9wEYb8ggw= github.com/cncf/xds/go v0.0.0-20211011173535-cb28da3451f1/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= +github.com/cncf/xds/go v0.0.0-20220314180256-7f1daf1720fc h1:PYXxkRUBGUMa5xgMVMDl62vEklZvKpVaxQeN9ie7Hfk= +github.com/cncf/xds/go v0.0.0-20220314180256-7f1daf1720fc/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= github.com/coocood/freecache v1.1.0 h1:ENiHOsWdj1BrrlPwblhbn4GdAsMymK3pZORJ+bJGAjA= github.com/coocood/freecache v1.1.0/go.mod h1:ePwxCDzOYvARfHdr1pByNct1at3CoKnsipOHwKlNbzI= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= -github.com/envoyproxy/go-control-plane v0.9.0/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= -github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= -github.com/envoyproxy/go-control-plane v0.9.4/go.mod h1:6rpuAdCZL397s3pYoYcLgu1mIlRU8Am5FuJP05cCM98= -github.com/envoyproxy/go-control-plane v0.9.9-0.20201210154907-fd9021fe5dad/go.mod h1:cXg6YxExXjJnVBQHBLXeUAgxn2UodCpnH306RInaBQk= -github.com/envoyproxy/go-control-plane v0.9.9-0.20210512163311-63b5d3c536b0/go.mod h1:hliV/p42l8fGbc6Y9bQ70uLwIvmJyVE5k4iMKlh8wCQ= -github.com/envoyproxy/go-control-plane v0.9.10-0.20210907150352-cf90f659a021/go.mod h1:AFq3mo9L8Lqqiid3OhADV3RfLJnjiw63cSpi+fDTRC0= -github.com/envoyproxy/go-control-plane v0.10.1 h1:cgDRLG7bs59Zd+apAWuzLQL95obVYAymNJek76W3mgw= -github.com/envoyproxy/go-control-plane v0.10.1/go.mod h1:AY7fTTXNdv/aJ2O5jwpxAPOWUZ7hQAEvzN5Pf27BkQQ= -github.com/envoyproxy/protoc-gen-validate v0.1.0 h1:EQciDnbrYxy13PgWoY8AqoxGiPrpgBZ1R8UNe3ddc+A= github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= +github.com/envoyproxy/protoc-gen-validate v0.6.7 h1:qcZcULcd/abmQg6dwigimCNEyi4gg31M/xaciQlDml8= +github.com/envoyproxy/protoc-gen-validate v0.6.7/go.mod h1:dyJXwwfPK2VSqiB9Klm1J6romD608Ba7Hij42vrOBCo= github.com/fsnotify/fsnotify v1.4.9 h1:hsms1Qyu0jgnwNXIxa+/V/PDsU6CfLf6CNO8H7IWoS4= github.com/fsnotify/fsnotify v1.4.9/go.mod h1:znqG4EE+3YCdAaPaxE2ZRY/06pZUdp0tY4IgpuI1SZQ= github.com/ghodss/yaml v1.0.0 h1:wQHKEahhL6wmXdzwWG11gIVCkOv05bNOh+Rxn0yngAk= @@ -156,11 +148,11 @@ github.com/gorilla/mux v1.7.4-0.20191121170500-49c01487a141 h1:VQjjMh+uElTfioy6G github.com/gorilla/mux v1.7.4-0.20191121170500-49c01487a141/go.mod h1:DVbg23sWSpFRCP0SfiEN6jmj59UnW/n46BH5rLB71So= github.com/grpc-ecosystem/go-grpc-middleware v1.3.0 h1:+9834+KizmvFV7pXQGSXQTsaWhq2GjuNUt0aUU0YBYw= github.com/grpc-ecosystem/go-grpc-middleware v1.3.0/go.mod h1:z0ButlSOZa5vEBq9m2m2hlwIgKw+rp3sdCBRoJY+30Y= -github.com/grpc-ecosystem/grpc-gateway v1.16.0/go.mod h1:BDjrQk3hbvj6Nolgz8mAMFbcEtjT1g+wF4CSlocrBnw= github.com/grpc-ecosystem/grpc-gateway/v2 v2.7.0 h1:BZHcxBETFHIdVyhyEfOvn/RdU/QGdLI4y34qQGjGWO0= github.com/grpc-ecosystem/grpc-gateway/v2 v2.7.0/go.mod h1:hgWBS7lorOAVIJEQMi4ZsPv9hVvWI6+ch50m39Pf2Ks= github.com/hashicorp/golang-lru v0.5.0/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= github.com/hashicorp/golang-lru v0.5.1/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= +github.com/iancoleman/strcase v0.2.0/go.mod h1:iwCmte+B7n89clKwxIoIXy/HfoL7AsD47ZCWhYzw7ho= github.com/ianlancetaylor/demangle v0.0.0-20181102032728-5e5cf60278f6/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= github.com/jstemmer/go-junit-report v0.0.0-20190106144839-af01ea7f8024/go.mod h1:6v2b51hI/fHJwM22ozAgKL4VKDeJcHhJFhtBdhmNjmU= github.com/jstemmer/go-junit-report v0.9.1/go.mod h1:Brl9GWCQeLvo8nXZwPNNblvFj/XSXhF0NWZEnDohbsk= @@ -173,6 +165,7 @@ github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+o github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= github.com/konsorten/go-windows-terminal-sequences v1.0.3 h1:CE8S1cTafDpPvMhIxNJKvHsGVBgn1xWYf1NbHQhywc8= github.com/konsorten/go-windows-terminal-sequences v1.0.3/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= +github.com/kr/fs v0.1.0/go.mod h1:FFnZGqtBN9Gxj7eW1uZ42v5BccTP0vu6NEaFoC2HwRg= github.com/kr/logfmt v0.0.0-20140226030751-b84e30acd515/go.mod h1:+0opPa2QZZtGFBFZlji/RkVcI2GknAs/DXo4wKdlNEc= github.com/kr/pretty v0.1.0 h1:L/CwN0zerZDmRFUapSPitk6f+Q3+0za1rQkzVuMiMFI= github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= @@ -183,13 +176,15 @@ github.com/lyft/goruntime v0.3.0 h1:VLBYR4s3XazkUT8lLtq9CJrt58YmLQQumrK3ktenEkI= github.com/lyft/goruntime v0.3.0/go.mod h1:BW1gngSpMJR9P9w23BPUPdhdbUWhpirl98TQhOWWMF4= github.com/lyft/gostats v0.4.1 h1:oR6p4HRCGxt0nUntmZIWmYMgyothBi3eZH2A71vRjsc= github.com/lyft/gostats v0.4.1/go.mod h1:Tpx2xRzz4t+T2Tx0xdVgIoBdR2UMVz+dKnE3X01XSd8= +github.com/lyft/protoc-gen-star v0.6.0/go.mod h1:TGAoBVkt8w7MPG72TrKIu85MIdXwDuzJYeZuUPFPNwA= github.com/mediocregopher/radix/v3 v3.8.1 h1:rOkHflVuulFKlwsLY01/M2cM2tWCjDoETcMqKbAWu1M= github.com/mediocregopher/radix/v3 v3.8.1/go.mod h1:8FL3F6UQRXHXIBSPUs5h0RybMF8i4n7wVopoX3x7Bv8= github.com/opentracing/opentracing-go v1.1.0/go.mod h1:UkNAQd3GIcIGf0SeVgPpRdFStlNbqXla1AfSYxPUl2o= github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= +github.com/pkg/sftp v1.10.1/go.mod h1:lYOWFsE0bwd1+KfKJaKeuokY15vzFx25BLbzYYoAxZI= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= -github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= +github.com/prometheus/client_model v0.2.0/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= github.com/rogpeppe/fastuuid v1.2.0/go.mod h1:jVj6XXZzXRy/MSR5jhDC/2q6DgLz+nrA6LYCDYWNEvQ= github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= github.com/sirupsen/logrus v1.4.2/go.mod h1:tLMulIdttU9McNUspp0xgXVQah82FyeX6MwdIuYE2rE= @@ -197,6 +192,8 @@ github.com/sirupsen/logrus v1.6.0 h1:UBcNElsrwanuuMsnGSlYmtmgbb23qDR5dG+6X6Oo89I github.com/sirupsen/logrus v1.6.0/go.mod h1:7uNnSEd1DgxDLC74fIahvMZmmYsHGZGEOFrfsX/uA88= github.com/spaolacci/murmur3 v0.0.0-20180118202830-f09979ecbc72 h1:qLC7fQah7D6K1B0ujays3HV9gkFtllcxhzImRR7ArPQ= github.com/spaolacci/murmur3 v0.0.0-20180118202830-f09979ecbc72/go.mod h1:JwIasOWyU6f++ZhiEuf87xNszmSA2myDM2Kzu9HwQUA= +github.com/spf13/afero v1.3.3/go.mod h1:5KUK8ByomD5Ti5Artl0RtHeI5pTF7MIDuXL3yY520V4= +github.com/spf13/afero v1.6.0/go.mod h1:Ai8FlHk4v/PARR026UzYexafAt9roJ7LcLMAmO6Z93I= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/objx v0.2.0 h1:Hbg2NidpLE8veEBkEZTL3CvlkUIVzuU9jDplZO54c48= @@ -204,7 +201,7 @@ github.com/stretchr/objx v0.2.0/go.mod h1:qt09Ya8vawLte6SNmTgCsAVtYtaKzEcn8ATUoH github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4= -github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5cxcmMvtA= +github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/stretchr/testify v1.7.1 h1:5TQK59W5E3v0r2duFAb7P95B6hEeOyEnHRa8MjYSMTY= github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= @@ -241,7 +238,6 @@ go.opentelemetry.io/otel/trace v1.6.1/go.mod h1:RkFRM1m0puWIq10oxImnGEduNBzxiN7T go.opentelemetry.io/otel/trace v1.6.3/go.mod h1:GNJQusJlUgZl9/TQBPKU/Y/ty+0iVB5fjhKeJGZPGFs= go.opentelemetry.io/otel/trace v1.7.0 h1:O37Iogk1lEkMRXewVtZ1BBTVn5JEp8GrJvP92bJqC6o= go.opentelemetry.io/otel/trace v1.7.0/go.mod h1:fzLSB9nqR2eXzxPXb2JW9IKE+ScyXA48yyE4TNvoHqU= -go.opentelemetry.io/proto/otlp v0.7.0/go.mod h1:PqfVotwruBrMGOCsRd/89rSnXhoiJIqeYNgFYFoEGnI= go.opentelemetry.io/proto/otlp v0.15.0/go.mod h1:H7XAot3MsfNsj7EXtrA2q5xSNQ10UqI405h3+duxN4U= go.opentelemetry.io/proto/otlp v0.16.0 h1:WHzDWdXUvbc5bG2ObdrGfaNpQz7ft7QN9HHmJlbiB1E= go.opentelemetry.io/proto/otlp v0.16.0/go.mod h1:H7XAot3MsfNsj7EXtrA2q5xSNQ10UqI405h3+duxN4U= @@ -253,6 +249,7 @@ go.uber.org/zap v1.10.0/go.mod h1:vwi/ZaCAaUcBkycHslxD9B2zi4UTXhF60s6SWpuDF0Q= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20190510104115-cbcb75029529/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20190605123033-f99c8df09eb5/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= +golang.org/x/crypto v0.0.0-20190820162420-60c769a6c586/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= @@ -277,6 +274,7 @@ golang.org/x/lint v0.0.0-20190930215403-16217165b5de/go.mod h1:6SW0HCj/g11FgYtHl golang.org/x/lint v0.0.0-20191125180803-fdd1cda4f05f/go.mod h1:5qLYkcX4OjUUV8bRuDixDT3tpyyb+LUpUlRWLxfhWrs= golang.org/x/lint v0.0.0-20200130185559-910be7a94367/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= golang.org/x/lint v0.0.0-20200302205851-738671d3881b/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= +golang.org/x/lint v0.0.0-20210508222113-6edffad5e616/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= golang.org/x/mobile v0.0.0-20190312151609-d3739f865fa6/go.mod h1:z+o9i4GpDbdi3rU15maQ/Ox0txvL9dWGYEHz965HBQE= golang.org/x/mobile v0.0.0-20190719004257-d2bd2a29d028/go.mod h1:E/iHnbuqvinMTCcRqshq8CkpyQDoeVncDDYHnLhea+o= golang.org/x/mod v0.0.0-20190513183733-4bf6d317e70e/go.mod h1:mXi4GBBbnImb6dmsKGUJ2LatrhH/nqhxcFungHvyanc= @@ -286,6 +284,7 @@ golang.org/x/mod v0.1.1-0.20191107180719-034126e5016b/go.mod h1:QqPTAvyqsEbceGzB golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.4.2/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= +golang.org/x/mod v0.5.0/go.mod h1:5OXOZSfqPIIbmVBIIKWRFfZjPR0E5r58TLhUjH0a2Ro= golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190108225652-1e06a53dbb7e/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= @@ -314,6 +313,7 @@ golang.org/x/net v0.0.0-20200707034311-ab3426394381/go.mod h1:/O7V0waA8r7cgGh81R golang.org/x/net v0.0.0-20200822124328-c89045814202/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= golang.org/x/net v0.0.0-20210405180319-a5a99cb37ef4/go.mod h1:p54w0d4576C0XHj96bSt6lcn1PtDYWL6XObtHCRCNQM= +golang.org/x/net v0.0.0-20210813160813-60bc85c4be6d/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20220909164309-bea034e7d591 h1:D0B/7al0LLrVC8aWF4+oxpv/m8bc7ViFfVS8/gXGdqI= golang.org/x/net v0.0.0-20220909164309-bea034e7d591/go.mod h1:YDH+HFinaLZZlnHAfSS6ZXJJ9M9t4Dl22yv3iI2vPwk= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= @@ -363,10 +363,11 @@ golang.org/x/sys v0.0.0-20200523222454-059865788121/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20200803210538-64077c9b5642/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210119212857-b64e53b001e4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210330210617-4fbd30eecc44/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210423185535-09eb48e85fd7/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210510120138-977fb7262007/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20210816183151-1e6c022a8912/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220728004956-3c1f35247d10 h1:WIoqL4EROvwiPdUtaip4VcDdpZ4kha7wBWZrbVKCIZg= golang.org/x/sys v0.0.0-20220728004956-3c1f35247d10/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= @@ -376,6 +377,7 @@ golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3 golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.5/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= +golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.7 h1:olpwvP2KacW1ZWvsR7uQhoyTYvKAupfQrRGBFM352Gk= golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= @@ -476,19 +478,18 @@ google.golang.org/genproto v0.0.0-20200331122359-1ee6d9798940/go.mod h1:55QSHmfG google.golang.org/genproto v0.0.0-20200423170343-7949de9c1215/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= google.golang.org/genproto v0.0.0-20200430143042-b979b6f78d84/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= google.golang.org/genproto v0.0.0-20200511104702-f5ebc3bea380/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= -google.golang.org/genproto v0.0.0-20200513103714-09dca8ec2884/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= google.golang.org/genproto v0.0.0-20200515170657-fc4c6c6a6587/go.mod h1:YsZOwe1myG/8QRHRsmBRE1LrgQY60beZKjly0O1fX9U= google.golang.org/genproto v0.0.0-20200526211855-cb27e3aa2013/go.mod h1:NbSheEEYHJ7i3ixzK3sjbqSGDJWnxyFXZblF3eUsNvo= google.golang.org/genproto v0.0.0-20200618031413-b414f8b61790/go.mod h1:jDfRM7FcilCzHH/e9qn6dsT145K34l5v+OpcnNgKAAA= google.golang.org/genproto v0.0.0-20200729003335-053ba62fc06f/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20200804131852-c06518451d9c/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20200825200019-8632dd797987/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto v0.0.0-20211118181313-81c1377c94b1 h1:b9mVrqYfq3P4bCdaLg1qtBnPzUYgglsIdjZkL/fQVOE= google.golang.org/genproto v0.0.0-20211118181313-81c1377c94b1/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc= +google.golang.org/genproto v0.0.0-20220329172620-7be39ac1afc7 h1:HOL66YCI20JvN2hVk6o2YIp9i/3RvzVUz82PqNr7fXw= +google.golang.org/genproto v0.0.0-20220329172620-7be39ac1afc7/go.mod h1:8w6bsBMX6yCPbAVTeqQHvzxW0EIFigd5lZyahWgyfDo= google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= google.golang.org/grpc v1.20.1/go.mod h1:10oTOabMzJvdu6/UiuZezV6QK5dSlG84ov/aaiqXj38= google.golang.org/grpc v1.21.1/go.mod h1:oYelfM1adQP15Ek0mdvEgi9Df8B9CZIaU1084ijfRaM= -google.golang.org/grpc v1.23.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg= google.golang.org/grpc v1.25.1/go.mod h1:c3i+UQWmh7LiEpx4sFZnkU36qjEYZ0imhYfXVyQciAY= google.golang.org/grpc v1.26.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= google.golang.org/grpc v1.27.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= @@ -497,8 +498,6 @@ google.golang.org/grpc v1.28.0/go.mod h1:rpkK4SK4GF4Ach/+MFLZUBavHOvF2JJB5uozKKa google.golang.org/grpc v1.29.1/go.mod h1:itym6AZVZYACWQqET3MqgPpjcuV5QH3BxFS3IjizoKk= google.golang.org/grpc v1.30.0/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak= google.golang.org/grpc v1.31.0/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak= -google.golang.org/grpc v1.33.1/go.mod h1:fr5YgcSWrqhRRxogOsw7RzIpsmvOZ6IcH4kBYTpR3n0= -google.golang.org/grpc v1.36.0/go.mod h1:qjiiYl8FncCW8feJPdyg3v6XW24KsRHe+dy9BAGRRjU= google.golang.org/grpc v1.40.0/go.mod h1:ogyxbiOoUXAkP+4+xa6PZSE9DZgIHtSpzjDTB9KAK34= google.golang.org/grpc v1.42.0/go.mod h1:k+4IHHFw41K8+bbowsex27ge2rCb65oeWqe4jJ590SU= google.golang.org/grpc v1.45.0 h1:NEpgUqV3Z+ZjkqMsxMg11IaDrXY4RY6CQukSGK0uI1M= @@ -523,7 +522,6 @@ gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127 h1:qIbj1fsPNlZgppZ+VLlY7N33 gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI= gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= -gopkg.in/yaml.v2 v2.2.3/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.3.0 h1:clyUAQHOM3G0M3f5vQj7LuJrETvjVot3Z5el9nffUtU= gopkg.in/yaml.v2 v2.3.0/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c h1:dUUwHk2QECo/6vqA44rthZ8ie2QXMNeKRTHCNY2nXvo= diff --git a/src/api/ratelimit/config/ratelimit/v3/rls_conf.pb.go b/src/api/ratelimit/config/ratelimit/v3/rls_conf.pb.go deleted file mode 100644 index f9e68eb4a..000000000 --- a/src/api/ratelimit/config/ratelimit/v3/rls_conf.pb.go +++ /dev/null @@ -1,455 +0,0 @@ -// Code generated by protoc-gen-go. DO NOT EDIT. -// versions: -// protoc-gen-go v1.25.0-devel -// protoc v3.13.0 -// source: ratelimit/config/ratelimit/v3/rls_conf.proto - -package ratelimitv3 - -import ( - reflect "reflect" - sync "sync" - - protoreflect "google.golang.org/protobuf/reflect/protoreflect" - protoimpl "google.golang.org/protobuf/runtime/protoimpl" -) - -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) -) - -// Rate-limit config model -type RateLimitConfig struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Domain string `protobuf:"bytes,1,opt,name=domain,proto3" json:"domain,omitempty"` - Descriptors []*RateLimitDescriptor `protobuf:"bytes,2,rep,name=descriptors,proto3" json:"descriptors,omitempty"` -} - -func (x *RateLimitConfig) Reset() { - *x = RateLimitConfig{} - if protoimpl.UnsafeEnabled { - mi := &file_ratelimit_config_ratelimit_v3_rls_conf_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *RateLimitConfig) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*RateLimitConfig) ProtoMessage() {} - -func (x *RateLimitConfig) ProtoReflect() protoreflect.Message { - mi := &file_ratelimit_config_ratelimit_v3_rls_conf_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 RateLimitConfig.ProtoReflect.Descriptor instead. -func (*RateLimitConfig) Descriptor() ([]byte, []int) { - return file_ratelimit_config_ratelimit_v3_rls_conf_proto_rawDescGZIP(), []int{0} -} - -func (x *RateLimitConfig) GetDomain() string { - if x != nil { - return x.Domain - } - return "" -} - -func (x *RateLimitConfig) GetDescriptors() []*RateLimitDescriptor { - if x != nil { - return x.Descriptors - } - return nil -} - -// Rate-limit descriptor model -type RateLimitDescriptor struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Key string `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"` - Value string `protobuf:"bytes,2,opt,name=value,proto3" json:"value,omitempty"` - RateLimit *RateLimitPolicy `protobuf:"bytes,3,opt,name=rate_limit,json=rateLimit,proto3" json:"rate_limit,omitempty"` - Descriptors []*RateLimitDescriptor `protobuf:"bytes,4,rep,name=descriptors,proto3" json:"descriptors,omitempty"` - ShadowMode bool `protobuf:"varint,5,opt,name=shadow_mode,json=shadowMode,proto3" json:"shadow_mode,omitempty"` -} - -func (x *RateLimitDescriptor) Reset() { - *x = RateLimitDescriptor{} - if protoimpl.UnsafeEnabled { - mi := &file_ratelimit_config_ratelimit_v3_rls_conf_proto_msgTypes[1] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *RateLimitDescriptor) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*RateLimitDescriptor) ProtoMessage() {} - -func (x *RateLimitDescriptor) ProtoReflect() protoreflect.Message { - mi := &file_ratelimit_config_ratelimit_v3_rls_conf_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 RateLimitDescriptor.ProtoReflect.Descriptor instead. -func (*RateLimitDescriptor) Descriptor() ([]byte, []int) { - return file_ratelimit_config_ratelimit_v3_rls_conf_proto_rawDescGZIP(), []int{1} -} - -func (x *RateLimitDescriptor) GetKey() string { - if x != nil { - return x.Key - } - return "" -} - -func (x *RateLimitDescriptor) GetValue() string { - if x != nil { - return x.Value - } - return "" -} - -func (x *RateLimitDescriptor) GetRateLimit() *RateLimitPolicy { - if x != nil { - return x.RateLimit - } - return nil -} - -func (x *RateLimitDescriptor) GetDescriptors() []*RateLimitDescriptor { - if x != nil { - return x.Descriptors - } - return nil -} - -func (x *RateLimitDescriptor) GetShadowMode() bool { - if x != nil { - return x.ShadowMode - } - return false -} - -// Rate-limit policy model -type RateLimitPolicy struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Unit string `protobuf:"bytes,1,opt,name=unit,proto3" json:"unit,omitempty"` - RequestsPerUnit uint32 `protobuf:"varint,2,opt,name=requests_per_unit,json=requestsPerUnit,proto3" json:"requests_per_unit,omitempty"` - Unlimited bool `protobuf:"varint,3,opt,name=unlimited,proto3" json:"unlimited,omitempty"` - Name string `protobuf:"bytes,4,opt,name=name,proto3" json:"name,omitempty"` - Replaces []*RateLimitReplace `protobuf:"bytes,5,rep,name=replaces,proto3" json:"replaces,omitempty"` -} - -func (x *RateLimitPolicy) Reset() { - *x = RateLimitPolicy{} - if protoimpl.UnsafeEnabled { - mi := &file_ratelimit_config_ratelimit_v3_rls_conf_proto_msgTypes[2] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *RateLimitPolicy) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*RateLimitPolicy) ProtoMessage() {} - -func (x *RateLimitPolicy) ProtoReflect() protoreflect.Message { - mi := &file_ratelimit_config_ratelimit_v3_rls_conf_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 RateLimitPolicy.ProtoReflect.Descriptor instead. -func (*RateLimitPolicy) Descriptor() ([]byte, []int) { - return file_ratelimit_config_ratelimit_v3_rls_conf_proto_rawDescGZIP(), []int{2} -} - -func (x *RateLimitPolicy) GetUnit() string { - if x != nil { - return x.Unit - } - return "" -} - -func (x *RateLimitPolicy) GetRequestsPerUnit() uint32 { - if x != nil { - return x.RequestsPerUnit - } - return 0 -} - -func (x *RateLimitPolicy) GetUnlimited() bool { - if x != nil { - return x.Unlimited - } - return false -} - -func (x *RateLimitPolicy) GetName() string { - if x != nil { - return x.Name - } - return "" -} - -func (x *RateLimitPolicy) GetReplaces() []*RateLimitReplace { - if x != nil { - return x.Replaces - } - return nil -} - -// Rate-limit replace model -type RateLimitReplace struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` -} - -func (x *RateLimitReplace) Reset() { - *x = RateLimitReplace{} - if protoimpl.UnsafeEnabled { - mi := &file_ratelimit_config_ratelimit_v3_rls_conf_proto_msgTypes[3] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *RateLimitReplace) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*RateLimitReplace) ProtoMessage() {} - -func (x *RateLimitReplace) ProtoReflect() protoreflect.Message { - mi := &file_ratelimit_config_ratelimit_v3_rls_conf_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 RateLimitReplace.ProtoReflect.Descriptor instead. -func (*RateLimitReplace) Descriptor() ([]byte, []int) { - return file_ratelimit_config_ratelimit_v3_rls_conf_proto_rawDescGZIP(), []int{3} -} - -func (x *RateLimitReplace) GetName() string { - if x != nil { - return x.Name - } - return "" -} - -var File_ratelimit_config_ratelimit_v3_rls_conf_proto protoreflect.FileDescriptor - -var file_ratelimit_config_ratelimit_v3_rls_conf_proto_rawDesc = []byte{ - 0x0a, 0x2c, 0x72, 0x61, 0x74, 0x65, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x2f, 0x63, 0x6f, 0x6e, 0x66, - 0x69, 0x67, 0x2f, 0x72, 0x61, 0x74, 0x65, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x2f, 0x76, 0x33, 0x2f, - 0x72, 0x6c, 0x73, 0x5f, 0x63, 0x6f, 0x6e, 0x66, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x1d, - 0x72, 0x61, 0x74, 0x65, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x2e, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, - 0x2e, 0x72, 0x61, 0x74, 0x65, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x2e, 0x76, 0x33, 0x22, 0x7f, 0x0a, - 0x0f, 0x52, 0x61, 0x74, 0x65, 0x4c, 0x69, 0x6d, 0x69, 0x74, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, - 0x12, 0x16, 0x0a, 0x06, 0x64, 0x6f, 0x6d, 0x61, 0x69, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, - 0x52, 0x06, 0x64, 0x6f, 0x6d, 0x61, 0x69, 0x6e, 0x12, 0x54, 0x0a, 0x0b, 0x64, 0x65, 0x73, 0x63, - 0x72, 0x69, 0x70, 0x74, 0x6f, 0x72, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x32, 0x2e, - 0x72, 0x61, 0x74, 0x65, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x2e, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, - 0x2e, 0x72, 0x61, 0x74, 0x65, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x2e, 0x76, 0x33, 0x2e, 0x52, 0x61, - 0x74, 0x65, 0x4c, 0x69, 0x6d, 0x69, 0x74, 0x44, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x6f, - 0x72, 0x52, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x6f, 0x72, 0x73, 0x22, 0x83, - 0x02, 0x0a, 0x13, 0x52, 0x61, 0x74, 0x65, 0x4c, 0x69, 0x6d, 0x69, 0x74, 0x44, 0x65, 0x73, 0x63, - 0x72, 0x69, 0x70, 0x74, 0x6f, 0x72, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, - 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, - 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x4d, - 0x0a, 0x0a, 0x72, 0x61, 0x74, 0x65, 0x5f, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x18, 0x03, 0x20, 0x01, - 0x28, 0x0b, 0x32, 0x2e, 0x2e, 0x72, 0x61, 0x74, 0x65, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x2e, 0x63, - 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2e, 0x72, 0x61, 0x74, 0x65, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x2e, - 0x76, 0x33, 0x2e, 0x52, 0x61, 0x74, 0x65, 0x4c, 0x69, 0x6d, 0x69, 0x74, 0x50, 0x6f, 0x6c, 0x69, - 0x63, 0x79, 0x52, 0x09, 0x72, 0x61, 0x74, 0x65, 0x4c, 0x69, 0x6d, 0x69, 0x74, 0x12, 0x54, 0x0a, - 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x6f, 0x72, 0x73, 0x18, 0x04, 0x20, 0x03, - 0x28, 0x0b, 0x32, 0x32, 0x2e, 0x72, 0x61, 0x74, 0x65, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x2e, 0x63, - 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2e, 0x72, 0x61, 0x74, 0x65, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x2e, - 0x76, 0x33, 0x2e, 0x52, 0x61, 0x74, 0x65, 0x4c, 0x69, 0x6d, 0x69, 0x74, 0x44, 0x65, 0x73, 0x63, - 0x72, 0x69, 0x70, 0x74, 0x6f, 0x72, 0x52, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, - 0x6f, 0x72, 0x73, 0x12, 0x1f, 0x0a, 0x0b, 0x73, 0x68, 0x61, 0x64, 0x6f, 0x77, 0x5f, 0x6d, 0x6f, - 0x64, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0a, 0x73, 0x68, 0x61, 0x64, 0x6f, 0x77, - 0x4d, 0x6f, 0x64, 0x65, 0x22, 0xd0, 0x01, 0x0a, 0x0f, 0x52, 0x61, 0x74, 0x65, 0x4c, 0x69, 0x6d, - 0x69, 0x74, 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x12, 0x12, 0x0a, 0x04, 0x75, 0x6e, 0x69, 0x74, - 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x75, 0x6e, 0x69, 0x74, 0x12, 0x2a, 0x0a, 0x11, - 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x73, 0x5f, 0x70, 0x65, 0x72, 0x5f, 0x75, 0x6e, 0x69, - 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x0f, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, - 0x73, 0x50, 0x65, 0x72, 0x55, 0x6e, 0x69, 0x74, 0x12, 0x1c, 0x0a, 0x09, 0x75, 0x6e, 0x6c, 0x69, - 0x6d, 0x69, 0x74, 0x65, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x08, 0x52, 0x09, 0x75, 0x6e, 0x6c, - 0x69, 0x6d, 0x69, 0x74, 0x65, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x04, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x4b, 0x0a, 0x08, 0x72, 0x65, - 0x70, 0x6c, 0x61, 0x63, 0x65, 0x73, 0x18, 0x05, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x2f, 0x2e, 0x72, - 0x61, 0x74, 0x65, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x2e, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2e, - 0x72, 0x61, 0x74, 0x65, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x2e, 0x76, 0x33, 0x2e, 0x52, 0x61, 0x74, - 0x65, 0x4c, 0x69, 0x6d, 0x69, 0x74, 0x52, 0x65, 0x70, 0x6c, 0x61, 0x63, 0x65, 0x52, 0x08, 0x72, - 0x65, 0x70, 0x6c, 0x61, 0x63, 0x65, 0x73, 0x22, 0x26, 0x0a, 0x10, 0x52, 0x61, 0x74, 0x65, 0x4c, - 0x69, 0x6d, 0x69, 0x74, 0x52, 0x65, 0x70, 0x6c, 0x61, 0x63, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x6e, - 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x42, - 0x91, 0x01, 0x0a, 0x2b, 0x69, 0x6f, 0x2e, 0x65, 0x6e, 0x76, 0x6f, 0x79, 0x70, 0x72, 0x6f, 0x78, - 0x79, 0x2e, 0x72, 0x61, 0x74, 0x65, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x2e, 0x63, 0x6f, 0x6e, 0x66, - 0x69, 0x67, 0x2e, 0x72, 0x61, 0x74, 0x65, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x2e, 0x76, 0x33, 0x42, - 0x0e, 0x52, 0x6c, 0x73, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, - 0x01, 0x5a, 0x50, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x65, 0x6e, - 0x76, 0x6f, 0x79, 0x70, 0x72, 0x6f, 0x78, 0x79, 0x2f, 0x67, 0x6f, 0x2d, 0x63, 0x6f, 0x6e, 0x74, - 0x72, 0x6f, 0x6c, 0x2d, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2f, 0x72, 0x61, 0x74, 0x65, 0x6c, 0x69, - 0x6d, 0x69, 0x74, 0x2f, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2f, 0x72, 0x61, 0x74, 0x65, 0x6c, - 0x69, 0x6d, 0x69, 0x74, 0x2f, 0x76, 0x33, 0x3b, 0x72, 0x61, 0x74, 0x65, 0x6c, 0x69, 0x6d, 0x69, - 0x74, 0x76, 0x33, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, -} - -var ( - file_ratelimit_config_ratelimit_v3_rls_conf_proto_rawDescOnce sync.Once - file_ratelimit_config_ratelimit_v3_rls_conf_proto_rawDescData = file_ratelimit_config_ratelimit_v3_rls_conf_proto_rawDesc -) - -func file_ratelimit_config_ratelimit_v3_rls_conf_proto_rawDescGZIP() []byte { - file_ratelimit_config_ratelimit_v3_rls_conf_proto_rawDescOnce.Do(func() { - file_ratelimit_config_ratelimit_v3_rls_conf_proto_rawDescData = protoimpl.X.CompressGZIP(file_ratelimit_config_ratelimit_v3_rls_conf_proto_rawDescData) - }) - return file_ratelimit_config_ratelimit_v3_rls_conf_proto_rawDescData -} - -var ( - file_ratelimit_config_ratelimit_v3_rls_conf_proto_msgTypes = make([]protoimpl.MessageInfo, 4) - file_ratelimit_config_ratelimit_v3_rls_conf_proto_goTypes = []interface{}{ - (*RateLimitConfig)(nil), // 0: ratelimit.config.ratelimit.v3.RateLimitConfig - (*RateLimitDescriptor)(nil), // 1: ratelimit.config.ratelimit.v3.RateLimitDescriptor - (*RateLimitPolicy)(nil), // 2: ratelimit.config.ratelimit.v3.RateLimitPolicy - (*RateLimitReplace)(nil), // 3: ratelimit.config.ratelimit.v3.RateLimitReplace - } -) - -var file_ratelimit_config_ratelimit_v3_rls_conf_proto_depIdxs = []int32{ - 1, // 0: ratelimit.config.ratelimit.v3.RateLimitConfig.descriptors:type_name -> ratelimit.config.ratelimit.v3.RateLimitDescriptor - 2, // 1: ratelimit.config.ratelimit.v3.RateLimitDescriptor.rate_limit:type_name -> ratelimit.config.ratelimit.v3.RateLimitPolicy - 1, // 2: ratelimit.config.ratelimit.v3.RateLimitDescriptor.descriptors:type_name -> ratelimit.config.ratelimit.v3.RateLimitDescriptor - 3, // 3: ratelimit.config.ratelimit.v3.RateLimitPolicy.replaces:type_name -> ratelimit.config.ratelimit.v3.RateLimitReplace - 4, // [4:4] is the sub-list for method output_type - 4, // [4:4] is the sub-list for method input_type - 4, // [4:4] is the sub-list for extension type_name - 4, // [4:4] is the sub-list for extension extendee - 0, // [0:4] is the sub-list for field type_name -} - -func init() { file_ratelimit_config_ratelimit_v3_rls_conf_proto_init() } -func file_ratelimit_config_ratelimit_v3_rls_conf_proto_init() { - if File_ratelimit_config_ratelimit_v3_rls_conf_proto != nil { - return - } - if !protoimpl.UnsafeEnabled { - file_ratelimit_config_ratelimit_v3_rls_conf_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*RateLimitConfig); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_ratelimit_config_ratelimit_v3_rls_conf_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*RateLimitDescriptor); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_ratelimit_config_ratelimit_v3_rls_conf_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*RateLimitPolicy); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_ratelimit_config_ratelimit_v3_rls_conf_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*RateLimitReplace); 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_ratelimit_config_ratelimit_v3_rls_conf_proto_rawDesc, - NumEnums: 0, - NumMessages: 4, - NumExtensions: 0, - NumServices: 0, - }, - GoTypes: file_ratelimit_config_ratelimit_v3_rls_conf_proto_goTypes, - DependencyIndexes: file_ratelimit_config_ratelimit_v3_rls_conf_proto_depIdxs, - MessageInfos: file_ratelimit_config_ratelimit_v3_rls_conf_proto_msgTypes, - }.Build() - File_ratelimit_config_ratelimit_v3_rls_conf_proto = out.File - file_ratelimit_config_ratelimit_v3_rls_conf_proto_rawDesc = nil - file_ratelimit_config_ratelimit_v3_rls_conf_proto_goTypes = nil - file_ratelimit_config_ratelimit_v3_rls_conf_proto_depIdxs = nil -} diff --git a/src/api/ratelimit/service/ratelimit/v3/rls_conf_ds.pb.go b/src/api/ratelimit/service/ratelimit/v3/rls_conf_ds.pb.go deleted file mode 100644 index b8d95e02d..000000000 --- a/src/api/ratelimit/service/ratelimit/v3/rls_conf_ds.pb.go +++ /dev/null @@ -1,258 +0,0 @@ -// Code generated by protoc-gen-go. DO NOT EDIT. -// versions: -// protoc-gen-go v1.25.0-devel -// protoc v3.13.0 -// source: ratelimit/service/ratelimit/v3/rls_conf_ds.proto - -package configv3 - -import ( - context "context" - reflect "reflect" - - v3 "github.com/envoyproxy/go-control-plane/envoy/service/discovery/v3" - grpc "google.golang.org/grpc" - codes "google.golang.org/grpc/codes" - status "google.golang.org/grpc/status" - protoreflect "google.golang.org/protobuf/reflect/protoreflect" - protoimpl "google.golang.org/protobuf/runtime/protoimpl" -) - -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) -) - -var File_ratelimit_service_ratelimit_v3_rls_conf_ds_proto protoreflect.FileDescriptor - -var file_ratelimit_service_ratelimit_v3_rls_conf_ds_proto_rawDesc = []byte{ - 0x0a, 0x30, 0x72, 0x61, 0x74, 0x65, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x2f, 0x73, 0x65, 0x72, 0x76, - 0x69, 0x63, 0x65, 0x2f, 0x72, 0x61, 0x74, 0x65, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x2f, 0x76, 0x33, - 0x2f, 0x72, 0x6c, 0x73, 0x5f, 0x63, 0x6f, 0x6e, 0x66, 0x5f, 0x64, 0x73, 0x2e, 0x70, 0x72, 0x6f, - 0x74, 0x6f, 0x12, 0x1e, 0x72, 0x61, 0x74, 0x65, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x2e, 0x73, 0x65, - 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x72, 0x61, 0x74, 0x65, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x2e, - 0x76, 0x33, 0x1a, 0x2a, 0x65, 0x6e, 0x76, 0x6f, 0x79, 0x2f, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, - 0x65, 0x2f, 0x64, 0x69, 0x73, 0x63, 0x6f, 0x76, 0x65, 0x72, 0x79, 0x2f, 0x76, 0x33, 0x2f, 0x64, - 0x69, 0x73, 0x63, 0x6f, 0x76, 0x65, 0x72, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x32, 0x8a, - 0x02, 0x0a, 0x1f, 0x52, 0x61, 0x74, 0x65, 0x4c, 0x69, 0x6d, 0x69, 0x74, 0x43, 0x6f, 0x6e, 0x66, - 0x69, 0x67, 0x44, 0x69, 0x73, 0x63, 0x6f, 0x76, 0x65, 0x72, 0x79, 0x53, 0x65, 0x72, 0x76, 0x69, - 0x63, 0x65, 0x12, 0x75, 0x0a, 0x10, 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x52, 0x6c, 0x73, 0x43, - 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x73, 0x12, 0x2c, 0x2e, 0x65, 0x6e, 0x76, 0x6f, 0x79, 0x2e, 0x73, - 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x64, 0x69, 0x73, 0x63, 0x6f, 0x76, 0x65, 0x72, 0x79, - 0x2e, 0x76, 0x33, 0x2e, 0x44, 0x69, 0x73, 0x63, 0x6f, 0x76, 0x65, 0x72, 0x79, 0x52, 0x65, 0x71, - 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2d, 0x2e, 0x65, 0x6e, 0x76, 0x6f, 0x79, 0x2e, 0x73, 0x65, 0x72, - 0x76, 0x69, 0x63, 0x65, 0x2e, 0x64, 0x69, 0x73, 0x63, 0x6f, 0x76, 0x65, 0x72, 0x79, 0x2e, 0x76, - 0x33, 0x2e, 0x44, 0x69, 0x73, 0x63, 0x6f, 0x76, 0x65, 0x72, 0x79, 0x52, 0x65, 0x73, 0x70, 0x6f, - 0x6e, 0x73, 0x65, 0x22, 0x00, 0x28, 0x01, 0x30, 0x01, 0x12, 0x70, 0x0a, 0x0f, 0x46, 0x65, 0x74, - 0x63, 0x68, 0x52, 0x6c, 0x73, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x73, 0x12, 0x2c, 0x2e, 0x65, - 0x6e, 0x76, 0x6f, 0x79, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x64, 0x69, 0x73, - 0x63, 0x6f, 0x76, 0x65, 0x72, 0x79, 0x2e, 0x76, 0x33, 0x2e, 0x44, 0x69, 0x73, 0x63, 0x6f, 0x76, - 0x65, 0x72, 0x79, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2d, 0x2e, 0x65, 0x6e, 0x76, - 0x6f, 0x79, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x64, 0x69, 0x73, 0x63, 0x6f, - 0x76, 0x65, 0x72, 0x79, 0x2e, 0x76, 0x33, 0x2e, 0x44, 0x69, 0x73, 0x63, 0x6f, 0x76, 0x65, 0x72, - 0x79, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x42, 0x8d, 0x01, 0x0a, 0x29, - 0x69, 0x6f, 0x2e, 0x65, 0x6e, 0x76, 0x6f, 0x79, 0x70, 0x72, 0x6f, 0x78, 0x79, 0x2e, 0x72, 0x61, - 0x74, 0x65, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, - 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2e, 0x76, 0x33, 0x42, 0x0e, 0x52, 0x6c, 0x73, 0x43, 0x6f, - 0x6e, 0x66, 0x69, 0x67, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x4b, 0x67, 0x69, 0x74, - 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x65, 0x6e, 0x76, 0x6f, 0x79, 0x70, 0x72, 0x6f, - 0x78, 0x79, 0x2f, 0x67, 0x6f, 0x2d, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x2d, 0x70, 0x6c, - 0x61, 0x6e, 0x65, 0x2f, 0x72, 0x61, 0x74, 0x65, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x2f, 0x73, 0x65, - 0x72, 0x76, 0x69, 0x63, 0x65, 0x2f, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2f, 0x76, 0x33, 0x3b, - 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x76, 0x33, 0x88, 0x01, 0x01, 0x62, 0x06, 0x70, 0x72, 0x6f, - 0x74, 0x6f, 0x33, -} - -var file_ratelimit_service_ratelimit_v3_rls_conf_ds_proto_goTypes = []interface{}{ - (*v3.DiscoveryRequest)(nil), // 0: envoy.service.discovery.v3.DiscoveryRequest - (*v3.DiscoveryResponse)(nil), // 1: envoy.service.discovery.v3.DiscoveryResponse -} - -var file_ratelimit_service_ratelimit_v3_rls_conf_ds_proto_depIdxs = []int32{ - 0, // 0: ratelimit.service.ratelimit.v3.RateLimitConfigDiscoveryService.StreamRlsConfigs:input_type -> envoy.service.discovery.v3.DiscoveryRequest - 0, // 1: ratelimit.service.ratelimit.v3.RateLimitConfigDiscoveryService.FetchRlsConfigs:input_type -> envoy.service.discovery.v3.DiscoveryRequest - 1, // 2: ratelimit.service.ratelimit.v3.RateLimitConfigDiscoveryService.StreamRlsConfigs:output_type -> envoy.service.discovery.v3.DiscoveryResponse - 1, // 3: ratelimit.service.ratelimit.v3.RateLimitConfigDiscoveryService.FetchRlsConfigs:output_type -> envoy.service.discovery.v3.DiscoveryResponse - 2, // [2:4] is the sub-list for method output_type - 0, // [0:2] is the sub-list for method input_type - 0, // [0:0] is the sub-list for extension type_name - 0, // [0:0] is the sub-list for extension extendee - 0, // [0:0] is the sub-list for field type_name -} - -func init() { file_ratelimit_service_ratelimit_v3_rls_conf_ds_proto_init() } -func file_ratelimit_service_ratelimit_v3_rls_conf_ds_proto_init() { - if File_ratelimit_service_ratelimit_v3_rls_conf_ds_proto != nil { - return - } - type x struct{} - out := protoimpl.TypeBuilder{ - File: protoimpl.DescBuilder{ - GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: file_ratelimit_service_ratelimit_v3_rls_conf_ds_proto_rawDesc, - NumEnums: 0, - NumMessages: 0, - NumExtensions: 0, - NumServices: 1, - }, - GoTypes: file_ratelimit_service_ratelimit_v3_rls_conf_ds_proto_goTypes, - DependencyIndexes: file_ratelimit_service_ratelimit_v3_rls_conf_ds_proto_depIdxs, - }.Build() - File_ratelimit_service_ratelimit_v3_rls_conf_ds_proto = out.File - file_ratelimit_service_ratelimit_v3_rls_conf_ds_proto_rawDesc = nil - file_ratelimit_service_ratelimit_v3_rls_conf_ds_proto_goTypes = nil - file_ratelimit_service_ratelimit_v3_rls_conf_ds_proto_depIdxs = nil -} - -// Reference imports to suppress errors if they are not otherwise used. -var ( - _ context.Context - _ grpc.ClientConnInterface -) - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the grpc package it is being compiled against. -const _ = grpc.SupportPackageIsVersion6 - -// RateLimitConfigDiscoveryServiceClient is the client API for RateLimitConfigDiscoveryService service. -// -// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. -type RateLimitConfigDiscoveryServiceClient interface { - StreamRlsConfigs(ctx context.Context, opts ...grpc.CallOption) (RateLimitConfigDiscoveryService_StreamRlsConfigsClient, error) - FetchRlsConfigs(ctx context.Context, in *v3.DiscoveryRequest, opts ...grpc.CallOption) (*v3.DiscoveryResponse, error) -} - -type rateLimitConfigDiscoveryServiceClient struct { - cc grpc.ClientConnInterface -} - -func NewRateLimitConfigDiscoveryServiceClient(cc grpc.ClientConnInterface) RateLimitConfigDiscoveryServiceClient { - return &rateLimitConfigDiscoveryServiceClient{cc} -} - -func (c *rateLimitConfigDiscoveryServiceClient) StreamRlsConfigs(ctx context.Context, opts ...grpc.CallOption) (RateLimitConfigDiscoveryService_StreamRlsConfigsClient, error) { - stream, err := c.cc.NewStream(ctx, &_RateLimitConfigDiscoveryService_serviceDesc.Streams[0], "/ratelimit.service.ratelimit.v3.RateLimitConfigDiscoveryService/StreamRlsConfigs", opts...) - if err != nil { - return nil, err - } - x := &rateLimitConfigDiscoveryServiceStreamRlsConfigsClient{stream} - return x, nil -} - -type RateLimitConfigDiscoveryService_StreamRlsConfigsClient interface { - Send(*v3.DiscoveryRequest) error - Recv() (*v3.DiscoveryResponse, error) - grpc.ClientStream -} - -type rateLimitConfigDiscoveryServiceStreamRlsConfigsClient struct { - grpc.ClientStream -} - -func (x *rateLimitConfigDiscoveryServiceStreamRlsConfigsClient) Send(m *v3.DiscoveryRequest) error { - return x.ClientStream.SendMsg(m) -} - -func (x *rateLimitConfigDiscoveryServiceStreamRlsConfigsClient) Recv() (*v3.DiscoveryResponse, error) { - m := new(v3.DiscoveryResponse) - if err := x.ClientStream.RecvMsg(m); err != nil { - return nil, err - } - return m, nil -} - -func (c *rateLimitConfigDiscoveryServiceClient) FetchRlsConfigs(ctx context.Context, in *v3.DiscoveryRequest, opts ...grpc.CallOption) (*v3.DiscoveryResponse, error) { - out := new(v3.DiscoveryResponse) - err := c.cc.Invoke(ctx, "/ratelimit.service.ratelimit.v3.RateLimitConfigDiscoveryService/FetchRlsConfigs", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -// RateLimitConfigDiscoveryServiceServer is the server API for RateLimitConfigDiscoveryService service. -type RateLimitConfigDiscoveryServiceServer interface { - StreamRlsConfigs(RateLimitConfigDiscoveryService_StreamRlsConfigsServer) error - FetchRlsConfigs(context.Context, *v3.DiscoveryRequest) (*v3.DiscoveryResponse, error) -} - -// UnimplementedRateLimitConfigDiscoveryServiceServer can be embedded to have forward compatible implementations. -type UnimplementedRateLimitConfigDiscoveryServiceServer struct{} - -func (*UnimplementedRateLimitConfigDiscoveryServiceServer) StreamRlsConfigs(RateLimitConfigDiscoveryService_StreamRlsConfigsServer) error { - return status.Errorf(codes.Unimplemented, "method StreamRlsConfigs not implemented") -} - -func (*UnimplementedRateLimitConfigDiscoveryServiceServer) FetchRlsConfigs(context.Context, *v3.DiscoveryRequest) (*v3.DiscoveryResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method FetchRlsConfigs not implemented") -} - -func RegisterRateLimitConfigDiscoveryServiceServer(s *grpc.Server, srv RateLimitConfigDiscoveryServiceServer) { - s.RegisterService(&_RateLimitConfigDiscoveryService_serviceDesc, srv) -} - -func _RateLimitConfigDiscoveryService_StreamRlsConfigs_Handler(srv interface{}, stream grpc.ServerStream) error { - return srv.(RateLimitConfigDiscoveryServiceServer).StreamRlsConfigs(&rateLimitConfigDiscoveryServiceStreamRlsConfigsServer{stream}) -} - -type RateLimitConfigDiscoveryService_StreamRlsConfigsServer interface { - Send(*v3.DiscoveryResponse) error - Recv() (*v3.DiscoveryRequest, error) - grpc.ServerStream -} - -type rateLimitConfigDiscoveryServiceStreamRlsConfigsServer struct { - grpc.ServerStream -} - -func (x *rateLimitConfigDiscoveryServiceStreamRlsConfigsServer) Send(m *v3.DiscoveryResponse) error { - return x.ServerStream.SendMsg(m) -} - -func (x *rateLimitConfigDiscoveryServiceStreamRlsConfigsServer) Recv() (*v3.DiscoveryRequest, error) { - m := new(v3.DiscoveryRequest) - if err := x.ServerStream.RecvMsg(m); err != nil { - return nil, err - } - return m, nil -} - -func _RateLimitConfigDiscoveryService_FetchRlsConfigs_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(v3.DiscoveryRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(RateLimitConfigDiscoveryServiceServer).FetchRlsConfigs(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/ratelimit.service.ratelimit.v3.RateLimitConfigDiscoveryService/FetchRlsConfigs", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(RateLimitConfigDiscoveryServiceServer).FetchRlsConfigs(ctx, req.(*v3.DiscoveryRequest)) - } - return interceptor(ctx, in, info, handler) -} - -var _RateLimitConfigDiscoveryService_serviceDesc = grpc.ServiceDesc{ - ServiceName: "ratelimit.service.ratelimit.v3.RateLimitConfigDiscoveryService", - HandlerType: (*RateLimitConfigDiscoveryServiceServer)(nil), - Methods: []grpc.MethodDesc{ - { - MethodName: "FetchRlsConfigs", - Handler: _RateLimitConfigDiscoveryService_FetchRlsConfigs_Handler, - }, - }, - Streams: []grpc.StreamDesc{ - { - StreamName: "StreamRlsConfigs", - Handler: _RateLimitConfigDiscoveryService_StreamRlsConfigs_Handler, - ServerStreams: true, - ClientStreams: true, - }, - }, - Metadata: "ratelimit/service/ratelimit/v3/rls_conf_ds.proto", -} diff --git a/src/provider/file_provider.go b/src/provider/file_provider.go index f2ec72f2b..2d218edd1 100644 --- a/src/provider/file_provider.go +++ b/src/provider/file_provider.go @@ -28,6 +28,8 @@ func (p *FileProvider) ConfigUpdateEvent() <-chan ConfigUpdateEvent { return p.configUpdateEventChan } +func (p *FileProvider) Stop() {} + func (p *FileProvider) watch() { p.runtime.AddUpdateCallback(p.runtimeUpdateEvent) diff --git a/src/provider/provider.go b/src/provider/provider.go index e552f0af8..fcc0546fb 100644 --- a/src/provider/provider.go +++ b/src/provider/provider.go @@ -6,6 +6,7 @@ import ( type RateLimitConfigProvider interface { ConfigUpdateEvent() <-chan ConfigUpdateEvent + Stop() } type ConfigUpdateEvent interface { diff --git a/src/provider/xds_grpc_sotw_provider.go b/src/provider/xds_grpc_sotw_provider.go index 049a32b94..43af037f4 100644 --- a/src/provider/xds_grpc_sotw_provider.go +++ b/src/provider/xds_grpc_sotw_provider.go @@ -24,8 +24,8 @@ import ( "google.golang.org/grpc/codes" grpcStatus "google.golang.org/grpc/status" - rls_conf_v3 "github.com/envoyproxy/ratelimit/src/api/ratelimit/config/ratelimit/v3" - rls_svc_v3 "github.com/envoyproxy/ratelimit/src/api/ratelimit/service/ratelimit/v3" + rls_conf_v3 "github.com/envoyproxy/go-control-plane/ratelimit/config/ratelimit/v3" + // rls_svc_v3 "github.com/envoyproxy/go-control-plane/ratelimit/service/ratelimit/v3" ) const ( @@ -37,20 +37,22 @@ type XdsGrpcSotwProvider struct { loader config.RateLimitConfigLoader configUpdateEventChan chan ConfigUpdateEvent statsManager stats.Manager - xdsStream rls_svc_v3.RateLimitConfigDiscoveryService_StreamRlsConfigsClient - lastAckedResponse *discovery.DiscoveryResponse + // xdsStream rls_svc_v3.RateLimitConfigDiscoveryService_StreamRlsConfigsClient + xdsStream discovery.AggregatedDiscoveryService_StreamAggregatedResourcesClient + lastAckedResponse *discovery.DiscoveryResponse // TODO: (renuka) lastAckedResponse and lastReceivedResponse are equal lastReceivedResponse *discovery.DiscoveryResponse // If a connection error occurs, true event would be returned - connectionFaultChannel chan bool + connectionRetryChannel chan bool } func NewXdsGrpcSotwProvider(settings settings.Settings, statsManager stats.Manager) RateLimitConfigProvider { return &XdsGrpcSotwProvider{ - settings: settings, - statsManager: statsManager, - configUpdateEventChan: make(chan ConfigUpdateEvent), - loader: config.NewRateLimitConfigLoaderImpl(), + settings: settings, + statsManager: statsManager, + configUpdateEventChan: make(chan ConfigUpdateEvent), + connectionRetryChannel: make(chan bool), + loader: config.NewRateLimitConfigLoaderImpl(), } } @@ -59,16 +61,21 @@ func (p *XdsGrpcSotwProvider) ConfigUpdateEvent() <-chan ConfigUpdateEvent { return p.configUpdateEventChan } +func (p *XdsGrpcSotwProvider) Stop() { + p.connectionRetryChannel <- false +} + func (p *XdsGrpcSotwProvider) initXdsClient() { logger.Info("Starting xDS client connection for rate limit configurations") conn := p.initializeAndWatch() - for retryTrueReceived := range p.connectionFaultChannel { - if !retryTrueReceived { - continue - } + for retryEvent := range p.connectionRetryChannel { if conn != nil { conn.Close() } + if !retryEvent { // stop watching + logger.Info("Stopping xDS client watch for rate limit configurations") + break + } conn = p.initializeAndWatch() } } @@ -76,7 +83,7 @@ func (p *XdsGrpcSotwProvider) initXdsClient() { func (p *XdsGrpcSotwProvider) initializeAndWatch() *grpc.ClientConn { conn, err := p.initConnection() if err != nil { - p.connectionFaultChannel <- true + p.connectionRetryChannel <- true return conn } go p.watchConfigs() @@ -104,16 +111,16 @@ func (p *XdsGrpcSotwProvider) watchConfigs() { if err == io.EOF { // reinitialize again, if stream ends logger.Error("EOF is received from xDS Configuration Server") - p.connectionFaultChannel <- true + p.connectionRetryChannel <- true return } if err != nil { logger.Errorf("Failed to receive the discovery response from xDS Configuration Server: %s", err.Error()) errStatus, _ := grpcStatus.FromError(err) - if errStatus.Code() == codes.Unavailable { - logger.Errorf("Connection unavailable. errorCode: %s errorMessage: %s", + if errStatus.Code() == codes.Unavailable || errStatus.Code() == codes.Canceled { + logger.Errorf("Connection error. errorCode: %s errorMessage: %s", errStatus.Code().String(), errStatus.Message()) - p.connectionFaultChannel <- true + p.connectionRetryChannel <- true return } logger.Errorf("Error while xDS communication; errorCode: %s errorMessage: %s", @@ -134,7 +141,7 @@ func (p *XdsGrpcSotwProvider) initConnection() (*grpc.ClientConn, error) { logger.Errorf("Error initializing gRPC connection to xDS Configuration Server: %s", err.Error()) return nil, err } - p.xdsStream, err = rls_svc_v3.NewRateLimitConfigDiscoveryServiceClient(conn).StreamRlsConfigs(context.Background()) + p.xdsStream, err = discovery.NewAggregatedDiscoveryServiceClient(conn).StreamAggregatedResources(context.Background()) if err != nil { logger.Errorf("Error initializing gRPC stream to xDS Configuration Server: %s", err.Error()) return nil, err diff --git a/src/server/server.go b/src/server/server.go index 86ec9a981..aa812f8cf 100644 --- a/src/server/server.go +++ b/src/server/server.go @@ -5,7 +5,8 @@ import ( pb "github.com/envoyproxy/go-control-plane/envoy/service/ratelimit/v3" - "github.com/lyft/goruntime/loader" + "github.com/envoyproxy/ratelimit/src/provider" + stats "github.com/lyft/gostats" "google.golang.org/grpc" ) @@ -18,11 +19,6 @@ type Server interface { */ Start() - /** - * Returns the root store of the stats tree for the server - */ - Store() stats.Store - /** * Returns the root of the stats tree for the server */ @@ -40,9 +36,9 @@ type Server interface { GrpcServer() *grpc.Server /** - * Returns the runtime configuration for the server. + * Returns the configuration provider for the server. */ - Runtime() loader.IFace + Provider() provider.RateLimitConfigProvider /** * Stops serving the grpc port (for integration testing). diff --git a/src/server/server_impl.go b/src/server/server_impl.go index dea35af95..ba704449f 100644 --- a/src/server/server_impl.go +++ b/src/server/server_impl.go @@ -11,7 +11,6 @@ import ( "net/http/pprof" "os" "os/signal" - "path/filepath" "sort" "strconv" "sync" @@ -20,6 +19,7 @@ import ( "google.golang.org/grpc/credentials" "google.golang.org/grpc/keepalive" + "github.com/envoyproxy/ratelimit/src/provider" "github.com/envoyproxy/ratelimit/src/stats" "github.com/coocood/freecache" @@ -59,6 +59,7 @@ type server struct { grpcServer *grpc.Server store gostats.Store scope gostats.Scope + provider provider.RateLimitConfigProvider runtime loader.IFace debugListener serverDebugListener httpServer *http.Server @@ -127,6 +128,18 @@ func NewJsonHandler(svc pb.RateLimitServiceServer) func(http.ResponseWriter, *ht } } +func getProviderImpl(s settings.Settings, statsManager stats.Manager, rootStore gostats.Store) provider.RateLimitConfigProvider { + switch s.ConfigType { + case "FILE": + return provider.NewFileProvider(s, statsManager, rootStore) + case "GRPC_XDS_SOTW": + return provider.NewXdsGrpcSotwProvider(s, statsManager) + default: + logger.Fatalf("Invalid setting for ConfigType: %s", s.ConfigType) + panic("This line should not be reachable") + } +} + func (server *server) AddJsonHandler(svc pb.RateLimitServiceServer) { server.router.HandleFunc("/json", NewJsonHandler(svc)) } @@ -180,16 +193,12 @@ func (server *server) startGrpc() { server.grpcServer.Serve(lis) } -func (server *server) Store() gostats.Store { - return server.store -} - func (server *server) Scope() gostats.Scope { return server.scope } -func (server *server) Runtime() loader.IFace { - return server.runtime +func (server *server) Provider() provider.RateLimitConfigProvider { + return server.provider } func NewServer(s settings.Settings, name string, statsManager stats.Manager, localCache *freecache.Cache, opts ...settings.Option) Server { @@ -238,37 +247,8 @@ func newServer(s settings.Settings, name string, statsManager stats.Manager, loc ret.store.AddStatGenerator(limiter.NewLocalCacheStats(localCache, ret.scope.Scope("localcache"))) } - // setup runtime - loaderOpts := make([]loader.Option, 0, 1) - if s.RuntimeIgnoreDotFiles { - loaderOpts = append(loaderOpts, loader.IgnoreDotFiles) - } else { - loaderOpts = append(loaderOpts, loader.AllowDotFiles) - } - var err error - if s.RuntimeWatchRoot { - ret.runtime, err = loader.New2( - s.RuntimePath, - s.RuntimeSubdirectory, - ret.store.ScopeWithTags("runtime", s.ExtraTags), - &loader.SymlinkRefresher{RuntimePath: s.RuntimePath}, - loaderOpts...) - } else { - directoryRefresher := &loader.DirectoryRefresher{} - // Adding loader.Remove to the default set of goruntime's FileSystemOps. - directoryRefresher.WatchFileSystemOps(loader.Remove, loader.Write, loader.Create, loader.Chmod) - - ret.runtime, err = loader.New2( - filepath.Join(s.RuntimePath, s.RuntimeSubdirectory), - "config", - ret.store.ScopeWithTags("runtime", s.ExtraTags), - directoryRefresher, - loaderOpts...) - } - - if err != nil { - panic(err) - } + // setup config provider + ret.provider = getProviderImpl(s, statsManager, ret.store) // setup http router ret.router = mux.NewRouter() @@ -343,6 +323,7 @@ func (server *server) Stop() { if server.httpServer != nil { server.httpServer.Close() } + server.provider.Stop() } func (server *server) handleGracefulShutdown() { diff --git a/src/service_cmd/runner/runner.go b/src/service_cmd/runner/runner.go index 61f5f1822..952814b60 100644 --- a/src/service_cmd/runner/runner.go +++ b/src/service_cmd/runner/runner.go @@ -10,7 +10,6 @@ import ( "time" "github.com/envoyproxy/ratelimit/src/metrics" - "github.com/envoyproxy/ratelimit/src/provider" "github.com/envoyproxy/ratelimit/src/stats" "github.com/envoyproxy/ratelimit/src/trace" @@ -75,18 +74,6 @@ func createLimiter(srv server.Server, s settings.Settings, localCache *freecache } } -func getProviderImpl(s settings.Settings, statsManager stats.Manager, rootStore gostats.Store) provider.RateLimitConfigProvider { - switch s.ConfigType { - case "FILE": - return provider.NewFileProvider(s, statsManager, rootStore) - case "GRPC_XDS_SOTW": - return provider.NewXdsGrpcSotwProvider(s, statsManager) - default: - logger.Fatalf("Invalid setting for ConfigType: %s", s.ConfigType) - panic("This line should not be reachable") - } -} - func (runner *Runner) Run() { s := runner.settings if s.TracingEnabled { @@ -130,7 +117,7 @@ func (runner *Runner) Run() { service := ratelimit.NewService( createLimiter(srv, s, localCache, runner.statsManager), - getProviderImpl(s, runner.statsManager, srv.Store()), + srv.Provider(), runner.statsManager, utils.NewTimeSourceImpl(), s.GlobalShadowMode, diff --git a/test/common/xds_sotw.go b/test/common/xds_sotw.go new file mode 100644 index 000000000..eaed24fbe --- /dev/null +++ b/test/common/xds_sotw.go @@ -0,0 +1,52 @@ +package common + +import ( + "context" + "fmt" + "net" + "testing" + + "github.com/envoyproxy/go-control-plane/pkg/cache/v3" + "github.com/envoyproxy/go-control-plane/pkg/server/v3" + "google.golang.org/grpc" + + discoverygrpc "github.com/envoyproxy/go-control-plane/envoy/service/discovery/v3" +) + +type XdsServerConfig struct { + Port int + NodeId string +} + +func StartXdsSotwServer(t *testing.T, config *XdsServerConfig, initSnapshot *cache.Snapshot) (cache.SnapshotCache, context.CancelFunc) { + t.Helper() + + ctx, cancel := context.WithCancel(context.Background()) + + snapCache := cache.NewSnapshotCache(true, cache.IDHash{}, nil) // TODO: marked as true + if err := initSnapshot.Consistent(); err != nil { + t.Errorf("Error checking consistency in initial snapshot: %v", err) + } + + if err := snapCache.SetSnapshot(context.Background(), config.NodeId, initSnapshot); err != nil { + panic(err) + } + srv := server.NewServer(ctx, snapCache, nil) + + grpcServer := grpc.NewServer() + lis, err := net.Listen("tcp", fmt.Sprintf(":%d", config.Port)) + if err != nil { + t.Errorf("Error listening to port: %v: %v", config.Port, err) + } + discoverygrpc.RegisterAggregatedDiscoveryServiceServer(grpcServer, srv) + go func() { + if err = grpcServer.Serve(lis); err != nil { + t.Error(err) + } + }() + + return snapCache, func() { + cancel() + grpcServer.Stop() + } +} diff --git a/test/mocks/provider/provider.go b/test/mocks/provider/provider.go index 2d2d4b319..376f8379b 100644 --- a/test/mocks/provider/provider.go +++ b/test/mocks/provider/provider.go @@ -50,6 +50,18 @@ func (mr *MockRateLimitConfigProviderMockRecorder) ConfigUpdateEvent() *gomock.C return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ConfigUpdateEvent", reflect.TypeOf((*MockRateLimitConfigProvider)(nil).ConfigUpdateEvent)) } +// Stop mocks base method +func (m *MockRateLimitConfigProvider) Stop() { + m.ctrl.T.Helper() + m.ctrl.Call(m, "Stop") +} + +// Stop indicates an expected call of Stop +func (mr *MockRateLimitConfigProviderMockRecorder) Stop() *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Stop", reflect.TypeOf((*MockRateLimitConfigProvider)(nil).Stop)) +} + // MockConfigUpdateEvent is a mock of ConfigUpdateEvent interface type MockConfigUpdateEvent struct { ctrl *gomock.Controller diff --git a/test/provider/xds_grpc_sotw_provider_test.go b/test/provider/xds_grpc_sotw_provider_test.go new file mode 100644 index 000000000..af5482af3 --- /dev/null +++ b/test/provider/xds_grpc_sotw_provider_test.go @@ -0,0 +1,175 @@ +package provider_test + +import ( + "context" + "fmt" + "strings" + "testing" + + gostats "github.com/lyft/gostats" + "github.com/stretchr/testify/assert" + + "github.com/envoyproxy/go-control-plane/pkg/cache/types" + "github.com/envoyproxy/go-control-plane/pkg/cache/v3" + "github.com/envoyproxy/go-control-plane/pkg/resource/v3" + + "github.com/envoyproxy/ratelimit/src/provider" + "github.com/envoyproxy/ratelimit/src/settings" + "github.com/envoyproxy/ratelimit/test/common" + "github.com/envoyproxy/ratelimit/test/mocks/stats" + + rls_config "github.com/envoyproxy/go-control-plane/ratelimit/config/ratelimit/v3" + // ratelimitservice "github.com/envoyproxy/go-control-plane/ratelimit/service/ratelimit/v3" +) + +const ( + xdsNodeId = "test-node" + xdsPort = 18001 +) + +func TestXdsProvider(t *testing.T) { + intSnapshot, _ := cache.NewSnapshot("1", + map[resource.Type][]types.Resource{ + resource.RateLimitConfigType: { + &rls_config.RateLimitConfig{ + Domain: "foo", + Descriptors: []*rls_config.RateLimitDescriptor{ + { + Key: "k1", + Value: "v1", + RateLimit: &rls_config.RateLimitPolicy{ + Unit: "minute", + RequestsPerUnit: 3, + }, + }, + }, + }, + }, + }, + ) + snapCache, cancel := common.StartXdsSotwServer(t, &common.XdsServerConfig{Port: xdsPort, NodeId: xdsNodeId}, intSnapshot) + defer cancel() + + s := settings.Settings{ + ConfigType: "GRPC_XDS_SOTW", + ConfigGrpcXdsNodeId: xdsNodeId, + ConfigGrpcXdsServerUrl: fmt.Sprintf("localhost:%d", xdsPort), + } + + statsStore := gostats.NewStore(gostats.NewNullSink(), false) + statsManager := stats.NewMockStatManager(statsStore) + p := provider.NewXdsGrpcSotwProvider(s, statsManager) + defer p.Stop() + providerEventChan := p.ConfigUpdateEvent() + + t.Run("Test initial xDS config", testInitialXdsConfig(snapCache, providerEventChan)) + t.Run("Test new (after initial) xDS config update", testNewXdsConfigUpdate(snapCache, providerEventChan)) + t.Run("Test multi domain xDS config update", testMultiDomainXdsConfigUpdate(snapCache, providerEventChan)) +} + +func testInitialXdsConfig(snapCache cache.SnapshotCache, providerEventChan <-chan provider.ConfigUpdateEvent) func(t *testing.T) { + return func(t *testing.T) { + assert := assert.New(t) + + configEvent := <-providerEventChan + assert.NotNil(configEvent) + + config, err := configEvent.GetConfig() + assert.Nil(err) + assert.Equal("foo.k1_v1: unit=MINUTE requests_per_unit=3, shadow_mode: false\n", config.Dump()) + } +} + +func testNewXdsConfigUpdate(snapCache cache.SnapshotCache, providerEventChan <-chan provider.ConfigUpdateEvent) func(t *testing.T) { + return func(t *testing.T) { + assert := assert.New(t) + + snapshot, _ := cache.NewSnapshot("2", + map[resource.Type][]types.Resource{ + resource.RateLimitConfigType: { + &rls_config.RateLimitConfig{ + Domain: "foo", + Descriptors: []*rls_config.RateLimitDescriptor{ + { + Key: "k2", + Value: "v2", + RateLimit: &rls_config.RateLimitPolicy{ + Unit: "minute", + RequestsPerUnit: 5, + }, + }, + }, + }, + }, + }, + ) + setSnapshot(t, snapCache, snapshot) + + configEvent := <-providerEventChan + assert.NotNil(configEvent) + + config, err := configEvent.GetConfig() + assert.Nil(err) + assert.Equal("foo.k2_v2: unit=MINUTE requests_per_unit=5, shadow_mode: false\n", config.Dump()) + } +} + +func testMultiDomainXdsConfigUpdate(snapCache cache.SnapshotCache, providerEventChan <-chan provider.ConfigUpdateEvent) func(t *testing.T) { + return func(t *testing.T) { + assert := assert.New(t) + + snapshot, _ := cache.NewSnapshot("3", + map[resource.Type][]types.Resource{ + resource.RateLimitConfigType: { + &rls_config.RateLimitConfig{ + Domain: "foo", + Descriptors: []*rls_config.RateLimitDescriptor{ + { + Key: "k1", + Value: "k2", + RateLimit: &rls_config.RateLimitPolicy{ + Unit: "minute", + RequestsPerUnit: 10, + }, + }, + }, + }, + &rls_config.RateLimitConfig{ + Domain: "bar", + Descriptors: []*rls_config.RateLimitDescriptor{ + { + Key: "k1", + Value: "k2", + RateLimit: &rls_config.RateLimitPolicy{ + Unit: "minute", + RequestsPerUnit: 100, + }, + }, + }, + }, + }, + }, + ) + setSnapshot(t, snapCache, snapshot) + + configEvent := <-providerEventChan + assert.NotNil(configEvent) + + config, err := configEvent.GetConfig() + assert.Nil(err) + assert.Equal([]string{ + "foo.k1_k2: unit=MINUTE requests_per_unit=10, shadow_mode: false", + "bar.k1_k2: unit=MINUTE requests_per_unit=100, shadow_mode: false", + }, strings.Split(strings.TrimSuffix(config.Dump(), "\n"), "\n")) + } +} + +func setSnapshot(t *testing.T, snapCache cache.SnapshotCache, snapshot *cache.Snapshot) { + t.Helper() + if err := snapshot.Consistent(); err != nil { + t.Errorf("snapshot inconsistency: %+v\n%+v", snapshot, err) + } + if err := snapCache.SetSnapshot(context.Background(), "test-node", snapshot); err != nil { + t.Errorf("snapshot error %q for %+v", err, snapshot) + } +} From a94b006ef151692a483092db975b6889650e07af Mon Sep 17 00:00:00 2001 From: Renuka Fernando Date: Tue, 18 Oct 2022 20:59:51 +0530 Subject: [PATCH 08/22] Add integration tests for xDS config provider Signed-off-by: Renuka Fernando --- go.mod | 3 +- go.sum | 2 + test/integration/integration_test.go | 14 +++ test/integration/xds_sotw_integration_test.go | 118 ++++++++++++++++++ 4 files changed, 136 insertions(+), 1 deletion(-) create mode 100644 test/integration/xds_sotw_integration_test.go diff --git a/go.mod b/go.mod index 2ff0a2b63..9b73b6836 100644 --- a/go.mod +++ b/go.mod @@ -2,7 +2,8 @@ module github.com/envoyproxy/ratelimit go 1.18 -replace github.com/envoyproxy/go-control-plane => /Users/renuka/git/go-control-plane +// replace github.com/envoyproxy/go-control-plane => /Users/renuka/git/go-control-plane +replace github.com/envoyproxy/go-control-plane => github.com/renuka-fernando/go-control-plane v0.0.1 require ( github.com/alicebob/miniredis/v2 v2.23.0 diff --git a/go.sum b/go.sum index fea3aff34..fa38c1e5a 100644 --- a/go.sum +++ b/go.sum @@ -185,6 +185,8 @@ github.com/pkg/sftp v1.10.1/go.mod h1:lYOWFsE0bwd1+KfKJaKeuokY15vzFx25BLbzYYoAxZ github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= github.com/prometheus/client_model v0.2.0/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= +github.com/renuka-fernando/go-control-plane v0.0.1 h1:XURYmEmqrBkiT/JNALD3YC3blB4ubbjZyz5oOpqKLI8= +github.com/renuka-fernando/go-control-plane v0.0.1/go.mod h1:fJJn/j26vwOu972OllsvAgJJM//w9BV6Fxbg2LuVd34= github.com/rogpeppe/fastuuid v1.2.0/go.mod h1:jVj6XXZzXRy/MSR5jhDC/2q6DgLz+nrA6LYCDYWNEvQ= github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= github.com/sirupsen/logrus v1.4.2/go.mod h1:tLMulIdttU9McNUspp0xgXVQah82FyeX6MwdIuYE2rE= diff --git a/test/integration/integration_test.go b/test/integration/integration_test.go index a835c5080..b0c816259 100644 --- a/test/integration/integration_test.go +++ b/test/integration/integration_test.go @@ -95,6 +95,20 @@ func TestBasicConfig(t *testing.T) { }) } +func TestXdsProviderBasicConfig(t *testing.T) { + common.WithMultiRedis(t, []common.RedisConfig{ + {Port: 6383}, + {Port: 6380}, + }, func() { + _, cancel := startXdsSotwServer(t) + defer cancel() + t.Run("WithoutPerSecondRedis", testXdsProviderBasicConfig(false, 0)) + t.Run("WithPerSecondRedis", testXdsProviderBasicConfig(true, 0)) + t.Run("WithoutPerSecondRedisWithLocalCache", testXdsProviderBasicConfig(false, 1000)) + t.Run("WithPerSecondRedisWithLocalCache", testXdsProviderBasicConfig(true, 1000)) + }) +} + func TestBasicConfig_ExtraTags(t *testing.T) { common.WithMultiRedis(t, []common.RedisConfig{ {Port: 6383}, diff --git a/test/integration/xds_sotw_integration_test.go b/test/integration/xds_sotw_integration_test.go new file mode 100644 index 000000000..b1d40b6ed --- /dev/null +++ b/test/integration/xds_sotw_integration_test.go @@ -0,0 +1,118 @@ +//go:build integration + +package integration_test + +import ( + "context" + "testing" + + "github.com/envoyproxy/go-control-plane/pkg/cache/types" + "github.com/envoyproxy/go-control-plane/pkg/cache/v3" + "github.com/envoyproxy/go-control-plane/pkg/resource/v3" + + "github.com/envoyproxy/ratelimit/src/settings" + "github.com/envoyproxy/ratelimit/test/common" + + rls_config "github.com/envoyproxy/go-control-plane/ratelimit/config/ratelimit/v3" +) + +func testXdsProviderBasicConfig(perSecond bool, local_cache_size int) func(*testing.T) { + s := makeSimpleRedisSettings(6383, 6380, perSecond, local_cache_size) + configXdsProvider(&s) + + return testBasicBaseConfig(s) +} + +func configXdsProvider(s *settings.Settings) { + s.ConfigType = "GRPC_XDS_SOTW" + s.ConfigGrpcXdsNodeId = "init-test-node" + s.ConfigGrpcXdsServerUrl = "localhost:18000" +} + +func startXdsSotwServer(t *testing.T) (cache.SnapshotCache, context.CancelFunc) { + conf := &common.XdsServerConfig{Port: 18000, NodeId: "init-test-node"} + return common.StartXdsSotwServer(t, conf, initialXdsBasicConfig()) +} + +func initialXdsBasicConfig() *cache.Snapshot { + intSnapshot, _ := cache.NewSnapshot("1", + map[resource.Type][]types.Resource{ + resource.RateLimitConfigType: { + &rls_config.RateLimitConfig{ + Domain: "basic", + Descriptors: []*rls_config.RateLimitDescriptor{ + { + Key: "key1", + RateLimit: &rls_config.RateLimitPolicy{ + Unit: "second", + RequestsPerUnit: 50, + }, + }, + { + Key: "key1_local", + RateLimit: &rls_config.RateLimitPolicy{ + Unit: "second", + RequestsPerUnit: 50, + }, + }, + { + Key: "one_per_minute", + RateLimit: &rls_config.RateLimitPolicy{ + Unit: "minute", + RequestsPerUnit: 1, + }, + }, + }, + }, + &rls_config.RateLimitConfig{ + Domain: "another", + Descriptors: []*rls_config.RateLimitDescriptor{ + { + Key: "key2", + RateLimit: &rls_config.RateLimitPolicy{ + Unit: "minute", + RequestsPerUnit: 20, + }, + }, + { + Key: "key3", + RateLimit: &rls_config.RateLimitPolicy{ + Unit: "hour", + RequestsPerUnit: 10, + }, + }, + { + Key: "key2_local", + RateLimit: &rls_config.RateLimitPolicy{ + Unit: "minute", + RequestsPerUnit: 20, + }, + }, + { + Key: "key3_local", + RateLimit: &rls_config.RateLimitPolicy{ + Unit: "hour", + RequestsPerUnit: 10, + }, + }, + { + Key: "key4", + RateLimit: &rls_config.RateLimitPolicy{ + Unit: "day", + RequestsPerUnit: 20, + }, + }, + { + Key: "key4_local", + RateLimit: &rls_config.RateLimitPolicy{ + Unit: "day", + RequestsPerUnit: 20, + }, + }, + }, + }, + }, + }, + ) + return intSnapshot +} From e1f0eceabe0fb5c18ca93714d98badd2fd483392 Mon Sep 17 00:00:00 2001 From: Renuka Fernando Date: Wed, 19 Oct 2022 14:13:01 +0530 Subject: [PATCH 09/22] Add integration tests for xDS config reload Signed-off-by: Renuka Fernando --- src/service/ratelimit.go | 1 + test/common/xds_sotw.go | 22 +- test/integration/integration_test.go | 75 ++++--- test/integration/xds_sotw_integration_test.go | 197 ++++++++++++------ test/provider/xds_grpc_sotw_provider_test.go | 28 +-- 5 files changed, 210 insertions(+), 113 deletions(-) diff --git a/src/service/ratelimit.go b/src/service/ratelimit.go index e1984dfbe..d9810131f 100644 --- a/src/service/ratelimit.go +++ b/src/service/ratelimit.go @@ -312,6 +312,7 @@ func NewService(cache limiter.RateLimitCache, configProvider provider.RateLimitC customHeaderClock: clock, } + newService.reloadConfig(<-newService.configUpdateEvent) go func() { for { logger.Debugf("waiting for config update") diff --git a/test/common/xds_sotw.go b/test/common/xds_sotw.go index eaed24fbe..fa93f48d1 100644 --- a/test/common/xds_sotw.go +++ b/test/common/xds_sotw.go @@ -5,6 +5,7 @@ import ( "fmt" "net" "testing" + "time" "github.com/envoyproxy/go-control-plane/pkg/cache/v3" "github.com/envoyproxy/go-control-plane/pkg/server/v3" @@ -18,7 +19,9 @@ type XdsServerConfig struct { NodeId string } -func StartXdsSotwServer(t *testing.T, config *XdsServerConfig, initSnapshot *cache.Snapshot) (cache.SnapshotCache, context.CancelFunc) { +type SetSnapshotFunc func(*cache.Snapshot) + +func StartXdsSotwServer(t *testing.T, config *XdsServerConfig, initSnapshot *cache.Snapshot) (SetSnapshotFunc, context.CancelFunc) { t.Helper() ctx, cancel := context.WithCancel(context.Background()) @@ -45,8 +48,23 @@ func StartXdsSotwServer(t *testing.T, config *XdsServerConfig, initSnapshot *cac } }() - return snapCache, func() { + // HACK: Wait for the server to come up. Make a hook that we can wait on. + WaitForTcpPort(context.Background(), config.Port, 1*time.Second) + + cancelFunc := func() { cancel() grpcServer.Stop() } + return setSnapshotFunc(t, snapCache, config.NodeId), cancelFunc +} + +func setSnapshotFunc(t *testing.T, snapCache cache.SnapshotCache, nodeId string) SetSnapshotFunc { + return func(snapshot *cache.Snapshot) { + if err := snapshot.Consistent(); err != nil { + t.Errorf("snapshot inconsistency: %+v\n%+v", snapshot, err) + } + if err := snapCache.SetSnapshot(context.Background(), nodeId, snapshot); err != nil { + t.Errorf("snapshot error %q for %+v", err, snapshot) + } + } } diff --git a/test/integration/integration_test.go b/test/integration/integration_test.go index b0c816259..74cfb8b16 100644 --- a/test/integration/integration_test.go +++ b/test/integration/integration_test.go @@ -195,6 +195,17 @@ func TestBasicReloadConfig(t *testing.T) { }) } +func TestXdsProviderBasicConfigReload(t *testing.T) { + common.WithMultiRedis(t, []common.RedisConfig{ + {Port: 6383}, + }, func() { + setSnapshotFunc, cancel := startXdsSotwServer(t) + defer cancel() + + t.Run("ReloadConfigWithXdsServer", testXdsProviderBasicConfigReload(setSnapshotFunc, false, 0)) + }) +} + func makeSimpleMemcacheSettings(memcachePorts []int, localCacheSize int) settings.Settings { s := defaultSettings() var memcacheHostAndPort []string @@ -395,7 +406,7 @@ func testBasicConfigWithoutWatchRootWithRedisSentinel(perSecond bool, local_cach func testBasicConfigReload(perSecond bool, local_cache_size int, runtimeWatchRoot bool) func(*testing.T) { s := makeSimpleRedisSettings(6383, 6380, perSecond, local_cache_size) s.RuntimeWatchRoot = runtimeWatchRoot - return testConfigReload(s) + return testConfigReload(s, reloadNewConfigFile, restoreConfigFile) } func testBasicConfigReloadWithRedisCluster(perSecond bool, local_cache_size int, runtimeWatchRoot string) func(*testing.T) { @@ -409,7 +420,7 @@ func testBasicConfigReloadWithRedisCluster(perSecond bool, local_cache_size int, configRedisCluster(&s) - return testConfigReload(s) + return testConfigReload(s, reloadNewConfigFile, restoreConfigFile) } func testBasicConfigReloadWithRedisSentinel(perSecond bool, local_cache_size int, runtimeWatchRoot bool) func(*testing.T) { @@ -423,7 +434,7 @@ func testBasicConfigReloadWithRedisSentinel(perSecond bool, local_cache_size int s.RuntimeWatchRoot = runtimeWatchRoot - return testConfigReload(s) + return testConfigReload(s, reloadNewConfigFile, restoreConfigFile) } func getCacheKey(cacheKey string, enableLocalCache bool) string { @@ -685,7 +696,7 @@ func startTestRunner(t *testing.T, s settings.Settings) *runner.Runner { return &runner } -func testConfigReload(s settings.Settings) func(*testing.T) { +func testConfigReload(s settings.Settings, reloadConfFunc, restoreConfFunc func()) func(*testing.T) { return func(t *testing.T) { enable_local_cache := s.LocalCacheSizeInBytes > 0 runner := startTestRunner(t, s) @@ -712,26 +723,7 @@ func testConfigReload(s settings.Settings) func(*testing.T) { runner.GetStatsStore().Flush() loadCountBefore := runner.GetStatsStore().NewCounter("ratelimit.service.config_load_success").Value() - // Copy a new file to config folder to test config reload functionality - in, err := os.Open("runtime/current/ratelimit/reload.yaml") - if err != nil { - panic(err) - } - defer in.Close() - out, err := os.Create("runtime/current/ratelimit/config/reload.yaml") - if err != nil { - panic(err) - } - defer out.Close() - _, err = io.Copy(out, in) - if err != nil { - panic(err) - } - err = out.Close() - if err != nil { - panic(err) - } - + reloadConfFunc() loadCountAfter, reloaded := waitForConfigReload(runner, loadCountBefore) assert.True(reloaded) @@ -753,11 +745,7 @@ func testConfigReload(s settings.Settings) func(*testing.T) { response) assert.NoError(err) - err = os.Remove("runtime/current/ratelimit/config/reload.yaml") - if err != nil { - panic(err) - } - + restoreConfFunc() // Removal of config files must trigger a reload loadCountBefore = loadCountAfter loadCountAfter, reloaded = waitForConfigReload(runner, loadCountBefore) @@ -766,6 +754,35 @@ func testConfigReload(s settings.Settings) func(*testing.T) { } } +func reloadNewConfigFile() { + // Copy a new file to config folder to test config reload functionality + in, err := os.Open("runtime/current/ratelimit/reload.yaml") + if err != nil { + panic(err) + } + defer in.Close() + out, err := os.Create("runtime/current/ratelimit/config/reload.yaml") + if err != nil { + panic(err) + } + defer out.Close() + _, err = io.Copy(out, in) + if err != nil { + panic(err) + } + err = out.Close() + if err != nil { + panic(err) + } +} + +func restoreConfigFile() { + err := os.Remove("runtime/current/ratelimit/config/reload.yaml") + if err != nil { + panic(err) + } +} + func waitForConfigReload(runner *runner.Runner, loadCountBefore uint64) (uint64, bool) { // Need to wait for config reload to take place and new descriptors to be loaded. // Shouldn't take more than 5 seconds but wait 120 at most just to be safe. diff --git a/test/integration/xds_sotw_integration_test.go b/test/integration/xds_sotw_integration_test.go index b1d40b6ed..0cc2a62e3 100644 --- a/test/integration/xds_sotw_integration_test.go +++ b/test/integration/xds_sotw_integration_test.go @@ -23,96 +23,157 @@ func testXdsProviderBasicConfig(perSecond bool, local_cache_size int) func(*test return testBasicBaseConfig(s) } +func testXdsProviderBasicConfigReload(setSnapshotFunc common.SetSnapshotFunc, perSecond bool, local_cache_size int) func(*testing.T) { + s := makeSimpleRedisSettings(6383, 6380, perSecond, local_cache_size) + configXdsProvider(&s) + return testConfigReload(s, newConfigWithXdsConfigProvider(setSnapshotFunc), restoreConfigWithXdsConfigProvider(setSnapshotFunc)) +} + func configXdsProvider(s *settings.Settings) { s.ConfigType = "GRPC_XDS_SOTW" s.ConfigGrpcXdsNodeId = "init-test-node" s.ConfigGrpcXdsServerUrl = "localhost:18000" } -func startXdsSotwServer(t *testing.T) (cache.SnapshotCache, context.CancelFunc) { +func startXdsSotwServer(t *testing.T) (common.SetSnapshotFunc, context.CancelFunc) { conf := &common.XdsServerConfig{Port: 18000, NodeId: "init-test-node"} - return common.StartXdsSotwServer(t, conf, initialXdsBasicConfig()) + intSnapshot, err := cache.NewSnapshot("1", initialXdsBasicConfig()) + if err != nil { + panic(err) + } + return common.StartXdsSotwServer(t, conf, intSnapshot) } -func initialXdsBasicConfig() *cache.Snapshot { - intSnapshot, _ := cache.NewSnapshot("1", - map[resource.Type][]types.Resource{ - resource.RateLimitConfigType: { - &rls_config.RateLimitConfig{ - Domain: "basic", - Descriptors: []*rls_config.RateLimitDescriptor{ - { - Key: "key1", - RateLimit: &rls_config.RateLimitPolicy{ - Unit: "second", - RequestsPerUnit: 50, - }, +func initialXdsBasicConfig() map[resource.Type][]types.Resource { + return map[resource.Type][]types.Resource{ + resource.RateLimitConfigType: { + &rls_config.RateLimitConfig{ + Domain: "basic", + Descriptors: []*rls_config.RateLimitDescriptor{ + { + Key: "key1", + RateLimit: &rls_config.RateLimitPolicy{ + Unit: "second", + RequestsPerUnit: 50, }, - { - Key: "key1_local", - RateLimit: &rls_config.RateLimitPolicy{ - Unit: "second", - RequestsPerUnit: 50, - }, + }, + { + Key: "key1_local", + RateLimit: &rls_config.RateLimitPolicy{ + Unit: "second", + RequestsPerUnit: 50, }, - { - Key: "one_per_minute", - RateLimit: &rls_config.RateLimitPolicy{ - Unit: "minute", - RequestsPerUnit: 1, - }, + }, + { + Key: "one_per_minute", + RateLimit: &rls_config.RateLimitPolicy{ + Unit: "minute", + RequestsPerUnit: 1, }, }, }, - &rls_config.RateLimitConfig{ - Domain: "another", - Descriptors: []*rls_config.RateLimitDescriptor{ - { - Key: "key2", - RateLimit: &rls_config.RateLimitPolicy{ - Unit: "minute", - RequestsPerUnit: 20, - }, + }, + &rls_config.RateLimitConfig{ + Domain: "another", + Descriptors: []*rls_config.RateLimitDescriptor{ + { + Key: "key2", + RateLimit: &rls_config.RateLimitPolicy{ + Unit: "minute", + RequestsPerUnit: 20, }, - { - Key: "key3", - RateLimit: &rls_config.RateLimitPolicy{ - Unit: "hour", - RequestsPerUnit: 10, - }, + }, + { + Key: "key3", + RateLimit: &rls_config.RateLimitPolicy{ + Unit: "hour", + RequestsPerUnit: 10, }, - { - Key: "key2_local", - RateLimit: &rls_config.RateLimitPolicy{ - Unit: "minute", - RequestsPerUnit: 20, - }, + }, + { + Key: "key2_local", + RateLimit: &rls_config.RateLimitPolicy{ + Unit: "minute", + RequestsPerUnit: 20, }, - { - Key: "key3_local", - RateLimit: &rls_config.RateLimitPolicy{ - Unit: "hour", - RequestsPerUnit: 10, - }, + }, + { + Key: "key3_local", + RateLimit: &rls_config.RateLimitPolicy{ + Unit: "hour", + RequestsPerUnit: 10, }, - { - Key: "key4", - RateLimit: &rls_config.RateLimitPolicy{ - Unit: "day", - RequestsPerUnit: 20, - }, + }, + { + Key: "key4", + RateLimit: &rls_config.RateLimitPolicy{ + Unit: "day", + RequestsPerUnit: 20, }, - { - Key: "key4_local", - RateLimit: &rls_config.RateLimitPolicy{ - Unit: "day", - RequestsPerUnit: 20, - }, + }, + { + Key: "key4_local", + RateLimit: &rls_config.RateLimitPolicy{ + Unit: "day", + RequestsPerUnit: 20, }, }, }, }, }, - ) - return intSnapshot + } +} + +func newConfigWithXdsConfigProvider(setSnapshotFunc common.SetSnapshotFunc) func() { + initConfig := initialXdsBasicConfig() + rlsConf := initConfig[resource.RateLimitConfigType] + newRlsConf := append(rlsConf, &rls_config.RateLimitConfig{ + Domain: "reload", + Descriptors: []*rls_config.RateLimitDescriptor{ + { + Key: "key1", + RateLimit: &rls_config.RateLimitPolicy{ + Unit: "second", + RequestsPerUnit: 50, + }, + }, + { + Key: "block", + RateLimit: &rls_config.RateLimitPolicy{ + Unit: "second", + RequestsPerUnit: 0, + }, + }, + { + Key: "one_per_minute", + RateLimit: &rls_config.RateLimitPolicy{ + Unit: "minute", + RequestsPerUnit: 1, + }, + }, + }, + }) + + newConfig := map[resource.Type][]types.Resource{ + resource.RateLimitConfigType: newRlsConf, + } + newSnapshot, err := cache.NewSnapshot("2", newConfig) + if err != nil { + panic(err) + } + + return func() { + setSnapshotFunc(newSnapshot) + } +} + +func restoreConfigWithXdsConfigProvider(setSnapshotFunc common.SetSnapshotFunc) func() { + newSnapshot, err := cache.NewSnapshot("3", initialXdsBasicConfig()) + if err != nil { + panic(err) + } + + return func() { + setSnapshotFunc(newSnapshot) + } } diff --git a/test/provider/xds_grpc_sotw_provider_test.go b/test/provider/xds_grpc_sotw_provider_test.go index af5482af3..051706e23 100644 --- a/test/provider/xds_grpc_sotw_provider_test.go +++ b/test/provider/xds_grpc_sotw_provider_test.go @@ -47,7 +47,7 @@ func TestXdsProvider(t *testing.T) { }, }, ) - snapCache, cancel := common.StartXdsSotwServer(t, &common.XdsServerConfig{Port: xdsPort, NodeId: xdsNodeId}, intSnapshot) + setSnapshotFunc, cancel := common.StartXdsSotwServer(t, &common.XdsServerConfig{Port: xdsPort, NodeId: xdsNodeId}, intSnapshot) defer cancel() s := settings.Settings{ @@ -62,12 +62,12 @@ func TestXdsProvider(t *testing.T) { defer p.Stop() providerEventChan := p.ConfigUpdateEvent() - t.Run("Test initial xDS config", testInitialXdsConfig(snapCache, providerEventChan)) - t.Run("Test new (after initial) xDS config update", testNewXdsConfigUpdate(snapCache, providerEventChan)) - t.Run("Test multi domain xDS config update", testMultiDomainXdsConfigUpdate(snapCache, providerEventChan)) + t.Run("Test initial xDS config", testInitialXdsConfig(setSnapshotFunc, providerEventChan)) + t.Run("Test new (after initial) xDS config update", testNewXdsConfigUpdate(setSnapshotFunc, providerEventChan)) + t.Run("Test multi domain xDS config update", testMultiDomainXdsConfigUpdate(setSnapshotFunc, providerEventChan)) } -func testInitialXdsConfig(snapCache cache.SnapshotCache, providerEventChan <-chan provider.ConfigUpdateEvent) func(t *testing.T) { +func testInitialXdsConfig(setSnapshotFunc common.SetSnapshotFunc, providerEventChan <-chan provider.ConfigUpdateEvent) func(t *testing.T) { return func(t *testing.T) { assert := assert.New(t) @@ -80,7 +80,7 @@ func testInitialXdsConfig(snapCache cache.SnapshotCache, providerEventChan <-cha } } -func testNewXdsConfigUpdate(snapCache cache.SnapshotCache, providerEventChan <-chan provider.ConfigUpdateEvent) func(t *testing.T) { +func testNewXdsConfigUpdate(setSnapshotFunc common.SetSnapshotFunc, providerEventChan <-chan provider.ConfigUpdateEvent) func(t *testing.T) { return func(t *testing.T) { assert := assert.New(t) @@ -103,7 +103,7 @@ func testNewXdsConfigUpdate(snapCache cache.SnapshotCache, providerEventChan <-c }, }, ) - setSnapshot(t, snapCache, snapshot) + setSnapshotFunc(snapshot) configEvent := <-providerEventChan assert.NotNil(configEvent) @@ -114,7 +114,7 @@ func testNewXdsConfigUpdate(snapCache cache.SnapshotCache, providerEventChan <-c } } -func testMultiDomainXdsConfigUpdate(snapCache cache.SnapshotCache, providerEventChan <-chan provider.ConfigUpdateEvent) func(t *testing.T) { +func testMultiDomainXdsConfigUpdate(setSnapshotFunc common.SetSnapshotFunc, providerEventChan <-chan provider.ConfigUpdateEvent) func(t *testing.T) { return func(t *testing.T) { assert := assert.New(t) @@ -126,7 +126,7 @@ func testMultiDomainXdsConfigUpdate(snapCache cache.SnapshotCache, providerEvent Descriptors: []*rls_config.RateLimitDescriptor{ { Key: "k1", - Value: "k2", + Value: "v2", RateLimit: &rls_config.RateLimitPolicy{ Unit: "minute", RequestsPerUnit: 10, @@ -139,7 +139,7 @@ func testMultiDomainXdsConfigUpdate(snapCache cache.SnapshotCache, providerEvent Descriptors: []*rls_config.RateLimitDescriptor{ { Key: "k1", - Value: "k2", + Value: "v2", RateLimit: &rls_config.RateLimitPolicy{ Unit: "minute", RequestsPerUnit: 100, @@ -150,16 +150,16 @@ func testMultiDomainXdsConfigUpdate(snapCache cache.SnapshotCache, providerEvent }, }, ) - setSnapshot(t, snapCache, snapshot) + setSnapshotFunc(snapshot) configEvent := <-providerEventChan assert.NotNil(configEvent) config, err := configEvent.GetConfig() assert.Nil(err) - assert.Equal([]string{ - "foo.k1_k2: unit=MINUTE requests_per_unit=10, shadow_mode: false", - "bar.k1_k2: unit=MINUTE requests_per_unit=100, shadow_mode: false", + assert.ElementsMatch([]string{ + "foo.k1_v2: unit=MINUTE requests_per_unit=10, shadow_mode: false", + "bar.k1_v2: unit=MINUTE requests_per_unit=100, shadow_mode: false", }, strings.Split(strings.TrimSuffix(config.Dump(), "\n"), "\n")) } } From 6ad7ad8a9968b4dfef6f70c6d0f80d5f43f384c8 Mon Sep 17 00:00:00 2001 From: Renuka Fernando Date: Thu, 20 Oct 2022 20:25:47 +0530 Subject: [PATCH 10/22] Enable TLS for xDS configuration client Signed-off-by: Renuka Fernando --- src/provider/xds_grpc_sotw_provider.go | 17 ++++++++++++-- src/service/ratelimit.go | 13 +++++++---- src/service_cmd/runner/runner.go | 1 + src/settings/settings.go | 31 +++++++++++++++++++++++++- test/service/ratelimit_test.go | 4 ++-- 5 files changed, 57 insertions(+), 9 deletions(-) diff --git a/src/provider/xds_grpc_sotw_provider.go b/src/provider/xds_grpc_sotw_provider.go index 43af037f4..df33cbcf8 100644 --- a/src/provider/xds_grpc_sotw_provider.go +++ b/src/provider/xds_grpc_sotw_provider.go @@ -13,6 +13,7 @@ import ( logger "github.com/sirupsen/logrus" "google.golang.org/genproto/googleapis/rpc/status" "google.golang.org/grpc" + "google.golang.org/grpc/credentials" "google.golang.org/grpc/credentials/insecure" "google.golang.org/protobuf/proto" "google.golang.org/protobuf/types/known/anypb" @@ -155,14 +156,26 @@ func (p *XdsGrpcSotwProvider) getGrpcConnection() (*grpc.ClientConn, error) { logger.Infof("Dialing xDS Configuration Server: '%s'", p.settings.ConfigGrpcXdsServerUrl) return grpc.Dial( p.settings.ConfigGrpcXdsServerUrl, - grpc.WithTransportCredentials(insecure.NewCredentials()), - // grpc.WithTransportCredentials(generateTLSCredentialsForXdsClient()), + p.getGrpcTransportCredentials(), grpc.WithBlock(), grpc.WithStreamInterceptor( grpc_retry.StreamClientInterceptor(grpc_retry.WithBackoff(backOff)), )) } +func (p *XdsGrpcSotwProvider) getGrpcTransportCredentials() grpc.DialOption { + if !p.settings.ConfigGrpcXdsServerUseTls { + return grpc.WithTransportCredentials(insecure.NewCredentials()) + } + + configGrpcXdsTlsConfig := p.settings.ConfigGrpcXdsTlsConfig + if p.settings.ConfigGrpcXdsServerTlsSAN != "" { + logger.Infof("ServerName used for xDS configuration service hostname verification is %s", p.settings.ConfigGrpcXdsServerTlsSAN) + configGrpcXdsTlsConfig.ServerName = p.settings.ConfigGrpcXdsServerTlsSAN + } + return grpc.WithTransportCredentials(credentials.NewTLS(configGrpcXdsTlsConfig)) +} + func (p *XdsGrpcSotwProvider) sendConfigs(resources []*any.Any) { conf := make([]config.RateLimitConfigToLoad, 0, len(resources)) for i, res := range resources { diff --git a/src/service/ratelimit.go b/src/service/ratelimit.go index d9810131f..bb28e7412 100644 --- a/src/service/ratelimit.go +++ b/src/service/ratelimit.go @@ -300,7 +300,7 @@ func (this *service) GetCurrentConfig() config.RateLimitConfig { } func NewService(cache limiter.RateLimitCache, configProvider provider.RateLimitConfigProvider, statsManager stats.Manager, - clock utils.TimeSource, shadowMode bool) RateLimitServiceServer { + clock utils.TimeSource, shadowMode, forceStart bool) RateLimitServiceServer { newService := &service{ configLock: sync.RWMutex{}, @@ -312,12 +312,17 @@ func NewService(cache limiter.RateLimitCache, configProvider provider.RateLimitC customHeaderClock: clock, } - newService.reloadConfig(<-newService.configUpdateEvent) + if !forceStart { + logger.Info("Waiting for initial ratelimit config update event") + newService.reloadConfig(<-newService.configUpdateEvent) + logger.Info("Successfully loaded the initial ratelimit configs") + } + go func() { for { - logger.Debugf("waiting for config update") + logger.Debug("Waiting for config update") updateEvent := <-newService.configUpdateEvent - logger.Debugf("got config update and reloading config") + logger.Debug("Got config update and reloading config") newService.reloadConfig(updateEvent) } }() diff --git a/src/service_cmd/runner/runner.go b/src/service_cmd/runner/runner.go index 952814b60..6b1bc136d 100644 --- a/src/service_cmd/runner/runner.go +++ b/src/service_cmd/runner/runner.go @@ -121,6 +121,7 @@ func (runner *Runner) Run() { runner.statsManager, utils.NewTimeSourceImpl(), s.GlobalShadowMode, + s.ForceStartWithoutInitialConfig, ) srv.AddDebugHttpEndpoint( diff --git a/src/settings/settings.go b/src/settings/settings.go index 5d6c09f66..7cb085c77 100644 --- a/src/settings/settings.go +++ b/src/settings/settings.go @@ -48,12 +48,26 @@ type Settings struct { // Rate limit configuration // ConfigType is the method of configuring rate limits. Possible values "FILE", "GRPC_XDS_SOTW". - ConfigType string `envconfig:"CONFIG_TYPE" default:"FILE"` + ConfigType string `envconfig:"CONFIG_TYPE" default:"FILE"` + // ForceStartWithoutInitialConfig enables start the server without initial rate limit config event + ForceStartWithoutInitialConfig bool `envconfig:"FORCE_START_WITHOUT_INITIAL_CONFIG" default:"false"` + + // xDS rate limit configuration + // ConfigGrpcXdsNodeId is the Node ID. xDS server should set snapshots to this Node ID ConfigGrpcXdsNodeId string `envconfig:"CONFIG_GRPC_XDS_NODE_ID" default:"default"` ConfigGrpcXdsServerUrl string `envconfig:"CONFIG_GRPC_XDS_SERVER_URL" default:"localhost:18000"` ConfigGrpcXdsServerConnectRetryInterval time.Duration `envconfig:"CONFIG_GRPC_XDS_SERVER_CONNECT_RETRY_INTERVAL" default:"3s"` ConfigGrpcXdsServerConnectTimeout time.Duration `envconfig:"CONFIG_GRPC_XDS_SERVER_CONNECT_TIMEOUT" default:"3s"` + // xDS config server TLS configurations + ConfigGrpcXdsTlsConfig *tls.Config + ConfigGrpcXdsServerUseTls bool `envconfig:"CONFIG_GRPC_XDS_SERVER_USE_TLS" default:"false"` + ConfigGrpcXdsClientTlsCert string `envconfig:"CONFIG_GRPC_XDS_CLIENT_TLS_CERT" default:""` + ConfigGrpcXdsClientTlsKey string `envconfig:"CONFIG_GRPC_XDS_CLIENT_TLS_KEY" default:""` + ConfigGrpcXdsServerTlsCACert string `envconfig:"CONFIG_GRPC_XDS_SERVER_TLS_CACERT" default:""` + // GrpcClientTlsSAN is the SAN to validate from the client cert during mTLS auth + ConfigGrpcXdsServerTlsSAN string `envconfig:"GRPC_CLIENT_TLS_SAN" default:""` + // Stats-related settings UseStatsd bool `envconfig:"USE_STATSD" default:"true"` StatsdHost string `envconfig:"STATSD_HOST" default:"localhost"` @@ -157,6 +171,7 @@ func NewSettings() Settings { // When we require TLS to connect to Redis, we check if we need to connect using the provided key-pair. RedisTlsConfig(s.RedisTls || s.RedisPerSecondTls)(&s) GrpcServerTlsConfig()(&s) + ConfigGrpcXdsServerTlsConfig()(&s) return s } @@ -186,6 +201,20 @@ func GrpcServerTlsConfig() Option { } } +func ConfigGrpcXdsServerTlsConfig() Option { + return func(s *Settings) { + if s.ConfigGrpcXdsServerUseTls { + configGrpcXdsServerTlsConfig := utils.TlsConfigFromFiles(s.ConfigGrpcXdsClientTlsCert, s.ConfigGrpcXdsClientTlsKey, s.ConfigGrpcXdsServerTlsCACert, utils.ServerCA) + if s.ConfigGrpcXdsServerTlsCACert != "" { + configGrpcXdsServerTlsConfig.ClientAuth = tls.RequireAndVerifyClientCert + } else { + configGrpcXdsServerTlsConfig.ClientAuth = tls.NoClientCert + } + s.ConfigGrpcXdsTlsConfig = configGrpcXdsServerTlsConfig + } + } +} + func GrpcUnaryInterceptor(i grpc.UnaryServerInterceptor) Option { return func(s *Settings) { s.GrpcUnaryInterceptor = i diff --git a/test/service/ratelimit_test.go b/test/service/ratelimit_test.go index 4e1f0916b..021d7b3c4 100644 --- a/test/service/ratelimit_test.go +++ b/test/service/ratelimit_test.go @@ -102,7 +102,7 @@ func (this *rateLimitServiceTestSuite) setupBasicService() ratelimit.RateLimitSe testSpanExporter.Reset() - svc := ratelimit.NewService(this.cache, this.configProvider, this.statsManager, MockClock{now: int64(2222)}, false) + svc := ratelimit.NewService(this.cache, this.configProvider, this.statsManager, MockClock{now: int64(2222)}, false, false) barrier.wait() // wait for initial config load return svc } @@ -528,7 +528,7 @@ func TestInitialLoadError(test *testing.T) { return nil, config.RateLimitConfigError("load error") }) go func() { t.configUpdateEventChan <- t.configUpdateEvent }() // initial config update from provider - service := ratelimit.NewService(t.cache, t.configProvider, t.statsManager, t.mockClock, false) + service := ratelimit.NewService(t.cache, t.configProvider, t.statsManager, t.mockClock, false, false) barrier.wait() request := common.NewRateLimitRequest("test-domain", [][][2]string{{{"hello", "world"}}}, 1) From 2cf48fa50dfff7fcc1cd11e949bb1cf6a9e632a0 Mon Sep 17 00:00:00 2001 From: Renuka Fernando Date: Thu, 20 Oct 2022 21:36:54 +0530 Subject: [PATCH 11/22] Add sample xDS sever Signed-off-by: Renuka Fernando --- README.md | 36 +- docker-compose-example.yml | 16 + examples/ratelimit/config/example.yaml | 18 +- examples/xds-sotw-config-server/Dockerfile | 15 + examples/xds-sotw-config-server/README.md | 16 + examples/xds-sotw-config-server/go.mod | 23 + examples/xds-sotw-config-server/go.sum | 429 +++++++++++++++++++ examples/xds-sotw-config-server/logger.go | 40 ++ examples/xds-sotw-config-server/main/main.go | 67 +++ examples/xds-sotw-config-server/resource.go | 181 ++++++++ examples/xds-sotw-config-server/server.go | 62 +++ 11 files changed, 892 insertions(+), 11 deletions(-) create mode 100644 examples/xds-sotw-config-server/Dockerfile create mode 100644 examples/xds-sotw-config-server/README.md create mode 100644 examples/xds-sotw-config-server/go.mod create mode 100644 examples/xds-sotw-config-server/go.sum create mode 100644 examples/xds-sotw-config-server/logger.go create mode 100644 examples/xds-sotw-config-server/main/main.go create mode 100644 examples/xds-sotw-config-server/resource.go create mode 100644 examples/xds-sotw-config-server/server.go diff --git a/README.md b/README.md index 1fd24af4f..f7947520a 100644 --- a/README.md +++ b/README.md @@ -7,7 +7,8 @@ - [API Deprecation History](#api-deprecation-history) - [Building and Testing](#building-and-testing) - [Docker-compose setup](#docker-compose-setup) - - [Full test environment](#full-test-environment) + - [Full test environment - Configure rate limits through files](#full-test-environment---configure-rate-limits-through-files) + - [Full test environment - Configure rate limits through xDS-Server](#full-test-environment---configure-rate-limits-through-xds-server) - [Self-contained end-to-end integration test](#self-contained-end-to-end-integration-test) - [Configuration](#configuration) - [The configuration format](#the-configuration-format) @@ -129,11 +130,12 @@ If you want to run with [two redis instances](#two-redis-instances), you will ne the docker-compose.yml file to run a second redis container, and change the environment variables as explained in the [two redis instances](#two-redis-instances) section. -## Full test environment +## Full test environment - Configure rate limits through files To run a fully configured environment to demo Envoy based rate limiting, run: ```bash +export CONFIG_TYPE=FILE docker-compose -f docker-compose-example.yml up --build --remove-orphans ``` @@ -160,6 +162,36 @@ To see the metrics in the example curl http://localhost:9102/metrics | grep -i shadow ``` +## Full test environment - Configure rate limits through xDS-Server + +To run a fully configured environment to demo Envoy based rate limiting, run: + +```bash +export CONFIG_TYPE=GRPC_XDS_SOTW +docker-compose -f docker-compose-example.yml --profile xds-config up --build --remove-orphans +``` + +This will run in `xds-config` docker-compose profile which will run example xDS-Server, ratelimit, redis, prom-statsd-exporter and two Envoy containers such that you can demo rate limiting by hitting the below endpoints. + +```bash +curl localhost:8888/test +curl localhost:8888/header -H "foo: foo" # Header based +curl localhost:8888/twoheader -H "foo: foo" -H "bar: bar" # Two headers +curl localhost:8888/twoheader -H "foo: foo" -H "baz: baz" # This will be rate limited +curl localhost:8888/twoheader -H "foo: foo" -H "bar: banned" # Ban a particular header value +curl localhost:8888/twoheader -H "foo: foo" -H "baz: shady" # This will never be ratelimited since "baz" with value "shady" is in shadow_mode +curl localhost:8888/twoheader -H "foo: foo" -H "baz: not-so-shady" # This is subject to rate-limiting because the it's now in shadow_mode +``` + +Edit[ `examples/xds-sotw-config-server/resource.go`](examples/xds-sotw-config-server/resource.go) to test different rate limit configs. + +To see the metrics in the example + +```bash +# The metrics for the shadow_mode keys +curl http://localhost:9102/metrics | grep -i shadow +``` + ## Self-contained end-to-end integration test Integration tests are coded as bash-scripts in `integration-test/scripts`. diff --git a/docker-compose-example.yml b/docker-compose-example.yml index ba4cc69ed..242a50117 100644 --- a/docker-compose-example.yml +++ b/docker-compose-example.yml @@ -49,6 +49,22 @@ services: - RUNTIME_ROOT=/data - RUNTIME_SUBDIRECTORY=ratelimit - RUNTIME_WATCH_ROOT=false + - CONFIG_TYPE=${CONFIG_TYPE:-FILE} + - CONFIG_GRPC_XDS_NODE_ID=test-node-id + - CONFIG_GRPC_XDS_SERVER_URL=ratelimit-xds-config-server:18000 + + ratelimit-xds-config-server: + image: ratelimit-xds-config-server:latest + build: + context: examples/xds-sotw-config-server + dockerfile: Dockerfile + command: ["-nodeID", "test-node-id", "-port", "18000", "-debug", "true"] + expose: + - 18000 + networks: + - ratelimit-network + profiles: + - xds-config envoy-proxy: image: envoyproxy/envoy-dev:latest diff --git a/examples/ratelimit/config/example.yaml b/examples/ratelimit/config/example.yaml index d783fe989..52cc8e422 100644 --- a/examples/ratelimit/config/example.yaml +++ b/examples/ratelimit/config/example.yaml @@ -1,14 +1,14 @@ --- -domain: foo +domain: rl descriptors: - - key: k1 - value: v1 - descriptors: - - key: k2 - value: v2 - rate_limit: - unit: minute - requests_per_unit: 4 + - key: category + value: account + rate_limit: + replaces: + - name: bkthomps + - name: fake_name + unit: minute + requests_per_unit: 4 - key: source_cluster value: proxy descriptors: diff --git a/examples/xds-sotw-config-server/Dockerfile b/examples/xds-sotw-config-server/Dockerfile new file mode 100644 index 000000000..bcc08bfc3 --- /dev/null +++ b/examples/xds-sotw-config-server/Dockerfile @@ -0,0 +1,15 @@ +FROM golang:1.18 AS build +WORKDIR /xds-server + +# ENV GOPROXY=https://proxy.golang.org +# COPY go.mod go.sum /xds-server/ +# RUN go mod download + +COPY . . + +RUN CGO_ENABLED=0 GOOS=linux go build -o /go/bin/xds-server -v main/main.go + +FROM alpine:3.16 AS final +RUN apk --no-cache add ca-certificates && apk --no-cache update +COPY --from=build /go/bin/xds-server /bin/xds-server +ENTRYPOINT [ "/bin/xds-server" ] diff --git a/examples/xds-sotw-config-server/README.md b/examples/xds-sotw-config-server/README.md new file mode 100644 index 000000000..891da7763 --- /dev/null +++ b/examples/xds-sotw-config-server/README.md @@ -0,0 +1,16 @@ +# Example Rate-limit Configuration SotW xDS Server + +This is an example of a trivial xDS V3 control plane server similar to the example server in [go-control-plane](https://github.com/envoyproxy/go-control-plane/tree/main/internal/example). It serves Rate limit configuration. You can run the example using the project top-level Makefile, e.g.: + +``` +$ make example +``` + +The Makefile builds the example server and then runs `build/example.sh` which runs both Envoy and the example server. The example server serves a configuration defined in `internal/example/resource.go`. If everything works correctly, you should be able to open a browser to [http://localhost:10000](http://localhost:10000) and see Envoy's website. + +## Files + +- [main/main.go](main/main.go) is the example program entrypoint. It instantiates the cache and xDS server and runs the xDS server process. +- [resource.go](resource.go) generates a `Snapshot` structure which describes the configuration that the xDS server serves to Envoy. +- [server.go](server.go) runs the xDS control plane server. +- [logger.go](logger.go) implements the `pkg/log/Logger` interface which provides logging services to the cache. diff --git a/examples/xds-sotw-config-server/go.mod b/examples/xds-sotw-config-server/go.mod new file mode 100644 index 000000000..13d39d9e2 --- /dev/null +++ b/examples/xds-sotw-config-server/go.mod @@ -0,0 +1,23 @@ +module github.com/envoyproxy/ratelimit/examples/xds-sotw-config-server + +go 1.18 + +// TODO: (renuka) Remove this replace once, https://github.com/envoyproxy/go-control-plane/pull/598 is merged +replace github.com/envoyproxy/go-control-plane => github.com/renuka-fernando/go-control-plane v0.0.1 + +require ( + github.com/envoyproxy/go-control-plane v0.10.1 + google.golang.org/grpc v1.45.0 + google.golang.org/protobuf v1.28.0 +) + +require ( + github.com/census-instrumentation/opencensus-proto v0.3.0 // indirect + github.com/cncf/xds/go v0.0.0-20220314180256-7f1daf1720fc // indirect + github.com/envoyproxy/protoc-gen-validate v0.6.7 // indirect + github.com/golang/protobuf v1.5.2 // indirect + golang.org/x/net v0.0.0-20210813160813-60bc85c4be6d // indirect + golang.org/x/sys v0.0.0-20210816183151-1e6c022a8912 // indirect + golang.org/x/text v0.3.7 // indirect + google.golang.org/genproto v0.0.0-20220329172620-7be39ac1afc7 // indirect +) diff --git a/examples/xds-sotw-config-server/go.sum b/examples/xds-sotw-config-server/go.sum new file mode 100644 index 000000000..6e46f1a98 --- /dev/null +++ b/examples/xds-sotw-config-server/go.sum @@ -0,0 +1,429 @@ +cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= +cloud.google.com/go v0.34.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= +cloud.google.com/go v0.38.0/go.mod h1:990N+gfupTy94rShfmMCWGDn0LpTmnzTp2qbd1dvSRU= +cloud.google.com/go v0.44.1/go.mod h1:iSa0KzasP4Uvy3f1mN/7PiObzGgflwredwwASm/v6AU= +cloud.google.com/go v0.44.2/go.mod h1:60680Gw3Yr4ikxnPRS/oxxkBccT6SA1yMk63TGekxKY= +cloud.google.com/go v0.45.1/go.mod h1:RpBamKRgapWJb87xiFSdk4g1CME7QZg3uwTez+TSTjc= +cloud.google.com/go v0.46.3/go.mod h1:a6bKKbmY7er1mI7TEI4lsAkts/mkhTSZK8w33B4RAg0= +cloud.google.com/go v0.50.0/go.mod h1:r9sluTvynVuxRIOHXQEHMFffphuXHOMZMycpNR5e6To= +cloud.google.com/go v0.52.0/go.mod h1:pXajvRH/6o3+F9jDHZWQ5PbGhn+o8w9qiu/CffaVdO4= +cloud.google.com/go v0.53.0/go.mod h1:fp/UouUEsRkN6ryDKNW/Upv/JBKnv6WDthjR6+vze6M= +cloud.google.com/go v0.54.0/go.mod h1:1rq2OEkV3YMf6n/9ZvGWI3GWw0VoqH/1x2nd8Is/bPc= +cloud.google.com/go v0.56.0/go.mod h1:jr7tqZxxKOVYizybht9+26Z/gUq7tiRzu+ACVAMbKVk= +cloud.google.com/go v0.57.0/go.mod h1:oXiQ6Rzq3RAkkY7N6t3TcE6jE+CIBBbA36lwQ1JyzZs= +cloud.google.com/go v0.62.0/go.mod h1:jmCYTdRCQuc1PHIIJ/maLInMho30T/Y0M4hTdTShOYc= +cloud.google.com/go v0.65.0/go.mod h1:O5N8zS7uWy9vkA9vayVHs65eM1ubvY4h553ofrNHObY= +cloud.google.com/go/bigquery v1.0.1/go.mod h1:i/xbL2UlR5RvWAURpBYZTtm/cXjCha9lbfbpx4poX+o= +cloud.google.com/go/bigquery v1.3.0/go.mod h1:PjpwJnslEMmckchkHFfq+HTD2DmtT67aNFKH1/VBDHE= +cloud.google.com/go/bigquery v1.4.0/go.mod h1:S8dzgnTigyfTmLBfrtrhyYhwRxG72rYxvftPBK2Dvzc= +cloud.google.com/go/bigquery v1.5.0/go.mod h1:snEHRnqQbz117VIFhE8bmtwIDY80NLUZUMb4Nv6dBIg= +cloud.google.com/go/bigquery v1.7.0/go.mod h1://okPTzCYNXSlb24MZs83e2Do+h+VXtc4gLoIoXIAPc= +cloud.google.com/go/bigquery v1.8.0/go.mod h1:J5hqkt3O0uAFnINi6JXValWIb1v0goeZM77hZzJN/fQ= +cloud.google.com/go/datastore v1.0.0/go.mod h1:LXYbyblFSglQ5pkeyhO+Qmw7ukd3C+pD7TKLgZqpHYE= +cloud.google.com/go/datastore v1.1.0/go.mod h1:umbIZjpQpHh4hmRpGhH4tLFup+FVzqBi1b3c64qFpCk= +cloud.google.com/go/pubsub v1.0.1/go.mod h1:R0Gpsv3s54REJCy4fxDixWD93lHJMoZTyQ2kNxGRt3I= +cloud.google.com/go/pubsub v1.1.0/go.mod h1:EwwdRX2sKPjnvnqCa270oGRyludottCI76h+R3AArQw= +cloud.google.com/go/pubsub v1.2.0/go.mod h1:jhfEVHT8odbXTkndysNHCcx0awwzvfOlguIAii9o8iA= +cloud.google.com/go/pubsub v1.3.1/go.mod h1:i+ucay31+CNRpDW4Lu78I4xXG+O1r/MAHgjpRVR+TSU= +cloud.google.com/go/storage v1.0.0/go.mod h1:IhtSnM/ZTZV8YYJWCY8RULGVqBDmpoyjwiyrjsg+URw= +cloud.google.com/go/storage v1.5.0/go.mod h1:tpKbwo567HUNpVclU5sGELwQWBDZ8gh0ZeosJ0Rtdos= +cloud.google.com/go/storage v1.6.0/go.mod h1:N7U0C8pVQ/+NIKOBQyamJIeKQKkZ+mxpohlUTyfDhBk= +cloud.google.com/go/storage v1.8.0/go.mod h1:Wv1Oy7z6Yz3DshWRJFhqM/UCfaWIRTdp0RXyy7KQOVs= +cloud.google.com/go/storage v1.10.0/go.mod h1:FLPqc6j+Ki4BU591ie1oL6qBQGu2Bl/tZ9ullr3+Kg0= +dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU= +github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= +github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo= +github.com/OneOfOne/xxhash v1.2.2/go.mod h1:HSdplMjZKSmBqAxg5vPj2TmRDmfkzw+cTzAElWljhcU= +github.com/antihax/optional v1.0.0/go.mod h1:uupD/76wgC+ih3iEmQUL+0Ugr19nfwCT1kdvxnR2qWY= +github.com/census-instrumentation/opencensus-proto v0.3.0 h1:t/LhUZLVitR1Ow2YOnduCsavhwFUklBMoGVYUCqmCqk= +github.com/census-instrumentation/opencensus-proto v0.3.0/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= +github.com/cespare/xxhash v1.1.0/go.mod h1:XrSqR1VqqWfGrhpAt58auRo0WTKS1nRRg3ghfAqPWnc= +github.com/cespare/xxhash/v2 v2.1.1/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= +github.com/chzyer/logex v1.1.10/go.mod h1:+Ywpsq7O8HXn0nuIou7OrIPyXbp3wmkHB+jjWRnGsAI= +github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e/go.mod h1:nSuG5e5PlCu98SY8svDHJxuZscDgtXS6KTTbou5AhLI= +github.com/chzyer/test v0.0.0-20180213035817-a1ea475d72b1/go.mod h1:Q3SI9o4m/ZMnBNeIyt5eFwwo7qiLfzFZmjNmxjkiQlU= +github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw= +github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f/go.mod h1:M8M6+tZqaGXZJjfX53e64911xZQV5JYwmTeXPW+k8Sc= +github.com/cncf/udpa/go v0.0.0-20201120205902-5459f2c99403/go.mod h1:WmhPx2Nbnhtbo57+VJT5O0JRkEi1Wbu0z5j0R8u5Hbk= +github.com/cncf/udpa/go v0.0.0-20210930031921-04548b0d99d4/go.mod h1:6pvJx4me5XPnfI9Z40ddWsdw2W/uZgQLFXToKeRcDiI= +github.com/cncf/xds/go v0.0.0-20210922020428-25de7278fc84/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= +github.com/cncf/xds/go v0.0.0-20211011173535-cb28da3451f1/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= +github.com/cncf/xds/go v0.0.0-20220314180256-7f1daf1720fc h1:PYXxkRUBGUMa5xgMVMDl62vEklZvKpVaxQeN9ie7Hfk= +github.com/cncf/xds/go v0.0.0-20220314180256-7f1daf1720fc/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= +github.com/davecgh/go-spew v1.1.0 h1:ZDRjVQ15GmhC3fiQ8ni8+OwkZQO4DARzQgrnXU1Liz8= +github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= +github.com/envoyproxy/protoc-gen-validate v0.6.7 h1:qcZcULcd/abmQg6dwigimCNEyi4gg31M/xaciQlDml8= +github.com/envoyproxy/protoc-gen-validate v0.6.7/go.mod h1:dyJXwwfPK2VSqiB9Klm1J6romD608Ba7Hij42vrOBCo= +github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= +github.com/go-gl/glfw v0.0.0-20190409004039-e6da0acd62b1/go.mod h1:vR7hzQXu2zJy9AVAgeJqvqgH9Q5CA+iKCZ2gyEVpxRU= +github.com/go-gl/glfw/v3.3/glfw v0.0.0-20191125211704-12ad95a8df72/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= +github.com/go-gl/glfw/v3.3/glfw v0.0.0-20200222043503-6f7a984d4dc4/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= +github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= +github.com/golang/glog v1.0.0/go.mod h1:EWib/APOK0SL3dFbYqvxE3UYd8E6s1ouQ7iEp/0LWV4= +github.com/golang/groupcache v0.0.0-20190702054246-869f871628b6/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= +github.com/golang/groupcache v0.0.0-20191227052852-215e87163ea7/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= +github.com/golang/groupcache v0.0.0-20200121045136-8c9f03a8e57e/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= +github.com/golang/mock v1.1.1/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= +github.com/golang/mock v1.2.0/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= +github.com/golang/mock v1.3.1/go.mod h1:sBzyDLLjw3U8JLTeZvSv8jJB+tU5PVekmnlKIyFUx0Y= +github.com/golang/mock v1.4.0/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw= +github.com/golang/mock v1.4.1/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw= +github.com/golang/mock v1.4.3/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw= +github.com/golang/mock v1.4.4/go.mod h1:l3mdAwkq5BuhzHwde/uurv3sEJeZMXNpwsxVWU71h+4= +github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= +github.com/golang/protobuf v1.3.1/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= +github.com/golang/protobuf v1.3.2/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= +github.com/golang/protobuf v1.3.3/go.mod h1:vzj43D7+SQXF/4pzW/hwtAqwc6iTitCiVSaWz5lYuqw= +github.com/golang/protobuf v1.3.4/go.mod h1:vzj43D7+SQXF/4pzW/hwtAqwc6iTitCiVSaWz5lYuqw= +github.com/golang/protobuf v1.3.5/go.mod h1:6O5/vntMXwX2lRkT1hjjk0nAC1IDOTvTlVgjlRvqsdk= +github.com/golang/protobuf v1.4.0-rc.1/go.mod h1:ceaxUfeHdC40wWswd/P6IGgMaK3YpKi5j83Wpe3EHw8= +github.com/golang/protobuf v1.4.0-rc.1.0.20200221234624-67d41d38c208/go.mod h1:xKAWHe0F5eneWXFV3EuXVDTCmh+JuBKY0li0aMyXATA= +github.com/golang/protobuf v1.4.0-rc.2/go.mod h1:LlEzMj4AhA7rCAGe4KMBDvJI+AwstrUpVNzEA03Pprs= +github.com/golang/protobuf v1.4.0-rc.4.0.20200313231945-b860323f09d0/go.mod h1:WU3c8KckQ9AFe+yFwt9sWVRKCVIyN9cPHBJSNnbL67w= +github.com/golang/protobuf v1.4.0/go.mod h1:jodUvKwWbYaEsadDk5Fwe5c77LiNKVO9IDvqG2KuDX0= +github.com/golang/protobuf v1.4.1/go.mod h1:U8fpvMrcmy5pZrNK1lt4xCsGvpyWQ/VVv6QDs8UjoX8= +github.com/golang/protobuf v1.4.2/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI= +github.com/golang/protobuf v1.4.3/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI= +github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk= +github.com/golang/protobuf v1.5.2 h1:ROPKBNFfQgOUMifHyP+KYbvpjbdoFNs+aK7DXlji0Tw= +github.com/golang/protobuf v1.5.2/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= +github.com/google/btree v0.0.0-20180813153112-4030bb1f1f0c/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= +github.com/google/btree v1.0.0/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= +github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M= +github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= +github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= +github.com/google/go-cmp v0.4.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.4.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.5.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.5.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.5.6/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.5.7 h1:81/ik6ipDQS2aGcBfIN5dHDB36BwrStyeAQquSYCV4o= +github.com/google/go-cmp v0.5.7/go.mod h1:n+brtR0CgQNWTVd5ZUFpTBC8YFBDLK/h/bpaJ8/DtOE= +github.com/google/martian v2.1.0+incompatible/go.mod h1:9I4somxYTbIHy5NJKHRl3wXiIaQGbYVAs8BPL6v8lEs= +github.com/google/martian/v3 v3.0.0/go.mod h1:y5Zk1BBys9G+gd6Jrk0W3cC1+ELVxBWuIGO+w/tUAp0= +github.com/google/pprof v0.0.0-20181206194817-3ea8567a2e57/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc= +github.com/google/pprof v0.0.0-20190515194954-54271f7e092f/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc= +github.com/google/pprof v0.0.0-20191218002539-d4f498aebedc/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= +github.com/google/pprof v0.0.0-20200212024743-f11f1df84d12/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= +github.com/google/pprof v0.0.0-20200229191704-1ebb73c60ed3/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= +github.com/google/pprof v0.0.0-20200430221834-fc25d7d30c6d/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= +github.com/google/pprof v0.0.0-20200708004538-1a94d8640e99/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= +github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI= +github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= +github.com/googleapis/gax-go/v2 v2.0.4/go.mod h1:0Wqv26UfaUD9n4G6kQubkQ+KchISgw+vpHVxEJEs9eg= +github.com/googleapis/gax-go/v2 v2.0.5/go.mod h1:DWXyrwAJ9X0FpwwEdw+IPEYBICEFu5mhpdKc/us6bOk= +github.com/grpc-ecosystem/grpc-gateway/v2 v2.7.0/go.mod h1:hgWBS7lorOAVIJEQMi4ZsPv9hVvWI6+ch50m39Pf2Ks= +github.com/hashicorp/golang-lru v0.5.0/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= +github.com/hashicorp/golang-lru v0.5.1/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= +github.com/iancoleman/strcase v0.2.0/go.mod h1:iwCmte+B7n89clKwxIoIXy/HfoL7AsD47ZCWhYzw7ho= +github.com/ianlancetaylor/demangle v0.0.0-20181102032728-5e5cf60278f6/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= +github.com/jstemmer/go-junit-report v0.0.0-20190106144839-af01ea7f8024/go.mod h1:6v2b51hI/fHJwM22ozAgKL4VKDeJcHhJFhtBdhmNjmU= +github.com/jstemmer/go-junit-report v0.9.1/go.mod h1:Brl9GWCQeLvo8nXZwPNNblvFj/XSXhF0NWZEnDohbsk= +github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= +github.com/kr/fs v0.1.0/go.mod h1:FFnZGqtBN9Gxj7eW1uZ42v5BccTP0vu6NEaFoC2HwRg= +github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= +github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= +github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= +github.com/lyft/protoc-gen-star v0.6.0/go.mod h1:TGAoBVkt8w7MPG72TrKIu85MIdXwDuzJYeZuUPFPNwA= +github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= +github.com/pkg/sftp v1.10.1/go.mod h1:lYOWFsE0bwd1+KfKJaKeuokY15vzFx25BLbzYYoAxZI= +github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= +github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= +github.com/prometheus/client_model v0.2.0/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= +github.com/renuka-fernando/go-control-plane v0.0.1 h1:XURYmEmqrBkiT/JNALD3YC3blB4ubbjZyz5oOpqKLI8= +github.com/renuka-fernando/go-control-plane v0.0.1/go.mod h1:fJJn/j26vwOu972OllsvAgJJM//w9BV6Fxbg2LuVd34= +github.com/rogpeppe/fastuuid v1.2.0/go.mod h1:jVj6XXZzXRy/MSR5jhDC/2q6DgLz+nrA6LYCDYWNEvQ= +github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= +github.com/spaolacci/murmur3 v0.0.0-20180118202830-f09979ecbc72/go.mod h1:JwIasOWyU6f++ZhiEuf87xNszmSA2myDM2Kzu9HwQUA= +github.com/spf13/afero v1.3.3/go.mod h1:5KUK8ByomD5Ti5Artl0RtHeI5pTF7MIDuXL3yY520V4= +github.com/spf13/afero v1.6.0/go.mod h1:Ai8FlHk4v/PARR026UzYexafAt9roJ7LcLMAmO6Z93I= +github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= +github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4= +github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= +github.com/stretchr/testify v1.7.1 h1:5TQK59W5E3v0r2duFAb7P95B6hEeOyEnHRa8MjYSMTY= +github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= +github.com/yuin/goldmark v1.1.25/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= +github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= +github.com/yuin/goldmark v1.1.32/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= +github.com/yuin/goldmark v1.3.5/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k= +go.opencensus.io v0.21.0/go.mod h1:mSImk1erAIZhrmZN+AvHh14ztQfjbGwt4TtuofqLduU= +go.opencensus.io v0.22.0/go.mod h1:+kGneAE2xo2IficOXnaByMWTGM9T73dGwxeWcUqIpI8= +go.opencensus.io v0.22.2/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= +go.opencensus.io v0.22.3/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= +go.opencensus.io v0.22.4/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= +go.opentelemetry.io/proto/otlp v0.15.0/go.mod h1:H7XAot3MsfNsj7EXtrA2q5xSNQ10UqI405h3+duxN4U= +golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= +golang.org/x/crypto v0.0.0-20190510104115-cbcb75029529/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= +golang.org/x/crypto v0.0.0-20190605123033-f99c8df09eb5/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= +golang.org/x/crypto v0.0.0-20190820162420-60c769a6c586/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= +golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= +golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= +golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= +golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= +golang.org/x/exp v0.0.0-20190510132918-efd6b22b2522/go.mod h1:ZjyILWgesfNpC6sMxTJOJm9Kp84zZh5NQWvqDGG3Qr8= +golang.org/x/exp v0.0.0-20190829153037-c13cbed26979/go.mod h1:86+5VVa7VpoJ4kLfm080zCjGlMRFzhUhsZKEZO7MGek= +golang.org/x/exp v0.0.0-20191030013958-a1ab85dbe136/go.mod h1:JXzH8nQsPlswgeRAPE3MuO9GYsAcnJvJ4vnMwN/5qkY= +golang.org/x/exp v0.0.0-20191129062945-2f5052295587/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4= +golang.org/x/exp v0.0.0-20191227195350-da58074b4299/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4= +golang.org/x/exp v0.0.0-20200119233911-0405dc783f0a/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4= +golang.org/x/exp v0.0.0-20200207192155-f17229e696bd/go.mod h1:J/WKrq2StrnmMY6+EHIKF9dgMWnmCNThgcyBT1FY9mM= +golang.org/x/exp v0.0.0-20200224162631-6cc2880d07d6/go.mod h1:3jZMyOhIsHpP37uCMkUooju7aAi5cS1Q23tOzKc+0MU= +golang.org/x/image v0.0.0-20190227222117-0694c2d4d067/go.mod h1:kZ7UVZpmo3dzQBMxlp+ypCbDeSB+sBbTgSJuh5dn5js= +golang.org/x/image v0.0.0-20190802002840-cff245a6509b/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0= +golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= +golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU= +golang.org/x/lint v0.0.0-20190301231843-5614ed5bae6f/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= +golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= +golang.org/x/lint v0.0.0-20190409202823-959b441ac422/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= +golang.org/x/lint v0.0.0-20190909230951-414d861bb4ac/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= +golang.org/x/lint v0.0.0-20190930215403-16217165b5de/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= +golang.org/x/lint v0.0.0-20191125180803-fdd1cda4f05f/go.mod h1:5qLYkcX4OjUUV8bRuDixDT3tpyyb+LUpUlRWLxfhWrs= +golang.org/x/lint v0.0.0-20200130185559-910be7a94367/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= +golang.org/x/lint v0.0.0-20200302205851-738671d3881b/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= +golang.org/x/lint v0.0.0-20210508222113-6edffad5e616/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= +golang.org/x/mobile v0.0.0-20190312151609-d3739f865fa6/go.mod h1:z+o9i4GpDbdi3rU15maQ/Ox0txvL9dWGYEHz965HBQE= +golang.org/x/mobile v0.0.0-20190719004257-d2bd2a29d028/go.mod h1:E/iHnbuqvinMTCcRqshq8CkpyQDoeVncDDYHnLhea+o= +golang.org/x/mod v0.0.0-20190513183733-4bf6d317e70e/go.mod h1:mXi4GBBbnImb6dmsKGUJ2LatrhH/nqhxcFungHvyanc= +golang.org/x/mod v0.1.0/go.mod h1:0QHyrYULN0/3qlju5TqG8bIK38QM8yzMo5ekMj3DlcY= +golang.org/x/mod v0.1.1-0.20191105210325-c90efee705ee/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg= +golang.org/x/mod v0.1.1-0.20191107180719-034126e5016b/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg= +golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= +golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= +golang.org/x/mod v0.4.2/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= +golang.org/x/mod v0.5.0/go.mod h1:5OXOZSfqPIIbmVBIIKWRFfZjPR0E5r58TLhUjH0a2Ro= +golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20190108225652-1e06a53dbb7e/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20190213061140-3a22650c66bd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= +golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= +golang.org/x/net v0.0.0-20190501004415-9ce7a6920f09/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= +golang.org/x/net v0.0.0-20190503192946-f4e77d36d62c/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= +golang.org/x/net v0.0.0-20190603091049-60506f45cf65/go.mod h1:HSz+uSET+XFnRR8LxR5pz3Of3rY3CfYBVs4xY44aLks= +golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20190628185345-da137c7871d7/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20190724013045-ca1201d0de80/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20191209160850-c0dbc17a3553/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20200114155413-6afb5195e5aa/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20200202094626-16171245cfb2/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20200222125558-5a598a2470a0/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20200301022130-244492dfa37a/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20200324143707-d3edc9973b7e/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= +golang.org/x/net v0.0.0-20200501053045-e0ff5e5a1de5/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= +golang.org/x/net v0.0.0-20200506145744-7e3656a0809f/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= +golang.org/x/net v0.0.0-20200513185701-a91f0712d120/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= +golang.org/x/net v0.0.0-20200520182314-0ba52f642ac2/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= +golang.org/x/net v0.0.0-20200625001655-4c5254603344/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= +golang.org/x/net v0.0.0-20200707034311-ab3426394381/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= +golang.org/x/net v0.0.0-20200822124328-c89045814202/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= +golang.org/x/net v0.0.0-20210405180319-a5a99cb37ef4/go.mod h1:p54w0d4576C0XHj96bSt6lcn1PtDYWL6XObtHCRCNQM= +golang.org/x/net v0.0.0-20210813160813-60bc85c4be6d h1:LO7XpTYMwTqxjLcGWPijK3vRXg1aWdlNOVOHRq45d7c= +golang.org/x/net v0.0.0-20210813160813-60bc85c4be6d/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= +golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= +golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= +golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= +golang.org/x/oauth2 v0.0.0-20191202225959-858c2ad4c8b6/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= +golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= +golang.org/x/oauth2 v0.0.0-20211104180415-d3ed0bb246c8/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= +golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20190227155943-e225da77a7e6/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20200317015054-43a5402ce75a/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20200625203802-6e8e738ad208/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20190312061237-fead79001313/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190502145724-3ef323f4f1fd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190507160741-ecd444e8653b/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190606165138-5da285871e9c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190624142023-c5567b49c5d0/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190726091711-fc99dfbffb4e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20191001151750-bb3f8db39f24/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20191204072324-ce4227a45e2e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20191228213918-04cbcbbfeed8/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200113162924-86b910548bc1/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200122134326-e047566fdf82/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200202164722-d101bd2416d5/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200212091648-12a6c2dcc1e4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200223170610-d5e6a3e2c0ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200302150141-5c8b2ff67527/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200323222414-85ca7c5b95cd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200331124033-c3d80250170d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200501052902-10377860bb8e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200511232937-7e40ca221e25/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200515095857-1151b9dac4a9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200523222454-059865788121/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200803210538-64077c9b5642/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210330210617-4fbd30eecc44/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210510120138-977fb7262007/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20210816183151-1e6c022a8912 h1:uCLL3g5wH2xjxVREVuAbP9JM5PPKjRbXKRa6IBjkzmU= +golang.org/x/sys v0.0.0-20210816183151-1e6c022a8912/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= +golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= +golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= +golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= +golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= +golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= +golang.org/x/text v0.3.5/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= +golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= +golang.org/x/text v0.3.7 h1:olpwvP2KacW1ZWvsR7uQhoyTYvKAupfQrRGBFM352Gk= +golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= +golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= +golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= +golang.org/x/time v0.0.0-20191024005414-555d28b269f0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= +golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= +golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= +golang.org/x/tools v0.0.0-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3HoIrodX9oNMXvdceNzlUR8zjMvY= +golang.org/x/tools v0.0.0-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= +golang.org/x/tools v0.0.0-20190312151545-0bb0c0a6e846/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= +golang.org/x/tools v0.0.0-20190312170243-e65039ee4138/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= +golang.org/x/tools v0.0.0-20190425150028-36563e24a262/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= +golang.org/x/tools v0.0.0-20190506145303-2d16b83fe98c/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= +golang.org/x/tools v0.0.0-20190524140312-2c0ae7006135/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= +golang.org/x/tools v0.0.0-20190606124116-d0a3d012864b/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= +golang.org/x/tools v0.0.0-20190621195816-6e04913cbbac/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= +golang.org/x/tools v0.0.0-20190628153133-6cdbf07be9d0/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= +golang.org/x/tools v0.0.0-20190816200558-6889da9d5479/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20190911174233-4f2ddba30aff/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20191012152004-8de300cfc20a/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20191113191852-77e3bb0ad9e7/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20191115202509-3a792d9c32b2/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20191125144606-a911d9008d1f/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20191130070609-6e064ea0cf2d/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20191216173652-a0e659d51361/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20191227053925-7b8e75db28f4/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20200117161641-43d50277825c/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20200122220014-bf1340f18c4a/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20200130002326-2f3ba24bd6e7/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20200204074204-1cc6d1ef6c74/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20200207183749-b753a1ba74fa/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20200212150539-ea181f53ac56/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20200224181240-023911ca70b2/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20200227222343-706bc42d1f0d/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20200304193943-95d2e580d8eb/go.mod h1:o4KQGtdN14AW+yjsvvwRTJJuXz8XRtIHtEnmAXLyFUw= +golang.org/x/tools v0.0.0-20200312045724-11d5b4c81c7d/go.mod h1:o4KQGtdN14AW+yjsvvwRTJJuXz8XRtIHtEnmAXLyFUw= +golang.org/x/tools v0.0.0-20200331025713-a30bf2db82d4/go.mod h1:Sl4aGygMT6LrqrWclx+PTx3U+LnKx/seiNR+3G19Ar8= +golang.org/x/tools v0.0.0-20200501065659-ab2804fb9c9d/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= +golang.org/x/tools v0.0.0-20200512131952-2bc93b1c0c88/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= +golang.org/x/tools v0.0.0-20200515010526-7d3b6ebf133d/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= +golang.org/x/tools v0.0.0-20200618134242-20370b0cb4b2/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= +golang.org/x/tools v0.0.0-20200729194436-6467de6f59a7/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= +golang.org/x/tools v0.0.0-20200804011535-6c149bb5ef0d/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= +golang.org/x/tools v0.0.0-20200825202427-b303f430e36d/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= +golang.org/x/tools v0.1.5/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= +golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1 h1:go1bK/D/BFZV2I8cIQd1NKEZ+0owSTG1fDTci4IqFcE= +golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +google.golang.org/api v0.4.0/go.mod h1:8k5glujaEP+g9n7WNsDg8QP6cUVNI86fCNMcbazEtwE= +google.golang.org/api v0.7.0/go.mod h1:WtwebWUNSVBH/HAw79HIFXZNqEvBhG+Ra+ax0hx3E3M= +google.golang.org/api v0.8.0/go.mod h1:o4eAsZoiT+ibD93RtjEohWalFOjRDx6CVaqeizhEnKg= +google.golang.org/api v0.9.0/go.mod h1:o4eAsZoiT+ibD93RtjEohWalFOjRDx6CVaqeizhEnKg= +google.golang.org/api v0.13.0/go.mod h1:iLdEw5Ide6rF15KTC1Kkl0iskquN2gFfn9o9XIsbkAI= +google.golang.org/api v0.14.0/go.mod h1:iLdEw5Ide6rF15KTC1Kkl0iskquN2gFfn9o9XIsbkAI= +google.golang.org/api v0.15.0/go.mod h1:iLdEw5Ide6rF15KTC1Kkl0iskquN2gFfn9o9XIsbkAI= +google.golang.org/api v0.17.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= +google.golang.org/api v0.18.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= +google.golang.org/api v0.19.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= +google.golang.org/api v0.20.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= +google.golang.org/api v0.22.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= +google.golang.org/api v0.24.0/go.mod h1:lIXQywCXRcnZPGlsd8NbLnOjtAoL6em04bJ9+z0MncE= +google.golang.org/api v0.28.0/go.mod h1:lIXQywCXRcnZPGlsd8NbLnOjtAoL6em04bJ9+z0MncE= +google.golang.org/api v0.29.0/go.mod h1:Lcubydp8VUV7KeIHD9z2Bys/sm/vGKnG1UHuDBSrHWM= +google.golang.org/api v0.30.0/go.mod h1:QGmEvQ87FHZNiUVJkT14jQNYJ4ZJjdRF23ZXz5138Fc= +google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= +google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= +google.golang.org/appengine v1.5.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= +google.golang.org/appengine v1.6.1/go.mod h1:i06prIuMbXzDqacNJfV5OdTW448YApPu5ww/cMBSeb0= +google.golang.org/appengine v1.6.5/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= +google.golang.org/appengine v1.6.6/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= +google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= +google.golang.org/genproto v0.0.0-20190307195333-5fe7a883aa19/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= +google.golang.org/genproto v0.0.0-20190418145605-e7d98fc518a7/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= +google.golang.org/genproto v0.0.0-20190425155659-357c62f0e4bb/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= +google.golang.org/genproto v0.0.0-20190502173448-54afdca5d873/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= +google.golang.org/genproto v0.0.0-20190801165951-fa694d86fc64/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= +google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= +google.golang.org/genproto v0.0.0-20190911173649-1774047e7e51/go.mod h1:IbNlFCBrqXvoKpeg0TB2l7cyZUmoaFKYIwrEpbDKLA8= +google.golang.org/genproto v0.0.0-20191108220845-16a3f7862a1a/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= +google.golang.org/genproto v0.0.0-20191115194625-c23dd37a84c9/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= +google.golang.org/genproto v0.0.0-20191216164720-4f79533eabd1/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= +google.golang.org/genproto v0.0.0-20191230161307-f3c370f40bfb/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= +google.golang.org/genproto v0.0.0-20200115191322-ca5a22157cba/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= +google.golang.org/genproto v0.0.0-20200122232147-0452cf42e150/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= +google.golang.org/genproto v0.0.0-20200204135345-fa8e72b47b90/go.mod h1:GmwEX6Z4W5gMy59cAlVYjN9JhxgbQH6Gn+gFDQe2lzA= +google.golang.org/genproto v0.0.0-20200212174721-66ed5ce911ce/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= +google.golang.org/genproto v0.0.0-20200224152610-e50cd9704f63/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= +google.golang.org/genproto v0.0.0-20200228133532-8c2c7df3a383/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= +google.golang.org/genproto v0.0.0-20200305110556-506484158171/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= +google.golang.org/genproto v0.0.0-20200312145019-da6875a35672/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= +google.golang.org/genproto v0.0.0-20200331122359-1ee6d9798940/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= +google.golang.org/genproto v0.0.0-20200430143042-b979b6f78d84/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= +google.golang.org/genproto v0.0.0-20200511104702-f5ebc3bea380/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= +google.golang.org/genproto v0.0.0-20200515170657-fc4c6c6a6587/go.mod h1:YsZOwe1myG/8QRHRsmBRE1LrgQY60beZKjly0O1fX9U= +google.golang.org/genproto v0.0.0-20200526211855-cb27e3aa2013/go.mod h1:NbSheEEYHJ7i3ixzK3sjbqSGDJWnxyFXZblF3eUsNvo= +google.golang.org/genproto v0.0.0-20200618031413-b414f8b61790/go.mod h1:jDfRM7FcilCzHH/e9qn6dsT145K34l5v+OpcnNgKAAA= +google.golang.org/genproto v0.0.0-20200729003335-053ba62fc06f/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/genproto v0.0.0-20200804131852-c06518451d9c/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/genproto v0.0.0-20200825200019-8632dd797987/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/genproto v0.0.0-20211118181313-81c1377c94b1/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc= +google.golang.org/genproto v0.0.0-20220329172620-7be39ac1afc7 h1:HOL66YCI20JvN2hVk6o2YIp9i/3RvzVUz82PqNr7fXw= +google.golang.org/genproto v0.0.0-20220329172620-7be39ac1afc7/go.mod h1:8w6bsBMX6yCPbAVTeqQHvzxW0EIFigd5lZyahWgyfDo= +google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= +google.golang.org/grpc v1.20.1/go.mod h1:10oTOabMzJvdu6/UiuZezV6QK5dSlG84ov/aaiqXj38= +google.golang.org/grpc v1.21.1/go.mod h1:oYelfM1adQP15Ek0mdvEgi9Df8B9CZIaU1084ijfRaM= +google.golang.org/grpc v1.25.1/go.mod h1:c3i+UQWmh7LiEpx4sFZnkU36qjEYZ0imhYfXVyQciAY= +google.golang.org/grpc v1.26.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= +google.golang.org/grpc v1.27.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= +google.golang.org/grpc v1.27.1/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= +google.golang.org/grpc v1.28.0/go.mod h1:rpkK4SK4GF4Ach/+MFLZUBavHOvF2JJB5uozKKal+60= +google.golang.org/grpc v1.29.1/go.mod h1:itym6AZVZYACWQqET3MqgPpjcuV5QH3BxFS3IjizoKk= +google.golang.org/grpc v1.30.0/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak= +google.golang.org/grpc v1.31.0/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak= +google.golang.org/grpc v1.40.0/go.mod h1:ogyxbiOoUXAkP+4+xa6PZSE9DZgIHtSpzjDTB9KAK34= +google.golang.org/grpc v1.42.0/go.mod h1:k+4IHHFw41K8+bbowsex27ge2rCb65oeWqe4jJ590SU= +google.golang.org/grpc v1.45.0 h1:NEpgUqV3Z+ZjkqMsxMg11IaDrXY4RY6CQukSGK0uI1M= +google.golang.org/grpc v1.45.0/go.mod h1:lN7owxKUQEqMfSyQikvvk5tf/6zMPsrK+ONuO11+0rQ= +google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8= +google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0= +google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQJ+fmap5saPgwCLgHXTUD7jkjRqWcaiX5VyM= +google.golang.org/protobuf v1.20.1-0.20200309200217-e05f789c0967/go.mod h1:A+miEFZTKqfCUM6K7xSMQL9OKL/b6hQv+e19PK+JZNE= +google.golang.org/protobuf v1.21.0/go.mod h1:47Nbq4nVaFHyn7ilMalzfO3qCViNmqZ2kzikPIcrTAo= +google.golang.org/protobuf v1.22.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= +google.golang.org/protobuf v1.23.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= +google.golang.org/protobuf v1.23.1-0.20200526195155-81db48ad09cc/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= +google.golang.org/protobuf v1.24.0/go.mod h1:r/3tXBNzIEhYS9I1OUVjXDlt8tc493IdKGjtUeSXeh4= +google.golang.org/protobuf v1.25.0/go.mod h1:9JNX74DMeImyA3h4bdi1ymwjUzf21/xIlbajtzgsN7c= +google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw= +google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= +google.golang.org/protobuf v1.27.1/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= +google.golang.org/protobuf v1.28.0 h1:w43yiav+6bVFTBQFZX0r7ipe9JQ1QsbMgHwbBziscLw= +google.golang.org/protobuf v1.28.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= +gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI= +gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c h1:dUUwHk2QECo/6vqA44rthZ8ie2QXMNeKRTHCNY2nXvo= +gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= +honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= +honnef.co/go/tools v0.0.0-20190106161140-3f1c8253044a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= +honnef.co/go/tools v0.0.0-20190418001031-e561f6794a2a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= +honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= +honnef.co/go/tools v0.0.1-2019.2.3/go.mod h1:a3bituU0lyd329TUQxRnasdCoJDkEUEAqEt0JzvZhAg= +honnef.co/go/tools v0.0.1-2020.1.3/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k= +honnef.co/go/tools v0.0.1-2020.1.4/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k= +rsc.io/binaryregexp v0.2.0/go.mod h1:qTv7/COck+e2FymRvadv62gMdZztPaShugOCi3I+8D8= +rsc.io/quote/v3 v3.1.0/go.mod h1:yEA65RcK8LyAZtP9Kv3t0HmxON59tX3rD+tICJqUlj0= +rsc.io/sampler v1.3.0/go.mod h1:T1hPZKmBbMNahiBKFy5HrXp6adAjACjK9JXDnKaTXpA= diff --git a/examples/xds-sotw-config-server/logger.go b/examples/xds-sotw-config-server/logger.go new file mode 100644 index 000000000..65315a776 --- /dev/null +++ b/examples/xds-sotw-config-server/logger.go @@ -0,0 +1,40 @@ +// Copyright 2020 Envoyproxy Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +package example + +import ( + "log" +) + +type Logger struct { + Debug bool +} + +func (logger Logger) Debugf(format string, args ...interface{}) { + if logger.Debug { + log.Printf("[DEBUG] "+format+"\n", args...) + } +} + +func (logger Logger) Infof(format string, args ...interface{}) { + log.Printf("[INFO]"+format+"\n", args...) +} + +func (logger Logger) Warnf(format string, args ...interface{}) { + log.Printf("[WARN] "+format+"\n", args...) +} + +func (logger Logger) Errorf(format string, args ...interface{}) { + log.Printf("[ERROR]"+format+"\n", args...) +} diff --git a/examples/xds-sotw-config-server/main/main.go b/examples/xds-sotw-config-server/main/main.go new file mode 100644 index 000000000..5fe9453bf --- /dev/null +++ b/examples/xds-sotw-config-server/main/main.go @@ -0,0 +1,67 @@ +// Copyright 2020 Envoyproxy Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +package main + +import ( + "context" + "flag" + "os" + + "github.com/envoyproxy/go-control-plane/pkg/cache/v3" + "github.com/envoyproxy/go-control-plane/pkg/server/v3" + "github.com/envoyproxy/go-control-plane/pkg/test/v3" + + example "github.com/envoyproxy/ratelimit/examples/xds-sotw-config-server" +) + +var ( + logger example.Logger + port uint + nodeID string +) + +func init() { + logger = example.Logger{} + + flag.BoolVar(&logger.Debug, "debug", false, "Enable xDS server debug logging") + flag.UintVar(&port, "port", 18000, "xDS management server port") + flag.StringVar(&nodeID, "nodeID", "test-node-id", "Node ID") +} + +func main() { + flag.Parse() + + // Create a cache + cache := cache.NewSnapshotCache(false, cache.IDHash{}, logger) + + // Create the snapshot that we'll serve to Envoy + snapshot := example.GenerateSnapshot() + if err := snapshot.Consistent(); err != nil { + logger.Errorf("Snapshot is inconsistent: %+v\n%+v", snapshot, err) + os.Exit(1) + } + logger.Debugf("Will serve snapshot %+v", snapshot) + + // Add the snapshot to the cache + if err := cache.SetSnapshot(context.Background(), nodeID, snapshot); err != nil { + logger.Errorf("Snapshot error %q for %+v", err, snapshot) + os.Exit(1) + } + + // Run the xDS server + ctx := context.Background() + cb := &test.Callbacks{Debug: logger.Debug} + srv := server.NewServer(ctx, cache, cb) + example.RunServer(ctx, srv, port) +} diff --git a/examples/xds-sotw-config-server/resource.go b/examples/xds-sotw-config-server/resource.go new file mode 100644 index 000000000..726ac97b9 --- /dev/null +++ b/examples/xds-sotw-config-server/resource.go @@ -0,0 +1,181 @@ +// Copyright 2020 Envoyproxy Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +package example + +import ( + "github.com/envoyproxy/go-control-plane/pkg/cache/types" + "github.com/envoyproxy/go-control-plane/pkg/cache/v3" + "github.com/envoyproxy/go-control-plane/pkg/resource/v3" + rls_config "github.com/envoyproxy/go-control-plane/ratelimit/config/ratelimit/v3" +) + +func makeRlsConfig() []types.Resource { + return []types.Resource{ + &rls_config.RateLimitConfig{ + Domain: "mongo_cps", + Descriptors: []*rls_config.RateLimitDescriptor{ + { + Key: "database", + Value: "users", + RateLimit: &rls_config.RateLimitPolicy{ + Unit: "second", + RequestsPerUnit: 500, + }, + }, + { + Key: "database", + Value: "default", + RateLimit: &rls_config.RateLimitPolicy{ + Unit: "second", + RequestsPerUnit: 500, + }, + }, + }, + }, + &rls_config.RateLimitConfig{ + Domain: "rl", + Descriptors: []*rls_config.RateLimitDescriptor{ + { + Key: "category", + Value: "account", + RateLimit: &rls_config.RateLimitPolicy{ + Replaces: []*rls_config.RateLimitReplace{{Name: "bkthomps"}, {Name: "fake_name"}}, + Unit: "minute", + RequestsPerUnit: 4, + }, + }, + { + Key: "source_cluster", + Value: "proxy", + Descriptors: []*rls_config.RateLimitDescriptor{ + { + Key: "destination_cluster", + Value: "bkthomps", + RateLimit: &rls_config.RateLimitPolicy{ + Replaces: []*rls_config.RateLimitReplace{{Name: "bkthomps"}}, + Unit: "minute", + RequestsPerUnit: 2, + }, + }, + { + Key: "destination_cluster", + Value: "mock", + RateLimit: &rls_config.RateLimitPolicy{ + Unit: "minute", + RequestsPerUnit: 1, + }, + }, + { + Key: "destination_cluster", + Value: "override", + RateLimit: &rls_config.RateLimitPolicy{ + Replaces: []*rls_config.RateLimitReplace{{Name: "banned_limit"}}, + Unit: "minute", + RequestsPerUnit: 2, + }, + }, + { + Key: "destination_cluster", + Value: "fake", + RateLimit: &rls_config.RateLimitPolicy{ + Name: "fake_name", + Unit: "minute", + RequestsPerUnit: 2, + }, + }, + }, + }, + { + Key: "foo", + RateLimit: &rls_config.RateLimitPolicy{ + Unit: "minute", + RequestsPerUnit: 2, + }, + Descriptors: []*rls_config.RateLimitDescriptor{ + { + Key: "bar", + RateLimit: &rls_config.RateLimitPolicy{ + Unit: "minute", + RequestsPerUnit: 3, + }, + }, + { + Key: "bar", + Value: "bkthomps", + RateLimit: &rls_config.RateLimitPolicy{ + Name: "bkthomps", + Unit: "minute", + RequestsPerUnit: 1, + }, + }, + { + Key: "bar", + Value: "banned", + RateLimit: &rls_config.RateLimitPolicy{ + Name: "banned_limit", + Unit: "minute", + RequestsPerUnit: 0, + }, + }, + { + Key: "baz", + RateLimit: &rls_config.RateLimitPolicy{ + Unit: "second", + RequestsPerUnit: 1, + }, + }, + { + Key: "baz", + Value: "not-so-shady", + RateLimit: &rls_config.RateLimitPolicy{ + Unit: "minute", + RequestsPerUnit: 3, + }, + }, + { + Key: "baz", + Value: "shady", + RateLimit: &rls_config.RateLimitPolicy{ + Unit: "minute", + RequestsPerUnit: 3, + }, + ShadowMode: true, + }, + { + Key: "bay", + RateLimit: &rls_config.RateLimitPolicy{ + Unlimited: true, + }, + }, + }, + }, + { + Key: "qux", + RateLimit: &rls_config.RateLimitPolicy{ + Unlimited: true, + }, + }, + }, + }, + } +} + +func GenerateSnapshot() *cache.Snapshot { + snap, _ := cache.NewSnapshot("1", + map[resource.Type][]types.Resource{ + resource.RateLimitConfigType: makeRlsConfig(), + }, + ) + return snap +} diff --git a/examples/xds-sotw-config-server/server.go b/examples/xds-sotw-config-server/server.go new file mode 100644 index 000000000..f727bf37b --- /dev/null +++ b/examples/xds-sotw-config-server/server.go @@ -0,0 +1,62 @@ +// Copyright 2020 Envoyproxy Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +package example + +import ( + "context" + "fmt" + "log" + "net" + "time" + + "google.golang.org/grpc" + "google.golang.org/grpc/keepalive" + + discovery "github.com/envoyproxy/go-control-plane/envoy/service/discovery/v3" + "github.com/envoyproxy/go-control-plane/pkg/server/v3" +) + +const ( + grpcKeepaliveTime = 30 * time.Second + grpcKeepaliveTimeout = 5 * time.Second + grpcKeepaliveMinTime = 30 * time.Second + grpcMaxConcurrentStreams = 1000000 +) + +// RunServer starts an xDS server at the given port. +func RunServer(ctx context.Context, srv server.Server, port uint) { + grpcServer := grpc.NewServer( + grpc.MaxConcurrentStreams(grpcMaxConcurrentStreams), + grpc.KeepaliveParams(keepalive.ServerParameters{ + Time: grpcKeepaliveTime, + Timeout: grpcKeepaliveTimeout, + }), + grpc.KeepaliveEnforcementPolicy(keepalive.EnforcementPolicy{ + MinTime: grpcKeepaliveMinTime, + PermitWithoutStream: true, + }), + ) + + lis, err := net.Listen("tcp", fmt.Sprintf(":%d", port)) + if err != nil { + log.Fatal(err) + } + + discovery.RegisterAggregatedDiscoveryServiceServer(grpcServer, srv) + + log.Printf("Management server listening on %d\n", port) + if err = grpcServer.Serve(lis); err != nil { + log.Println(err) + } +} From e9e2a9e96390b49248d2c0a58447d9519cf8b3f5 Mon Sep 17 00:00:00 2001 From: Renuka Fernando Date: Fri, 21 Oct 2022 10:28:23 +0530 Subject: [PATCH 12/22] Separate the logic that converts string format of config file to yaml Signed-off-by: Renuka Fernando Signed-off-by: Renuka Fernando --- src/config/config_impl.go | 74 +++++++++++++++++++++------------------ 1 file changed, 40 insertions(+), 34 deletions(-) diff --git a/src/config/config_impl.go b/src/config/config_impl.go index aa4404001..38dc85d10 100644 --- a/src/config/config_impl.go +++ b/src/config/config_impl.go @@ -107,8 +107,8 @@ func (this *rateLimitDescriptor) dump() string { // Create a new config error which includes the owning file. // @param config supplies the config file that generated the error. // @param err supplies the error string. -func newRateLimitConfigError(config RateLimitConfigToLoad, err string) RateLimitConfigError { - return RateLimitConfigError(fmt.Sprintf("%s: %s", config.Name, err)) +func newRateLimitConfigError(name string, err string) RateLimitConfigError { + return RateLimitConfigError(fmt.Sprintf("%s: %s", name, err)) } // Load a set of config descriptors from the YAML file and check the input. @@ -119,7 +119,7 @@ func newRateLimitConfigError(config RateLimitConfigToLoad, err string) RateLimit func (this *rateLimitDescriptor) loadDescriptors(config RateLimitConfigToLoad, parentKey string, descriptors []yamlDescriptor, statsManager stats.Manager) { for _, descriptorConfig := range descriptors { if descriptorConfig.Key == "" { - panic(newRateLimitConfigError(config, "descriptor has empty key")) + panic(newRateLimitConfigError(config.Name, "descriptor has empty key")) } // Value is optional, so the final key for the map is either the key only or key_value. @@ -131,7 +131,7 @@ func (this *rateLimitDescriptor) loadDescriptors(config RateLimitConfigToLoad, p newParentKey := parentKey + finalKey if _, present := this.descriptors[finalKey]; present { panic(newRateLimitConfigError( - config, fmt.Sprintf("duplicate descriptor composite key '%s'", newParentKey))) + config.Name, fmt.Sprintf("duplicate descriptor composite key '%s'", newParentKey))) } var rateLimit *RateLimit = nil @@ -146,12 +146,12 @@ func (this *rateLimitDescriptor) loadDescriptors(config RateLimitConfigToLoad, p if unlimited { if validUnit { panic(newRateLimitConfigError( - config, + config.Name, fmt.Sprintf("should not specify rate limit unit when unlimited"))) } } else if !validUnit { panic(newRateLimitConfigError( - config, + config.Name, fmt.Sprintf("invalid rate limit unit '%s'", descriptorConfig.RateLimit.Unit))) } @@ -171,10 +171,10 @@ func (this *rateLimitDescriptor) loadDescriptors(config RateLimitConfigToLoad, p for _, replaces := range descriptorConfig.RateLimit.Replaces { if replaces.Name == "" { - panic(newRateLimitConfigError(config, "should not have an empty replaces entry")) + panic(newRateLimitConfigError(config.Name, "should not have an empty replaces entry")) } if replaces.Name == descriptorConfig.RateLimit.Name { - panic(newRateLimitConfigError(config, "replaces should not contain name of same descriptor")) + panic(newRateLimitConfigError(config.Name, "replaces should not contain name of same descriptor")) } } } @@ -190,17 +190,17 @@ func (this *rateLimitDescriptor) loadDescriptors(config RateLimitConfigToLoad, p // Validate a YAML config file's keys. // @param config specifies the file contents to load. // @param any specifies the yaml file and a map. -func validateYamlKeys(config RateLimitConfigToLoad, config_map map[interface{}]interface{}) { +func validateYamlKeys(fileName string, config_map map[interface{}]interface{}) { for k, v := range config_map { if _, ok := k.(string); !ok { errorText := fmt.Sprintf("config error, key is not of type string: %v", k) logger.Debugf(errorText) - panic(newRateLimitConfigError(config, errorText)) + panic(newRateLimitConfigError(fileName, errorText)) } if _, ok := validKeys[k.(string)]; !ok { errorText := fmt.Sprintf("config error, unknown key '%s'", k) logger.Debugf(errorText) - panic(newRateLimitConfigError(config, errorText)) + panic(newRateLimitConfigError(fileName, errorText)) } switch v := v.(type) { case []interface{}: @@ -208,13 +208,13 @@ func validateYamlKeys(config RateLimitConfigToLoad, config_map map[interface{}]i if _, ok := e.(map[interface{}]interface{}); !ok { errorText := fmt.Sprintf("config error, yaml file contains list of type other than map: %v", e) logger.Debugf(errorText) - panic(newRateLimitConfigError(config, errorText)) + panic(newRateLimitConfigError(fileName, errorText)) } element := e.(map[interface{}]interface{}) - validateYamlKeys(config, element) + validateYamlKeys(fileName, element) } case map[interface{}]interface{}: - validateYamlKeys(config, v) + validateYamlKeys(fileName, v) // string is a leaf type in ratelimit config. No need to keep validating. case string: // int is a leaf type in ratelimit config. No need to keep validating. @@ -227,7 +227,7 @@ func validateYamlKeys(config RateLimitConfigToLoad, config_map map[interface{}]i default: errorText := fmt.Sprintf("error checking config") logger.Debugf(errorText) - panic(newRateLimitConfigError(config, errorText)) + panic(newRateLimitConfigError(fileName, errorText)) } } } @@ -235,32 +235,16 @@ func validateYamlKeys(config RateLimitConfigToLoad, config_map map[interface{}]i // Load a single YAML config file into the global config. // @param config specifies the file contents to load. func (this *rateLimitConfigImpl) loadConfig(config RateLimitConfigToLoad) { - // validate keys in config with generic map - any := map[interface{}]interface{}{} - err := yaml.Unmarshal([]byte(config.FileBytes), &any) - if err != nil { - errorText := fmt.Sprintf("error loading config file: %s", err.Error()) - logger.Debugf(errorText) - panic(newRateLimitConfigError(config, errorText)) - } - validateYamlKeys(config, any) - - var root yamlRoot - err = yaml.Unmarshal([]byte(config.FileBytes), &root) - if err != nil { - errorText := fmt.Sprintf("error loading config file: %s", err.Error()) - logger.Debugf(errorText) - panic(newRateLimitConfigError(config, errorText)) - } + root := ConfigFileContentToYaml(config.Name, config.FileBytes) if root.Domain == "" { - panic(newRateLimitConfigError(config, "config file cannot have empty domain")) + panic(newRateLimitConfigError(config.Name, "config file cannot have empty domain")) } if _, present := this.domains[root.Domain]; present { if !this.mergeDomainConfigs { panic(newRateLimitConfigError( - config, fmt.Sprintf("duplicate domain '%s' in config file", root.Domain))) + config.Name, fmt.Sprintf("duplicate domain '%s' in config file", root.Domain))) } logger.Debugf("patching domain: %s", root.Domain) @@ -357,6 +341,28 @@ func descriptorKey(domain string, descriptor *pb_struct.RateLimitDescriptor) str return domain + "." + rateLimitKey } +func ConfigFileContentToYaml(fileName, content string) *yamlRoot { + // validate keys in config with generic map + any := map[interface{}]interface{}{} + err := yaml.Unmarshal([]byte(content), &any) + if err != nil { + errorText := fmt.Sprintf("error loading config file: %s", err.Error()) + logger.Debugf(errorText) + panic(newRateLimitConfigError(fileName, errorText)) + } + validateYamlKeys(fileName, any) + + var root yamlRoot + err = yaml.Unmarshal([]byte(content), &root) + if err != nil { + errorText := fmt.Sprintf("error loading config file: %s", err.Error()) + logger.Debugf(errorText) + panic(newRateLimitConfigError(fileName, errorText)) + } + + return &root +} + // Create rate limit config from a list of input YAML files. // @param configs specifies a list of YAML files to load. // @param stats supplies the stats scope to use for limit stats during runtime. From 2ba99f963a2f0963e753e2333875c9a187546541 Mon Sep 17 00:00:00 2001 From: Renuka Fernando Date: Fri, 21 Oct 2022 11:36:14 +0530 Subject: [PATCH 13/22] Convert xDS proto to yaml and use yaml as the config instead of file content string Signed-off-by: Renuka Fernando --- src/config/config.go | 4 +-- src/config/config_impl.go | 2 +- src/config/config_xds.go | 49 ++++++++++++++++++++++++++ src/config_check_cmd/main.go | 3 +- src/provider/file_provider.go | 3 +- src/provider/xds_grpc_sotw_provider.go | 12 ++----- test/config/config_test.go | 3 +- 7 files changed, 61 insertions(+), 15 deletions(-) create mode 100644 src/config/config_xds.go diff --git a/src/config/config.go b/src/config/config.go index 7a22734d4..7c23087ec 100644 --- a/src/config/config.go +++ b/src/config/config.go @@ -41,8 +41,8 @@ type RateLimitConfig interface { // Information for a config file to load into the aggregate config. type RateLimitConfigToLoad struct { - Name string - FileBytes string + Name string + ConfigYaml *yamlRoot } // Interface for loading a configuration from a list of YAML files. diff --git a/src/config/config_impl.go b/src/config/config_impl.go index 38dc85d10..aea2c7a69 100644 --- a/src/config/config_impl.go +++ b/src/config/config_impl.go @@ -235,7 +235,7 @@ func validateYamlKeys(fileName string, config_map map[interface{}]interface{}) { // Load a single YAML config file into the global config. // @param config specifies the file contents to load. func (this *rateLimitConfigImpl) loadConfig(config RateLimitConfigToLoad) { - root := ConfigFileContentToYaml(config.Name, config.FileBytes) + root := config.ConfigYaml if root.Domain == "" { panic(newRateLimitConfigError(config.Name, "config file cannot have empty domain")) diff --git a/src/config/config_xds.go b/src/config/config_xds.go new file mode 100644 index 000000000..b83a1a9f6 --- /dev/null +++ b/src/config/config_xds.go @@ -0,0 +1,49 @@ +package config + +import ( + rls_conf_v3 "github.com/envoyproxy/go-control-plane/ratelimit/config/ratelimit/v3" +) + +// ConfigXdsProtoToYaml converts Xds Proto format to yamlRoot +func ConfigXdsProtoToYaml(xdsProto *rls_conf_v3.RateLimitConfig) *yamlRoot { + return &yamlRoot{ + Domain: xdsProto.Domain, + Descriptors: rateLimitDescriptorsPbToYaml(xdsProto.Descriptors), + } +} + +func rateLimitDescriptorsPbToYaml(pb []*rls_conf_v3.RateLimitDescriptor) []yamlDescriptor { + descriptors := make([]yamlDescriptor, len(pb)) + for i, d := range pb { + descriptors[i] = yamlDescriptor{ + Key: d.Key, + Value: d.Value, + RateLimit: rateLimitPolicyPbToYaml(d.RateLimit), + Descriptors: rateLimitDescriptorsPbToYaml(d.Descriptors), + ShadowMode: d.ShadowMode, + } + } + + return descriptors +} + +func rateLimitPolicyPbToYaml(pb *rls_conf_v3.RateLimitPolicy) *yamlRateLimit { + if pb == nil { + return nil + } + return &yamlRateLimit{ + RequestsPerUnit: pb.RequestsPerUnit, + Unit: pb.Unit, + Unlimited: pb.Unlimited, + Name: pb.Name, + Replaces: rateLimitReplacesPbToYaml(pb.Replaces), + } +} + +func rateLimitReplacesPbToYaml(pb []*rls_conf_v3.RateLimitReplace) []yamlReplaces { + replaces := make([]yamlReplaces, len(pb)) + for i, r := range pb { + replaces[i] = yamlReplaces{Name: r.Name} + } + return replaces +} diff --git a/src/config_check_cmd/main.go b/src/config_check_cmd/main.go index 750af7915..dc313c31f 100644 --- a/src/config_check_cmd/main.go +++ b/src/config_check_cmd/main.go @@ -51,7 +51,8 @@ func main() { fmt.Printf("error reading file %s: %s\n", finalPath, err.Error()) os.Exit(1) } - allConfigs = append(allConfigs, config.RateLimitConfigToLoad{finalPath, string(bytes)}) + configYaml := config.ConfigFileContentToYaml(finalPath, string(bytes)) + allConfigs = append(allConfigs, config.RateLimitConfigToLoad{Name: finalPath, ConfigYaml: configYaml}) } loadConfigs(allConfigs, *mergeDomainConfigs) diff --git a/src/provider/file_provider.go b/src/provider/file_provider.go index 2d218edd1..07bfa11aa 100644 --- a/src/provider/file_provider.go +++ b/src/provider/file_provider.go @@ -59,7 +59,8 @@ func (p *FileProvider) sendEvent() { continue } - files = append(files, config.RateLimitConfigToLoad{Name: key, FileBytes: snapshot.Get(key)}) + configYaml := config.ConfigFileContentToYaml(key, snapshot.Get(key)) + files = append(files, config.RateLimitConfigToLoad{Name: key, ConfigYaml: configYaml}) } rlSettings := settings.NewSettings() diff --git a/src/provider/xds_grpc_sotw_provider.go b/src/provider/xds_grpc_sotw_provider.go index df33cbcf8..c7bb3e115 100644 --- a/src/provider/xds_grpc_sotw_provider.go +++ b/src/provider/xds_grpc_sotw_provider.go @@ -3,11 +3,9 @@ package provider import ( "context" "io" - "strconv" core "github.com/envoyproxy/go-control-plane/envoy/config/core/v3" discovery "github.com/envoyproxy/go-control-plane/envoy/service/discovery/v3" - "github.com/ghodss/yaml" "github.com/golang/protobuf/ptypes/any" grpc_retry "github.com/grpc-ecosystem/go-grpc-middleware/retry" logger "github.com/sirupsen/logrus" @@ -178,7 +176,7 @@ func (p *XdsGrpcSotwProvider) getGrpcTransportCredentials() grpc.DialOption { func (p *XdsGrpcSotwProvider) sendConfigs(resources []*any.Any) { conf := make([]config.RateLimitConfigToLoad, 0, len(resources)) - for i, res := range resources { + for _, res := range resources { confPb := &rls_conf_v3.RateLimitConfig{} err := anypb.UnmarshalTo(res, confPb, proto.UnmarshalOptions{}) // err := ptypes.UnmarshalAny(res, config) if err != nil { @@ -189,12 +187,8 @@ func (p *XdsGrpcSotwProvider) sendConfigs(resources []*any.Any) { logger.Infof("RENUKA TEST: %v", confPb) - byteConf, err := yaml.Marshal(confPb) - if err != nil { - logger.Errorf("Error config: %s", err.Error()) - } - // TODO: (renuka) This is temp, have to pass the Yaml instead of string - conf = append(conf, config.RateLimitConfigToLoad{Name: confPb.Domain + strconv.Itoa(i), FileBytes: string(byteConf)}) + configYaml := config.ConfigXdsProtoToYaml(confPb) + conf = append(conf, config.RateLimitConfigToLoad{Name: confPb.Domain, ConfigYaml: configYaml}) } rlSettings := settings.NewSettings() rlsConf := p.loader.Load(conf, p.statsManager, rlSettings.MergeDomainConfigurations) diff --git a/test/config/config_test.go b/test/config/config_test.go index 2b4cb0a77..ad587e03b 100644 --- a/test/config/config_test.go +++ b/test/config/config_test.go @@ -21,7 +21,8 @@ func loadFile(path string) []config.RateLimitConfigToLoad { if err != nil { panic(err) } - return []config.RateLimitConfigToLoad{{path, string(contents)}} + configYaml := config.ConfigFileContentToYaml(path, string(contents)) + return []config.RateLimitConfigToLoad{{Name: path, ConfigYaml: configYaml}} } func TestBasicConfig(t *testing.T) { From 943907ac6a15bf9db2c1b557cbcc1db85c16025d Mon Sep 17 00:00:00 2001 From: Renuka Fernando Date: Fri, 21 Oct 2022 12:15:27 +0530 Subject: [PATCH 14/22] Add RateLimitUnit enum in rate limit config xDS proto Signed-off-by: Renuka Fernando --- .../config/ratelimit/v3/rls_conf.proto | 63 ++++++++++++++++--- examples/xds-sotw-config-server/resource.go | 28 ++++----- go.mod | 6 +- go.sum | 6 +- src/config/config_xds.go | 2 +- src/provider/xds_grpc_sotw_provider.go | 7 +++ 6 files changed, 83 insertions(+), 29 deletions(-) diff --git a/api/ratelimit/config/ratelimit/v3/rls_conf.proto b/api/ratelimit/config/ratelimit/v3/rls_conf.proto index 9ae06095b..013809736 100644 --- a/api/ratelimit/config/ratelimit/v3/rls_conf.proto +++ b/api/ratelimit/config/ratelimit/v3/rls_conf.proto @@ -7,33 +7,80 @@ option java_outer_classname = "RlsConfigProto"; option java_multiple_files = true; option go_package = "github.com/envoyproxy/go-control-plane/ratelimit/config/ratelimit/v3;ratelimitv3"; -// [#protodoc-title: Rate Limit Config Discovery Service (RLS Conf DS)] +// [#protodoc-title: Rate limit service configuration] -// Rate-limit config model +// Rate limit configuration for a single domain. message RateLimitConfig { - string domain = 1; - repeated RateLimitDescriptor descriptors = 2; + // Name of the rate limit configuration. This should be unique for each configuration. + string name = 1; + + // Domain name for the rate limit configuration. + string domain = 2; + + // List of rate limit configuration descriptors. + repeated RateLimitDescriptor descriptors = 3; } -// Rate-limit descriptor model +// Rate limit configuration descriptor. message RateLimitDescriptor { + // Key of the descriptor. string key = 1; + + // Optional value of the descriptor. string value = 2; + + // Rate limit policy of the descriptor. RateLimitPolicy rate_limit = 3; + + // List of sub rate limit descriptors. repeated RateLimitDescriptor descriptors = 4; + + // Mark the descriptor as shadow. When the values is true, rate limit service allow requests to the backend. bool shadow_mode = 5; } -// Rate-limit policy model +// Rate-limit policy. message RateLimitPolicy { - string unit = 1; + // Unit of time for the rate limit. + RateLimitUnit unit = 1; + + // Number of requests allowed in the policy within `unit` time. uint32 requests_per_unit = 2; + + // Mark the rate limit policy as unlimited. All requests are allowed to the backend. bool unlimited = 3; + + // Optional name for the rate limit policy. Name the policy, if it should be replaced (dropped evaluation) by + // another policy. string name = 4; + + // List of rate limit policies, this rate limit policy will replace (drop evaluation) + // For more information: https://github.com/envoyproxy/ratelimit/tree/0b2f4d5fb04bf55e1873e2c5e2bb28da67c0643f#replaces + // Example: https://github.com/envoyproxy/ratelimit/tree/0b2f4d5fb04bf55e1873e2c5e2bb28da67c0643f#example-7 repeated RateLimitReplace replaces = 5; } -// Rate-limit replace model +// Replace specifies the rate limit policy that should be replaced (dropped evaluation). +// For more information: https://github.com/envoyproxy/ratelimit/tree/0b2f4d5fb04bf55e1873e2c5e2bb28da67c0643f#replaces message RateLimitReplace { + // Name of the rate limit policy, that is being replaced (dropped evaluation). string name = 1; } + +// Identifies the unit of of time for rate limit. +enum RateLimitUnit { + // The time unit is not known. + UNKNOWN = 0; + + // The time unit representing a second. + SECOND = 1; + + // The time unit representing a minute. + MINUTE = 2; + + // The time unit representing an hour. + HOUR = 3; + + // The time unit representing a day. + DAY = 4; +} diff --git a/examples/xds-sotw-config-server/resource.go b/examples/xds-sotw-config-server/resource.go index 726ac97b9..3946f51c5 100644 --- a/examples/xds-sotw-config-server/resource.go +++ b/examples/xds-sotw-config-server/resource.go @@ -29,7 +29,7 @@ func makeRlsConfig() []types.Resource { Key: "database", Value: "users", RateLimit: &rls_config.RateLimitPolicy{ - Unit: "second", + Unit: rls_config.RateLimitUnit_SECOND, RequestsPerUnit: 500, }, }, @@ -37,7 +37,7 @@ func makeRlsConfig() []types.Resource { Key: "database", Value: "default", RateLimit: &rls_config.RateLimitPolicy{ - Unit: "second", + Unit: rls_config.RateLimitUnit_SECOND, RequestsPerUnit: 500, }, }, @@ -51,7 +51,7 @@ func makeRlsConfig() []types.Resource { Value: "account", RateLimit: &rls_config.RateLimitPolicy{ Replaces: []*rls_config.RateLimitReplace{{Name: "bkthomps"}, {Name: "fake_name"}}, - Unit: "minute", + Unit: rls_config.RateLimitUnit_MINUTE, RequestsPerUnit: 4, }, }, @@ -64,7 +64,7 @@ func makeRlsConfig() []types.Resource { Value: "bkthomps", RateLimit: &rls_config.RateLimitPolicy{ Replaces: []*rls_config.RateLimitReplace{{Name: "bkthomps"}}, - Unit: "minute", + Unit: rls_config.RateLimitUnit_MINUTE, RequestsPerUnit: 2, }, }, @@ -72,7 +72,7 @@ func makeRlsConfig() []types.Resource { Key: "destination_cluster", Value: "mock", RateLimit: &rls_config.RateLimitPolicy{ - Unit: "minute", + Unit: rls_config.RateLimitUnit_MINUTE, RequestsPerUnit: 1, }, }, @@ -81,7 +81,7 @@ func makeRlsConfig() []types.Resource { Value: "override", RateLimit: &rls_config.RateLimitPolicy{ Replaces: []*rls_config.RateLimitReplace{{Name: "banned_limit"}}, - Unit: "minute", + Unit: rls_config.RateLimitUnit_MINUTE, RequestsPerUnit: 2, }, }, @@ -90,7 +90,7 @@ func makeRlsConfig() []types.Resource { Value: "fake", RateLimit: &rls_config.RateLimitPolicy{ Name: "fake_name", - Unit: "minute", + Unit: rls_config.RateLimitUnit_MINUTE, RequestsPerUnit: 2, }, }, @@ -99,14 +99,14 @@ func makeRlsConfig() []types.Resource { { Key: "foo", RateLimit: &rls_config.RateLimitPolicy{ - Unit: "minute", + Unit: rls_config.RateLimitUnit_MINUTE, RequestsPerUnit: 2, }, Descriptors: []*rls_config.RateLimitDescriptor{ { Key: "bar", RateLimit: &rls_config.RateLimitPolicy{ - Unit: "minute", + Unit: rls_config.RateLimitUnit_MINUTE, RequestsPerUnit: 3, }, }, @@ -115,7 +115,7 @@ func makeRlsConfig() []types.Resource { Value: "bkthomps", RateLimit: &rls_config.RateLimitPolicy{ Name: "bkthomps", - Unit: "minute", + Unit: rls_config.RateLimitUnit_MINUTE, RequestsPerUnit: 1, }, }, @@ -124,14 +124,14 @@ func makeRlsConfig() []types.Resource { Value: "banned", RateLimit: &rls_config.RateLimitPolicy{ Name: "banned_limit", - Unit: "minute", + Unit: rls_config.RateLimitUnit_MINUTE, RequestsPerUnit: 0, }, }, { Key: "baz", RateLimit: &rls_config.RateLimitPolicy{ - Unit: "second", + Unit: rls_config.RateLimitUnit_SECOND, RequestsPerUnit: 1, }, }, @@ -139,7 +139,7 @@ func makeRlsConfig() []types.Resource { Key: "baz", Value: "not-so-shady", RateLimit: &rls_config.RateLimitPolicy{ - Unit: "minute", + Unit: rls_config.RateLimitUnit_MINUTE, RequestsPerUnit: 3, }, }, @@ -147,7 +147,7 @@ func makeRlsConfig() []types.Resource { Key: "baz", Value: "shady", RateLimit: &rls_config.RateLimitPolicy{ - Unit: "minute", + Unit: rls_config.RateLimitUnit_MINUTE, RequestsPerUnit: 3, }, ShadowMode: true, diff --git a/go.mod b/go.mod index 9b73b6836..5ad85fbca 100644 --- a/go.mod +++ b/go.mod @@ -2,15 +2,15 @@ module github.com/envoyproxy/ratelimit go 1.18 -// replace github.com/envoyproxy/go-control-plane => /Users/renuka/git/go-control-plane -replace github.com/envoyproxy/go-control-plane => github.com/renuka-fernando/go-control-plane v0.0.1 +replace github.com/envoyproxy/go-control-plane => /Users/renuka/git/go-control-plane + +// replace github.com/envoyproxy/go-control-plane => github.com/renuka-fernando/go-control-plane v0.0.1 require ( github.com/alicebob/miniredis/v2 v2.23.0 github.com/bradfitz/gomemcache v0.0.0-20190913173617-a41fca850d0b github.com/coocood/freecache v1.1.0 github.com/envoyproxy/go-control-plane v0.10.1 - github.com/ghodss/yaml v1.0.0 github.com/golang/mock v1.4.4 github.com/golang/protobuf v1.5.2 github.com/gorilla/mux v1.7.4-0.20191121170500-49c01487a141 diff --git a/go.sum b/go.sum index fa38c1e5a..9544de1db 100644 --- a/go.sum +++ b/go.sum @@ -69,9 +69,9 @@ github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSs github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= github.com/envoyproxy/protoc-gen-validate v0.6.7 h1:qcZcULcd/abmQg6dwigimCNEyi4gg31M/xaciQlDml8= github.com/envoyproxy/protoc-gen-validate v0.6.7/go.mod h1:dyJXwwfPK2VSqiB9Klm1J6romD608Ba7Hij42vrOBCo= +github.com/envoyproxy/ratelimit v1.4.1-0.20220928150143-0b2f4d5fb04b/go.mod h1:qd8mgua4nBCzIWo+ClmfUqGxFEu+Tm9/CDCs5XRFUsA= github.com/fsnotify/fsnotify v1.4.9 h1:hsms1Qyu0jgnwNXIxa+/V/PDsU6CfLf6CNO8H7IWoS4= github.com/fsnotify/fsnotify v1.4.9/go.mod h1:znqG4EE+3YCdAaPaxE2ZRY/06pZUdp0tY4IgpuI1SZQ= -github.com/ghodss/yaml v1.0.0 h1:wQHKEahhL6wmXdzwWG11gIVCkOv05bNOh+Rxn0yngAk= github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= github.com/go-gl/glfw v0.0.0-20190409004039-e6da0acd62b1/go.mod h1:vR7hzQXu2zJy9AVAgeJqvqgH9Q5CA+iKCZ2gyEVpxRU= github.com/go-gl/glfw/v3.3/glfw v0.0.0-20191125211704-12ad95a8df72/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= @@ -185,8 +185,6 @@ github.com/pkg/sftp v1.10.1/go.mod h1:lYOWFsE0bwd1+KfKJaKeuokY15vzFx25BLbzYYoAxZ github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= github.com/prometheus/client_model v0.2.0/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= -github.com/renuka-fernando/go-control-plane v0.0.1 h1:XURYmEmqrBkiT/JNALD3YC3blB4ubbjZyz5oOpqKLI8= -github.com/renuka-fernando/go-control-plane v0.0.1/go.mod h1:fJJn/j26vwOu972OllsvAgJJM//w9BV6Fxbg2LuVd34= github.com/rogpeppe/fastuuid v1.2.0/go.mod h1:jVj6XXZzXRy/MSR5jhDC/2q6DgLz+nrA6LYCDYWNEvQ= github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= github.com/sirupsen/logrus v1.4.2/go.mod h1:tLMulIdttU9McNUspp0xgXVQah82FyeX6MwdIuYE2rE= @@ -369,10 +367,12 @@ golang.org/x/sys v0.0.0-20210330210617-4fbd30eecc44/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210423185535-09eb48e85fd7/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210510120138-977fb7262007/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210816183151-1e6c022a8912/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220728004956-3c1f35247d10 h1:WIoqL4EROvwiPdUtaip4VcDdpZ4kha7wBWZrbVKCIZg= golang.org/x/sys v0.0.0-20220728004956-3c1f35247d10/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= +golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= diff --git a/src/config/config_xds.go b/src/config/config_xds.go index b83a1a9f6..591d79e2c 100644 --- a/src/config/config_xds.go +++ b/src/config/config_xds.go @@ -33,7 +33,7 @@ func rateLimitPolicyPbToYaml(pb *rls_conf_v3.RateLimitPolicy) *yamlRateLimit { } return &yamlRateLimit{ RequestsPerUnit: pb.RequestsPerUnit, - Unit: pb.Unit, + Unit: pb.Unit.String(), Unlimited: pb.Unlimited, Name: pb.Name, Replaces: rateLimitReplacesPbToYaml(pb.Replaces), diff --git a/src/provider/xds_grpc_sotw_provider.go b/src/provider/xds_grpc_sotw_provider.go index c7bb3e115..21b74d81b 100644 --- a/src/provider/xds_grpc_sotw_provider.go +++ b/src/provider/xds_grpc_sotw_provider.go @@ -2,6 +2,7 @@ package provider import ( "context" + "fmt" "io" core "github.com/envoyproxy/go-control-plane/envoy/config/core/v3" @@ -175,6 +176,12 @@ func (p *XdsGrpcSotwProvider) getGrpcTransportCredentials() grpc.DialOption { } func (p *XdsGrpcSotwProvider) sendConfigs(resources []*any.Any) { + defer func() { + err := recover() + logger.Errorf("Error applying xDS configuration: %v", err) + p.nack(fmt.Sprint(err)) + }() + conf := make([]config.RateLimitConfigToLoad, 0, len(resources)) for _, res := range resources { confPb := &rls_conf_v3.RateLimitConfig{} From 0955383c07d560614769b7f7c76b647ff8ab8445 Mon Sep 17 00:00:00 2001 From: Renuka Fernando Date: Fri, 21 Oct 2022 15:20:46 +0530 Subject: [PATCH 15/22] Add unit tests for test domain merge functionality Signed-off-by: Renuka Fernando --- go.mod | 1 - src/provider/xds_grpc_sotw_provider.go | 2 +- test/provider/xds_grpc_sotw_provider_test.go | 202 ++++++++++++++++--- 3 files changed, 180 insertions(+), 25 deletions(-) diff --git a/go.mod b/go.mod index 5ad85fbca..757950b5d 100644 --- a/go.mod +++ b/go.mod @@ -3,7 +3,6 @@ module github.com/envoyproxy/ratelimit go 1.18 replace github.com/envoyproxy/go-control-plane => /Users/renuka/git/go-control-plane - // replace github.com/envoyproxy/go-control-plane => github.com/renuka-fernando/go-control-plane v0.0.1 require ( diff --git a/src/provider/xds_grpc_sotw_provider.go b/src/provider/xds_grpc_sotw_provider.go index 21b74d81b..74ac6f17a 100644 --- a/src/provider/xds_grpc_sotw_provider.go +++ b/src/provider/xds_grpc_sotw_provider.go @@ -195,7 +195,7 @@ func (p *XdsGrpcSotwProvider) sendConfigs(resources []*any.Any) { logger.Infof("RENUKA TEST: %v", confPb) configYaml := config.ConfigXdsProtoToYaml(confPb) - conf = append(conf, config.RateLimitConfigToLoad{Name: confPb.Domain, ConfigYaml: configYaml}) + conf = append(conf, config.RateLimitConfigToLoad{Name: confPb.Name, ConfigYaml: configYaml}) } rlSettings := settings.NewSettings() rlsConf := p.loader.Load(conf, p.statsManager, rlSettings.MergeDomainConfigurations) diff --git a/test/provider/xds_grpc_sotw_provider_test.go b/test/provider/xds_grpc_sotw_provider_test.go index 051706e23..4f2d08c69 100644 --- a/test/provider/xds_grpc_sotw_provider_test.go +++ b/test/provider/xds_grpc_sotw_provider_test.go @@ -1,8 +1,8 @@ package provider_test import ( - "context" "fmt" + "os" "strings" "testing" @@ -32,13 +32,14 @@ func TestXdsProvider(t *testing.T) { map[resource.Type][]types.Resource{ resource.RateLimitConfigType: { &rls_config.RateLimitConfig{ + Name: "foo", Domain: "foo", Descriptors: []*rls_config.RateLimitDescriptor{ { Key: "k1", Value: "v1", RateLimit: &rls_config.RateLimitPolicy{ - Unit: "minute", + Unit: rls_config.RateLimitUnit_MINUTE, RequestsPerUnit: 3, }, }, @@ -62,12 +63,22 @@ func TestXdsProvider(t *testing.T) { defer p.Stop() providerEventChan := p.ConfigUpdateEvent() - t.Run("Test initial xDS config", testInitialXdsConfig(setSnapshotFunc, providerEventChan)) - t.Run("Test new (after initial) xDS config update", testNewXdsConfigUpdate(setSnapshotFunc, providerEventChan)) - t.Run("Test multi domain xDS config update", testMultiDomainXdsConfigUpdate(setSnapshotFunc, providerEventChan)) + snapVersion := 1 + t.Run("Test initial xDS config", testInitialXdsConfig(&snapVersion, setSnapshotFunc, providerEventChan)) + t.Run("Test new (after initial) xDS config update", testNewXdsConfigUpdate(&snapVersion, setSnapshotFunc, providerEventChan)) + t.Run("Test multi domain xDS config update", testMultiDomainXdsConfigUpdate(&snapVersion, setSnapshotFunc, providerEventChan)) + t.Run("Test limits with deeper xDS config update", testDeeperLimitsXdsConfigUpdate(&snapVersion, setSnapshotFunc, providerEventChan)) + + err := os.Setenv("MERGE_DOMAIN_CONFIG", "true") + defer os.Unsetenv("MERGE_DOMAIN_CONFIG") + if err != nil { + t.Error("Error setting 'MERGE_DOMAIN_CONFIG' environment variable", err) + } + t.Run("Test same domain multiple times xDS config update", testSameDomainMultipleXdsConfigUpdate(setSnapshotFunc, providerEventChan)) } -func testInitialXdsConfig(setSnapshotFunc common.SetSnapshotFunc, providerEventChan <-chan provider.ConfigUpdateEvent) func(t *testing.T) { +func testInitialXdsConfig(snapVersion *int, setSnapshotFunc common.SetSnapshotFunc, providerEventChan <-chan provider.ConfigUpdateEvent) func(t *testing.T) { + *snapVersion += 1 return func(t *testing.T) { assert := assert.New(t) @@ -80,21 +91,23 @@ func testInitialXdsConfig(setSnapshotFunc common.SetSnapshotFunc, providerEventC } } -func testNewXdsConfigUpdate(setSnapshotFunc common.SetSnapshotFunc, providerEventChan <-chan provider.ConfigUpdateEvent) func(t *testing.T) { +func testNewXdsConfigUpdate(snapVersion *int, setSnapshotFunc common.SetSnapshotFunc, providerEventChan <-chan provider.ConfigUpdateEvent) func(t *testing.T) { + *snapVersion += 1 return func(t *testing.T) { assert := assert.New(t) - snapshot, _ := cache.NewSnapshot("2", + snapshot, _ := cache.NewSnapshot(fmt.Sprint(*snapVersion), map[resource.Type][]types.Resource{ resource.RateLimitConfigType: { &rls_config.RateLimitConfig{ + Name: "foo", Domain: "foo", Descriptors: []*rls_config.RateLimitDescriptor{ { Key: "k2", Value: "v2", RateLimit: &rls_config.RateLimitPolicy{ - Unit: "minute", + Unit: rls_config.RateLimitUnit_MINUTE, RequestsPerUnit: 5, }, }, @@ -114,34 +127,37 @@ func testNewXdsConfigUpdate(setSnapshotFunc common.SetSnapshotFunc, providerEven } } -func testMultiDomainXdsConfigUpdate(setSnapshotFunc common.SetSnapshotFunc, providerEventChan <-chan provider.ConfigUpdateEvent) func(t *testing.T) { +func testMultiDomainXdsConfigUpdate(snapVersion *int, setSnapshotFunc common.SetSnapshotFunc, providerEventChan <-chan provider.ConfigUpdateEvent) func(t *testing.T) { + *snapVersion += 1 return func(t *testing.T) { assert := assert.New(t) - snapshot, _ := cache.NewSnapshot("3", + snapshot, _ := cache.NewSnapshot(fmt.Sprint(*snapVersion), map[resource.Type][]types.Resource{ resource.RateLimitConfigType: { &rls_config.RateLimitConfig{ + Name: "foo", Domain: "foo", Descriptors: []*rls_config.RateLimitDescriptor{ { Key: "k1", - Value: "v2", + Value: "v1", RateLimit: &rls_config.RateLimitPolicy{ - Unit: "minute", + Unit: rls_config.RateLimitUnit_MINUTE, RequestsPerUnit: 10, }, }, }, }, &rls_config.RateLimitConfig{ + Name: "bar", Domain: "bar", Descriptors: []*rls_config.RateLimitDescriptor{ { Key: "k1", - Value: "v2", + Value: "v1", RateLimit: &rls_config.RateLimitPolicy{ - Unit: "minute", + Unit: rls_config.RateLimitUnit_MINUTE, RequestsPerUnit: 100, }, }, @@ -158,18 +174,158 @@ func testMultiDomainXdsConfigUpdate(setSnapshotFunc common.SetSnapshotFunc, prov config, err := configEvent.GetConfig() assert.Nil(err) assert.ElementsMatch([]string{ - "foo.k1_v2: unit=MINUTE requests_per_unit=10, shadow_mode: false", - "bar.k1_v2: unit=MINUTE requests_per_unit=100, shadow_mode: false", + "foo.k1_v1: unit=MINUTE requests_per_unit=10, shadow_mode: false", + "bar.k1_v1: unit=MINUTE requests_per_unit=100, shadow_mode: false", }, strings.Split(strings.TrimSuffix(config.Dump(), "\n"), "\n")) } } -func setSnapshot(t *testing.T, snapCache cache.SnapshotCache, snapshot *cache.Snapshot) { - t.Helper() - if err := snapshot.Consistent(); err != nil { - t.Errorf("snapshot inconsistency: %+v\n%+v", snapshot, err) +func testDeeperLimitsXdsConfigUpdate(snapVersion *int, setSnapshotFunc common.SetSnapshotFunc, providerEventChan <-chan provider.ConfigUpdateEvent) func(t *testing.T) { + *snapVersion += 1 + return func(t *testing.T) { + assert := assert.New(t) + + snapshot, _ := cache.NewSnapshot(fmt.Sprint(*snapVersion), + map[resource.Type][]types.Resource{ + resource.RateLimitConfigType: { + &rls_config.RateLimitConfig{ + Name: "foo", + Domain: "foo", + Descriptors: []*rls_config.RateLimitDescriptor{ + { + Key: "k1", + Value: "v1", + RateLimit: &rls_config.RateLimitPolicy{ + Unit: rls_config.RateLimitUnit_MINUTE, + RequestsPerUnit: 10, + }, + Descriptors: []*rls_config.RateLimitDescriptor{ + { + Key: "k2", + RateLimit: &rls_config.RateLimitPolicy{ + Unlimited: true, + }, + }, + { + Key: "k2", + Value: "v2", + RateLimit: &rls_config.RateLimitPolicy{ + Unit: rls_config.RateLimitUnit_HOUR, + RequestsPerUnit: 15, + }, + }, + }, + }, + { + Key: "j1", + Value: "v2", + RateLimit: &rls_config.RateLimitPolicy{ + Unlimited: true, + }, + Descriptors: []*rls_config.RateLimitDescriptor{ + { + Key: "j2", + RateLimit: &rls_config.RateLimitPolicy{ + Unlimited: true, + }, + }, + { + Key: "j2", + Value: "v2", + RateLimit: &rls_config.RateLimitPolicy{ + Unit: rls_config.RateLimitUnit_DAY, + RequestsPerUnit: 15, + }, + ShadowMode: true, + }, + }, + }, + }, + }, + &rls_config.RateLimitConfig{ + Name: "bar", + Domain: "bar", + Descriptors: []*rls_config.RateLimitDescriptor{ + { + Key: "k1", + Value: "v1", + RateLimit: &rls_config.RateLimitPolicy{ + Unit: rls_config.RateLimitUnit_MINUTE, + RequestsPerUnit: 100, + }, + }, + }, + }, + }, + }, + ) + setSnapshotFunc(snapshot) + + configEvent := <-providerEventChan + assert.NotNil(configEvent) + + config, err := configEvent.GetConfig() + assert.Nil(err) + assert.ElementsMatch([]string{ + "foo.k1_v1: unit=MINUTE requests_per_unit=10, shadow_mode: false", + "foo.k1_v1.k2: unit=UNKNOWN requests_per_unit=0, shadow_mode: false", + "foo.k1_v1.k2_v2: unit=HOUR requests_per_unit=15, shadow_mode: false", + "foo.j1_v2: unit=UNKNOWN requests_per_unit=0, shadow_mode: false", + "foo.j1_v2.j2: unit=UNKNOWN requests_per_unit=0, shadow_mode: false", + "foo.j1_v2.j2_v2: unit=DAY requests_per_unit=15, shadow_mode: true", + "bar.k1_v1: unit=MINUTE requests_per_unit=100, shadow_mode: false", + }, strings.Split(strings.TrimSuffix(config.Dump(), "\n"), "\n")) } - if err := snapCache.SetSnapshot(context.Background(), "test-node", snapshot); err != nil { - t.Errorf("snapshot error %q for %+v", err, snapshot) +} + +func testSameDomainMultipleXdsConfigUpdate(setSnapshotFunc common.SetSnapshotFunc, providerEventChan <-chan provider.ConfigUpdateEvent) func(t *testing.T) { + return func(t *testing.T) { + assert := assert.New(t) + + snapshot, _ := cache.NewSnapshot("3", + map[resource.Type][]types.Resource{ + resource.RateLimitConfigType: { + &rls_config.RateLimitConfig{ + Name: "foo-1", + Domain: "foo", + Descriptors: []*rls_config.RateLimitDescriptor{ + { + Key: "k1", + Value: "v1", + RateLimit: &rls_config.RateLimitPolicy{ + Unit: rls_config.RateLimitUnit_MINUTE, + RequestsPerUnit: 10, + }, + }, + }, + }, + &rls_config.RateLimitConfig{ + Name: "foo-2", + Domain: "foo", + Descriptors: []*rls_config.RateLimitDescriptor{ + { + Key: "k1", + Value: "v2", + RateLimit: &rls_config.RateLimitPolicy{ + Unit: rls_config.RateLimitUnit_MINUTE, + RequestsPerUnit: 100, + }, + }, + }, + }, + }, + }, + ) + setSnapshotFunc(snapshot) + + configEvent := <-providerEventChan + assert.NotNil(configEvent) + + config, err := configEvent.GetConfig() + assert.Nil(err) + assert.ElementsMatch([]string{ + "foo.k1_v2: unit=MINUTE requests_per_unit=100, shadow_mode: false", + "foo.k1_v1: unit=MINUTE requests_per_unit=10, shadow_mode: false", + }, strings.Split(strings.TrimSuffix(config.Dump(), "\n"), "\n")) } } From be6c1076fdce97718ac21c4eb3638f187674947a Mon Sep 17 00:00:00 2001 From: Renuka Fernando Date: Tue, 25 Oct 2022 13:21:09 +0530 Subject: [PATCH 16/22] Update docs for rate limit xDS config management service Signed-off-by: Renuka Fernando --- README.md | 45 +++++++++- .../config/ratelimit/v3/rls_conf.proto | 86 ------------------- .../service/ratelimit/v3/rls_conf_ds.proto | 25 ------ examples/xds-sotw-config-server/Dockerfile | 4 - examples/xds-sotw-config-server/README.md | 11 +-- examples/xds-sotw-config-server/go.mod | 4 +- examples/xds-sotw-config-server/go.sum | 4 +- examples/xds-sotw-config-server/resource.go | 2 + go.mod | 4 +- go.sum | 5 +- src/config/config_impl.go | 7 +- src/provider/provider.go | 6 ++ src/provider/xds_grpc_sotw_provider.go | 34 ++++---- src/service/ratelimit.go | 26 ++---- src/settings/settings.go | 1 - test/common/xds_sotw.go | 2 +- test/integration/xds_sotw_integration_test.go | 27 +++--- test/provider/xds_grpc_sotw_provider_test.go | 1 - test/service/ratelimit_test.go | 26 ------ 19 files changed, 111 insertions(+), 209 deletions(-) delete mode 100644 api/ratelimit/config/ratelimit/v3/rls_conf.proto delete mode 100644 api/ratelimit/service/ratelimit/v3/rls_conf_ds.proto diff --git a/README.md b/README.md index f7947520a..2afb4f997 100644 --- a/README.md +++ b/README.md @@ -8,7 +8,7 @@ - [Building and Testing](#building-and-testing) - [Docker-compose setup](#docker-compose-setup) - [Full test environment - Configure rate limits through files](#full-test-environment---configure-rate-limits-through-files) - - [Full test environment - Configure rate limits through xDS-Server](#full-test-environment---configure-rate-limits-through-xds-server) + - [Full test environment - Configure rate limits through an xDS Management Server](#full-test-environment---configure-rate-limits-through-an-xds-management-server) - [Self-contained end-to-end integration test](#self-contained-end-to-end-integration-test) - [Configuration](#configuration) - [The configuration format](#the-configuration-format) @@ -26,6 +26,8 @@ - [Example 6](#example-6) - [Example 7](#example-7) - [Loading Configuration](#loading-configuration) + - [File Based Configuration Loading](#file-based-configuration-loading) + - [xDS Management Server Based Configuration Loading](#xds-management-server-based-configuration-loading) - [Log Format](#log-format) - [GRPC Keepalive](#grpc-keepalive) - [Request Fields](#request-fields) @@ -162,7 +164,7 @@ To see the metrics in the example curl http://localhost:9102/metrics | grep -i shadow ``` -## Full test environment - Configure rate limits through xDS-Server +## Full test environment - Configure rate limits through an xDS Management Server To run a fully configured environment to demo Envoy based rate limiting, run: @@ -183,7 +185,7 @@ curl localhost:8888/twoheader -H "foo: foo" -H "baz: shady" # This will never be curl localhost:8888/twoheader -H "foo: foo" -H "baz: not-so-shady" # This is subject to rate-limiting because the it's now in shadow_mode ``` -Edit[ `examples/xds-sotw-config-server/resource.go`](examples/xds-sotw-config-server/resource.go) to test different rate limit configs. +Edit[`examples/xds-sotw-config-server/resource.go`](examples/xds-sotw-config-server/resource.go) to test different rate limit configs. To see the metrics in the example @@ -524,6 +526,18 @@ descriptors: ## Loading Configuration +Rate limit service supports following configuration loading methods. You can define which methods to use by configuring environment variable `CONFIG_TYPE`. + +| Config Loading Method | Value for Environment Variable `CONFIG_TYPE` | +| --------------------------------------------------------------------------------- | -------------------------------------------- | +| [File Based Configuration Loading](#file-based-configuration-loading) | `FILE` (Default) | +| [xDS Server Based Configuration Loading](#xds-server-based-configuration-loading) | `GRPC_XDS_SOTW` | + +When the environment variable `FORCE_START_WITHOUT_INITIAL_CONFIG` set to `false`, the Rate limit service will wait for initial rate limit configuration before +starting the server (gRPC, Rest server endpoints). When set to `true` the server will start even without initial configuration. + +### File Based Configuration Loading + The Ratelimit service uses a library written by Lyft called [goruntime](https://github.com/lyft/goruntime) to do configuration loading. Goruntime monitors a designated path, and watches for symlink swaps to files in the directory tree to reload configuration files. @@ -557,6 +571,31 @@ For more information on how runtime works you can read its [README](https://gith By default it is not possible to define multiple configuration files within `RUNTIME_SUBDIRECTORY` referencing the same domain. To enable this behavior set `MERGE_DOMAIN_CONFIG` to `true`. +### xDS Management Server Based Configuration Loading + +xDS Management Server is a gRPC server which implements the [Aggregated Discovery Service (ADS)](https://github.com/envoyproxy/data-plane-api/blob/97b6dae39046f7da1331a4dc57830d20e842fc26/envoy/service/discovery/v3/ads.proto). +The xDS Management server serves [Discovery Response](https://github.com/envoyproxy/data-plane-api/blob/97b6dae39046f7da1331a4dc57830d20e842fc26/envoy/service/discovery/v3/discovery.proto#L69) with [Ratelimit Configuration Resources](api/ratelimit/config/ratelimit/v3/rls_conf.proto) +and with Type URL `"type.googleapis.com/ratelimit.config.ratelimit.v3.RateLimitConfig"`. +The xDS client in the Rate limit service configure Rate limit service with the provided configuration. +For more information on xDS protocol please refer to the [envoy proxy documentation](https://www.envoyproxy.io/docs/envoy/latest/api-docs/xds_protocol). + +You can refer to [the sample xDS configuration management server](examples/xds-sotw-config-server/README.md). + +The xDS server for listening for configuration can be set via [settings](https://github.com/envoyproxy/ratelimit/blob/master/src/settings/settings.go) +package with the following environment variables: + +``` +CONFIG_GRPC_XDS_NODE_ID default:"default" +CONFIG_GRPC_XDS_SERVER_URL default:"localhost:18000" +CONFIG_GRPC_XDS_SERVER_CONNECT_RETRY_INTERVAL default:"3s" +``` + +As well Ratelimit supports TLS connections, these can be configured using the following environment variables: + +1. `CONFIG_GRPC_XDS_SERVER_USE_TLS`: set to `"true"` to enable a TLS connection with the xDS configuration management server. +2. `CONFIG_GRPC_XDS_CLIENT_TLS_CERT`, `CONFIG_GRPC_XDS_CLIENT_TLS_KEY`, and `CONFIG_GRPC_XDS_SERVER_TLS_CACERT` to provides files to specify a TLS connection configuration to the xDS configuration management server. +3. `GRPC_CLIENT_TLS_SAN`: Override the SAN value to validate from the server certificate. + ## Log Format A centralized log collection system works better with logs in json format. JSON format avoids the need for custom parsing rules. diff --git a/api/ratelimit/config/ratelimit/v3/rls_conf.proto b/api/ratelimit/config/ratelimit/v3/rls_conf.proto deleted file mode 100644 index 013809736..000000000 --- a/api/ratelimit/config/ratelimit/v3/rls_conf.proto +++ /dev/null @@ -1,86 +0,0 @@ -syntax = "proto3"; - -package ratelimit.config.ratelimit.v3; - -option java_package = "io.envoyproxy.ratelimit.config.ratelimit.v3"; -option java_outer_classname = "RlsConfigProto"; -option java_multiple_files = true; -option go_package = "github.com/envoyproxy/go-control-plane/ratelimit/config/ratelimit/v3;ratelimitv3"; - -// [#protodoc-title: Rate limit service configuration] - -// Rate limit configuration for a single domain. -message RateLimitConfig { - // Name of the rate limit configuration. This should be unique for each configuration. - string name = 1; - - // Domain name for the rate limit configuration. - string domain = 2; - - // List of rate limit configuration descriptors. - repeated RateLimitDescriptor descriptors = 3; -} - -// Rate limit configuration descriptor. -message RateLimitDescriptor { - // Key of the descriptor. - string key = 1; - - // Optional value of the descriptor. - string value = 2; - - // Rate limit policy of the descriptor. - RateLimitPolicy rate_limit = 3; - - // List of sub rate limit descriptors. - repeated RateLimitDescriptor descriptors = 4; - - // Mark the descriptor as shadow. When the values is true, rate limit service allow requests to the backend. - bool shadow_mode = 5; -} - -// Rate-limit policy. -message RateLimitPolicy { - // Unit of time for the rate limit. - RateLimitUnit unit = 1; - - // Number of requests allowed in the policy within `unit` time. - uint32 requests_per_unit = 2; - - // Mark the rate limit policy as unlimited. All requests are allowed to the backend. - bool unlimited = 3; - - // Optional name for the rate limit policy. Name the policy, if it should be replaced (dropped evaluation) by - // another policy. - string name = 4; - - // List of rate limit policies, this rate limit policy will replace (drop evaluation) - // For more information: https://github.com/envoyproxy/ratelimit/tree/0b2f4d5fb04bf55e1873e2c5e2bb28da67c0643f#replaces - // Example: https://github.com/envoyproxy/ratelimit/tree/0b2f4d5fb04bf55e1873e2c5e2bb28da67c0643f#example-7 - repeated RateLimitReplace replaces = 5; -} - -// Replace specifies the rate limit policy that should be replaced (dropped evaluation). -// For more information: https://github.com/envoyproxy/ratelimit/tree/0b2f4d5fb04bf55e1873e2c5e2bb28da67c0643f#replaces -message RateLimitReplace { - // Name of the rate limit policy, that is being replaced (dropped evaluation). - string name = 1; -} - -// Identifies the unit of of time for rate limit. -enum RateLimitUnit { - // The time unit is not known. - UNKNOWN = 0; - - // The time unit representing a second. - SECOND = 1; - - // The time unit representing a minute. - MINUTE = 2; - - // The time unit representing an hour. - HOUR = 3; - - // The time unit representing a day. - DAY = 4; -} diff --git a/api/ratelimit/service/ratelimit/v3/rls_conf_ds.proto b/api/ratelimit/service/ratelimit/v3/rls_conf_ds.proto deleted file mode 100644 index 3aa6525c7..000000000 --- a/api/ratelimit/service/ratelimit/v3/rls_conf_ds.proto +++ /dev/null @@ -1,25 +0,0 @@ -syntax = "proto3"; - -package ratelimit.service.ratelimit.v3; - -import "envoy/service/discovery/v3/discovery.proto"; - -option java_package = "io.envoyproxy.ratelimit.service.config.v3"; -option java_outer_classname = "RlsConfigProto"; -option java_multiple_files = true; -option go_package = "github.com/envoyproxy/go-control-plane/ratelimit/service/config/v3;configv3"; -option java_generic_services = true; - -// [#protodoc-title: Rate Limit Config Discovery Service (RLS Conf DS)] - -// Return list of all rate limit configs that rate limit service should be configured with. -service RateLimitConfigDiscoveryService { - - rpc StreamRlsConfigs(stream envoy.service.discovery.v3.DiscoveryRequest) - returns (stream envoy.service.discovery.v3.DiscoveryResponse) { - } - - rpc FetchRlsConfigs(envoy.service.discovery.v3.DiscoveryRequest) - returns (envoy.service.discovery.v3.DiscoveryResponse) { - } -} diff --git a/examples/xds-sotw-config-server/Dockerfile b/examples/xds-sotw-config-server/Dockerfile index bcc08bfc3..52439213f 100644 --- a/examples/xds-sotw-config-server/Dockerfile +++ b/examples/xds-sotw-config-server/Dockerfile @@ -1,10 +1,6 @@ FROM golang:1.18 AS build WORKDIR /xds-server -# ENV GOPROXY=https://proxy.golang.org -# COPY go.mod go.sum /xds-server/ -# RUN go mod download - COPY . . RUN CGO_ENABLED=0 GOOS=linux go build -o /go/bin/xds-server -v main/main.go diff --git a/examples/xds-sotw-config-server/README.md b/examples/xds-sotw-config-server/README.md index 891da7763..4586cf140 100644 --- a/examples/xds-sotw-config-server/README.md +++ b/examples/xds-sotw-config-server/README.md @@ -1,16 +1,17 @@ # Example Rate-limit Configuration SotW xDS Server -This is an example of a trivial xDS V3 control plane server similar to the example server in [go-control-plane](https://github.com/envoyproxy/go-control-plane/tree/main/internal/example). It serves Rate limit configuration. You can run the example using the project top-level Makefile, e.g.: +This is an example of a trivial xDS V3 control plane server similar to the example server in [go-control-plane](https://github.com/envoyproxy/go-control-plane/tree/main/internal/example). It serves sample Rate limit configuration. You can run the example using the project top-level docker-compose-example.yml, e.g.: -``` -$ make example +```bash +export CONFIG_TYPE=GRPC_XDS_SOTW +docker-compose -f docker-compose-example.yml --profile xds-config up --build --remove-orphans ``` -The Makefile builds the example server and then runs `build/example.sh` which runs both Envoy and the example server. The example server serves a configuration defined in `internal/example/resource.go`. If everything works correctly, you should be able to open a browser to [http://localhost:10000](http://localhost:10000) and see Envoy's website. +The docker-compose builds and runs the example server along with Rate limit server. The example server serves a configuration defined in [`resource.go`](resource.go). If everything works correctly, you can follow the [examples in project top-level README.md file](../../README.md#examples). ## Files - [main/main.go](main/main.go) is the example program entrypoint. It instantiates the cache and xDS server and runs the xDS server process. - [resource.go](resource.go) generates a `Snapshot` structure which describes the configuration that the xDS server serves to Envoy. - [server.go](server.go) runs the xDS control plane server. -- [logger.go](logger.go) implements the `pkg/log/Logger` interface which provides logging services to the cache. +- [logger.go](logger.go) is the logger. diff --git a/examples/xds-sotw-config-server/go.mod b/examples/xds-sotw-config-server/go.mod index 13d39d9e2..dd024899b 100644 --- a/examples/xds-sotw-config-server/go.mod +++ b/examples/xds-sotw-config-server/go.mod @@ -3,12 +3,11 @@ module github.com/envoyproxy/ratelimit/examples/xds-sotw-config-server go 1.18 // TODO: (renuka) Remove this replace once, https://github.com/envoyproxy/go-control-plane/pull/598 is merged -replace github.com/envoyproxy/go-control-plane => github.com/renuka-fernando/go-control-plane v0.0.1 +replace github.com/envoyproxy/go-control-plane => github.com/renuka-fernando/go-control-plane v0.0.2 require ( github.com/envoyproxy/go-control-plane v0.10.1 google.golang.org/grpc v1.45.0 - google.golang.org/protobuf v1.28.0 ) require ( @@ -20,4 +19,5 @@ require ( golang.org/x/sys v0.0.0-20210816183151-1e6c022a8912 // indirect golang.org/x/text v0.3.7 // indirect google.golang.org/genproto v0.0.0-20220329172620-7be39ac1afc7 // indirect + google.golang.org/protobuf v1.28.0 // indirect ) diff --git a/examples/xds-sotw-config-server/go.sum b/examples/xds-sotw-config-server/go.sum index 6e46f1a98..16578581c 100644 --- a/examples/xds-sotw-config-server/go.sum +++ b/examples/xds-sotw-config-server/go.sum @@ -132,8 +132,8 @@ github.com/pkg/sftp v1.10.1/go.mod h1:lYOWFsE0bwd1+KfKJaKeuokY15vzFx25BLbzYYoAxZ github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= github.com/prometheus/client_model v0.2.0/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= -github.com/renuka-fernando/go-control-plane v0.0.1 h1:XURYmEmqrBkiT/JNALD3YC3blB4ubbjZyz5oOpqKLI8= -github.com/renuka-fernando/go-control-plane v0.0.1/go.mod h1:fJJn/j26vwOu972OllsvAgJJM//w9BV6Fxbg2LuVd34= +github.com/renuka-fernando/go-control-plane v0.0.2 h1:tvvR+mkPz7ab2JZ5N6TQ/V3TOue8PmtTbuMuZxqVKbU= +github.com/renuka-fernando/go-control-plane v0.0.2/go.mod h1:fJJn/j26vwOu972OllsvAgJJM//w9BV6Fxbg2LuVd34= github.com/rogpeppe/fastuuid v1.2.0/go.mod h1:jVj6XXZzXRy/MSR5jhDC/2q6DgLz+nrA6LYCDYWNEvQ= github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= github.com/spaolacci/murmur3 v0.0.0-20180118202830-f09979ecbc72/go.mod h1:JwIasOWyU6f++ZhiEuf87xNszmSA2myDM2Kzu9HwQUA= diff --git a/examples/xds-sotw-config-server/resource.go b/examples/xds-sotw-config-server/resource.go index 3946f51c5..6c43ed3d4 100644 --- a/examples/xds-sotw-config-server/resource.go +++ b/examples/xds-sotw-config-server/resource.go @@ -23,6 +23,7 @@ import ( func makeRlsConfig() []types.Resource { return []types.Resource{ &rls_config.RateLimitConfig{ + Name: "mongo_cps", Domain: "mongo_cps", Descriptors: []*rls_config.RateLimitDescriptor{ { @@ -44,6 +45,7 @@ func makeRlsConfig() []types.Resource { }, }, &rls_config.RateLimitConfig{ + Name: "rl", Domain: "rl", Descriptors: []*rls_config.RateLimitDescriptor{ { diff --git a/go.mod b/go.mod index 757950b5d..e80472d09 100644 --- a/go.mod +++ b/go.mod @@ -2,8 +2,8 @@ module github.com/envoyproxy/ratelimit go 1.18 -replace github.com/envoyproxy/go-control-plane => /Users/renuka/git/go-control-plane -// replace github.com/envoyproxy/go-control-plane => github.com/renuka-fernando/go-control-plane v0.0.1 +// TODO: (renuka) Remove this replace once, https://github.com/envoyproxy/go-control-plane/pull/598 is merged +replace github.com/envoyproxy/go-control-plane => github.com/renuka-fernando/go-control-plane v0.0.2 require ( github.com/alicebob/miniredis/v2 v2.23.0 diff --git a/go.sum b/go.sum index 9544de1db..3e27d7812 100644 --- a/go.sum +++ b/go.sum @@ -69,7 +69,6 @@ github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSs github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= github.com/envoyproxy/protoc-gen-validate v0.6.7 h1:qcZcULcd/abmQg6dwigimCNEyi4gg31M/xaciQlDml8= github.com/envoyproxy/protoc-gen-validate v0.6.7/go.mod h1:dyJXwwfPK2VSqiB9Klm1J6romD608Ba7Hij42vrOBCo= -github.com/envoyproxy/ratelimit v1.4.1-0.20220928150143-0b2f4d5fb04b/go.mod h1:qd8mgua4nBCzIWo+ClmfUqGxFEu+Tm9/CDCs5XRFUsA= github.com/fsnotify/fsnotify v1.4.9 h1:hsms1Qyu0jgnwNXIxa+/V/PDsU6CfLf6CNO8H7IWoS4= github.com/fsnotify/fsnotify v1.4.9/go.mod h1:znqG4EE+3YCdAaPaxE2ZRY/06pZUdp0tY4IgpuI1SZQ= github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= @@ -185,6 +184,8 @@ github.com/pkg/sftp v1.10.1/go.mod h1:lYOWFsE0bwd1+KfKJaKeuokY15vzFx25BLbzYYoAxZ github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= github.com/prometheus/client_model v0.2.0/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= +github.com/renuka-fernando/go-control-plane v0.0.2 h1:tvvR+mkPz7ab2JZ5N6TQ/V3TOue8PmtTbuMuZxqVKbU= +github.com/renuka-fernando/go-control-plane v0.0.2/go.mod h1:fJJn/j26vwOu972OllsvAgJJM//w9BV6Fxbg2LuVd34= github.com/rogpeppe/fastuuid v1.2.0/go.mod h1:jVj6XXZzXRy/MSR5jhDC/2q6DgLz+nrA6LYCDYWNEvQ= github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= github.com/sirupsen/logrus v1.4.2/go.mod h1:tLMulIdttU9McNUspp0xgXVQah82FyeX6MwdIuYE2rE= @@ -367,12 +368,10 @@ golang.org/x/sys v0.0.0-20210330210617-4fbd30eecc44/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210423185535-09eb48e85fd7/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210510120138-977fb7262007/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210816183151-1e6c022a8912/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220728004956-3c1f35247d10 h1:WIoqL4EROvwiPdUtaip4VcDdpZ4kha7wBWZrbVKCIZg= golang.org/x/sys v0.0.0-20220728004956-3c1f35247d10/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= -golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= diff --git a/src/config/config_impl.go b/src/config/config_impl.go index aea2c7a69..f131d50c2 100644 --- a/src/config/config_impl.go +++ b/src/config/config_impl.go @@ -232,8 +232,8 @@ func validateYamlKeys(fileName string, config_map map[interface{}]interface{}) { } } -// Load a single YAML config file into the global config. -// @param config specifies the file contents to load. +// Load a single YAML config into the global config. +// @param config specifies the yamlRoot struct to load. func (this *rateLimitConfigImpl) loadConfig(config RateLimitConfigToLoad) { root := config.ConfigYaml @@ -341,6 +341,9 @@ func descriptorKey(domain string, descriptor *pb_struct.RateLimitDescriptor) str return domain + "." + rateLimitKey } +// ConfigFileContentToYaml converts a single YAML (string content) into yamlRoot struct with validating yaml keys. +// @param fileName specifies the name of the file. +// @param content specifies the string content of the yaml file. func ConfigFileContentToYaml(fileName, content string) *yamlRoot { // validate keys in config with generic map any := map[interface{}]interface{}{} diff --git a/src/provider/provider.go b/src/provider/provider.go index fcc0546fb..a4cade4ca 100644 --- a/src/provider/provider.go +++ b/src/provider/provider.go @@ -4,8 +4,14 @@ import ( "github.com/envoyproxy/ratelimit/src/config" ) +// RateLimitConfigProvider is the interface for configurations providers. type RateLimitConfigProvider interface { + // ConfigUpdateEvent returns a receive-only channel for retrieve configuration updates + // The provider implementer should send config update to this channel when it detect a config update + // Config receiver waits for configuration updates ConfigUpdateEvent() <-chan ConfigUpdateEvent + + // Stop stops the configuration provider watch for configurations. Stop() } diff --git a/src/provider/xds_grpc_sotw_provider.go b/src/provider/xds_grpc_sotw_provider.go index 74ac6f17a..c5b4a2074 100644 --- a/src/provider/xds_grpc_sotw_provider.go +++ b/src/provider/xds_grpc_sotw_provider.go @@ -25,39 +25,45 @@ import ( grpcStatus "google.golang.org/grpc/status" rls_conf_v3 "github.com/envoyproxy/go-control-plane/ratelimit/config/ratelimit/v3" - // rls_svc_v3 "github.com/envoyproxy/go-control-plane/ratelimit/service/ratelimit/v3" ) const ( configTypeURL string = "type.googleapis.com/ratelimit.config.ratelimit.v3.RateLimitConfig" ) +// XdsGrpcSotwProvider is the xDS provider which implements `RateLimitConfigProvider` interface. type XdsGrpcSotwProvider struct { settings settings.Settings loader config.RateLimitConfigLoader configUpdateEventChan chan ConfigUpdateEvent statsManager stats.Manager - // xdsStream rls_svc_v3.RateLimitConfigDiscoveryService_StreamRlsConfigsClient - xdsStream discovery.AggregatedDiscoveryService_StreamAggregatedResourcesClient + ctx context.Context + // xdsStream is the ADS stream client + xdsStream discovery.AggregatedDiscoveryService_StreamAggregatedResourcesClient + // lastAckedResponse is the last response acked by the rate limit service lastAckedResponse *discovery.DiscoveryResponse - // TODO: (renuka) lastAckedResponse and lastReceivedResponse are equal + // lastReceivedResponse is the last response received from xDS server lastReceivedResponse *discovery.DiscoveryResponse - // If a connection error occurs, true event would be returned + // connectionRetryChannel is the channel which trigger true for connection issues connectionRetryChannel chan bool } +// NewXdsGrpcSotwProvider initializes xDS listener and returns the xDS provider. func NewXdsGrpcSotwProvider(settings settings.Settings, statsManager stats.Manager) RateLimitConfigProvider { - return &XdsGrpcSotwProvider{ + p := &XdsGrpcSotwProvider{ settings: settings, statsManager: statsManager, + ctx: context.Background(), configUpdateEventChan: make(chan ConfigUpdateEvent), connectionRetryChannel: make(chan bool), loader: config.NewRateLimitConfigLoaderImpl(), } + go p.initXdsClient() + return p } +// ConfigUpdateEvent returns config provider channel func (p *XdsGrpcSotwProvider) ConfigUpdateEvent() <-chan ConfigUpdateEvent { - go p.initXdsClient() return p.configUpdateEventChan } @@ -84,14 +90,13 @@ func (p *XdsGrpcSotwProvider) initializeAndWatch() *grpc.ClientConn { conn, err := p.initConnection() if err != nil { p.connectionRetryChannel <- true - return conn + return nil } go p.watchConfigs() - // TODO: (renuka) check this, no nil for all cases var lastAppliedVersion string if p.lastAckedResponse != nil { - // If the connection is interrupted in the middle, we need to apply if the version remains same + // If the connection is interrupted in the middle, apply the previously applied version lastAppliedVersion = p.lastAckedResponse.VersionInfo } else { lastAppliedVersion = "" @@ -177,9 +182,10 @@ func (p *XdsGrpcSotwProvider) getGrpcTransportCredentials() grpc.DialOption { func (p *XdsGrpcSotwProvider) sendConfigs(resources []*any.Any) { defer func() { - err := recover() - logger.Errorf("Error applying xDS configuration: %v", err) - p.nack(fmt.Sprint(err)) + if e := recover(); e != nil { + p.configUpdateEventChan <- &ConfigUpdateEventImpl{err: e} + p.nack(fmt.Sprint(e)) + } }() conf := make([]config.RateLimitConfigToLoad, 0, len(resources)) @@ -192,8 +198,6 @@ func (p *XdsGrpcSotwProvider) sendConfigs(resources []*any.Any) { return } - logger.Infof("RENUKA TEST: %v", confPb) - configYaml := config.ConfigXdsProtoToYaml(confPb) conf = append(conf, config.RateLimitConfigToLoad{Name: confPb.Name, ConfigYaml: configYaml}) } diff --git a/src/service/ratelimit.go b/src/service/ratelimit.go index bb28e7412..7bcecd33a 100644 --- a/src/service/ratelimit.go +++ b/src/service/ratelimit.go @@ -49,7 +49,7 @@ type service struct { globalShadowMode bool } -func (this *service) reloadConfig(updateEvent provider.ConfigUpdateEvent) { +func (this *service) setConfig(updateEvent provider.ConfigUpdateEvent) { newConfig, err := updateEvent.GetConfig() if err != nil { configError, ok := err.(config.RateLimitConfigError) @@ -58,7 +58,7 @@ func (this *service) reloadConfig(updateEvent provider.ConfigUpdateEvent) { } this.stats.ConfigLoadError.Inc() - logger.Errorf("error loading new configuration from runtime: %s", configError.Error()) + logger.Errorf("Error loading new configuration: %s", configError.Error()) return } @@ -80,6 +80,7 @@ func (this *service) reloadConfig(updateEvent provider.ConfigUpdateEvent) { this.customHeaderResetHeader = rlSettings.HeaderRatelimitReset } this.configLock.Unlock() + logger.Info("Successfully loaded new configuration") } type serviceError string @@ -314,31 +315,18 @@ func NewService(cache limiter.RateLimitCache, configProvider provider.RateLimitC if !forceStart { logger.Info("Waiting for initial ratelimit config update event") - newService.reloadConfig(<-newService.configUpdateEvent) + newService.setConfig(<-newService.configUpdateEvent) logger.Info("Successfully loaded the initial ratelimit configs") } go func() { for { - logger.Debug("Waiting for config update") + logger.Debug("Waiting for config update event") updateEvent := <-newService.configUpdateEvent - logger.Debug("Got config update and reloading config") - newService.reloadConfig(updateEvent) + logger.Debug("Setting config retrieved from config provider") + newService.setConfig(updateEvent) } }() - // runtime.AddUpdateCallback(newService.runtimeUpdateEvent) - - // newService.reloadConfig(statsManager) - // go func() { - // // No exit right now. - // for { - // logger.Debugf("waiting for runtime update") - // <-newService.runtimeUpdateEvent - // logger.Debugf("got runtime update and reloading config") - // newService.reloadConfig(statsManager) - // } - // }() - return newService } diff --git a/src/settings/settings.go b/src/settings/settings.go index 7cb085c77..b06039ead 100644 --- a/src/settings/settings.go +++ b/src/settings/settings.go @@ -57,7 +57,6 @@ type Settings struct { ConfigGrpcXdsNodeId string `envconfig:"CONFIG_GRPC_XDS_NODE_ID" default:"default"` ConfigGrpcXdsServerUrl string `envconfig:"CONFIG_GRPC_XDS_SERVER_URL" default:"localhost:18000"` ConfigGrpcXdsServerConnectRetryInterval time.Duration `envconfig:"CONFIG_GRPC_XDS_SERVER_CONNECT_RETRY_INTERVAL" default:"3s"` - ConfigGrpcXdsServerConnectTimeout time.Duration `envconfig:"CONFIG_GRPC_XDS_SERVER_CONNECT_TIMEOUT" default:"3s"` // xDS config server TLS configurations ConfigGrpcXdsTlsConfig *tls.Config diff --git a/test/common/xds_sotw.go b/test/common/xds_sotw.go index fa93f48d1..1b214531e 100644 --- a/test/common/xds_sotw.go +++ b/test/common/xds_sotw.go @@ -26,7 +26,7 @@ func StartXdsSotwServer(t *testing.T, config *XdsServerConfig, initSnapshot *cac ctx, cancel := context.WithCancel(context.Background()) - snapCache := cache.NewSnapshotCache(true, cache.IDHash{}, nil) // TODO: marked as true + snapCache := cache.NewSnapshotCache(true, cache.IDHash{}, nil) if err := initSnapshot.Consistent(); err != nil { t.Errorf("Error checking consistency in initial snapshot: %v", err) } diff --git a/test/integration/xds_sotw_integration_test.go b/test/integration/xds_sotw_integration_test.go index 0cc2a62e3..01f435838 100644 --- a/test/integration/xds_sotw_integration_test.go +++ b/test/integration/xds_sotw_integration_test.go @@ -48,73 +48,75 @@ func initialXdsBasicConfig() map[resource.Type][]types.Resource { return map[resource.Type][]types.Resource{ resource.RateLimitConfigType: { &rls_config.RateLimitConfig{ + Name: "basic", Domain: "basic", Descriptors: []*rls_config.RateLimitDescriptor{ { Key: "key1", RateLimit: &rls_config.RateLimitPolicy{ - Unit: "second", + Unit: rls_config.RateLimitUnit_SECOND, RequestsPerUnit: 50, }, }, { Key: "key1_local", RateLimit: &rls_config.RateLimitPolicy{ - Unit: "second", + Unit: rls_config.RateLimitUnit_SECOND, RequestsPerUnit: 50, }, }, { Key: "one_per_minute", RateLimit: &rls_config.RateLimitPolicy{ - Unit: "minute", + Unit: rls_config.RateLimitUnit_MINUTE, RequestsPerUnit: 1, }, }, }, }, &rls_config.RateLimitConfig{ + Name: "another", Domain: "another", Descriptors: []*rls_config.RateLimitDescriptor{ { Key: "key2", RateLimit: &rls_config.RateLimitPolicy{ - Unit: "minute", + Unit: rls_config.RateLimitUnit_MINUTE, RequestsPerUnit: 20, }, }, { Key: "key3", RateLimit: &rls_config.RateLimitPolicy{ - Unit: "hour", + Unit: rls_config.RateLimitUnit_HOUR, RequestsPerUnit: 10, }, }, { Key: "key2_local", RateLimit: &rls_config.RateLimitPolicy{ - Unit: "minute", + Unit: rls_config.RateLimitUnit_MINUTE, RequestsPerUnit: 20, }, }, { Key: "key3_local", RateLimit: &rls_config.RateLimitPolicy{ - Unit: "hour", + Unit: rls_config.RateLimitUnit_HOUR, RequestsPerUnit: 10, }, }, { Key: "key4", RateLimit: &rls_config.RateLimitPolicy{ - Unit: "day", + Unit: rls_config.RateLimitUnit_DAY, RequestsPerUnit: 20, }, }, { Key: "key4_local", RateLimit: &rls_config.RateLimitPolicy{ - Unit: "day", + Unit: rls_config.RateLimitUnit_DAY, RequestsPerUnit: 20, }, }, @@ -128,26 +130,27 @@ func newConfigWithXdsConfigProvider(setSnapshotFunc common.SetSnapshotFunc) func initConfig := initialXdsBasicConfig() rlsConf := initConfig[resource.RateLimitConfigType] newRlsConf := append(rlsConf, &rls_config.RateLimitConfig{ + Name: "reload", Domain: "reload", Descriptors: []*rls_config.RateLimitDescriptor{ { Key: "key1", RateLimit: &rls_config.RateLimitPolicy{ - Unit: "second", + Unit: rls_config.RateLimitUnit_SECOND, RequestsPerUnit: 50, }, }, { Key: "block", RateLimit: &rls_config.RateLimitPolicy{ - Unit: "second", + Unit: rls_config.RateLimitUnit_SECOND, RequestsPerUnit: 0, }, }, { Key: "one_per_minute", RateLimit: &rls_config.RateLimitPolicy{ - Unit: "minute", + Unit: rls_config.RateLimitUnit_MINUTE, RequestsPerUnit: 1, }, }, diff --git a/test/provider/xds_grpc_sotw_provider_test.go b/test/provider/xds_grpc_sotw_provider_test.go index 4f2d08c69..49a124bdf 100644 --- a/test/provider/xds_grpc_sotw_provider_test.go +++ b/test/provider/xds_grpc_sotw_provider_test.go @@ -19,7 +19,6 @@ import ( "github.com/envoyproxy/ratelimit/test/mocks/stats" rls_config "github.com/envoyproxy/go-control-plane/ratelimit/config/ratelimit/v3" - // ratelimitservice "github.com/envoyproxy/go-control-plane/ratelimit/service/ratelimit/v3" ) const ( diff --git a/test/service/ratelimit_test.go b/test/service/ratelimit_test.go index 021d7b3c4..d90a8ce2f 100644 --- a/test/service/ratelimit_test.go +++ b/test/service/ratelimit_test.go @@ -133,10 +133,6 @@ func TestService(test *testing.T) { t.assert.Nil(err) // Force a config reload - config event from config provider. - // t.configLoader.EXPECT().Load( - // []config.RateLimitConfigToLoad{{Name: "config.basic_config", FileBytes: "fake_yaml"}}, gomock.Any(), gomock.Any()).Do( - // func([]config.RateLimitConfigToLoad, stats.Manager, bool) { barrier.signal() }).Return(t.config) - // t.runtimeUpdateCallback <- 1 t.configUpdateEvent.EXPECT().GetConfig().DoAndReturn(func() (config.RateLimitConfig, any) { barrier.signal() return t.config, nil @@ -178,13 +174,6 @@ func TestService(test *testing.T) { }) t.configUpdateEventChan <- t.configUpdateEvent barrier.wait() - // t.configLoader.EXPECT().Load( - // []config.RateLimitConfigToLoad{{Name: "config.basic_config", FileBytes: "fake_yaml"}}, gomock.Any(), gomock.Any()).Do( - // func([]config.RateLimitConfigToLoad, stats.Manager, bool) { - // defer barrier.signal() - // panic(config.RateLimitConfigError("load error")) - // }) - // t.runtimeUpdateCallback <- 1 // Config should still be valid. Also make sure order does not affect results. limits = []*config.RateLimit{ @@ -236,11 +225,6 @@ func TestServiceGlobalShadowMode(test *testing.T) { }) t.configUpdateEventChan <- t.configUpdateEvent barrier.wait() - // t.configLoader.EXPECT().Load( - // []config.RateLimitConfigToLoad{{Name: "config.basic_config", FileBytes: "fake_yaml"}}, gomock.Any(), gomock.Any()).Do( - // func([]config.RateLimitConfigToLoad, stats.Manager, bool) { barrier.signal() }).Return(t.config) - // t.runtimeUpdateCallback <- 1 - // barrier.wait() // Make a request. request := common.NewRateLimitRequest( @@ -376,11 +360,6 @@ func TestServiceWithCustomRatelimitHeaders(test *testing.T) { }) t.configUpdateEventChan <- t.configUpdateEvent barrier.wait() - // t.configLoader.EXPECT().Load( - // []config.RateLimitConfigToLoad{{Name: "config.basic_config", FileBytes: "fake_yaml"}}, gomock.Any(), gomock.Any()).Do( - // func([]config.RateLimitConfigToLoad, stats.Manager, bool) { barrier.signal() }).Return(t.config) - // t.runtimeUpdateCallback <- 1 - // barrier.wait() // Make request request := common.NewRateLimitRequest( @@ -434,11 +413,6 @@ func TestServiceWithDefaultRatelimitHeaders(test *testing.T) { }) t.configUpdateEventChan <- t.configUpdateEvent barrier.wait() - // t.configLoader.EXPECT().Load( - // []config.RateLimitConfigToLoad{{Name: "config.basic_config", FileBytes: "fake_yaml"}}, gomock.Any(), gomock.Any()).Do( - // func([]config.RateLimitConfigToLoad, stats.Manager, bool) { barrier.signal() }).Return(t.config) - // t.runtimeUpdateCallback <- 1 - // barrier.wait() // Make request request := common.NewRateLimitRequest( From b591364a355927e21156f1168b7439b2a2f5d8ef Mon Sep 17 00:00:00 2001 From: Renuka Fernando Date: Fri, 28 Oct 2022 14:39:34 +0530 Subject: [PATCH 17/22] Using ADS client from GCP Signed-off-by: Renuka Fernando --- go.mod | 4 +- go.sum | 7 +- src/provider/xds_grpc_sotw_provider.go | 131 ++++++------------------- 3 files changed, 36 insertions(+), 106 deletions(-) diff --git a/go.mod b/go.mod index e80472d09..0fbd43f98 100644 --- a/go.mod +++ b/go.mod @@ -3,7 +3,7 @@ module github.com/envoyproxy/ratelimit go 1.18 // TODO: (renuka) Remove this replace once, https://github.com/envoyproxy/go-control-plane/pull/598 is merged -replace github.com/envoyproxy/go-control-plane => github.com/renuka-fernando/go-control-plane v0.0.2 +replace github.com/envoyproxy/go-control-plane => github.com/renuka-fernando/go-control-plane v0.0.3 require ( github.com/alicebob/miniredis/v2 v2.23.0 @@ -22,7 +22,6 @@ require ( github.com/sirupsen/logrus v1.6.0 github.com/stretchr/testify v1.7.1 golang.org/x/net v0.0.0-20220909164309-bea034e7d591 - google.golang.org/genproto v0.0.0-20220329172620-7be39ac1afc7 google.golang.org/grpc v1.45.0 google.golang.org/protobuf v1.28.0 gopkg.in/yaml.v2 v2.3.0 @@ -37,6 +36,7 @@ require ( github.com/grpc-ecosystem/grpc-gateway/v2 v2.7.0 // indirect go.opentelemetry.io/otel/exporters/otlp/internal/retry v1.6.3 // indirect golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1 // indirect + google.golang.org/genproto v0.0.0-20220329172620-7be39ac1afc7 // indirect gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c // indirect ) diff --git a/go.sum b/go.sum index 3e27d7812..56ec3f4d0 100644 --- a/go.sum +++ b/go.sum @@ -69,6 +69,7 @@ github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSs github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= github.com/envoyproxy/protoc-gen-validate v0.6.7 h1:qcZcULcd/abmQg6dwigimCNEyi4gg31M/xaciQlDml8= github.com/envoyproxy/protoc-gen-validate v0.6.7/go.mod h1:dyJXwwfPK2VSqiB9Klm1J6romD608Ba7Hij42vrOBCo= +github.com/envoyproxy/ratelimit v1.4.1-0.20220928150143-0b2f4d5fb04b/go.mod h1:qd8mgua4nBCzIWo+ClmfUqGxFEu+Tm9/CDCs5XRFUsA= github.com/fsnotify/fsnotify v1.4.9 h1:hsms1Qyu0jgnwNXIxa+/V/PDsU6CfLf6CNO8H7IWoS4= github.com/fsnotify/fsnotify v1.4.9/go.mod h1:znqG4EE+3YCdAaPaxE2ZRY/06pZUdp0tY4IgpuI1SZQ= github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= @@ -184,8 +185,8 @@ github.com/pkg/sftp v1.10.1/go.mod h1:lYOWFsE0bwd1+KfKJaKeuokY15vzFx25BLbzYYoAxZ github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= github.com/prometheus/client_model v0.2.0/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= -github.com/renuka-fernando/go-control-plane v0.0.2 h1:tvvR+mkPz7ab2JZ5N6TQ/V3TOue8PmtTbuMuZxqVKbU= -github.com/renuka-fernando/go-control-plane v0.0.2/go.mod h1:fJJn/j26vwOu972OllsvAgJJM//w9BV6Fxbg2LuVd34= +github.com/renuka-fernando/go-control-plane v0.0.3 h1:2sgFlqaeYKkI26NSiSGb65mJO1wITmy++VcSGAevVCc= +github.com/renuka-fernando/go-control-plane v0.0.3/go.mod h1:b1r8wC2S/Nhq2WfGQPdQShAJVYLCIPtnHrUnw/oy+Xs= github.com/rogpeppe/fastuuid v1.2.0/go.mod h1:jVj6XXZzXRy/MSR5jhDC/2q6DgLz+nrA6LYCDYWNEvQ= github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= github.com/sirupsen/logrus v1.4.2/go.mod h1:tLMulIdttU9McNUspp0xgXVQah82FyeX6MwdIuYE2rE= @@ -368,10 +369,12 @@ golang.org/x/sys v0.0.0-20210330210617-4fbd30eecc44/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210423185535-09eb48e85fd7/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210510120138-977fb7262007/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210816183151-1e6c022a8912/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220728004956-3c1f35247d10 h1:WIoqL4EROvwiPdUtaip4VcDdpZ4kha7wBWZrbVKCIZg= golang.org/x/sys v0.0.0-20220728004956-3c1f35247d10/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= +golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= diff --git a/src/provider/xds_grpc_sotw_provider.go b/src/provider/xds_grpc_sotw_provider.go index c5b4a2074..2b1d99c0b 100644 --- a/src/provider/xds_grpc_sotw_provider.go +++ b/src/provider/xds_grpc_sotw_provider.go @@ -3,14 +3,11 @@ package provider import ( "context" "fmt" - "io" - core "github.com/envoyproxy/go-control-plane/envoy/config/core/v3" - discovery "github.com/envoyproxy/go-control-plane/envoy/service/discovery/v3" + "github.com/envoyproxy/go-control-plane/pkg/resource/v3" "github.com/golang/protobuf/ptypes/any" grpc_retry "github.com/grpc-ecosystem/go-grpc-middleware/retry" logger "github.com/sirupsen/logrus" - "google.golang.org/genproto/googleapis/rpc/status" "google.golang.org/grpc" "google.golang.org/grpc/credentials" "google.golang.org/grpc/credentials/insecure" @@ -21,16 +18,10 @@ import ( "github.com/envoyproxy/ratelimit/src/settings" "github.com/envoyproxy/ratelimit/src/stats" - "google.golang.org/grpc/codes" - grpcStatus "google.golang.org/grpc/status" - + "github.com/envoyproxy/go-control-plane/pkg/adsclient/sotw/v3" rls_conf_v3 "github.com/envoyproxy/go-control-plane/ratelimit/config/ratelimit/v3" ) -const ( - configTypeURL string = "type.googleapis.com/ratelimit.config.ratelimit.v3.RateLimitConfig" -) - // XdsGrpcSotwProvider is the xDS provider which implements `RateLimitConfigProvider` interface. type XdsGrpcSotwProvider struct { settings settings.Settings @@ -38,25 +29,22 @@ type XdsGrpcSotwProvider struct { configUpdateEventChan chan ConfigUpdateEvent statsManager stats.Manager ctx context.Context - // xdsStream is the ADS stream client - xdsStream discovery.AggregatedDiscoveryService_StreamAggregatedResourcesClient - // lastAckedResponse is the last response acked by the rate limit service - lastAckedResponse *discovery.DiscoveryResponse - // lastReceivedResponse is the last response received from xDS server - lastReceivedResponse *discovery.DiscoveryResponse + adsClient sotw.AdsClient // connectionRetryChannel is the channel which trigger true for connection issues connectionRetryChannel chan bool } // NewXdsGrpcSotwProvider initializes xDS listener and returns the xDS provider. func NewXdsGrpcSotwProvider(settings settings.Settings, statsManager stats.Manager) RateLimitConfigProvider { + ctx := context.Background() p := &XdsGrpcSotwProvider{ settings: settings, statsManager: statsManager, - ctx: context.Background(), + ctx: ctx, configUpdateEventChan: make(chan ConfigUpdateEvent), connectionRetryChannel: make(chan bool), loader: config.NewRateLimitConfigLoaderImpl(), + adsClient: sotw.NewAdsClient(ctx, settings.ConfigGrpcXdsNodeId, resource.RateLimitConfigType), } go p.initXdsClient() return p @@ -74,6 +62,7 @@ func (p *XdsGrpcSotwProvider) Stop() { func (p *XdsGrpcSotwProvider) initXdsClient() { logger.Info("Starting xDS client connection for rate limit configurations") conn := p.initializeAndWatch() + for retryEvent := range p.connectionRetryChannel { if conn != nil { conn.Close() @@ -87,77 +76,39 @@ func (p *XdsGrpcSotwProvider) initXdsClient() { } func (p *XdsGrpcSotwProvider) initializeAndWatch() *grpc.ClientConn { - conn, err := p.initConnection() + conn, err := p.getGrpcConnection() if err != nil { - p.connectionRetryChannel <- true + logger.Errorf("Error initializing gRPC connection to xDS Management Server: %s", err.Error()) + p.retryGrpcConn() return nil } - go p.watchConfigs() - var lastAppliedVersion string - if p.lastAckedResponse != nil { - // If the connection is interrupted in the middle, apply the previously applied version - lastAppliedVersion = p.lastAckedResponse.VersionInfo - } else { - lastAppliedVersion = "" - } - discoveryRequest := &discovery.DiscoveryRequest{ - Node: &core.Node{Id: p.settings.ConfigGrpcXdsNodeId}, - VersionInfo: lastAppliedVersion, - TypeUrl: configTypeURL, - } - p.xdsStream.Send(discoveryRequest) + logger.Info("Connection to xDS Management Server is successful") + p.adsClient.InitConnect(conn) + go p.watchConfigs() return conn } func (p *XdsGrpcSotwProvider) watchConfigs() { for { - discoveryResponse, err := p.xdsStream.Recv() - if err == io.EOF { - // reinitialize again, if stream ends - logger.Error("EOF is received from xDS Configuration Server") - p.connectionRetryChannel <- true - return - } + resp, err := p.adsClient.Fetch() if err != nil { - logger.Errorf("Failed to receive the discovery response from xDS Configuration Server: %s", err.Error()) - errStatus, _ := grpcStatus.FromError(err) - if errStatus.Code() == codes.Unavailable || errStatus.Code() == codes.Canceled { - logger.Errorf("Connection error. errorCode: %s errorMessage: %s", - errStatus.Code().String(), errStatus.Message()) - p.connectionRetryChannel <- true + logger.Errorf("Failed to receive configuration from xDS Management Server: %s", err.Error()) + if sotw.IsConnError(err) { + p.retryGrpcConn() return } - logger.Errorf("Error while xDS communication; errorCode: %s errorMessage: %s", - errStatus.Code().String(), errStatus.Message()) - p.nack(errStatus.Message()) + p.adsClient.Nack(err.Error()) } else { - p.lastReceivedResponse = discoveryResponse - logger.Debugf("Discovery response is received from xDS Configuration Server with response version: %s", discoveryResponse.VersionInfo) - logger.Tracef("Discovery response received from xDS Configuration Server: %v", discoveryResponse) - p.sendConfigs(discoveryResponse.Resources) + logger.Tracef("Response received from xDS Management Server: %v", resp) + p.sendConfigs(resp.Resources) } } } -func (p *XdsGrpcSotwProvider) initConnection() (*grpc.ClientConn, error) { - conn, err := p.getGrpcConnection() - if err != nil { - logger.Errorf("Error initializing gRPC connection to xDS Configuration Server: %s", err.Error()) - return nil, err - } - p.xdsStream, err = discovery.NewAggregatedDiscoveryServiceClient(conn).StreamAggregatedResources(context.Background()) - if err != nil { - logger.Errorf("Error initializing gRPC stream to xDS Configuration Server: %s", err.Error()) - return nil, err - } - logger.Info("Connection to xDS Configuration Server is successful") - return conn, nil -} - func (p *XdsGrpcSotwProvider) getGrpcConnection() (*grpc.ClientConn, error) { backOff := grpc_retry.BackoffLinearWithJitter(p.settings.ConfigGrpcXdsServerConnectRetryInterval, 0.5) - logger.Infof("Dialing xDS Configuration Server: '%s'", p.settings.ConfigGrpcXdsServerUrl) + logger.Infof("Dialing xDS Management Server: '%s'", p.settings.ConfigGrpcXdsServerUrl) return grpc.Dial( p.settings.ConfigGrpcXdsServerUrl, p.getGrpcTransportCredentials(), @@ -174,7 +125,7 @@ func (p *XdsGrpcSotwProvider) getGrpcTransportCredentials() grpc.DialOption { configGrpcXdsTlsConfig := p.settings.ConfigGrpcXdsTlsConfig if p.settings.ConfigGrpcXdsServerTlsSAN != "" { - logger.Infof("ServerName used for xDS configuration service hostname verification is %s", p.settings.ConfigGrpcXdsServerTlsSAN) + logger.Infof("ServerName used for xDS Management Service hostname verification is %s", p.settings.ConfigGrpcXdsServerTlsSAN) configGrpcXdsTlsConfig.ServerName = p.settings.ConfigGrpcXdsServerTlsSAN } return grpc.WithTransportCredentials(credentials.NewTLS(configGrpcXdsTlsConfig)) @@ -184,17 +135,17 @@ func (p *XdsGrpcSotwProvider) sendConfigs(resources []*any.Any) { defer func() { if e := recover(); e != nil { p.configUpdateEventChan <- &ConfigUpdateEventImpl{err: e} - p.nack(fmt.Sprint(e)) + p.adsClient.Nack(fmt.Sprint(e)) } }() conf := make([]config.RateLimitConfigToLoad, 0, len(resources)) for _, res := range resources { confPb := &rls_conf_v3.RateLimitConfig{} - err := anypb.UnmarshalTo(res, confPb, proto.UnmarshalOptions{}) // err := ptypes.UnmarshalAny(res, config) + err := anypb.UnmarshalTo(res, confPb, proto.UnmarshalOptions{}) if err != nil { - logger.Errorf("Error while unmarshalling config from xDS Configuration Server: %s", err.Error()) - p.nack(err.Error()) + logger.Errorf("Error while unmarshalling config from xDS Management Server: %s", err.Error()) + p.adsClient.Nack(err.Error()) return } @@ -204,33 +155,9 @@ func (p *XdsGrpcSotwProvider) sendConfigs(resources []*any.Any) { rlSettings := settings.NewSettings() rlsConf := p.loader.Load(conf, p.statsManager, rlSettings.MergeDomainConfigurations) p.configUpdateEventChan <- &ConfigUpdateEventImpl{config: rlsConf} - p.ack() + p.adsClient.Ack() } -func (p *XdsGrpcSotwProvider) ack() { - p.lastAckedResponse = p.lastReceivedResponse - discoveryRequest := &discovery.DiscoveryRequest{ - Node: &core.Node{Id: p.settings.ConfigGrpcXdsNodeId}, - VersionInfo: p.lastAckedResponse.VersionInfo, - TypeUrl: configTypeURL, - ResponseNonce: p.lastReceivedResponse.Nonce, - } - p.xdsStream.Send(discoveryRequest) -} - -func (p *XdsGrpcSotwProvider) nack(errorMessage string) { - discoveryRequest := &discovery.DiscoveryRequest{ - Node: &core.Node{Id: p.settings.ConfigGrpcXdsNodeId}, - TypeUrl: configTypeURL, - ErrorDetail: &status.Status{ - Message: errorMessage, - }, - } - if p.lastAckedResponse != nil { - discoveryRequest.VersionInfo = p.lastAckedResponse.VersionInfo - } - if p.lastReceivedResponse != nil { - discoveryRequest.ResponseNonce = p.lastReceivedResponse.Nonce - } - p.xdsStream.Send(discoveryRequest) +func (p *XdsGrpcSotwProvider) retryGrpcConn() { + p.connectionRetryChannel <- true } From 192cd92dee352ac32cb1959a35c1b811193039ad Mon Sep 17 00:00:00 2001 From: Renuka Fernando Date: Wed, 30 Nov 2022 10:14:54 +0530 Subject: [PATCH 18/22] Correct the config name 'CONFIG_GRPC_XDS_SERVER_TLS_SAN' Signed-off-by: Renuka Fernando --- README.md | 2 +- src/settings/settings.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 2afb4f997..42502ef93 100644 --- a/README.md +++ b/README.md @@ -594,7 +594,7 @@ As well Ratelimit supports TLS connections, these can be configured using the fo 1. `CONFIG_GRPC_XDS_SERVER_USE_TLS`: set to `"true"` to enable a TLS connection with the xDS configuration management server. 2. `CONFIG_GRPC_XDS_CLIENT_TLS_CERT`, `CONFIG_GRPC_XDS_CLIENT_TLS_KEY`, and `CONFIG_GRPC_XDS_SERVER_TLS_CACERT` to provides files to specify a TLS connection configuration to the xDS configuration management server. -3. `GRPC_CLIENT_TLS_SAN`: Override the SAN value to validate from the server certificate. +3. `CONFIG_GRPC_XDS_SERVER_TLS_SAN`: (Optional) Override the SAN value to validate from the server certificate. ## Log Format diff --git a/src/settings/settings.go b/src/settings/settings.go index b06039ead..ab4d187f4 100644 --- a/src/settings/settings.go +++ b/src/settings/settings.go @@ -65,7 +65,7 @@ type Settings struct { ConfigGrpcXdsClientTlsKey string `envconfig:"CONFIG_GRPC_XDS_CLIENT_TLS_KEY" default:""` ConfigGrpcXdsServerTlsCACert string `envconfig:"CONFIG_GRPC_XDS_SERVER_TLS_CACERT" default:""` // GrpcClientTlsSAN is the SAN to validate from the client cert during mTLS auth - ConfigGrpcXdsServerTlsSAN string `envconfig:"GRPC_CLIENT_TLS_SAN" default:""` + ConfigGrpcXdsServerTlsSAN string `envconfig:"CONFIG_GRPC_XDS_SERVER_TLS_SAN" default:""` // Stats-related settings UseStatsd bool `envconfig:"USE_STATSD" default:"true"` From f8f0e4aa3d55506f457dbd9a612b3e8d7c4a9cf1 Mon Sep 17 00:00:00 2001 From: Renuka Fernando Date: Fri, 27 Jan 2023 22:07:27 +0530 Subject: [PATCH 19/22] Update go-control-plane version which contains ADS Client implementation Signed-off-by: Renuka Fernando --- go.mod | 27 ++++---- go.sum | 94 ++++++++++++++------------ src/provider/xds_grpc_sotw_provider.go | 25 ++++++- src/settings/settings.go | 1 + 4 files changed, 85 insertions(+), 62 deletions(-) diff --git a/go.mod b/go.mod index c6571bb8e..3ed667266 100644 --- a/go.mod +++ b/go.mod @@ -2,14 +2,11 @@ module github.com/envoyproxy/ratelimit go 1.18 -// TODO: (renuka) Remove this replace once, https://github.com/envoyproxy/go-control-plane/pull/598 is merged -replace github.com/envoyproxy/go-control-plane => github.com/renuka-fernando/go-control-plane v0.0.3 - require ( github.com/alicebob/miniredis/v2 v2.23.0 github.com/bradfitz/gomemcache v0.0.0-20190913173617-a41fca850d0b github.com/coocood/freecache v1.1.0 - github.com/envoyproxy/go-control-plane v0.10.1 + github.com/envoyproxy/go-control-plane v0.10.3-0.20230127155013-72157d335c8f github.com/golang/mock v1.4.4 github.com/golang/protobuf v1.5.2 github.com/gorilla/mux v1.7.4-0.20191121170500-49c01487a141 @@ -20,36 +17,36 @@ require ( github.com/lyft/gostats v0.4.1 github.com/mediocregopher/radix/v3 v3.8.1 github.com/sirupsen/logrus v1.6.0 - github.com/stretchr/testify v1.7.1 + github.com/stretchr/testify v1.8.1 golang.org/x/net v0.4.0 - google.golang.org/grpc v1.45.0 - google.golang.org/protobuf v1.28.0 + google.golang.org/grpc v1.52.0 + google.golang.org/protobuf v1.28.1 gopkg.in/yaml.v2 v2.3.0 ) require ( github.com/cenkalti/backoff/v4 v4.1.2 // indirect - github.com/census-instrumentation/opencensus-proto v0.3.0 // indirect + github.com/census-instrumentation/opencensus-proto v0.4.1 // indirect github.com/cncf/xds/go v0.0.0-20220314180256-7f1daf1720fc // indirect github.com/go-logr/logr v1.2.3 // indirect github.com/go-logr/stdr v1.2.2 // indirect - github.com/grpc-ecosystem/grpc-gateway/v2 v2.7.0 // indirect + github.com/grpc-ecosystem/grpc-gateway/v2 v2.11.3 // indirect go.opentelemetry.io/otel/exporters/otlp/internal/retry v1.6.3 // indirect - golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1 // indirect - google.golang.org/genproto v0.0.0-20220329172620-7be39ac1afc7 // indirect - gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c // indirect + golang.org/x/xerrors v0.0.0-20220907171357-04be3eba64a2 // indirect + google.golang.org/genproto v0.0.0-20221118155620-16455021b5e6 // indirect + gopkg.in/yaml.v3 v3.0.1 // indirect ) require ( github.com/alicebob/gopher-json v0.0.0-20200520072559-a9ecdc9d1d3a // indirect github.com/cespare/xxhash v1.1.0 // indirect github.com/davecgh/go-spew v1.1.1 // indirect - github.com/envoyproxy/protoc-gen-validate v0.6.7 // indirect + github.com/envoyproxy/protoc-gen-validate v0.9.1 // indirect github.com/fsnotify/fsnotify v1.4.9 // indirect github.com/google/uuid v1.3.0 github.com/konsorten/go-windows-terminal-sequences v1.0.3 // indirect github.com/pmezard/go-difflib v1.0.0 // indirect - github.com/stretchr/objx v0.2.0 // indirect + github.com/stretchr/objx v0.5.0 // indirect github.com/yuin/gopher-lua v0.0.0-20210529063254-f4c35e4016d9 // indirect go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.31.0 go.opentelemetry.io/otel v1.7.0 @@ -58,7 +55,7 @@ require ( go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.6.3 go.opentelemetry.io/otel/sdk v1.7.0 go.opentelemetry.io/otel/trace v1.7.0 - go.opentelemetry.io/proto/otlp v0.16.0 // indirect + go.opentelemetry.io/proto/otlp v0.19.0 // indirect golang.org/x/sys v0.3.0 // indirect golang.org/x/text v0.5.0 // indirect ) diff --git a/go.sum b/go.sum index 5278a6fb4..efe276bd6 100644 --- a/go.sum +++ b/go.sum @@ -12,14 +12,16 @@ cloud.google.com/go v0.54.0/go.mod h1:1rq2OEkV3YMf6n/9ZvGWI3GWw0VoqH/1x2nd8Is/bP cloud.google.com/go v0.56.0/go.mod h1:jr7tqZxxKOVYizybht9+26Z/gUq7tiRzu+ACVAMbKVk= cloud.google.com/go v0.57.0/go.mod h1:oXiQ6Rzq3RAkkY7N6t3TcE6jE+CIBBbA36lwQ1JyzZs= cloud.google.com/go v0.62.0/go.mod h1:jmCYTdRCQuc1PHIIJ/maLInMho30T/Y0M4hTdTShOYc= -cloud.google.com/go v0.65.0 h1:Dg9iHVQfrhq82rUNu9ZxUDrJLaxFUe/HlCVaLyRruq8= cloud.google.com/go v0.65.0/go.mod h1:O5N8zS7uWy9vkA9vayVHs65eM1ubvY4h553ofrNHObY= +cloud.google.com/go v0.105.0 h1:DNtEKRBAAzeS4KyIory52wWHuClNaXJ5x1F7xa4q+5Y= cloud.google.com/go/bigquery v1.0.1/go.mod h1:i/xbL2UlR5RvWAURpBYZTtm/cXjCha9lbfbpx4poX+o= cloud.google.com/go/bigquery v1.3.0/go.mod h1:PjpwJnslEMmckchkHFfq+HTD2DmtT67aNFKH1/VBDHE= cloud.google.com/go/bigquery v1.4.0/go.mod h1:S8dzgnTigyfTmLBfrtrhyYhwRxG72rYxvftPBK2Dvzc= cloud.google.com/go/bigquery v1.5.0/go.mod h1:snEHRnqQbz117VIFhE8bmtwIDY80NLUZUMb4Nv6dBIg= cloud.google.com/go/bigquery v1.7.0/go.mod h1://okPTzCYNXSlb24MZs83e2Do+h+VXtc4gLoIoXIAPc= cloud.google.com/go/bigquery v1.8.0/go.mod h1:J5hqkt3O0uAFnINi6JXValWIb1v0goeZM77hZzJN/fQ= +cloud.google.com/go/compute v1.12.1 h1:gKVJMEyqV5c/UnpzjjQbo3Rjvvqpr9B1DFSbJC4OXr0= +cloud.google.com/go/compute/metadata v0.2.1 h1:efOwf5ymceDhK6PKMnnrTHP4pppY5L22mle96M1yP48= cloud.google.com/go/datastore v1.0.0/go.mod h1:LXYbyblFSglQ5pkeyhO+Qmw7ukd3C+pD7TKLgZqpHYE= cloud.google.com/go/datastore v1.1.0/go.mod h1:umbIZjpQpHh4hmRpGhH4tLFup+FVzqBi1b3c64qFpCk= cloud.google.com/go/pubsub v1.0.1/go.mod h1:R0Gpsv3s54REJCy4fxDixWD93lHJMoZTyQ2kNxGRt3I= @@ -45,8 +47,9 @@ github.com/bradfitz/gomemcache v0.0.0-20190913173617-a41fca850d0b h1:L/QXpzIa3pO github.com/bradfitz/gomemcache v0.0.0-20190913173617-a41fca850d0b/go.mod h1:H0wQNHz2YrLsuXOZozoeDmnHXkNCRmMW0gwFWDfEZDA= github.com/cenkalti/backoff/v4 v4.1.2 h1:6Yo7N8UP2K6LWZnW94DLVSSrbobcWdVzAYOisuDPIFo= github.com/cenkalti/backoff/v4 v4.1.2/go.mod h1:scbssz8iZGpm3xbr14ovlUdkxfGXNInqkPWOWmG2CLw= -github.com/census-instrumentation/opencensus-proto v0.3.0 h1:t/LhUZLVitR1Ow2YOnduCsavhwFUklBMoGVYUCqmCqk= -github.com/census-instrumentation/opencensus-proto v0.3.0/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= +github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= +github.com/census-instrumentation/opencensus-proto v0.4.1 h1:iKLQ0xPNFxR/2hzXZMrBo8f1j86j5WHzznCCQxV/b8g= +github.com/census-instrumentation/opencensus-proto v0.4.1/go.mod h1:4T9NM4+4Vw91VeyqjLS6ao50K5bOcLKN6Q42XnYaRYw= github.com/cespare/xxhash v1.1.0 h1:a6HrQnmkObjyL+Gs60czilIUGqrzKutQD6XZog3p+ko= github.com/cespare/xxhash v1.1.0/go.mod h1:XrSqR1VqqWfGrhpAt58auRo0WTKS1nRRg3ghfAqPWnc= github.com/cespare/xxhash/v2 v2.1.1/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= @@ -57,6 +60,8 @@ github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDk github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f/go.mod h1:M8M6+tZqaGXZJjfX53e64911xZQV5JYwmTeXPW+k8Sc= github.com/cncf/udpa/go v0.0.0-20201120205902-5459f2c99403/go.mod h1:WmhPx2Nbnhtbo57+VJT5O0JRkEi1Wbu0z5j0R8u5Hbk= github.com/cncf/udpa/go v0.0.0-20210930031921-04548b0d99d4/go.mod h1:6pvJx4me5XPnfI9Z40ddWsdw2W/uZgQLFXToKeRcDiI= +github.com/cncf/xds/go v0.0.0-20210312221358-fbca930ec8ed/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= +github.com/cncf/xds/go v0.0.0-20210805033703-aa0b78936158/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= github.com/cncf/xds/go v0.0.0-20210922020428-25de7278fc84/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= github.com/cncf/xds/go v0.0.0-20211011173535-cb28da3451f1/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= github.com/cncf/xds/go v0.0.0-20220314180256-7f1daf1720fc h1:PYXxkRUBGUMa5xgMVMDl62vEklZvKpVaxQeN9ie7Hfk= @@ -66,10 +71,17 @@ github.com/coocood/freecache v1.1.0/go.mod h1:ePwxCDzOYvARfHdr1pByNct1at3CoKnsip github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/envoyproxy/go-control-plane v0.9.0/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= +github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= +github.com/envoyproxy/go-control-plane v0.9.4/go.mod h1:6rpuAdCZL397s3pYoYcLgu1mIlRU8Am5FuJP05cCM98= +github.com/envoyproxy/go-control-plane v0.9.9-0.20201210154907-fd9021fe5dad/go.mod h1:cXg6YxExXjJnVBQHBLXeUAgxn2UodCpnH306RInaBQk= +github.com/envoyproxy/go-control-plane v0.9.9-0.20210512163311-63b5d3c536b0/go.mod h1:hliV/p42l8fGbc6Y9bQ70uLwIvmJyVE5k4iMKlh8wCQ= +github.com/envoyproxy/go-control-plane v0.9.10-0.20210907150352-cf90f659a021/go.mod h1:AFq3mo9L8Lqqiid3OhADV3RfLJnjiw63cSpi+fDTRC0= +github.com/envoyproxy/go-control-plane v0.10.3-0.20230127155013-72157d335c8f h1:nqACgqiYlDnB0znidh+8uhnQVLeqfW5NyyRfnGibowc= +github.com/envoyproxy/go-control-plane v0.10.3-0.20230127155013-72157d335c8f/go.mod h1:VnHyVMpzcLvCFt9yUz1UnCwHLhwx1WguiVDV7pTG/tI= github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= -github.com/envoyproxy/protoc-gen-validate v0.6.7 h1:qcZcULcd/abmQg6dwigimCNEyi4gg31M/xaciQlDml8= -github.com/envoyproxy/protoc-gen-validate v0.6.7/go.mod h1:dyJXwwfPK2VSqiB9Klm1J6romD608Ba7Hij42vrOBCo= -github.com/envoyproxy/ratelimit v1.4.1-0.20220928150143-0b2f4d5fb04b/go.mod h1:qd8mgua4nBCzIWo+ClmfUqGxFEu+Tm9/CDCs5XRFUsA= +github.com/envoyproxy/protoc-gen-validate v0.9.1 h1:PS7VIOgmSVhWUEeZwTe7z7zouA22Cr590PzXKbZHOVY= +github.com/envoyproxy/protoc-gen-validate v0.9.1/go.mod h1:OKNgG7TCp5pF4d6XftA0++PMirau2/yoOwVac3AbF2w= github.com/fsnotify/fsnotify v1.4.9 h1:hsms1Qyu0jgnwNXIxa+/V/PDsU6CfLf6CNO8H7IWoS4= github.com/fsnotify/fsnotify v1.4.9/go.mod h1:znqG4EE+3YCdAaPaxE2ZRY/06pZUdp0tY4IgpuI1SZQ= github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= @@ -127,8 +139,8 @@ github.com/google/go-cmp v0.5.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/ github.com/google/go-cmp v0.5.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.6/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/google/go-cmp v0.5.7 h1:81/ik6ipDQS2aGcBfIN5dHDB36BwrStyeAQquSYCV4o= github.com/google/go-cmp v0.5.7/go.mod h1:n+brtR0CgQNWTVd5ZUFpTBC8YFBDLK/h/bpaJ8/DtOE= +github.com/google/go-cmp v0.5.9 h1:O2Tfq5qg4qc4AmwVlvv0oLiVAGB7enBSJ2x2DqQFi38= github.com/google/martian v2.1.0+incompatible/go.mod h1:9I4somxYTbIHy5NJKHRl3wXiIaQGbYVAs8BPL6v8lEs= github.com/google/martian/v3 v3.0.0/go.mod h1:y5Zk1BBys9G+gd6Jrk0W3cC1+ELVxBWuIGO+w/tUAp0= github.com/google/pprof v0.0.0-20181206194817-3ea8567a2e57/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc= @@ -148,11 +160,12 @@ github.com/gorilla/mux v1.7.4-0.20191121170500-49c01487a141 h1:VQjjMh+uElTfioy6G github.com/gorilla/mux v1.7.4-0.20191121170500-49c01487a141/go.mod h1:DVbg23sWSpFRCP0SfiEN6jmj59UnW/n46BH5rLB71So= github.com/grpc-ecosystem/go-grpc-middleware v1.3.0 h1:+9834+KizmvFV7pXQGSXQTsaWhq2GjuNUt0aUU0YBYw= github.com/grpc-ecosystem/go-grpc-middleware v1.3.0/go.mod h1:z0ButlSOZa5vEBq9m2m2hlwIgKw+rp3sdCBRoJY+30Y= -github.com/grpc-ecosystem/grpc-gateway/v2 v2.7.0 h1:BZHcxBETFHIdVyhyEfOvn/RdU/QGdLI4y34qQGjGWO0= +github.com/grpc-ecosystem/grpc-gateway v1.16.0/go.mod h1:BDjrQk3hbvj6Nolgz8mAMFbcEtjT1g+wF4CSlocrBnw= github.com/grpc-ecosystem/grpc-gateway/v2 v2.7.0/go.mod h1:hgWBS7lorOAVIJEQMi4ZsPv9hVvWI6+ch50m39Pf2Ks= +github.com/grpc-ecosystem/grpc-gateway/v2 v2.11.3 h1:lLT7ZLSzGLI08vc9cpd+tYmNWjdKDqyr/2L+f6U12Fk= +github.com/grpc-ecosystem/grpc-gateway/v2 v2.11.3/go.mod h1:o//XUCC/F+yRGJoPO/VU0GSB0f8Nhgmxx0VIRUvaC0w= github.com/hashicorp/golang-lru v0.5.0/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= github.com/hashicorp/golang-lru v0.5.1/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= -github.com/iancoleman/strcase v0.2.0/go.mod h1:iwCmte+B7n89clKwxIoIXy/HfoL7AsD47ZCWhYzw7ho= github.com/ianlancetaylor/demangle v0.0.0-20181102032728-5e5cf60278f6/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= github.com/jstemmer/go-junit-report v0.0.0-20190106144839-af01ea7f8024/go.mod h1:6v2b51hI/fHJwM22ozAgKL4VKDeJcHhJFhtBdhmNjmU= github.com/jstemmer/go-junit-report v0.9.1/go.mod h1:Brl9GWCQeLvo8nXZwPNNblvFj/XSXhF0NWZEnDohbsk= @@ -165,7 +178,6 @@ github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+o github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= github.com/konsorten/go-windows-terminal-sequences v1.0.3 h1:CE8S1cTafDpPvMhIxNJKvHsGVBgn1xWYf1NbHQhywc8= github.com/konsorten/go-windows-terminal-sequences v1.0.3/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= -github.com/kr/fs v0.1.0/go.mod h1:FFnZGqtBN9Gxj7eW1uZ42v5BccTP0vu6NEaFoC2HwRg= github.com/kr/logfmt v0.0.0-20140226030751-b84e30acd515/go.mod h1:+0opPa2QZZtGFBFZlji/RkVcI2GknAs/DXo4wKdlNEc= github.com/kr/pretty v0.1.0 h1:L/CwN0zerZDmRFUapSPitk6f+Q3+0za1rQkzVuMiMFI= github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= @@ -176,17 +188,13 @@ github.com/lyft/goruntime v0.3.0 h1:VLBYR4s3XazkUT8lLtq9CJrt58YmLQQumrK3ktenEkI= github.com/lyft/goruntime v0.3.0/go.mod h1:BW1gngSpMJR9P9w23BPUPdhdbUWhpirl98TQhOWWMF4= github.com/lyft/gostats v0.4.1 h1:oR6p4HRCGxt0nUntmZIWmYMgyothBi3eZH2A71vRjsc= github.com/lyft/gostats v0.4.1/go.mod h1:Tpx2xRzz4t+T2Tx0xdVgIoBdR2UMVz+dKnE3X01XSd8= -github.com/lyft/protoc-gen-star v0.6.0/go.mod h1:TGAoBVkt8w7MPG72TrKIu85MIdXwDuzJYeZuUPFPNwA= github.com/mediocregopher/radix/v3 v3.8.1 h1:rOkHflVuulFKlwsLY01/M2cM2tWCjDoETcMqKbAWu1M= github.com/mediocregopher/radix/v3 v3.8.1/go.mod h1:8FL3F6UQRXHXIBSPUs5h0RybMF8i4n7wVopoX3x7Bv8= github.com/opentracing/opentracing-go v1.1.0/go.mod h1:UkNAQd3GIcIGf0SeVgPpRdFStlNbqXla1AfSYxPUl2o= github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= -github.com/pkg/sftp v1.10.1/go.mod h1:lYOWFsE0bwd1+KfKJaKeuokY15vzFx25BLbzYYoAxZI= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= -github.com/prometheus/client_model v0.2.0/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= -github.com/renuka-fernando/go-control-plane v0.0.3 h1:2sgFlqaeYKkI26NSiSGb65mJO1wITmy++VcSGAevVCc= -github.com/renuka-fernando/go-control-plane v0.0.3/go.mod h1:b1r8wC2S/Nhq2WfGQPdQShAJVYLCIPtnHrUnw/oy+Xs= +github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= github.com/rogpeppe/fastuuid v1.2.0/go.mod h1:jVj6XXZzXRy/MSR5jhDC/2q6DgLz+nrA6LYCDYWNEvQ= github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= github.com/sirupsen/logrus v1.4.2/go.mod h1:tLMulIdttU9McNUspp0xgXVQah82FyeX6MwdIuYE2rE= @@ -194,19 +202,19 @@ github.com/sirupsen/logrus v1.6.0 h1:UBcNElsrwanuuMsnGSlYmtmgbb23qDR5dG+6X6Oo89I github.com/sirupsen/logrus v1.6.0/go.mod h1:7uNnSEd1DgxDLC74fIahvMZmmYsHGZGEOFrfsX/uA88= github.com/spaolacci/murmur3 v0.0.0-20180118202830-f09979ecbc72 h1:qLC7fQah7D6K1B0ujays3HV9gkFtllcxhzImRR7ArPQ= github.com/spaolacci/murmur3 v0.0.0-20180118202830-f09979ecbc72/go.mod h1:JwIasOWyU6f++ZhiEuf87xNszmSA2myDM2Kzu9HwQUA= -github.com/spf13/afero v1.3.3/go.mod h1:5KUK8ByomD5Ti5Artl0RtHeI5pTF7MIDuXL3yY520V4= -github.com/spf13/afero v1.6.0/go.mod h1:Ai8FlHk4v/PARR026UzYexafAt9roJ7LcLMAmO6Z93I= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= -github.com/stretchr/objx v0.2.0 h1:Hbg2NidpLE8veEBkEZTL3CvlkUIVzuU9jDplZO54c48= -github.com/stretchr/objx v0.2.0/go.mod h1:qt09Ya8vawLte6SNmTgCsAVtYtaKzEcn8ATUoHMkEqE= +github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw= +github.com/stretchr/objx v0.5.0 h1:1zr/of2m5FGMsad5YfcqgdqdWrIhu+EBEJRhR1U7z/c= +github.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpEOglKo= github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= -github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4= -github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= +github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5cxcmMvtA= github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= -github.com/stretchr/testify v1.7.1 h1:5TQK59W5E3v0r2duFAb7P95B6hEeOyEnHRa8MjYSMTY= github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= +github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU= +github.com/stretchr/testify v1.8.1 h1:w7B6lhMri9wdJUVmEZPGGhZzrYTPvgJArz7wNPgYKsk= +github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4= github.com/yuin/goldmark v1.1.25/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.1.32/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= @@ -240,9 +248,10 @@ go.opentelemetry.io/otel/trace v1.6.1/go.mod h1:RkFRM1m0puWIq10oxImnGEduNBzxiN7T go.opentelemetry.io/otel/trace v1.6.3/go.mod h1:GNJQusJlUgZl9/TQBPKU/Y/ty+0iVB5fjhKeJGZPGFs= go.opentelemetry.io/otel/trace v1.7.0 h1:O37Iogk1lEkMRXewVtZ1BBTVn5JEp8GrJvP92bJqC6o= go.opentelemetry.io/otel/trace v1.7.0/go.mod h1:fzLSB9nqR2eXzxPXb2JW9IKE+ScyXA48yyE4TNvoHqU= +go.opentelemetry.io/proto/otlp v0.7.0/go.mod h1:PqfVotwruBrMGOCsRd/89rSnXhoiJIqeYNgFYFoEGnI= go.opentelemetry.io/proto/otlp v0.15.0/go.mod h1:H7XAot3MsfNsj7EXtrA2q5xSNQ10UqI405h3+duxN4U= -go.opentelemetry.io/proto/otlp v0.16.0 h1:WHzDWdXUvbc5bG2ObdrGfaNpQz7ft7QN9HHmJlbiB1E= -go.opentelemetry.io/proto/otlp v0.16.0/go.mod h1:H7XAot3MsfNsj7EXtrA2q5xSNQ10UqI405h3+duxN4U= +go.opentelemetry.io/proto/otlp v0.19.0 h1:IVN6GR+mhC4s5yfcTbmzHYODqvWAp3ZedA2SJPI1Nnw= +go.opentelemetry.io/proto/otlp v0.19.0/go.mod h1:H7XAot3MsfNsj7EXtrA2q5xSNQ10UqI405h3+duxN4U= go.uber.org/atomic v1.4.0/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE= go.uber.org/goleak v1.1.12 h1:gZAh5/EyT/HQwlpkCy6wTpqfH9H8Lz8zbm3dZh+OyzA= go.uber.org/goleak v1.1.12/go.mod h1:cwTWslyiVhfpKIDGSZEM2HlOvcqm+tG4zioyIeLoqMQ= @@ -251,7 +260,6 @@ go.uber.org/zap v1.10.0/go.mod h1:vwi/ZaCAaUcBkycHslxD9B2zi4UTXhF60s6SWpuDF0Q= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20190510104115-cbcb75029529/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20190605123033-f99c8df09eb5/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= -golang.org/x/crypto v0.0.0-20190820162420-60c769a6c586/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= @@ -276,7 +284,6 @@ golang.org/x/lint v0.0.0-20190930215403-16217165b5de/go.mod h1:6SW0HCj/g11FgYtHl golang.org/x/lint v0.0.0-20191125180803-fdd1cda4f05f/go.mod h1:5qLYkcX4OjUUV8bRuDixDT3tpyyb+LUpUlRWLxfhWrs= golang.org/x/lint v0.0.0-20200130185559-910be7a94367/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= golang.org/x/lint v0.0.0-20200302205851-738671d3881b/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= -golang.org/x/lint v0.0.0-20210508222113-6edffad5e616/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= golang.org/x/mobile v0.0.0-20190312151609-d3739f865fa6/go.mod h1:z+o9i4GpDbdi3rU15maQ/Ox0txvL9dWGYEHz965HBQE= golang.org/x/mobile v0.0.0-20190719004257-d2bd2a29d028/go.mod h1:E/iHnbuqvinMTCcRqshq8CkpyQDoeVncDDYHnLhea+o= golang.org/x/mod v0.0.0-20190513183733-4bf6d317e70e/go.mod h1:mXi4GBBbnImb6dmsKGUJ2LatrhH/nqhxcFungHvyanc= @@ -286,7 +293,6 @@ golang.org/x/mod v0.1.1-0.20191107180719-034126e5016b/go.mod h1:QqPTAvyqsEbceGzB golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.4.2/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= -golang.org/x/mod v0.5.0/go.mod h1:5OXOZSfqPIIbmVBIIKWRFfZjPR0E5r58TLhUjH0a2Ro= golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190108225652-1e06a53dbb7e/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= @@ -315,8 +321,6 @@ golang.org/x/net v0.0.0-20200707034311-ab3426394381/go.mod h1:/O7V0waA8r7cgGh81R golang.org/x/net v0.0.0-20200822124328-c89045814202/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= golang.org/x/net v0.0.0-20210405180319-a5a99cb37ef4/go.mod h1:p54w0d4576C0XHj96bSt6lcn1PtDYWL6XObtHCRCNQM= -golang.org/x/net v0.0.0-20210813160813-60bc85c4be6d/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= -golang.org/x/net v0.0.0-20220909164309-bea034e7d591/go.mod h1:YDH+HFinaLZZlnHAfSS6ZXJJ9M9t4Dl22yv3iI2vPwk= golang.org/x/net v0.4.0 h1:Q5QPcMlvfxFTAPV0+07Xz/MpK9NTXu2VDUuy0FeMfaU= golang.org/x/net v0.4.0/go.mod h1:MBQ8lrhLObU/6UmLb4fmbmk5OcyYmqtbGd/9yIeKjEE= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= @@ -324,8 +328,8 @@ golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4Iltr golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20191202225959-858c2ad4c8b6/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= -golang.org/x/oauth2 v0.0.0-20211104180415-d3ed0bb246c8 h1:RerP+noqYHUQ8CMRcPlC2nvTa4dcBIjegkuWdcUDuqg= golang.org/x/oauth2 v0.0.0-20211104180415-d3ed0bb246c8/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= +golang.org/x/oauth2 v0.0.0-20221014153046-6fdb5e3db783 h1:nt+Q6cXKz4MosCSpnbMtqiQ8Oz0pxTef2B4Vca2lvfk= golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= @@ -367,24 +371,17 @@ golang.org/x/sys v0.0.0-20200803210538-64077c9b5642/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210330210617-4fbd30eecc44/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210423185535-09eb48e85fd7/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210510120138-977fb7262007/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20210816183151-1e6c022a8912/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20220728004956-3c1f35247d10/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.3.0 h1:w8ZOecv6NaNa/zC8944JTU3vz4u6Lagfk4RPQxv92NQ= golang.org/x/sys v0.3.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= -golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.5/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= -golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= -golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= golang.org/x/text v0.5.0 h1:OLmvp0KP+FVG99Ct/qFiL/Fhk4zp4QQnZ7b2U+5piUM= golang.org/x/text v0.5.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= @@ -436,8 +433,9 @@ golang.org/x/tools v0.1.5/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= -golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1 h1:go1bK/D/BFZV2I8cIQd1NKEZ+0owSTG1fDTci4IqFcE= golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +golang.org/x/xerrors v0.0.0-20220907171357-04be3eba64a2 h1:H2TDz8ibqkAF6YGhCdN3jS9O0/s90v0rJh3X/OLHEUk= +golang.org/x/xerrors v0.0.0-20220907171357-04be3eba64a2/go.mod h1:K8+ghG5WaK9qNqU5K3HdILfMLy1f3aNYFI/wnl100a8= google.golang.org/api v0.4.0/go.mod h1:8k5glujaEP+g9n7WNsDg8QP6cUVNI86fCNMcbazEtwE= google.golang.org/api v0.7.0/go.mod h1:WtwebWUNSVBH/HAw79HIFXZNqEvBhG+Ra+ax0hx3E3M= google.golang.org/api v0.8.0/go.mod h1:o4eAsZoiT+ibD93RtjEohWalFOjRDx6CVaqeizhEnKg= @@ -459,8 +457,8 @@ google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7 google.golang.org/appengine v1.5.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= google.golang.org/appengine v1.6.1/go.mod h1:i06prIuMbXzDqacNJfV5OdTW448YApPu5ww/cMBSeb0= google.golang.org/appengine v1.6.5/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= -google.golang.org/appengine v1.6.6 h1:lMO5rYAqUxkmaj76jAkRUvt5JZgFymx/+Q5Mzfivuhc= google.golang.org/appengine v1.6.6/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= +google.golang.org/appengine v1.6.7 h1:FZR1q0exgwxzPzp/aF+VccGrSfxfPpkBqjIIEq3ru6c= google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= google.golang.org/genproto v0.0.0-20190307195333-5fe7a883aa19/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= google.golang.org/genproto v0.0.0-20190418145605-e7d98fc518a7/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= @@ -485,6 +483,7 @@ google.golang.org/genproto v0.0.0-20200331122359-1ee6d9798940/go.mod h1:55QSHmfG google.golang.org/genproto v0.0.0-20200423170343-7949de9c1215/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= google.golang.org/genproto v0.0.0-20200430143042-b979b6f78d84/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= google.golang.org/genproto v0.0.0-20200511104702-f5ebc3bea380/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= +google.golang.org/genproto v0.0.0-20200513103714-09dca8ec2884/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= google.golang.org/genproto v0.0.0-20200515170657-fc4c6c6a6587/go.mod h1:YsZOwe1myG/8QRHRsmBRE1LrgQY60beZKjly0O1fX9U= google.golang.org/genproto v0.0.0-20200526211855-cb27e3aa2013/go.mod h1:NbSheEEYHJ7i3ixzK3sjbqSGDJWnxyFXZblF3eUsNvo= google.golang.org/genproto v0.0.0-20200618031413-b414f8b61790/go.mod h1:jDfRM7FcilCzHH/e9qn6dsT145K34l5v+OpcnNgKAAA= @@ -492,11 +491,12 @@ google.golang.org/genproto v0.0.0-20200729003335-053ba62fc06f/go.mod h1:FWY/as6D google.golang.org/genproto v0.0.0-20200804131852-c06518451d9c/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20200825200019-8632dd797987/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20211118181313-81c1377c94b1/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc= -google.golang.org/genproto v0.0.0-20220329172620-7be39ac1afc7 h1:HOL66YCI20JvN2hVk6o2YIp9i/3RvzVUz82PqNr7fXw= -google.golang.org/genproto v0.0.0-20220329172620-7be39ac1afc7/go.mod h1:8w6bsBMX6yCPbAVTeqQHvzxW0EIFigd5lZyahWgyfDo= +google.golang.org/genproto v0.0.0-20221118155620-16455021b5e6 h1:a2S6M0+660BgMNl++4JPlcAO/CjkqYItDEZwkoDQK7c= +google.golang.org/genproto v0.0.0-20221118155620-16455021b5e6/go.mod h1:rZS5c/ZVYMaOGBfO68GWtjOw/eLaZM1X6iVtgjZ+EWg= google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= google.golang.org/grpc v1.20.1/go.mod h1:10oTOabMzJvdu6/UiuZezV6QK5dSlG84ov/aaiqXj38= google.golang.org/grpc v1.21.1/go.mod h1:oYelfM1adQP15Ek0mdvEgi9Df8B9CZIaU1084ijfRaM= +google.golang.org/grpc v1.23.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg= google.golang.org/grpc v1.25.1/go.mod h1:c3i+UQWmh7LiEpx4sFZnkU36qjEYZ0imhYfXVyQciAY= google.golang.org/grpc v1.26.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= google.golang.org/grpc v1.27.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= @@ -505,10 +505,13 @@ google.golang.org/grpc v1.28.0/go.mod h1:rpkK4SK4GF4Ach/+MFLZUBavHOvF2JJB5uozKKa google.golang.org/grpc v1.29.1/go.mod h1:itym6AZVZYACWQqET3MqgPpjcuV5QH3BxFS3IjizoKk= google.golang.org/grpc v1.30.0/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak= google.golang.org/grpc v1.31.0/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak= +google.golang.org/grpc v1.33.1/go.mod h1:fr5YgcSWrqhRRxogOsw7RzIpsmvOZ6IcH4kBYTpR3n0= +google.golang.org/grpc v1.36.0/go.mod h1:qjiiYl8FncCW8feJPdyg3v6XW24KsRHe+dy9BAGRRjU= google.golang.org/grpc v1.40.0/go.mod h1:ogyxbiOoUXAkP+4+xa6PZSE9DZgIHtSpzjDTB9KAK34= google.golang.org/grpc v1.42.0/go.mod h1:k+4IHHFw41K8+bbowsex27ge2rCb65oeWqe4jJ590SU= -google.golang.org/grpc v1.45.0 h1:NEpgUqV3Z+ZjkqMsxMg11IaDrXY4RY6CQukSGK0uI1M= google.golang.org/grpc v1.45.0/go.mod h1:lN7owxKUQEqMfSyQikvvk5tf/6zMPsrK+ONuO11+0rQ= +google.golang.org/grpc v1.52.0 h1:kd48UiU7EHsV4rnLyOJRuP/Il/UHE7gdDAQ+SZI7nZk= +google.golang.org/grpc v1.52.0/go.mod h1:pu6fVzoFb+NBYNAvQL08ic+lvB2IojljRYuun5vorUY= google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8= google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0= google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQJ+fmap5saPgwCLgHXTUD7jkjRqWcaiX5VyM= @@ -522,17 +525,20 @@ google.golang.org/protobuf v1.25.0/go.mod h1:9JNX74DMeImyA3h4bdi1ymwjUzf21/xIlba google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw= google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= google.golang.org/protobuf v1.27.1/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= -google.golang.org/protobuf v1.28.0 h1:w43yiav+6bVFTBQFZX0r7ipe9JQ1QsbMgHwbBziscLw= google.golang.org/protobuf v1.28.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= +google.golang.org/protobuf v1.28.1 h1:d0NfwRgPtno5B1Wa6L2DAG+KivqkdutMf1UhdNx175w= +google.golang.org/protobuf v1.28.1/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127 h1:qIbj1fsPNlZgppZ+VLlY7N33q108Sa+fhmuc+sWQYwY= gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI= gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/yaml.v2 v2.2.3/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.3.0 h1:clyUAQHOM3G0M3f5vQj7LuJrETvjVot3Z5el9nffUtU= gopkg.in/yaml.v2 v2.3.0/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= -gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c h1:dUUwHk2QECo/6vqA44rthZ8ie2QXMNeKRTHCNY2nXvo= gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= +gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= +gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= honnef.co/go/tools v0.0.0-20190106161140-3f1c8253044a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= honnef.co/go/tools v0.0.0-20190418001031-e561f6794a2a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= diff --git a/src/provider/xds_grpc_sotw_provider.go b/src/provider/xds_grpc_sotw_provider.go index 2b1d99c0b..3b8919793 100644 --- a/src/provider/xds_grpc_sotw_provider.go +++ b/src/provider/xds_grpc_sotw_provider.go @@ -3,7 +3,9 @@ package provider import ( "context" "fmt" + "strings" + corev3 "github.com/envoyproxy/go-control-plane/envoy/config/core/v3" "github.com/envoyproxy/go-control-plane/pkg/resource/v3" "github.com/golang/protobuf/ptypes/any" grpc_retry "github.com/grpc-ecosystem/go-grpc-middleware/retry" @@ -13,12 +15,13 @@ import ( "google.golang.org/grpc/credentials/insecure" "google.golang.org/protobuf/proto" "google.golang.org/protobuf/types/known/anypb" + "google.golang.org/protobuf/types/known/structpb" "github.com/envoyproxy/ratelimit/src/config" "github.com/envoyproxy/ratelimit/src/settings" "github.com/envoyproxy/ratelimit/src/stats" - "github.com/envoyproxy/go-control-plane/pkg/adsclient/sotw/v3" + "github.com/envoyproxy/go-control-plane/pkg/client/sotw/v3" rls_conf_v3 "github.com/envoyproxy/go-control-plane/ratelimit/config/ratelimit/v3" ) @@ -29,7 +32,7 @@ type XdsGrpcSotwProvider struct { configUpdateEventChan chan ConfigUpdateEvent statsManager stats.Manager ctx context.Context - adsClient sotw.AdsClient + adsClient sotw.ADSClient // connectionRetryChannel is the channel which trigger true for connection issues connectionRetryChannel chan bool } @@ -44,7 +47,7 @@ func NewXdsGrpcSotwProvider(settings settings.Settings, statsManager stats.Manag configUpdateEventChan: make(chan ConfigUpdateEvent), connectionRetryChannel: make(chan bool), loader: config.NewRateLimitConfigLoaderImpl(), - adsClient: sotw.NewAdsClient(ctx, settings.ConfigGrpcXdsNodeId, resource.RateLimitConfigType), + adsClient: sotw.NewADSClient(ctx, getClientNode(settings), resource.RateLimitConfigType), } go p.initXdsClient() return p @@ -161,3 +164,19 @@ func (p *XdsGrpcSotwProvider) sendConfigs(resources []*any.Any) { func (p *XdsGrpcSotwProvider) retryGrpcConn() { p.connectionRetryChannel <- true } + +func getClientNode(s settings.Settings) *corev3.Node { + // setting metadata for node + metadataMap := make(map[string]*structpb.Value) + for _, entry := range strings.Split(s.ConfigGrpcXdsNodeMetadata, ",") { + keyValPair := strings.SplitN(entry, "=", 2) + if len(keyValPair) == 2 { + metadataMap[keyValPair[0]] = structpb.NewStringValue(keyValPair[1]) + } + } + + return &corev3.Node{ + Id: s.ConfigGrpcXdsNodeId, + Metadata: &structpb.Struct{Fields: metadataMap}, + } +} diff --git a/src/settings/settings.go b/src/settings/settings.go index ab4d187f4..eae203dc3 100644 --- a/src/settings/settings.go +++ b/src/settings/settings.go @@ -55,6 +55,7 @@ type Settings struct { // xDS rate limit configuration // ConfigGrpcXdsNodeId is the Node ID. xDS server should set snapshots to this Node ID ConfigGrpcXdsNodeId string `envconfig:"CONFIG_GRPC_XDS_NODE_ID" default:"default"` + ConfigGrpcXdsNodeMetadata string `envconfig:"CONFIG_GRPC_XDS_NODE_METADATA" default:""` // eg: "key1:val1,key2=val2" ConfigGrpcXdsServerUrl string `envconfig:"CONFIG_GRPC_XDS_SERVER_URL" default:"localhost:18000"` ConfigGrpcXdsServerConnectRetryInterval time.Duration `envconfig:"CONFIG_GRPC_XDS_SERVER_CONNECT_RETRY_INTERVAL" default:"3s"` From 6ea0628e80a31d91c6c62975a11062473951277e Mon Sep 17 00:00:00 2001 From: Renuka Fernando Date: Sat, 28 Jan 2023 11:38:27 +0530 Subject: [PATCH 20/22] Update go-control-plane version which contains rate limit impl in sample Signed-off-by: Renuka Fernando --- examples/xds-sotw-config-server/go.mod | 21 +- examples/xds-sotw-config-server/go.sum | 408 ++----------------------- 2 files changed, 35 insertions(+), 394 deletions(-) diff --git a/examples/xds-sotw-config-server/go.mod b/examples/xds-sotw-config-server/go.mod index dd024899b..7c5ac4cd8 100644 --- a/examples/xds-sotw-config-server/go.mod +++ b/examples/xds-sotw-config-server/go.mod @@ -2,22 +2,19 @@ module github.com/envoyproxy/ratelimit/examples/xds-sotw-config-server go 1.18 -// TODO: (renuka) Remove this replace once, https://github.com/envoyproxy/go-control-plane/pull/598 is merged -replace github.com/envoyproxy/go-control-plane => github.com/renuka-fernando/go-control-plane v0.0.2 - require ( - github.com/envoyproxy/go-control-plane v0.10.1 - google.golang.org/grpc v1.45.0 + github.com/envoyproxy/go-control-plane v0.10.3-0.20230127155013-72157d335c8f + google.golang.org/grpc v1.52.0 ) require ( - github.com/census-instrumentation/opencensus-proto v0.3.0 // indirect + github.com/census-instrumentation/opencensus-proto v0.4.1 // indirect github.com/cncf/xds/go v0.0.0-20220314180256-7f1daf1720fc // indirect - github.com/envoyproxy/protoc-gen-validate v0.6.7 // indirect + github.com/envoyproxy/protoc-gen-validate v0.9.1 // indirect github.com/golang/protobuf v1.5.2 // indirect - golang.org/x/net v0.0.0-20210813160813-60bc85c4be6d // indirect - golang.org/x/sys v0.0.0-20210816183151-1e6c022a8912 // indirect - golang.org/x/text v0.3.7 // indirect - google.golang.org/genproto v0.0.0-20220329172620-7be39ac1afc7 // indirect - google.golang.org/protobuf v1.28.0 // indirect + golang.org/x/net v0.4.0 // indirect + golang.org/x/sys v0.3.0 // indirect + golang.org/x/text v0.5.0 // indirect + google.golang.org/genproto v0.0.0-20221118155620-16455021b5e6 // indirect + google.golang.org/protobuf v1.28.1 // indirect ) diff --git a/examples/xds-sotw-config-server/go.sum b/examples/xds-sotw-config-server/go.sum index 16578581c..d82360b96 100644 --- a/examples/xds-sotw-config-server/go.sum +++ b/examples/xds-sotw-config-server/go.sum @@ -1,429 +1,73 @@ cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= -cloud.google.com/go v0.34.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= -cloud.google.com/go v0.38.0/go.mod h1:990N+gfupTy94rShfmMCWGDn0LpTmnzTp2qbd1dvSRU= -cloud.google.com/go v0.44.1/go.mod h1:iSa0KzasP4Uvy3f1mN/7PiObzGgflwredwwASm/v6AU= -cloud.google.com/go v0.44.2/go.mod h1:60680Gw3Yr4ikxnPRS/oxxkBccT6SA1yMk63TGekxKY= -cloud.google.com/go v0.45.1/go.mod h1:RpBamKRgapWJb87xiFSdk4g1CME7QZg3uwTez+TSTjc= -cloud.google.com/go v0.46.3/go.mod h1:a6bKKbmY7er1mI7TEI4lsAkts/mkhTSZK8w33B4RAg0= -cloud.google.com/go v0.50.0/go.mod h1:r9sluTvynVuxRIOHXQEHMFffphuXHOMZMycpNR5e6To= -cloud.google.com/go v0.52.0/go.mod h1:pXajvRH/6o3+F9jDHZWQ5PbGhn+o8w9qiu/CffaVdO4= -cloud.google.com/go v0.53.0/go.mod h1:fp/UouUEsRkN6ryDKNW/Upv/JBKnv6WDthjR6+vze6M= -cloud.google.com/go v0.54.0/go.mod h1:1rq2OEkV3YMf6n/9ZvGWI3GWw0VoqH/1x2nd8Is/bPc= -cloud.google.com/go v0.56.0/go.mod h1:jr7tqZxxKOVYizybht9+26Z/gUq7tiRzu+ACVAMbKVk= -cloud.google.com/go v0.57.0/go.mod h1:oXiQ6Rzq3RAkkY7N6t3TcE6jE+CIBBbA36lwQ1JyzZs= -cloud.google.com/go v0.62.0/go.mod h1:jmCYTdRCQuc1PHIIJ/maLInMho30T/Y0M4hTdTShOYc= -cloud.google.com/go v0.65.0/go.mod h1:O5N8zS7uWy9vkA9vayVHs65eM1ubvY4h553ofrNHObY= -cloud.google.com/go/bigquery v1.0.1/go.mod h1:i/xbL2UlR5RvWAURpBYZTtm/cXjCha9lbfbpx4poX+o= -cloud.google.com/go/bigquery v1.3.0/go.mod h1:PjpwJnslEMmckchkHFfq+HTD2DmtT67aNFKH1/VBDHE= -cloud.google.com/go/bigquery v1.4.0/go.mod h1:S8dzgnTigyfTmLBfrtrhyYhwRxG72rYxvftPBK2Dvzc= -cloud.google.com/go/bigquery v1.5.0/go.mod h1:snEHRnqQbz117VIFhE8bmtwIDY80NLUZUMb4Nv6dBIg= -cloud.google.com/go/bigquery v1.7.0/go.mod h1://okPTzCYNXSlb24MZs83e2Do+h+VXtc4gLoIoXIAPc= -cloud.google.com/go/bigquery v1.8.0/go.mod h1:J5hqkt3O0uAFnINi6JXValWIb1v0goeZM77hZzJN/fQ= -cloud.google.com/go/datastore v1.0.0/go.mod h1:LXYbyblFSglQ5pkeyhO+Qmw7ukd3C+pD7TKLgZqpHYE= -cloud.google.com/go/datastore v1.1.0/go.mod h1:umbIZjpQpHh4hmRpGhH4tLFup+FVzqBi1b3c64qFpCk= -cloud.google.com/go/pubsub v1.0.1/go.mod h1:R0Gpsv3s54REJCy4fxDixWD93lHJMoZTyQ2kNxGRt3I= -cloud.google.com/go/pubsub v1.1.0/go.mod h1:EwwdRX2sKPjnvnqCa270oGRyludottCI76h+R3AArQw= -cloud.google.com/go/pubsub v1.2.0/go.mod h1:jhfEVHT8odbXTkndysNHCcx0awwzvfOlguIAii9o8iA= -cloud.google.com/go/pubsub v1.3.1/go.mod h1:i+ucay31+CNRpDW4Lu78I4xXG+O1r/MAHgjpRVR+TSU= -cloud.google.com/go/storage v1.0.0/go.mod h1:IhtSnM/ZTZV8YYJWCY8RULGVqBDmpoyjwiyrjsg+URw= -cloud.google.com/go/storage v1.5.0/go.mod h1:tpKbwo567HUNpVclU5sGELwQWBDZ8gh0ZeosJ0Rtdos= -cloud.google.com/go/storage v1.6.0/go.mod h1:N7U0C8pVQ/+NIKOBQyamJIeKQKkZ+mxpohlUTyfDhBk= -cloud.google.com/go/storage v1.8.0/go.mod h1:Wv1Oy7z6Yz3DshWRJFhqM/UCfaWIRTdp0RXyy7KQOVs= -cloud.google.com/go/storage v1.10.0/go.mod h1:FLPqc6j+Ki4BU591ie1oL6qBQGu2Bl/tZ9ullr3+Kg0= -dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU= github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= -github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo= -github.com/OneOfOne/xxhash v1.2.2/go.mod h1:HSdplMjZKSmBqAxg5vPj2TmRDmfkzw+cTzAElWljhcU= -github.com/antihax/optional v1.0.0/go.mod h1:uupD/76wgC+ih3iEmQUL+0Ugr19nfwCT1kdvxnR2qWY= -github.com/census-instrumentation/opencensus-proto v0.3.0 h1:t/LhUZLVitR1Ow2YOnduCsavhwFUklBMoGVYUCqmCqk= -github.com/census-instrumentation/opencensus-proto v0.3.0/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= -github.com/cespare/xxhash v1.1.0/go.mod h1:XrSqR1VqqWfGrhpAt58auRo0WTKS1nRRg3ghfAqPWnc= -github.com/cespare/xxhash/v2 v2.1.1/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= -github.com/chzyer/logex v1.1.10/go.mod h1:+Ywpsq7O8HXn0nuIou7OrIPyXbp3wmkHB+jjWRnGsAI= -github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e/go.mod h1:nSuG5e5PlCu98SY8svDHJxuZscDgtXS6KTTbou5AhLI= -github.com/chzyer/test v0.0.0-20180213035817-a1ea475d72b1/go.mod h1:Q3SI9o4m/ZMnBNeIyt5eFwwo7qiLfzFZmjNmxjkiQlU= +github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= +github.com/census-instrumentation/opencensus-proto v0.4.1 h1:iKLQ0xPNFxR/2hzXZMrBo8f1j86j5WHzznCCQxV/b8g= +github.com/census-instrumentation/opencensus-proto v0.4.1/go.mod h1:4T9NM4+4Vw91VeyqjLS6ao50K5bOcLKN6Q42XnYaRYw= github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw= -github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f/go.mod h1:M8M6+tZqaGXZJjfX53e64911xZQV5JYwmTeXPW+k8Sc= -github.com/cncf/udpa/go v0.0.0-20201120205902-5459f2c99403/go.mod h1:WmhPx2Nbnhtbo57+VJT5O0JRkEi1Wbu0z5j0R8u5Hbk= -github.com/cncf/udpa/go v0.0.0-20210930031921-04548b0d99d4/go.mod h1:6pvJx4me5XPnfI9Z40ddWsdw2W/uZgQLFXToKeRcDiI= -github.com/cncf/xds/go v0.0.0-20210922020428-25de7278fc84/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= -github.com/cncf/xds/go v0.0.0-20211011173535-cb28da3451f1/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= github.com/cncf/xds/go v0.0.0-20220314180256-7f1daf1720fc h1:PYXxkRUBGUMa5xgMVMDl62vEklZvKpVaxQeN9ie7Hfk= github.com/cncf/xds/go v0.0.0-20220314180256-7f1daf1720fc/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= -github.com/davecgh/go-spew v1.1.0 h1:ZDRjVQ15GmhC3fiQ8ni8+OwkZQO4DARzQgrnXU1Liz8= -github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= +github.com/envoyproxy/go-control-plane v0.9.0/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= +github.com/envoyproxy/go-control-plane v0.10.3-0.20230127155013-72157d335c8f h1:nqACgqiYlDnB0znidh+8uhnQVLeqfW5NyyRfnGibowc= +github.com/envoyproxy/go-control-plane v0.10.3-0.20230127155013-72157d335c8f/go.mod h1:VnHyVMpzcLvCFt9yUz1UnCwHLhwx1WguiVDV7pTG/tI= github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= -github.com/envoyproxy/protoc-gen-validate v0.6.7 h1:qcZcULcd/abmQg6dwigimCNEyi4gg31M/xaciQlDml8= -github.com/envoyproxy/protoc-gen-validate v0.6.7/go.mod h1:dyJXwwfPK2VSqiB9Klm1J6romD608Ba7Hij42vrOBCo= -github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= -github.com/go-gl/glfw v0.0.0-20190409004039-e6da0acd62b1/go.mod h1:vR7hzQXu2zJy9AVAgeJqvqgH9Q5CA+iKCZ2gyEVpxRU= -github.com/go-gl/glfw/v3.3/glfw v0.0.0-20191125211704-12ad95a8df72/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= -github.com/go-gl/glfw/v3.3/glfw v0.0.0-20200222043503-6f7a984d4dc4/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= +github.com/envoyproxy/protoc-gen-validate v0.9.1 h1:PS7VIOgmSVhWUEeZwTe7z7zouA22Cr590PzXKbZHOVY= +github.com/envoyproxy/protoc-gen-validate v0.9.1/go.mod h1:OKNgG7TCp5pF4d6XftA0++PMirau2/yoOwVac3AbF2w= github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= -github.com/golang/glog v1.0.0/go.mod h1:EWib/APOK0SL3dFbYqvxE3UYd8E6s1ouQ7iEp/0LWV4= -github.com/golang/groupcache v0.0.0-20190702054246-869f871628b6/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= -github.com/golang/groupcache v0.0.0-20191227052852-215e87163ea7/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= -github.com/golang/groupcache v0.0.0-20200121045136-8c9f03a8e57e/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= github.com/golang/mock v1.1.1/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= -github.com/golang/mock v1.2.0/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= -github.com/golang/mock v1.3.1/go.mod h1:sBzyDLLjw3U8JLTeZvSv8jJB+tU5PVekmnlKIyFUx0Y= -github.com/golang/mock v1.4.0/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw= -github.com/golang/mock v1.4.1/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw= -github.com/golang/mock v1.4.3/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw= -github.com/golang/mock v1.4.4/go.mod h1:l3mdAwkq5BuhzHwde/uurv3sEJeZMXNpwsxVWU71h+4= github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= -github.com/golang/protobuf v1.3.1/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= github.com/golang/protobuf v1.3.2/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= -github.com/golang/protobuf v1.3.3/go.mod h1:vzj43D7+SQXF/4pzW/hwtAqwc6iTitCiVSaWz5lYuqw= -github.com/golang/protobuf v1.3.4/go.mod h1:vzj43D7+SQXF/4pzW/hwtAqwc6iTitCiVSaWz5lYuqw= -github.com/golang/protobuf v1.3.5/go.mod h1:6O5/vntMXwX2lRkT1hjjk0nAC1IDOTvTlVgjlRvqsdk= -github.com/golang/protobuf v1.4.0-rc.1/go.mod h1:ceaxUfeHdC40wWswd/P6IGgMaK3YpKi5j83Wpe3EHw8= -github.com/golang/protobuf v1.4.0-rc.1.0.20200221234624-67d41d38c208/go.mod h1:xKAWHe0F5eneWXFV3EuXVDTCmh+JuBKY0li0aMyXATA= -github.com/golang/protobuf v1.4.0-rc.2/go.mod h1:LlEzMj4AhA7rCAGe4KMBDvJI+AwstrUpVNzEA03Pprs= -github.com/golang/protobuf v1.4.0-rc.4.0.20200313231945-b860323f09d0/go.mod h1:WU3c8KckQ9AFe+yFwt9sWVRKCVIyN9cPHBJSNnbL67w= -github.com/golang/protobuf v1.4.0/go.mod h1:jodUvKwWbYaEsadDk5Fwe5c77LiNKVO9IDvqG2KuDX0= -github.com/golang/protobuf v1.4.1/go.mod h1:U8fpvMrcmy5pZrNK1lt4xCsGvpyWQ/VVv6QDs8UjoX8= -github.com/golang/protobuf v1.4.2/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI= -github.com/golang/protobuf v1.4.3/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI= github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk= github.com/golang/protobuf v1.5.2 h1:ROPKBNFfQgOUMifHyP+KYbvpjbdoFNs+aK7DXlji0Tw= github.com/golang/protobuf v1.5.2/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= -github.com/google/btree v0.0.0-20180813153112-4030bb1f1f0c/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= -github.com/google/btree v1.0.0/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M= -github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= -github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= -github.com/google/go-cmp v0.4.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/google/go-cmp v0.4.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/google/go-cmp v0.5.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/google/go-cmp v0.5.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/google/go-cmp v0.5.6/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/google/go-cmp v0.5.7 h1:81/ik6ipDQS2aGcBfIN5dHDB36BwrStyeAQquSYCV4o= -github.com/google/go-cmp v0.5.7/go.mod h1:n+brtR0CgQNWTVd5ZUFpTBC8YFBDLK/h/bpaJ8/DtOE= -github.com/google/martian v2.1.0+incompatible/go.mod h1:9I4somxYTbIHy5NJKHRl3wXiIaQGbYVAs8BPL6v8lEs= -github.com/google/martian/v3 v3.0.0/go.mod h1:y5Zk1BBys9G+gd6Jrk0W3cC1+ELVxBWuIGO+w/tUAp0= -github.com/google/pprof v0.0.0-20181206194817-3ea8567a2e57/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc= -github.com/google/pprof v0.0.0-20190515194954-54271f7e092f/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc= -github.com/google/pprof v0.0.0-20191218002539-d4f498aebedc/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= -github.com/google/pprof v0.0.0-20200212024743-f11f1df84d12/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= -github.com/google/pprof v0.0.0-20200229191704-1ebb73c60ed3/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= -github.com/google/pprof v0.0.0-20200430221834-fc25d7d30c6d/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= -github.com/google/pprof v0.0.0-20200708004538-1a94d8640e99/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= -github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI= -github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= -github.com/googleapis/gax-go/v2 v2.0.4/go.mod h1:0Wqv26UfaUD9n4G6kQubkQ+KchISgw+vpHVxEJEs9eg= -github.com/googleapis/gax-go/v2 v2.0.5/go.mod h1:DWXyrwAJ9X0FpwwEdw+IPEYBICEFu5mhpdKc/us6bOk= -github.com/grpc-ecosystem/grpc-gateway/v2 v2.7.0/go.mod h1:hgWBS7lorOAVIJEQMi4ZsPv9hVvWI6+ch50m39Pf2Ks= -github.com/hashicorp/golang-lru v0.5.0/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= -github.com/hashicorp/golang-lru v0.5.1/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= -github.com/iancoleman/strcase v0.2.0/go.mod h1:iwCmte+B7n89clKwxIoIXy/HfoL7AsD47ZCWhYzw7ho= -github.com/ianlancetaylor/demangle v0.0.0-20181102032728-5e5cf60278f6/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= -github.com/jstemmer/go-junit-report v0.0.0-20190106144839-af01ea7f8024/go.mod h1:6v2b51hI/fHJwM22ozAgKL4VKDeJcHhJFhtBdhmNjmU= -github.com/jstemmer/go-junit-report v0.9.1/go.mod h1:Brl9GWCQeLvo8nXZwPNNblvFj/XSXhF0NWZEnDohbsk= -github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= -github.com/kr/fs v0.1.0/go.mod h1:FFnZGqtBN9Gxj7eW1uZ42v5BccTP0vu6NEaFoC2HwRg= -github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= -github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= -github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= -github.com/lyft/protoc-gen-star v0.6.0/go.mod h1:TGAoBVkt8w7MPG72TrKIu85MIdXwDuzJYeZuUPFPNwA= -github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= -github.com/pkg/sftp v1.10.1/go.mod h1:lYOWFsE0bwd1+KfKJaKeuokY15vzFx25BLbzYYoAxZI= +github.com/google/go-cmp v0.5.9 h1:O2Tfq5qg4qc4AmwVlvv0oLiVAGB7enBSJ2x2DqQFi38= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= -github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= -github.com/prometheus/client_model v0.2.0/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= -github.com/renuka-fernando/go-control-plane v0.0.2 h1:tvvR+mkPz7ab2JZ5N6TQ/V3TOue8PmtTbuMuZxqVKbU= -github.com/renuka-fernando/go-control-plane v0.0.2/go.mod h1:fJJn/j26vwOu972OllsvAgJJM//w9BV6Fxbg2LuVd34= -github.com/rogpeppe/fastuuid v1.2.0/go.mod h1:jVj6XXZzXRy/MSR5jhDC/2q6DgLz+nrA6LYCDYWNEvQ= -github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= -github.com/spaolacci/murmur3 v0.0.0-20180118202830-f09979ecbc72/go.mod h1:JwIasOWyU6f++ZhiEuf87xNszmSA2myDM2Kzu9HwQUA= -github.com/spf13/afero v1.3.3/go.mod h1:5KUK8ByomD5Ti5Artl0RtHeI5pTF7MIDuXL3yY520V4= -github.com/spf13/afero v1.6.0/go.mod h1:Ai8FlHk4v/PARR026UzYexafAt9roJ7LcLMAmO6Z93I= -github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= -github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4= -github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= -github.com/stretchr/testify v1.7.1 h1:5TQK59W5E3v0r2duFAb7P95B6hEeOyEnHRa8MjYSMTY= -github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= -github.com/yuin/goldmark v1.1.25/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= -github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= -github.com/yuin/goldmark v1.1.32/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= -github.com/yuin/goldmark v1.3.5/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k= -go.opencensus.io v0.21.0/go.mod h1:mSImk1erAIZhrmZN+AvHh14ztQfjbGwt4TtuofqLduU= -go.opencensus.io v0.22.0/go.mod h1:+kGneAE2xo2IficOXnaByMWTGM9T73dGwxeWcUqIpI8= -go.opencensus.io v0.22.2/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= -go.opencensus.io v0.22.3/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= -go.opencensus.io v0.22.4/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= -go.opentelemetry.io/proto/otlp v0.15.0/go.mod h1:H7XAot3MsfNsj7EXtrA2q5xSNQ10UqI405h3+duxN4U= +github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= +github.com/stretchr/testify v1.8.1 h1:w7B6lhMri9wdJUVmEZPGGhZzrYTPvgJArz7wNPgYKsk= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= -golang.org/x/crypto v0.0.0-20190510104115-cbcb75029529/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= -golang.org/x/crypto v0.0.0-20190605123033-f99c8df09eb5/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= -golang.org/x/crypto v0.0.0-20190820162420-60c769a6c586/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= -golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= -golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= -golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= -golang.org/x/exp v0.0.0-20190510132918-efd6b22b2522/go.mod h1:ZjyILWgesfNpC6sMxTJOJm9Kp84zZh5NQWvqDGG3Qr8= -golang.org/x/exp v0.0.0-20190829153037-c13cbed26979/go.mod h1:86+5VVa7VpoJ4kLfm080zCjGlMRFzhUhsZKEZO7MGek= -golang.org/x/exp v0.0.0-20191030013958-a1ab85dbe136/go.mod h1:JXzH8nQsPlswgeRAPE3MuO9GYsAcnJvJ4vnMwN/5qkY= -golang.org/x/exp v0.0.0-20191129062945-2f5052295587/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4= -golang.org/x/exp v0.0.0-20191227195350-da58074b4299/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4= -golang.org/x/exp v0.0.0-20200119233911-0405dc783f0a/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4= -golang.org/x/exp v0.0.0-20200207192155-f17229e696bd/go.mod h1:J/WKrq2StrnmMY6+EHIKF9dgMWnmCNThgcyBT1FY9mM= -golang.org/x/exp v0.0.0-20200224162631-6cc2880d07d6/go.mod h1:3jZMyOhIsHpP37uCMkUooju7aAi5cS1Q23tOzKc+0MU= -golang.org/x/image v0.0.0-20190227222117-0694c2d4d067/go.mod h1:kZ7UVZpmo3dzQBMxlp+ypCbDeSB+sBbTgSJuh5dn5js= -golang.org/x/image v0.0.0-20190802002840-cff245a6509b/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0= golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU= -golang.org/x/lint v0.0.0-20190301231843-5614ed5bae6f/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= -golang.org/x/lint v0.0.0-20190409202823-959b441ac422/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= -golang.org/x/lint v0.0.0-20190909230951-414d861bb4ac/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= -golang.org/x/lint v0.0.0-20190930215403-16217165b5de/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= -golang.org/x/lint v0.0.0-20191125180803-fdd1cda4f05f/go.mod h1:5qLYkcX4OjUUV8bRuDixDT3tpyyb+LUpUlRWLxfhWrs= -golang.org/x/lint v0.0.0-20200130185559-910be7a94367/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= -golang.org/x/lint v0.0.0-20200302205851-738671d3881b/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= -golang.org/x/lint v0.0.0-20210508222113-6edffad5e616/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= -golang.org/x/mobile v0.0.0-20190312151609-d3739f865fa6/go.mod h1:z+o9i4GpDbdi3rU15maQ/Ox0txvL9dWGYEHz965HBQE= -golang.org/x/mobile v0.0.0-20190719004257-d2bd2a29d028/go.mod h1:E/iHnbuqvinMTCcRqshq8CkpyQDoeVncDDYHnLhea+o= -golang.org/x/mod v0.0.0-20190513183733-4bf6d317e70e/go.mod h1:mXi4GBBbnImb6dmsKGUJ2LatrhH/nqhxcFungHvyanc= -golang.org/x/mod v0.1.0/go.mod h1:0QHyrYULN0/3qlju5TqG8bIK38QM8yzMo5ekMj3DlcY= -golang.org/x/mod v0.1.1-0.20191105210325-c90efee705ee/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg= -golang.org/x/mod v0.1.1-0.20191107180719-034126e5016b/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg= -golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= -golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= -golang.org/x/mod v0.4.2/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= -golang.org/x/mod v0.5.0/go.mod h1:5OXOZSfqPIIbmVBIIKWRFfZjPR0E5r58TLhUjH0a2Ro= golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20190108225652-1e06a53dbb7e/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190213061140-3a22650c66bd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= -golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= -golang.org/x/net v0.0.0-20190501004415-9ce7a6920f09/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= -golang.org/x/net v0.0.0-20190503192946-f4e77d36d62c/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= -golang.org/x/net v0.0.0-20190603091049-60506f45cf65/go.mod h1:HSz+uSET+XFnRR8LxR5pz3Of3rY3CfYBVs4xY44aLks= -golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20190628185345-da137c7871d7/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20190724013045-ca1201d0de80/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20191209160850-c0dbc17a3553/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20200114155413-6afb5195e5aa/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20200202094626-16171245cfb2/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20200222125558-5a598a2470a0/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20200301022130-244492dfa37a/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20200324143707-d3edc9973b7e/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= -golang.org/x/net v0.0.0-20200501053045-e0ff5e5a1de5/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= -golang.org/x/net v0.0.0-20200506145744-7e3656a0809f/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= -golang.org/x/net v0.0.0-20200513185701-a91f0712d120/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= -golang.org/x/net v0.0.0-20200520182314-0ba52f642ac2/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= -golang.org/x/net v0.0.0-20200625001655-4c5254603344/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= -golang.org/x/net v0.0.0-20200707034311-ab3426394381/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= -golang.org/x/net v0.0.0-20200822124328-c89045814202/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= -golang.org/x/net v0.0.0-20210405180319-a5a99cb37ef4/go.mod h1:p54w0d4576C0XHj96bSt6lcn1PtDYWL6XObtHCRCNQM= -golang.org/x/net v0.0.0-20210813160813-60bc85c4be6d h1:LO7XpTYMwTqxjLcGWPijK3vRXg1aWdlNOVOHRq45d7c= -golang.org/x/net v0.0.0-20210813160813-60bc85c4be6d/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= +golang.org/x/net v0.4.0 h1:Q5QPcMlvfxFTAPV0+07Xz/MpK9NTXu2VDUuy0FeMfaU= +golang.org/x/net v0.4.0/go.mod h1:MBQ8lrhLObU/6UmLb4fmbmk5OcyYmqtbGd/9yIeKjEE= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= -golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= -golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= -golang.org/x/oauth2 v0.0.0-20191202225959-858c2ad4c8b6/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= -golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= -golang.org/x/oauth2 v0.0.0-20211104180415-d3ed0bb246c8/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20190227155943-e225da77a7e6/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20200317015054-43a5402ce75a/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20200625203802-6e8e738ad208/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20190312061237-fead79001313/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190502145724-3ef323f4f1fd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190507160741-ecd444e8653b/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190606165138-5da285871e9c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190624142023-c5567b49c5d0/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190726091711-fc99dfbffb4e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20191001151750-bb3f8db39f24/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20191204072324-ce4227a45e2e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20191228213918-04cbcbbfeed8/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200113162924-86b910548bc1/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200122134326-e047566fdf82/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200202164722-d101bd2416d5/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200212091648-12a6c2dcc1e4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200223170610-d5e6a3e2c0ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200302150141-5c8b2ff67527/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200323222414-85ca7c5b95cd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200331124033-c3d80250170d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200501052902-10377860bb8e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200511232937-7e40ca221e25/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200515095857-1151b9dac4a9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200523222454-059865788121/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200803210538-64077c9b5642/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210330210617-4fbd30eecc44/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210510120138-977fb7262007/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20210816183151-1e6c022a8912 h1:uCLL3g5wH2xjxVREVuAbP9JM5PPKjRbXKRa6IBjkzmU= -golang.org/x/sys v0.0.0-20210816183151-1e6c022a8912/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= -golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= +golang.org/x/sys v0.3.0 h1:w8ZOecv6NaNa/zC8944JTU3vz4u6Lagfk4RPQxv92NQ= +golang.org/x/sys v0.3.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= -golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= -golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= -golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= -golang.org/x/text v0.3.5/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= -golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= -golang.org/x/text v0.3.7 h1:olpwvP2KacW1ZWvsR7uQhoyTYvKAupfQrRGBFM352Gk= -golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= -golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= -golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= -golang.org/x/time v0.0.0-20191024005414-555d28b269f0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= -golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= +golang.org/x/text v0.5.0 h1:OLmvp0KP+FVG99Ct/qFiL/Fhk4zp4QQnZ7b2U+5piUM= +golang.org/x/text v0.5.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3HoIrodX9oNMXvdceNzlUR8zjMvY= golang.org/x/tools v0.0.0-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= -golang.org/x/tools v0.0.0-20190312151545-0bb0c0a6e846/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= -golang.org/x/tools v0.0.0-20190312170243-e65039ee4138/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= -golang.org/x/tools v0.0.0-20190425150028-36563e24a262/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= -golang.org/x/tools v0.0.0-20190506145303-2d16b83fe98c/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= golang.org/x/tools v0.0.0-20190524140312-2c0ae7006135/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= -golang.org/x/tools v0.0.0-20190606124116-d0a3d012864b/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= -golang.org/x/tools v0.0.0-20190621195816-6e04913cbbac/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= -golang.org/x/tools v0.0.0-20190628153133-6cdbf07be9d0/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= -golang.org/x/tools v0.0.0-20190816200558-6889da9d5479/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20190911174233-4f2ddba30aff/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20191012152004-8de300cfc20a/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20191113191852-77e3bb0ad9e7/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20191115202509-3a792d9c32b2/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20191125144606-a911d9008d1f/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20191130070609-6e064ea0cf2d/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20191216173652-a0e659d51361/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= -golang.org/x/tools v0.0.0-20191227053925-7b8e75db28f4/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= -golang.org/x/tools v0.0.0-20200117161641-43d50277825c/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= -golang.org/x/tools v0.0.0-20200122220014-bf1340f18c4a/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= -golang.org/x/tools v0.0.0-20200130002326-2f3ba24bd6e7/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= -golang.org/x/tools v0.0.0-20200204074204-1cc6d1ef6c74/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= -golang.org/x/tools v0.0.0-20200207183749-b753a1ba74fa/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= -golang.org/x/tools v0.0.0-20200212150539-ea181f53ac56/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= -golang.org/x/tools v0.0.0-20200224181240-023911ca70b2/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= -golang.org/x/tools v0.0.0-20200227222343-706bc42d1f0d/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= -golang.org/x/tools v0.0.0-20200304193943-95d2e580d8eb/go.mod h1:o4KQGtdN14AW+yjsvvwRTJJuXz8XRtIHtEnmAXLyFUw= -golang.org/x/tools v0.0.0-20200312045724-11d5b4c81c7d/go.mod h1:o4KQGtdN14AW+yjsvvwRTJJuXz8XRtIHtEnmAXLyFUw= -golang.org/x/tools v0.0.0-20200331025713-a30bf2db82d4/go.mod h1:Sl4aGygMT6LrqrWclx+PTx3U+LnKx/seiNR+3G19Ar8= -golang.org/x/tools v0.0.0-20200501065659-ab2804fb9c9d/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= -golang.org/x/tools v0.0.0-20200512131952-2bc93b1c0c88/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= -golang.org/x/tools v0.0.0-20200515010526-7d3b6ebf133d/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= -golang.org/x/tools v0.0.0-20200618134242-20370b0cb4b2/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= -golang.org/x/tools v0.0.0-20200729194436-6467de6f59a7/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= -golang.org/x/tools v0.0.0-20200804011535-6c149bb5ef0d/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= -golang.org/x/tools v0.0.0-20200825202427-b303f430e36d/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= -golang.org/x/tools v0.1.5/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= -golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= -golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= -golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1 h1:go1bK/D/BFZV2I8cIQd1NKEZ+0owSTG1fDTci4IqFcE= -golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= -google.golang.org/api v0.4.0/go.mod h1:8k5glujaEP+g9n7WNsDg8QP6cUVNI86fCNMcbazEtwE= -google.golang.org/api v0.7.0/go.mod h1:WtwebWUNSVBH/HAw79HIFXZNqEvBhG+Ra+ax0hx3E3M= -google.golang.org/api v0.8.0/go.mod h1:o4eAsZoiT+ibD93RtjEohWalFOjRDx6CVaqeizhEnKg= -google.golang.org/api v0.9.0/go.mod h1:o4eAsZoiT+ibD93RtjEohWalFOjRDx6CVaqeizhEnKg= -google.golang.org/api v0.13.0/go.mod h1:iLdEw5Ide6rF15KTC1Kkl0iskquN2gFfn9o9XIsbkAI= -google.golang.org/api v0.14.0/go.mod h1:iLdEw5Ide6rF15KTC1Kkl0iskquN2gFfn9o9XIsbkAI= -google.golang.org/api v0.15.0/go.mod h1:iLdEw5Ide6rF15KTC1Kkl0iskquN2gFfn9o9XIsbkAI= -google.golang.org/api v0.17.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= -google.golang.org/api v0.18.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= -google.golang.org/api v0.19.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= -google.golang.org/api v0.20.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= -google.golang.org/api v0.22.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= -google.golang.org/api v0.24.0/go.mod h1:lIXQywCXRcnZPGlsd8NbLnOjtAoL6em04bJ9+z0MncE= -google.golang.org/api v0.28.0/go.mod h1:lIXQywCXRcnZPGlsd8NbLnOjtAoL6em04bJ9+z0MncE= -google.golang.org/api v0.29.0/go.mod h1:Lcubydp8VUV7KeIHD9z2Bys/sm/vGKnG1UHuDBSrHWM= -google.golang.org/api v0.30.0/go.mod h1:QGmEvQ87FHZNiUVJkT14jQNYJ4ZJjdRF23ZXz5138Fc= google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= -google.golang.org/appengine v1.5.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= -google.golang.org/appengine v1.6.1/go.mod h1:i06prIuMbXzDqacNJfV5OdTW448YApPu5ww/cMBSeb0= -google.golang.org/appengine v1.6.5/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= -google.golang.org/appengine v1.6.6/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= -google.golang.org/genproto v0.0.0-20190307195333-5fe7a883aa19/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= -google.golang.org/genproto v0.0.0-20190418145605-e7d98fc518a7/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= -google.golang.org/genproto v0.0.0-20190425155659-357c62f0e4bb/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= -google.golang.org/genproto v0.0.0-20190502173448-54afdca5d873/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= -google.golang.org/genproto v0.0.0-20190801165951-fa694d86fc64/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= -google.golang.org/genproto v0.0.0-20190911173649-1774047e7e51/go.mod h1:IbNlFCBrqXvoKpeg0TB2l7cyZUmoaFKYIwrEpbDKLA8= -google.golang.org/genproto v0.0.0-20191108220845-16a3f7862a1a/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= -google.golang.org/genproto v0.0.0-20191115194625-c23dd37a84c9/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= -google.golang.org/genproto v0.0.0-20191216164720-4f79533eabd1/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= -google.golang.org/genproto v0.0.0-20191230161307-f3c370f40bfb/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= -google.golang.org/genproto v0.0.0-20200115191322-ca5a22157cba/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= -google.golang.org/genproto v0.0.0-20200122232147-0452cf42e150/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= -google.golang.org/genproto v0.0.0-20200204135345-fa8e72b47b90/go.mod h1:GmwEX6Z4W5gMy59cAlVYjN9JhxgbQH6Gn+gFDQe2lzA= -google.golang.org/genproto v0.0.0-20200212174721-66ed5ce911ce/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= -google.golang.org/genproto v0.0.0-20200224152610-e50cd9704f63/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= -google.golang.org/genproto v0.0.0-20200228133532-8c2c7df3a383/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= -google.golang.org/genproto v0.0.0-20200305110556-506484158171/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= -google.golang.org/genproto v0.0.0-20200312145019-da6875a35672/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= -google.golang.org/genproto v0.0.0-20200331122359-1ee6d9798940/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= -google.golang.org/genproto v0.0.0-20200430143042-b979b6f78d84/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= -google.golang.org/genproto v0.0.0-20200511104702-f5ebc3bea380/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= -google.golang.org/genproto v0.0.0-20200515170657-fc4c6c6a6587/go.mod h1:YsZOwe1myG/8QRHRsmBRE1LrgQY60beZKjly0O1fX9U= -google.golang.org/genproto v0.0.0-20200526211855-cb27e3aa2013/go.mod h1:NbSheEEYHJ7i3ixzK3sjbqSGDJWnxyFXZblF3eUsNvo= -google.golang.org/genproto v0.0.0-20200618031413-b414f8b61790/go.mod h1:jDfRM7FcilCzHH/e9qn6dsT145K34l5v+OpcnNgKAAA= -google.golang.org/genproto v0.0.0-20200729003335-053ba62fc06f/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto v0.0.0-20200804131852-c06518451d9c/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto v0.0.0-20200825200019-8632dd797987/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto v0.0.0-20211118181313-81c1377c94b1/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc= -google.golang.org/genproto v0.0.0-20220329172620-7be39ac1afc7 h1:HOL66YCI20JvN2hVk6o2YIp9i/3RvzVUz82PqNr7fXw= -google.golang.org/genproto v0.0.0-20220329172620-7be39ac1afc7/go.mod h1:8w6bsBMX6yCPbAVTeqQHvzxW0EIFigd5lZyahWgyfDo= +google.golang.org/genproto v0.0.0-20221118155620-16455021b5e6 h1:a2S6M0+660BgMNl++4JPlcAO/CjkqYItDEZwkoDQK7c= +google.golang.org/genproto v0.0.0-20221118155620-16455021b5e6/go.mod h1:rZS5c/ZVYMaOGBfO68GWtjOw/eLaZM1X6iVtgjZ+EWg= google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= -google.golang.org/grpc v1.20.1/go.mod h1:10oTOabMzJvdu6/UiuZezV6QK5dSlG84ov/aaiqXj38= -google.golang.org/grpc v1.21.1/go.mod h1:oYelfM1adQP15Ek0mdvEgi9Df8B9CZIaU1084ijfRaM= +google.golang.org/grpc v1.23.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg= google.golang.org/grpc v1.25.1/go.mod h1:c3i+UQWmh7LiEpx4sFZnkU36qjEYZ0imhYfXVyQciAY= -google.golang.org/grpc v1.26.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= -google.golang.org/grpc v1.27.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= -google.golang.org/grpc v1.27.1/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= -google.golang.org/grpc v1.28.0/go.mod h1:rpkK4SK4GF4Ach/+MFLZUBavHOvF2JJB5uozKKal+60= -google.golang.org/grpc v1.29.1/go.mod h1:itym6AZVZYACWQqET3MqgPpjcuV5QH3BxFS3IjizoKk= -google.golang.org/grpc v1.30.0/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak= -google.golang.org/grpc v1.31.0/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak= -google.golang.org/grpc v1.40.0/go.mod h1:ogyxbiOoUXAkP+4+xa6PZSE9DZgIHtSpzjDTB9KAK34= -google.golang.org/grpc v1.42.0/go.mod h1:k+4IHHFw41K8+bbowsex27ge2rCb65oeWqe4jJ590SU= -google.golang.org/grpc v1.45.0 h1:NEpgUqV3Z+ZjkqMsxMg11IaDrXY4RY6CQukSGK0uI1M= -google.golang.org/grpc v1.45.0/go.mod h1:lN7owxKUQEqMfSyQikvvk5tf/6zMPsrK+ONuO11+0rQ= -google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8= -google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0= -google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQJ+fmap5saPgwCLgHXTUD7jkjRqWcaiX5VyM= -google.golang.org/protobuf v1.20.1-0.20200309200217-e05f789c0967/go.mod h1:A+miEFZTKqfCUM6K7xSMQL9OKL/b6hQv+e19PK+JZNE= -google.golang.org/protobuf v1.21.0/go.mod h1:47Nbq4nVaFHyn7ilMalzfO3qCViNmqZ2kzikPIcrTAo= -google.golang.org/protobuf v1.22.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= -google.golang.org/protobuf v1.23.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= -google.golang.org/protobuf v1.23.1-0.20200526195155-81db48ad09cc/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= -google.golang.org/protobuf v1.24.0/go.mod h1:r/3tXBNzIEhYS9I1OUVjXDlt8tc493IdKGjtUeSXeh4= -google.golang.org/protobuf v1.25.0/go.mod h1:9JNX74DMeImyA3h4bdi1ymwjUzf21/xIlbajtzgsN7c= +google.golang.org/grpc v1.52.0 h1:kd48UiU7EHsV4rnLyOJRuP/Il/UHE7gdDAQ+SZI7nZk= +google.golang.org/grpc v1.52.0/go.mod h1:pu6fVzoFb+NBYNAvQL08ic+lvB2IojljRYuun5vorUY= google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw= google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= -google.golang.org/protobuf v1.27.1/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= -google.golang.org/protobuf v1.28.0 h1:w43yiav+6bVFTBQFZX0r7ipe9JQ1QsbMgHwbBziscLw= -google.golang.org/protobuf v1.28.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= -gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= -gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= -gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI= -gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= -gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c h1:dUUwHk2QECo/6vqA44rthZ8ie2QXMNeKRTHCNY2nXvo= -gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= +google.golang.org/protobuf v1.28.1 h1:d0NfwRgPtno5B1Wa6L2DAG+KivqkdutMf1UhdNx175w= +google.golang.org/protobuf v1.28.1/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= +gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= -honnef.co/go/tools v0.0.0-20190106161140-3f1c8253044a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= -honnef.co/go/tools v0.0.0-20190418001031-e561f6794a2a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= -honnef.co/go/tools v0.0.1-2019.2.3/go.mod h1:a3bituU0lyd329TUQxRnasdCoJDkEUEAqEt0JzvZhAg= -honnef.co/go/tools v0.0.1-2020.1.3/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k= -honnef.co/go/tools v0.0.1-2020.1.4/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k= -rsc.io/binaryregexp v0.2.0/go.mod h1:qTv7/COck+e2FymRvadv62gMdZztPaShugOCi3I+8D8= -rsc.io/quote/v3 v3.1.0/go.mod h1:yEA65RcK8LyAZtP9Kv3t0HmxON59tX3rD+tICJqUlj0= -rsc.io/sampler v1.3.0/go.mod h1:T1hPZKmBbMNahiBKFy5HrXp6adAjACjK9JXDnKaTXpA= From 1873901a3a5c42874c8c2f704b8fed43c5227ba7 Mon Sep 17 00:00:00 2001 From: Renuka Fernando Date: Tue, 7 Feb 2023 08:33:02 +0530 Subject: [PATCH 21/22] Remove license headers https://github.com/envoyproxy/ratelimit/pull/373#discussion_r1097607116 Signed-off-by: Renuka Fernando --- examples/xds-sotw-config-server/logger.go | 13 ------------- examples/xds-sotw-config-server/main/main.go | 13 ------------- examples/xds-sotw-config-server/resource.go | 13 ------------- examples/xds-sotw-config-server/server.go | 13 ------------- 4 files changed, 52 deletions(-) diff --git a/examples/xds-sotw-config-server/logger.go b/examples/xds-sotw-config-server/logger.go index 65315a776..bbfeadde7 100644 --- a/examples/xds-sotw-config-server/logger.go +++ b/examples/xds-sotw-config-server/logger.go @@ -1,16 +1,3 @@ -// Copyright 2020 Envoyproxy Authors -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. package example import ( diff --git a/examples/xds-sotw-config-server/main/main.go b/examples/xds-sotw-config-server/main/main.go index 5fe9453bf..82da545fa 100644 --- a/examples/xds-sotw-config-server/main/main.go +++ b/examples/xds-sotw-config-server/main/main.go @@ -1,16 +1,3 @@ -// Copyright 2020 Envoyproxy Authors -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. package main import ( diff --git a/examples/xds-sotw-config-server/resource.go b/examples/xds-sotw-config-server/resource.go index 6c43ed3d4..71df63249 100644 --- a/examples/xds-sotw-config-server/resource.go +++ b/examples/xds-sotw-config-server/resource.go @@ -1,16 +1,3 @@ -// Copyright 2020 Envoyproxy Authors -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. package example import ( diff --git a/examples/xds-sotw-config-server/server.go b/examples/xds-sotw-config-server/server.go index f727bf37b..0e120b584 100644 --- a/examples/xds-sotw-config-server/server.go +++ b/examples/xds-sotw-config-server/server.go @@ -1,16 +1,3 @@ -// Copyright 2020 Envoyproxy Authors -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. package example import ( From 4f54625c2aadb3f9162b5dc129c6262931939698 Mon Sep 17 00:00:00 2001 From: Renuka Fernando Date: Tue, 7 Feb 2023 08:37:29 +0530 Subject: [PATCH 22/22] Include rate limit config xDS proto Related to envoyproxy/ratelimit#371 Signed-off-by: Renuka Fernando --- .../config/ratelimit/v3/rls_conf.proto | 104 ++++++++++++++++++ 1 file changed, 104 insertions(+) create mode 100644 api/ratelimit/config/ratelimit/v3/rls_conf.proto diff --git a/api/ratelimit/config/ratelimit/v3/rls_conf.proto b/api/ratelimit/config/ratelimit/v3/rls_conf.proto new file mode 100644 index 000000000..cdb1836fd --- /dev/null +++ b/api/ratelimit/config/ratelimit/v3/rls_conf.proto @@ -0,0 +1,104 @@ +syntax = "proto3"; + +package ratelimit.config.ratelimit.v3; + +option java_package = "io.envoyproxy.ratelimit.config.ratelimit.v3"; +option java_outer_classname = "RlsConfigProto"; +option java_multiple_files = true; +option go_package = "github.com/envoyproxy/go-control-plane/ratelimit/config/ratelimit/v3;ratelimitv3"; + +// [#protodoc-title: Rate limit service configuration] +// A management server which supports ADS (Aggregated Discovery Service - SotW or delta protocol) can apply +// rate limit service configuration using the message type RateLimitConfig. The ADS client within the rate limit service +// will stream Discovery Request with the resource type URL "type.googleapis.com/ratelimit.config.ratelimit.v3.RateLimitConfig". +// The ADS management server should respond stream of Discovery Response with the same type URL and array of RateLimitConfigs +// within resources of the Discovery Response. + +// Rate limit configuration for a single domain. +message RateLimitConfig { + // Name of the rate limit configuration. This should be unique for each configuration. + string name = 1; + + // Domain name for the rate limit configuration. + string domain = 2; + + // List of rate limit configuration descriptors. + repeated RateLimitDescriptor descriptors = 3; +} + +// Rate limit configuration descriptor. +message RateLimitDescriptor { + // Key of the descriptor. + string key = 1; + + // Optional value of the descriptor. + string value = 2; + + // Rate limit policy of the descriptor. + RateLimitPolicy rate_limit = 3; + + // List of sub rate limit descriptors. + repeated RateLimitDescriptor descriptors = 4; + + // Mark the descriptor as shadow. When the values is true, rate limit service allow requests to the backend. + bool shadow_mode = 5; +} + +// Rate-limit policy. +message RateLimitPolicy { + // Unit of time for the rate limit. + RateLimitUnit unit = 1; + + // Number of requests allowed in the policy within `unit` time. + uint32 requests_per_unit = 2; + + // Mark the rate limit policy as unlimited. All requests are allowed to the backend. + bool unlimited = 3; + + // Optional name for the rate limit policy. Name the policy, if it should be replaced (dropped evaluation) by + // another policy. + string name = 4; + + // List of rate limit policies, this rate limit policy will replace (drop evaluation) + // For more information: https://github.com/envoyproxy/ratelimit/tree/0b2f4d5fb04bf55e1873e2c5e2bb28da67c0643f#replaces + // Example: https://github.com/envoyproxy/ratelimit/tree/0b2f4d5fb04bf55e1873e2c5e2bb28da67c0643f#example-7 + repeated RateLimitReplace replaces = 5; +} + +// Replace specifies the rate limit policy that should be replaced (dropped evaluation). +// For more information: https://github.com/envoyproxy/ratelimit/tree/0b2f4d5fb04bf55e1873e2c5e2bb28da67c0643f#replaces +message RateLimitReplace { + // Name of the rate limit policy, that is being replaced (dropped evaluation). + string name = 1; +} + +// Identifies the unit of of time for rate limit. +enum RateLimitUnit { + // The time unit is not known. + UNKNOWN = 0; + + // The time unit representing a second. + SECOND = 1; + + // The time unit representing a minute. + MINUTE = 2; + + // The time unit representing an hour. + HOUR = 3; + + // The time unit representing a day. + DAY = 4; +} + +// [#protodoc-title: Rate Limit Config Discovery Service (RLS Conf DS)] + +// Return list of all rate limit configs that rate limit service should be configured with. +service RateLimitConfigDiscoveryService { + rpc StreamRlsConfigs(stream envoy.service.discovery.v3.DiscoveryRequest) + returns (stream envoy.service.discovery.v3.DiscoveryResponse) { + } + + rpc FetchRlsConfigs(envoy.service.discovery.v3.DiscoveryRequest) + returns (envoy.service.discovery.v3.DiscoveryResponse) { + } +}