diff --git a/.github/workflows/lint.yaml b/.github/workflows/lint.yaml index b0944acd..597a29ba 100644 --- a/.github/workflows/lint.yaml +++ b/.github/workflows/lint.yaml @@ -1,5 +1,5 @@ name: Lint -on: [ push, pull_request, workflow_dispatch ] +on: [push] jobs: golangci-lint: @@ -14,4 +14,4 @@ jobs: with: skip-go-installation: true version: v1.50.1 - args: --timeout=10m \ No newline at end of file + args: --timeout=10m diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index 82cd9c79..37c9cf73 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -1,6 +1,5 @@ - name: Test -on: [push, pull_request] +on: [push] jobs: test: diff --git a/Makefile b/Makefile index fe92a2cd..d38e887b 100644 --- a/Makefile +++ b/Makefile @@ -2,7 +2,7 @@ NAME="github.com/goto/siren" LAST_COMMIT := $(shell git rev-parse --short HEAD) LAST_TAG := "$(shell git rev-list --tags --max-count=1)" APP_VERSION := "$(shell git describe --tags ${LAST_TAG})-next" -PROTON_COMMIT := "4fc96a5406f640044ebe0572385336af7bd221ae" +PROTON_COMMIT := "534a703026bd70fa464c3bedc6a9aef3f8fcdd19" .PHONY: all build test clean dist vet proto install diff --git a/cli/deps.go b/cli/deps.go index 0721a29b..433b2583 100644 --- a/cli/deps.go +++ b/cli/deps.go @@ -73,9 +73,6 @@ func InitDeps( templateRepository := postgres.NewTemplateRepository(pgClient) templateService := template.NewService(templateRepository) - providerRepository := postgres.NewProviderRepository(pgClient) - providerService := provider.NewService(providerRepository) - logRepository := postgres.NewLogRepository(pgClient) logService := log.NewService(logRepository) @@ -103,6 +100,13 @@ func InitDeps( ruleUploaders[k] = pc.(rule.RuleUploader) } + var supportedProviderTypes = []string{} + for typ := range providerPlugins { + supportedProviderTypes = append(supportedProviderTypes, typ) + } + providerRepository := postgres.NewProviderRepository(pgClient) + providerService := provider.NewService(providerRepository, supportedProviderTypes) + alertRepository := postgres.NewAlertRepository(pgClient) alertService := alert.NewService( alertRepository, diff --git a/core/alert/service_test.go b/core/alert/service_test.go index 1f318940..abaa7816 100644 --- a/core/alert/service_test.go +++ b/core/alert/service_test.go @@ -26,7 +26,7 @@ func TestService_List(t *testing.T) { {ID: 2, ProviderID: 1, ResourceName: "foo", Severity: "CRITICAL", MetricName: "baz", MetricValue: "0", Rule: "bar", TriggeredAt: timenow}, } - repositoryMock.EXPECT().List(mock.AnythingOfType("*context.emptyCtx"), alert.Filter{ + repositoryMock.EXPECT().List(mock.AnythingOfType("context.todoCtx"), alert.Filter{ ProviderID: 1, ResourceName: "foo", StartTime: 0, @@ -53,7 +53,7 @@ func TestService_List(t *testing.T) { {ID: 2, ProviderID: 1, ResourceName: "foo", Severity: "CRITICAL", MetricName: "baz", MetricValue: "0", Rule: "bar", TriggeredAt: timenow}, } - repositoryMock.EXPECT().List(mock.AnythingOfType("*context.emptyCtx"), mock.Anything).Return(dummyAlerts, nil) + repositoryMock.EXPECT().List(mock.AnythingOfType("context.todoCtx"), mock.Anything).Return(dummyAlerts, nil) actualAlerts, err := dummyService.List(ctx, alert.Filter{ ProviderID: 1, ResourceName: "foo", @@ -68,7 +68,7 @@ func TestService_List(t *testing.T) { t.Run("should call repository List method and handle errors", func(t *testing.T) { repositoryMock := &mocks.AlertRepository{} dummyService := alert.NewService(repositoryMock, nil, nil) - repositoryMock.EXPECT().List(mock.AnythingOfType("*context.emptyCtx"), mock.Anything). + repositoryMock.EXPECT().List(mock.AnythingOfType("context.todoCtx"), mock.Anything). Return(nil, errors.New("random error")) actualAlerts, err := dummyService.List(ctx, alert.Filter{ ProviderID: 1, @@ -116,7 +116,7 @@ func TestService_CreateAlerts(t *testing.T) { { name: "should return error if TransformToAlerts return error", setup: func(ar *mocks.AlertRepository, at *mocks.AlertTransformer) { - at.EXPECT().TransformToAlerts(mock.AnythingOfType("*context.emptyCtx"), mock.AnythingOfType("uint64"), mock.AnythingOfType("uint64"), mock.AnythingOfType("map[string]interface {}")).Return(nil, 0, errors.New("some error")) + at.EXPECT().TransformToAlerts(mock.AnythingOfType("context.todoCtx"), mock.AnythingOfType("uint64"), mock.AnythingOfType("uint64"), mock.AnythingOfType("map[string]interface {}")).Return(nil, 0, errors.New("some error")) }, alertsToBeCreated: alertsToBeCreated, wantErr: true, @@ -124,11 +124,11 @@ func TestService_CreateAlerts(t *testing.T) { { name: "should call repository Create method with proper arguments", setup: func(ar *mocks.AlertRepository, at *mocks.AlertTransformer) { - at.EXPECT().TransformToAlerts(mock.AnythingOfType("*context.emptyCtx"), mock.AnythingOfType("uint64"), mock.AnythingOfType("uint64"), mock.AnythingOfType("map[string]interface {}")).Return([]alert.Alert{ + at.EXPECT().TransformToAlerts(mock.AnythingOfType("context.todoCtx"), mock.AnythingOfType("uint64"), mock.AnythingOfType("uint64"), mock.AnythingOfType("map[string]interface {}")).Return([]alert.Alert{ {ID: 1, ProviderID: 1, ResourceName: "foo", Severity: "CRITICAL", MetricName: "lag", MetricValue: "20", Rule: "lagHigh", TriggeredAt: timenow}, }, 1, nil) - ar.EXPECT().Create(mock.AnythingOfType("*context.emptyCtx"), mock.AnythingOfType("alert.Alert")).Return(alert.Alert{ID: 1, ProviderID: 1, ResourceName: "foo", Severity: "CRITICAL", MetricName: "lag", MetricValue: "20", + ar.EXPECT().Create(mock.AnythingOfType("context.todoCtx"), mock.AnythingOfType("alert.Alert")).Return(alert.Alert{ID: 1, ProviderID: 1, ResourceName: "foo", Severity: "CRITICAL", MetricName: "lag", MetricValue: "20", Rule: "lagHigh", TriggeredAt: timenow}, nil) }, alertsToBeCreated: alertsToBeCreated, @@ -141,11 +141,11 @@ func TestService_CreateAlerts(t *testing.T) { { name: "should return error not found if repository return err relation", setup: func(ar *mocks.AlertRepository, at *mocks.AlertTransformer) { - at.EXPECT().TransformToAlerts(mock.AnythingOfType("*context.emptyCtx"), mock.AnythingOfType("uint64"), mock.AnythingOfType("uint64"), mock.AnythingOfType("map[string]interface {}")).Return([]alert.Alert{ + at.EXPECT().TransformToAlerts(mock.AnythingOfType("context.todoCtx"), mock.AnythingOfType("uint64"), mock.AnythingOfType("uint64"), mock.AnythingOfType("map[string]interface {}")).Return([]alert.Alert{ {ID: 1, ProviderID: 1, ResourceName: "foo", Severity: "CRITICAL", MetricName: "lag", MetricValue: "20", Rule: "lagHigh", TriggeredAt: timenow}, }, 1, nil) - ar.EXPECT().Create(mock.AnythingOfType("*context.emptyCtx"), mock.Anything).Return(alert.Alert{}, alert.ErrRelation) + ar.EXPECT().Create(mock.AnythingOfType("context.todoCtx"), mock.Anything).Return(alert.Alert{}, alert.ErrRelation) }, alertsToBeCreated: alertsToBeCreated, wantErr: true, @@ -153,11 +153,11 @@ func TestService_CreateAlerts(t *testing.T) { { name: "should handle errors from repository", setup: func(ar *mocks.AlertRepository, at *mocks.AlertTransformer) { - at.EXPECT().TransformToAlerts(mock.AnythingOfType("*context.emptyCtx"), mock.AnythingOfType("uint64"), mock.AnythingOfType("uint64"), mock.AnythingOfType("map[string]interface {}")).Return([]alert.Alert{ + at.EXPECT().TransformToAlerts(mock.AnythingOfType("context.todoCtx"), mock.AnythingOfType("uint64"), mock.AnythingOfType("uint64"), mock.AnythingOfType("map[string]interface {}")).Return([]alert.Alert{ {ID: 1, ProviderID: 1, ResourceName: "foo", Severity: "CRITICAL", MetricName: "lag", MetricValue: "20", Rule: "lagHigh", TriggeredAt: timenow}, }, 1, nil) - ar.EXPECT().Create(mock.AnythingOfType("*context.emptyCtx"), mock.Anything).Return(alert.Alert{}, errors.New("random error")) + ar.EXPECT().Create(mock.AnythingOfType("context.todoCtx"), mock.Anything).Return(alert.Alert{}, errors.New("random error")) }, alertsToBeCreated: alertsToBeCreated, wantErr: true, diff --git a/core/namespace/service_test.go b/core/namespace/service_test.go index 8a2e9b80..9e57511a 100644 --- a/core/namespace/service_test.go +++ b/core/namespace/service_test.go @@ -32,14 +32,14 @@ func TestService_ListNamespaces(t *testing.T) { { Description: "should return error if List repository error", Setup: func(rr *mocks.NamespaceRepository, e *mocks.Encryptor, tc testCase) { - rr.EXPECT().List(mock.AnythingOfType("*context.emptyCtx")).Return(nil, errors.New("some error")) + rr.EXPECT().List(mock.AnythingOfType("context.todoCtx")).Return(nil, errors.New("some error")) }, Err: errors.New("some error"), }, { Description: "should return error if List repository success and decrypt error", Setup: func(rr *mocks.NamespaceRepository, e *mocks.Encryptor, tc testCase) { - rr.EXPECT().List(mock.AnythingOfType("*context.emptyCtx")).Return([]namespace.EncryptedNamespace{ + rr.EXPECT().List(mock.AnythingOfType("context.todoCtx")).Return([]namespace.EncryptedNamespace{ { Namespace: &namespace.Namespace{ ID: 1, @@ -74,7 +74,7 @@ func TestService_ListNamespaces(t *testing.T) { { Description: "should return error if list repository success and decrypted object is not json", Setup: func(rr *mocks.NamespaceRepository, e *mocks.Encryptor, tc testCase) { - rr.EXPECT().List(mock.AnythingOfType("*context.emptyCtx")).Return([]namespace.EncryptedNamespace{ + rr.EXPECT().List(mock.AnythingOfType("context.todoCtx")).Return([]namespace.EncryptedNamespace{ { Namespace: &namespace.Namespace{ ID: 1, @@ -109,7 +109,7 @@ func TestService_ListNamespaces(t *testing.T) { { Description: "should success if list repository and decrypt success", Setup: func(rr *mocks.NamespaceRepository, e *mocks.Encryptor, tc testCase) { - rr.EXPECT().List(mock.AnythingOfType("*context.emptyCtx")).Return([]namespace.EncryptedNamespace{ + rr.EXPECT().List(mock.AnythingOfType("context.todoCtx")).Return([]namespace.EncryptedNamespace{ { Namespace: &namespace.Namespace{ ID: 1, @@ -214,7 +214,7 @@ func TestService_CreateNamespace(t *testing.T) { { Description: "should return error if provider service return error", Setup: func(rr *mocks.NamespaceRepository, e *mocks.Encryptor, ps *mocks.ProviderService, cs *mocks.ConfigSyncer, tc testCase) { - ps.EXPECT().Get(mock.AnythingOfType("*context.emptyCtx"), mock.AnythingOfType("uint64")).Return(nil, errors.New("some error")) + ps.EXPECT().Get(mock.AnythingOfType("context.todoCtx"), mock.AnythingOfType("uint64")).Return(nil, errors.New("some error")) }, NSpace: &namespace.Namespace{ Credentials: map[string]any{}, @@ -224,7 +224,7 @@ func TestService_CreateNamespace(t *testing.T) { { Description: "should return error if encrypt return error caused credential is not in json", Setup: func(rr *mocks.NamespaceRepository, e *mocks.Encryptor, ps *mocks.ProviderService, cs *mocks.ConfigSyncer, tc testCase) { - ps.EXPECT().Get(mock.AnythingOfType("*context.emptyCtx"), mock.AnythingOfType("uint64")).Return(&provider.Provider{Type: testProviderType}, nil) + ps.EXPECT().Get(mock.AnythingOfType("context.todoCtx"), mock.AnythingOfType("uint64")).Return(&provider.Provider{Type: testProviderType}, nil) }, NSpace: &namespace.Namespace{ Credentials: map[string]any{ @@ -236,7 +236,7 @@ func TestService_CreateNamespace(t *testing.T) { { Description: "should return error if encrypt return error", Setup: func(rr *mocks.NamespaceRepository, e *mocks.Encryptor, ps *mocks.ProviderService, cs *mocks.ConfigSyncer, tc testCase) { - ps.EXPECT().Get(mock.AnythingOfType("*context.emptyCtx"), mock.AnythingOfType("uint64")).Return(&provider.Provider{Type: testProviderType}, nil) + ps.EXPECT().Get(mock.AnythingOfType("context.todoCtx"), mock.AnythingOfType("uint64")).Return(&provider.Provider{Type: testProviderType}, nil) e.EXPECT().Encrypt(mock.AnythingOfType("secret.MaskableString")).Return("", errors.New("some error")) }, NSpace: &namespace.Namespace{ @@ -249,14 +249,14 @@ func TestService_CreateNamespace(t *testing.T) { { Description: "should return error if create repository error", Setup: func(rr *mocks.NamespaceRepository, e *mocks.Encryptor, ps *mocks.ProviderService, cs *mocks.ConfigSyncer, tc testCase) { - ps.EXPECT().Get(mock.AnythingOfType("*context.emptyCtx"), mock.AnythingOfType("uint64")).Return(&provider.Provider{Type: testProviderType}, nil) + ps.EXPECT().Get(mock.AnythingOfType("context.todoCtx"), mock.AnythingOfType("uint64")).Return(&provider.Provider{Type: testProviderType}, nil) e.EXPECT().Encrypt(mock.AnythingOfType("secret.MaskableString")).Return("some-ciphertext", nil) - rr.EXPECT().WithTransaction(mock.AnythingOfType("*context.emptyCtx")).Return(ctx) - rr.EXPECT().Create(mock.AnythingOfType("*context.emptyCtx"), &namespace.EncryptedNamespace{ + rr.EXPECT().WithTransaction(mock.AnythingOfType("context.todoCtx")).Return(ctx) + rr.EXPECT().Create(mock.AnythingOfType("context.todoCtx"), &namespace.EncryptedNamespace{ Namespace: tc.NSpace, CredentialString: "some-ciphertext", }).Return(errors.New("some error")) - rr.EXPECT().Rollback(mock.AnythingOfType("*context.emptyCtx"), mock.AnythingOfType("*errors.errorString")).Return(nil) + rr.EXPECT().Rollback(mock.AnythingOfType("context.todoCtx"), mock.AnythingOfType("*errors.errorString")).Return(nil) }, NSpace: &namespace.Namespace{ Credentials: map[string]any{ @@ -268,14 +268,14 @@ func TestService_CreateNamespace(t *testing.T) { { Description: "should return error conflict if create repository return duplicate error", Setup: func(rr *mocks.NamespaceRepository, e *mocks.Encryptor, ps *mocks.ProviderService, cs *mocks.ConfigSyncer, tc testCase) { - ps.EXPECT().Get(mock.AnythingOfType("*context.emptyCtx"), mock.AnythingOfType("uint64")).Return(&provider.Provider{Type: testProviderType}, nil) + ps.EXPECT().Get(mock.AnythingOfType("context.todoCtx"), mock.AnythingOfType("uint64")).Return(&provider.Provider{Type: testProviderType}, nil) e.EXPECT().Encrypt(mock.AnythingOfType("secret.MaskableString")).Return("some-ciphertext", nil) - rr.EXPECT().WithTransaction(mock.AnythingOfType("*context.emptyCtx")).Return(ctx) - rr.EXPECT().Create(mock.AnythingOfType("*context.emptyCtx"), &namespace.EncryptedNamespace{ + rr.EXPECT().WithTransaction(mock.AnythingOfType("context.todoCtx")).Return(ctx) + rr.EXPECT().Create(mock.AnythingOfType("context.todoCtx"), &namespace.EncryptedNamespace{ Namespace: tc.NSpace, CredentialString: "some-ciphertext", }).Return(namespace.ErrDuplicate) - rr.EXPECT().Rollback(mock.AnythingOfType("*context.emptyCtx"), mock.AnythingOfType("*errors.errorString")).Return(nil) + rr.EXPECT().Rollback(mock.AnythingOfType("context.todoCtx"), mock.AnythingOfType("*errors.errorString")).Return(nil) }, NSpace: &namespace.Namespace{ Credentials: map[string]any{ @@ -287,14 +287,14 @@ func TestService_CreateNamespace(t *testing.T) { { Description: "should return error not found if create repository return relation error", Setup: func(rr *mocks.NamespaceRepository, e *mocks.Encryptor, ps *mocks.ProviderService, cs *mocks.ConfigSyncer, tc testCase) { - ps.EXPECT().Get(mock.AnythingOfType("*context.emptyCtx"), mock.AnythingOfType("uint64")).Return(&provider.Provider{Type: testProviderType}, nil) + ps.EXPECT().Get(mock.AnythingOfType("context.todoCtx"), mock.AnythingOfType("uint64")).Return(&provider.Provider{Type: testProviderType}, nil) e.EXPECT().Encrypt(mock.AnythingOfType("secret.MaskableString")).Return("some-ciphertext", nil) - rr.EXPECT().WithTransaction(mock.AnythingOfType("*context.emptyCtx")).Return(ctx) - rr.EXPECT().Create(mock.AnythingOfType("*context.emptyCtx"), &namespace.EncryptedNamespace{ + rr.EXPECT().WithTransaction(mock.AnythingOfType("context.todoCtx")).Return(ctx) + rr.EXPECT().Create(mock.AnythingOfType("context.todoCtx"), &namespace.EncryptedNamespace{ Namespace: tc.NSpace, CredentialString: "some-ciphertext", }).Return(namespace.ErrRelation) - rr.EXPECT().Rollback(mock.AnythingOfType("*context.emptyCtx"), mock.AnythingOfType("*errors.errorString")).Return(nil) + rr.EXPECT().Rollback(mock.AnythingOfType("context.todoCtx"), mock.AnythingOfType("*errors.errorString")).Return(nil) }, NSpace: &namespace.Namespace{ Credentials: map[string]any{ @@ -306,15 +306,15 @@ func TestService_CreateNamespace(t *testing.T) { { Description: "should return error if create repository success & sync config return error", Setup: func(rr *mocks.NamespaceRepository, e *mocks.Encryptor, ps *mocks.ProviderService, cs *mocks.ConfigSyncer, tc testCase) { - ps.EXPECT().Get(mock.AnythingOfType("*context.emptyCtx"), mock.AnythingOfType("uint64")).Return(&provider.Provider{Type: testProviderType}, nil) + ps.EXPECT().Get(mock.AnythingOfType("context.todoCtx"), mock.AnythingOfType("uint64")).Return(&provider.Provider{Type: testProviderType}, nil) e.EXPECT().Encrypt(mock.AnythingOfType("secret.MaskableString")).Return("some-ciphertext", nil) - rr.EXPECT().WithTransaction(mock.AnythingOfType("*context.emptyCtx")).Return(ctx) - rr.EXPECT().Create(mock.AnythingOfType("*context.emptyCtx"), &namespace.EncryptedNamespace{ + rr.EXPECT().WithTransaction(mock.AnythingOfType("context.todoCtx")).Return(ctx) + rr.EXPECT().Create(mock.AnythingOfType("context.todoCtx"), &namespace.EncryptedNamespace{ Namespace: tc.NSpace, CredentialString: "some-ciphertext", }).Return(nil) - cs.EXPECT().SyncRuntimeConfig(mock.AnythingOfType("*context.emptyCtx"), mock.AnythingOfType("uint64"), mock.AnythingOfType("string"), mock.AnythingOfType("provider.Provider")).Return(errors.New("some error")) - rr.EXPECT().Rollback(mock.AnythingOfType("*context.emptyCtx"), mock.AnythingOfType("*errors.errorString")).Return(nil) + cs.EXPECT().SyncRuntimeConfig(mock.AnythingOfType("context.todoCtx"), mock.AnythingOfType("uint64"), mock.AnythingOfType("string"), mock.AnythingOfType("provider.Provider")).Return(errors.New("some error")) + rr.EXPECT().Rollback(mock.AnythingOfType("context.todoCtx"), mock.AnythingOfType("*errors.errorString")).Return(nil) }, NSpace: &namespace.Namespace{ Credentials: map[string]any{ @@ -326,15 +326,15 @@ func TestService_CreateNamespace(t *testing.T) { { Description: "should return nil error if create repository success & sync config success", Setup: func(rr *mocks.NamespaceRepository, e *mocks.Encryptor, ps *mocks.ProviderService, cs *mocks.ConfigSyncer, tc testCase) { - ps.EXPECT().Get(mock.AnythingOfType("*context.emptyCtx"), mock.AnythingOfType("uint64")).Return(&provider.Provider{Type: testProviderType}, nil) + ps.EXPECT().Get(mock.AnythingOfType("context.todoCtx"), mock.AnythingOfType("uint64")).Return(&provider.Provider{Type: testProviderType}, nil) e.EXPECT().Encrypt(mock.AnythingOfType("secret.MaskableString")).Return("some-ciphertext", nil) - rr.EXPECT().WithTransaction(mock.AnythingOfType("*context.emptyCtx")).Return(ctx) - rr.EXPECT().Create(mock.AnythingOfType("*context.emptyCtx"), &namespace.EncryptedNamespace{ + rr.EXPECT().WithTransaction(mock.AnythingOfType("context.todoCtx")).Return(ctx) + rr.EXPECT().Create(mock.AnythingOfType("context.todoCtx"), &namespace.EncryptedNamespace{ Namespace: tc.NSpace, CredentialString: "some-ciphertext", }).Return(nil) - cs.EXPECT().SyncRuntimeConfig(mock.AnythingOfType("*context.emptyCtx"), mock.AnythingOfType("uint64"), mock.AnythingOfType("string"), mock.AnythingOfType("provider.Provider")).Return(nil) - rr.EXPECT().Commit(mock.AnythingOfType("*context.emptyCtx")).Return(nil) + cs.EXPECT().SyncRuntimeConfig(mock.AnythingOfType("context.todoCtx"), mock.AnythingOfType("uint64"), mock.AnythingOfType("string"), mock.AnythingOfType("provider.Provider")).Return(nil) + rr.EXPECT().Commit(mock.AnythingOfType("context.todoCtx")).Return(nil) }, NSpace: &namespace.Namespace{ Credentials: map[string]any{ @@ -390,21 +390,21 @@ func TestService_GetNamespace(t *testing.T) { { Description: "should return error if Get repository error", Setup: func(rr *mocks.NamespaceRepository, e *mocks.Encryptor, tc testCase) { - rr.EXPECT().Get(mock.AnythingOfType("*context.emptyCtx"), testID).Return(nil, errors.New("some error")) + rr.EXPECT().Get(mock.AnythingOfType("context.todoCtx"), testID).Return(nil, errors.New("some error")) }, Err: errors.New("some error"), }, { Description: "should return error not found if Get repository return not found error", Setup: func(rr *mocks.NamespaceRepository, e *mocks.Encryptor, tc testCase) { - rr.EXPECT().Get(mock.AnythingOfType("*context.emptyCtx"), testID).Return(nil, namespace.NotFoundError{}) + rr.EXPECT().Get(mock.AnythingOfType("context.todoCtx"), testID).Return(nil, namespace.NotFoundError{}) }, Err: errors.New("namespace not found"), }, { Description: "should return error if Get repository success and decrypt return error", Setup: func(rr *mocks.NamespaceRepository, e *mocks.Encryptor, tc testCase) { - rr.EXPECT().Get(mock.AnythingOfType("*context.emptyCtx"), testID).Return(&namespace.EncryptedNamespace{ + rr.EXPECT().Get(mock.AnythingOfType("context.todoCtx"), testID).Return(&namespace.EncryptedNamespace{ Namespace: tc.NSpace, CredentialString: "some-ciphertext", }, nil) @@ -415,7 +415,7 @@ func TestService_GetNamespace(t *testing.T) { { Description: "should return error if Get repository success and decrypted credentials is not json marshallable", Setup: func(rr *mocks.NamespaceRepository, e *mocks.Encryptor, tc testCase) { - rr.EXPECT().Get(mock.AnythingOfType("*context.emptyCtx"), testID).Return(&namespace.EncryptedNamespace{ + rr.EXPECT().Get(mock.AnythingOfType("context.todoCtx"), testID).Return(&namespace.EncryptedNamespace{ Namespace: tc.NSpace, CredentialString: "some-ciphertext", }, nil) @@ -426,7 +426,7 @@ func TestService_GetNamespace(t *testing.T) { { Description: "should return nil error if Get repository success and decrypt success", Setup: func(rr *mocks.NamespaceRepository, e *mocks.Encryptor, tc testCase) { - rr.EXPECT().Get(mock.AnythingOfType("*context.emptyCtx"), testID).Return(&namespace.EncryptedNamespace{ + rr.EXPECT().Get(mock.AnythingOfType("context.todoCtx"), testID).Return(&namespace.EncryptedNamespace{ Namespace: tc.NSpace, CredentialString: "some-ciphertext", }, nil) @@ -484,7 +484,7 @@ func TestService_UpdateNamespace(t *testing.T) { { Description: "should return error if provider service return error", Setup: func(rr *mocks.NamespaceRepository, e *mocks.Encryptor, cs *mocks.ConfigSyncer, tc testCase) { - rr.EXPECT().Get(mock.AnythingOfType("*context.emptyCtx"), mock.AnythingOfType("uint64")).Return(nil, errors.New("some error")) + rr.EXPECT().Get(mock.AnythingOfType("context.todoCtx"), mock.AnythingOfType("uint64")).Return(nil, errors.New("some error")) }, NSpace: &namespace.Namespace{ Credentials: map[string]any{}, @@ -494,7 +494,7 @@ func TestService_UpdateNamespace(t *testing.T) { { Description: "should return error if decrypt return error", Setup: func(rr *mocks.NamespaceRepository, e *mocks.Encryptor, cs *mocks.ConfigSyncer, tc testCase) { - rr.EXPECT().Get(mock.AnythingOfType("*context.emptyCtx"), mock.AnythingOfType("uint64")).Return(&namespace.EncryptedNamespace{Namespace: &namespace.Namespace{Provider: provider.Provider{Type: testProviderType}}}, nil) + rr.EXPECT().Get(mock.AnythingOfType("context.todoCtx"), mock.AnythingOfType("uint64")).Return(&namespace.EncryptedNamespace{Namespace: &namespace.Namespace{Provider: provider.Provider{Type: testProviderType}}}, nil) e.EXPECT().Decrypt(mock.AnythingOfType("secret.MaskableString")).Return("", errors.New("some error")) }, NSpace: &namespace.Namespace{ @@ -505,7 +505,7 @@ func TestService_UpdateNamespace(t *testing.T) { { Description: "should return error if encrypt return error caused credential is not in json", Setup: func(rr *mocks.NamespaceRepository, e *mocks.Encryptor, cs *mocks.ConfigSyncer, tc testCase) { - rr.EXPECT().Get(mock.AnythingOfType("*context.emptyCtx"), mock.AnythingOfType("uint64")).Return(&namespace.EncryptedNamespace{Namespace: &namespace.Namespace{Provider: provider.Provider{Type: testProviderType}}}, nil) + rr.EXPECT().Get(mock.AnythingOfType("context.todoCtx"), mock.AnythingOfType("uint64")).Return(&namespace.EncryptedNamespace{Namespace: &namespace.Namespace{Provider: provider.Provider{Type: testProviderType}}}, nil) e.EXPECT().Decrypt(mock.AnythingOfType("secret.MaskableString")).Return("{ \"key\": \"value\" }", nil) }, NSpace: &namespace.Namespace{ @@ -518,7 +518,7 @@ func TestService_UpdateNamespace(t *testing.T) { { Description: "should return error if encrypt return error", Setup: func(rr *mocks.NamespaceRepository, e *mocks.Encryptor, cs *mocks.ConfigSyncer, tc testCase) { - rr.EXPECT().Get(mock.AnythingOfType("*context.emptyCtx"), mock.AnythingOfType("uint64")).Return(&namespace.EncryptedNamespace{Namespace: &namespace.Namespace{Provider: provider.Provider{Type: testProviderType}}}, nil) + rr.EXPECT().Get(mock.AnythingOfType("context.todoCtx"), mock.AnythingOfType("uint64")).Return(&namespace.EncryptedNamespace{Namespace: &namespace.Namespace{Provider: provider.Provider{Type: testProviderType}}}, nil) e.EXPECT().Decrypt(mock.AnythingOfType("secret.MaskableString")).Return("{ \"key\": \"value\" }", nil) e.EXPECT().Encrypt(mock.AnythingOfType("secret.MaskableString")).Return("", errors.New("some error")) }, @@ -532,15 +532,15 @@ func TestService_UpdateNamespace(t *testing.T) { { Description: "should return error if update repository error", Setup: func(rr *mocks.NamespaceRepository, e *mocks.Encryptor, cs *mocks.ConfigSyncer, tc testCase) { - rr.EXPECT().Get(mock.AnythingOfType("*context.emptyCtx"), mock.AnythingOfType("uint64")).Return(&namespace.EncryptedNamespace{Namespace: &namespace.Namespace{Provider: provider.Provider{Type: testProviderType}}}, nil) + rr.EXPECT().Get(mock.AnythingOfType("context.todoCtx"), mock.AnythingOfType("uint64")).Return(&namespace.EncryptedNamespace{Namespace: &namespace.Namespace{Provider: provider.Provider{Type: testProviderType}}}, nil) e.EXPECT().Decrypt(mock.AnythingOfType("secret.MaskableString")).Return("{ \"key\": \"value\" }", nil) e.EXPECT().Encrypt(mock.AnythingOfType("secret.MaskableString")).Return("some-ciphertext", nil) - rr.EXPECT().WithTransaction(mock.AnythingOfType("*context.emptyCtx")).Return(ctx) - rr.EXPECT().Update(mock.AnythingOfType("*context.emptyCtx"), &namespace.EncryptedNamespace{ + rr.EXPECT().WithTransaction(mock.AnythingOfType("context.todoCtx")).Return(ctx) + rr.EXPECT().Update(mock.AnythingOfType("context.todoCtx"), &namespace.EncryptedNamespace{ Namespace: tc.NSpace, CredentialString: "some-ciphertext", }).Return(errors.New("some error")) - rr.EXPECT().Rollback(mock.AnythingOfType("*context.emptyCtx"), mock.AnythingOfType("*errors.errorString")).Return(nil) + rr.EXPECT().Rollback(mock.AnythingOfType("context.todoCtx"), mock.AnythingOfType("*errors.errorString")).Return(nil) }, NSpace: &namespace.Namespace{ Credentials: map[string]any{ @@ -552,15 +552,15 @@ func TestService_UpdateNamespace(t *testing.T) { { Description: "should return error not found if update repository return not found error", Setup: func(rr *mocks.NamespaceRepository, e *mocks.Encryptor, cs *mocks.ConfigSyncer, tc testCase) { - rr.EXPECT().Get(mock.AnythingOfType("*context.emptyCtx"), mock.AnythingOfType("uint64")).Return(&namespace.EncryptedNamespace{Namespace: &namespace.Namespace{Provider: provider.Provider{Type: testProviderType}}}, nil) + rr.EXPECT().Get(mock.AnythingOfType("context.todoCtx"), mock.AnythingOfType("uint64")).Return(&namespace.EncryptedNamespace{Namespace: &namespace.Namespace{Provider: provider.Provider{Type: testProviderType}}}, nil) e.EXPECT().Decrypt(mock.AnythingOfType("secret.MaskableString")).Return("{ \"key\": \"value\" }", nil) e.EXPECT().Encrypt(mock.AnythingOfType("secret.MaskableString")).Return("some-ciphertext", nil) - rr.EXPECT().WithTransaction(mock.AnythingOfType("*context.emptyCtx")).Return(ctx) - rr.EXPECT().Update(mock.AnythingOfType("*context.emptyCtx"), &namespace.EncryptedNamespace{ + rr.EXPECT().WithTransaction(mock.AnythingOfType("context.todoCtx")).Return(ctx) + rr.EXPECT().Update(mock.AnythingOfType("context.todoCtx"), &namespace.EncryptedNamespace{ Namespace: tc.NSpace, CredentialString: "some-ciphertext", }).Return(namespace.NotFoundError{}) - rr.EXPECT().Rollback(mock.AnythingOfType("*context.emptyCtx"), mock.AnythingOfType("namespace.NotFoundError")).Return(nil) + rr.EXPECT().Rollback(mock.AnythingOfType("context.todoCtx"), mock.AnythingOfType("namespace.NotFoundError")).Return(nil) }, NSpace: &namespace.Namespace{ Credentials: map[string]any{ @@ -572,15 +572,15 @@ func TestService_UpdateNamespace(t *testing.T) { { Description: "should return error not found if update repository return relation error", Setup: func(rr *mocks.NamespaceRepository, e *mocks.Encryptor, cs *mocks.ConfigSyncer, tc testCase) { - rr.EXPECT().Get(mock.AnythingOfType("*context.emptyCtx"), mock.AnythingOfType("uint64")).Return(&namespace.EncryptedNamespace{Namespace: &namespace.Namespace{Provider: provider.Provider{Type: testProviderType}}}, nil) + rr.EXPECT().Get(mock.AnythingOfType("context.todoCtx"), mock.AnythingOfType("uint64")).Return(&namespace.EncryptedNamespace{Namespace: &namespace.Namespace{Provider: provider.Provider{Type: testProviderType}}}, nil) e.EXPECT().Decrypt(mock.AnythingOfType("secret.MaskableString")).Return("{ \"key\": \"value\" }", nil) e.EXPECT().Encrypt(mock.AnythingOfType("secret.MaskableString")).Return("some-ciphertext", nil) - rr.EXPECT().WithTransaction(mock.AnythingOfType("*context.emptyCtx")).Return(ctx) - rr.EXPECT().Update(mock.AnythingOfType("*context.emptyCtx"), &namespace.EncryptedNamespace{ + rr.EXPECT().WithTransaction(mock.AnythingOfType("context.todoCtx")).Return(ctx) + rr.EXPECT().Update(mock.AnythingOfType("context.todoCtx"), &namespace.EncryptedNamespace{ Namespace: tc.NSpace, CredentialString: "some-ciphertext", }).Return(namespace.ErrRelation) - rr.EXPECT().Rollback(mock.AnythingOfType("*context.emptyCtx"), mock.AnythingOfType("*errors.errorString")).Return(nil) + rr.EXPECT().Rollback(mock.AnythingOfType("context.todoCtx"), mock.AnythingOfType("*errors.errorString")).Return(nil) }, NSpace: &namespace.Namespace{ Credentials: map[string]any{ @@ -592,15 +592,15 @@ func TestService_UpdateNamespace(t *testing.T) { { Description: "should return error conflict if update repository return error duplicate", Setup: func(rr *mocks.NamespaceRepository, e *mocks.Encryptor, cs *mocks.ConfigSyncer, tc testCase) { - rr.EXPECT().Get(mock.AnythingOfType("*context.emptyCtx"), mock.AnythingOfType("uint64")).Return(&namespace.EncryptedNamespace{Namespace: &namespace.Namespace{Provider: provider.Provider{Type: testProviderType}}}, nil) + rr.EXPECT().Get(mock.AnythingOfType("context.todoCtx"), mock.AnythingOfType("uint64")).Return(&namespace.EncryptedNamespace{Namespace: &namespace.Namespace{Provider: provider.Provider{Type: testProviderType}}}, nil) e.EXPECT().Decrypt(mock.AnythingOfType("secret.MaskableString")).Return("{ \"key\": \"value\" }", nil) e.EXPECT().Encrypt(mock.AnythingOfType("secret.MaskableString")).Return("some-ciphertext", nil) - rr.EXPECT().WithTransaction(mock.AnythingOfType("*context.emptyCtx")).Return(ctx) - rr.EXPECT().Update(mock.AnythingOfType("*context.emptyCtx"), &namespace.EncryptedNamespace{ + rr.EXPECT().WithTransaction(mock.AnythingOfType("context.todoCtx")).Return(ctx) + rr.EXPECT().Update(mock.AnythingOfType("context.todoCtx"), &namespace.EncryptedNamespace{ Namespace: tc.NSpace, CredentialString: "some-ciphertext", }).Return(namespace.ErrDuplicate) - rr.EXPECT().Rollback(mock.AnythingOfType("*context.emptyCtx"), mock.AnythingOfType("*errors.errorString")).Return(nil) + rr.EXPECT().Rollback(mock.AnythingOfType("context.todoCtx"), mock.AnythingOfType("*errors.errorString")).Return(nil) }, NSpace: &namespace.Namespace{ Credentials: map[string]any{ @@ -612,16 +612,16 @@ func TestService_UpdateNamespace(t *testing.T) { { Description: "should return error if sync config return error", Setup: func(rr *mocks.NamespaceRepository, e *mocks.Encryptor, cs *mocks.ConfigSyncer, tc testCase) { - rr.EXPECT().Get(mock.AnythingOfType("*context.emptyCtx"), mock.AnythingOfType("uint64")).Return(&namespace.EncryptedNamespace{Namespace: &namespace.Namespace{Provider: provider.Provider{Type: testProviderType}}}, nil) + rr.EXPECT().Get(mock.AnythingOfType("context.todoCtx"), mock.AnythingOfType("uint64")).Return(&namespace.EncryptedNamespace{Namespace: &namespace.Namespace{Provider: provider.Provider{Type: testProviderType}}}, nil) e.EXPECT().Decrypt(mock.AnythingOfType("secret.MaskableString")).Return("{ \"key\": \"value\" }", nil) e.EXPECT().Encrypt(mock.AnythingOfType("secret.MaskableString")).Return("some-ciphertext", nil) - rr.EXPECT().WithTransaction(mock.AnythingOfType("*context.emptyCtx")).Return(ctx) - rr.EXPECT().Update(mock.AnythingOfType("*context.emptyCtx"), &namespace.EncryptedNamespace{ + rr.EXPECT().WithTransaction(mock.AnythingOfType("context.todoCtx")).Return(ctx) + rr.EXPECT().Update(mock.AnythingOfType("context.todoCtx"), &namespace.EncryptedNamespace{ Namespace: tc.NSpace, CredentialString: "some-ciphertext", }).Return(nil) - cs.EXPECT().SyncRuntimeConfig(mock.AnythingOfType("*context.emptyCtx"), mock.AnythingOfType("uint64"), mock.AnythingOfType("string"), mock.AnythingOfType("provider.Provider")).Return(errors.New("some error")) - rr.EXPECT().Rollback(mock.AnythingOfType("*context.emptyCtx"), mock.AnythingOfType("*errors.errorString")).Return(nil) + cs.EXPECT().SyncRuntimeConfig(mock.AnythingOfType("context.todoCtx"), mock.AnythingOfType("uint64"), mock.AnythingOfType("string"), mock.AnythingOfType("provider.Provider")).Return(errors.New("some error")) + rr.EXPECT().Rollback(mock.AnythingOfType("context.todoCtx"), mock.AnythingOfType("*errors.errorString")).Return(nil) }, NSpace: &namespace.Namespace{ Credentials: map[string]any{ @@ -633,16 +633,16 @@ func TestService_UpdateNamespace(t *testing.T) { { Description: "should return nil error if update repository success", Setup: func(rr *mocks.NamespaceRepository, e *mocks.Encryptor, cs *mocks.ConfigSyncer, tc testCase) { - rr.EXPECT().Get(mock.AnythingOfType("*context.emptyCtx"), mock.AnythingOfType("uint64")).Return(&namespace.EncryptedNamespace{Namespace: &namespace.Namespace{Provider: provider.Provider{Type: testProviderType}}}, nil) + rr.EXPECT().Get(mock.AnythingOfType("context.todoCtx"), mock.AnythingOfType("uint64")).Return(&namespace.EncryptedNamespace{Namespace: &namespace.Namespace{Provider: provider.Provider{Type: testProviderType}}}, nil) e.EXPECT().Decrypt(mock.AnythingOfType("secret.MaskableString")).Return("{ \"key\": \"value\" }", nil) e.EXPECT().Encrypt(mock.AnythingOfType("secret.MaskableString")).Return("some-ciphertext", nil) - rr.EXPECT().WithTransaction(mock.AnythingOfType("*context.emptyCtx")).Return(ctx) - rr.EXPECT().Update(mock.AnythingOfType("*context.emptyCtx"), &namespace.EncryptedNamespace{ + rr.EXPECT().WithTransaction(mock.AnythingOfType("context.todoCtx")).Return(ctx) + rr.EXPECT().Update(mock.AnythingOfType("context.todoCtx"), &namespace.EncryptedNamespace{ Namespace: tc.NSpace, CredentialString: "some-ciphertext", }).Return(nil) - cs.EXPECT().SyncRuntimeConfig(mock.AnythingOfType("*context.emptyCtx"), mock.AnythingOfType("uint64"), mock.AnythingOfType("string"), mock.AnythingOfType("provider.Provider")).Return(nil) - rr.EXPECT().Commit(mock.AnythingOfType("*context.emptyCtx")).Return(nil) + cs.EXPECT().SyncRuntimeConfig(mock.AnythingOfType("context.todoCtx"), mock.AnythingOfType("uint64"), mock.AnythingOfType("string"), mock.AnythingOfType("provider.Provider")).Return(nil) + rr.EXPECT().Commit(mock.AnythingOfType("context.todoCtx")).Return(nil) }, NSpace: &namespace.Namespace{ Credentials: map[string]any{ @@ -691,7 +691,7 @@ func TestDeleteNamespace(t *testing.T) { t.Run("should call repository Delete method and return nil if no error", func(t *testing.T) { repositoryMock := &mocks.NamespaceRepository{} dummyService := namespace.NewService(nil, repositoryMock, nil, nil) - repositoryMock.EXPECT().Delete(mock.AnythingOfType("*context.emptyCtx"), namespaceID).Return(nil).Once() + repositoryMock.EXPECT().Delete(mock.AnythingOfType("context.todoCtx"), namespaceID).Return(nil).Once() err := dummyService.Delete(ctx, namespaceID) assert.Nil(t, err) repositoryMock.AssertExpectations(t) @@ -700,7 +700,7 @@ func TestDeleteNamespace(t *testing.T) { t.Run("should call repository Delete method and return error if any", func(t *testing.T) { repositoryMock := &mocks.NamespaceRepository{} dummyService := namespace.NewService(nil, repositoryMock, nil, nil) - repositoryMock.EXPECT().Delete(mock.AnythingOfType("*context.emptyCtx"), namespaceID).Return(errors.New("random error")).Once() + repositoryMock.EXPECT().Delete(mock.AnythingOfType("context.todoCtx"), namespaceID).Return(errors.New("random error")).Once() err := dummyService.Delete(ctx, namespaceID) assert.EqualError(t, err, "random error") repositoryMock.AssertExpectations(t) diff --git a/core/namespace/v1beta1.go b/core/namespace/v1beta1.go new file mode 100644 index 00000000..fd076d09 --- /dev/null +++ b/core/namespace/v1beta1.go @@ -0,0 +1,42 @@ +package namespace + +import ( + "fmt" + + "github.com/goto/siren/core/provider" + sirenv1beta1 "github.com/goto/siren/proto/gotocompany/siren/v1beta1" + "google.golang.org/protobuf/types/known/structpb" + "google.golang.org/protobuf/types/known/timestamppb" +) + +func (n *Namespace) ToV1beta1Proto() (*sirenv1beta1.Namespace, error) { + credentials, err := structpb.NewStruct(n.Credentials) + if err != nil { + return nil, fmt.Errorf("failed to fetch namespace credentials: %w", err) + } + + return &sirenv1beta1.Namespace{ + Id: n.ID, + Urn: n.URN, + Name: n.Name, + Credentials: credentials, + Labels: n.Labels, + CreatedAt: timestamppb.New(n.CreatedAt), + UpdatedAt: timestamppb.New(n.UpdatedAt), + }, nil +} + +func FromV1beta1Proto(proto *sirenv1beta1.Namespace) *Namespace { + return &Namespace{ + ID: proto.GetId(), + URN: proto.GetUrn(), + Name: proto.GetName(), + Provider: provider.Provider{ + ID: proto.GetProvider(), + }, + Credentials: proto.GetCredentials().AsMap(), + Labels: proto.GetLabels(), + CreatedAt: proto.CreatedAt.AsTime(), + UpdatedAt: proto.UpdatedAt.AsTime(), + } +} diff --git a/core/notification/dispatch_receiver_service_test.go b/core/notification/dispatch_receiver_service_test.go index 985f29a7..7923c643 100644 --- a/core/notification/dispatch_receiver_service_test.go +++ b/core/notification/dispatch_receiver_service_test.go @@ -41,7 +41,7 @@ func TestDispatchReceiverService_PrepareMessage(t *testing.T) { }, }, setup: func(rs *mocks.ReceiverService, n *mocks.Notifier) { - rs.EXPECT().Get(mock.AnythingOfType("*context.emptyCtx"), mock.AnythingOfType("uint64")).Return(nil, errors.New("some error")) + rs.EXPECT().Get(mock.AnythingOfType("context.todoCtx"), mock.AnythingOfType("uint64")).Return(nil, errors.New("some error")) }, wantErr: true, }, @@ -53,7 +53,7 @@ func TestDispatchReceiverService_PrepareMessage(t *testing.T) { }, }, setup: func(rs *mocks.ReceiverService, n *mocks.Notifier) { - rs.EXPECT().Get(mock.AnythingOfType("*context.emptyCtx"), mock.AnythingOfType("uint64")).Return(&receiver.Receiver{}, nil) + rs.EXPECT().Get(mock.AnythingOfType("context.todoCtx"), mock.AnythingOfType("uint64")).Return(&receiver.Receiver{}, nil) }, wantErr: true, }, @@ -65,10 +65,10 @@ func TestDispatchReceiverService_PrepareMessage(t *testing.T) { }, }, setup: func(rs *mocks.ReceiverService, n *mocks.Notifier) { - rs.EXPECT().Get(mock.AnythingOfType("*context.emptyCtx"), mock.AnythingOfType("uint64")).Return(&receiver.Receiver{ + rs.EXPECT().Get(mock.AnythingOfType("context.todoCtx"), mock.AnythingOfType("uint64")).Return(&receiver.Receiver{ Type: testPluginType, }, nil) - n.EXPECT().PreHookQueueTransformConfigs(mock.AnythingOfType("*context.emptyCtx"), mock.AnythingOfType("map[string]interface {}")).Return(nil, errors.New("some error")) + n.EXPECT().PreHookQueueTransformConfigs(mock.AnythingOfType("context.todoCtx"), mock.AnythingOfType("map[string]interface {}")).Return(nil, errors.New("some error")) }, wantErr: true, }, @@ -80,11 +80,11 @@ func TestDispatchReceiverService_PrepareMessage(t *testing.T) { }, }, setup: func(rs *mocks.ReceiverService, n *mocks.Notifier) { - rs.EXPECT().Get(mock.AnythingOfType("*context.emptyCtx"), mock.AnythingOfType("uint64")).Return(&receiver.Receiver{ + rs.EXPECT().Get(mock.AnythingOfType("context.todoCtx"), mock.AnythingOfType("uint64")).Return(&receiver.Receiver{ ID: 11, Type: testPluginType, }, nil) - n.EXPECT().PreHookQueueTransformConfigs(mock.AnythingOfType("*context.emptyCtx"), mock.AnythingOfType("map[string]interface {}")).Return(map[string]any{}, nil) + n.EXPECT().PreHookQueueTransformConfigs(mock.AnythingOfType("context.todoCtx"), mock.AnythingOfType("map[string]interface {}")).Return(map[string]any{}, nil) }, want: []notification.Message{ { diff --git a/core/notification/dispatch_subscriber_service_test.go b/core/notification/dispatch_subscriber_service_test.go index 0a3ae382..fffcd8b3 100644 --- a/core/notification/dispatch_subscriber_service_test.go +++ b/core/notification/dispatch_subscriber_service_test.go @@ -29,21 +29,21 @@ func TestDispatchSubscriberService_PrepareMessage(t *testing.T) { { name: "should return error if subscription service match by labels return error", setup: func(ss1 *mocks.SubscriptionService, ss2 *mocks.SilenceService, n *mocks.Notifier) { - ss1.EXPECT().MatchByLabels(mock.AnythingOfType("*context.emptyCtx"), mock.AnythingOfType("uint64"), mock.AnythingOfType("map[string]string")).Return(nil, errors.New("some error")) + ss1.EXPECT().MatchByLabels(mock.AnythingOfType("context.todoCtx"), mock.AnythingOfType("uint64"), mock.AnythingOfType("map[string]string")).Return(nil, errors.New("some error")) }, wantErr: true, }, { name: "should return error if no matching subscriptions", setup: func(ss1 *mocks.SubscriptionService, ss2 *mocks.SilenceService, n *mocks.Notifier) { - ss1.EXPECT().MatchByLabels(mock.AnythingOfType("*context.emptyCtx"), mock.AnythingOfType("uint64"), mock.AnythingOfType("map[string]string")).Return(nil, nil) + ss1.EXPECT().MatchByLabels(mock.AnythingOfType("context.todoCtx"), mock.AnythingOfType("uint64"), mock.AnythingOfType("map[string]string")).Return(nil, nil) }, wantErr: true, }, { name: "should return error if match subscription exist but list silences return error", setup: func(ss1 *mocks.SubscriptionService, ss2 *mocks.SilenceService, n *mocks.Notifier) { - ss1.EXPECT().MatchByLabels(mock.AnythingOfType("*context.emptyCtx"), mock.AnythingOfType("uint64"), mock.AnythingOfType("map[string]string")).Return([]subscription.Subscription{ + ss1.EXPECT().MatchByLabels(mock.AnythingOfType("context.todoCtx"), mock.AnythingOfType("uint64"), mock.AnythingOfType("map[string]string")).Return([]subscription.Subscription{ { ID: 123, Receivers: []subscription.Receiver{ @@ -53,14 +53,14 @@ func TestDispatchSubscriberService_PrepareMessage(t *testing.T) { }, }, }, nil) - ss2.EXPECT().List(mock.AnythingOfType("*context.emptyCtx"), mock.AnythingOfType("silence.Filter")).Return(nil, errors.New("some error")) + ss2.EXPECT().List(mock.AnythingOfType("context.todoCtx"), mock.AnythingOfType("silence.Filter")).Return(nil, errors.New("some error")) }, wantErr: true, }, { name: "should return error if match subscription exist but list silences by label return error", setup: func(ss1 *mocks.SubscriptionService, ss2 *mocks.SilenceService, n *mocks.Notifier) { - ss1.EXPECT().MatchByLabels(mock.AnythingOfType("*context.emptyCtx"), mock.AnythingOfType("uint64"), mock.AnythingOfType("map[string]string")).Return([]subscription.Subscription{ + ss1.EXPECT().MatchByLabels(mock.AnythingOfType("context.todoCtx"), mock.AnythingOfType("uint64"), mock.AnythingOfType("map[string]string")).Return([]subscription.Subscription{ { ID: 123, Receivers: []subscription.Receiver{ @@ -70,7 +70,7 @@ func TestDispatchSubscriberService_PrepareMessage(t *testing.T) { }, }, }, nil) - ss2.EXPECT().List(mock.AnythingOfType("*context.emptyCtx"), mock.AnythingOfType("silence.Filter")).Return(nil, errors.New("some error")) + ss2.EXPECT().List(mock.AnythingOfType("context.todoCtx"), mock.AnythingOfType("silence.Filter")).Return(nil, errors.New("some error")) }, wantErr: true, }, @@ -80,7 +80,7 @@ func TestDispatchSubscriberService_PrepareMessage(t *testing.T) { NamespaceID: 1, }, setup: func(ss1 *mocks.SubscriptionService, ss2 *mocks.SilenceService, n *mocks.Notifier) { - ss1.EXPECT().MatchByLabels(mock.AnythingOfType("*context.emptyCtx"), mock.AnythingOfType("uint64"), mock.AnythingOfType("map[string]string")).Return([]subscription.Subscription{ + ss1.EXPECT().MatchByLabels(mock.AnythingOfType("context.todoCtx"), mock.AnythingOfType("uint64"), mock.AnythingOfType("map[string]string")).Return([]subscription.Subscription{ { ID: 123, Match: map[string]string{ @@ -93,7 +93,7 @@ func TestDispatchSubscriberService_PrepareMessage(t *testing.T) { }, }, }, nil) - ss2.EXPECT().List(mock.AnythingOfType("*context.emptyCtx"), silence.Filter{ + ss2.EXPECT().List(mock.AnythingOfType("context.todoCtx"), silence.Filter{ NamespaceID: 1, SubscriptionMatch: map[string]string{ "k1": "v1", @@ -116,7 +116,7 @@ func TestDispatchSubscriberService_PrepareMessage(t *testing.T) { NamespaceID: 1, }, setup: func(ss1 *mocks.SubscriptionService, ss2 *mocks.SilenceService, n *mocks.Notifier) { - ss1.EXPECT().MatchByLabels(mock.AnythingOfType("*context.emptyCtx"), mock.AnythingOfType("uint64"), mock.AnythingOfType("map[string]string")).Return([]subscription.Subscription{ + ss1.EXPECT().MatchByLabels(mock.AnythingOfType("context.todoCtx"), mock.AnythingOfType("uint64"), mock.AnythingOfType("map[string]string")).Return([]subscription.Subscription{ { ID: 123, Namespace: 1, @@ -130,13 +130,13 @@ func TestDispatchSubscriberService_PrepareMessage(t *testing.T) { }, }, }, nil) - ss2.EXPECT().List(mock.AnythingOfType("*context.emptyCtx"), silence.Filter{ + ss2.EXPECT().List(mock.AnythingOfType("context.todoCtx"), silence.Filter{ NamespaceID: 1, SubscriptionMatch: map[string]string{ "k1": "v1", }, }).Return(nil, nil) - ss2.EXPECT().List(mock.AnythingOfType("*context.emptyCtx"), silence.Filter{ + ss2.EXPECT().List(mock.AnythingOfType("context.todoCtx"), silence.Filter{ NamespaceID: 1, SubscriptionID: 123, }).Return([]silence.Silence{ @@ -154,7 +154,7 @@ func TestDispatchSubscriberService_PrepareMessage(t *testing.T) { NamespaceID: 1, }, setup: func(ss1 *mocks.SubscriptionService, ss2 *mocks.SilenceService, n *mocks.Notifier) { - ss1.EXPECT().MatchByLabels(mock.AnythingOfType("*context.emptyCtx"), mock.AnythingOfType("uint64"), mock.AnythingOfType("map[string]string")).Return([]subscription.Subscription{ + ss1.EXPECT().MatchByLabels(mock.AnythingOfType("context.todoCtx"), mock.AnythingOfType("uint64"), mock.AnythingOfType("map[string]string")).Return([]subscription.Subscription{ { ID: 123, Namespace: 1, @@ -168,13 +168,13 @@ func TestDispatchSubscriberService_PrepareMessage(t *testing.T) { }, }, }, nil) - ss2.EXPECT().List(mock.AnythingOfType("*context.emptyCtx"), silence.Filter{ + ss2.EXPECT().List(mock.AnythingOfType("context.todoCtx"), silence.Filter{ NamespaceID: 1, SubscriptionMatch: map[string]string{ "k1": "v1", }, }).Return(nil, nil) - ss2.EXPECT().List(mock.AnythingOfType("*context.emptyCtx"), silence.Filter{ + ss2.EXPECT().List(mock.AnythingOfType("context.todoCtx"), silence.Filter{ NamespaceID: 1, SubscriptionID: 123, }).Return([]silence.Silence{ @@ -195,7 +195,7 @@ func TestDispatchSubscriberService_PrepareMessage(t *testing.T) { NamespaceID: 1, }, setup: func(ss1 *mocks.SubscriptionService, ss2 *mocks.SilenceService, n *mocks.Notifier) { - ss1.EXPECT().MatchByLabels(mock.AnythingOfType("*context.emptyCtx"), mock.AnythingOfType("uint64"), mock.AnythingOfType("map[string]string")).Return([]subscription.Subscription{ + ss1.EXPECT().MatchByLabels(mock.AnythingOfType("context.todoCtx"), mock.AnythingOfType("uint64"), mock.AnythingOfType("map[string]string")).Return([]subscription.Subscription{ { ID: 123, Namespace: 1, @@ -209,13 +209,13 @@ func TestDispatchSubscriberService_PrepareMessage(t *testing.T) { }, }, }, nil) - ss2.EXPECT().List(mock.AnythingOfType("*context.emptyCtx"), silence.Filter{ + ss2.EXPECT().List(mock.AnythingOfType("context.todoCtx"), silence.Filter{ NamespaceID: 1, SubscriptionMatch: map[string]string{ "k1": "v1", }, }).Return(nil, nil) - ss2.EXPECT().List(mock.AnythingOfType("*context.emptyCtx"), silence.Filter{ + ss2.EXPECT().List(mock.AnythingOfType("context.todoCtx"), silence.Filter{ NamespaceID: 1, SubscriptionID: 123, }).Return(nil, nil) @@ -228,7 +228,7 @@ func TestDispatchSubscriberService_PrepareMessage(t *testing.T) { NamespaceID: 1, }, setup: func(ss1 *mocks.SubscriptionService, ss2 *mocks.SilenceService, n *mocks.Notifier) { - ss1.EXPECT().MatchByLabels(mock.AnythingOfType("*context.emptyCtx"), mock.AnythingOfType("uint64"), mock.AnythingOfType("map[string]string")).Return([]subscription.Subscription{ + ss1.EXPECT().MatchByLabels(mock.AnythingOfType("context.todoCtx"), mock.AnythingOfType("uint64"), mock.AnythingOfType("map[string]string")).Return([]subscription.Subscription{ { ID: 123, Namespace: 1, @@ -243,17 +243,17 @@ func TestDispatchSubscriberService_PrepareMessage(t *testing.T) { }, }, }, nil) - ss2.EXPECT().List(mock.AnythingOfType("*context.emptyCtx"), silence.Filter{ + ss2.EXPECT().List(mock.AnythingOfType("context.todoCtx"), silence.Filter{ NamespaceID: 1, SubscriptionMatch: map[string]string{ "k1": "v1", }, }).Return(nil, nil) - ss2.EXPECT().List(mock.AnythingOfType("*context.emptyCtx"), silence.Filter{ + ss2.EXPECT().List(mock.AnythingOfType("context.todoCtx"), silence.Filter{ NamespaceID: 1, SubscriptionID: 123, }).Return(nil, nil) - n.EXPECT().PreHookQueueTransformConfigs(mock.AnythingOfType("*context.emptyCtx"), mock.AnythingOfType("map[string]interface {}")).Return(nil, errors.New("some error")) + n.EXPECT().PreHookQueueTransformConfigs(mock.AnythingOfType("context.todoCtx"), mock.AnythingOfType("map[string]interface {}")).Return(nil, errors.New("some error")) }, wantErr: true, }, @@ -263,7 +263,7 @@ func TestDispatchSubscriberService_PrepareMessage(t *testing.T) { NamespaceID: 1, }, setup: func(ss1 *mocks.SubscriptionService, ss2 *mocks.SilenceService, n *mocks.Notifier) { - ss1.EXPECT().MatchByLabels(mock.AnythingOfType("*context.emptyCtx"), mock.AnythingOfType("uint64"), mock.AnythingOfType("map[string]string")).Return([]subscription.Subscription{ + ss1.EXPECT().MatchByLabels(mock.AnythingOfType("context.todoCtx"), mock.AnythingOfType("uint64"), mock.AnythingOfType("map[string]string")).Return([]subscription.Subscription{ { ID: 123, Namespace: 1, @@ -278,17 +278,17 @@ func TestDispatchSubscriberService_PrepareMessage(t *testing.T) { }, }, }, nil) - ss2.EXPECT().List(mock.AnythingOfType("*context.emptyCtx"), silence.Filter{ + ss2.EXPECT().List(mock.AnythingOfType("context.todoCtx"), silence.Filter{ NamespaceID: 1, SubscriptionMatch: map[string]string{ "k1": "v1", }, }).Return(nil, nil) - ss2.EXPECT().List(mock.AnythingOfType("*context.emptyCtx"), silence.Filter{ + ss2.EXPECT().List(mock.AnythingOfType("context.todoCtx"), silence.Filter{ NamespaceID: 1, SubscriptionID: 123, }).Return(nil, nil) - n.EXPECT().PreHookQueueTransformConfigs(mock.AnythingOfType("*context.emptyCtx"), mock.AnythingOfType("map[string]interface {}")).Return(map[string]any{}, nil) + n.EXPECT().PreHookQueueTransformConfigs(mock.AnythingOfType("context.todoCtx"), mock.AnythingOfType("map[string]interface {}")).Return(map[string]any{}, nil) }, want: []notification.Message{ { diff --git a/core/notification/handler_test.go b/core/notification/handler_test.go index 65237c7c..b426a362 100644 --- a/core/notification/handler_test.go +++ b/core/notification/handler_test.go @@ -42,8 +42,8 @@ func TestHandler_MessageHandler(t *testing.T) { }, setup: func(q *mocks.Queuer, n *mocks.Notifier) { q.EXPECT().Type().Return("postgresql") - n.EXPECT().PostHookQueueTransformConfigs(mock.AnythingOfType("*context.emptyCtx"), mock.AnythingOfType("map[string]interface {}")).Return(nil, errors.New("some error")) - q.EXPECT().ErrorCallback(mock.AnythingOfType("*context.emptyCtx"), mock.AnythingOfType("notification.Message")).Return(nil) + n.EXPECT().PostHookQueueTransformConfigs(mock.AnythingOfType("context.todoCtx"), mock.AnythingOfType("map[string]interface {}")).Return(nil, errors.New("some error")) + q.EXPECT().ErrorCallback(mock.AnythingOfType("context.todoCtx"), mock.AnythingOfType("notification.Message")).Return(nil) }, wantErr: true, }, @@ -56,8 +56,8 @@ func TestHandler_MessageHandler(t *testing.T) { }, setup: func(q *mocks.Queuer, n *mocks.Notifier) { q.EXPECT().Type().Return("postgresql") - n.EXPECT().PostHookQueueTransformConfigs(mock.AnythingOfType("*context.emptyCtx"), mock.AnythingOfType("map[string]interface {}")).Return(nil, errors.New("some error")) - q.EXPECT().ErrorCallback(mock.AnythingOfType("*context.emptyCtx"), mock.AnythingOfType("notification.Message")).Return(errors.New("some error")) + n.EXPECT().PostHookQueueTransformConfigs(mock.AnythingOfType("context.todoCtx"), mock.AnythingOfType("map[string]interface {}")).Return(nil, errors.New("some error")) + q.EXPECT().ErrorCallback(mock.AnythingOfType("context.todoCtx"), mock.AnythingOfType("notification.Message")).Return(errors.New("some error")) }, wantErr: true, }, @@ -70,9 +70,9 @@ func TestHandler_MessageHandler(t *testing.T) { }, setup: func(q *mocks.Queuer, n *mocks.Notifier) { q.EXPECT().Type().Return("postgresql") - n.EXPECT().PostHookQueueTransformConfigs(mock.AnythingOfType("*context.emptyCtx"), mock.AnythingOfType("map[string]interface {}")).Return(map[string]any{}, nil) - n.EXPECT().Send(mock.AnythingOfType("*context.emptyCtx"), mock.AnythingOfType("notification.Message")).Return(false, errors.New("some error")) - q.EXPECT().ErrorCallback(mock.AnythingOfType("*context.emptyCtx"), mock.AnythingOfType("notification.Message")).Return(errors.New("some error")) + n.EXPECT().PostHookQueueTransformConfigs(mock.AnythingOfType("context.todoCtx"), mock.AnythingOfType("map[string]interface {}")).Return(map[string]any{}, nil) + n.EXPECT().Send(mock.AnythingOfType("context.todoCtx"), mock.AnythingOfType("notification.Message")).Return(false, errors.New("some error")) + q.EXPECT().ErrorCallback(mock.AnythingOfType("context.todoCtx"), mock.AnythingOfType("notification.Message")).Return(errors.New("some error")) }, wantErr: true, }, @@ -85,9 +85,9 @@ func TestHandler_MessageHandler(t *testing.T) { }, setup: func(q *mocks.Queuer, n *mocks.Notifier) { q.EXPECT().Type().Return("postgresql") - n.EXPECT().PostHookQueueTransformConfigs(mock.AnythingOfType("*context.emptyCtx"), mock.AnythingOfType("map[string]interface {}")).Return(map[string]any{}, nil) - n.EXPECT().Send(mock.AnythingOfType("*context.emptyCtx"), mock.AnythingOfType("notification.Message")).Return(false, errors.New("some error")) - q.EXPECT().ErrorCallback(mock.AnythingOfType("*context.emptyCtx"), mock.AnythingOfType("notification.Message")).Return(nil) + n.EXPECT().PostHookQueueTransformConfigs(mock.AnythingOfType("context.todoCtx"), mock.AnythingOfType("map[string]interface {}")).Return(map[string]any{}, nil) + n.EXPECT().Send(mock.AnythingOfType("context.todoCtx"), mock.AnythingOfType("notification.Message")).Return(false, errors.New("some error")) + q.EXPECT().ErrorCallback(mock.AnythingOfType("context.todoCtx"), mock.AnythingOfType("notification.Message")).Return(nil) }, wantErr: true, }, @@ -100,9 +100,9 @@ func TestHandler_MessageHandler(t *testing.T) { }, setup: func(q *mocks.Queuer, n *mocks.Notifier) { q.EXPECT().Type().Return("postgresql") - n.EXPECT().PostHookQueueTransformConfigs(mock.AnythingOfType("*context.emptyCtx"), mock.AnythingOfType("map[string]interface {}")).Return(map[string]any{}, nil) - n.EXPECT().Send(mock.AnythingOfType("*context.emptyCtx"), mock.AnythingOfType("notification.Message")).Return(false, nil) - q.EXPECT().SuccessCallback(mock.AnythingOfType("*context.emptyCtx"), mock.AnythingOfType("notification.Message")).Return(errors.New("some error")) + n.EXPECT().PostHookQueueTransformConfigs(mock.AnythingOfType("context.todoCtx"), mock.AnythingOfType("map[string]interface {}")).Return(map[string]any{}, nil) + n.EXPECT().Send(mock.AnythingOfType("context.todoCtx"), mock.AnythingOfType("notification.Message")).Return(false, nil) + q.EXPECT().SuccessCallback(mock.AnythingOfType("context.todoCtx"), mock.AnythingOfType("notification.Message")).Return(errors.New("some error")) }, wantErr: true, }, @@ -115,9 +115,9 @@ func TestHandler_MessageHandler(t *testing.T) { }, setup: func(q *mocks.Queuer, n *mocks.Notifier) { q.EXPECT().Type().Return("postgresql") - n.EXPECT().PostHookQueueTransformConfigs(mock.AnythingOfType("*context.emptyCtx"), mock.AnythingOfType("map[string]interface {}")).Return(map[string]any{}, nil) - n.EXPECT().Send(mock.AnythingOfType("*context.emptyCtx"), mock.AnythingOfType("notification.Message")).Return(false, nil) - q.EXPECT().SuccessCallback(mock.AnythingOfType("*context.emptyCtx"), mock.AnythingOfType("notification.Message")).Return(nil) + n.EXPECT().PostHookQueueTransformConfigs(mock.AnythingOfType("context.todoCtx"), mock.AnythingOfType("map[string]interface {}")).Return(map[string]any{}, nil) + n.EXPECT().Send(mock.AnythingOfType("context.todoCtx"), mock.AnythingOfType("notification.Message")).Return(false, nil) + q.EXPECT().SuccessCallback(mock.AnythingOfType("context.todoCtx"), mock.AnythingOfType("notification.Message")).Return(nil) }, wantErr: false, }, diff --git a/core/notification/message_test.go b/core/notification/message_test.go index 3033c532..84669db7 100644 --- a/core/notification/message_test.go +++ b/core/notification/message_test.go @@ -31,7 +31,7 @@ func TestMessage_InitMessage(t *testing.T) { { name: "all notification labels and data should be merged to message detail and data takes precedence if key conflict", setup: func(n *mocks.Notifier) { - n.EXPECT().PreHookQueueTransformConfigs(mock.AnythingOfType("*context.emptyCtx"), mock.AnythingOfType("map[string]interface {}")).Return(nil, nil) + n.EXPECT().PreHookQueueTransformConfigs(mock.AnythingOfType("context.todoCtx"), mock.AnythingOfType("map[string]interface {}")).Return(nil, nil) }, n: notification.Notification{ Type: notification.TypeSubscriber, diff --git a/core/notification/service_test.go b/core/notification/service_test.go index 0736a3f5..fdd47636 100644 --- a/core/notification/service_test.go +++ b/core/notification/service_test.go @@ -35,7 +35,7 @@ func TestService_CheckAndInsertIdempotency(t *testing.T) { { name: "should return error if idempotency exist and success", setup: func(ir *mocks.IdempotencyRepository) { - ir.EXPECT().InsertOnConflictReturning(mock.AnythingOfType("*context.emptyCtx"), scope, key).Return(nil, errors.ErrConflict) + ir.EXPECT().InsertOnConflictReturning(mock.AnythingOfType("context.todoCtx"), scope, key).Return(nil, errors.ErrConflict) }, scope: scope, key: key, @@ -44,7 +44,7 @@ func TestService_CheckAndInsertIdempotency(t *testing.T) { { name: "should return error if repository returning some error", setup: func(ir *mocks.IdempotencyRepository) { - ir.EXPECT().InsertOnConflictReturning(mock.AnythingOfType("*context.emptyCtx"), scope, key).Return(nil, errors.New("some error")) + ir.EXPECT().InsertOnConflictReturning(mock.AnythingOfType("context.todoCtx"), scope, key).Return(nil, errors.New("some error")) }, scope: scope, key: key, @@ -53,7 +53,7 @@ func TestService_CheckAndInsertIdempotency(t *testing.T) { { name: "should return id and nil error if no idempotency exists", setup: func(ir *mocks.IdempotencyRepository) { - ir.EXPECT().InsertOnConflictReturning(mock.AnythingOfType("*context.emptyCtx"), scope, key).Return(¬ification.Idempotency{ + ir.EXPECT().InsertOnConflictReturning(mock.AnythingOfType("context.todoCtx"), scope, key).Return(¬ification.Idempotency{ ID: 1, }, nil) }, @@ -72,7 +72,7 @@ func TestService_CheckAndInsertIdempotency(t *testing.T) { ns := notification.NewService(saltlog.NewNoop(), notification.Config{}, nil, nil, nil, notification.Deps{IdempotencyRepository: mockIdempotencyRepository}) - _, err := ns.CheckAndInsertIdempotency(context.Background(), tc.scope, tc.key) + _, err := ns.CheckAndInsertIdempotency(context.TODO(), tc.scope, tc.key) if (err != nil) != tc.wantErr { t.Errorf("NotificationService.CheckAndInsertIdempotency() error = %v, wantErr %v", err, tc.wantErr) @@ -104,7 +104,7 @@ func TestService_Dispatch(t *testing.T) { }, }, setup: func(n notification.Notification, r *mocks.Repository, _ *mocks.LogService, _ *mocks.AlertService, _ *mocks.Queuer, _ *mocks.Dispatcher) { - r.EXPECT().Create(mock.AnythingOfType("*context.emptyCtx"), mock.AnythingOfType("notification.Notification")).Return(notification.Notification{}, errors.New("some error")) + r.EXPECT().Create(mock.AnythingOfType("context.todoCtx"), mock.AnythingOfType("notification.Notification")).Return(notification.Notification{}, errors.New("some error")) }, wantErr: true, }, @@ -117,7 +117,7 @@ func TestService_Dispatch(t *testing.T) { }, }, setup: func(n notification.Notification, r *mocks.Repository, _ *mocks.LogService, _ *mocks.AlertService, _ *mocks.Queuer, d *mocks.Dispatcher) { - r.EXPECT().Create(mock.AnythingOfType("*context.emptyCtx"), mock.AnythingOfType("notification.Notification")).Return(notification.Notification{}, nil) + r.EXPECT().Create(mock.AnythingOfType("context.todoCtx"), mock.AnythingOfType("notification.Notification")).Return(notification.Notification{}, nil) d.EXPECT().PrepareMessage(mock.AnythingOfType("*context.valueCtx"), mock.AnythingOfType("notification.Notification")).Return(nil, nil, false, errors.New("some error")) }, wantErr: true, @@ -131,7 +131,7 @@ func TestService_Dispatch(t *testing.T) { }, }, setup: func(n notification.Notification, r *mocks.Repository, _ *mocks.LogService, _ *mocks.AlertService, _ *mocks.Queuer, d *mocks.Dispatcher) { - r.EXPECT().Create(mock.AnythingOfType("*context.emptyCtx"), mock.AnythingOfType("notification.Notification")).Return(notification.Notification{}, nil) + r.EXPECT().Create(mock.AnythingOfType("context.todoCtx"), mock.AnythingOfType("notification.Notification")).Return(notification.Notification{}, nil) d.EXPECT().PrepareMessage(mock.AnythingOfType("*context.valueCtx"), mock.AnythingOfType("notification.Notification")).Return(nil, nil, false, nil) }, wantErr: true, @@ -145,7 +145,7 @@ func TestService_Dispatch(t *testing.T) { }, }, setup: func(n notification.Notification, r *mocks.Repository, l *mocks.LogService, _ *mocks.AlertService, _ *mocks.Queuer, d *mocks.Dispatcher) { - r.EXPECT().Create(mock.AnythingOfType("*context.emptyCtx"), mock.AnythingOfType("notification.Notification")).Return(notification.Notification{}, nil) + r.EXPECT().Create(mock.AnythingOfType("context.todoCtx"), mock.AnythingOfType("notification.Notification")).Return(notification.Notification{}, nil) d.EXPECT().PrepareMessage(mock.AnythingOfType("*context.valueCtx"), mock.AnythingOfType("notification.Notification")).Return([]notification.Message{{ID: "123"}}, []log.Notification{{ReceiverID: 123}}, false, nil) l.EXPECT().LogNotifications(mock.AnythingOfType("*context.valueCtx"), mock.AnythingOfType("log.Notification")).Return(errors.New("some error")) }, @@ -160,7 +160,7 @@ func TestService_Dispatch(t *testing.T) { }, }, setup: func(n notification.Notification, r *mocks.Repository, l *mocks.LogService, a *mocks.AlertService, _ *mocks.Queuer, d *mocks.Dispatcher) { - r.EXPECT().Create(mock.AnythingOfType("*context.emptyCtx"), mock.AnythingOfType("notification.Notification")).Return(notification.Notification{}, nil) + r.EXPECT().Create(mock.AnythingOfType("context.todoCtx"), mock.AnythingOfType("notification.Notification")).Return(notification.Notification{}, nil) d.EXPECT().PrepareMessage(mock.AnythingOfType("*context.valueCtx"), mock.AnythingOfType("notification.Notification")).Return([]notification.Message{{ID: "123"}}, []log.Notification{{ReceiverID: 123}}, false, nil) l.EXPECT().LogNotifications(mock.AnythingOfType("*context.valueCtx"), mock.AnythingOfType("log.Notification")).Return(nil) a.EXPECT().UpdateSilenceStatus(mock.AnythingOfType("*context.valueCtx"), mock.AnythingOfType("[]int64"), mock.AnythingOfType("bool"), mock.AnythingOfType("bool")).Return(errors.New("some error")) @@ -176,7 +176,7 @@ func TestService_Dispatch(t *testing.T) { }, }, setup: func(n notification.Notification, r *mocks.Repository, l *mocks.LogService, a *mocks.AlertService, q *mocks.Queuer, d *mocks.Dispatcher) { - r.EXPECT().Create(mock.AnythingOfType("*context.emptyCtx"), mock.AnythingOfType("notification.Notification")).Return(notification.Notification{}, nil) + r.EXPECT().Create(mock.AnythingOfType("context.todoCtx"), mock.AnythingOfType("notification.Notification")).Return(notification.Notification{}, nil) d.EXPECT().PrepareMessage(mock.AnythingOfType("*context.valueCtx"), mock.AnythingOfType("notification.Notification")).Return([]notification.Message{{ID: "123"}}, []log.Notification{{ReceiverID: 123}}, false, nil) l.EXPECT().LogNotifications(mock.AnythingOfType("*context.valueCtx"), mock.AnythingOfType("log.Notification")).Return(nil) a.EXPECT().UpdateSilenceStatus(mock.AnythingOfType("*context.valueCtx"), mock.AnythingOfType("[]int64"), mock.AnythingOfType("bool"), mock.AnythingOfType("bool")).Return(nil) @@ -193,7 +193,7 @@ func TestService_Dispatch(t *testing.T) { }, }, setup: func(n notification.Notification, r *mocks.Repository, l *mocks.LogService, a *mocks.AlertService, q *mocks.Queuer, d *mocks.Dispatcher) { - r.EXPECT().Create(mock.AnythingOfType("*context.emptyCtx"), mock.AnythingOfType("notification.Notification")).Return(n, nil) + r.EXPECT().Create(mock.AnythingOfType("context.todoCtx"), mock.AnythingOfType("notification.Notification")).Return(n, nil) d.EXPECT().PrepareMessage(mock.AnythingOfType("*context.valueCtx"), mock.AnythingOfType("notification.Notification")).Return([]notification.Message{{ID: "123"}}, []log.Notification{{ReceiverID: 123}}, false, nil) l.EXPECT().LogNotifications(mock.AnythingOfType("*context.valueCtx"), mock.AnythingOfType("log.Notification")).Return(nil) a.EXPECT().UpdateSilenceStatus(mock.AnythingOfType("*context.valueCtx"), mock.AnythingOfType("[]int64"), mock.AnythingOfType("bool"), mock.AnythingOfType("bool")).Return(nil) diff --git a/core/provider/service.go b/core/provider/service.go index 6d00b523..af832e82 100644 --- a/core/provider/service.go +++ b/core/provider/service.go @@ -8,13 +8,15 @@ import ( // Service handles business logic type Service struct { - repository Repository + supportedTypes []string + repository Repository } // NewService returns repository struct -func NewService(repository Repository) *Service { +func NewService(repository Repository, supportedProviders []string) *Service { return &Service{ - repository: repository, + repository: repository, + supportedTypes: supportedProviders, } } @@ -27,6 +29,10 @@ func (s *Service) Create(ctx context.Context, prov *Provider) error { return errors.ErrInvalid.WithMsgf("provider is nil") } + if !s.isTypeSupported(prov.Type) { + return errors.ErrInvalid.WithMsgf("type %s is not supported, supported types are: %+v", prov.Type, s.supportedTypes) + } + err := s.repository.Create(ctx, prov) if err != nil { if errors.Is(err, ErrDuplicate) { @@ -54,6 +60,10 @@ func (s *Service) Update(ctx context.Context, prov *Provider) error { return errors.ErrInvalid.WithMsgf("provider is nil") } + if !s.isTypeSupported(prov.Type) { + return errors.ErrInvalid.WithMsgf("type %s is not supported, supported types are: %+v", prov.Type, s.supportedTypes) + } + err := s.repository.Update(ctx, prov) if err != nil { if errors.Is(err, ErrDuplicate) { @@ -71,3 +81,12 @@ func (s *Service) Update(ctx context.Context, prov *Provider) error { func (s *Service) Delete(ctx context.Context, id uint64) error { return s.repository.Delete(ctx, id) } + +func (s *Service) isTypeSupported(providerType string) bool { + for _, st := range s.supportedTypes { + if st == providerType { + return true + } + } + return false +} diff --git a/core/provider/service_test.go b/core/provider/service_test.go index 7b013e99..70cbd7cc 100644 --- a/core/provider/service_test.go +++ b/core/provider/service_test.go @@ -22,7 +22,7 @@ func TestList(t *testing.T) { t.Run("should call repository List method and return result in domain's type", func(t *testing.T) { repositoryMock := &mocks.ProviderRepository{} - dummyService := provider.NewService(repositoryMock) + dummyService := provider.NewService(repositoryMock, nil) dummyProviders := []provider.Provider{ { ID: 10, @@ -35,7 +35,7 @@ func TestList(t *testing.T) { UpdatedAt: time.Now(), }, } - repositoryMock.EXPECT().List(mock.AnythingOfType("*context.emptyCtx"), provider.Filter{}).Return(dummyProviders, nil).Once() + repositoryMock.EXPECT().List(mock.AnythingOfType("context.todoCtx"), provider.Filter{}).Return(dummyProviders, nil).Once() result, err := dummyService.List(ctx, provider.Filter{}) assert.Nil(t, err) assert.Equal(t, len(dummyProviders), len(result)) @@ -45,8 +45,8 @@ func TestList(t *testing.T) { t.Run("should call repository List method and return error if any", func(t *testing.T) { repositoryMock := &mocks.ProviderRepository{} - dummyService := provider.NewService(repositoryMock) - repositoryMock.EXPECT().List(mock.AnythingOfType("*context.emptyCtx"), provider.Filter{}).Return(nil, errors.New("random error")).Once() + dummyService := provider.NewService(repositoryMock, nil) + repositoryMock.EXPECT().List(mock.AnythingOfType("context.todoCtx"), provider.Filter{}).Return(nil, errors.New("random error")).Once() result, err := dummyService.List(ctx, provider.Filter{}) assert.Nil(t, result) assert.EqualError(t, err, "random error") @@ -75,8 +75,8 @@ func TestCreate(t *testing.T) { t.Run("should call repository Create method and return result in domain's type", func(t *testing.T) { repositoryMock := &mocks.ProviderRepository{} - dummyService := provider.NewService(repositoryMock) - repositoryMock.EXPECT().Create(mock.AnythingOfType("*context.emptyCtx"), dummyProvider).Return(nil).Once() + dummyService := provider.NewService(repositoryMock, nil) + repositoryMock.EXPECT().Create(mock.AnythingOfType("context.todoCtx"), dummyProvider).Return(nil).Once() err := dummyService.Create(ctx, dummyProvider) assert.Nil(t, err) repositoryMock.AssertExpectations(t) @@ -84,8 +84,8 @@ func TestCreate(t *testing.T) { t.Run("should call repository Create method and return error if any", func(t *testing.T) { repositoryMock := &mocks.ProviderRepository{} - dummyService := provider.NewService(repositoryMock) - repositoryMock.EXPECT().Create(mock.AnythingOfType("*context.emptyCtx"), dummyProvider).Return(errors.New("random error")).Once() + dummyService := provider.NewService(repositoryMock, nil) + repositoryMock.EXPECT().Create(mock.AnythingOfType("context.todoCtx"), dummyProvider).Return(errors.New("random error")).Once() err := dummyService.Create(ctx, dummyProvider) assert.EqualError(t, err, "random error") repositoryMock.AssertExpectations(t) @@ -93,8 +93,8 @@ func TestCreate(t *testing.T) { t.Run("should call repository Create method and return conflict error if duplicated", func(t *testing.T) { repositoryMock := &mocks.ProviderRepository{} - dummyService := provider.NewService(repositoryMock) - repositoryMock.EXPECT().Create(mock.AnythingOfType("*context.emptyCtx"), dummyProvider).Return(provider.ErrDuplicate).Once() + dummyService := provider.NewService(repositoryMock, nil) + repositoryMock.EXPECT().Create(mock.AnythingOfType("context.todoCtx"), dummyProvider).Return(provider.ErrDuplicate).Once() err := dummyService.Create(ctx, dummyProvider) assert.EqualError(t, err, "urn already exist") repositoryMock.AssertExpectations(t) @@ -122,8 +122,8 @@ func TestGetProvider(t *testing.T) { t.Run("should call repository Get method and return result in domain's type", func(t *testing.T) { repositoryMock := &mocks.ProviderRepository{} - dummyService := provider.NewService(repositoryMock) - repositoryMock.EXPECT().Get(mock.AnythingOfType("*context.emptyCtx"), dummyProviderID).Return(dummyProvider, nil).Once() + dummyService := provider.NewService(repositoryMock, nil) + repositoryMock.EXPECT().Get(mock.AnythingOfType("context.todoCtx"), dummyProviderID).Return(dummyProvider, nil).Once() result, err := dummyService.Get(ctx, dummyProviderID) assert.Nil(t, err) assert.Equal(t, dummyProvider, result) @@ -132,8 +132,8 @@ func TestGetProvider(t *testing.T) { t.Run("should call repository Get method and return error if any", func(t *testing.T) { repositoryMock := &mocks.ProviderRepository{} - dummyService := provider.NewService(repositoryMock) - repositoryMock.EXPECT().Get(mock.AnythingOfType("*context.emptyCtx"), dummyProviderID).Return(nil, errors.New("random error")).Once() + dummyService := provider.NewService(repositoryMock, nil) + repositoryMock.EXPECT().Get(mock.AnythingOfType("context.todoCtx"), dummyProviderID).Return(nil, errors.New("random error")).Once() result, err := dummyService.Get(ctx, dummyProviderID) assert.Empty(t, result) assert.EqualError(t, err, "random error") @@ -142,8 +142,8 @@ func TestGetProvider(t *testing.T) { t.Run("should call repository Get method and return error if repository return not found error", func(t *testing.T) { repositoryMock := &mocks.ProviderRepository{} - dummyService := provider.NewService(repositoryMock) - repositoryMock.EXPECT().Get(mock.AnythingOfType("*context.emptyCtx"), dummyProviderID).Return(nil, provider.NotFoundError{}).Once() + dummyService := provider.NewService(repositoryMock, nil) + repositoryMock.EXPECT().Get(mock.AnythingOfType("context.todoCtx"), dummyProviderID).Return(nil, provider.NotFoundError{}).Once() result, err := dummyService.Get(ctx, dummyProviderID) assert.Empty(t, result) assert.EqualError(t, err, "provider not found") @@ -172,8 +172,8 @@ func TestUpdateProvider(t *testing.T) { t.Run("should call repository Update method and return result in domain's type", func(t *testing.T) { repositoryMock := &mocks.ProviderRepository{} - dummyService := provider.NewService(repositoryMock) - repositoryMock.EXPECT().Update(mock.AnythingOfType("*context.emptyCtx"), dummyProvider).Return(nil).Once() + dummyService := provider.NewService(repositoryMock, nil) + repositoryMock.EXPECT().Update(mock.AnythingOfType("context.todoCtx"), dummyProvider).Return(nil).Once() err := dummyService.Update(ctx, dummyProvider) assert.Nil(t, err) repositoryMock.AssertExpectations(t) @@ -181,8 +181,8 @@ func TestUpdateProvider(t *testing.T) { t.Run("should call repository Update method and return error if any", func(t *testing.T) { repositoryMock := &mocks.ProviderRepository{} - dummyService := provider.NewService(repositoryMock) - repositoryMock.EXPECT().Update(mock.AnythingOfType("*context.emptyCtx"), dummyProvider).Return(errors.New("random error")).Once() + dummyService := provider.NewService(repositoryMock, nil) + repositoryMock.EXPECT().Update(mock.AnythingOfType("context.todoCtx"), dummyProvider).Return(errors.New("random error")).Once() err := dummyService.Update(ctx, dummyProvider) assert.EqualError(t, err, "random error") repositoryMock.AssertExpectations(t) @@ -190,8 +190,8 @@ func TestUpdateProvider(t *testing.T) { t.Run("should call repository Update method and return error not found if repository return not found error", func(t *testing.T) { repositoryMock := &mocks.ProviderRepository{} - dummyService := provider.NewService(repositoryMock) - repositoryMock.EXPECT().Update(mock.AnythingOfType("*context.emptyCtx"), dummyProvider).Return(provider.NotFoundError{}).Once() + dummyService := provider.NewService(repositoryMock, nil) + repositoryMock.EXPECT().Update(mock.AnythingOfType("context.todoCtx"), dummyProvider).Return(provider.NotFoundError{}).Once() err := dummyService.Update(ctx, dummyProvider) assert.EqualError(t, err, "provider not found") repositoryMock.AssertExpectations(t) @@ -199,8 +199,8 @@ func TestUpdateProvider(t *testing.T) { t.Run("should call repository Update method and return conflict error if repository return duplicate error", func(t *testing.T) { repositoryMock := &mocks.ProviderRepository{} - dummyService := provider.NewService(repositoryMock) - repositoryMock.EXPECT().Update(mock.AnythingOfType("*context.emptyCtx"), dummyProvider).Return(provider.ErrDuplicate).Once() + dummyService := provider.NewService(repositoryMock, nil) + repositoryMock.EXPECT().Update(mock.AnythingOfType("context.todoCtx"), dummyProvider).Return(provider.ErrDuplicate).Once() err := dummyService.Update(ctx, dummyProvider) assert.EqualError(t, err, "urn already exist") repositoryMock.AssertExpectations(t) @@ -213,8 +213,8 @@ func TestDeleteProvider(t *testing.T) { t.Run("should call repository Delete method and return nil if no error", func(t *testing.T) { repositoryMock := &mocks.ProviderRepository{} - dummyService := provider.NewService(repositoryMock) - repositoryMock.EXPECT().Delete(mock.AnythingOfType("*context.emptyCtx"), providerID).Return(nil).Once() + dummyService := provider.NewService(repositoryMock, nil) + repositoryMock.EXPECT().Delete(mock.AnythingOfType("context.todoCtx"), providerID).Return(nil).Once() err := dummyService.Delete(ctx, providerID) assert.Nil(t, err) repositoryMock.AssertExpectations(t) @@ -222,8 +222,8 @@ func TestDeleteProvider(t *testing.T) { t.Run("should call repository Delete method and return error if any", func(t *testing.T) { repositoryMock := &mocks.ProviderRepository{} - dummyService := provider.NewService(repositoryMock) - repositoryMock.EXPECT().Delete(mock.AnythingOfType("*context.emptyCtx"), providerID).Return(errors.New("random error")).Once() + dummyService := provider.NewService(repositoryMock, nil) + repositoryMock.EXPECT().Delete(mock.AnythingOfType("context.todoCtx"), providerID).Return(errors.New("random error")).Once() err := dummyService.Delete(ctx, providerID) assert.EqualError(t, err, "random error") repositoryMock.AssertExpectations(t) diff --git a/core/provider/type.go b/core/provider/type.go deleted file mode 100644 index 1513edc7..00000000 --- a/core/provider/type.go +++ /dev/null @@ -1,18 +0,0 @@ -package provider - -const ( - TypeCortex string = "cortex" -) - -var SupportedTypes = []string{ - TypeCortex, -} - -func IsTypeSupported(providerType string) bool { - for _, st := range SupportedTypes { - if st == providerType { - return true - } - } - return false -} diff --git a/core/receiver/service_test.go b/core/receiver/service_test.go index 7c074966..b9eca77d 100644 --- a/core/receiver/service_test.go +++ b/core/receiver/service_test.go @@ -28,14 +28,14 @@ func TestService_ListReceivers(t *testing.T) { { Description: "should return error if List repository error", Setup: func(rr *mocks.ReceiverRepository, ss *mocks.ConfigResolver) { - rr.EXPECT().List(mock.AnythingOfType("*context.emptyCtx"), receiver.Filter{Expanded: true}).Return(nil, errors.New("some error")) + rr.EXPECT().List(mock.AnythingOfType("context.todoCtx"), receiver.Filter{Expanded: true}).Return(nil, errors.New("some error")) }, Err: errors.New("some error"), }, { Description: "should return error if List repository success and decrypt error", Setup: func(rr *mocks.ReceiverRepository, ss *mocks.ConfigResolver) { - rr.EXPECT().List(mock.AnythingOfType("*context.emptyCtx"), receiver.Filter{ + rr.EXPECT().List(mock.AnythingOfType("context.todoCtx"), receiver.Filter{ Expanded: true, }).Return([]receiver.Receiver{ { @@ -52,7 +52,7 @@ func TestService_ListReceivers(t *testing.T) { UpdatedAt: timeNow, }, }, nil) - ss.EXPECT().PostHookDBTransformConfigs(mock.AnythingOfType("*context.emptyCtx"), map[string]any{ + ss.EXPECT().PostHookDBTransformConfigs(mock.AnythingOfType("context.todoCtx"), map[string]any{ "token": "key", }).Return(nil, errors.New("decrypt error")) }, @@ -61,7 +61,7 @@ func TestService_ListReceivers(t *testing.T) { { Description: "should return error if type unknown", Setup: func(rr *mocks.ReceiverRepository, ss *mocks.ConfigResolver) { - rr.EXPECT().List(mock.AnythingOfType("*context.emptyCtx"), receiver.Filter{Expanded: true}).Return([]receiver.Receiver{ + rr.EXPECT().List(mock.AnythingOfType("context.todoCtx"), receiver.Filter{Expanded: true}).Return([]receiver.Receiver{ { Type: "random", }, @@ -72,7 +72,7 @@ func TestService_ListReceivers(t *testing.T) { { Description: "should success if list repository and decrypt success", Setup: func(rr *mocks.ReceiverRepository, ss *mocks.ConfigResolver) { - rr.EXPECT().List(mock.AnythingOfType("*context.emptyCtx"), receiver.Filter{Expanded: true}).Return([]receiver.Receiver{ + rr.EXPECT().List(mock.AnythingOfType("context.todoCtx"), receiver.Filter{Expanded: true}).Return([]receiver.Receiver{ { ID: 10, Name: "foo", @@ -87,7 +87,7 @@ func TestService_ListReceivers(t *testing.T) { UpdatedAt: timeNow, }, }, nil) - ss.EXPECT().PostHookDBTransformConfigs(mock.AnythingOfType("*context.emptyCtx"), map[string]any{ + ss.EXPECT().PostHookDBTransformConfigs(mock.AnythingOfType("context.todoCtx"), map[string]any{ "token": "key", }).Return(map[string]any{ "token": "decrypted_key", @@ -164,7 +164,7 @@ func TestService_CreateReceiver(t *testing.T) { { Description: "should return error if type child but wrong parent", Setup: func(rr *mocks.ReceiverRepository, ss *mocks.ConfigResolver) { - rr.EXPECT().Get(mock.AnythingOfType("*context.emptyCtx"), uint64(2)).Return(&receiver.Receiver{Type: receiver.TypeFile}, nil) + rr.EXPECT().Get(mock.AnythingOfType("context.todoCtx"), uint64(2)).Return(&receiver.Receiver{Type: receiver.TypeFile}, nil) }, Rcv: &receiver.Receiver{ ID: 123, @@ -179,7 +179,7 @@ func TestService_CreateReceiver(t *testing.T) { { Description: "should return error if validateParent return error", Setup: func(rr *mocks.ReceiverRepository, ss *mocks.ConfigResolver) { - rr.EXPECT().Get(mock.AnythingOfType("*context.emptyCtx"), uint64(2)).Return(nil, errors.New("some error")) + rr.EXPECT().Get(mock.AnythingOfType("context.todoCtx"), uint64(2)).Return(nil, errors.New("some error")) }, Rcv: &receiver.Receiver{ ID: 123, @@ -194,7 +194,7 @@ func TestService_CreateReceiver(t *testing.T) { { Description: "should return error if PreHookDBTransformConfigs return error", Setup: func(rr *mocks.ReceiverRepository, ss *mocks.ConfigResolver) { - ss.EXPECT().PreHookDBTransformConfigs(mock.AnythingOfType("*context.emptyCtx"), map[string]any{"token": "key"}).Return(nil, errors.New("some error")) + ss.EXPECT().PreHookDBTransformConfigs(mock.AnythingOfType("context.todoCtx"), map[string]any{"token": "key"}).Return(nil, errors.New("some error")) }, Rcv: &receiver.Receiver{ @@ -209,10 +209,10 @@ func TestService_CreateReceiver(t *testing.T) { { Description: "should return error if Create repository return error", Setup: func(rr *mocks.ReceiverRepository, ss *mocks.ConfigResolver) { - ss.EXPECT().PreHookDBTransformConfigs(mock.AnythingOfType("*context.emptyCtx"), map[string]any{"token": "key"}).Return(map[string]any{ + ss.EXPECT().PreHookDBTransformConfigs(mock.AnythingOfType("context.todoCtx"), map[string]any{"token": "key"}).Return(map[string]any{ "token": "encrypted_key", }, nil) - rr.EXPECT().Create(mock.AnythingOfType("*context.emptyCtx"), &receiver.Receiver{ + rr.EXPECT().Create(mock.AnythingOfType("context.todoCtx"), &receiver.Receiver{ ID: 123, Type: receiver.TypeSlack, Configurations: map[string]any{ @@ -232,10 +232,10 @@ func TestService_CreateReceiver(t *testing.T) { { Description: "should return nil error if no error returned", Setup: func(rr *mocks.ReceiverRepository, ss *mocks.ConfigResolver) { - ss.EXPECT().PreHookDBTransformConfigs(mock.AnythingOfType("*context.emptyCtx"), map[string]any{"token": "key"}).Return(map[string]any{ + ss.EXPECT().PreHookDBTransformConfigs(mock.AnythingOfType("context.todoCtx"), map[string]any{"token": "key"}).Return(map[string]any{ "token": "encrypted_key", }, nil) - rr.EXPECT().Create(mock.AnythingOfType("*context.emptyCtx"), &receiver.Receiver{ + rr.EXPECT().Create(mock.AnythingOfType("context.todoCtx"), &receiver.Receiver{ ID: 123, Type: receiver.TypeSlack, Configurations: map[string]any{ @@ -298,14 +298,14 @@ func TestService_GetReceiver(t *testing.T) { { Description: "should return error if Get repository error", Setup: func(rr *mocks.ReceiverRepository, ss *mocks.ConfigResolver) { - rr.EXPECT().Get(mock.AnythingOfType("*context.emptyCtx"), testID).Return(nil, errors.New("some error")) + rr.EXPECT().Get(mock.AnythingOfType("context.todoCtx"), testID).Return(nil, errors.New("some error")) }, Err: errors.New("some error"), }, { Description: "should return error if type unknown", Setup: func(rr *mocks.ReceiverRepository, ss *mocks.ConfigResolver) { - rr.EXPECT().Get(mock.AnythingOfType("*context.emptyCtx"), testID).Return(&receiver.Receiver{ + rr.EXPECT().Get(mock.AnythingOfType("context.todoCtx"), testID).Return(&receiver.Receiver{ Type: "random", }, nil) }, @@ -314,14 +314,14 @@ func TestService_GetReceiver(t *testing.T) { { Description: "should return error not found if Get repository return not found error", Setup: func(rr *mocks.ReceiverRepository, ss *mocks.ConfigResolver) { - rr.EXPECT().Get(mock.AnythingOfType("*context.emptyCtx"), testID).Return(nil, receiver.NotFoundError{}) + rr.EXPECT().Get(mock.AnythingOfType("context.todoCtx"), testID).Return(nil, receiver.NotFoundError{}) }, Err: errors.New("receiver not found"), }, { Description: "should return error if Get repository success and decrypt error", Setup: func(rr *mocks.ReceiverRepository, ss *mocks.ConfigResolver) { - rr.EXPECT().Get(mock.AnythingOfType("*context.emptyCtx"), testID).Return(&receiver.Receiver{ + rr.EXPECT().Get(mock.AnythingOfType("context.todoCtx"), testID).Return(&receiver.Receiver{ ID: 10, Name: "foo", Type: receiver.TypeSlack, @@ -334,7 +334,7 @@ func TestService_GetReceiver(t *testing.T) { CreatedAt: timeNow, UpdatedAt: timeNow, }, nil) - ss.EXPECT().PostHookDBTransformConfigs(mock.AnythingOfType("*context.emptyCtx"), map[string]any{ + ss.EXPECT().PostHookDBTransformConfigs(mock.AnythingOfType("context.todoCtx"), map[string]any{ "token": "key", }).Return(nil, errors.New("decrypt error")) }, @@ -343,7 +343,7 @@ func TestService_GetReceiver(t *testing.T) { { Description: "should success if Get repository and decrypt success", Setup: func(rr *mocks.ReceiverRepository, ss *mocks.ConfigResolver) { - rr.EXPECT().Get(mock.AnythingOfType("*context.emptyCtx"), testID).Return(&receiver.Receiver{ + rr.EXPECT().Get(mock.AnythingOfType("context.todoCtx"), testID).Return(&receiver.Receiver{ ID: 10, Name: "foo", Type: receiver.TypeSlack, @@ -356,12 +356,12 @@ func TestService_GetReceiver(t *testing.T) { CreatedAt: timeNow, UpdatedAt: timeNow, }, nil) - ss.EXPECT().PostHookDBTransformConfigs(mock.AnythingOfType("*context.emptyCtx"), map[string]any{ + ss.EXPECT().PostHookDBTransformConfigs(mock.AnythingOfType("context.todoCtx"), map[string]any{ "token": "key", }).Return(map[string]any{ "token": "decrypted_key", }, nil) - ss.EXPECT().BuildData(mock.AnythingOfType("*context.emptyCtx"), map[string]any{ + ss.EXPECT().BuildData(mock.AnythingOfType("context.todoCtx"), map[string]any{ "token": "decrypted_key", }).Return(map[string]any{ "newdata": "populated", @@ -431,7 +431,7 @@ func TestService_UpdateReceiver(t *testing.T) { { Description: "should return error if get receiver return error", Setup: func(rr *mocks.ReceiverRepository, ss *mocks.ConfigResolver) { - rr.EXPECT().Get(mock.AnythingOfType("*context.emptyCtx"), mock.AnythingOfType("uint64")).Return(nil, errors.New("some error")) + rr.EXPECT().Get(mock.AnythingOfType("context.todoCtx"), mock.AnythingOfType("uint64")).Return(nil, errors.New("some error")) }, Rcv: &receiver.Receiver{ ID: 123, @@ -441,7 +441,7 @@ func TestService_UpdateReceiver(t *testing.T) { { Description: "should return error if type unknown", Setup: func(rr *mocks.ReceiverRepository, ss *mocks.ConfigResolver) { - rr.EXPECT().Get(mock.AnythingOfType("*context.emptyCtx"), mock.AnythingOfType("uint64")).Return(&receiver.Receiver{ + rr.EXPECT().Get(mock.AnythingOfType("context.todoCtx"), mock.AnythingOfType("uint64")).Return(&receiver.Receiver{ Type: "random", }, nil) }, @@ -453,14 +453,14 @@ func TestService_UpdateReceiver(t *testing.T) { { Description: "should return error if PreHookDBTransformConfigs return error", Setup: func(rr *mocks.ReceiverRepository, ss *mocks.ConfigResolver) { - rr.EXPECT().Get(mock.AnythingOfType("*context.emptyCtx"), mock.AnythingOfType("uint64")).Return(&receiver.Receiver{ + rr.EXPECT().Get(mock.AnythingOfType("context.todoCtx"), mock.AnythingOfType("uint64")).Return(&receiver.Receiver{ ID: 123, Type: receiver.TypeSlack, Configurations: map[string]any{ "token": "key", }, }, nil) - ss.EXPECT().PreHookDBTransformConfigs(mock.AnythingOfType("*context.emptyCtx"), map[string]any{"token": "key"}).Return(nil, errors.New("some error")) + ss.EXPECT().PreHookDBTransformConfigs(mock.AnythingOfType("context.todoCtx"), map[string]any{"token": "key"}).Return(nil, errors.New("some error")) }, Rcv: &receiver.Receiver{ ID: 123, @@ -474,17 +474,17 @@ func TestService_UpdateReceiver(t *testing.T) { { Description: "should return error if Update repository return error", Setup: func(rr *mocks.ReceiverRepository, ss *mocks.ConfigResolver) { - rr.EXPECT().Get(mock.AnythingOfType("*context.emptyCtx"), mock.AnythingOfType("uint64")).Return(&receiver.Receiver{ + rr.EXPECT().Get(mock.AnythingOfType("context.todoCtx"), mock.AnythingOfType("uint64")).Return(&receiver.Receiver{ ID: 123, Type: receiver.TypeSlack, Configurations: map[string]any{ "token": "key", }, }, nil) - ss.EXPECT().PreHookDBTransformConfigs(mock.AnythingOfType("*context.emptyCtx"), map[string]any{"token": "key"}).Return(map[string]any{ + ss.EXPECT().PreHookDBTransformConfigs(mock.AnythingOfType("context.todoCtx"), map[string]any{"token": "key"}).Return(map[string]any{ "token": "encrypted_key", }, nil) - rr.EXPECT().Update(mock.AnythingOfType("*context.emptyCtx"), &receiver.Receiver{ + rr.EXPECT().Update(mock.AnythingOfType("context.todoCtx"), &receiver.Receiver{ ID: 123, Type: receiver.TypeSlack, Configurations: map[string]any{ @@ -504,17 +504,17 @@ func TestService_UpdateReceiver(t *testing.T) { { Description: "should return nil error if no error returned", Setup: func(rr *mocks.ReceiverRepository, ss *mocks.ConfigResolver) { - rr.EXPECT().Get(mock.AnythingOfType("*context.emptyCtx"), mock.AnythingOfType("uint64")).Return(&receiver.Receiver{ + rr.EXPECT().Get(mock.AnythingOfType("context.todoCtx"), mock.AnythingOfType("uint64")).Return(&receiver.Receiver{ ID: 123, Type: receiver.TypeSlack, Configurations: map[string]any{ "token": "old-key", }, }, nil) - ss.EXPECT().PreHookDBTransformConfigs(mock.AnythingOfType("*context.emptyCtx"), map[string]any{"token": "key"}).Return(map[string]any{ + ss.EXPECT().PreHookDBTransformConfigs(mock.AnythingOfType("context.todoCtx"), map[string]any{"token": "key"}).Return(map[string]any{ "token": "encrypted_key", }, nil) - rr.EXPECT().Update(mock.AnythingOfType("*context.emptyCtx"), &receiver.Receiver{ + rr.EXPECT().Update(mock.AnythingOfType("context.todoCtx"), &receiver.Receiver{ ID: 123, Type: receiver.TypeSlack, Configurations: map[string]any{ @@ -533,17 +533,17 @@ func TestService_UpdateReceiver(t *testing.T) { }, { Description: "should return error not found if repository return not found error", Setup: func(rr *mocks.ReceiverRepository, ss *mocks.ConfigResolver) { - rr.EXPECT().Get(mock.AnythingOfType("*context.emptyCtx"), mock.AnythingOfType("uint64")).Return(&receiver.Receiver{ + rr.EXPECT().Get(mock.AnythingOfType("context.todoCtx"), mock.AnythingOfType("uint64")).Return(&receiver.Receiver{ ID: 123, Type: receiver.TypeSlack, Configurations: map[string]any{ "token": "key", }, }, nil) - ss.EXPECT().PreHookDBTransformConfigs(mock.AnythingOfType("*context.emptyCtx"), map[string]any{"token": "key"}).Return(map[string]any{ + ss.EXPECT().PreHookDBTransformConfigs(mock.AnythingOfType("context.todoCtx"), map[string]any{"token": "key"}).Return(map[string]any{ "token": "encrypted_key", }, nil) - rr.EXPECT().Update(mock.AnythingOfType("*context.emptyCtx"), &receiver.Receiver{ + rr.EXPECT().Update(mock.AnythingOfType("context.todoCtx"), &receiver.Receiver{ ID: 123, Type: receiver.TypeSlack, Configurations: map[string]any{ @@ -597,7 +597,7 @@ func TestDeleteReceiver(t *testing.T) { t.Run("should call repository Delete method and return nil if no error", func(t *testing.T) { repositoryMock := &mocks.ReceiverRepository{} dummyService := receiver.NewService(repositoryMock, nil) - repositoryMock.EXPECT().Delete(mock.AnythingOfType("*context.emptyCtx"), receiverID).Return(nil).Once() + repositoryMock.EXPECT().Delete(mock.AnythingOfType("context.todoCtx"), receiverID).Return(nil).Once() err := dummyService.Delete(ctx, receiverID) assert.Nil(t, err) repositoryMock.AssertExpectations(t) @@ -606,7 +606,7 @@ func TestDeleteReceiver(t *testing.T) { t.Run("should call repository Delete method and return error if any", func(t *testing.T) { repositoryMock := &mocks.ReceiverRepository{} dummyService := receiver.NewService(repositoryMock, nil) - repositoryMock.EXPECT().Delete(mock.AnythingOfType("*context.emptyCtx"), receiverID).Return(errors.New("random error")).Once() + repositoryMock.EXPECT().Delete(mock.AnythingOfType("context.todoCtx"), receiverID).Return(errors.New("random error")).Once() err := dummyService.Delete(ctx, receiverID) assert.EqualError(t, err, "random error") repositoryMock.AssertExpectations(t) @@ -672,7 +672,7 @@ func TestService_ExpandParents(t *testing.T) { { Description: "should return expanded receivers if there is any child receivers found", Setup: func(rr *mocks.ReceiverRepository, ss *mocks.ConfigResolver, sc *mocks.ConfigResolver) { - rr.EXPECT().List(mock.AnythingOfType("*context.emptyCtx"), receiver.Filter{ + rr.EXPECT().List(mock.AnythingOfType("context.todoCtx"), receiver.Filter{ ReceiverIDs: []uint64{1, 2}, Expanded: false, }).Return([]receiver.Receiver{ diff --git a/core/rule/mocks/rule_uploader.go b/core/rule/mocks/rule_uploader.go index 37300e6e..d6dc6f37 100644 --- a/core/rule/mocks/rule_uploader.go +++ b/core/rule/mocks/rule_uploader.go @@ -5,9 +5,11 @@ package mocks import ( context "context" - provider "github.com/goto/siren/core/provider" + namespace "github.com/goto/siren/core/namespace" mock "github.com/stretchr/testify/mock" + provider "github.com/goto/siren/core/provider" + rule "github.com/goto/siren/core/rule" template "github.com/goto/siren/core/template" @@ -26,13 +28,13 @@ func (_m *RuleUploader) EXPECT() *RuleUploader_Expecter { return &RuleUploader_Expecter{mock: &_m.Mock} } -// UpsertRule provides a mock function with given fields: ctx, namespaceURN, prov, rl, templateToUpdate -func (_m *RuleUploader) UpsertRule(ctx context.Context, namespaceURN string, prov provider.Provider, rl *rule.Rule, templateToUpdate *template.Template) error { - ret := _m.Called(ctx, namespaceURN, prov, rl, templateToUpdate) +// UpsertRule provides a mock function with given fields: ctx, ns, prov, rl, templateToUpdate +func (_m *RuleUploader) UpsertRule(ctx context.Context, ns namespace.Namespace, prov provider.Provider, rl *rule.Rule, templateToUpdate *template.Template) error { + ret := _m.Called(ctx, ns, prov, rl, templateToUpdate) var r0 error - if rf, ok := ret.Get(0).(func(context.Context, string, provider.Provider, *rule.Rule, *template.Template) error); ok { - r0 = rf(ctx, namespaceURN, prov, rl, templateToUpdate) + if rf, ok := ret.Get(0).(func(context.Context, namespace.Namespace, provider.Provider, *rule.Rule, *template.Template) error); ok { + r0 = rf(ctx, ns, prov, rl, templateToUpdate) } else { r0 = ret.Error(0) } @@ -47,17 +49,17 @@ type RuleUploader_UpsertRule_Call struct { // UpsertRule is a helper method to define mock.On call // - ctx context.Context -// - namespaceURN string +// - ns namespace.Namespace // - prov provider.Provider // - rl *rule.Rule // - templateToUpdate *template.Template -func (_e *RuleUploader_Expecter) UpsertRule(ctx interface{}, namespaceURN interface{}, prov interface{}, rl interface{}, templateToUpdate interface{}) *RuleUploader_UpsertRule_Call { - return &RuleUploader_UpsertRule_Call{Call: _e.mock.On("UpsertRule", ctx, namespaceURN, prov, rl, templateToUpdate)} +func (_e *RuleUploader_Expecter) UpsertRule(ctx interface{}, ns interface{}, prov interface{}, rl interface{}, templateToUpdate interface{}) *RuleUploader_UpsertRule_Call { + return &RuleUploader_UpsertRule_Call{Call: _e.mock.On("UpsertRule", ctx, ns, prov, rl, templateToUpdate)} } -func (_c *RuleUploader_UpsertRule_Call) Run(run func(ctx context.Context, namespaceURN string, prov provider.Provider, rl *rule.Rule, templateToUpdate *template.Template)) *RuleUploader_UpsertRule_Call { +func (_c *RuleUploader_UpsertRule_Call) Run(run func(ctx context.Context, ns namespace.Namespace, prov provider.Provider, rl *rule.Rule, templateToUpdate *template.Template)) *RuleUploader_UpsertRule_Call { _c.Call.Run(func(args mock.Arguments) { - run(args[0].(context.Context), args[1].(string), args[2].(provider.Provider), args[3].(*rule.Rule), args[4].(*template.Template)) + run(args[0].(context.Context), args[1].(namespace.Namespace), args[2].(provider.Provider), args[3].(*rule.Rule), args[4].(*template.Template)) }) return _c } @@ -67,7 +69,7 @@ func (_c *RuleUploader_UpsertRule_Call) Return(_a0 error) *RuleUploader_UpsertRu return _c } -func (_c *RuleUploader_UpsertRule_Call) RunAndReturn(run func(context.Context, string, provider.Provider, *rule.Rule, *template.Template) error) *RuleUploader_UpsertRule_Call { +func (_c *RuleUploader_UpsertRule_Call) RunAndReturn(run func(context.Context, namespace.Namespace, provider.Provider, *rule.Rule, *template.Template) error) *RuleUploader_UpsertRule_Call { _c.Call.Return(run) return _c } diff --git a/core/rule/provider_plugin.go b/core/rule/provider_plugin.go index 79abb0e7..b0873e39 100644 --- a/core/rule/provider_plugin.go +++ b/core/rule/provider_plugin.go @@ -3,6 +3,7 @@ package rule import ( "context" + "github.com/goto/siren/core/namespace" "github.com/goto/siren/core/provider" "github.com/goto/siren/core/template" ) @@ -13,5 +14,5 @@ import ( // //go:generate mockery --name=RuleUploader -r --case underscore --with-expecter --structname RuleUploader --filename rule_uploader.go --output=./mocks type RuleUploader interface { - UpsertRule(ctx context.Context, namespaceURN string, prov provider.Provider, rl *Rule, templateToUpdate *template.Template) error + UpsertRule(ctx context.Context, ns namespace.Namespace, prov provider.Provider, rl *Rule, templateToUpdate *template.Template) error } diff --git a/core/rule/service.go b/core/rule/service.go index f12a74e7..5ce278a6 100644 --- a/core/rule/service.go +++ b/core/rule/service.go @@ -98,7 +98,7 @@ func (s *Service) Upsert(ctx context.Context, rl *Rule) error { return err } - if err := pluginService.UpsertRule(ctx, ns.URN, ns.Provider, rl, templateToUpdate); err != nil { + if err := pluginService.UpsertRule(ctx, *ns, ns.Provider, rl, templateToUpdate); err != nil { if err := s.repository.Rollback(ctx, err); err != nil { return err } diff --git a/core/rule/service_test.go b/core/rule/service_test.go index 96257b22..08f4231b 100644 --- a/core/rule/service_test.go +++ b/core/rule/service_test.go @@ -39,7 +39,7 @@ func TestService_Upsert(t *testing.T) { }, }, Setup: func(rr *mocks.RuleRepository, ts *mocks.TemplateService, ns *mocks.NamespaceService, ru *mocks.RuleUploader) { - ns.EXPECT().Get(mock.AnythingOfType("*context.emptyCtx"), mock.AnythingOfType("uint64")).Return(nil, errors.New("some error")) + ns.EXPECT().Get(mock.AnythingOfType("context.todoCtx"), mock.AnythingOfType("uint64")).Return(nil, errors.New("some error")) }, ErrString: "some error", }, @@ -58,8 +58,8 @@ func TestService_Upsert(t *testing.T) { }, }, Setup: func(rr *mocks.RuleRepository, ts *mocks.TemplateService, ns *mocks.NamespaceService, ru *mocks.RuleUploader) { - ns.EXPECT().Get(mock.AnythingOfType("*context.emptyCtx"), mock.AnythingOfType("uint64")).Return(&namespace.Namespace{}, nil) - ts.EXPECT().GetByName(mock.AnythingOfType("*context.emptyCtx"), mock.AnythingOfType("string")).Return(nil, errors.New("some error")) + ns.EXPECT().Get(mock.AnythingOfType("context.todoCtx"), mock.AnythingOfType("uint64")).Return(&namespace.Namespace{}, nil) + ts.EXPECT().GetByName(mock.AnythingOfType("context.todoCtx"), mock.AnythingOfType("string")).Return(nil, errors.New("some error")) }, ErrString: "some error", }, @@ -78,15 +78,15 @@ func TestService_Upsert(t *testing.T) { }, }, Setup: func(rr *mocks.RuleRepository, ts *mocks.TemplateService, ns *mocks.NamespaceService, ru *mocks.RuleUploader) { - ts.EXPECT().GetByName(mock.AnythingOfType("*context.emptyCtx"), mock.AnythingOfType("string")).Return(&template.Template{}, nil) - ns.EXPECT().Get(mock.AnythingOfType("*context.emptyCtx"), mock.AnythingOfType("uint64")).Return(&namespace.Namespace{ + ts.EXPECT().GetByName(mock.AnythingOfType("context.todoCtx"), mock.AnythingOfType("string")).Return(&template.Template{}, nil) + ns.EXPECT().Get(mock.AnythingOfType("context.todoCtx"), mock.AnythingOfType("uint64")).Return(&namespace.Namespace{ Provider: provider.Provider{ - Type: provider.TypeCortex, + Type: "cortex", }, }, nil) rr.EXPECT().WithTransaction(ctx).Return(ctx) - rr.EXPECT().Upsert(mock.AnythingOfType("*context.emptyCtx"), mock.AnythingOfType("*rule.Rule")).Return(errors.New("some error")) + rr.EXPECT().Upsert(mock.AnythingOfType("context.todoCtx"), mock.AnythingOfType("*rule.Rule")).Return(errors.New("some error")) rr.EXPECT().Rollback(ctx, mock.Anything).Return(nil) }, ErrString: "some error", @@ -106,11 +106,11 @@ func TestService_Upsert(t *testing.T) { }, }, Setup: func(rr *mocks.RuleRepository, ts *mocks.TemplateService, ns *mocks.NamespaceService, ru *mocks.RuleUploader) { - ts.EXPECT().GetByName(mock.AnythingOfType("*context.emptyCtx"), mock.AnythingOfType("string")).Return(&template.Template{}, nil) - ns.EXPECT().Get(mock.AnythingOfType("*context.emptyCtx"), mock.AnythingOfType("uint64")).Return(&namespace.Namespace{}, nil) + ts.EXPECT().GetByName(mock.AnythingOfType("context.todoCtx"), mock.AnythingOfType("string")).Return(&template.Template{}, nil) + ns.EXPECT().Get(mock.AnythingOfType("context.todoCtx"), mock.AnythingOfType("uint64")).Return(&namespace.Namespace{}, nil) rr.EXPECT().WithTransaction(ctx).Return(ctx) - rr.EXPECT().Upsert(mock.AnythingOfType("*context.emptyCtx"), mock.AnythingOfType("*rule.Rule")).Return(errors.New("some error")) + rr.EXPECT().Upsert(mock.AnythingOfType("context.todoCtx"), mock.AnythingOfType("*rule.Rule")).Return(errors.New("some error")) rr.EXPECT().Rollback(ctx, errors.New("some error")).Return(nil) }, ErrString: "some error", @@ -129,16 +129,16 @@ func TestService_Upsert(t *testing.T) { }, }, Setup: func(rr *mocks.RuleRepository, ts *mocks.TemplateService, ns *mocks.NamespaceService, ru *mocks.RuleUploader) { - ts.EXPECT().GetByName(mock.AnythingOfType("*context.emptyCtx"), mock.AnythingOfType("string")).Return(&template.Template{}, nil) - ns.EXPECT().Get(mock.AnythingOfType("*context.emptyCtx"), mock.AnythingOfType("uint64")).Return(&namespace.Namespace{ + ts.EXPECT().GetByName(mock.AnythingOfType("context.todoCtx"), mock.AnythingOfType("string")).Return(&template.Template{}, nil) + ns.EXPECT().Get(mock.AnythingOfType("context.todoCtx"), mock.AnythingOfType("uint64")).Return(&namespace.Namespace{ Provider: provider.Provider{ - Type: provider.TypeCortex, + Type: "cortex", }, }, nil) rr.EXPECT().WithTransaction(ctx).Return(ctx) - rr.EXPECT().Upsert(mock.AnythingOfType("*context.emptyCtx"), mock.AnythingOfType("*rule.Rule")).Return(nil) - ru.EXPECT().UpsertRule(mock.Anything, mock.AnythingOfType("string"), mock.AnythingOfType("provider.Provider"), mock.AnythingOfType("*rule.Rule"), mock.AnythingOfType("*template.Template")).Return(nil) + rr.EXPECT().Upsert(mock.AnythingOfType("context.todoCtx"), mock.AnythingOfType("*rule.Rule")).Return(nil) + ru.EXPECT().UpsertRule(mock.Anything, mock.AnythingOfType("namespace.Namespace"), mock.AnythingOfType("provider.Provider"), mock.AnythingOfType("*rule.Rule"), mock.AnythingOfType("*template.Template")).Return(nil) rr.EXPECT().Commit(ctx).Return(nil) }, }, @@ -157,7 +157,7 @@ func TestService_Upsert(t *testing.T) { }, }, Setup: func(rr *mocks.RuleRepository, ts *mocks.TemplateService, ns *mocks.NamespaceService, ru *mocks.RuleUploader) { - ts.EXPECT().GetByName(mock.AnythingOfType("*context.emptyCtx"), mock.AnythingOfType("string")).Return(&template.Template{ + ts.EXPECT().GetByName(mock.AnythingOfType("context.todoCtx"), mock.AnythingOfType("string")).Return(&template.Template{ Variables: []template.Variable{ { Name: "var1", @@ -167,15 +167,15 @@ func TestService_Upsert(t *testing.T) { }, }, }, nil) - ns.EXPECT().Get(mock.AnythingOfType("*context.emptyCtx"), mock.AnythingOfType("uint64")).Return(&namespace.Namespace{ + ns.EXPECT().Get(mock.AnythingOfType("context.todoCtx"), mock.AnythingOfType("uint64")).Return(&namespace.Namespace{ Provider: provider.Provider{ - Type: provider.TypeCortex, + Type: "cortex", }, }, nil) rr.EXPECT().WithTransaction(ctx).Return(ctx) - rr.EXPECT().Upsert(mock.AnythingOfType("*context.emptyCtx"), mock.AnythingOfType("*rule.Rule")).Return(nil) - ru.EXPECT().UpsertRule(mock.Anything, mock.AnythingOfType("string"), mock.AnythingOfType("provider.Provider"), mock.AnythingOfType("*rule.Rule"), mock.AnythingOfType("*template.Template")).Return(errors.New("some error")) + rr.EXPECT().Upsert(mock.AnythingOfType("context.todoCtx"), mock.AnythingOfType("*rule.Rule")).Return(nil) + ru.EXPECT().UpsertRule(mock.Anything, mock.AnythingOfType("namespace.Namespace"), mock.AnythingOfType("provider.Provider"), mock.AnythingOfType("*rule.Rule"), mock.AnythingOfType("*template.Template")).Return(errors.New("some error")) rr.EXPECT().Rollback(ctx, mock.Anything).Return(nil) }, ErrString: "some error", @@ -195,7 +195,7 @@ func TestService_Upsert(t *testing.T) { }, }, Setup: func(rr *mocks.RuleRepository, ts *mocks.TemplateService, ns *mocks.NamespaceService, ru *mocks.RuleUploader) { - ts.EXPECT().GetByName(mock.AnythingOfType("*context.emptyCtx"), mock.AnythingOfType("string")).Return(&template.Template{ + ts.EXPECT().GetByName(mock.AnythingOfType("context.todoCtx"), mock.AnythingOfType("string")).Return(&template.Template{ Variables: []template.Variable{ { Name: "var1", @@ -205,15 +205,15 @@ func TestService_Upsert(t *testing.T) { }, }, }, nil) - ns.EXPECT().Get(mock.AnythingOfType("*context.emptyCtx"), mock.AnythingOfType("uint64")).Return(&namespace.Namespace{ + ns.EXPECT().Get(mock.AnythingOfType("context.todoCtx"), mock.AnythingOfType("uint64")).Return(&namespace.Namespace{ Provider: provider.Provider{ - Type: provider.TypeCortex, + Type: "cortex", }, }, nil) rr.EXPECT().WithTransaction(ctx).Return(ctx) - rr.EXPECT().Upsert(mock.AnythingOfType("*context.emptyCtx"), mock.AnythingOfType("*rule.Rule")).Return(nil) - ru.EXPECT().UpsertRule(mock.Anything, mock.AnythingOfType("string"), mock.AnythingOfType("provider.Provider"), mock.AnythingOfType("*rule.Rule"), mock.AnythingOfType("*template.Template")).Return(errors.New("some error")) + rr.EXPECT().Upsert(mock.AnythingOfType("context.todoCtx"), mock.AnythingOfType("*rule.Rule")).Return(nil) + ru.EXPECT().UpsertRule(mock.Anything, mock.AnythingOfType("namespace.Namespace"), mock.AnythingOfType("provider.Provider"), mock.AnythingOfType("*rule.Rule"), mock.AnythingOfType("*template.Template")).Return(errors.New("some error")) rr.EXPECT().Rollback(ctx, mock.Anything).Return(errors.New("rollback error")) }, ErrString: "rollback error", @@ -233,7 +233,7 @@ func TestService_Upsert(t *testing.T) { }, }, Setup: func(rr *mocks.RuleRepository, ts *mocks.TemplateService, ns *mocks.NamespaceService, ru *mocks.RuleUploader) { - ts.EXPECT().GetByName(mock.AnythingOfType("*context.emptyCtx"), mock.AnythingOfType("string")).Return(&template.Template{ + ts.EXPECT().GetByName(mock.AnythingOfType("context.todoCtx"), mock.AnythingOfType("string")).Return(&template.Template{ Variables: []template.Variable{ { Name: "var1", @@ -243,15 +243,15 @@ func TestService_Upsert(t *testing.T) { }, }, }, nil) - ns.EXPECT().Get(mock.AnythingOfType("*context.emptyCtx"), mock.AnythingOfType("uint64")).Return(&namespace.Namespace{ + ns.EXPECT().Get(mock.AnythingOfType("context.todoCtx"), mock.AnythingOfType("uint64")).Return(&namespace.Namespace{ Provider: provider.Provider{ - Type: provider.TypeCortex, + Type: "cortex", }, }, nil) rr.EXPECT().WithTransaction(ctx).Return(ctx) - rr.EXPECT().Upsert(mock.AnythingOfType("*context.emptyCtx"), mock.AnythingOfType("*rule.Rule")).Return(nil) - ru.EXPECT().UpsertRule(mock.Anything, mock.AnythingOfType("string"), mock.AnythingOfType("provider.Provider"), mock.AnythingOfType("*rule.Rule"), mock.AnythingOfType("*template.Template")).Return(nil) + rr.EXPECT().Upsert(mock.AnythingOfType("context.todoCtx"), mock.AnythingOfType("*rule.Rule")).Return(nil) + ru.EXPECT().UpsertRule(mock.Anything, mock.AnythingOfType("namespace.Namespace"), mock.AnythingOfType("provider.Provider"), mock.AnythingOfType("*rule.Rule"), mock.AnythingOfType("*template.Template")).Return(nil) rr.EXPECT().Commit(ctx).Return(errors.New("some commit error")) }, ErrString: "some commit error", @@ -272,7 +272,7 @@ func TestService_Upsert(t *testing.T) { templateServiceMock, namespaceServiceMock, map[string]rule.RuleUploader{ - provider.TypeCortex: ruleUploaderMock, + "cortex": ruleUploaderMock, }, ) @@ -297,7 +297,7 @@ func TestService_List(t *testing.T) { t.Run("should call repository List method and return result in domain's type", func(t *testing.T) { repositoryMock := &mocks.RuleRepository{} dummyService := rule.NewService(repositoryMock, nil, nil, nil) - ctx := context.Background() + ctx := context.TODO() dummyRules := []rule.Rule{{ ID: 1, Name: "bar", Enabled: true, GroupName: "test-group", Namespace: "baz", Template: "test-tmpl", @@ -333,7 +333,7 @@ func TestService_List(t *testing.T) { t.Run("should call repository List method and return error if any", func(t *testing.T) { repositoryMock := &mocks.RuleRepository{} dummyService := rule.NewService(repositoryMock, nil, nil, nil) - ctx := context.Background() + ctx := context.TODO() repositoryMock.EXPECT().List(ctx, mock.Anything).Return(nil, errors.New("random error")).Once() diff --git a/core/subscription/service_test.go b/core/subscription/service_test.go index 2adae050..91d7d753 100644 --- a/core/subscription/service_test.go +++ b/core/subscription/service_test.go @@ -24,13 +24,13 @@ func TestService_List(t *testing.T) { { Description: "should return nil error if subscription list repository return no error", Setup: func(sr *mocks.SubscriptionRepository) { - sr.EXPECT().List(mock.AnythingOfType("*context.emptyCtx"), mock.AnythingOfType("subscription.Filter")).Return([]subscription.Subscription{}, nil) + sr.EXPECT().List(mock.AnythingOfType("context.todoCtx"), mock.AnythingOfType("subscription.Filter")).Return([]subscription.Subscription{}, nil) }, }, { Description: "should return error if subscription list repository return error", Setup: func(sr *mocks.SubscriptionRepository) { - sr.EXPECT().List(mock.AnythingOfType("*context.emptyCtx"), mock.AnythingOfType("subscription.Filter")).Return(nil, errors.New("some error")) + sr.EXPECT().List(mock.AnythingOfType("context.todoCtx"), mock.AnythingOfType("subscription.Filter")).Return(nil, errors.New("some error")) }, ErrString: "some error", }, @@ -71,20 +71,20 @@ func TestService_Get(t *testing.T) { { Description: "should return nil error if subscription get repository return no error", Setup: func(sr *mocks.SubscriptionRepository) { - sr.EXPECT().Get(mock.AnythingOfType("*context.emptyCtx"), mock.AnythingOfType("uint64")).Return(&subscription.Subscription{}, nil) + sr.EXPECT().Get(mock.AnythingOfType("context.todoCtx"), mock.AnythingOfType("uint64")).Return(&subscription.Subscription{}, nil) }, }, { Description: "should return error if subscription get repository return error", Setup: func(sr *mocks.SubscriptionRepository) { - sr.EXPECT().Get(mock.AnythingOfType("*context.emptyCtx"), mock.AnythingOfType("uint64")).Return(nil, errors.New("some error")) + sr.EXPECT().Get(mock.AnythingOfType("context.todoCtx"), mock.AnythingOfType("uint64")).Return(nil, errors.New("some error")) }, ErrString: "some error", }, { Description: "should return error not found if subscription get repository return not found", Setup: func(sr *mocks.SubscriptionRepository) { - sr.EXPECT().Get(mock.AnythingOfType("*context.emptyCtx"), mock.AnythingOfType("uint64")).Return(nil, subscription.NotFoundError{}) + sr.EXPECT().Get(mock.AnythingOfType("context.todoCtx"), mock.AnythingOfType("uint64")).Return(nil, subscription.NotFoundError{}) }, ErrString: "subscription not found", }, @@ -127,28 +127,28 @@ func TestService_Create(t *testing.T) { { Description: "should return error conflict if create subscription return error duplicate", Setup: func(sr *mocks.SubscriptionRepository, ns *mocks.NamespaceService, rs *mocks.ReceiverService) { - sr.EXPECT().Create(mock.AnythingOfType("*context.emptyCtx"), mock.AnythingOfType("*subscription.Subscription")).Return(subscription.ErrDuplicate) + sr.EXPECT().Create(mock.AnythingOfType("context.todoCtx"), mock.AnythingOfType("*subscription.Subscription")).Return(subscription.ErrDuplicate) }, ErrString: "urn already exist", }, { Description: "should return error not found if create subscription return error relation", Setup: func(sr *mocks.SubscriptionRepository, ns *mocks.NamespaceService, rs *mocks.ReceiverService) { - sr.EXPECT().Create(mock.AnythingOfType("*context.emptyCtx"), mock.AnythingOfType("*subscription.Subscription")).Return(subscription.ErrRelation) + sr.EXPECT().Create(mock.AnythingOfType("context.todoCtx"), mock.AnythingOfType("*subscription.Subscription")).Return(subscription.ErrRelation) }, ErrString: "namespace id does not exist", }, { Description: "should return error if create subscription return some error", Setup: func(sr *mocks.SubscriptionRepository, ns *mocks.NamespaceService, rs *mocks.ReceiverService) { - sr.EXPECT().Create(mock.AnythingOfType("*context.emptyCtx"), mock.AnythingOfType("*subscription.Subscription")).Return(errors.New("some error")) + sr.EXPECT().Create(mock.AnythingOfType("context.todoCtx"), mock.AnythingOfType("*subscription.Subscription")).Return(errors.New("some error")) }, ErrString: "some error", }, { Description: "should return no error if create subscription return no error", Setup: func(sr *mocks.SubscriptionRepository, ns *mocks.NamespaceService, rs *mocks.ReceiverService) { - sr.EXPECT().Create(mock.AnythingOfType("*context.emptyCtx"), mock.AnythingOfType("*subscription.Subscription")).Return(nil) + sr.EXPECT().Create(mock.AnythingOfType("context.todoCtx"), mock.AnythingOfType("*subscription.Subscription")).Return(nil) }, }, } @@ -197,35 +197,35 @@ func TestService_Update(t *testing.T) { { Description: "should return error conflict if update subscription return error duplicate", Setup: func(sr *mocks.SubscriptionRepository, ns *mocks.NamespaceService, rs *mocks.ReceiverService) { - sr.EXPECT().Update(mock.AnythingOfType("*context.emptyCtx"), mock.AnythingOfType("*subscription.Subscription")).Return(subscription.ErrDuplicate) + sr.EXPECT().Update(mock.AnythingOfType("context.todoCtx"), mock.AnythingOfType("*subscription.Subscription")).Return(subscription.ErrDuplicate) }, ErrString: "urn already exist", }, { Description: "should return error not found if update subscription return error relation", Setup: func(sr *mocks.SubscriptionRepository, ns *mocks.NamespaceService, rs *mocks.ReceiverService) { - sr.EXPECT().Update(mock.AnythingOfType("*context.emptyCtx"), mock.AnythingOfType("*subscription.Subscription")).Return(subscription.ErrRelation) + sr.EXPECT().Update(mock.AnythingOfType("context.todoCtx"), mock.AnythingOfType("*subscription.Subscription")).Return(subscription.ErrRelation) }, ErrString: "namespace id does not exist", }, { Description: "should return error not found if update subscription return not found error", Setup: func(sr *mocks.SubscriptionRepository, ns *mocks.NamespaceService, rs *mocks.ReceiverService) { - sr.EXPECT().Update(mock.AnythingOfType("*context.emptyCtx"), mock.AnythingOfType("*subscription.Subscription")).Return(subscription.NotFoundError{}) + sr.EXPECT().Update(mock.AnythingOfType("context.todoCtx"), mock.AnythingOfType("*subscription.Subscription")).Return(subscription.NotFoundError{}) }, ErrString: "subscription not found", }, { Description: "should return error if update subscription return some error", Setup: func(sr *mocks.SubscriptionRepository, ns *mocks.NamespaceService, rs *mocks.ReceiverService) { - sr.EXPECT().Update(mock.AnythingOfType("*context.emptyCtx"), mock.AnythingOfType("*subscription.Subscription")).Return(errors.New("some error")) + sr.EXPECT().Update(mock.AnythingOfType("context.todoCtx"), mock.AnythingOfType("*subscription.Subscription")).Return(errors.New("some error")) }, ErrString: "some error", }, { Description: "should return no error if update subscription return no error", Setup: func(sr *mocks.SubscriptionRepository, ns *mocks.NamespaceService, rs *mocks.ReceiverService) { - sr.EXPECT().Update(mock.AnythingOfType("*context.emptyCtx"), mock.AnythingOfType("*subscription.Subscription")).Return(nil) + sr.EXPECT().Update(mock.AnythingOfType("context.todoCtx"), mock.AnythingOfType("*subscription.Subscription")).Return(nil) }, }, } @@ -274,21 +274,21 @@ func TestService_Delete(t *testing.T) { { Description: "should return error if delete subscription return error", Setup: func(sr *mocks.SubscriptionRepository, ns *mocks.NamespaceService, rs *mocks.ReceiverService) { - sr.EXPECT().Delete(mock.AnythingOfType("*context.emptyCtx"), mock.AnythingOfType("uint64")).Return(errors.New("some error")) + sr.EXPECT().Delete(mock.AnythingOfType("context.todoCtx"), mock.AnythingOfType("uint64")).Return(errors.New("some error")) }, ErrString: "some error", }, { Description: "should return error if delete subscription return error", Setup: func(sr *mocks.SubscriptionRepository, ns *mocks.NamespaceService, rs *mocks.ReceiverService) { - sr.EXPECT().Delete(mock.AnythingOfType("*context.emptyCtx"), mock.AnythingOfType("uint64")).Return(errors.New("some error")) + sr.EXPECT().Delete(mock.AnythingOfType("context.todoCtx"), mock.AnythingOfType("uint64")).Return(errors.New("some error")) }, ErrString: "some error", }, { Description: "should return no error if delete subscription return no error", Setup: func(sr *mocks.SubscriptionRepository, ns *mocks.NamespaceService, rs *mocks.ReceiverService) { - sr.EXPECT().Delete(mock.AnythingOfType("*context.emptyCtx"), mock.AnythingOfType("uint64")).Return(nil) + sr.EXPECT().Delete(mock.AnythingOfType("context.todoCtx"), mock.AnythingOfType("uint64")).Return(nil) }, }, } @@ -352,7 +352,7 @@ func TestCreateReceiversMap(t *testing.T) { }, }, Setup: func(rs *mocks.ReceiverService) { - rs.EXPECT().List(mock.AnythingOfType("*context.emptyCtx"), mock.AnythingOfType("receiver.Filter")).Return(nil, errors.New("some error")) + rs.EXPECT().List(mock.AnythingOfType("context.todoCtx"), mock.AnythingOfType("receiver.Filter")).Return(nil, errors.New("some error")) }, ErrString: "some error", }, @@ -366,7 +366,7 @@ func TestCreateReceiversMap(t *testing.T) { }, }, Setup: func(rs *mocks.ReceiverService) { - rs.EXPECT().List(mock.AnythingOfType("*context.emptyCtx"), mock.AnythingOfType("receiver.Filter")).Return([]receiver.Receiver{ + rs.EXPECT().List(mock.AnythingOfType("context.todoCtx"), mock.AnythingOfType("receiver.Filter")).Return([]receiver.Receiver{ {ID: 1}, {ID: 2}, {ID: 5}, {ID: 7}, {ID: 9}, {ID: 11}, }, nil) }, @@ -391,7 +391,7 @@ func TestCreateReceiversMap(t *testing.T) { 12: {ID: 12}, }, Setup: func(rs *mocks.ReceiverService) { - rs.EXPECT().List(mock.AnythingOfType("*context.emptyCtx"), mock.AnythingOfType("receiver.Filter")).Return([]receiver.Receiver{ + rs.EXPECT().List(mock.AnythingOfType("context.todoCtx"), mock.AnythingOfType("receiver.Filter")).Return([]receiver.Receiver{ {ID: 1}, {ID: 2}, {ID: 5}, {ID: 7}, {ID: 9}, {ID: 11}, {ID: 12}, }, nil) }, @@ -406,7 +406,7 @@ func TestCreateReceiversMap(t *testing.T) { tc.Setup(receiverServiceMock) - got, err := subscription.CreateReceiversMap(context.Background(), receiverServiceMock, tc.Subscriptions) + got, err := subscription.CreateReceiversMap(context.TODO(), receiverServiceMock, tc.Subscriptions) if tc.ErrString != "" { if tc.ErrString != err.Error() { t.Fatalf("got error %s, expected was %s", err.Error(), tc.ErrString) diff --git a/core/template/service_test.go b/core/template/service_test.go index 2eb20392..fd8307b4 100644 --- a/core/template/service_test.go +++ b/core/template/service_test.go @@ -23,7 +23,7 @@ func TestService_Upsert(t *testing.T) { { Description: "should return error if upsert repository error", Setup: func(tr *mocks.TemplateRepository) { - tr.EXPECT().Upsert(mock.AnythingOfType("*context.emptyCtx"), &template.Template{ + tr.EXPECT().Upsert(mock.AnythingOfType("context.todoCtx"), &template.Template{ ID: 1, Name: "template-1", Body: "body of a template", @@ -39,7 +39,7 @@ func TestService_Upsert(t *testing.T) { { Description: "should return error conflict if upsert repository return error duplicate", Setup: func(tr *mocks.TemplateRepository) { - tr.EXPECT().Upsert(mock.AnythingOfType("*context.emptyCtx"), &template.Template{ + tr.EXPECT().Upsert(mock.AnythingOfType("context.todoCtx"), &template.Template{ ID: 1, Name: "template-1", Body: "body of a template", @@ -55,7 +55,7 @@ func TestService_Upsert(t *testing.T) { { Description: "should return nil error if upsert repository not error", Setup: func(tr *mocks.TemplateRepository) { - tr.EXPECT().Upsert(mock.AnythingOfType("*context.emptyCtx"), &template.Template{ + tr.EXPECT().Upsert(mock.AnythingOfType("context.todoCtx"), &template.Template{ ID: 1, Name: "template-1", Body: "body of a template", @@ -102,21 +102,21 @@ func TestService_GetTemplate(t *testing.T) { { Description: "should return error if get repository return error", Setup: func(tr *mocks.TemplateRepository) { - tr.EXPECT().GetByName(mock.AnythingOfType("*context.emptyCtx"), templateName).Return(nil, errors.New("some error")) + tr.EXPECT().GetByName(mock.AnythingOfType("context.todoCtx"), templateName).Return(nil, errors.New("some error")) }, Err: errors.New("some error"), }, { Description: "should return error not found if get repository return error not found", Setup: func(tr *mocks.TemplateRepository) { - tr.EXPECT().GetByName(mock.AnythingOfType("*context.emptyCtx"), templateName).Return(nil, template.NotFoundError{}) + tr.EXPECT().GetByName(mock.AnythingOfType("context.todoCtx"), templateName).Return(nil, template.NotFoundError{}) }, Err: errors.New("template not found"), }, { Description: "should return nil error if get by name repository not error", Setup: func(tr *mocks.TemplateRepository) { - tr.EXPECT().GetByName(mock.AnythingOfType("*context.emptyCtx"), templateName).Return(&template.Template{ + tr.EXPECT().GetByName(mock.AnythingOfType("context.todoCtx"), templateName).Return(&template.Template{ ID: 1, Name: "template-1", Body: "body of a template", @@ -160,7 +160,7 @@ func TestService_Render(t *testing.T) { { Description: "should render template body from the input", Setup: func(tr *mocks.TemplateRepository) { - tr.EXPECT().GetByName(mock.AnythingOfType("*context.emptyCtx"), mock.AnythingOfType("string")).Return(&template.Template{ + tr.EXPECT().GetByName(mock.AnythingOfType("context.todoCtx"), mock.AnythingOfType("string")).Return(&template.Template{ Name: "foo", Body: "The quick [[.color]] fox jumped over the [[.adjective]] dog.", Tags: []string{"baz"}, @@ -189,7 +189,7 @@ func TestService_Render(t *testing.T) { { Description: "should render template body enriched with defaults", Setup: func(tr *mocks.TemplateRepository) { - tr.EXPECT().GetByName(mock.AnythingOfType("*context.emptyCtx"), mock.AnythingOfType("string")).Return(&template.Template{ + tr.EXPECT().GetByName(mock.AnythingOfType("context.todoCtx"), mock.AnythingOfType("string")).Return(&template.Template{ Name: "foo", Body: "The quick [[.color]] fox jumped over the [[.adjective]] dog.", Tags: []string{"baz"}, @@ -217,7 +217,7 @@ func TestService_Render(t *testing.T) { { Description: "should return not found if name does not exist", Setup: func(tr *mocks.TemplateRepository) { - tr.EXPECT().GetByName(mock.AnythingOfType("*context.emptyCtx"), mock.AnythingOfType("string")).Return(nil, template.NotFoundError{}) + tr.EXPECT().GetByName(mock.AnythingOfType("context.todoCtx"), mock.AnythingOfType("string")).Return(nil, template.NotFoundError{}) }, ErrString: "template not found", }, @@ -253,7 +253,7 @@ func TestService_List(t *testing.T) { t.Run("should call repository List method and return no error if repository return nil error", func(t *testing.T) { repositoryMock := &mocks.TemplateRepository{} dummyService := template.NewService(repositoryMock) - repositoryMock.EXPECT().List(mock.AnythingOfType("*context.emptyCtx"), template.Filter{}).Return([]template.Template{}, nil).Once() + repositoryMock.EXPECT().List(mock.AnythingOfType("context.todoCtx"), template.Filter{}).Return([]template.Template{}, nil).Once() _, err := dummyService.List(ctx, template.Filter{}) assert.Nil(t, err) repositoryMock.AssertExpectations(t) @@ -262,7 +262,7 @@ func TestService_List(t *testing.T) { t.Run("should call repository Delete method and return error if any", func(t *testing.T) { repositoryMock := &mocks.TemplateRepository{} dummyService := template.NewService(repositoryMock) - repositoryMock.EXPECT().List(mock.AnythingOfType("*context.emptyCtx"), template.Filter{}).Return(nil, errors.New("random error")).Once() + repositoryMock.EXPECT().List(mock.AnythingOfType("context.todoCtx"), template.Filter{}).Return(nil, errors.New("random error")).Once() _, err := dummyService.List(ctx, template.Filter{}) assert.EqualError(t, err, "random error") repositoryMock.AssertExpectations(t) @@ -276,7 +276,7 @@ func TestService_Delete(t *testing.T) { t.Run("should call repository Delete method and return nil if no error", func(t *testing.T) { repositoryMock := &mocks.TemplateRepository{} dummyService := template.NewService(repositoryMock) - repositoryMock.EXPECT().Delete(mock.AnythingOfType("*context.emptyCtx"), templateName).Return(nil).Once() + repositoryMock.EXPECT().Delete(mock.AnythingOfType("context.todoCtx"), templateName).Return(nil).Once() err := dummyService.Delete(ctx, templateName) assert.Nil(t, err) repositoryMock.AssertExpectations(t) @@ -285,7 +285,7 @@ func TestService_Delete(t *testing.T) { t.Run("should call repository Delete method and return error if any", func(t *testing.T) { repositoryMock := &mocks.TemplateRepository{} dummyService := template.NewService(repositoryMock) - repositoryMock.EXPECT().Delete(mock.AnythingOfType("*context.emptyCtx"), templateName).Return(errors.New("random error")).Once() + repositoryMock.EXPECT().Delete(mock.AnythingOfType("context.todoCtx"), templateName).Return(errors.New("random error")).Once() err := dummyService.Delete(ctx, templateName) assert.EqualError(t, err, "random error") repositoryMock.AssertExpectations(t) diff --git a/docs/docs/concepts/plugin.md b/docs/docs/concepts/plugin.md index 72ab2eee..7dc2b483 100644 --- a/docs/docs/concepts/plugin.md +++ b/docs/docs/concepts/plugin.md @@ -25,7 +25,7 @@ type ProviderPlugin interface { SyncRuntimeConfig(ctx context.Context, namespaceID uint64, namespaceURN string, prov provider.Provider) error // RuleUploader - UpsertRule(ctx context.Context, namespaceURN string, prov provider.Provider, rl *rule.Rule, templateToUpdate *template.Template) error + UpsertRule(ctx context.Context, ns namespace.Namespace, prov provider.Provider, rl *rule.Rule, templateToUpdate *template.Template) error } ``` - **AlertTransformer** interface is being used by alert service to transform incoming alert body in Siren's Hook API to a list of `*alert.Alert`. diff --git a/go.work.sum b/go.work.sum index d46eeced..a5894ade 100644 --- a/go.work.sum +++ b/go.work.sum @@ -1,1164 +1,35 @@ -cloud.google.com/go v0.102.1/go.mod h1:XZ77E9qnTEnrgEOvr4xzfdX5TRo7fB4T2F4O6+34hIU= -cloud.google.com/go v0.104.0/go.mod h1:OO6xxXdJyvuJPcEPBLN9BJPD+jep5G1+2U5B5gkRYtA= -cloud.google.com/go v0.105.0/go.mod h1:PrLgOJNe5nfE9UMxKxgXj4mD3voiP+YQ6gdt6KMFOKM= -cloud.google.com/go v0.107.0/go.mod h1:wpc2eNrD7hXUTy8EKS10jkxpZBjASrORK7goS+3YX2I= -cloud.google.com/go v0.110.0/go.mod h1:SJnCLqQ0FCFGSZMUNUf84MV3Aia54kn7pi8st7tMzaY= -cloud.google.com/go v0.110.2/go.mod h1:k04UEeEtb6ZBRTv3dZz4CeJC3jKGxyhl0sAiVVquxiw= -cloud.google.com/go v0.110.4/go.mod h1:+EYjdK8e5RME/VY/qLCAtuyALQ9q67dvuum8i+H5xsI= -cloud.google.com/go v0.110.6/go.mod h1:+EYjdK8e5RME/VY/qLCAtuyALQ9q67dvuum8i+H5xsI= -cloud.google.com/go/accessapproval v1.4.0/go.mod h1:zybIuC3KpDOvotz59lFe5qxRZx6C75OtwbisN56xYB4= -cloud.google.com/go/accessapproval v1.5.0/go.mod h1:HFy3tuiGvMdcd/u+Cu5b9NkO1pEICJ46IR82PoUdplw= -cloud.google.com/go/accessapproval v1.6.0/go.mod h1:R0EiYnwV5fsRFiKZkPHr6mwyk2wxUJ30nL4j2pcFY2E= -cloud.google.com/go/accessapproval v1.7.1/go.mod h1:JYczztsHRMK7NTXb6Xw+dwbs/WnOJxbo/2mTI+Kgg68= -cloud.google.com/go/accesscontextmanager v1.3.0/go.mod h1:TgCBehyr5gNMz7ZaH9xubp+CE8dkrszb4oK9CWyvD4o= -cloud.google.com/go/accesscontextmanager v1.4.0/go.mod h1:/Kjh7BBu/Gh83sv+K60vN9QE5NJcd80sU33vIe2IFPE= -cloud.google.com/go/accesscontextmanager v1.6.0/go.mod h1:8XCvZWfYw3K/ji0iVnp+6pu7huxoQTLmxAbVjbloTtM= -cloud.google.com/go/accesscontextmanager v1.7.0/go.mod h1:CEGLewx8dwa33aDAZQujl7Dx+uYhS0eay198wB/VumQ= -cloud.google.com/go/accesscontextmanager v1.8.0/go.mod h1:uI+AI/r1oyWK99NN8cQ3UK76AMelMzgZCvJfsi2c+ps= -cloud.google.com/go/accesscontextmanager v1.8.1/go.mod h1:JFJHfvuaTC+++1iL1coPiG1eu5D24db2wXCDWDjIrxo= -cloud.google.com/go/aiplatform v1.22.0/go.mod h1:ig5Nct50bZlzV6NvKaTwmplLLddFx0YReh9WfTO5jKw= -cloud.google.com/go/aiplatform v1.24.0/go.mod h1:67UUvRBKG6GTayHKV8DBv2RtR1t93YRu5B1P3x99mYY= -cloud.google.com/go/aiplatform v1.27.0/go.mod h1:Bvxqtl40l0WImSb04d0hXFU7gDOiq9jQmorivIiWcKg= -cloud.google.com/go/aiplatform v1.35.0/go.mod h1:7MFT/vCaOyZT/4IIFfxH4ErVg/4ku6lKv3w0+tFTgXQ= -cloud.google.com/go/aiplatform v1.36.1/go.mod h1:WTm12vJRPARNvJ+v6P52RDHCNe4AhvjcIZ/9/RRHy/k= -cloud.google.com/go/aiplatform v1.37.0/go.mod h1:IU2Cv29Lv9oCn/9LkFiiuKfwrRTq+QQMbW+hPCxJGZw= -cloud.google.com/go/aiplatform v1.45.0/go.mod h1:Iu2Q7sC7QGhXUeOhAj/oCK9a+ULz1O4AotZiqjQ8MYA= -cloud.google.com/go/aiplatform v1.48.0/go.mod h1:Iu2Q7sC7QGhXUeOhAj/oCK9a+ULz1O4AotZiqjQ8MYA= -cloud.google.com/go/analytics v0.11.0/go.mod h1:DjEWCu41bVbYcKyvlws9Er60YE4a//bK6mnhWvQeFNI= -cloud.google.com/go/analytics v0.12.0/go.mod h1:gkfj9h6XRf9+TS4bmuhPEShsh3hH8PAZzm/41OOhQd4= -cloud.google.com/go/analytics v0.17.0/go.mod h1:WXFa3WSym4IZ+JiKmavYdJwGG/CvpqiqczmL59bTD9M= -cloud.google.com/go/analytics v0.18.0/go.mod h1:ZkeHGQlcIPkw0R/GW+boWHhCOR43xz9RN/jn7WcqfIE= -cloud.google.com/go/analytics v0.19.0/go.mod h1:k8liqf5/HCnOUkbawNtrWWc+UAzyDlW89doe8TtoDsE= -cloud.google.com/go/analytics v0.21.2/go.mod h1:U8dcUtmDmjrmUTnnnRnI4m6zKn/yaA5N9RlEkYFHpQo= -cloud.google.com/go/analytics v0.21.3/go.mod h1:U8dcUtmDmjrmUTnnnRnI4m6zKn/yaA5N9RlEkYFHpQo= -cloud.google.com/go/apigateway v1.3.0/go.mod h1:89Z8Bhpmxu6AmUxuVRg/ECRGReEdiP3vQtk4Z1J9rJk= -cloud.google.com/go/apigateway v1.4.0/go.mod h1:pHVY9MKGaH9PQ3pJ4YLzoj6U5FUDeDFBllIz7WmzJoc= -cloud.google.com/go/apigateway v1.5.0/go.mod h1:GpnZR3Q4rR7LVu5951qfXPJCHquZt02jf7xQx7kpqN8= -cloud.google.com/go/apigateway v1.6.1/go.mod h1:ufAS3wpbRjqfZrzpvLC2oh0MFlpRJm2E/ts25yyqmXA= -cloud.google.com/go/apigeeconnect v1.3.0/go.mod h1:G/AwXFAKo0gIXkPTVfZDd2qA1TxBXJ3MgMRBQkIi9jc= -cloud.google.com/go/apigeeconnect v1.4.0/go.mod h1:kV4NwOKqjvt2JYR0AoIWo2QGfoRtn/pkS3QlHp0Ni04= -cloud.google.com/go/apigeeconnect v1.5.0/go.mod h1:KFaCqvBRU6idyhSNyn3vlHXc8VMDJdRmwDF6JyFRqZ8= -cloud.google.com/go/apigeeconnect v1.6.1/go.mod h1:C4awq7x0JpLtrlQCr8AzVIzAaYgngRqWf9S5Uhg+wWs= -cloud.google.com/go/apigeeregistry v0.4.0/go.mod h1:EUG4PGcsZvxOXAdyEghIdXwAEi/4MEaoqLMLDMIwKXY= -cloud.google.com/go/apigeeregistry v0.5.0/go.mod h1:YR5+s0BVNZfVOUkMa5pAR2xGd0A473vA5M7j247o1wM= -cloud.google.com/go/apigeeregistry v0.6.0/go.mod h1:BFNzW7yQVLZ3yj0TKcwzb8n25CFBri51GVGOEUcgQsc= -cloud.google.com/go/apigeeregistry v0.7.1/go.mod h1:1XgyjZye4Mqtw7T9TsY4NW10U7BojBvG4RMD+vRDrIw= -cloud.google.com/go/apikeys v0.4.0/go.mod h1:XATS/yqZbaBK0HOssf+ALHp8jAlNHUgyfprvNcBIszU= -cloud.google.com/go/apikeys v0.5.0/go.mod h1:5aQfwY4D+ewMMWScd3hm2en3hCj+BROlyrt3ytS7KLI= -cloud.google.com/go/apikeys v0.6.0/go.mod h1:kbpXu5upyiAlGkKrJgQl8A0rKNNJ7dQ377pdroRSSi8= -cloud.google.com/go/appengine v1.4.0/go.mod h1:CS2NhuBuDXM9f+qscZ6V86m1MIIqPj3WC/UoEuR1Sno= -cloud.google.com/go/appengine v1.5.0/go.mod h1:TfasSozdkFI0zeoxW3PTBLiNqRmzraodCWatWI9Dmak= -cloud.google.com/go/appengine v1.6.0/go.mod h1:hg6i0J/BD2cKmDJbaFSYHFyZkgBEfQrDg/X0V5fJn84= -cloud.google.com/go/appengine v1.7.0/go.mod h1:eZqpbHFCqRGa2aCdope7eC0SWLV1j0neb/QnMJVWx6A= -cloud.google.com/go/appengine v1.7.1/go.mod h1:IHLToyb/3fKutRysUlFO0BPt5j7RiQ45nrzEJmKTo6E= -cloud.google.com/go/appengine v1.8.1/go.mod h1:6NJXGLVhZCN9aQ/AEDvmfzKEfoYBlfB80/BHiKVputY= -cloud.google.com/go/area120 v0.5.0/go.mod h1:DE/n4mp+iqVyvxHN41Vf1CR602GiHQjFPusMFW6bGR4= -cloud.google.com/go/area120 v0.6.0/go.mod h1:39yFJqWVgm0UZqWTOdqkLhjoC7uFfgXRC8g/ZegeAh0= -cloud.google.com/go/area120 v0.7.0/go.mod h1:a3+8EUD1SX5RUcCs3MY5YasiO1z6yLiNLRiFrykbynY= -cloud.google.com/go/area120 v0.7.1/go.mod h1:j84i4E1RboTWjKtZVWXPqvK5VHQFJRF2c1Nm69pWm9k= -cloud.google.com/go/area120 v0.8.1/go.mod h1:BVfZpGpB7KFVNxPiQBuHkX6Ed0rS51xIgmGyjrAfzsg= -cloud.google.com/go/artifactregistry v1.6.0/go.mod h1:IYt0oBPSAGYj/kprzsBjZ/4LnG/zOcHyFHjWPCi6SAQ= -cloud.google.com/go/artifactregistry v1.7.0/go.mod h1:mqTOFOnGZx8EtSqK/ZWcsm/4U8B77rbcLP6ruDU2Ixk= -cloud.google.com/go/artifactregistry v1.8.0/go.mod h1:w3GQXkJX8hiKN0v+at4b0qotwijQbYUqF2GWkZzAhC0= -cloud.google.com/go/artifactregistry v1.9.0/go.mod h1:2K2RqvA2CYvAeARHRkLDhMDJ3OXy26h3XW+3/Jh2uYc= -cloud.google.com/go/artifactregistry v1.11.1/go.mod h1:lLYghw+Itq9SONbCa1YWBoWs1nOucMH0pwXN1rOBZFI= -cloud.google.com/go/artifactregistry v1.11.2/go.mod h1:nLZns771ZGAwVLzTX/7Al6R9ehma4WUEhZGWV6CeQNQ= -cloud.google.com/go/artifactregistry v1.12.0/go.mod h1:o6P3MIvtzTOnmvGagO9v/rOjjA0HmhJ+/6KAXrmYDCI= -cloud.google.com/go/artifactregistry v1.13.0/go.mod h1:uy/LNfoOIivepGhooAUpL1i30Hgee3Cu0l4VTWHUC08= -cloud.google.com/go/artifactregistry v1.14.1/go.mod h1:nxVdG19jTaSTu7yA7+VbWL346r3rIdkZ142BSQqhn5E= -cloud.google.com/go/asset v1.5.0/go.mod h1:5mfs8UvcM5wHhqtSv8J1CtxxaQq3AdBxxQi2jGW/K4o= -cloud.google.com/go/asset v1.7.0/go.mod h1:YbENsRK4+xTiL+Ofoj5Ckf+O17kJtgp3Y3nn4uzZz5s= -cloud.google.com/go/asset v1.8.0/go.mod h1:mUNGKhiqIdbr8X7KNayoYvyc4HbbFO9URsjbytpUaW0= -cloud.google.com/go/asset v1.9.0/go.mod h1:83MOE6jEJBMqFKadM9NLRcs80Gdw76qGuHn8m3h8oHQ= -cloud.google.com/go/asset v1.10.0/go.mod h1:pLz7uokL80qKhzKr4xXGvBQXnzHn5evJAEAtZiIb0wY= -cloud.google.com/go/asset v1.11.1/go.mod h1:fSwLhbRvC9p9CXQHJ3BgFeQNM4c9x10lqlrdEUYXlJo= -cloud.google.com/go/asset v1.12.0/go.mod h1:h9/sFOa4eDIyKmH6QMpm4eUK3pDojWnUhTgJlk762Hg= -cloud.google.com/go/asset v1.13.0/go.mod h1:WQAMyYek/b7NBpYq/K4KJWcRqzoalEsxz/t/dTk4THw= -cloud.google.com/go/asset v1.14.1/go.mod h1:4bEJ3dnHCqWCDbWJ/6Vn7GVI9LerSi7Rfdi03hd+WTQ= -cloud.google.com/go/assuredworkloads v1.5.0/go.mod h1:n8HOZ6pff6re5KYfBXcFvSViQjDwxFkAkmUFffJRbbY= -cloud.google.com/go/assuredworkloads v1.6.0/go.mod h1:yo2YOk37Yc89Rsd5QMVECvjaMKymF9OP+QXWlKXUkXw= -cloud.google.com/go/assuredworkloads v1.7.0/go.mod h1:z/736/oNmtGAyU47reJgGN+KVoYoxeLBoj4XkKYscNI= -cloud.google.com/go/assuredworkloads v1.8.0/go.mod h1:AsX2cqyNCOvEQC8RMPnoc0yEarXQk6WEKkxYfL6kGIo= -cloud.google.com/go/assuredworkloads v1.9.0/go.mod h1:kFuI1P78bplYtT77Tb1hi0FMxM0vVpRC7VVoJC3ZoT0= -cloud.google.com/go/assuredworkloads v1.10.0/go.mod h1:kwdUQuXcedVdsIaKgKTp9t0UJkE5+PAVNhdQm4ZVq2E= -cloud.google.com/go/assuredworkloads v1.11.1/go.mod h1:+F04I52Pgn5nmPG36CWFtxmav6+7Q+c5QyJoL18Lry0= -cloud.google.com/go/automl v1.5.0/go.mod h1:34EjfoFGMZ5sgJ9EoLsRtdPSNZLcfflJR39VbVNS2M0= -cloud.google.com/go/automl v1.6.0/go.mod h1:ugf8a6Fx+zP0D59WLhqgTDsQI9w07o64uf/Is3Nh5p8= -cloud.google.com/go/automl v1.7.0/go.mod h1:RL9MYCCsJEOmt0Wf3z9uzG0a7adTT1fe+aObgSpkCt8= -cloud.google.com/go/automl v1.8.0/go.mod h1:xWx7G/aPEe/NP+qzYXktoBSDfjO+vnKMGgsApGJJquM= -cloud.google.com/go/automl v1.12.0/go.mod h1:tWDcHDp86aMIuHmyvjuKeeHEGq76lD7ZqfGLN6B0NuU= -cloud.google.com/go/automl v1.13.1/go.mod h1:1aowgAHWYZU27MybSCFiukPO7xnyawv7pt3zK4bheQE= -cloud.google.com/go/baremetalsolution v0.3.0/go.mod h1:XOrocE+pvK1xFfleEnShBlNAXf+j5blPPxrhjKgnIFc= -cloud.google.com/go/baremetalsolution v0.4.0/go.mod h1:BymplhAadOO/eBa7KewQ0Ppg4A4Wplbn+PsFKRLo0uI= -cloud.google.com/go/baremetalsolution v0.5.0/go.mod h1:dXGxEkmR9BMwxhzBhV0AioD0ULBmuLZI8CdwalUxuss= -cloud.google.com/go/baremetalsolution v1.1.1/go.mod h1:D1AV6xwOksJMV4OSlWHtWuFNZZYujJknMAP4Qa27QIA= -cloud.google.com/go/batch v0.3.0/go.mod h1:TR18ZoAekj1GuirsUsR1ZTKN3FC/4UDnScjT8NXImFE= -cloud.google.com/go/batch v0.4.0/go.mod h1:WZkHnP43R/QCGQsZ+0JyG4i79ranE2u8xvjq/9+STPE= -cloud.google.com/go/batch v0.7.0/go.mod h1:vLZN95s6teRUqRQ4s3RLDsH8PvboqBK+rn1oevL159g= -cloud.google.com/go/batch v1.3.1/go.mod h1:VguXeQKXIYaeeIYbuozUmBR13AfL4SJP7IltNPS+A4A= -cloud.google.com/go/beyondcorp v0.2.0/go.mod h1:TB7Bd+EEtcw9PCPQhCJtJGjk/7TC6ckmnSFS+xwTfm4= -cloud.google.com/go/beyondcorp v0.3.0/go.mod h1:E5U5lcrcXMsCuoDNyGrpyTm/hn7ne941Jz2vmksAxW8= -cloud.google.com/go/beyondcorp v0.4.0/go.mod h1:3ApA0mbhHx6YImmuubf5pyW8srKnCEPON32/5hj+RmM= -cloud.google.com/go/beyondcorp v0.5.0/go.mod h1:uFqj9X+dSfrheVp7ssLTaRHd2EHqSL4QZmH4e8WXGGU= -cloud.google.com/go/beyondcorp v0.6.1/go.mod h1:YhxDWw946SCbmcWo3fAhw3V4XZMSpQ/VYfcKGAEU8/4= -cloud.google.com/go/beyondcorp v1.0.0/go.mod h1:YhxDWw946SCbmcWo3fAhw3V4XZMSpQ/VYfcKGAEU8/4= -cloud.google.com/go/bigquery v1.42.0/go.mod h1:8dRTJxhtG+vwBKzE5OseQn/hiydoQN3EedCaOdYmxRA= -cloud.google.com/go/bigquery v1.43.0/go.mod h1:ZMQcXHsl+xmU1z36G2jNGZmKp9zNY5BUua5wDgmNCfw= -cloud.google.com/go/bigquery v1.44.0/go.mod h1:0Y33VqXTEsbamHJvJHdFmtqHvMIY28aK1+dFsvaChGc= -cloud.google.com/go/bigquery v1.47.0/go.mod h1:sA9XOgy0A8vQK9+MWhEQTY6Tix87M/ZurWFIxmF9I/E= -cloud.google.com/go/bigquery v1.48.0/go.mod h1:QAwSz+ipNgfL5jxiaK7weyOhzdoAy1zFm0Nf1fysJac= -cloud.google.com/go/bigquery v1.49.0/go.mod h1:Sv8hMmTFFYBlt/ftw2uN6dFdQPzBlREY9yBh7Oy7/4Q= -cloud.google.com/go/bigquery v1.50.0/go.mod h1:YrleYEh2pSEbgTBZYMJ5SuSr0ML3ypjRB1zgf7pvQLU= -cloud.google.com/go/bigquery v1.52.0/go.mod h1:3b/iXjRQGU4nKa87cXeg6/gogLjO8C6PmuM8i5Bi/u4= -cloud.google.com/go/bigquery v1.53.0/go.mod h1:3b/iXjRQGU4nKa87cXeg6/gogLjO8C6PmuM8i5Bi/u4= -cloud.google.com/go/billing v1.4.0/go.mod h1:g9IdKBEFlItS8bTtlrZdVLWSSdSyFUZKXNS02zKMOZY= -cloud.google.com/go/billing v1.5.0/go.mod h1:mztb1tBc3QekhjSgmpf/CV4LzWXLzCArwpLmP2Gm88s= -cloud.google.com/go/billing v1.6.0/go.mod h1:WoXzguj+BeHXPbKfNWkqVtDdzORazmCjraY+vrxcyvI= -cloud.google.com/go/billing v1.7.0/go.mod h1:q457N3Hbj9lYwwRbnlD7vUpyjq6u5U1RAOArInEiD5Y= -cloud.google.com/go/billing v1.12.0/go.mod h1:yKrZio/eu+okO/2McZEbch17O5CB5NpZhhXG6Z766ss= -cloud.google.com/go/billing v1.13.0/go.mod h1:7kB2W9Xf98hP9Sr12KfECgfGclsH3CQR0R08tnRlRbc= -cloud.google.com/go/billing v1.16.0/go.mod h1:y8vx09JSSJG02k5QxbycNRrN7FGZB6F3CAcgum7jvGA= -cloud.google.com/go/binaryauthorization v1.1.0/go.mod h1:xwnoWu3Y84jbuHa0zd526MJYmtnVXn0syOjaJgy4+dM= -cloud.google.com/go/binaryauthorization v1.2.0/go.mod h1:86WKkJHtRcv5ViNABtYMhhNWRrD1Vpi//uKEy7aYEfI= -cloud.google.com/go/binaryauthorization v1.3.0/go.mod h1:lRZbKgjDIIQvzYQS1p99A7/U1JqvqeZg0wiI5tp6tg0= -cloud.google.com/go/binaryauthorization v1.4.0/go.mod h1:tsSPQrBd77VLplV70GUhBf/Zm3FsKmgSqgm4UmiDItk= -cloud.google.com/go/binaryauthorization v1.5.0/go.mod h1:OSe4OU1nN/VswXKRBmciKpo9LulY41gch5c68htf3/Q= -cloud.google.com/go/binaryauthorization v1.6.1/go.mod h1:TKt4pa8xhowwffiBmbrbcxijJRZED4zrqnwZ1lKH51U= -cloud.google.com/go/certificatemanager v1.3.0/go.mod h1:n6twGDvcUBFu9uBgt4eYvvf3sQ6My8jADcOVwHmzadg= -cloud.google.com/go/certificatemanager v1.4.0/go.mod h1:vowpercVFyqs8ABSmrdV+GiFf2H/ch3KyudYQEMM590= -cloud.google.com/go/certificatemanager v1.6.0/go.mod h1:3Hh64rCKjRAX8dXgRAyOcY5vQ/fE1sh8o+Mdd6KPgY8= -cloud.google.com/go/certificatemanager v1.7.1/go.mod h1:iW8J3nG6SaRYImIa+wXQ0g8IgoofDFRp5UMzaNk1UqI= -cloud.google.com/go/channel v1.8.0/go.mod h1:W5SwCXDJsq/rg3tn3oG0LOxpAo6IMxNa09ngphpSlnk= -cloud.google.com/go/channel v1.9.0/go.mod h1:jcu05W0my9Vx4mt3/rEHpfxc9eKi9XwsdDL8yBMbKUk= -cloud.google.com/go/channel v1.11.0/go.mod h1:IdtI0uWGqhEeatSB62VOoJ8FSUhJ9/+iGkJVqp74CGE= -cloud.google.com/go/channel v1.12.0/go.mod h1:VkxCGKASi4Cq7TbXxlaBezonAYpp1GCnKMY6tnMQnLU= -cloud.google.com/go/channel v1.16.0/go.mod h1:eN/q1PFSl5gyu0dYdmxNXscY/4Fi7ABmeHCJNf/oHmc= -cloud.google.com/go/cloudbuild v1.3.0/go.mod h1:WequR4ULxlqvMsjDEEEFnOG5ZSRSgWOywXYDb1vPE6U= -cloud.google.com/go/cloudbuild v1.4.0/go.mod h1:5Qwa40LHiOXmz3386FrjrYM93rM/hdRr7b53sySrTqA= -cloud.google.com/go/cloudbuild v1.6.0/go.mod h1:UIbc/w9QCbH12xX+ezUsgblrWv+Cv4Tw83GiSMHOn9M= -cloud.google.com/go/cloudbuild v1.7.0/go.mod h1:zb5tWh2XI6lR9zQmsm1VRA+7OCuve5d8S+zJUul8KTg= -cloud.google.com/go/cloudbuild v1.9.0/go.mod h1:qK1d7s4QlO0VwfYn5YuClDGg2hfmLZEb4wQGAbIgL1s= -cloud.google.com/go/cloudbuild v1.10.1/go.mod h1:lyJg7v97SUIPq4RC2sGsz/9tNczhyv2AjML/ci4ulzU= -cloud.google.com/go/cloudbuild v1.13.0/go.mod h1:lyJg7v97SUIPq4RC2sGsz/9tNczhyv2AjML/ci4ulzU= -cloud.google.com/go/clouddms v1.3.0/go.mod h1:oK6XsCDdW4Ib3jCCBugx+gVjevp2TMXFtgxvPSee3OM= -cloud.google.com/go/clouddms v1.4.0/go.mod h1:Eh7sUGCC+aKry14O1NRljhjyrr0NFC0G2cjwX0cByRk= -cloud.google.com/go/clouddms v1.5.0/go.mod h1:QSxQnhikCLUw13iAbffF2CZxAER3xDGNHjsTAkQJcQA= -cloud.google.com/go/clouddms v1.6.1/go.mod h1:Ygo1vL52Ov4TBZQquhz5fiw2CQ58gvu+PlS6PVXCpZI= -cloud.google.com/go/cloudtasks v1.5.0/go.mod h1:fD92REy1x5woxkKEkLdvavGnPJGEn8Uic9nWuLzqCpY= -cloud.google.com/go/cloudtasks v1.6.0/go.mod h1:C6Io+sxuke9/KNRkbQpihnW93SWDU3uXt92nu85HkYI= -cloud.google.com/go/cloudtasks v1.7.0/go.mod h1:ImsfdYWwlWNJbdgPIIGJWC+gemEGTBK/SunNQQNCAb4= -cloud.google.com/go/cloudtasks v1.8.0/go.mod h1:gQXUIwCSOI4yPVK7DgTVFiiP0ZW/eQkydWzwVMdHxrI= -cloud.google.com/go/cloudtasks v1.9.0/go.mod h1:w+EyLsVkLWHcOaqNEyvcKAsWp9p29dL6uL9Nst1cI7Y= -cloud.google.com/go/cloudtasks v1.10.0/go.mod h1:NDSoTLkZ3+vExFEWu2UJV1arUyzVDAiZtdWcsUyNwBs= -cloud.google.com/go/cloudtasks v1.11.1/go.mod h1:a9udmnou9KO2iulGscKR0qBYjreuX8oHwpmFsKspEvM= -cloud.google.com/go/cloudtasks v1.12.1/go.mod h1:a9udmnou9KO2iulGscKR0qBYjreuX8oHwpmFsKspEvM= -cloud.google.com/go/compute v1.10.0/go.mod h1:ER5CLbMxl90o2jtNbGSbtfOpQKR0t15FOtRsugnLrlU= -cloud.google.com/go/compute v1.12.0/go.mod h1:e8yNOBcBONZU1vJKCvCoDw/4JQsA0dpM4x/6PIIOocU= -cloud.google.com/go/compute v1.12.1/go.mod h1:e8yNOBcBONZU1vJKCvCoDw/4JQsA0dpM4x/6PIIOocU= -cloud.google.com/go/compute v1.13.0/go.mod h1:5aPTS0cUNMIc1CE546K+Th6weJUNQErARyZtRXDJ8GE= -cloud.google.com/go/compute v1.14.0/go.mod h1:YfLtxrj9sU4Yxv+sXzZkyPjEyPBZfXHUvjxega5vAdo= -cloud.google.com/go/compute v1.15.1/go.mod h1:bjjoF/NtFUrkD/urWfdHaKuOPDR5nWIs63rR+SXhcpA= -cloud.google.com/go/compute v1.18.0/go.mod h1:1X7yHxec2Ga+Ss6jPyjxRxpu2uu7PLgsOVXvgU0yacs= -cloud.google.com/go/compute v1.19.0/go.mod h1:rikpw2y+UMidAe9tISo04EHNOIf42RLYF/q8Bs93scU= -cloud.google.com/go/compute v1.19.1/go.mod h1:6ylj3a05WF8leseCdIf77NK0g1ey+nj5IKd5/kvShxE= -cloud.google.com/go/compute v1.19.3/go.mod h1:qxvISKp/gYnXkSAD1ppcSOveRAmzxicEv/JlizULFrI= -cloud.google.com/go/compute v1.20.1/go.mod h1:4tCnrn48xsqlwSAiLf1HXMQk8CONslYbdiEZc9FEIbM= -cloud.google.com/go/compute v1.21.0/go.mod h1:4tCnrn48xsqlwSAiLf1HXMQk8CONslYbdiEZc9FEIbM= -cloud.google.com/go/compute v1.23.0/go.mod h1:4tCnrn48xsqlwSAiLf1HXMQk8CONslYbdiEZc9FEIbM= -cloud.google.com/go/compute/metadata v0.1.0/go.mod h1:Z1VN+bulIf6bt4P/C37K4DyZYZEXYonfTBHHFPO/4UU= -cloud.google.com/go/compute/metadata v0.2.0/go.mod h1:zFmK7XCadkQkj6TtorcaGlCW1hT1fIilQDwofLpJ20k= -cloud.google.com/go/compute/metadata v0.2.1/go.mod h1:jgHgmJd2RKBGzXqF5LR2EZMGxBkeanZ9wwa75XHJgOM= -cloud.google.com/go/compute/metadata v0.2.3/go.mod h1:VAV5nSsACxMJvgaAuX6Pk2AawlZn8kiOGuCv6gTkwuA= -cloud.google.com/go/contactcenterinsights v1.3.0/go.mod h1:Eu2oemoePuEFc/xKFPjbTuPSj0fYJcPls9TFlPNnHHY= -cloud.google.com/go/contactcenterinsights v1.4.0/go.mod h1:L2YzkGbPsv+vMQMCADxJoT9YiTTnSEd6fEvCeHTYVck= -cloud.google.com/go/contactcenterinsights v1.6.0/go.mod h1:IIDlT6CLcDoyv79kDv8iWxMSTZhLxSCofVV5W6YFM/w= -cloud.google.com/go/contactcenterinsights v1.9.1/go.mod h1:bsg/R7zGLYMVxFFzfh9ooLTruLRCG9fnzhH9KznHhbM= -cloud.google.com/go/contactcenterinsights v1.10.0/go.mod h1:bsg/R7zGLYMVxFFzfh9ooLTruLRCG9fnzhH9KznHhbM= -cloud.google.com/go/container v1.6.0/go.mod h1:Xazp7GjJSeUYo688S+6J5V+n/t+G5sKBTFkKNudGRxg= -cloud.google.com/go/container v1.7.0/go.mod h1:Dp5AHtmothHGX3DwwIHPgq45Y8KmNsgN3amoYfxVkLo= -cloud.google.com/go/container v1.13.1/go.mod h1:6wgbMPeQRw9rSnKBCAJXnds3Pzj03C4JHamr8asWKy4= -cloud.google.com/go/container v1.14.0/go.mod h1:3AoJMPhHfLDxLvrlVWaK57IXzaPnLaZq63WX59aQBfM= -cloud.google.com/go/container v1.15.0/go.mod h1:ft+9S0WGjAyjDggg5S06DXj+fHJICWg8L7isCQe9pQA= -cloud.google.com/go/container v1.22.1/go.mod h1:lTNExE2R7f+DLbAN+rJiKTisauFCaoDq6NURZ83eVH4= -cloud.google.com/go/container v1.24.0/go.mod h1:lTNExE2R7f+DLbAN+rJiKTisauFCaoDq6NURZ83eVH4= -cloud.google.com/go/containeranalysis v0.5.1/go.mod h1:1D92jd8gRR/c0fGMlymRgxWD3Qw9C1ff6/T7mLgVL8I= -cloud.google.com/go/containeranalysis v0.6.0/go.mod h1:HEJoiEIu+lEXM+k7+qLCci0h33lX3ZqoYFdmPcoO7s4= -cloud.google.com/go/containeranalysis v0.7.0/go.mod h1:9aUL+/vZ55P2CXfuZjS4UjQ9AgXoSw8Ts6lemfmxBxI= -cloud.google.com/go/containeranalysis v0.9.0/go.mod h1:orbOANbwk5Ejoom+s+DUCTTJ7IBdBQJDcSylAx/on9s= -cloud.google.com/go/containeranalysis v0.10.1/go.mod h1:Ya2jiILITMY68ZLPaogjmOMNkwsDrWBSTyBubGXO7j0= -cloud.google.com/go/datacatalog v1.3.0/go.mod h1:g9svFY6tuR+j+hrTw3J2dNcmI0dzmSiyOzm8kpLq0a0= -cloud.google.com/go/datacatalog v1.5.0/go.mod h1:M7GPLNQeLfWqeIm3iuiruhPzkt65+Bx8dAKvScX8jvs= -cloud.google.com/go/datacatalog v1.6.0/go.mod h1:+aEyF8JKg+uXcIdAmmaMUmZ3q1b/lKLtXCmXdnc0lbc= -cloud.google.com/go/datacatalog v1.7.0/go.mod h1:9mEl4AuDYWw81UGc41HonIHH7/sn52H0/tc8f8ZbZIE= -cloud.google.com/go/datacatalog v1.8.0/go.mod h1:KYuoVOv9BM8EYz/4eMFxrr4DUKhGIOXxZoKYF5wdISM= -cloud.google.com/go/datacatalog v1.8.1/go.mod h1:RJ58z4rMp3gvETA465Vg+ag8BGgBdnRPEMMSTr5Uv+M= -cloud.google.com/go/datacatalog v1.12.0/go.mod h1:CWae8rFkfp6LzLumKOnmVh4+Zle4A3NXLzVJ1d1mRm0= -cloud.google.com/go/datacatalog v1.13.0/go.mod h1:E4Rj9a5ZtAxcQJlEBTLgMTphfP11/lNaAshpoBgemX8= -cloud.google.com/go/datacatalog v1.14.0/go.mod h1:h0PrGtlihoutNMp/uvwhawLQ9+c63Kz65UFqh49Yo+E= -cloud.google.com/go/datacatalog v1.14.1/go.mod h1:d2CevwTG4yedZilwe+v3E3ZBDRMobQfSG/a6cCCN5R4= -cloud.google.com/go/datacatalog v1.16.0/go.mod h1:d2CevwTG4yedZilwe+v3E3ZBDRMobQfSG/a6cCCN5R4= -cloud.google.com/go/dataflow v0.6.0/go.mod h1:9QwV89cGoxjjSR9/r7eFDqqjtvbKxAK2BaYU6PVk9UM= -cloud.google.com/go/dataflow v0.7.0/go.mod h1:PX526vb4ijFMesO1o202EaUmouZKBpjHsTlCtB4parQ= -cloud.google.com/go/dataflow v0.8.0/go.mod h1:Rcf5YgTKPtQyYz8bLYhFoIV/vP39eL7fWNcSOyFfLJE= -cloud.google.com/go/dataflow v0.9.1/go.mod h1:Wp7s32QjYuQDWqJPFFlnBKhkAtiFpMTdg00qGbnIHVw= -cloud.google.com/go/dataform v0.3.0/go.mod h1:cj8uNliRlHpa6L3yVhDOBrUXH+BPAO1+KFMQQNSThKo= -cloud.google.com/go/dataform v0.4.0/go.mod h1:fwV6Y4Ty2yIFL89huYlEkwUPtS7YZinZbzzj5S9FzCE= -cloud.google.com/go/dataform v0.5.0/go.mod h1:GFUYRe8IBa2hcomWplodVmUx/iTL0FrsauObOM3Ipr0= -cloud.google.com/go/dataform v0.6.0/go.mod h1:QPflImQy33e29VuapFdf19oPbE4aYTJxr31OAPV+ulA= -cloud.google.com/go/dataform v0.7.0/go.mod h1:7NulqnVozfHvWUBpMDfKMUESr+85aJsC/2O0o3jWPDE= -cloud.google.com/go/dataform v0.8.1/go.mod h1:3BhPSiw8xmppbgzeBbmDvmSWlwouuJkXsXsb8UBih9M= -cloud.google.com/go/datafusion v1.4.0/go.mod h1:1Zb6VN+W6ALo85cXnM1IKiPw+yQMKMhB9TsTSRDo/38= -cloud.google.com/go/datafusion v1.5.0/go.mod h1:Kz+l1FGHB0J+4XF2fud96WMmRiq/wj8N9u007vyXZ2w= -cloud.google.com/go/datafusion v1.6.0/go.mod h1:WBsMF8F1RhSXvVM8rCV3AeyWVxcC2xY6vith3iw3S+8= -cloud.google.com/go/datafusion v1.7.1/go.mod h1:KpoTBbFmoToDExJUso/fcCiguGDk7MEzOWXUsJo0wsI= -cloud.google.com/go/datalabeling v0.5.0/go.mod h1:TGcJ0G2NzcsXSE/97yWjIZO0bXj0KbVlINXMG9ud42I= -cloud.google.com/go/datalabeling v0.6.0/go.mod h1:WqdISuk/+WIGeMkpw/1q7bK/tFEZxsrFJOJdY2bXvTQ= -cloud.google.com/go/datalabeling v0.7.0/go.mod h1:WPQb1y08RJbmpM3ww0CSUAGweL0SxByuW2E+FU+wXcM= -cloud.google.com/go/datalabeling v0.8.1/go.mod h1:XS62LBSVPbYR54GfYQsPXZjTW8UxCK2fkDciSrpRFdY= -cloud.google.com/go/dataplex v1.3.0/go.mod h1:hQuRtDg+fCiFgC8j0zV222HvzFQdRd+SVX8gdmFcZzA= -cloud.google.com/go/dataplex v1.4.0/go.mod h1:X51GfLXEMVJ6UN47ESVqvlsRplbLhcsAt0kZCCKsU0A= -cloud.google.com/go/dataplex v1.5.2/go.mod h1:cVMgQHsmfRoI5KFYq4JtIBEUbYwc3c7tXmIDhRmNNVQ= -cloud.google.com/go/dataplex v1.6.0/go.mod h1:bMsomC/aEJOSpHXdFKFGQ1b0TDPIeL28nJObeO1ppRs= -cloud.google.com/go/dataplex v1.8.1/go.mod h1:7TyrDT6BCdI8/38Uvp0/ZxBslOslP2X2MPDucliyvSE= -cloud.google.com/go/dataplex v1.9.0/go.mod h1:7TyrDT6BCdI8/38Uvp0/ZxBslOslP2X2MPDucliyvSE= -cloud.google.com/go/dataproc v1.7.0/go.mod h1:CKAlMjII9H90RXaMpSxQ8EU6dQx6iAYNPcYPOkSbi8s= -cloud.google.com/go/dataproc v1.8.0/go.mod h1:5OW+zNAH0pMpw14JVrPONsxMQYMBqJuzORhIBfBn9uI= -cloud.google.com/go/dataproc v1.12.0/go.mod h1:zrF3aX0uV3ikkMz6z4uBbIKyhRITnxvr4i3IjKsKrw4= -cloud.google.com/go/dataproc/v2 v2.0.1/go.mod h1:7Ez3KRHdFGcfY7GcevBbvozX+zyWGcwLJvvAMwCaoZ4= -cloud.google.com/go/dataqna v0.5.0/go.mod h1:90Hyk596ft3zUQ8NkFfvICSIfHFh1Bc7C4cK3vbhkeo= -cloud.google.com/go/dataqna v0.6.0/go.mod h1:1lqNpM7rqNLVgWBJyk5NF6Uen2PHym0jtVJonplVsDA= -cloud.google.com/go/dataqna v0.7.0/go.mod h1:Lx9OcIIeqCrw1a6KdO3/5KMP1wAmTc0slZWwP12Qq3c= -cloud.google.com/go/dataqna v0.8.1/go.mod h1:zxZM0Bl6liMePWsHA8RMGAfmTG34vJMapbHAxQ5+WA8= -cloud.google.com/go/datastore v1.10.0/go.mod h1:PC5UzAmDEkAmkfaknstTYbNpgE49HAgW2J1gcgUfmdM= -cloud.google.com/go/datastore v1.11.0/go.mod h1:TvGxBIHCS50u8jzG+AW/ppf87v1of8nwzFNgEZU1D3c= -cloud.google.com/go/datastore v1.12.0/go.mod h1:KjdB88W897MRITkvWWJrg2OUtrR5XVj1EoLgSp6/N70= -cloud.google.com/go/datastore v1.12.1/go.mod h1:KjdB88W897MRITkvWWJrg2OUtrR5XVj1EoLgSp6/N70= -cloud.google.com/go/datastore v1.13.0/go.mod h1:KjdB88W897MRITkvWWJrg2OUtrR5XVj1EoLgSp6/N70= -cloud.google.com/go/datastream v1.2.0/go.mod h1:i/uTP8/fZwgATHS/XFu0TcNUhuA0twZxxQ3EyCUQMwo= -cloud.google.com/go/datastream v1.3.0/go.mod h1:cqlOX8xlyYF/uxhiKn6Hbv6WjwPPuI9W2M9SAXwaLLQ= -cloud.google.com/go/datastream v1.4.0/go.mod h1:h9dpzScPhDTs5noEMQVWP8Wx8AFBRyS0s8KWPx/9r0g= -cloud.google.com/go/datastream v1.5.0/go.mod h1:6TZMMNPwjUqZHBKPQ1wwXpb0d5VDVPl2/XoS5yi88q4= -cloud.google.com/go/datastream v1.6.0/go.mod h1:6LQSuswqLa7S4rPAOZFVjHIG3wJIjZcZrw8JDEDJuIs= -cloud.google.com/go/datastream v1.7.0/go.mod h1:uxVRMm2elUSPuh65IbZpzJNMbuzkcvu5CjMqVIUHrww= -cloud.google.com/go/datastream v1.9.1/go.mod h1:hqnmr8kdUBmrnk65k5wNRoHSCYksvpdZIcZIEl8h43Q= -cloud.google.com/go/datastream v1.10.0/go.mod h1:hqnmr8kdUBmrnk65k5wNRoHSCYksvpdZIcZIEl8h43Q= -cloud.google.com/go/deploy v1.4.0/go.mod h1:5Xghikd4VrmMLNaF6FiRFDlHb59VM59YoDQnOUdsH/c= -cloud.google.com/go/deploy v1.5.0/go.mod h1:ffgdD0B89tToyW/U/D2eL0jN2+IEV/3EMuXHA0l4r+s= -cloud.google.com/go/deploy v1.6.0/go.mod h1:f9PTHehG/DjCom3QH0cntOVRm93uGBDt2vKzAPwpXQI= -cloud.google.com/go/deploy v1.8.0/go.mod h1:z3myEJnA/2wnB4sgjqdMfgxCA0EqC3RBTNcVPs93mtQ= -cloud.google.com/go/deploy v1.11.0/go.mod h1:tKuSUV5pXbn67KiubiUNUejqLs4f5cxxiCNCeyl0F2g= -cloud.google.com/go/deploy v1.13.0/go.mod h1:tKuSUV5pXbn67KiubiUNUejqLs4f5cxxiCNCeyl0F2g= -cloud.google.com/go/dialogflow v1.15.0/go.mod h1:HbHDWs33WOGJgn6rfzBW1Kv807BE3O1+xGbn59zZWI4= -cloud.google.com/go/dialogflow v1.16.1/go.mod h1:po6LlzGfK+smoSmTBnbkIZY2w8ffjz/RcGSS+sh1el0= -cloud.google.com/go/dialogflow v1.17.0/go.mod h1:YNP09C/kXA1aZdBgC/VtXX74G/TKn7XVCcVumTflA+8= -cloud.google.com/go/dialogflow v1.18.0/go.mod h1:trO7Zu5YdyEuR+BhSNOqJezyFQ3aUzz0njv7sMx/iek= -cloud.google.com/go/dialogflow v1.19.0/go.mod h1:JVmlG1TwykZDtxtTXujec4tQ+D8SBFMoosgy+6Gn0s0= -cloud.google.com/go/dialogflow v1.29.0/go.mod h1:b+2bzMe+k1s9V+F2jbJwpHPzrnIyHihAdRFMtn2WXuM= -cloud.google.com/go/dialogflow v1.31.0/go.mod h1:cuoUccuL1Z+HADhyIA7dci3N5zUssgpBJmCzI6fNRB4= -cloud.google.com/go/dialogflow v1.32.0/go.mod h1:jG9TRJl8CKrDhMEcvfcfFkkpp8ZhgPz3sBGmAUYJ2qE= -cloud.google.com/go/dialogflow v1.38.0/go.mod h1:L7jnH+JL2mtmdChzAIcXQHXMvQkE3U4hTaNltEuxXn4= -cloud.google.com/go/dialogflow v1.40.0/go.mod h1:L7jnH+JL2mtmdChzAIcXQHXMvQkE3U4hTaNltEuxXn4= -cloud.google.com/go/dlp v1.6.0/go.mod h1:9eyB2xIhpU0sVwUixfBubDoRwP+GjeUoxxeueZmqvmM= -cloud.google.com/go/dlp v1.7.0/go.mod h1:68ak9vCiMBjbasxeVD17hVPxDEck+ExiHavX8kiHG+Q= -cloud.google.com/go/dlp v1.9.0/go.mod h1:qdgmqgTyReTz5/YNSSuueR8pl7hO0o9bQ39ZhtgkWp4= -cloud.google.com/go/dlp v1.10.1/go.mod h1:IM8BWz1iJd8njcNcG0+Kyd9OPnqnRNkDV8j42VT5KOI= -cloud.google.com/go/documentai v1.7.0/go.mod h1:lJvftZB5NRiFSX4moiye1SMxHx0Bc3x1+p9e/RfXYiU= -cloud.google.com/go/documentai v1.8.0/go.mod h1:xGHNEB7CtsnySCNrCFdCyyMz44RhFEEX2Q7UD0c5IhU= -cloud.google.com/go/documentai v1.9.0/go.mod h1:FS5485S8R00U10GhgBC0aNGrJxBP8ZVpEeJ7PQDZd6k= -cloud.google.com/go/documentai v1.10.0/go.mod h1:vod47hKQIPeCfN2QS/jULIvQTugbmdc0ZvxxfQY1bg4= -cloud.google.com/go/documentai v1.16.0/go.mod h1:o0o0DLTEZ+YnJZ+J4wNfTxmDVyrkzFvttBXXtYRMHkM= -cloud.google.com/go/documentai v1.18.0/go.mod h1:F6CK6iUH8J81FehpskRmhLq/3VlwQvb7TvwOceQ2tbs= -cloud.google.com/go/documentai v1.20.0/go.mod h1:yJkInoMcK0qNAEdRnqY/D5asy73tnPe88I1YTZT+a8E= -cloud.google.com/go/documentai v1.22.0/go.mod h1:yJkInoMcK0qNAEdRnqY/D5asy73tnPe88I1YTZT+a8E= -cloud.google.com/go/domains v0.6.0/go.mod h1:T9Rz3GasrpYk6mEGHh4rymIhjlnIuB4ofT1wTxDeT4Y= -cloud.google.com/go/domains v0.7.0/go.mod h1:PtZeqS1xjnXuRPKE/88Iru/LdfoRyEHYA9nFQf4UKpg= -cloud.google.com/go/domains v0.8.0/go.mod h1:M9i3MMDzGFXsydri9/vW+EWz9sWb4I6WyHqdlAk0idE= -cloud.google.com/go/domains v0.9.1/go.mod h1:aOp1c0MbejQQ2Pjf1iJvnVyT+z6R6s8pX66KaCSDYfE= -cloud.google.com/go/edgecontainer v0.1.0/go.mod h1:WgkZ9tp10bFxqO8BLPqv2LlfmQF1X8lZqwW4r1BTajk= -cloud.google.com/go/edgecontainer v0.2.0/go.mod h1:RTmLijy+lGpQ7BXuTDa4C4ssxyXT34NIuHIgKuP4s5w= -cloud.google.com/go/edgecontainer v0.3.0/go.mod h1:FLDpP4nykgwwIfcLt6zInhprzw0lEi2P1fjO6Ie0qbc= -cloud.google.com/go/edgecontainer v1.0.0/go.mod h1:cttArqZpBB2q58W/upSG++ooo6EsblxDIolxa3jSjbY= -cloud.google.com/go/edgecontainer v1.1.1/go.mod h1:O5bYcS//7MELQZs3+7mabRqoWQhXCzenBu0R8bz2rwk= -cloud.google.com/go/errorreporting v0.3.0/go.mod h1:xsP2yaAp+OAW4OIm60An2bbLpqIhKXdWR/tawvl7QzU= -cloud.google.com/go/essentialcontacts v1.3.0/go.mod h1:r+OnHa5jfj90qIfZDO/VztSFqbQan7HV75p8sA+mdGI= -cloud.google.com/go/essentialcontacts v1.4.0/go.mod h1:8tRldvHYsmnBCHdFpvU+GL75oWiBKl80BiqlFh9tp+8= -cloud.google.com/go/essentialcontacts v1.5.0/go.mod h1:ay29Z4zODTuwliK7SnX8E86aUF2CTzdNtvv42niCX0M= -cloud.google.com/go/essentialcontacts v1.6.2/go.mod h1:T2tB6tX+TRak7i88Fb2N9Ok3PvY3UNbUsMag9/BARh4= -cloud.google.com/go/eventarc v1.7.0/go.mod h1:6ctpF3zTnaQCxUjHUdcfgcA1A2T309+omHZth7gDfmc= -cloud.google.com/go/eventarc v1.8.0/go.mod h1:imbzxkyAU4ubfsaKYdQg04WS1NvncblHEup4kvF+4gw= -cloud.google.com/go/eventarc v1.10.0/go.mod h1:u3R35tmZ9HvswGRBnF48IlYgYeBcPUCjkr4BTdem2Kw= -cloud.google.com/go/eventarc v1.11.0/go.mod h1:PyUjsUKPWoRBCHeOxZd/lbOOjahV41icXyUY5kSTvVY= -cloud.google.com/go/eventarc v1.12.1/go.mod h1:mAFCW6lukH5+IZjkvrEss+jmt2kOdYlN8aMx3sRJiAI= -cloud.google.com/go/eventarc v1.13.0/go.mod h1:mAFCW6lukH5+IZjkvrEss+jmt2kOdYlN8aMx3sRJiAI= -cloud.google.com/go/filestore v1.3.0/go.mod h1:+qbvHGvXU1HaKX2nD0WEPo92TP/8AQuCVEBXNY9z0+w= -cloud.google.com/go/filestore v1.4.0/go.mod h1:PaG5oDfo9r224f8OYXURtAsY+Fbyq/bLYoINEK8XQAI= -cloud.google.com/go/filestore v1.5.0/go.mod h1:FqBXDWBp4YLHqRnVGveOkHDf8svj9r5+mUDLupOWEDs= -cloud.google.com/go/filestore v1.6.0/go.mod h1:di5unNuss/qfZTw2U9nhFqo8/ZDSc466dre85Kydllg= -cloud.google.com/go/filestore v1.7.1/go.mod h1:y10jsorq40JJnjR/lQ8AfFbbcGlw3g+Dp8oN7i7FjV4= -cloud.google.com/go/firestore v1.9.0/go.mod h1:HMkjKHNTtRyZNiMzu7YAsLr9K3X2udY2AMwDaMEQiiE= -cloud.google.com/go/firestore v1.11.0/go.mod h1:b38dKhgzlmNNGTNZZwe7ZRFEuRab1Hay3/DBsIGKKy4= -cloud.google.com/go/functions v1.6.0/go.mod h1:3H1UA3qiIPRWD7PeZKLvHZ9SaQhR26XIJcC0A5GbvAk= -cloud.google.com/go/functions v1.7.0/go.mod h1:+d+QBcWM+RsrgZfV9xo6KfA1GlzJfxcfZcRPEhDDfzg= -cloud.google.com/go/functions v1.8.0/go.mod h1:RTZ4/HsQjIqIYP9a9YPbU+QFoQsAlYgrwOXJWHn1POY= -cloud.google.com/go/functions v1.9.0/go.mod h1:Y+Dz8yGguzO3PpIjhLTbnqV1CWmgQ5UwtlpzoyquQ08= -cloud.google.com/go/functions v1.10.0/go.mod h1:0D3hEOe3DbEvCXtYOZHQZmD+SzYsi1YbI7dGvHfldXw= -cloud.google.com/go/functions v1.12.0/go.mod h1:AXWGrF3e2C/5ehvwYo/GH6O5s09tOPksiKhz+hH8WkA= -cloud.google.com/go/functions v1.13.0/go.mod h1:EU4O007sQm6Ef/PwRsI8N2umygGqPBS/IZQKBQBcJ3c= -cloud.google.com/go/functions v1.15.1/go.mod h1:P5yNWUTkyU+LvW/S9O6V+V423VZooALQlqoXdoPz5AE= -cloud.google.com/go/gaming v1.5.0/go.mod h1:ol7rGcxP/qHTRQE/RO4bxkXq+Fix0j6D4LFPzYTIrDM= -cloud.google.com/go/gaming v1.6.0/go.mod h1:YMU1GEvA39Qt3zWGyAVA9bpYz/yAhTvaQ1t2sK4KPUA= -cloud.google.com/go/gaming v1.7.0/go.mod h1:LrB8U7MHdGgFG851iHAfqUdLcKBdQ55hzXy9xBJz0+w= -cloud.google.com/go/gaming v1.8.0/go.mod h1:xAqjS8b7jAVW0KFYeRUxngo9My3f33kFmua++Pi+ggM= -cloud.google.com/go/gaming v1.9.0/go.mod h1:Fc7kEmCObylSWLO334NcO+O9QMDyz+TKC4v1D7X+Bc0= -cloud.google.com/go/gaming v1.10.1/go.mod h1:XQQvtfP8Rb9Rxnxm5wFVpAp9zCQkJi2bLIb7iHGwB3s= -cloud.google.com/go/gkebackup v0.2.0/go.mod h1:XKvv/4LfG829/B8B7xRkk8zRrOEbKtEam6yNfuQNH60= -cloud.google.com/go/gkebackup v0.3.0/go.mod h1:n/E671i1aOQvUxT541aTkCwExO/bTer2HDlj4TsBRAo= -cloud.google.com/go/gkebackup v0.4.0/go.mod h1:byAyBGUwYGEEww7xsbnUTBHIYcOPy/PgUWUtOeRm9Vg= -cloud.google.com/go/gkebackup v1.3.0/go.mod h1:vUDOu++N0U5qs4IhG1pcOnD1Mac79xWy6GoBFlWCWBU= -cloud.google.com/go/gkeconnect v0.5.0/go.mod h1:c5lsNAg5EwAy7fkqX/+goqFsU1Da/jQFqArp+wGNr/o= -cloud.google.com/go/gkeconnect v0.6.0/go.mod h1:Mln67KyU/sHJEBY8kFZ0xTeyPtzbq9StAVvEULYK16A= -cloud.google.com/go/gkeconnect v0.7.0/go.mod h1:SNfmVqPkaEi3bF/B3CNZOAYPYdg7sU+obZ+QTky2Myw= -cloud.google.com/go/gkeconnect v0.8.1/go.mod h1:KWiK1g9sDLZqhxB2xEuPV8V9NYzrqTUmQR9shJHpOZw= -cloud.google.com/go/gkehub v0.9.0/go.mod h1:WYHN6WG8w9bXU0hqNxt8rm5uxnk8IH+lPY9J2TV7BK0= -cloud.google.com/go/gkehub v0.10.0/go.mod h1:UIPwxI0DsrpsVoWpLB0stwKCP+WFVG9+y977wO+hBH0= -cloud.google.com/go/gkehub v0.11.0/go.mod h1:JOWHlmN+GHyIbuWQPl47/C2RFhnFKH38jH9Ascu3n0E= -cloud.google.com/go/gkehub v0.12.0/go.mod h1:djiIwwzTTBrF5NaXCGv3mf7klpEMcST17VBTVVDcuaw= -cloud.google.com/go/gkehub v0.14.1/go.mod h1:VEXKIJZ2avzrbd7u+zeMtW00Y8ddk/4V9511C9CQGTY= -cloud.google.com/go/gkemulticloud v0.3.0/go.mod h1:7orzy7O0S+5kq95e4Hpn7RysVA7dPs8W/GgfUtsPbrA= -cloud.google.com/go/gkemulticloud v0.4.0/go.mod h1:E9gxVBnseLWCk24ch+P9+B2CoDFJZTyIgLKSalC7tuI= -cloud.google.com/go/gkemulticloud v0.5.0/go.mod h1:W0JDkiyi3Tqh0TJr//y19wyb1yf8llHVto2Htf2Ja3Y= -cloud.google.com/go/gkemulticloud v0.6.1/go.mod h1:kbZ3HKyTsiwqKX7Yw56+wUGwwNZViRnxWK2DVknXWfw= -cloud.google.com/go/gkemulticloud v1.0.0/go.mod h1:kbZ3HKyTsiwqKX7Yw56+wUGwwNZViRnxWK2DVknXWfw= -cloud.google.com/go/grafeas v0.2.0/go.mod h1:KhxgtF2hb0P191HlY5besjYm6MqTSTj3LSI+M+ByZHc= -cloud.google.com/go/grafeas v0.3.0/go.mod h1:P7hgN24EyONOTMyeJH6DxG4zD7fwiYa5Q6GUgyFSOU8= -cloud.google.com/go/gsuiteaddons v1.3.0/go.mod h1:EUNK/J1lZEZO8yPtykKxLXI6JSVN2rg9bN8SXOa0bgM= -cloud.google.com/go/gsuiteaddons v1.4.0/go.mod h1:rZK5I8hht7u7HxFQcFei0+AtfS9uSushomRlg+3ua1o= -cloud.google.com/go/gsuiteaddons v1.5.0/go.mod h1:TFCClYLd64Eaa12sFVmUyG62tk4mdIsI7pAnSXRkcFo= -cloud.google.com/go/gsuiteaddons v1.6.1/go.mod h1:CodrdOqRZcLp5WOwejHWYBjZvfY0kOphkAKpF/3qdZY= -cloud.google.com/go/iam v0.1.0/go.mod h1:vcUNEa0pEm0qRVpmWepWaFMIAI8/hjB9mO8rNCJtF6c= -cloud.google.com/go/iam v0.5.0/go.mod h1:wPU9Vt0P4UmCux7mqtRu6jcpPAb74cP1fh50J3QpkUc= -cloud.google.com/go/iam v0.6.0/go.mod h1:+1AH33ueBne5MzYccyMHtEKqLE4/kJOibtffMHDMFMc= -cloud.google.com/go/iam v0.7.0/go.mod h1:H5Br8wRaDGNc8XP3keLc4unfUUZeyH3Sfl9XpQEYOeg= -cloud.google.com/go/iam v0.8.0/go.mod h1:lga0/y3iH6CX7sYqypWJ33hf7kkfXJag67naqGESjkE= -cloud.google.com/go/iam v0.11.0/go.mod h1:9PiLDanza5D+oWFZiH1uG+RnRCfEGKoyl6yo4cgWZGY= -cloud.google.com/go/iam v0.12.0/go.mod h1:knyHGviacl11zrtZUoDuYpDgLjvr28sLQaG0YB2GYAY= -cloud.google.com/go/iam v0.13.0/go.mod h1:ljOg+rcNfzZ5d6f1nAUJ8ZIxOaZUVoS14bKCtaLZ/D0= -cloud.google.com/go/iam v1.0.1/go.mod h1:yR3tmSL8BcZB4bxByRv2jkSIahVmCtfKZwLYGBalRE8= -cloud.google.com/go/iam v1.1.0/go.mod h1:nxdHjaKfCr7fNYx/HJMM8LgiMugmveWlkatear5gVyk= -cloud.google.com/go/iam v1.1.1/go.mod h1:A5avdyVL2tCppe4unb0951eI9jreack+RJ0/d+KUZOU= -cloud.google.com/go/iap v1.4.0/go.mod h1:RGFwRJdihTINIe4wZ2iCP0zF/qu18ZwyKxrhMhygBEc= -cloud.google.com/go/iap v1.5.0/go.mod h1:UH/CGgKd4KyohZL5Pt0jSKE4m3FR51qg6FKQ/z/Ix9A= -cloud.google.com/go/iap v1.6.0/go.mod h1:NSuvI9C/j7UdjGjIde7t7HBz+QTwBcapPE07+sSRcLk= -cloud.google.com/go/iap v1.7.0/go.mod h1:beqQx56T9O1G1yNPph+spKpNibDlYIiIixiqsQXxLIo= -cloud.google.com/go/iap v1.7.1/go.mod h1:WapEwPc7ZxGt2jFGB/C/bm+hP0Y6NXzOYGjpPnmMS74= -cloud.google.com/go/iap v1.8.1/go.mod h1:sJCbeqg3mvWLqjZNsI6dfAtbbV1DL2Rl7e1mTyXYREQ= -cloud.google.com/go/ids v1.1.0/go.mod h1:WIuwCaYVOzHIj2OhN9HAwvW+DBdmUAdcWlFxRl+KubM= -cloud.google.com/go/ids v1.2.0/go.mod h1:5WXvp4n25S0rA/mQWAg1YEEBBq6/s+7ml1RDCW1IrcY= -cloud.google.com/go/ids v1.3.0/go.mod h1:JBdTYwANikFKaDP6LtW5JAi4gubs57SVNQjemdt6xV4= -cloud.google.com/go/ids v1.4.1/go.mod h1:np41ed8YMU8zOgv53MMMoCntLTn2lF+SUzlM+O3u/jw= -cloud.google.com/go/iot v1.3.0/go.mod h1:r7RGh2B61+B8oz0AGE+J72AhA0G7tdXItODWsaA2oLs= -cloud.google.com/go/iot v1.4.0/go.mod h1:dIDxPOn0UvNDUMD8Ger7FIaTuvMkj+aGk94RPP0iV+g= -cloud.google.com/go/iot v1.5.0/go.mod h1:mpz5259PDl3XJthEmh9+ap0affn/MqNSP4My77Qql9o= -cloud.google.com/go/iot v1.6.0/go.mod h1:IqdAsmE2cTYYNO1Fvjfzo9po179rAtJeVGUvkLN3rLE= -cloud.google.com/go/iot v1.7.1/go.mod h1:46Mgw7ev1k9KqK1ao0ayW9h0lI+3hxeanz+L1zmbbbk= -cloud.google.com/go/kms v1.4.0/go.mod h1:fajBHndQ+6ubNw6Ss2sSd+SWvjL26RNo/dr7uxsnnOA= -cloud.google.com/go/kms v1.5.0/go.mod h1:QJS2YY0eJGBg3mnDfuaCyLauWwBJiHRboYxJ++1xJNg= -cloud.google.com/go/kms v1.6.0/go.mod h1:Jjy850yySiasBUDi6KFUwUv2n1+o7QZFyuUJg6OgjA0= -cloud.google.com/go/kms v1.8.0/go.mod h1:4xFEhYFqvW+4VMELtZyxomGSYtSQKzM178ylFW4jMAg= -cloud.google.com/go/kms v1.9.0/go.mod h1:qb1tPTgfF9RQP8e1wq4cLFErVuTJv7UsSC915J8dh3w= -cloud.google.com/go/kms v1.10.0/go.mod h1:ng3KTUtQQU9bPX3+QGLsflZIHlkbn8amFAMY63m8d24= -cloud.google.com/go/kms v1.10.1/go.mod h1:rIWk/TryCkR59GMC3YtHtXeLzd634lBbKenvyySAyYI= -cloud.google.com/go/kms v1.11.0/go.mod h1:hwdiYC0xjnWsKQQCQQmIQnS9asjYVSK6jtXm+zFqXLM= -cloud.google.com/go/kms v1.12.1/go.mod h1:c9J991h5DTl+kg7gi3MYomh12YEENGrf48ee/N/2CDM= -cloud.google.com/go/kms v1.15.0/go.mod h1:c9J991h5DTl+kg7gi3MYomh12YEENGrf48ee/N/2CDM= -cloud.google.com/go/language v1.4.0/go.mod h1:F9dRpNFQmJbkaop6g0JhSBXCNlO90e1KWx5iDdxbWic= -cloud.google.com/go/language v1.6.0/go.mod h1:6dJ8t3B+lUYfStgls25GusK04NLh3eDLQnWM3mdEbhI= -cloud.google.com/go/language v1.7.0/go.mod h1:DJ6dYN/W+SQOjF8e1hLQXMF21AkH2w9wiPzPCJa2MIE= -cloud.google.com/go/language v1.8.0/go.mod h1:qYPVHf7SPoNNiCL2Dr0FfEFNil1qi3pQEyygwpgVKB8= -cloud.google.com/go/language v1.9.0/go.mod h1:Ns15WooPM5Ad/5no/0n81yUetis74g3zrbeJBE+ptUY= -cloud.google.com/go/language v1.10.1/go.mod h1:CPp94nsdVNiQEt1CNjF5WkTcisLiHPyIbMhvR8H2AW0= -cloud.google.com/go/lifesciences v0.5.0/go.mod h1:3oIKy8ycWGPUyZDR/8RNnTOYevhaMLqh5vLUXs9zvT8= -cloud.google.com/go/lifesciences v0.6.0/go.mod h1:ddj6tSX/7BOnhxCSd3ZcETvtNr8NZ6t/iPhY2Tyfu08= -cloud.google.com/go/lifesciences v0.8.0/go.mod h1:lFxiEOMqII6XggGbOnKiyZ7IBwoIqA84ClvoezaA/bo= -cloud.google.com/go/lifesciences v0.9.1/go.mod h1:hACAOd1fFbCGLr/+weUKRAJas82Y4vrL3O5326N//Wc= -cloud.google.com/go/logging v1.6.1/go.mod h1:5ZO0mHHbvm8gEmeEUHrmDlTDSu5imF6MUP9OfilNXBw= -cloud.google.com/go/logging v1.7.0/go.mod h1:3xjP2CjkM3ZkO73aj4ASA5wRPGGCRrPIAeNqVNkzY8M= -cloud.google.com/go/longrunning v0.1.1/go.mod h1:UUFxuDWkv22EuY93jjmDMFT5GPQKeFVJBIF6QlTqdsE= -cloud.google.com/go/longrunning v0.3.0/go.mod h1:qth9Y41RRSUE69rDcOn6DdK3HfQfsUI0YSmW3iIlLJc= -cloud.google.com/go/longrunning v0.4.1/go.mod h1:4iWDqhBZ70CvZ6BfETbvam3T8FMvLK+eFj0E6AaRQTo= -cloud.google.com/go/longrunning v0.4.2/go.mod h1:OHrnaYyLUV6oqwh0xiS7e5sLQhP1m0QU9R+WhGDMgIQ= -cloud.google.com/go/longrunning v0.5.0/go.mod h1:0JNuqRShmscVAhIACGtskSAWtqtOoPkwP0YF1oVEchc= -cloud.google.com/go/longrunning v0.5.1/go.mod h1:spvimkwdz6SPWKEt/XBij79E9fiTkHSQl/fRUUQJYJc= -cloud.google.com/go/managedidentities v1.3.0/go.mod h1:UzlW3cBOiPrzucO5qWkNkh0w33KFtBJU281hacNvsdE= -cloud.google.com/go/managedidentities v1.4.0/go.mod h1:NWSBYbEMgqmbZsLIyKvxrYbtqOsxY1ZrGM+9RgDqInM= -cloud.google.com/go/managedidentities v1.5.0/go.mod h1:+dWcZ0JlUmpuxpIDfyP5pP5y0bLdRwOS4Lp7gMni/LA= -cloud.google.com/go/managedidentities v1.6.1/go.mod h1:h/irGhTN2SkZ64F43tfGPMbHnypMbu4RB3yl8YcuEak= -cloud.google.com/go/maps v0.1.0/go.mod h1:BQM97WGyfw9FWEmQMpZ5T6cpovXXSd1cGmFma94eubI= -cloud.google.com/go/maps v0.6.0/go.mod h1:o6DAMMfb+aINHz/p/jbcY+mYeXBoZoxTfdSQ8VAJaCw= -cloud.google.com/go/maps v0.7.0/go.mod h1:3GnvVl3cqeSvgMcpRlQidXsPYuDGQ8naBis7MVzpXsY= -cloud.google.com/go/maps v1.4.0/go.mod h1:6mWTUv+WhnOwAgjVsSW2QPPECmW+s3PcRyOa9vgG/5s= -cloud.google.com/go/mediatranslation v0.5.0/go.mod h1:jGPUhGTybqsPQn91pNXw0xVHfuJ3leR1wj37oU3y1f4= -cloud.google.com/go/mediatranslation v0.6.0/go.mod h1:hHdBCTYNigsBxshbznuIMFNe5QXEowAuNmmC7h8pu5w= -cloud.google.com/go/mediatranslation v0.7.0/go.mod h1:LCnB/gZr90ONOIQLgSXagp8XUW1ODs2UmUMvcgMfI2I= -cloud.google.com/go/mediatranslation v0.8.1/go.mod h1:L/7hBdEYbYHQJhX2sldtTO5SZZ1C1vkapubj0T2aGig= -cloud.google.com/go/memcache v1.4.0/go.mod h1:rTOfiGZtJX1AaFUrOgsMHX5kAzaTQ8azHiuDoTPzNsE= -cloud.google.com/go/memcache v1.5.0/go.mod h1:dk3fCK7dVo0cUU2c36jKb4VqKPS22BTkf81Xq617aWM= -cloud.google.com/go/memcache v1.6.0/go.mod h1:XS5xB0eQZdHtTuTF9Hf8eJkKtR3pVRCcvJwtm68T3rA= -cloud.google.com/go/memcache v1.7.0/go.mod h1:ywMKfjWhNtkQTxrWxCkCFkoPjLHPW6A7WOTVI8xy3LY= -cloud.google.com/go/memcache v1.9.0/go.mod h1:8oEyzXCu+zo9RzlEaEjHl4KkgjlNDaXbCQeQWlzNFJM= -cloud.google.com/go/memcache v1.10.1/go.mod h1:47YRQIarv4I3QS5+hoETgKO40InqzLP6kpNLvyXuyaA= -cloud.google.com/go/metastore v1.5.0/go.mod h1:2ZNrDcQwghfdtCwJ33nM0+GrBGlVuh8rakL3vdPY3XY= -cloud.google.com/go/metastore v1.6.0/go.mod h1:6cyQTls8CWXzk45G55x57DVQ9gWg7RiH65+YgPsNh9s= -cloud.google.com/go/metastore v1.7.0/go.mod h1:s45D0B4IlsINu87/AsWiEVYbLaIMeUSoxlKKDqBGFS8= -cloud.google.com/go/metastore v1.8.0/go.mod h1:zHiMc4ZUpBiM7twCIFQmJ9JMEkDSyZS9U12uf7wHqSI= -cloud.google.com/go/metastore v1.10.0/go.mod h1:fPEnH3g4JJAk+gMRnrAnoqyv2lpUCqJPWOodSaf45Eo= -cloud.google.com/go/metastore v1.11.1/go.mod h1:uZuSo80U3Wd4zi6C22ZZliOUJ3XeM/MlYi/z5OAOWRA= -cloud.google.com/go/metastore v1.12.0/go.mod h1:uZuSo80U3Wd4zi6C22ZZliOUJ3XeM/MlYi/z5OAOWRA= -cloud.google.com/go/monitoring v1.7.0/go.mod h1:HpYse6kkGo//7p6sT0wsIC6IBDET0RhIsnmlA53dvEk= -cloud.google.com/go/monitoring v1.8.0/go.mod h1:E7PtoMJ1kQXWxPjB6mv2fhC5/15jInuulFdYYtlcvT4= -cloud.google.com/go/monitoring v1.12.0/go.mod h1:yx8Jj2fZNEkL/GYZyTLS4ZtZEZN8WtDEiEqG4kLK50w= -cloud.google.com/go/monitoring v1.13.0/go.mod h1:k2yMBAB1H9JT/QETjNkgdCGD9bPF712XiLTVr+cBrpw= -cloud.google.com/go/monitoring v1.15.1/go.mod h1:lADlSAlFdbqQuwwpaImhsJXu1QSdd3ojypXrFSMr2rM= -cloud.google.com/go/networkconnectivity v1.4.0/go.mod h1:nOl7YL8odKyAOtzNX73/M5/mGZgqqMeryi6UPZTk/rA= -cloud.google.com/go/networkconnectivity v1.5.0/go.mod h1:3GzqJx7uhtlM3kln0+x5wyFvuVH1pIBJjhCpjzSt75o= -cloud.google.com/go/networkconnectivity v1.6.0/go.mod h1:OJOoEXW+0LAxHh89nXd64uGG+FbQoeH8DtxCHVOMlaM= -cloud.google.com/go/networkconnectivity v1.7.0/go.mod h1:RMuSbkdbPwNMQjB5HBWD5MpTBnNm39iAVpC3TmsExt8= -cloud.google.com/go/networkconnectivity v1.10.0/go.mod h1:UP4O4sWXJG13AqrTdQCD9TnLGEbtNRqjuaaA7bNjF5E= -cloud.google.com/go/networkconnectivity v1.11.0/go.mod h1:iWmDD4QF16VCDLXUqvyspJjIEtBR/4zq5hwnY2X3scM= -cloud.google.com/go/networkconnectivity v1.12.1/go.mod h1:PelxSWYM7Sh9/guf8CFhi6vIqf19Ir/sbfZRUwXh92E= -cloud.google.com/go/networkmanagement v1.4.0/go.mod h1:Q9mdLLRn60AsOrPc8rs8iNV6OHXaGcDdsIQe1ohekq8= -cloud.google.com/go/networkmanagement v1.5.0/go.mod h1:ZnOeZ/evzUdUsnvRt792H0uYEnHQEMaz+REhhzJRcf4= -cloud.google.com/go/networkmanagement v1.6.0/go.mod h1:5pKPqyXjB/sgtvB5xqOemumoQNB7y95Q7S+4rjSOPYY= -cloud.google.com/go/networkmanagement v1.8.0/go.mod h1:Ho/BUGmtyEqrttTgWEe7m+8vDdK74ibQc+Be0q7Fof0= -cloud.google.com/go/networksecurity v0.5.0/go.mod h1:xS6fOCoqpVC5zx15Z/MqkfDwH4+m/61A3ODiDV1xmiQ= -cloud.google.com/go/networksecurity v0.6.0/go.mod h1:Q5fjhTr9WMI5mbpRYEbiexTzROf7ZbDzvzCrNl14nyU= -cloud.google.com/go/networksecurity v0.7.0/go.mod h1:mAnzoxx/8TBSyXEeESMy9OOYwo1v+gZ5eMRnsT5bC8k= -cloud.google.com/go/networksecurity v0.8.0/go.mod h1:B78DkqsxFG5zRSVuwYFRZ9Xz8IcQ5iECsNrPn74hKHU= -cloud.google.com/go/networksecurity v0.9.1/go.mod h1:MCMdxOKQ30wsBI1eI659f9kEp4wuuAueoC9AJKSPWZQ= -cloud.google.com/go/notebooks v1.2.0/go.mod h1:9+wtppMfVPUeJ8fIWPOq1UnATHISkGXGqTkxeieQ6UY= -cloud.google.com/go/notebooks v1.3.0/go.mod h1:bFR5lj07DtCPC7YAAJ//vHskFBxA5JzYlH68kXVdk34= -cloud.google.com/go/notebooks v1.4.0/go.mod h1:4QPMngcwmgb6uw7Po99B2xv5ufVoIQ7nOGDyL4P8AgA= -cloud.google.com/go/notebooks v1.5.0/go.mod h1:q8mwhnP9aR8Hpfnrc5iN5IBhrXUy8S2vuYs+kBJ/gu0= -cloud.google.com/go/notebooks v1.7.0/go.mod h1:PVlaDGfJgj1fl1S3dUwhFMXFgfYGhYQt2164xOMONmE= -cloud.google.com/go/notebooks v1.8.0/go.mod h1:Lq6dYKOYOWUCTvw5t2q1gp1lAp0zxAxRycayS0iJcqQ= -cloud.google.com/go/notebooks v1.9.1/go.mod h1:zqG9/gk05JrzgBt4ghLzEepPHNwE5jgPcHZRKhlC1A8= -cloud.google.com/go/optimization v1.1.0/go.mod h1:5po+wfvX5AQlPznyVEZjGJTMr4+CAkJf2XSTQOOl9l4= -cloud.google.com/go/optimization v1.2.0/go.mod h1:Lr7SOHdRDENsh+WXVmQhQTrzdu9ybg0NecjHidBq6xs= -cloud.google.com/go/optimization v1.3.1/go.mod h1:IvUSefKiwd1a5p0RgHDbWCIbDFgKuEdB+fPPuP0IDLI= -cloud.google.com/go/optimization v1.4.1/go.mod h1:j64vZQP7h9bO49m2rVaTVoNM0vEBEN5eKPUPbZyXOrk= -cloud.google.com/go/orchestration v1.3.0/go.mod h1:Sj5tq/JpWiB//X/q3Ngwdl5K7B7Y0KZ7bfv0wL6fqVA= -cloud.google.com/go/orchestration v1.4.0/go.mod h1:6W5NLFWs2TlniBphAViZEVhrXRSMgUGDfW7vrWKvsBk= -cloud.google.com/go/orchestration v1.6.0/go.mod h1:M62Bevp7pkxStDfFfTuCOaXgaaqRAga1yKyoMtEoWPQ= -cloud.google.com/go/orchestration v1.8.1/go.mod h1:4sluRF3wgbYVRqz7zJ1/EUNc90TTprliq9477fGobD8= -cloud.google.com/go/orgpolicy v1.4.0/go.mod h1:xrSLIV4RePWmP9P3tBl8S93lTmlAxjm06NSm2UTmKvE= -cloud.google.com/go/orgpolicy v1.5.0/go.mod h1:hZEc5q3wzwXJaKrsx5+Ewg0u1LxJ51nNFlext7Tanwc= -cloud.google.com/go/orgpolicy v1.10.0/go.mod h1:w1fo8b7rRqlXlIJbVhOMPrwVljyuW5mqssvBtU18ONc= -cloud.google.com/go/orgpolicy v1.11.0/go.mod h1:2RK748+FtVvnfuynxBzdnyu7sygtoZa1za/0ZfpOs1M= -cloud.google.com/go/orgpolicy v1.11.1/go.mod h1:8+E3jQcpZJQliP+zaFfayC2Pg5bmhuLK755wKhIIUCE= -cloud.google.com/go/osconfig v1.7.0/go.mod h1:oVHeCeZELfJP7XLxcBGTMBvRO+1nQ5tFG9VQTmYS2Fs= -cloud.google.com/go/osconfig v1.8.0/go.mod h1:EQqZLu5w5XA7eKizepumcvWx+m8mJUhEwiPqWiZeEdg= -cloud.google.com/go/osconfig v1.9.0/go.mod h1:Yx+IeIZJ3bdWmzbQU4fxNl8xsZ4amB+dygAwFPlvnNo= -cloud.google.com/go/osconfig v1.10.0/go.mod h1:uMhCzqC5I8zfD9zDEAfvgVhDS8oIjySWh+l4WK6GnWw= -cloud.google.com/go/osconfig v1.11.0/go.mod h1:aDICxrur2ogRd9zY5ytBLV89KEgT2MKB2L/n6x1ooPw= -cloud.google.com/go/osconfig v1.12.0/go.mod h1:8f/PaYzoS3JMVfdfTubkowZYGmAhUCjjwnjqWI7NVBc= -cloud.google.com/go/osconfig v1.12.1/go.mod h1:4CjBxND0gswz2gfYRCUoUzCm9zCABp91EeTtWXyz0tE= -cloud.google.com/go/oslogin v1.4.0/go.mod h1:YdgMXWRaElXz/lDk1Na6Fh5orF7gvmJ0FGLIs9LId4E= -cloud.google.com/go/oslogin v1.5.0/go.mod h1:D260Qj11W2qx/HVF29zBg+0fd6YCSjSqLUkY/qEenQU= -cloud.google.com/go/oslogin v1.6.0/go.mod h1:zOJ1O3+dTU8WPlGEkFSh7qeHPPSoxrcMbbK1Nm2iX70= -cloud.google.com/go/oslogin v1.7.0/go.mod h1:e04SN0xO1UNJ1M5GP0vzVBFicIe4O53FOfcixIqTyXo= -cloud.google.com/go/oslogin v1.9.0/go.mod h1:HNavntnH8nzrn8JCTT5fj18FuJLFJc4NaZJtBnQtKFs= -cloud.google.com/go/oslogin v1.10.1/go.mod h1:x692z7yAue5nE7CsSnoG0aaMbNoRJRXO4sn73R+ZqAs= -cloud.google.com/go/phishingprotection v0.5.0/go.mod h1:Y3HZknsK9bc9dMi+oE8Bim0lczMU6hrX0UpADuMefr0= -cloud.google.com/go/phishingprotection v0.6.0/go.mod h1:9Y3LBLgy0kDTcYET8ZH3bq/7qni15yVUoAxiFxnlSUA= -cloud.google.com/go/phishingprotection v0.7.0/go.mod h1:8qJI4QKHoda/sb/7/YmMQ2omRLSLYSu9bU0EKCNI+Lk= -cloud.google.com/go/phishingprotection v0.8.1/go.mod h1:AxonW7GovcA8qdEk13NfHq9hNx5KPtfxXNeUxTDxB6I= -cloud.google.com/go/policytroubleshooter v1.3.0/go.mod h1:qy0+VwANja+kKrjlQuOzmlvscn4RNsAc0e15GGqfMxg= -cloud.google.com/go/policytroubleshooter v1.4.0/go.mod h1:DZT4BcRw3QoO8ota9xw/LKtPa8lKeCByYeKTIf/vxdE= -cloud.google.com/go/policytroubleshooter v1.5.0/go.mod h1:Rz1WfV+1oIpPdN2VvvuboLVRsB1Hclg3CKQ53j9l8vw= -cloud.google.com/go/policytroubleshooter v1.6.0/go.mod h1:zYqaPTsmfvpjm5ULxAyD/lINQxJ0DDsnWOP/GZ7xzBc= -cloud.google.com/go/policytroubleshooter v1.7.1/go.mod h1:0NaT5v3Ag1M7U5r0GfDCpUFkWd9YqpubBWsQlhanRv0= -cloud.google.com/go/policytroubleshooter v1.8.0/go.mod h1:tmn5Ir5EToWe384EuboTcVQT7nTag2+DuH3uHmKd1HU= -cloud.google.com/go/privatecatalog v0.5.0/go.mod h1:XgosMUvvPyxDjAVNDYxJ7wBW8//hLDDYmnsNcMGq1K0= -cloud.google.com/go/privatecatalog v0.6.0/go.mod h1:i/fbkZR0hLN29eEWiiwue8Pb+GforiEIBnV9yrRUOKI= -cloud.google.com/go/privatecatalog v0.7.0/go.mod h1:2s5ssIFO69F5csTXcwBP7NPFTZvps26xGzvQ2PQaBYg= -cloud.google.com/go/privatecatalog v0.8.0/go.mod h1:nQ6pfaegeDAq/Q5lrfCQzQLhubPiZhSaNhIgfJlnIXs= -cloud.google.com/go/privatecatalog v0.9.1/go.mod h1:0XlDXW2unJXdf9zFz968Hp35gl/bhF4twwpXZAW50JA= -cloud.google.com/go/pubsub v1.26.0/go.mod h1:QgBH3U/jdJy/ftjPhTkyXNj543Tin1pRYcdcPRnFIRI= -cloud.google.com/go/pubsub v1.27.1/go.mod h1:hQN39ymbV9geqBnfQq6Xf63yNhUAhv9CZhzp5O6qsW0= -cloud.google.com/go/pubsub v1.28.0/go.mod h1:vuXFpwaVoIPQMGXqRyUQigu/AX1S3IWugR9xznmcXX8= -cloud.google.com/go/pubsub v1.30.0/go.mod h1:qWi1OPS0B+b5L+Sg6Gmc9zD1Y+HaM0MdUr7LsupY1P4= -cloud.google.com/go/pubsub v1.32.0/go.mod h1:f+w71I33OMyxf9VpMVcZbnG5KSUkCOUHYpFd5U1GdRc= -cloud.google.com/go/pubsub v1.33.0/go.mod h1:f+w71I33OMyxf9VpMVcZbnG5KSUkCOUHYpFd5U1GdRc= -cloud.google.com/go/pubsublite v1.5.0/go.mod h1:xapqNQ1CuLfGi23Yda/9l4bBCKz/wC3KIJ5gKcxveZg= -cloud.google.com/go/pubsublite v1.6.0/go.mod h1:1eFCS0U11xlOuMFV/0iBqw3zP12kddMeCbj/F3FSj9k= -cloud.google.com/go/pubsublite v1.7.0/go.mod h1:8hVMwRXfDfvGm3fahVbtDbiLePT3gpoiJYJY+vxWxVM= -cloud.google.com/go/pubsublite v1.8.1/go.mod h1:fOLdU4f5xldK4RGJrBMm+J7zMWNj/k4PxwEZXy39QS0= -cloud.google.com/go/recaptchaenterprise v1.3.1/go.mod h1:OdD+q+y4XGeAlxRaMn1Y7/GveP6zmq76byL6tjPE7d4= -cloud.google.com/go/recaptchaenterprise/v2 v2.1.0/go.mod h1:w9yVqajwroDNTfGuhmOjPDN//rZGySaf6PtFVcSCa7o= -cloud.google.com/go/recaptchaenterprise/v2 v2.2.0/go.mod h1:/Zu5jisWGeERrd5HnlS3EUGb/D335f9k51B/FVil0jk= -cloud.google.com/go/recaptchaenterprise/v2 v2.3.0/go.mod h1:O9LwGCjrhGHBQET5CA7dd5NwwNQUErSgEDit1DLNTdo= -cloud.google.com/go/recaptchaenterprise/v2 v2.4.0/go.mod h1:Am3LHfOuBstrLrNCBrlI5sbwx9LBg3te2N6hGvHn2mE= -cloud.google.com/go/recaptchaenterprise/v2 v2.5.0/go.mod h1:O8LzcHXN3rz0j+LBC91jrwI3R+1ZSZEWrfL7XHgNo9U= -cloud.google.com/go/recaptchaenterprise/v2 v2.6.0/go.mod h1:RPauz9jeLtB3JVzg6nCbe12qNoaa8pXc4d/YukAmcnA= -cloud.google.com/go/recaptchaenterprise/v2 v2.7.0/go.mod h1:19wVj/fs5RtYtynAPJdDTb69oW0vNHYDBTbB4NvMD9c= -cloud.google.com/go/recaptchaenterprise/v2 v2.7.2/go.mod h1:kR0KjsJS7Jt1YSyWFkseQ756D45kaYNTlDPPaRAvDBU= -cloud.google.com/go/recommendationengine v0.5.0/go.mod h1:E5756pJcVFeVgaQv3WNpImkFP8a+RptV6dDLGPILjvg= -cloud.google.com/go/recommendationengine v0.6.0/go.mod h1:08mq2umu9oIqc7tDy8sx+MNJdLG0fUi3vaSVbztHgJ4= -cloud.google.com/go/recommendationengine v0.7.0/go.mod h1:1reUcE3GIu6MeBz/h5xZJqNLuuVjNg1lmWMPyjatzac= -cloud.google.com/go/recommendationengine v0.8.1/go.mod h1:MrZihWwtFYWDzE6Hz5nKcNz3gLizXVIDI/o3G1DLcrE= -cloud.google.com/go/recommender v1.5.0/go.mod h1:jdoeiBIVrJe9gQjwd759ecLJbxCDED4A6p+mqoqDvTg= -cloud.google.com/go/recommender v1.6.0/go.mod h1:+yETpm25mcoiECKh9DEScGzIRyDKpZ0cEhWGo+8bo+c= -cloud.google.com/go/recommender v1.7.0/go.mod h1:XLHs/W+T8olwlGOgfQenXBTbIseGclClff6lhFVe9Bs= -cloud.google.com/go/recommender v1.8.0/go.mod h1:PkjXrTT05BFKwxaUxQmtIlrtj0kph108r02ZZQ5FE70= -cloud.google.com/go/recommender v1.9.0/go.mod h1:PnSsnZY7q+VL1uax2JWkt/UegHssxjUVVCrX52CuEmQ= -cloud.google.com/go/recommender v1.10.1/go.mod h1:XFvrE4Suqn5Cq0Lf+mCP6oBHD/yRMA8XxP5sb7Q7gpA= -cloud.google.com/go/redis v1.7.0/go.mod h1:V3x5Jq1jzUcg+UNsRvdmsfuFnit1cfe3Z/PGyq/lm4Y= -cloud.google.com/go/redis v1.8.0/go.mod h1:Fm2szCDavWzBk2cDKxrkmWBqoCiL1+Ctwq7EyqBCA/A= -cloud.google.com/go/redis v1.9.0/go.mod h1:HMYQuajvb2D0LvMgZmLDZW8V5aOC/WxstZHiy4g8OiA= -cloud.google.com/go/redis v1.10.0/go.mod h1:ThJf3mMBQtW18JzGgh41/Wld6vnDDc/F/F35UolRZPM= -cloud.google.com/go/redis v1.11.0/go.mod h1:/X6eicana+BWcUda5PpwZC48o37SiFVTFSs0fWAJ7uQ= -cloud.google.com/go/redis v1.13.1/go.mod h1:VP7DGLpE91M6bcsDdMuyCm2hIpB6Vp2hI090Mfd1tcg= -cloud.google.com/go/resourcemanager v1.3.0/go.mod h1:bAtrTjZQFJkiWTPDb1WBjzvc6/kifjj4QBYuKCCoqKA= -cloud.google.com/go/resourcemanager v1.4.0/go.mod h1:MwxuzkumyTX7/a3n37gmsT3py7LIXwrShilPh3P1tR0= -cloud.google.com/go/resourcemanager v1.5.0/go.mod h1:eQoXNAiAvCf5PXxWxXjhKQoTMaUSNrEfg+6qdf/wots= -cloud.google.com/go/resourcemanager v1.6.0/go.mod h1:YcpXGRs8fDzcUl1Xw8uOVmI8JEadvhRIkoXXUNVYcVo= -cloud.google.com/go/resourcemanager v1.7.0/go.mod h1:HlD3m6+bwhzj9XCouqmeiGuni95NTrExfhoSrkC/3EI= -cloud.google.com/go/resourcemanager v1.9.1/go.mod h1:dVCuosgrh1tINZ/RwBufr8lULmWGOkPS8gL5gqyjdT8= -cloud.google.com/go/resourcesettings v1.3.0/go.mod h1:lzew8VfESA5DQ8gdlHwMrqZs1S9V87v3oCnKCWoOuQU= -cloud.google.com/go/resourcesettings v1.4.0/go.mod h1:ldiH9IJpcrlC3VSuCGvjR5of/ezRrOxFtpJoJo5SmXg= -cloud.google.com/go/resourcesettings v1.5.0/go.mod h1:+xJF7QSG6undsQDfsCJyqWXyBwUoJLhetkRMDRnIoXA= -cloud.google.com/go/resourcesettings v1.6.1/go.mod h1:M7mk9PIZrC5Fgsu1kZJci6mpgN8o0IUzVx3eJU3y4Jw= -cloud.google.com/go/retail v1.8.0/go.mod h1:QblKS8waDmNUhghY2TI9O3JLlFk8jybHeV4BF19FrE4= -cloud.google.com/go/retail v1.9.0/go.mod h1:g6jb6mKuCS1QKnH/dpu7isX253absFl6iE92nHwlBUY= -cloud.google.com/go/retail v1.10.0/go.mod h1:2gDk9HsL4HMS4oZwz6daui2/jmKvqShXKQuB2RZ+cCc= -cloud.google.com/go/retail v1.11.0/go.mod h1:MBLk1NaWPmh6iVFSz9MeKG/Psyd7TAgm6y/9L2B4x9Y= -cloud.google.com/go/retail v1.12.0/go.mod h1:UMkelN/0Z8XvKymXFbD4EhFJlYKRx1FGhQkVPU5kF14= -cloud.google.com/go/retail v1.14.1/go.mod h1:y3Wv3Vr2k54dLNIrCzenyKG8g8dhvhncT2NcNjb/6gE= -cloud.google.com/go/run v0.2.0/go.mod h1:CNtKsTA1sDcnqqIFR3Pb5Tq0usWxJJvsWOCPldRU3Do= -cloud.google.com/go/run v0.3.0/go.mod h1:TuyY1+taHxTjrD0ZFk2iAR+xyOXEA0ztb7U3UNA0zBo= -cloud.google.com/go/run v0.8.0/go.mod h1:VniEnuBwqjigv0A7ONfQUaEItaiCRVujlMqerPPiktM= -cloud.google.com/go/run v0.9.0/go.mod h1:Wwu+/vvg8Y+JUApMwEDfVfhetv30hCG4ZwDR/IXl2Qg= -cloud.google.com/go/run v1.2.0/go.mod h1:36V1IlDzQ0XxbQjUx6IYbw8H3TJnWvhii963WW3B/bo= -cloud.google.com/go/scheduler v1.4.0/go.mod h1:drcJBmxF3aqZJRhmkHQ9b3uSSpQoltBPGPxGAWROx6s= -cloud.google.com/go/scheduler v1.5.0/go.mod h1:ri073ym49NW3AfT6DZi21vLZrG07GXr5p3H1KxN5QlI= -cloud.google.com/go/scheduler v1.6.0/go.mod h1:SgeKVM7MIwPn3BqtcBntpLyrIJftQISRrYB5ZtT+KOk= -cloud.google.com/go/scheduler v1.7.0/go.mod h1:jyCiBqWW956uBjjPMMuX09n3x37mtyPJegEWKxRsn44= -cloud.google.com/go/scheduler v1.8.0/go.mod h1:TCET+Y5Gp1YgHT8py4nlg2Sew8nUHMqcpousDgXJVQc= -cloud.google.com/go/scheduler v1.9.0/go.mod h1:yexg5t+KSmqu+njTIh3b7oYPheFtBWGcbVUYF1GGMIc= -cloud.google.com/go/scheduler v1.10.1/go.mod h1:R63Ldltd47Bs4gnhQkmNDse5w8gBRrhObZ54PxgR2Oo= -cloud.google.com/go/secretmanager v1.6.0/go.mod h1:awVa/OXF6IiyaU1wQ34inzQNc4ISIDIrId8qE5QGgKA= -cloud.google.com/go/secretmanager v1.8.0/go.mod h1:hnVgi/bN5MYHd3Gt0SPuTPPp5ENina1/LxM+2W9U9J4= -cloud.google.com/go/secretmanager v1.9.0/go.mod h1:b71qH2l1yHmWQHt9LC80akm86mX8AL6X1MA01dW8ht4= -cloud.google.com/go/secretmanager v1.10.0/go.mod h1:MfnrdvKMPNra9aZtQFvBcvRU54hbPD8/HayQdlUgJpU= -cloud.google.com/go/secretmanager v1.11.1/go.mod h1:znq9JlXgTNdBeQk9TBW/FnR/W4uChEKGeqQWAJ8SXFw= -cloud.google.com/go/security v1.5.0/go.mod h1:lgxGdyOKKjHL4YG3/YwIL2zLqMFCKs0UbQwgyZmfJl4= -cloud.google.com/go/security v1.7.0/go.mod h1:mZklORHl6Bg7CNnnjLH//0UlAlaXqiG7Lb9PsPXLfD0= -cloud.google.com/go/security v1.8.0/go.mod h1:hAQOwgmaHhztFhiQ41CjDODdWP0+AE1B3sX4OFlq+GU= -cloud.google.com/go/security v1.9.0/go.mod h1:6Ta1bO8LXI89nZnmnsZGp9lVoVWXqsVbIq/t9dzI+2Q= -cloud.google.com/go/security v1.10.0/go.mod h1:QtOMZByJVlibUT2h9afNDWRZ1G96gVywH8T5GUSb9IA= -cloud.google.com/go/security v1.12.0/go.mod h1:rV6EhrpbNHrrxqlvW0BWAIawFWq3X90SduMJdFwtLB8= -cloud.google.com/go/security v1.13.0/go.mod h1:Q1Nvxl1PAgmeW0y3HTt54JYIvUdtcpYKVfIB8AOMZ+0= -cloud.google.com/go/security v1.15.1/go.mod h1:MvTnnbsWnehoizHi09zoiZob0iCHVcL4AUBj76h9fXA= -cloud.google.com/go/securitycenter v1.13.0/go.mod h1:cv5qNAqjY84FCN6Y9z28WlkKXyWsgLO832YiWwkCWcU= -cloud.google.com/go/securitycenter v1.14.0/go.mod h1:gZLAhtyKv85n52XYWt6RmeBdydyxfPeTrpToDPw4Auc= -cloud.google.com/go/securitycenter v1.15.0/go.mod h1:PeKJ0t8MoFmmXLXWm41JidyzI3PJjd8sXWaVqg43WWk= -cloud.google.com/go/securitycenter v1.16.0/go.mod h1:Q9GMaLQFUD+5ZTabrbujNWLtSLZIZF7SAR0wWECrjdk= -cloud.google.com/go/securitycenter v1.18.1/go.mod h1:0/25gAzCM/9OL9vVx4ChPeM/+DlfGQJDwBy/UC8AKK0= -cloud.google.com/go/securitycenter v1.19.0/go.mod h1:LVLmSg8ZkkyaNy4u7HCIshAngSQ8EcIRREP3xBnyfag= -cloud.google.com/go/securitycenter v1.23.0/go.mod h1:8pwQ4n+Y9WCWM278R8W3nF65QtY172h4S8aXyI9/hsQ= -cloud.google.com/go/servicecontrol v1.4.0/go.mod h1:o0hUSJ1TXJAmi/7fLJAedOovnujSEvjKCAFNXPQ1RaU= -cloud.google.com/go/servicecontrol v1.5.0/go.mod h1:qM0CnXHhyqKVuiZnGKrIurvVImCs8gmqWsDoqe9sU1s= -cloud.google.com/go/servicecontrol v1.10.0/go.mod h1:pQvyvSRh7YzUF2efw7H87V92mxU8FnFDawMClGCNuAA= -cloud.google.com/go/servicecontrol v1.11.0/go.mod h1:kFmTzYzTUIuZs0ycVqRHNaNhgR+UMUpw9n02l/pY+mc= -cloud.google.com/go/servicecontrol v1.11.1/go.mod h1:aSnNNlwEFBY+PWGQ2DoM0JJ/QUXqV5/ZD9DOLB7SnUk= -cloud.google.com/go/servicedirectory v1.4.0/go.mod h1:gH1MUaZCgtP7qQiI+F+A+OpeKF/HQWgtAddhTbhL2bs= -cloud.google.com/go/servicedirectory v1.5.0/go.mod h1:QMKFL0NUySbpZJ1UZs3oFAmdvVxhhxB6eJ/Vlp73dfg= -cloud.google.com/go/servicedirectory v1.6.0/go.mod h1:pUlbnWsLH9c13yGkxCmfumWEPjsRs1RlmJ4pqiNjVL4= -cloud.google.com/go/servicedirectory v1.7.0/go.mod h1:5p/U5oyvgYGYejufvxhgwjL8UVXjkuw7q5XcG10wx1U= -cloud.google.com/go/servicedirectory v1.8.0/go.mod h1:srXodfhY1GFIPvltunswqXpVxFPpZjf8nkKQT7XcXaY= -cloud.google.com/go/servicedirectory v1.9.0/go.mod h1:29je5JjiygNYlmsGz8k6o+OZ8vd4f//bQLtvzkPPT/s= -cloud.google.com/go/servicedirectory v1.10.1/go.mod h1:Xv0YVH8s4pVOwfM/1eMTl0XJ6bzIOSLDt8f8eLaGOxQ= -cloud.google.com/go/servicedirectory v1.11.0/go.mod h1:Xv0YVH8s4pVOwfM/1eMTl0XJ6bzIOSLDt8f8eLaGOxQ= -cloud.google.com/go/servicemanagement v1.4.0/go.mod h1:d8t8MDbezI7Z2R1O/wu8oTggo3BI2GKYbdG4y/SJTco= -cloud.google.com/go/servicemanagement v1.5.0/go.mod h1:XGaCRe57kfqu4+lRxaFEAuqmjzF0r+gWHjWqKqBvKFo= -cloud.google.com/go/servicemanagement v1.6.0/go.mod h1:aWns7EeeCOtGEX4OvZUWCCJONRZeFKiptqKf1D0l/Jc= -cloud.google.com/go/servicemanagement v1.8.0/go.mod h1:MSS2TDlIEQD/fzsSGfCdJItQveu9NXnUniTrq/L8LK4= -cloud.google.com/go/serviceusage v1.3.0/go.mod h1:Hya1cozXM4SeSKTAgGXgj97GlqUvF5JaoXacR1JTP/E= -cloud.google.com/go/serviceusage v1.4.0/go.mod h1:SB4yxXSaYVuUBYUml6qklyONXNLt83U0Rb+CXyhjEeU= -cloud.google.com/go/serviceusage v1.5.0/go.mod h1:w8U1JvqUqwJNPEOTQjrMHkw3IaIFLoLsPLvsE3xueec= -cloud.google.com/go/serviceusage v1.6.0/go.mod h1:R5wwQcbOWsyuOfbP9tGdAnCAc6B9DRwPG1xtWMDeuPA= -cloud.google.com/go/shell v1.3.0/go.mod h1:VZ9HmRjZBsjLGXusm7K5Q5lzzByZmJHf1d0IWHEN5X4= -cloud.google.com/go/shell v1.4.0/go.mod h1:HDxPzZf3GkDdhExzD/gs8Grqk+dmYcEjGShZgYa9URw= -cloud.google.com/go/shell v1.6.0/go.mod h1:oHO8QACS90luWgxP3N9iZVuEiSF84zNyLytb+qE2f9A= -cloud.google.com/go/shell v1.7.1/go.mod h1:u1RaM+huXFaTojTbW4g9P5emOrrmLE69KrxqQahKn4g= -cloud.google.com/go/spanner v1.41.0/go.mod h1:MLYDBJR/dY4Wt7ZaMIQ7rXOTLjYrmxLE/5ve9vFfWos= -cloud.google.com/go/spanner v1.44.0/go.mod h1:G8XIgYdOK+Fbcpbs7p2fiprDw4CaZX63whnSMLVBxjk= -cloud.google.com/go/spanner v1.45.0/go.mod h1:FIws5LowYz8YAE1J8fOS7DJup8ff7xJeetWEo5REA2M= -cloud.google.com/go/spanner v1.47.0/go.mod h1:IXsJwVW2j4UKs0eYDqodab6HgGuA1bViSqW4uH9lfUI= -cloud.google.com/go/speech v1.6.0/go.mod h1:79tcr4FHCimOp56lwC01xnt/WPJZc4v3gzyT7FoBkCM= -cloud.google.com/go/speech v1.7.0/go.mod h1:KptqL+BAQIhMsj1kOP2la5DSEEerPDuOP/2mmkhHhZQ= -cloud.google.com/go/speech v1.8.0/go.mod h1:9bYIl1/tjsAnMgKGHKmBZzXKEkGgtU+MpdDPTE9f7y0= -cloud.google.com/go/speech v1.9.0/go.mod h1:xQ0jTcmnRFFM2RfX/U+rk6FQNUF6DQlydUSyoooSpco= -cloud.google.com/go/speech v1.14.1/go.mod h1:gEosVRPJ9waG7zqqnsHpYTOoAS4KouMRLDFMekpJ0J0= -cloud.google.com/go/speech v1.15.0/go.mod h1:y6oH7GhqCaZANH7+Oe0BhgIogsNInLlz542tg3VqeYI= -cloud.google.com/go/speech v1.17.1/go.mod h1:8rVNzU43tQvxDaGvqOhpDqgkJTFowBpDvCJ14kGlJYo= -cloud.google.com/go/speech v1.19.0/go.mod h1:8rVNzU43tQvxDaGvqOhpDqgkJTFowBpDvCJ14kGlJYo= -cloud.google.com/go/storage v1.23.0/go.mod h1:vOEEDNFnciUMhBeT6hsJIn3ieU5cFRmzeLgDvXzfIXc= -cloud.google.com/go/storage v1.27.0/go.mod h1:x9DOL8TK/ygDUMieqwfhdpQryTeEkhGKMi80i/iqR2s= -cloud.google.com/go/storage v1.28.1/go.mod h1:Qnisd4CqDdo6BGs2AD5LLnEsmSQ80wQ5ogcBBKhU86Y= -cloud.google.com/go/storage v1.29.0/go.mod h1:4puEjyTKnku6gfKoTfNOU/W+a9JyuVNxjpS5GBrB8h4= -cloud.google.com/go/storage v1.30.1/go.mod h1:NfxhC0UJE1aXSx7CIIbCf7y9HKT7BiccwkR7+P7gN8E= -cloud.google.com/go/storagetransfer v1.5.0/go.mod h1:dxNzUopWy7RQevYFHewchb29POFv3/AaBgnhqzqiK0w= -cloud.google.com/go/storagetransfer v1.6.0/go.mod h1:y77xm4CQV/ZhFZH75PLEXY0ROiS7Gh6pSKrM8dJyg6I= -cloud.google.com/go/storagetransfer v1.7.0/go.mod h1:8Giuj1QNb1kfLAiWM1bN6dHzfdlDAVC9rv9abHot2W4= -cloud.google.com/go/storagetransfer v1.8.0/go.mod h1:JpegsHHU1eXg7lMHkvf+KE5XDJ7EQu0GwNJbbVGanEw= -cloud.google.com/go/storagetransfer v1.10.0/go.mod h1:DM4sTlSmGiNczmV6iZyceIh2dbs+7z2Ayg6YAiQlYfA= -cloud.google.com/go/talent v1.1.0/go.mod h1:Vl4pt9jiHKvOgF9KoZo6Kob9oV4lwd/ZD5Cto54zDRw= -cloud.google.com/go/talent v1.2.0/go.mod h1:MoNF9bhFQbiJ6eFD3uSsg0uBALw4n4gaCaEjBw9zo8g= -cloud.google.com/go/talent v1.3.0/go.mod h1:CmcxwJ/PKfRgd1pBjQgU6W3YBwiewmUzQYH5HHmSCmM= -cloud.google.com/go/talent v1.4.0/go.mod h1:ezFtAgVuRf8jRsvyE6EwmbTK5LKciD4KVnHuDEFmOOA= -cloud.google.com/go/talent v1.5.0/go.mod h1:G+ODMj9bsasAEJkQSzO2uHQWXHHXUomArjWQQYkqK6c= -cloud.google.com/go/talent v1.6.2/go.mod h1:CbGvmKCG61mkdjcqTcLOkb2ZN1SrQI8MDyma2l7VD24= -cloud.google.com/go/texttospeech v1.4.0/go.mod h1:FX8HQHA6sEpJ7rCMSfXuzBcysDAuWusNNNvN9FELDd8= -cloud.google.com/go/texttospeech v1.5.0/go.mod h1:oKPLhR4n4ZdQqWKURdwxMy0uiTS1xU161C8W57Wkea4= -cloud.google.com/go/texttospeech v1.6.0/go.mod h1:YmwmFT8pj1aBblQOI3TfKmwibnsfvhIBzPXcW4EBovc= -cloud.google.com/go/texttospeech v1.7.1/go.mod h1:m7QfG5IXxeneGqTapXNxv2ItxP/FS0hCZBwXYqucgSk= -cloud.google.com/go/tpu v1.3.0/go.mod h1:aJIManG0o20tfDQlRIej44FcwGGl/cD0oiRyMKG19IQ= -cloud.google.com/go/tpu v1.4.0/go.mod h1:mjZaX8p0VBgllCzF6wcU2ovUXN9TONFLd7iz227X2Xg= -cloud.google.com/go/tpu v1.5.0/go.mod h1:8zVo1rYDFuW2l4yZVY0R0fb/v44xLh3llq7RuV61fPM= -cloud.google.com/go/tpu v1.6.1/go.mod h1:sOdcHVIgDEEOKuqUoi6Fq53MKHJAtOwtz0GuKsWSH3E= -cloud.google.com/go/trace v1.3.0/go.mod h1:FFUE83d9Ca57C+K8rDl/Ih8LwOzWIV1krKgxg6N0G28= -cloud.google.com/go/trace v1.4.0/go.mod h1:UG0v8UBqzusp+z63o7FK74SdFE+AXpCLdFb1rshXG+Y= -cloud.google.com/go/trace v1.8.0/go.mod h1:zH7vcsbAhklH8hWFig58HvxcxyQbaIqMarMg9hn5ECA= -cloud.google.com/go/trace v1.9.0/go.mod h1:lOQqpE5IaWY0Ixg7/r2SjixMuc6lfTFeO4QGM4dQWOk= -cloud.google.com/go/trace v1.10.1/go.mod h1:gbtL94KE5AJLH3y+WVpfWILmqgc6dXcqgNXdOPAQTYk= -cloud.google.com/go/translate v1.3.0/go.mod h1:gzMUwRjvOqj5i69y/LYLd8RrNQk+hOmIXTi9+nb3Djs= -cloud.google.com/go/translate v1.4.0/go.mod h1:06Dn/ppvLD6WvA5Rhdp029IX2Mi3Mn7fpMRLPvXT5Wg= -cloud.google.com/go/translate v1.5.0/go.mod h1:29YDSYveqqpA1CQFD7NQuP49xymq17RXNaUDdc0mNu0= -cloud.google.com/go/translate v1.6.0/go.mod h1:lMGRudH1pu7I3n3PETiOB2507gf3HnfLV8qlkHZEyos= -cloud.google.com/go/translate v1.7.0/go.mod h1:lMGRudH1pu7I3n3PETiOB2507gf3HnfLV8qlkHZEyos= -cloud.google.com/go/translate v1.8.1/go.mod h1:d1ZH5aaOA0CNhWeXeC8ujd4tdCFw8XoNWRljklu5RHs= -cloud.google.com/go/translate v1.8.2/go.mod h1:d1ZH5aaOA0CNhWeXeC8ujd4tdCFw8XoNWRljklu5RHs= -cloud.google.com/go/video v1.8.0/go.mod h1:sTzKFc0bUSByE8Yoh8X0mn8bMymItVGPfTuUBUyRgxk= -cloud.google.com/go/video v1.9.0/go.mod h1:0RhNKFRF5v92f8dQt0yhaHrEuH95m068JYOvLZYnJSw= -cloud.google.com/go/video v1.12.0/go.mod h1:MLQew95eTuaNDEGriQdcYn0dTwf9oWiA4uYebxM5kdg= -cloud.google.com/go/video v1.13.0/go.mod h1:ulzkYlYgCp15N2AokzKjy7MQ9ejuynOJdf1tR5lGthk= -cloud.google.com/go/video v1.14.0/go.mod h1:SkgaXwT+lIIAKqWAJfktHT/RbgjSuY6DobxEp0C5yTQ= -cloud.google.com/go/video v1.15.0/go.mod h1:SkgaXwT+lIIAKqWAJfktHT/RbgjSuY6DobxEp0C5yTQ= -cloud.google.com/go/video v1.17.1/go.mod h1:9qmqPqw/Ib2tLqaeHgtakU+l5TcJxCJbhFXM7UJjVzU= -cloud.google.com/go/video v1.19.0/go.mod h1:9qmqPqw/Ib2tLqaeHgtakU+l5TcJxCJbhFXM7UJjVzU= -cloud.google.com/go/videointelligence v1.6.0/go.mod h1:w0DIDlVRKtwPCn/C4iwZIJdvC69yInhW0cfi+p546uU= -cloud.google.com/go/videointelligence v1.7.0/go.mod h1:k8pI/1wAhjznARtVT9U1llUaFNPh7muw8QyOUpavru4= -cloud.google.com/go/videointelligence v1.8.0/go.mod h1:dIcCn4gVDdS7yte/w+koiXn5dWVplOZkE+xwG9FgK+M= -cloud.google.com/go/videointelligence v1.9.0/go.mod h1:29lVRMPDYHikk3v8EdPSaL8Ku+eMzDljjuvRs105XoU= -cloud.google.com/go/videointelligence v1.10.0/go.mod h1:LHZngX1liVtUhZvi2uNS0VQuOzNi2TkY1OakiuoUOjU= -cloud.google.com/go/videointelligence v1.11.1/go.mod h1:76xn/8InyQHarjTWsBR058SmlPCwQjgcvoW0aZykOvo= -cloud.google.com/go/vision v1.2.0/go.mod h1:SmNwgObm5DpFBme2xpyOyasvBc1aPdjvMk2bBk0tKD0= -cloud.google.com/go/vision/v2 v2.2.0/go.mod h1:uCdV4PpN1S0jyCyq8sIM42v2Y6zOLkZs+4R9LrGYwFo= -cloud.google.com/go/vision/v2 v2.3.0/go.mod h1:UO61abBx9QRMFkNBbf1D8B1LXdS2cGiiCRx0vSpZoUo= -cloud.google.com/go/vision/v2 v2.4.0/go.mod h1:VtI579ll9RpVTrdKdkMzckdnwMyX2JILb+MhPqRbPsY= -cloud.google.com/go/vision/v2 v2.5.0/go.mod h1:MmaezXOOE+IWa+cS7OhRRLK2cNv1ZL98zhqFFZaaH2E= -cloud.google.com/go/vision/v2 v2.6.0/go.mod h1:158Hes0MvOS9Z/bDMSFpjwsUrZ5fPrdwuyyvKSGAGMY= -cloud.google.com/go/vision/v2 v2.7.0/go.mod h1:H89VysHy21avemp6xcf9b9JvZHVehWbET0uT/bcuY/0= -cloud.google.com/go/vision/v2 v2.7.2/go.mod h1:jKa8oSYBWhYiXarHPvP4USxYANYUEdEsQrloLjrSwJU= -cloud.google.com/go/vmmigration v1.2.0/go.mod h1:IRf0o7myyWFSmVR1ItrBSFLFD/rJkfDCUTO4vLlJvsE= -cloud.google.com/go/vmmigration v1.3.0/go.mod h1:oGJ6ZgGPQOFdjHuocGcLqX4lc98YQ7Ygq8YQwHh9A7g= -cloud.google.com/go/vmmigration v1.5.0/go.mod h1:E4YQ8q7/4W9gobHjQg4JJSgXXSgY21nA5r8swQV+Xxc= -cloud.google.com/go/vmmigration v1.6.0/go.mod h1:bopQ/g4z+8qXzichC7GW1w2MjbErL54rk3/C843CjfY= -cloud.google.com/go/vmmigration v1.7.1/go.mod h1:WD+5z7a/IpZ5bKK//YmT9E047AD+rjycCAvyMxGJbro= -cloud.google.com/go/vmwareengine v0.1.0/go.mod h1:RsdNEf/8UDvKllXhMz5J40XxDrNJNN4sagiox+OI208= -cloud.google.com/go/vmwareengine v0.2.2/go.mod h1:sKdctNJxb3KLZkE/6Oui94iw/xs9PRNC2wnNLXsHvH8= -cloud.google.com/go/vmwareengine v0.3.0/go.mod h1:wvoyMvNWdIzxMYSpH/R7y2h5h3WFkx6d+1TIsP39WGY= -cloud.google.com/go/vmwareengine v0.4.1/go.mod h1:Px64x+BvjPZwWuc4HdmVhoygcXqEkGHXoa7uyfTgSI0= -cloud.google.com/go/vmwareengine v1.0.0/go.mod h1:Px64x+BvjPZwWuc4HdmVhoygcXqEkGHXoa7uyfTgSI0= -cloud.google.com/go/vpcaccess v1.4.0/go.mod h1:aQHVbTWDYUR1EbTApSVvMq1EnT57ppDmQzZ3imqIk4w= -cloud.google.com/go/vpcaccess v1.5.0/go.mod h1:drmg4HLk9NkZpGfCmZ3Tz0Bwnm2+DKqViEpeEpOq0m8= -cloud.google.com/go/vpcaccess v1.6.0/go.mod h1:wX2ILaNhe7TlVa4vC5xce1bCnqE3AeH27RV31lnmZes= -cloud.google.com/go/vpcaccess v1.7.1/go.mod h1:FogoD46/ZU+JUBX9D606X21EnxiszYi2tArQwLY4SXs= -cloud.google.com/go/webrisk v1.4.0/go.mod h1:Hn8X6Zr+ziE2aNd8SliSDWpEnSS1u4R9+xXZmFiHmGE= -cloud.google.com/go/webrisk v1.5.0/go.mod h1:iPG6fr52Tv7sGk0H6qUFzmL3HHZev1htXuWDEEsqMTg= -cloud.google.com/go/webrisk v1.6.0/go.mod h1:65sW9V9rOosnc9ZY7A7jsy1zoHS5W9IAXv6dGqhMQMc= -cloud.google.com/go/webrisk v1.7.0/go.mod h1:mVMHgEYH0r337nmt1JyLthzMr6YxwN1aAIEc2fTcq7A= -cloud.google.com/go/webrisk v1.8.0/go.mod h1:oJPDuamzHXgUc+b8SiHRcVInZQuybnvEW72PqTc7sSg= -cloud.google.com/go/webrisk v1.9.1/go.mod h1:4GCmXKcOa2BZcZPn6DCEvE7HypmEJcJkr4mtM+sqYPc= -cloud.google.com/go/websecurityscanner v1.3.0/go.mod h1:uImdKm2wyeXQevQJXeh8Uun/Ym1VqworNDlBXQevGMo= -cloud.google.com/go/websecurityscanner v1.4.0/go.mod h1:ebit/Fp0a+FWu5j4JOmJEV8S8CzdTkAS77oDsiSqYWQ= -cloud.google.com/go/websecurityscanner v1.5.0/go.mod h1:Y6xdCPy81yi0SQnDY1xdNTNpfY1oAgXUlcfN3B3eSng= -cloud.google.com/go/websecurityscanner v1.6.1/go.mod h1:Njgaw3rttgRHXzwCB8kgCYqv5/rGpFCsBOvPbYgszpg= -cloud.google.com/go/workflows v1.6.0/go.mod h1:6t9F5h/unJz41YqfBmqSASJSXccBLtD1Vwf+KmJENM0= -cloud.google.com/go/workflows v1.7.0/go.mod h1:JhSrZuVZWuiDfKEFxU0/F1PQjmpnpcoISEXH2bcHC3M= -cloud.google.com/go/workflows v1.8.0/go.mod h1:ysGhmEajwZxGn1OhGOGKsTXc5PyxOc0vfKf5Af+to4M= -cloud.google.com/go/workflows v1.9.0/go.mod h1:ZGkj1aFIOd9c8Gerkjjq7OW7I5+l6cSvT3ujaO/WwSA= -cloud.google.com/go/workflows v1.10.0/go.mod h1:fZ8LmRmZQWacon9UCX1r/g/DfAXx5VcPALq2CxzdePw= -cloud.google.com/go/workflows v1.11.1/go.mod h1:Z+t10G1wF7h8LgdY/EmRcQY8ptBD/nvofaL6FqlET6g= -git.sr.ht/~sbinet/gg v0.3.1/go.mod h1:KGYtlADtqsqANL9ueOFkWymvzUvLMQllU5Ixo+8v3pc= -github.com/JohnCGriffin/overflow v0.0.0-20211019200055-46fa312c352c/go.mod h1:X0CRv0ky0k6m906ixxpzmDRLvX58TFUKS2eePweuyxk= -github.com/Masterminds/squirrel v1.5.3 h1:YPpoceAcxuzIljlr5iWpNKaql7hLeG1KLSrhvdHpkZc= -github.com/Masterminds/squirrel v1.5.3/go.mod h1:NNaOrjSoIDfDA40n7sr2tPNZRfjzjA400rg+riTZj10= -github.com/Nvveen/Gotty v0.0.0-20120604004816-cd527374f1e5 h1:TngWCqHvy9oXAN6lEVMRuU21PR1EtLVZJmdB18Gu3Rw= -github.com/PuerkitoBio/purell v1.1.1 h1:WEQqlqaGbrPkxLJWfBwQmfEAE1Z7ONdDLqrN38tNFfI= -github.com/PuerkitoBio/urlesc v0.0.0-20170810143723-de5bf2ad4578 h1:d+Bc7a5rLufV/sSk/8dngufqelfh6jnri85riMAaF/M= -github.com/ajstarks/deck v0.0.0-20200831202436-30c9fc6549a9/go.mod h1:JynElWSGnm/4RlzPXRlREEwqTHAN3T56Bv2ITsFT3gY= -github.com/ajstarks/deck/generate v0.0.0-20210309230005-c3f852c02e19/go.mod h1:T13YZdzov6OU0A1+RfKZiZN9ca6VeKdBdyDV+BY97Tk= -github.com/ajstarks/svgo v0.0.0-20211024235047-1546f124cd8b/go.mod h1:1KcenG0jGWcpt8ov532z81sp/kMMUG485J2InIOyADM= -github.com/alecthomas/chroma v0.10.0 h1:7XDcGkCQopCNKjZHfYrNLraA+M7e0fMiJ/Mfikbfjek= -github.com/alecthomas/chroma v0.10.0/go.mod h1:jtJATyUxlIORhUOFNA9NZDWGAQ8wpxQQqNSB4rjA/1s= -github.com/andybalholm/brotli v1.0.4/go.mod h1:fO7iG3H7G2nSZ7m0zPUDn85XEX2GTukHGRSepvi9Eig= -github.com/apache/arrow/go/v10 v10.0.1/go.mod h1:YvhnlEePVnBS4+0z3fhPfUy7W1Ikj0Ih0vcRo/gZ1M0= -github.com/apache/arrow/go/v11 v11.0.0/go.mod h1:Eg5OsL5H+e299f7u5ssuXsuHQVEGC4xei5aX110hRiI= -github.com/apache/arrow/go/v12 v12.0.0/go.mod h1:d+tV/eHZZ7Dz7RPrFKtPK02tpr+c9/PEd/zm8mDS9Vg= -github.com/apache/thrift v0.16.0/go.mod h1:PHK3hniurgQaNMZYaCLEqXKsYK8upmhPbmdP2FXSqgU= +github.com/HdrHistogram/hdrhistogram-go v1.1.2/go.mod h1:yDgFjdqOqDEKOvasDdhWNXYg9BVp4O+o5f6V/ehm6Oo= github.com/armon/go-metrics v0.4.0/go.mod h1:E6amYzXo6aW1tqzoZGT755KkbgrJsSdpwZ+3JqfkOG4= -github.com/asaskevich/govalidator v0.0.0-20200907205600-7a23bdc65eef h1:46PFijGLmAjMPwCCCo7Jf0W6f9slllCkkv7vyc1yOSg= -github.com/authzed/authzed-go v0.7.0 h1:etnzHUAIyxGiEaFYJPYkHTHzxCYWEGzZQMgVLe4xRME= -github.com/authzed/grpcutil v0.0.0-20230908193239-4286bb1d6403 h1:bQeIwWWRI9bl93poTqpix4sYHi+gnXUPK7N6bMtXzBE= -github.com/authzed/grpcutil v0.0.0-20230908193239-4286bb1d6403/go.mod h1:s3qC7V7XIbiNWERv7Lfljy/Lx25/V1Qlexb0WJuA8uQ= -github.com/aymanbagabas/go-osc52 v1.0.3/go.mod h1:zT8H+Rk4VSabYN90pWyugflM3ZhpTZNC7cASDfUCdT4= -github.com/aymanbagabas/go-osc52 v1.2.1 h1:q2sWUyDcozPLcLabEMd+a+7Ea2DitxZVN9hTxab9L4E= -github.com/aymanbagabas/go-osc52 v1.2.1/go.mod h1:zT8H+Rk4VSabYN90pWyugflM3ZhpTZNC7cASDfUCdT4= -github.com/aymerick/douceur v0.2.0 h1:Mv+mAeH1Q+n9Fr+oyamOlAkUNPWPlA8PPGR0QAaYuPk= -github.com/boombuler/barcode v1.0.1/go.mod h1:paBWMcWSl3LHKBqUq+rly7CNSldXjb2rDl3JlRe0mD8= -github.com/briandowns/spinner v1.21.0 h1:2lVBzf3iZ3cT/ulVXljc4BzlL3yTWZDzsGsamI7si+A= -github.com/briandowns/spinner v1.21.0/go.mod h1:TcwZHb7Wb6vn/+bcVv1UXEzaA4pLS7yznHlkY/HzH44= +github.com/bufbuild/protocompile v0.4.0/go.mod h1:3v93+mbWn/v3xzN+31nwkJfrEpAUwp+BagBSZWx+TP8= github.com/cenkalti/backoff v2.2.1+incompatible h1:tNowT99t7UNflLxfYYSlKYsBpXdEet03Pg2g16Swow4= -github.com/cenkalti/backoff/v4 v4.1.3 h1:cFAlzYUlVYDysBEH2T5hyJZMh3+5+WCBvSnK6Q8UtC4= -github.com/certifi/gocertifi v0.0.0-20210507211836-431795d63e8d h1:S2NE3iHSwP0XV47EEXL8mWmRdEfGscSJ+7EgePNgt0s= github.com/cespare/xxhash v1.1.0 h1:a6HrQnmkObjyL+Gs60czilIUGqrzKutQD6XZog3p+ko= -github.com/charmbracelet/glamour v0.6.0 h1:wi8fse3Y7nfcabbbDuwolqTqMQPMnVPeZhDM273bISc= -github.com/charmbracelet/glamour v0.6.0/go.mod h1:taqWV4swIMMbWALc0m7AfE9JkPSU8om2538k9ITBxOc= -github.com/cli/safeexec v1.0.1 h1:e/C79PbXF4yYTN/wauC4tviMxEV13BwljGj0N9j+N00= -github.com/cli/safeexec v1.0.1/go.mod h1:Z/D4tTN8Vs5gXYHDCbaM1S/anmEDnJb1iW0+EJ5zx3Q= -github.com/cncf/udpa/go v0.0.0-20220112060539-c52dc94e7fbe/go.mod h1:6pvJx4me5XPnfI9Z40ddWsdw2W/uZgQLFXToKeRcDiI= -github.com/cncf/xds/go v0.0.0-20220314180256-7f1daf1720fc/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= -github.com/cncf/xds/go v0.0.0-20230105202645-06c439db220b/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= -github.com/cncf/xds/go v0.0.0-20230310173818-32f1caf87195/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= -github.com/cncf/xds/go v0.0.0-20230428030218-4003588d1b74/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= -github.com/cncf/xds/go v0.0.0-20230607035331-e9ce68804cb4/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= -github.com/containerd/continuity v0.3.0 h1:nisirsYROK15TAMVukJOUyGJjz4BNQJBVsNvAXZJ/eg= -github.com/cpuguy83/go-md2man/v2 v2.0.2 h1:p1EgwI/C7NhT0JmVkwCD2ZBK8j4aeHQX2pMHHBfMQ6w= -github.com/cpuguy83/go-md2man/v2 v2.0.2/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o= -github.com/dlclark/regexp2 v1.4.0 h1:F1rxgk7p4uKjwIQxBs9oAXe5CqrXlCduYEJvrF4u93E= -github.com/dlclark/regexp2 v1.4.0/go.mod h1:2pZnwuY/m+8K6iRw6wQdMtk+rH5tNGR1i55kozfMjCc= -github.com/docker/cli v20.10.14+incompatible h1:dSBKJOVesDgHo7rbxlYjYsXe7gPzrTT+/cKQgpDAazg= -github.com/docker/docker v20.10.13+incompatible h1:5s7uxnKZG+b8hYWlPYUi6x1Sjpq2MSt96d15eLZeHyw= -github.com/docker/go-connections v0.4.0 h1:El9xVISelRB7BuFusrZozjnkIM5YnzCViNKohAFqRJQ= -github.com/docker/go-units v0.4.0 h1:3uh0PgVws3nIA0Q+MwDC8yjEPf9zjRfZZWXZYDct3Tw= -github.com/dustin/go-humanize v1.0.1/go.mod h1:Mu1zIs6XwVuF/gI1OepvI0qD18qycQx+mFykh5fBlto= -github.com/envoyproxy/go-control-plane v0.10.3/go.mod h1:fJJn/j26vwOu972OllsvAgJJM//w9BV6Fxbg2LuVd34= -github.com/envoyproxy/go-control-plane v0.11.0/go.mod h1:VnHyVMpzcLvCFt9yUz1UnCwHLhwx1WguiVDV7pTG/tI= -github.com/envoyproxy/go-control-plane v0.11.1-0.20230524094728-9239064ad72f/go.mod h1:sfYdkwUW4BA3PbKjySwjJy+O4Pu0h62rlqCMHNk+K+Q= -github.com/envoyproxy/go-control-plane v0.11.1/go.mod h1:uhMcXKCQMEJHiAb0w+YGefQLaTEw+YhGluxZkrTmD0g= -github.com/envoyproxy/protoc-gen-validate v0.9.1/go.mod h1:OKNgG7TCp5pF4d6XftA0++PMirau2/yoOwVac3AbF2w= -github.com/envoyproxy/protoc-gen-validate v0.10.0/go.mod h1:DRjgyB0I43LtJapqN6NiRwroiAU2PaFuvk/vjgh61ss= -github.com/envoyproxy/protoc-gen-validate v0.10.1/go.mod h1:DRjgyB0I43LtJapqN6NiRwroiAU2PaFuvk/vjgh61ss= -github.com/envoyproxy/protoc-gen-validate v1.0.1/go.mod h1:0vj8bNkYbSTNS2PIyH87KZaeN4x9zpL9Qt8fQC7d+vs= -github.com/fsnotify/fsnotify v1.6.0 h1:n+5WquG0fcWoWp6xPWfHdbskMCQaFnG6PfBrh1Ky4HY= -github.com/fsnotify/fsnotify v1.6.0/go.mod h1:sl3t1tCWJFWoRz9R8WJCbQihKKwmorjAbSClcnxKAGw= -github.com/go-fonts/liberation v0.2.0/go.mod h1:K6qoJYypsmfVjWg8KOVDQhLc8UDgIK2HYqyqAO9z7GY= -github.com/go-latex/latex v0.0.0-20210823091927-c0d11ff05a81/go.mod h1:SX0U8uGpxhq9o2S/CELCSUxEWWAuoCUcVCQWv7G2OCk= -github.com/go-openapi/analysis v0.20.0 h1:UN09o0kNhleunxW7LR+KnltD0YrJ8FF03pSqvAN3Vro= -github.com/go-openapi/errors v0.20.0 h1:Sxpo9PjEHDzhs3FbnGNonvDgWcMW2U7wGTcDDSFSceM= -github.com/go-openapi/jsonpointer v0.19.5 h1:gZr+CIYByUqjcgeLXnQu2gHYQC9o73G2XUeOFYEICuY= -github.com/go-openapi/jsonreference v0.19.5 h1:1WJP/wi4OjB4iV8KVbH73rQaoialJrqv8gitZLxGLtM= -github.com/go-openapi/loads v0.20.2 h1:z5p5Xf5wujMxS1y8aP+vxwW5qYT2zdJBbXKmQUG3lcc= -github.com/go-openapi/runtime v0.19.29 h1:5IIvCaIDbxetN674vX9eOxvoZ9mYGQ16fV1Q0VSG+NA= -github.com/go-openapi/spec v0.20.3 h1:uH9RQ6vdyPSs2pSy9fL8QPspDF2AMIMPtmK5coSSjtQ= -github.com/go-openapi/strfmt v0.20.1 h1:1VgxvehFne1mbChGeCmZ5pc0LxUf6yaACVSIYAR91Xc= -github.com/go-openapi/swag v0.19.15 h1:D2NRCBzS9/pEY3gP9Nl8aDqGUcPFrwG2p+CNFrLyrCM= -github.com/go-openapi/validate v0.20.2 h1:AhqDegYV3J3iQkMPJSXkvzymHKMTw0BST3RK3hTT4ts= -github.com/go-pdf/fpdf v0.5.0/go.mod h1:HzcnA+A23uwogo0tp9yU+l3V+KXhiESpt1PMayhOh5M= -github.com/go-pdf/fpdf v0.6.0/go.mod h1:HzcnA+A23uwogo0tp9yU+l3V+KXhiESpt1PMayhOh5M= -github.com/go-stack/stack v1.8.0 h1:5SgMzNM5HxrEjV0ww2lTmX6E2Izsfxas4+YHWRs3Lsk= -github.com/go-test/deep v1.0.4/go.mod h1:wGDj63lr65AM2AQyKZd/NYHGb0R+1RLqB8NKt3aSFNA= -github.com/goccy/go-json v0.9.11/go.mod h1:6MelG93GURQebXPDq3khkgXZkazVtN9CRI+MGFi0w8I= -github.com/gogo/protobuf v1.3.2 h1:Ov1cvc58UF3b5XjBnZv7+opcTcQFZebYjWzi34vdm4Q= -github.com/google/flatbuffers v2.0.8+incompatible/go.mod h1:1AeVuKshWv4vARoZatz6mlQ0JxURH0Kv5+zNeJKJCa8= -github.com/google/go-cmp v0.5.9/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= -github.com/google/martian/v3 v3.3.2/go.mod h1:oBOf6HBosgwRXnUGWUB05QECsc6uvmMiJ3+6W4l/CUk= -github.com/google/s2a-go v0.1.0/go.mod h1:OJpEgntRZo8ugHpF9hkoLJbS5dSI20XZeXJ9JVywLlM= -github.com/google/s2a-go v0.1.3/go.mod h1:Ej+mSEMGRnqRzjc7VtF+jdBwYG5fuJfiZ8ELkjEwM0A= -github.com/google/s2a-go v0.1.4/go.mod h1:Ej+mSEMGRnqRzjc7VtF+jdBwYG5fuJfiZ8ELkjEwM0A= -github.com/google/shlex v0.0.0-20191202100458-e7afc7fbc510 h1:El6M4kTTCOh6aBiKaUGG7oYTSPP8MxqL4YI3kZKwcP4= -github.com/googleapis/enterprise-certificate-proxy v0.1.0/go.mod h1:17drOmN3MwGY7t0e+Ei9b45FFGA3fBs3x36SsCg1hq8= -github.com/googleapis/enterprise-certificate-proxy v0.2.0/go.mod h1:8C0jb7/mgJe/9KK8Lm7X9ctZC2t60YyIpYEI16jx0Qg= -github.com/googleapis/enterprise-certificate-proxy v0.2.1/go.mod h1:AwSRAtLfXpU5Nm3pW+v7rGDHp09LsPtGY9MduiEsR9k= -github.com/googleapis/enterprise-certificate-proxy v0.2.3/go.mod h1:AwSRAtLfXpU5Nm3pW+v7rGDHp09LsPtGY9MduiEsR9k= -github.com/googleapis/gax-go/v2 v2.5.1/go.mod h1:h6B0KMMFNtI2ddbGJn3T3ZbwkeT6yqEF02fYlzkUCyo= -github.com/googleapis/gax-go/v2 v2.6.0/go.mod h1:1mjbznJAPHFpesgE5ucqfYEscaz5kMdcIDwU/6+DDoY= -github.com/googleapis/gax-go/v2 v2.7.0/go.mod h1:TEop28CZZQ2y+c0VxMUmu1lV+fQx57QpBWsYpwqHJx8= -github.com/googleapis/gax-go/v2 v2.7.1/go.mod h1:4orTrqY6hXxxaUL4LHIPl6lGo8vAE38/qKbhSAKP6QI= -github.com/googleapis/gax-go/v2 v2.8.0/go.mod h1:4orTrqY6hXxxaUL4LHIPl6lGo8vAE38/qKbhSAKP6QI= -github.com/googleapis/gax-go/v2 v2.10.0/go.mod h1:4UOEnMCrxsSqQ940WnTiD6qJ63le2ev3xfyagutxiPw= -github.com/googleapis/gax-go/v2 v2.11.0/go.mod h1:DxmR61SGKkGLa2xigwuZIQpkCI2S5iydzRfb3peWZJI= -github.com/gorilla/css v1.0.0 h1:BQqNyPTi50JCFMTw/b67hByjMVXZRwGha6wxVGkeihY= -github.com/gorilla/websocket v1.4.2 h1:+/TMaTYc4QFitKJxsQ7Yye35DkWvkdLcvGKqM+x0Ufc= +github.com/frankban/quicktest v1.14.3/go.mod h1:mgiwOwqx65TmIk1wJ6Q7wvnVMocbUorkibMOrVTHZps= +github.com/go-zookeeper/zk v1.0.2/go.mod h1:nOB03cncLtlp4t+UAkGSV+9beXP/akpekBwL+UX1Qcw= github.com/goto/salt v0.3.4-0.20230911135847-d2678dd23ab8 h1:XgsIQBxTWfMaXA6+CiRunvLSZP1cd+Phv1C04NHDmEw= github.com/goto/salt v0.3.4-0.20230911135847-d2678dd23ab8/go.mod h1:N4iZAE0TDOoo/If2EkcEwEG+LqpAQtnZ665R8+WKQjw= -github.com/grpc-ecosystem/go-grpc-middleware v1.4.0 h1:UH//fgunKIs4JdUbpDl1VZCDaL56wXCB/5+wF6uHfaI= -github.com/grpc-ecosystem/go-grpc-middleware v1.4.0/go.mod h1:g5qyo/la0ALbONm6Vbp88Yd8NsDy6rZz+RcrMPxvld8= github.com/grpc-ecosystem/grpc-gateway v1.16.0 h1:gmcG1KaJ57LophUzW0Hy8NmPhnMZb4M0+kPpLofRdBo= -github.com/grpc-ecosystem/grpc-gateway/v2 v2.7.0/go.mod h1:hgWBS7lorOAVIJEQMi4ZsPv9hVvWI6+ch50m39Pf2Ks= github.com/hashicorp/consul/api v1.18.0/go.mod h1:owRRGJ9M5xReDC5nfT8FTJrNAPbT4NM6p/k+d03q2v4= github.com/hashicorp/consul/sdk v0.13.0/go.mod h1:0hs/l5fOVhJy/VdcoaNqUSi2AUs95eF5WKtv+EYIQqE= github.com/hashicorp/go-cleanhttp v0.5.2/go.mod h1:kO/YDlP8L1346E6Sodw+PrpBSV4/SoxCXGY6BqNFT48= github.com/hashicorp/go-hclog v1.2.0/go.mod h1:whpDNt7SSdeAju8AWKIWsul05p54N/39EeqMAyrmvFQ= github.com/hashicorp/go-immutable-radix v1.3.1/go.mod h1:0y9vanUI8NX6FsYoO3zeMjhV/C5i9g4Q3DwcSNZ4P60= github.com/hashicorp/go-version v1.2.1/go.mod h1:fltr4n8CU8Ke44wwGCBoEymUuxUHl09ZGVZPK5anwXA= -github.com/hashicorp/hcl v1.0.0 h1:0Anlzjpi4vEasTeNFn2mLJgTSwt0+6sfsiTG8qcWGx4= github.com/hashicorp/mdns v1.0.4/go.mod h1:mtBihi+LeNXGtG8L9dX59gAEa12BDtBQSp4v/YAJqrc= github.com/hashicorp/memberlist v0.5.0/go.mod h1:yvyXLpo0QaGE59Y7hDTsTzDD25JYBZ4mHgHUZ8lrOI0= github.com/hashicorp/serf v0.10.1/go.mod h1:yL2t6BqATOLGc5HF7qbFkTfXoPIY0WZdWHfEvMqbG+4= -github.com/inconshreveable/mousetrap v1.0.1/go.mod h1:vpF70FUmC8bwa3OWnCshd2FqLfsEA9PFc4w1p2J65bw= -github.com/jeremywohl/flatten v1.0.1 h1:LrsxmB3hfwJuE+ptGOijix1PIfOoKLJ3Uee/mzbgtrs= -github.com/josharian/intern v1.0.0 h1:vlS4z54oSdjm0bgjRigI+G1HpF+tI+9rE5LLzOg8HmY= -github.com/jzelinskie/stringz v0.0.0-20210414224931-d6a8ce844a70 h1:thTca5Eyouk5CEcJ75Cbw9CSAGE7TAc6rIi+WgHWpOE= -github.com/klauspost/asmfmt v1.3.2/go.mod h1:AG8TuvYojzulgDAMCnYn50l/5QV3Bs/tp6j0HLHbNSE= -github.com/klauspost/compress v1.15.9/go.mod h1:PhcZ0MbTNciWF3rruxRgKxI5NkcHHrHUDtV4Yw2GlzU= -github.com/klauspost/cpuid/v2 v2.0.9/go.mod h1:FInQzS24/EEf25PyTYn52gqo7WaD8xa0213Md/qVLRg= -github.com/kr/pretty v0.3.0/go.mod h1:640gp4NfQd8pI5XOwp5fnNeVWj67G7CFk/SaSQn7NBk= -github.com/lann/builder v0.0.0-20180802200727-47ae307949d0 h1:SOEGU9fKiNWd/HOJuq6+3iTQz8KNCLtVX6idSoTLdUw= -github.com/lann/ps v0.0.0-20150810152359-62de8c46ede0 h1:P6pPBnrTSX3DEVR4fDembhRWSsG5rVo6hYhAB/ADZrk= -github.com/lib/pq v1.10.7/go.mod h1:AlVN5x4E4T544tWzH6hKfbfQvm3HdbOxrmggDNAPY9o= -github.com/lucasb-eyer/go-colorful v1.2.0 h1:1nnpGOrhyZZuNyfu1QjKiUICQ74+3FNCN69Aj6K7nkY= -github.com/lyft/protoc-gen-star/v2 v2.0.1/go.mod h1:RcCdONR2ScXaYnQC5tUzxzlpA3WVYF7/opLeUgcQs/o= -github.com/lyft/protoc-gen-star/v2 v2.0.3/go.mod h1:amey7yeodaJhXSbf/TlLvWiqQfLOSpEk//mLlc+axEk= -github.com/magiconair/properties v1.8.7 h1:IeQXZAiQcpL9mgcAe1Nu6cX9LLw6ExEHKjN0VQdvPDY= -github.com/magiconair/properties v1.8.7/go.mod h1:Dhd985XPs7jluiymwWYZ0G4Z61jb3vdS329zhj2hYo0= -github.com/mailru/easyjson v0.7.7 h1:UGYAvKxe3sBsEDzO8ZeWOSlIQfWFlxbzLZe7hwFURr0= -github.com/mailru/easyjson v0.7.7/go.mod h1:xzfreul335JAWq5oZzymOObrkdz5UnU4kGfJJLY9Nlc= -github.com/mattn/go-isatty v0.0.17/go.mod h1:kYGgaQfpe5nmfYZH+SKPsOc2e4SrIfOl2e/yFXSvRLM= -github.com/mattn/go-runewidth v0.0.12/go.mod h1:RAqKPSqVFrSLVXbA8x7dzmKdmGzieGRCM46jaSJTDAk= -github.com/mattn/go-runewidth v0.0.14 h1:+xnbZSEeDbOIg5/mE6JF0w6n9duR1l3/WmbinWVwUuU= -github.com/mattn/go-runewidth v0.0.14/go.mod h1:Jdepj2loyihRzMpdS35Xk/zdY8IAYHsh153qUoGf23w= -github.com/mattn/go-sqlite3 v1.14.14/go.mod h1:NyWgC/yNuGj7Q9rpYnZvas74GogHl5/Z4A/KQRfk6bU= -github.com/mattn/go-sqlite3 v1.14.15/go.mod h1:2eHXhiwb8IkHr+BDWZGa96P6+rkvnG63S2DGjv9HUNg= -github.com/microcosm-cc/bluemonday v1.0.21 h1:dNH3e4PSyE4vNX+KlRGHT5KrSvjeUkoNPwEORjffHJg= -github.com/microcosm-cc/bluemonday v1.0.21/go.mod h1:ytNkv4RrDrLJ2pqlsSI46O6IVXmZOBBD4SaJyDwwTkM= +github.com/jhump/protoreflect v1.15.1/go.mod h1:jD/2GMKKE6OqX8qTjhADU1e6DShO+gavG9e0Q693nKo= github.com/miekg/dns v1.1.41/go.mod h1:p6aan82bvRIyn+zDIv9xYNUpwa73JcSh9BKwknJysuI= -github.com/minio/asm2plan9s v0.0.0-20200509001527-cdd76441f9d8/go.mod h1:mC1jAcsrzbxHt8iiaC+zU4b1ylILSosueou12R++wfY= -github.com/minio/c2goasm v0.0.0-20190812172519-36a3d3bbc4f3/go.mod h1:RagcQ7I8IeTMnF8JTXieKnO4Z6JCsikNEzj0DwauVzE= -github.com/mitchellh/colorstring v0.0.0-20190213212951-d06e56a500db h1:62I3jR2EmQ4l5rM/4FEfDWcRD+abF5XlKShorW5LRoQ= -github.com/moby/term v0.0.0-20210619224110-3f7ff695adc6 h1:dcztxKSvZ4Id8iPpHERQBbIJfabdt4wUm5qy3wOL2Zc= -github.com/muesli/reflow v0.3.0 h1:IFsN6K9NfGtjeggFP+68I4chLZV2yIKsXJFNZ+eWh6s= -github.com/muesli/reflow v0.3.0/go.mod h1:pbwTDkVPibjO2kyvBQRBxTWEEGDGq0FlB1BIKtnHY/8= -github.com/muesli/termenv v0.13.0/go.mod h1:sP1+uffeLaEYpyOTb8pLCUctGcGLnoFjSn4YJK5e2bc= -github.com/muesli/termenv v0.14.0 h1:8x9NFfOe8lmIWK4pgy3IfVEy47f+ppe3tUqdPZG2Uy0= -github.com/muesli/termenv v0.14.0/go.mod h1:kG/pF1E7fh949Xhe156crRUrHNyK221IuGO7Ez60Uc8= -github.com/newrelic/go-agent/v3/integrations/nrgrpc v1.3.2 h1:SBtZAkWapxfAxYVZHagHxsrbRt+ULkgxi0mbn6TMRM8= -github.com/newrelic/go-agent/v3/integrations/nrgrpc v1.3.2/go.mod h1:h5GGcju9OuzmRdKa5glKh/SrMs1HhZyvXrf0mEPv70k= -github.com/olekukonko/tablewriter v0.0.5 h1:P2Ga83D34wi1o9J6Wh1mRuqd4mF/x/lgBS7N7AbDhec= -github.com/opencontainers/go-digest v1.0.0 h1:apOUWs51W5PlhuyGyz9FCeeBIOUDA/6nW8Oi/yOhh5U= -github.com/opencontainers/image-spec v1.0.2 h1:9yCKha/T5XdGtO0q9Q9a6T5NUCsTn/DrBg0D7ufOcFM= -github.com/opencontainers/runc v1.1.2 h1:2VSZwLx5k/BfsBxMMipG/LYUnmqOD/BPkIVgQUcTlLw= -github.com/ory/dockertest/v3 v3.9.1 h1:v4dkG+dlu76goxMiTT2j8zV7s4oPPEppKT8K8p2f1kY= github.com/pelletier/go-toml v1.9.3 h1:zeC5b1GviRUyKYd6OJPvBU/mcVDVoL1OhT17FCt5dSQ= -github.com/pelletier/go-toml/v2 v2.0.6 h1:nrzqCb7j9cDFj2coyLNLaZuJTLjWjlaz6nvTvIwycIU= -github.com/pelletier/go-toml/v2 v2.0.6/go.mod h1:eumQOmlWiOPt5WriQQqoM5y18pDHwha2N+QD+EUNTek= -github.com/phpdave11/gofpdi v1.0.13/go.mod h1:vBmVV0Do6hSBHC8uKUQ71JGW+ZGQq74llk/7bXwjDoI= -github.com/pierrec/lz4/v4 v4.1.15/go.mod h1:gZWDp/Ze/IJXGXf23ltt2EXimqmTUXEy0GFuRQyBid4= -github.com/pkg/diff v0.0.0-20210226163009-20ebb0f2a09e/go.mod h1:pJLUxLENpZxwdsKMEsNbx1VGcRFpLqf3715MtcvvzbA= github.com/prometheus/client_golang v1.11.1/go.mod h1:Z6t4BnS23TR94PD6BsDNk8yVqroYurpAkEiz0P2BEV0= -github.com/prometheus/client_model v0.3.0/go.mod h1:LDGWKZIo7rky3hgvBe+caln+Dr3dPggB5dvjtD7w9+w= -github.com/remyoudompheng/bigfft v0.0.0-20230129092748-24d4a6f8daec/go.mod h1:qqbHyh8v60DhA7CoWK5oRCqLrMHRGoxYCSS9EjAz6Eo= -github.com/rivo/uniseg v0.4.3 h1:utMvzDsuh3suAEnhH0RdHmoPbU648o6CvXxTx4SBMOw= -github.com/rivo/uniseg v0.4.3/go.mod h1:FN3SvrM+Zdj16jyLfmOkMNblXMcoc8DfTHruCPUcx88= -github.com/rogpeppe/go-internal v1.6.1/go.mod h1:xXDCJY+GAPziupqXw64V24skbSoqbTEfhy4qGm1nDQc= -github.com/rogpeppe/go-internal v1.9.0/go.mod h1:WtVeX8xhTBvf0smdhujwtBcq4Qrzq/fJaraNFVN+nFs= -github.com/russross/blackfriday/v2 v2.1.0 h1:JIOH55/0cWyOuilr9/qlrm0BSXldqnqwMsf35Ld67mk= -github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= -github.com/ruudk/golang-pdf417 v0.0.0-20201230142125-a7e3863a1245/go.mod h1:pQAZKsJ8yyVxGRWYNEm9oFB8ieLgKFnamEyDmSA0BRk= github.com/sagikazarmark/crypt v0.9.0/go.mod h1:RnH7sEhxfdnPm1z+XMgSLjWTEIjyK4z2dw6+4vHTMuo= -github.com/schollz/progressbar/v3 v3.13.0 h1:9TeeWRcjW2qd05I8Kf9knPkW4vLM/hYoa6z9ABvxje8= -github.com/schollz/progressbar/v3 v3.13.0/go.mod h1:ZBYnSuLAX2LU8P8UiKN/KgF2DY58AJC8yfVYLPC8Ly4= -github.com/slack-go/slack v0.11.0 h1:sBBjQz8LY++6eeWhGJNZpRm5jvLRNnWBFZ/cAq58a6k= -github.com/slack-go/slack v0.11.0/go.mod h1:hlGi5oXA+Gt+yWTPP0plCdRKmjsDxecdHxYQdlMQKOw= -github.com/spf13/afero v1.9.3 h1:41FoI0fD7OR7mGcKE/aOiLkGreyf8ifIOQmJANWogMk= -github.com/spf13/afero v1.9.3/go.mod h1:iUV7ddyEEZPO5gA3zD4fJt6iStLlL+Lg4m2cihcDf8Y= -github.com/spf13/cobra v1.6.1 h1:o94oiPyS4KD1mPy2fmcYYHHfCxLqYjJOhGsCHFZtEzA= -github.com/spf13/cobra v1.6.1/go.mod h1:IOw/AERYS7UzyrGinqmz6HLUo219MORXGxhbaJUqzrY= -github.com/spf13/jwalterweatherman v1.1.0 h1:ue6voC5bR5F8YxI5S67j9i582FU4Qvo2bmqnqMYADFk= -github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA= -github.com/spf13/viper v1.15.0 h1:js3yy885G8xwJa6iOISGFwd+qlUo5AvyXb7CiihdtiU= -github.com/spf13/viper v1.15.0/go.mod h1:fFcTBJxvhhzSJiZy8n+PeW6t8l+KeT/uTARa0jHOQLA= -github.com/stretchr/testify v1.8.2/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4= -github.com/stretchr/testify v1.8.4 h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcUk= -github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo= -github.com/subosito/gotenv v1.4.2 h1:X1TuBLAMDFbaTAChgCBLu3DU3UPyELpnF2jjJ2cz/S8= -github.com/subosito/gotenv v1.4.2/go.mod h1:ayKnFf/c6rvx/2iiLrJUk1e6plDbT3edrFNGqEflhK0= -github.com/tidwall/pretty v1.2.0/go.mod h1:ITEVvHYasfjBbM0u2Pg8T2nJnzm8xPwvNhhsoaGGjNU= -github.com/xeipuuv/gojsonpointer v0.0.0-20190905194746-02993c407bfb h1:zGWFAtiMcyryUHoUjUJX0/lt1H2+i2Ka2n+D3DImSNo= -github.com/xeipuuv/gojsonpointer v0.0.0-20190905194746-02993c407bfb/go.mod h1:N2zxlSyiKSe5eX1tZViRH5QA0qijqEDrYZiPEAiq3wU= -github.com/xeipuuv/gojsonreference v0.0.0-20180127040603-bd5ef7bd5415 h1:EzJWgHovont7NscjpAxXsDA8S8BMYve8Y5+7cuRE7R0= -github.com/xeipuuv/gojsonschema v1.2.0 h1:LhYJRs+L4fBtjZUfuSZIKGeVu0QRy8e5Xi7D17UxZ74= -github.com/yuin/goldmark v1.4.1/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k= -github.com/yuin/goldmark v1.5.2 h1:ALmeCk/px5FSm1MAcFBAsVKZjDuMVj8Tm7FFIlMJnqU= -github.com/yuin/goldmark v1.5.2/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY= -github.com/yuin/goldmark-emoji v1.0.1 h1:ctuWEyzGBwiucEqxzwe0SOYDXPAucOrE9NQC18Wa1os= -github.com/zeebo/assert v1.3.0/go.mod h1:Pq9JiuJQpG8JLJdtkwrJESF0Foym2/D9XMU5ciN/wJ0= -github.com/zeebo/xxh3 v1.0.2/go.mod h1:5NWz9Sef7zIDm2JHfFlcQvNekmcEl9ekUZQQKCYaDcA= go.etcd.io/etcd/api/v3 v3.5.6/go.mod h1:KFtNaxGDw4Yx/BA4iPPwevUTAuqcsPxzyX8PHydchN8= go.etcd.io/etcd/client/pkg/v3 v3.5.6/go.mod h1:ggrwbk069qxpKPq8/FKkQ3Xq9y39kbFR4LnKszpRXeQ= go.etcd.io/etcd/client/v2 v2.305.6/go.mod h1:BHha8XJGe8vCIBfWBpbBLVZ4QjOIlfoouvOwydu63E0= go.etcd.io/etcd/client/v3 v3.5.6/go.mod h1:f6GRinRMCsFVv9Ht42EyY7nfsVGwrNO0WEoS2pRKzQk= -go.mongodb.org/mongo-driver v1.7.0 h1:hHrvOBWlWB2c7+8Gh/Xi5jj82AgidK/t7KVXBZ+IyUA= -go.opentelemetry.io/proto/otlp v0.15.0/go.mod h1:H7XAot3MsfNsj7EXtrA2q5xSNQ10UqI405h3+duxN4U= -go.opentelemetry.io/proto/otlp v0.19.0/go.mod h1:H7XAot3MsfNsj7EXtrA2q5xSNQ10UqI405h3+duxN4U= go.uber.org/goleak v1.1.11/go.mod h1:cwTWslyiVhfpKIDGSZEM2HlOvcqm+tG4zioyIeLoqMQ= -go.uber.org/zap v1.18.1/go.mod h1:xg/QME4nWcxGxrpdeYfq7UvYrLh66cuVKdrbD1XF/NI= go.uber.org/zap v1.21.0/go.mod h1:wjWOCqI0f2ZZrJF/UufIOkiC8ii6tm1iqIsLo76RfJw= -golang.org/x/crypto v0.0.0-20220314234659-1baeb1ce4c0b/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= golang.org/x/crypto v0.0.0-20220525230936-793ad666bf5e/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= -golang.org/x/crypto v0.1.0/go.mod h1:RecgLatLF4+eUMCP1PoPZQb+cVrJcOPbHkTkbkB9sbw= -golang.org/x/crypto v0.7.0/go.mod h1:pYwdfH91IfpZVANVyUOhSIPZaFoJGxTFbZhFTx+dXZU= -golang.org/x/crypto v0.9.0/go.mod h1:yrmDGqONDYtNj3tH8X9dzUun2m2lzPa9ngI6/RUPGR0= -golang.org/x/crypto v0.10.0/go.mod h1:o4eNf7Ede1fv+hwOwZsTHl9EsPFO6q6ZvYR8vYfY45I= -golang.org/x/crypto v0.11.0/go.mod h1:xgJhtzW8F9jGdVFWZESrid1U1bjeNy4zgy5cRr/CIio= -golang.org/x/exp v0.0.0-20220827204233-334a2380cb91/go.mod h1:cyybsKvd6eL0RnXn6p/Grxp8F5bW7iYuBgsNCOHpMYE= -golang.org/x/image v0.0.0-20210607152325-775e3b0c77b9/go.mod h1:023OzeP/+EPmXeapQh35lcL3II3LrY8Ic+EFFKVhULM= -golang.org/x/image v0.0.0-20210628002857-a66eb6448b8d/go.mod h1:023OzeP/+EPmXeapQh35lcL3II3LrY8Ic+EFFKVhULM= -golang.org/x/image v0.0.0-20211028202545-6944b10bf410/go.mod h1:023OzeP/+EPmXeapQh35lcL3II3LrY8Ic+EFFKVhULM= -golang.org/x/image v0.0.0-20220302094943-723b81ca9867/go.mod h1:023OzeP/+EPmXeapQh35lcL3II3LrY8Ic+EFFKVhULM= -golang.org/x/mod v0.5.1/go.mod h1:5OXOZSfqPIIbmVBIIKWRFfZjPR0E5r58TLhUjH0a2Ro= -golang.org/x/mod v0.7.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= -golang.org/x/mod v0.8.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= -golang.org/x/mod v0.9.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= -golang.org/x/mod v0.10.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= -golang.org/x/mod v0.11.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= golang.org/x/net v0.0.0-20210410081132-afb366fc7cd1/go.mod h1:9tjilg8BloeKEkVJvy7fQ90B1CfIiPueXVOjqfkSzI8= -golang.org/x/net v0.0.0-20211015210444-4f30a5c0130f/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= -golang.org/x/net v0.0.0-20220617184016-355a448f1bc9/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= -golang.org/x/net v0.0.0-20220909164309-bea034e7d591/go.mod h1:YDH+HFinaLZZlnHAfSS6ZXJJ9M9t4Dl22yv3iI2vPwk= -golang.org/x/net v0.0.0-20221002022538-bcab6841153b/go.mod h1:YDH+HFinaLZZlnHAfSS6ZXJJ9M9t4Dl22yv3iI2vPwk= -golang.org/x/net v0.0.0-20221012135044-0b7e1fb9d458/go.mod h1:YDH+HFinaLZZlnHAfSS6ZXJJ9M9t4Dl22yv3iI2vPwk= -golang.org/x/net v0.0.0-20221014081412-f15817d10f9b/go.mod h1:YDH+HFinaLZZlnHAfSS6ZXJJ9M9t4Dl22yv3iI2vPwk= -golang.org/x/net v0.1.0/go.mod h1:Cx3nUiGt4eDBEyega/BKRp+/AlGL8hYe7U9odMt2Cco= -golang.org/x/net v0.4.0/go.mod h1:MBQ8lrhLObU/6UmLb4fmbmk5OcyYmqtbGd/9yIeKjEE= -golang.org/x/net v0.5.0/go.mod h1:DivGGAXEgPSlEBzxGzZI+ZLohi+xUj054jfeKui00ws= -golang.org/x/net v0.6.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs= -golang.org/x/net v0.7.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs= -golang.org/x/net v0.8.0/go.mod h1:QVkue5JL9kW//ek3r6jTKnTFis1tRmNAW2P1shuFdJc= -golang.org/x/net v0.9.0/go.mod h1:d48xBJpPfHeWQsugry2m+kC02ZBRGRgulfHnEXEuWns= -golang.org/x/net v0.10.0/go.mod h1:0qNGK6F8kojg2nk9dLZ2mShWaEBan6FAoqfSigmmuDg= -golang.org/x/net v0.11.0/go.mod h1:2L/ixqYpgIVXmeoSA/4Lu7BzTG4KIyPIryS4IsOd1oQ= -golang.org/x/net v0.12.0/go.mod h1:zEVYFnQC7m/vmpQFELhcD1EWkZlX69l4oqgmer6hfKA= -golang.org/x/oauth2 v0.0.0-20220622183110-fd043fe589d2/go.mod h1:jaDAt6Dkxork7LmZnYtzbRWj0W47D86a3TGe0YHBvmE= -golang.org/x/oauth2 v0.0.0-20221006150949-b44042a4b9c1/go.mod h1:h4gKUeWbJ4rQPri7E0u6Gs4e9Ri2zaLxzw5DI5XGrYg= -golang.org/x/oauth2 v0.0.0-20221014153046-6fdb5e3db783/go.mod h1:h4gKUeWbJ4rQPri7E0u6Gs4e9Ri2zaLxzw5DI5XGrYg= -golang.org/x/oauth2 v0.4.0/go.mod h1:RznEsdpjGAINPTOF0UH/t+xJ75L18YO3Ho6Pyn+uRec= -golang.org/x/oauth2 v0.5.0/go.mod h1:9/XBHVqLaWO3/BRHs5jbpYCnOZVjj5V0ndyaAM7KB4I= -golang.org/x/oauth2 v0.6.0/go.mod h1:ycmewcwgD4Rpr3eZJLSB4Kyyljb3qDh40vJ8STE5HKw= -golang.org/x/oauth2 v0.7.0/go.mod h1:hPLQkd9LyjfXTiRohC/41GhcFqxisoUQ99sCUOHO9x4= -golang.org/x/oauth2 v0.8.0/go.mod h1:yr7u4HXZRm1R1kBWqr/xKNqewf0plRYoB7sla+BCIXE= -golang.org/x/sync v0.0.0-20220819030929-7fc1605a5dde/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20220929204114-8fcdb60fdcc0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.1.0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.2.0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sys v0.0.0-20210303074136-134d130e1a04/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20211007075335-d3039528d8ac/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20211019181941-9d821ace8654/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20220615213510-4f61da869c0c/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20220624220833-87e55d714810/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20220829200755-d48e67d00261/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20220908164124-27713097b956/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.1.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.3.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.4.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.7.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.8.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.9.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.10.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/term v0.1.0/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= -golang.org/x/term v0.3.0/go.mod h1:q750SLmJuPmVoN1blW3UFBPREJfb1KmY3vwxfr+nFDA= -golang.org/x/term v0.4.0/go.mod h1:9P2UbLfCdcvo3p/nzKvsmas4TnlujnuoV9hGgYzW1lQ= -golang.org/x/term v0.5.0/go.mod h1:jMB1sMXY+tzblOD4FWmEbocvup2/aLOaQEp7JmGp78k= -golang.org/x/term v0.6.0/go.mod h1:m6U89DPEgQRMq3DNkDClhWw02AUbt2daBVO4cn4Hv9U= -golang.org/x/term v0.7.0/go.mod h1:P32HKFT3hSsZrRxla30E9HqToFYAQPCMs/zFMBUFqPY= -golang.org/x/term v0.8.0/go.mod h1:xPskH00ivmX89bAKVGSKKtLOWNx2+17Eiy94tnKShWo= -golang.org/x/term v0.9.0/go.mod h1:M6DEAAIenWoTxdKrOltXcmDY3rSplQUkrvaDU5FcQyo= -golang.org/x/term v0.10.0/go.mod h1:lpqdcUyK/oCiQxvxVrppt5ggO2KCZ5QblwqPnfZ6d5o= -golang.org/x/term v0.12.0 h1:/ZfYdc3zq+q02Rv9vGqTeSItdzZTSNDmfTi0mBAuidU= -golang.org/x/term v0.12.0/go.mod h1:owVbMEjm3cBLCHdkQu9b1opXd4ETQWc3BhuQGKgXgvU= -golang.org/x/text v0.3.8/go.mod h1:E6s5w1FMmriuDzIBO73fBruAKo1PCIq6d2Q6DHfQ8WQ= -golang.org/x/text v0.5.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= -golang.org/x/text v0.6.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= -golang.org/x/text v0.7.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= -golang.org/x/text v0.8.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8= -golang.org/x/text v0.9.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8= -golang.org/x/text v0.10.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE= -golang.org/x/text v0.11.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE= -golang.org/x/time v0.0.0-20220922220347-f3bd1da661af/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= -golang.org/x/time v0.1.0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= -golang.org/x/time v0.3.0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= -golang.org/x/tools v0.1.9/go.mod h1:nABZi5QlRsZVlzPpHl034qft6wpY4eDcsTt5AaioBiU= -golang.org/x/tools v0.3.0/go.mod h1:/rWhSS2+zyEVwoJf8YAX6L2f0ntZ7Kn/mGgAWcipA5k= -golang.org/x/tools v0.6.0/go.mod h1:Xwgl3UAJ/d3gWutnCtw505GrjyAbvKui8lOU390QaIU= -golang.org/x/tools v0.7.0/go.mod h1:4pg6aUX35JBAogB10C9AtvVL+qowtN4pT3CGSQex14s= -golang.org/x/tools v0.8.0/go.mod h1:JxBZ99ISMI5ViVkT1tr6tdNmXeTrcpVSD3vZ1RsRdN4= -golang.org/x/tools v0.9.1/go.mod h1:owI94Op576fPu3cIGQeHs3joujW/2Oc6MtlxbF5dfNc= -golang.org/x/tools v0.10.0/go.mod h1:UJwyiVBsOA2uwvK/e5OY3GTpDUJriEd+/YlqAwLPmyM= -golang.org/x/xerrors v0.0.0-20220907171357-04be3eba64a2/go.mod h1:K8+ghG5WaK9qNqU5K3HdILfMLy1f3aNYFI/wnl100a8= -gonum.org/v1/gonum v0.11.0/go.mod h1:fSG4YDCxxUZQJ7rKsQrj0gMOg00Il0Z96/qMA4bVQhA= -gonum.org/v1/plot v0.10.1/go.mod h1:VZW5OlhkL1mysU9vaqNHnsy86inf6Ot+jB3r+BczCEo= -google.golang.org/api v0.77.0/go.mod h1:pU9QmyHLnzlpar1Mjt4IbapUCy8J+6HD6GeELN69ljA= -google.golang.org/api v0.85.0/go.mod h1:AqZf8Ep9uZ2pyTvgL+x0D3Zt0eoT9b5E8fmzfu6FO2g= -google.golang.org/api v0.90.0/go.mod h1:+Sem1dnrKlrXMR/X0bPnMWyluQe4RsNoYfmNLhOIkzw= -google.golang.org/api v0.93.0/go.mod h1:+Sem1dnrKlrXMR/X0bPnMWyluQe4RsNoYfmNLhOIkzw= -google.golang.org/api v0.95.0/go.mod h1:eADj+UBuxkh5zlrSntJghuNeg8HwQ1w5lTKkuqaETEI= -google.golang.org/api v0.96.0/go.mod h1:w7wJQLTM+wvQpNf5JyEcBoxK0RH7EDrh/L4qfsuJ13s= -google.golang.org/api v0.97.0/go.mod h1:w7wJQLTM+wvQpNf5JyEcBoxK0RH7EDrh/L4qfsuJ13s= -google.golang.org/api v0.98.0/go.mod h1:w7wJQLTM+wvQpNf5JyEcBoxK0RH7EDrh/L4qfsuJ13s= -google.golang.org/api v0.99.0/go.mod h1:1YOf74vkVndF7pG6hIHuINsM7eWwpVTAfNMNiL91A08= -google.golang.org/api v0.100.0/go.mod h1:ZE3Z2+ZOr87Rx7dqFsdRQkRBk36kDtp/h+QpHbB7a70= -google.golang.org/api v0.102.0/go.mod h1:3VFl6/fzoA+qNuS1N1/VfXY4LjoXN/wzeIp7TweWwGo= -google.golang.org/api v0.103.0/go.mod h1:hGtW6nK1AC+d9si/UBhw8Xli+QMOf6xyNAyJw4qU9w0= -google.golang.org/api v0.106.0/go.mod h1:2Ts0XTHNVWxypznxWOYUeI4g3WdP9Pk2Qk58+a/O9MY= -google.golang.org/api v0.107.0/go.mod h1:2Ts0XTHNVWxypznxWOYUeI4g3WdP9Pk2Qk58+a/O9MY= -google.golang.org/api v0.108.0/go.mod h1:2Ts0XTHNVWxypznxWOYUeI4g3WdP9Pk2Qk58+a/O9MY= -google.golang.org/api v0.111.0/go.mod h1:qtFHvU9mhgTJegR31csQ+rwxyUTHOKFqCKWp1J0fdw0= -google.golang.org/api v0.114.0/go.mod h1:ifYI2ZsFK6/uGddGfAD5BMxlnkBqCmqHSDUVi45N5Yg= -google.golang.org/api v0.118.0/go.mod h1:76TtD3vkgmZ66zZzp72bUUklpmQmKlhh6sYtIjYK+5E= -google.golang.org/api v0.122.0/go.mod h1:gcitW0lvnyWjSp9nKxAbdHKIZ6vF4aajGueeslZOyms= -google.golang.org/api v0.124.0/go.mod h1:xu2HQurE5gi/3t1aFCvhPD781p0a3p11sdunTJ2BlP4= -google.golang.org/api v0.125.0/go.mod h1:mBwVAtz+87bEN6CbA1GtZPDOqY2R5ONPqJeIlvyo4Aw= -google.golang.org/api v0.126.0 h1:q4GJq+cAdMAC7XP7njvQ4tvohGLiSlytuL4BQxbIZ+o= -google.golang.org/api v0.126.0/go.mod h1:mBwVAtz+87bEN6CbA1GtZPDOqY2R5ONPqJeIlvyo4Aw= -google.golang.org/genproto v0.0.0-20220329172620-7be39ac1afc7/go.mod h1:8w6bsBMX6yCPbAVTeqQHvzxW0EIFigd5lZyahWgyfDo= -google.golang.org/genproto v0.0.0-20220502173005-c8bf987b8c21/go.mod h1:RAyBrSAP7Fh3Nc84ghnVLDPuV51xc9agzmm4Ph6i0Q4= -google.golang.org/genproto v0.0.0-20220617124728-180714bec0ad/go.mod h1:KEWEmljWE5zPzLBa/oHl6DaEt9LmfH6WtH1OHIvleBA= -google.golang.org/genproto v0.0.0-20220624142145-8cd45d7dbd1f/go.mod h1:KEWEmljWE5zPzLBa/oHl6DaEt9LmfH6WtH1OHIvleBA= -google.golang.org/genproto v0.0.0-20220628213854-d9e0b6570c03/go.mod h1:KEWEmljWE5zPzLBa/oHl6DaEt9LmfH6WtH1OHIvleBA= -google.golang.org/genproto v0.0.0-20220722212130-b98a9ff5e252/go.mod h1:GkXuJDJ6aQ7lnJcRF+SJVgFdQhypqgl3LB1C9vabdRE= -google.golang.org/genproto v0.0.0-20220801145646-83ce21fca29f/go.mod h1:iHe1svFLAZg9VWz891+QbRMwUv9O/1Ww+/mngYeThbc= -google.golang.org/genproto v0.0.0-20220815135757-37a418bb8959/go.mod h1:dbqgFATTzChvnt+ujMdZwITVAJHFtfyN1qUhDqEiIlk= -google.golang.org/genproto v0.0.0-20220817144833-d7fd3f11b9b1/go.mod h1:dbqgFATTzChvnt+ujMdZwITVAJHFtfyN1qUhDqEiIlk= -google.golang.org/genproto v0.0.0-20220829144015-23454907ede3/go.mod h1:dbqgFATTzChvnt+ujMdZwITVAJHFtfyN1qUhDqEiIlk= -google.golang.org/genproto v0.0.0-20220829175752-36a9c930ecbf/go.mod h1:dbqgFATTzChvnt+ujMdZwITVAJHFtfyN1qUhDqEiIlk= -google.golang.org/genproto v0.0.0-20220913154956-18f8339a66a5/go.mod h1:0Nb8Qy+Sk5eDzHnzlStwW3itdNaWoZA5XeSG+R3JHSo= -google.golang.org/genproto v0.0.0-20220914142337-ca0e39ece12f/go.mod h1:0Nb8Qy+Sk5eDzHnzlStwW3itdNaWoZA5XeSG+R3JHSo= -google.golang.org/genproto v0.0.0-20220915135415-7fd63a7952de/go.mod h1:0Nb8Qy+Sk5eDzHnzlStwW3itdNaWoZA5XeSG+R3JHSo= -google.golang.org/genproto v0.0.0-20220916172020-2692e8806bfa/go.mod h1:0Nb8Qy+Sk5eDzHnzlStwW3itdNaWoZA5XeSG+R3JHSo= -google.golang.org/genproto v0.0.0-20220919141832-68c03719ef51/go.mod h1:0Nb8Qy+Sk5eDzHnzlStwW3itdNaWoZA5XeSG+R3JHSo= -google.golang.org/genproto v0.0.0-20220920201722-2b89144ce006/go.mod h1:ht8XFiar2npT/g4vkk7O0WYS1sHOHbdujxbEp7CJWbw= -google.golang.org/genproto v0.0.0-20220926165614-551eb538f295/go.mod h1:woMGP53BroOrRY3xTxlbr8Y3eB/nzAvvFM83q7kG2OI= -google.golang.org/genproto v0.0.0-20220926220553-6981cbe3cfce/go.mod h1:woMGP53BroOrRY3xTxlbr8Y3eB/nzAvvFM83q7kG2OI= -google.golang.org/genproto v0.0.0-20221010155953-15ba04fc1c0e/go.mod h1:3526vdqwhZAwq4wsRUaVG555sVgsNmIjRtO7t/JH29U= -google.golang.org/genproto v0.0.0-20221014173430-6e2ab493f96b/go.mod h1:1vXfmgAz9N9Jx0QA82PqRVauvCz1SGSz739p0f183jM= -google.golang.org/genproto v0.0.0-20221014213838-99cd37c6964a/go.mod h1:1vXfmgAz9N9Jx0QA82PqRVauvCz1SGSz739p0f183jM= -google.golang.org/genproto v0.0.0-20221024153911-1573dae28c9c/go.mod h1:9qHF0xnpdSfF6knlcsnpzUu5y+rpwgbvsyGAZPBMg4s= -google.golang.org/genproto v0.0.0-20221024183307-1bc688fe9f3e/go.mod h1:9qHF0xnpdSfF6knlcsnpzUu5y+rpwgbvsyGAZPBMg4s= -google.golang.org/genproto v0.0.0-20221027153422-115e99e71e1c/go.mod h1:CGI5F/G+E5bKwmfYo09AXuVN4dD894kIKUFmVbP2/Fo= -google.golang.org/genproto v0.0.0-20221109142239-94d6d90a7d66/go.mod h1:rZS5c/ZVYMaOGBfO68GWtjOw/eLaZM1X6iVtgjZ+EWg= -google.golang.org/genproto v0.0.0-20221114212237-e4508ebdbee1/go.mod h1:rZS5c/ZVYMaOGBfO68GWtjOw/eLaZM1X6iVtgjZ+EWg= -google.golang.org/genproto v0.0.0-20221117204609-8f9c96812029/go.mod h1:rZS5c/ZVYMaOGBfO68GWtjOw/eLaZM1X6iVtgjZ+EWg= -google.golang.org/genproto v0.0.0-20221118155620-16455021b5e6/go.mod h1:rZS5c/ZVYMaOGBfO68GWtjOw/eLaZM1X6iVtgjZ+EWg= -google.golang.org/genproto v0.0.0-20221201164419-0e50fba7f41c/go.mod h1:rZS5c/ZVYMaOGBfO68GWtjOw/eLaZM1X6iVtgjZ+EWg= -google.golang.org/genproto v0.0.0-20221201204527-e3fa12d562f3/go.mod h1:rZS5c/ZVYMaOGBfO68GWtjOw/eLaZM1X6iVtgjZ+EWg= -google.golang.org/genproto v0.0.0-20221202195650-67e5cbc046fd/go.mod h1:cTsE614GARnxrLsqKREzmNYJACSWWpAWdNMwnD7c2BE= -google.golang.org/genproto v0.0.0-20221227171554-f9683d7f8bef/go.mod h1:RGgjbofJ8xD9Sq1VVhDM1Vok1vRONV+rg+CjzG4SZKM= -google.golang.org/genproto v0.0.0-20230110181048-76db0878b65f/go.mod h1:RGgjbofJ8xD9Sq1VVhDM1Vok1vRONV+rg+CjzG4SZKM= -google.golang.org/genproto v0.0.0-20230112194545-e10362b5ecf9/go.mod h1:RGgjbofJ8xD9Sq1VVhDM1Vok1vRONV+rg+CjzG4SZKM= -google.golang.org/genproto v0.0.0-20230113154510-dbe35b8444a5/go.mod h1:RGgjbofJ8xD9Sq1VVhDM1Vok1vRONV+rg+CjzG4SZKM= -google.golang.org/genproto v0.0.0-20230123190316-2c411cf9d197/go.mod h1:RGgjbofJ8xD9Sq1VVhDM1Vok1vRONV+rg+CjzG4SZKM= -google.golang.org/genproto v0.0.0-20230124163310-31e0e69b6fc2/go.mod h1:RGgjbofJ8xD9Sq1VVhDM1Vok1vRONV+rg+CjzG4SZKM= -google.golang.org/genproto v0.0.0-20230125152338-dcaf20b6aeaa/go.mod h1:RGgjbofJ8xD9Sq1VVhDM1Vok1vRONV+rg+CjzG4SZKM= -google.golang.org/genproto v0.0.0-20230127162408-596548ed4efa/go.mod h1:RGgjbofJ8xD9Sq1VVhDM1Vok1vRONV+rg+CjzG4SZKM= -google.golang.org/genproto v0.0.0-20230209215440-0dfe4f8abfcc/go.mod h1:RGgjbofJ8xD9Sq1VVhDM1Vok1vRONV+rg+CjzG4SZKM= -google.golang.org/genproto v0.0.0-20230216225411-c8e22ba71e44/go.mod h1:8B0gmkoRebU8ukX6HP+4wrVQUY1+6PkQ44BSyIlflHA= google.golang.org/genproto v0.0.0-20230221151758-ace64dc21148/go.mod h1:3Dl5ZL0q0isWJt+FVcfpQyirqemEuLAK/iFvg1UP1Hw= -google.golang.org/genproto v0.0.0-20230222225845-10f96fb3dbec/go.mod h1:3Dl5ZL0q0isWJt+FVcfpQyirqemEuLAK/iFvg1UP1Hw= -google.golang.org/genproto v0.0.0-20230223222841-637eb2293923/go.mod h1:3Dl5ZL0q0isWJt+FVcfpQyirqemEuLAK/iFvg1UP1Hw= -google.golang.org/genproto v0.0.0-20230303212802-e74f57abe488/go.mod h1:TvhZT5f700eVlTNwND1xoEZQeWTB2RY/65kplwl/bFA= -google.golang.org/genproto v0.0.0-20230306155012-7f2fa6fef1f4/go.mod h1:NWraEVixdDnqcqQ30jipen1STv2r/n24Wb7twVTGR4s= -google.golang.org/genproto v0.0.0-20230320184635-7606e756e683/go.mod h1:NWraEVixdDnqcqQ30jipen1STv2r/n24Wb7twVTGR4s= -google.golang.org/genproto v0.0.0-20230323212658-478b75c54725/go.mod h1:UUQDJDOlWu4KYeJZffbWgBkS1YFobzKbLVfK69pe0Ak= -google.golang.org/genproto v0.0.0-20230330154414-c0448cd141ea/go.mod h1:UUQDJDOlWu4KYeJZffbWgBkS1YFobzKbLVfK69pe0Ak= -google.golang.org/genproto v0.0.0-20230331144136-dcfb400f0633/go.mod h1:UUQDJDOlWu4KYeJZffbWgBkS1YFobzKbLVfK69pe0Ak= -google.golang.org/genproto v0.0.0-20230403163135-c38d8f061ccd/go.mod h1:UUQDJDOlWu4KYeJZffbWgBkS1YFobzKbLVfK69pe0Ak= -google.golang.org/genproto v0.0.0-20230410155749-daa745c078e1/go.mod h1:nKE/iIaLqn2bQwXBg8f1g2Ylh6r5MN5CmZvuzZCgsCU= -google.golang.org/genproto v0.0.0-20230525234025-438c736192d0/go.mod h1:9ExIQyXL5hZrHzQceCwuSYwZZ5QZBazOcprJ5rgs3lY= -google.golang.org/genproto v0.0.0-20230526161137-0005af68ea54/go.mod h1:zqTuNwFlFRsw5zIts5VnzLQxSRqh+CGOTVMlYbY0Eyk= -google.golang.org/genproto v0.0.0-20230526203410-71b5a4ffd15e/go.mod h1:zqTuNwFlFRsw5zIts5VnzLQxSRqh+CGOTVMlYbY0Eyk= -google.golang.org/genproto v0.0.0-20230530153820-e85fd2cbaebc/go.mod h1:xZnkP7mREFX5MORlOPEzLMr+90PPZQ2QWzrVTWfAq64= -google.golang.org/genproto v0.0.0-20230629202037-9506855d4529/go.mod h1:xZnkP7mREFX5MORlOPEzLMr+90PPZQ2QWzrVTWfAq64= -google.golang.org/genproto v0.0.0-20230706204954-ccb25ca9f130/go.mod h1:O9kGHb51iE/nOGvQaDUuadVYqovW56s5emA88lQnj6Y= -google.golang.org/genproto v0.0.0-20230711160842-782d3b101e98/go.mod h1:S7mY02OqCJTD0E1OiQy1F72PWFB4bZJ87cAtLPYgDR0= -google.golang.org/genproto/googleapis/api v0.0.0-20230525234020-1aefcd67740a/go.mod h1:ts19tUU+Z0ZShN1y3aPyq2+O3d5FUNNgT6FtOzmrNn8= -google.golang.org/genproto/googleapis/api v0.0.0-20230525234035-dd9d682886f9/go.mod h1:vHYtlOoi6TsQ3Uk2yxR7NI5z8uoV+3pZtR4jmHIkRig= -google.golang.org/genproto/googleapis/api v0.0.0-20230526203410-71b5a4ffd15e/go.mod h1:vHYtlOoi6TsQ3Uk2yxR7NI5z8uoV+3pZtR4jmHIkRig= -google.golang.org/genproto/googleapis/api v0.0.0-20230530153820-e85fd2cbaebc/go.mod h1:vHYtlOoi6TsQ3Uk2yxR7NI5z8uoV+3pZtR4jmHIkRig= -google.golang.org/genproto/googleapis/api v0.0.0-20230629202037-9506855d4529/go.mod h1:vHYtlOoi6TsQ3Uk2yxR7NI5z8uoV+3pZtR4jmHIkRig= -google.golang.org/genproto/googleapis/api v0.0.0-20230706204954-ccb25ca9f130/go.mod h1:mPBs5jNgx2GuQGvFwUvVKqtn6HsUw9nP64BedgvqEsQ= -google.golang.org/genproto/googleapis/api v0.0.0-20230711160842-782d3b101e98/go.mod h1:rsr7RhLuwsDKL7RmgDDCUc6yaGr1iqceVb5Wv6f6YvQ= -google.golang.org/genproto/googleapis/bytestream v0.0.0-20230530153820-e85fd2cbaebc/go.mod h1:ylj+BE99M198VPbBh6A8d9n3w8fChvyLK3wwBOjXBFA= -google.golang.org/genproto/googleapis/rpc v0.0.0-20230525234015-3fc162c6f38a/go.mod h1:xURIpW9ES5+/GZhnV6beoEtxQrnkRGIfP5VQG2tCBLc= -google.golang.org/genproto/googleapis/rpc v0.0.0-20230525234030-28d5490b6b19/go.mod h1:66JfowdXAEgad5O9NnYcsNPLCPZJD++2L9X0PCMODrA= -google.golang.org/genproto/googleapis/rpc v0.0.0-20230526203410-71b5a4ffd15e/go.mod h1:66JfowdXAEgad5O9NnYcsNPLCPZJD++2L9X0PCMODrA= -google.golang.org/genproto/googleapis/rpc v0.0.0-20230530153820-e85fd2cbaebc/go.mod h1:66JfowdXAEgad5O9NnYcsNPLCPZJD++2L9X0PCMODrA= -google.golang.org/genproto/googleapis/rpc v0.0.0-20230629202037-9506855d4529/go.mod h1:66JfowdXAEgad5O9NnYcsNPLCPZJD++2L9X0PCMODrA= -google.golang.org/genproto/googleapis/rpc v0.0.0-20230706204954-ccb25ca9f130/go.mod h1:8mL13HKkDa+IuJ8yruA3ci0q+0vsUz4m//+ottjwS5o= -google.golang.org/genproto/googleapis/rpc v0.0.0-20230711160842-782d3b101e98/go.mod h1:TUfxEVdsvPg18p6AslUXFoLdpED4oBnGwyqk3dV1XzM= -google.golang.org/genproto/googleapis/rpc v0.0.0-20230731190214-cbb8c96f2d6d/go.mod h1:TUfxEVdsvPg18p6AslUXFoLdpED4oBnGwyqk3dV1XzM= google.golang.org/grpc v1.41.0/go.mod h1:U3l9uK9J0sini8mHphKoXyaqDA/8VyGnDee1zzIUK6k= -google.golang.org/grpc v1.50.0/go.mod h1:ZgQEeidpAuNRZ8iRrlBKXZQP1ghovWIVhdJRyCDK+GI= -google.golang.org/grpc v1.50.1/go.mod h1:ZgQEeidpAuNRZ8iRrlBKXZQP1ghovWIVhdJRyCDK+GI= -google.golang.org/grpc v1.51.0/go.mod h1:wgNDFcnuBGmxLKI/qn4T+m5BtEBYXJPvibbUPsAIPww= -google.golang.org/grpc v1.52.0/go.mod h1:pu6fVzoFb+NBYNAvQL08ic+lvB2IojljRYuun5vorUY= -google.golang.org/grpc v1.52.3/go.mod h1:pu6fVzoFb+NBYNAvQL08ic+lvB2IojljRYuun5vorUY= -google.golang.org/grpc v1.53.0/go.mod h1:OnIrk0ipVdj4N5d9IUoFUx72/VlD7+jUsHwZgwSMQpw= -google.golang.org/grpc v1.54.0/go.mod h1:PUSEXI6iWghWaB6lXM4knEgpJNu2qUcKfDtNci3EC2g= -google.golang.org/grpc v1.55.0/go.mod h1:iYEXKGkEBhg1PjZQvoYEVPTDkHo1/bjTnfwTeGONTY8= -google.golang.org/grpc v1.56.2/go.mod h1:I9bI3vqKfayGqPUAwGdOSu7kt6oIJLixfffKrpXqQ9s= -google.golang.org/grpc v1.57.0/go.mod h1:Sd+9RMTACXwmub0zcNY2c4arhtrbBYD1AUHI/dt16Mo= -google.golang.org/protobuf v1.29.1/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= -google.golang.org/protobuf v1.30.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= -gopkg.in/ini.v1 v1.67.0 h1:Dgnx+6+nfE+IfzjUEISNeydPJh9AXNNsWbGP9KzCsOA= -gopkg.in/ini.v1 v1.67.0/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k= -honnef.co/go/tools v0.1.3/go.mod h1:NgwopIslSNH47DimFoV78dnkksY2EFtX0ajyb3K/las= -lukechampine.com/uint128 v1.1.1/go.mod h1:c4eWIwlEGaxC/+H1VguhU4PHXNWDCDMUlWdIWl2j1gk= -lukechampine.com/uint128 v1.2.0/go.mod h1:c4eWIwlEGaxC/+H1VguhU4PHXNWDCDMUlWdIWl2j1gk= -modernc.org/cc/v3 v3.36.0/go.mod h1:NFUHyPn4ekoC/JHeZFfZurN6ixxawE1BnVonP/oahEI= -modernc.org/cc/v3 v3.36.2/go.mod h1:NFUHyPn4ekoC/JHeZFfZurN6ixxawE1BnVonP/oahEI= -modernc.org/cc/v3 v3.36.3/go.mod h1:NFUHyPn4ekoC/JHeZFfZurN6ixxawE1BnVonP/oahEI= -modernc.org/cc/v3 v3.37.0/go.mod h1:vtL+3mdHx/wcj3iEGz84rQa8vEqR6XM84v5Lcvfph20= -modernc.org/cc/v3 v3.40.0/go.mod h1:/bTg4dnWkSXowUO6ssQKnOV0yMVxDYNIsIrzqTFDGH0= -modernc.org/ccgo/v3 v3.0.0-20220428102840-41399a37e894/go.mod h1:eI31LL8EwEBKPpNpA4bU1/i+sKOwOrQy8D87zWUcRZc= -modernc.org/ccgo/v3 v3.0.0-20220430103911-bc99d88307be/go.mod h1:bwdAnOoaIt8Ax9YdWGjxWsdkPcZyRPHqrOvJxaKAKGw= -modernc.org/ccgo/v3 v3.0.0-20220904174949-82d86e1b6d56/go.mod h1:YSXjPL62P2AMSxBphRHPn7IkzhVHqkvOnRKAKh+W6ZI= -modernc.org/ccgo/v3 v3.16.4/go.mod h1:tGtX0gE9Jn7hdZFeU88slbTh1UtCYKusWOoCJuvkWsQ= -modernc.org/ccgo/v3 v3.16.6/go.mod h1:tGtX0gE9Jn7hdZFeU88slbTh1UtCYKusWOoCJuvkWsQ= -modernc.org/ccgo/v3 v3.16.8/go.mod h1:zNjwkizS+fIFDrDjIAgBSCLkWbJuHF+ar3QRn+Z9aws= -modernc.org/ccgo/v3 v3.16.9/go.mod h1:zNMzC9A9xeNUepy6KuZBbugn3c0Mc9TeiJO4lgvkJDo= -modernc.org/ccgo/v3 v3.16.13-0.20221017192402-261537637ce8/go.mod h1:fUB3Vn0nVPReA+7IG7yZDfjv1TMWjhQP8gCxrFAtL5g= -modernc.org/ccgo/v3 v3.16.13/go.mod h1:2Quk+5YgpImhPjv2Qsob1DnZ/4som1lJTodubIcoUkY= -modernc.org/ccorpus v1.11.6/go.mod h1:2gEUTrWqdpH2pXsmTM1ZkjeSrUWDpjMu2T6m29L/ErQ= -modernc.org/libc v0.0.0-20220428101251-2d5f3daf273b/go.mod h1:p7Mg4+koNjc8jkqwcoFBJx7tXkpj00G77X7A72jXPXA= -modernc.org/libc v1.16.0/go.mod h1:N4LD6DBE9cf+Dzf9buBlzVJndKr/iJHG97vGLHYnb5A= -modernc.org/libc v1.16.1/go.mod h1:JjJE0eu4yeK7tab2n4S1w8tlWd9MxXLRzheaRnAKymU= -modernc.org/libc v1.16.17/go.mod h1:hYIV5VZczAmGZAnG15Vdngn5HSF5cSkbvfz2B7GRuVU= -modernc.org/libc v1.16.19/go.mod h1:p7Mg4+koNjc8jkqwcoFBJx7tXkpj00G77X7A72jXPXA= -modernc.org/libc v1.17.0/go.mod h1:XsgLldpP4aWlPlsjqKRdHPqCxCjISdHfM/yeWC5GyW0= -modernc.org/libc v1.17.1/go.mod h1:FZ23b+8LjxZs7XtFMbSzL/EhPxNbfZbErxEHc7cbD9s= -modernc.org/libc v1.17.4/go.mod h1:WNg2ZH56rDEwdropAJeZPQkXmDwh+JCA1s/htl6r2fA= -modernc.org/libc v1.18.0/go.mod h1:vj6zehR5bfc98ipowQOM2nIDUZnVew/wNC/2tOGS+q0= -modernc.org/libc v1.20.3/go.mod h1:ZRfIaEkgrYgZDl6pa4W39HgN5G/yDW+NRmNKZBDFrk0= -modernc.org/libc v1.21.4/go.mod h1:przBsL5RDOZajTVslkugzLBj1evTue36jEomFQOoYuI= -modernc.org/libc v1.22.2/go.mod h1:uvQavJ1pZ0hIoC/jfqNoMLURIMhKzINIWypNM17puug= -modernc.org/mathutil v1.4.1/go.mod h1:mZW8CKdRPY1v87qxC/wUdX5O1qDzXMP5TH3wjfpga6E= -modernc.org/mathutil v1.5.0/go.mod h1:mZW8CKdRPY1v87qxC/wUdX5O1qDzXMP5TH3wjfpga6E= -modernc.org/memory v1.1.1/go.mod h1:/0wo5ibyrQiaoUoH7f9D8dnglAmILJ5/cxZlRECf+Nw= -modernc.org/memory v1.2.0/go.mod h1:/0wo5ibyrQiaoUoH7f9D8dnglAmILJ5/cxZlRECf+Nw= -modernc.org/memory v1.2.1/go.mod h1:PkUhL0Mugw21sHPeskwZW4D6VscE/GQJOnIpCnW6pSU= -modernc.org/memory v1.3.0/go.mod h1:PkUhL0Mugw21sHPeskwZW4D6VscE/GQJOnIpCnW6pSU= -modernc.org/memory v1.4.0/go.mod h1:PkUhL0Mugw21sHPeskwZW4D6VscE/GQJOnIpCnW6pSU= -modernc.org/memory v1.5.0/go.mod h1:PkUhL0Mugw21sHPeskwZW4D6VscE/GQJOnIpCnW6pSU= -modernc.org/opt v0.1.3/go.mod h1:WdSiB5evDcignE70guQKxYUl14mgWtbClRi5wmkkTX0= -modernc.org/sqlite v1.18.1/go.mod h1:6ho+Gow7oX5V+OiOQ6Tr4xeqbx13UZ6t+Fw9IRUG4d4= -modernc.org/sqlite v1.18.2/go.mod h1:kvrTLEWgxUcHa2GfHBQtanR1H9ht3hTJNtKpzH9k1u0= -modernc.org/strutil v1.1.1/go.mod h1:DE+MQQ/hjKBZS2zNInV5hhcipt5rLPWkmpbGeW5mmdw= -modernc.org/strutil v1.1.3/go.mod h1:MEHNA7PdEnEwLvspRMtWTNnp2nnyvMfkimT1NKNAGbw= -modernc.org/tcl v1.13.1/go.mod h1:XOLfOwzhkljL4itZkK6T72ckMgvj0BDsnKNdZVUOecw= -modernc.org/tcl v1.13.2/go.mod h1:7CLiGIPo1M8Rv1Mitpv5akc2+8fxUd2y2UzC/MfMzy0= -modernc.org/token v1.0.1/go.mod h1:UGzOrNV1mAFSEB63lOFHIpNRUVMvYTc6yu1SMY/XTDM= -modernc.org/token v1.1.0/go.mod h1:UGzOrNV1mAFSEB63lOFHIpNRUVMvYTc6yu1SMY/XTDM= -modernc.org/z v1.5.1/go.mod h1:eWFB510QWW5Th9YGZT81s+LwvaAs3Q2yr4sP0rmLkv8= diff --git a/internal/api/v1beta1/alert_test.go b/internal/api/v1beta1/alert_test.go index 8f603d10..738e64f1 100644 --- a/internal/api/v1beta1/alert_test.go +++ b/internal/api/v1beta1/alert_test.go @@ -8,7 +8,6 @@ import ( "github.com/goto/salt/log" "github.com/goto/siren/core/alert" "github.com/goto/siren/core/notification" - "github.com/goto/siren/core/provider" "github.com/goto/siren/internal/api" "github.com/goto/siren/internal/api/mocks" "github.com/goto/siren/internal/api/v1beta1" @@ -27,7 +26,7 @@ func TestGRPCServer_ListAlerts(t *testing.T) { ID: 1, ProviderID: 1, ResourceName: "foo", Severity: "CRITICAL", MetricName: "bar", MetricValue: "30", Rule: "bar", TriggeredAt: timenow, }} - mockedAlertService.EXPECT().List(mock.AnythingOfType("*context.emptyCtx"), alert.Filter{ + mockedAlertService.EXPECT().List(mock.AnythingOfType("context.todoCtx"), alert.Filter{ ProviderID: 1, ResourceName: "foo", StartTime: 100, @@ -41,7 +40,7 @@ func TestGRPCServer_ListAlerts(t *testing.T) { StartTime: 100, EndTime: 200, } - res, err := dummyGRPCServer.ListAlerts(context.Background(), dummyReq) + res, err := dummyGRPCServer.ListAlerts(context.TODO(), dummyReq) assert.Equal(t, 1, len(res.GetAlerts())) assert.Equal(t, uint64(1), res.GetAlerts()[0].GetId()) assert.Equal(t, "foo", res.GetAlerts()[0].GetResourceName()) @@ -57,7 +56,7 @@ func TestGRPCServer_ListAlerts(t *testing.T) { mockedAlertService := &mocks.AlertService{} dummyGRPCServer := v1beta1.NewGRPCServer(nil, log.NewNoop(), api.HeadersConfig{}, &api.Deps{AlertService: mockedAlertService}) - mockedAlertService.EXPECT().List(mock.AnythingOfType("*context.emptyCtx"), alert.Filter{ + mockedAlertService.EXPECT().List(mock.AnythingOfType("context.todoCtx"), alert.Filter{ ProviderID: 1, ResourceName: "foo", StartTime: 100, @@ -70,7 +69,7 @@ func TestGRPCServer_ListAlerts(t *testing.T) { StartTime: 100, EndTime: 200, } - res, err := dummyGRPCServer.ListAlerts(context.Background(), dummyReq) + res, err := dummyGRPCServer.ListAlerts(context.TODO(), dummyReq) assert.EqualError(t, err, "rpc error: code = Internal desc = some unexpected error occurred") assert.Nil(t, res) mockedAlertService.AssertExpectations(t) @@ -142,7 +141,7 @@ func TestGRPCServer_CreateAlertHistory(t *testing.T) { dummyReq := &sirenv1beta1.CreateAlertsRequest{ ProviderId: 1, - ProviderType: provider.TypeCortex, + ProviderType: "cortex", Body: &structpb.Struct{ Fields: map[string]*structpb.Value{ "alerts": { @@ -171,14 +170,14 @@ func TestGRPCServer_CreateAlertHistory(t *testing.T) { Rule: "random", TriggeredAt: timenow, }} - mockedAlertService.EXPECT().CreateAlerts(mock.AnythingOfType("*context.emptyCtx"), mock.AnythingOfType("string"), mock.AnythingOfType("uint64"), mock.AnythingOfType("uint64"), payload). + mockedAlertService.EXPECT().CreateAlerts(mock.AnythingOfType("context.todoCtx"), mock.AnythingOfType("string"), mock.AnythingOfType("uint64"), mock.AnythingOfType("uint64"), payload). Return(dummyAlerts, 1, nil).Once() mockNotificationService.EXPECT().BuildFromAlerts(mock.AnythingOfType("[]alert.Alert"), mock.AnythingOfType("int"), mock.AnythingOfType("time.Time")).Return([]notification.Notification{}, nil) - mockNotificationService.EXPECT().Dispatch(mock.AnythingOfType("*context.emptyCtx"), mock.AnythingOfType("notification.Notification")).Return(nil) + mockNotificationService.EXPECT().Dispatch(mock.AnythingOfType("context.todoCtx"), mock.AnythingOfType("notification.Notification")).Return(nil) dummyGRPCServer := v1beta1.NewGRPCServer(nil, log.NewNoop(), api.HeadersConfig{}, &api.Deps{AlertService: mockedAlertService, NotificationService: mockNotificationService}) - res, err := dummyGRPCServer.CreateAlerts(context.Background(), dummyReq) + res, err := dummyGRPCServer.CreateAlerts(context.TODO(), dummyReq) assert.Equal(t, 1, len(res.GetAlerts())) assert.Equal(t, uint64(1), res.GetAlerts()[0].GetId()) assert.Equal(t, "foo", res.GetAlerts()[0].GetResourceName()) @@ -238,7 +237,7 @@ func TestGRPCServer_CreateAlertHistory(t *testing.T) { dummyReq := &sirenv1beta1.CreateAlertsRequest{ ProviderId: 1, - ProviderType: provider.TypeCortex, + ProviderType: "cortex", Body: &structpb.Struct{ Fields: map[string]*structpb.Value{ "alerts": { @@ -280,14 +279,14 @@ func TestGRPCServer_CreateAlertHistory(t *testing.T) { Rule: "random", TriggeredAt: timenow, }} - mockedAlertService.EXPECT().CreateAlerts(mock.AnythingOfType("*context.emptyCtx"), mock.AnythingOfType("string"), mock.AnythingOfType("uint64"), mock.AnythingOfType("uint64"), payload). + mockedAlertService.EXPECT().CreateAlerts(mock.AnythingOfType("context.todoCtx"), mock.AnythingOfType("string"), mock.AnythingOfType("uint64"), mock.AnythingOfType("uint64"), payload). Return(dummyAlerts, 1, nil).Once() mockNotificationService.EXPECT().BuildFromAlerts(mock.AnythingOfType("[]alert.Alert"), mock.AnythingOfType("int"), mock.AnythingOfType("time.Time")).Return([]notification.Notification{}, nil) - mockNotificationService.EXPECT().Dispatch(mock.AnythingOfType("*context.emptyCtx"), mock.AnythingOfType("notification.Notification")).Return(nil) + mockNotificationService.EXPECT().Dispatch(mock.AnythingOfType("context.todoCtx"), mock.AnythingOfType("notification.Notification")).Return(nil) dummyGRPCServer := v1beta1.NewGRPCServer(nil, log.NewNoop(), api.HeadersConfig{}, &api.Deps{AlertService: mockedAlertService, NotificationService: mockNotificationService}) - res, err := dummyGRPCServer.CreateAlerts(context.Background(), dummyReq) + res, err := dummyGRPCServer.CreateAlerts(context.TODO(), dummyReq) assert.Equal(t, 1, len(res.GetAlerts())) assert.Equal(t, uint64(1), res.GetAlerts()[0].GetId()) assert.Equal(t, "foo", res.GetAlerts()[0].GetResourceName()) @@ -303,10 +302,10 @@ func TestGRPCServer_CreateAlertHistory(t *testing.T) { mockedAlertService := &mocks.AlertService{} dummyGRPCServer := v1beta1.NewGRPCServer(nil, log.NewNoop(), api.HeadersConfig{}, &api.Deps{AlertService: mockedAlertService}) - mockedAlertService.EXPECT().CreateAlerts(mock.AnythingOfType("*context.emptyCtx"), mock.AnythingOfType("string"), mock.AnythingOfType("uint64"), mock.AnythingOfType("uint64"), payload). + mockedAlertService.EXPECT().CreateAlerts(mock.AnythingOfType("context.todoCtx"), mock.AnythingOfType("string"), mock.AnythingOfType("uint64"), mock.AnythingOfType("uint64"), payload). Return(nil, 0, errors.New("random error")).Once() - res, err := dummyGRPCServer.CreateAlerts(context.Background(), dummyReq) + res, err := dummyGRPCServer.CreateAlerts(context.TODO(), dummyReq) assert.EqualError(t, err, "rpc error: code = Internal desc = some unexpected error occurred") assert.Nil(t, res) mockedAlertService.AssertExpectations(t) @@ -432,7 +431,7 @@ func TestGRPCServer_CreateAlertHistory(t *testing.T) { dummyReq := &sirenv1beta1.CreateAlertsRequest{ ProviderId: 1, - ProviderType: provider.TypeCortex, + ProviderType: "cortex", Body: &structpb.Struct{ Fields: map[string]*structpb.Value{ "alerts": { @@ -462,12 +461,12 @@ func TestGRPCServer_CreateAlertHistory(t *testing.T) { dummyGRPCServer := v1beta1.NewGRPCServer(nil, log.NewNoop(), api.HeadersConfig{}, &api.Deps{AlertService: mockedAlertService, NotificationService: mockNotificationService}) - mockedAlertService.EXPECT().CreateAlerts(mock.AnythingOfType("*context.emptyCtx"), mock.AnythingOfType("string"), mock.AnythingOfType("uint64"), mock.AnythingOfType("uint64"), payload). + mockedAlertService.EXPECT().CreateAlerts(mock.AnythingOfType("context.todoCtx"), mock.AnythingOfType("string"), mock.AnythingOfType("uint64"), mock.AnythingOfType("uint64"), payload). Return(dummyAlerts, 2, nil).Once() mockNotificationService.EXPECT().BuildFromAlerts(mock.AnythingOfType("[]alert.Alert"), mock.AnythingOfType("int"), mock.AnythingOfType("time.Time")).Return([]notification.Notification{}, nil) - mockNotificationService.EXPECT().Dispatch(mock.AnythingOfType("*context.emptyCtx"), mock.AnythingOfType("notification.Notification")).Return(nil) + mockNotificationService.EXPECT().Dispatch(mock.AnythingOfType("context.todoCtx"), mock.AnythingOfType("notification.Notification")).Return(nil) - res, err := dummyGRPCServer.CreateAlerts(context.Background(), dummyReq) + res, err := dummyGRPCServer.CreateAlerts(context.TODO(), dummyReq) assert.Equal(t, 1, len(res.GetAlerts())) assert.Equal(t, uint64(1), res.GetAlerts()[0].GetProviderId()) assert.Equal(t, "foo", res.GetAlerts()[0].GetResourceName()) diff --git a/internal/api/v1beta1/health_test.go b/internal/api/v1beta1/health_test.go index e4155e71..b92c7630 100644 --- a/internal/api/v1beta1/health_test.go +++ b/internal/api/v1beta1/health_test.go @@ -26,7 +26,7 @@ func TestHealthCheck(t *testing.T) { } for _, tc := range testCases { t.Run(tc.Description, func(t *testing.T) { - ctx := context.Background() + ctx := context.TODO() healthHandler := &GRPCServer{} diff --git a/internal/api/v1beta1/namespace_test.go b/internal/api/v1beta1/namespace_test.go index f301f63d..f69a787c 100644 --- a/internal/api/v1beta1/namespace_test.go +++ b/internal/api/v1beta1/namespace_test.go @@ -41,8 +41,8 @@ func TestGRPCServer_ListNamespaces(t *testing.T) { }, } - mockedNamespaceService.EXPECT().List(mock.AnythingOfType("*context.emptyCtx")).Return(dummyResult, nil).Once() - res, err := dummyGRPCServer.ListNamespaces(context.Background(), &sirenv1beta1.ListNamespacesRequest{}) + mockedNamespaceService.EXPECT().List(mock.AnythingOfType("context.todoCtx")).Return(dummyResult, nil).Once() + res, err := dummyGRPCServer.ListNamespaces(context.TODO(), &sirenv1beta1.ListNamespacesRequest{}) assert.Nil(t, err) assert.Equal(t, 1, len(res.GetNamespaces())) assert.Equal(t, "foo", res.GetNamespaces()[0].GetName()) @@ -54,9 +54,9 @@ func TestGRPCServer_ListNamespaces(t *testing.T) { t.Run("should return Internal if getting namespaces failed", func(t *testing.T) { mockedNamespaceService := &mocks.NamespaceService{} dummyGRPCServer := v1beta1.NewGRPCServer(nil, log.NewNoop(), api.HeadersConfig{}, &api.Deps{NamespaceService: mockedNamespaceService}) - mockedNamespaceService.EXPECT().List(mock.AnythingOfType("*context.emptyCtx")). + mockedNamespaceService.EXPECT().List(mock.AnythingOfType("context.todoCtx")). Return(nil, errors.New("random error")).Once() - res, err := dummyGRPCServer.ListNamespaces(context.Background(), &sirenv1beta1.ListNamespacesRequest{}) + res, err := dummyGRPCServer.ListNamespaces(context.TODO(), &sirenv1beta1.ListNamespacesRequest{}) assert.Nil(t, res) assert.EqualError(t, err, "rpc error: code = Internal desc = some unexpected error occurred") }) @@ -78,8 +78,8 @@ func TestGRPCServer_ListNamespaces(t *testing.T) { UpdatedAt: time.Now(), }, } - mockedNamespaceService.EXPECT().List(mock.AnythingOfType("*context.emptyCtx")).Return(dummyResult, nil).Once() - res, err := dummyGRPCServer.ListNamespaces(context.Background(), &sirenv1beta1.ListNamespacesRequest{}) + mockedNamespaceService.EXPECT().List(mock.AnythingOfType("context.todoCtx")).Return(dummyResult, nil).Once() + res, err := dummyGRPCServer.ListNamespaces(context.TODO(), &sirenv1beta1.ListNamespacesRequest{}) assert.Nil(t, res) assert.EqualError(t, err, "rpc error: code = Internal desc = some unexpected error occurred") }) @@ -111,10 +111,10 @@ func TestGRPCServer_CreateNamespaces(t *testing.T) { t.Run("should create a namespace", func(t *testing.T) { mockedNamespaceService := &mocks.NamespaceService{} dummyGRPCServer := v1beta1.NewGRPCServer(nil, log.NewNoop(), api.HeadersConfig{}, &api.Deps{NamespaceService: mockedNamespaceService}) - mockedNamespaceService.EXPECT().Create(mock.AnythingOfType("*context.emptyCtx"), payload).Run(func(_a0 context.Context, _a1 *namespace.Namespace) { + mockedNamespaceService.EXPECT().Create(mock.AnythingOfType("context.todoCtx"), payload).Run(func(_a0 context.Context, _a1 *namespace.Namespace) { _a1.ID = generatedID }).Return(nil).Once() - res, err := dummyGRPCServer.CreateNamespace(context.Background(), request) + res, err := dummyGRPCServer.CreateNamespace(context.TODO(), request) assert.Nil(t, err) assert.Equal(t, generatedID, res.GetId()) }) @@ -122,8 +122,8 @@ func TestGRPCServer_CreateNamespaces(t *testing.T) { t.Run("should return error Internal if creating namespaces failed", func(t *testing.T) { mockedNamespaceService := &mocks.NamespaceService{} dummyGRPCServer := v1beta1.NewGRPCServer(nil, log.NewNoop(), api.HeadersConfig{}, &api.Deps{NamespaceService: mockedNamespaceService}) - mockedNamespaceService.EXPECT().Create(mock.AnythingOfType("*context.emptyCtx"), payload).Return(errors.New("random error")).Once() - res, err := dummyGRPCServer.CreateNamespace(context.Background(), request) + mockedNamespaceService.EXPECT().Create(mock.AnythingOfType("context.todoCtx"), payload).Return(errors.New("random error")).Once() + res, err := dummyGRPCServer.CreateNamespace(context.TODO(), request) assert.Nil(t, res) assert.EqualError(t, err, "rpc error: code = Internal desc = some unexpected error occurred") }) @@ -132,8 +132,8 @@ func TestGRPCServer_CreateNamespaces(t *testing.T) { mockedNamespaceService := &mocks.NamespaceService{} dummyGRPCServer := v1beta1.NewGRPCServer(nil, log.NewNoop(), api.HeadersConfig{}, &api.Deps{NamespaceService: mockedNamespaceService}) - mockedNamespaceService.EXPECT().Create(mock.AnythingOfType("*context.emptyCtx"), payload).Return(errors.ErrInvalid).Once() - res, err := dummyGRPCServer.CreateNamespace(context.Background(), request) + mockedNamespaceService.EXPECT().Create(mock.AnythingOfType("context.todoCtx"), payload).Return(errors.ErrInvalid).Once() + res, err := dummyGRPCServer.CreateNamespace(context.TODO(), request) assert.Nil(t, res) assert.EqualError(t, err, "rpc error: code = InvalidArgument desc = request is not valid") @@ -143,8 +143,8 @@ func TestGRPCServer_CreateNamespaces(t *testing.T) { mockedNamespaceService := &mocks.NamespaceService{} dummyGRPCServer := v1beta1.NewGRPCServer(nil, log.NewNoop(), api.HeadersConfig{}, &api.Deps{NamespaceService: mockedNamespaceService}) - mockedNamespaceService.EXPECT().Create(mock.AnythingOfType("*context.emptyCtx"), payload).Return(errors.ErrConflict).Once() - res, err := dummyGRPCServer.CreateNamespace(context.Background(), request) + mockedNamespaceService.EXPECT().Create(mock.AnythingOfType("context.todoCtx"), payload).Return(errors.ErrConflict).Once() + res, err := dummyGRPCServer.CreateNamespace(context.TODO(), request) assert.Nil(t, res) assert.EqualError(t, err, "rpc error: code = AlreadyExists desc = an entity with conflicting identifier exists") @@ -172,8 +172,8 @@ func TestGRPCServer_GetNamespace(t *testing.T) { UpdatedAt: time.Now(), } - mockedNamespaceService.EXPECT().Get(mock.AnythingOfType("*context.emptyCtx"), uint64(1)).Return(dummyResult, nil).Once() - res, err := dummyGRPCServer.GetNamespace(context.Background(), + mockedNamespaceService.EXPECT().Get(mock.AnythingOfType("context.todoCtx"), uint64(1)).Return(dummyResult, nil).Once() + res, err := dummyGRPCServer.GetNamespace(context.TODO(), &sirenv1beta1.GetNamespaceRequest{Id: uint64(1)}) assert.Nil(t, err) assert.Equal(t, "foo", res.GetNamespace().GetName()) @@ -185,8 +185,8 @@ func TestGRPCServer_GetNamespace(t *testing.T) { t.Run("should return error Invalid Argument if no namespace found", func(t *testing.T) { mockedNamespaceService := &mocks.NamespaceService{} dummyGRPCServer := v1beta1.NewGRPCServer(nil, log.NewNoop(), api.HeadersConfig{}, &api.Deps{NamespaceService: mockedNamespaceService}) - mockedNamespaceService.EXPECT().Get(mock.AnythingOfType("*context.emptyCtx"), uint64(1)).Return(nil, errors.ErrNotFound.WithCausef("some error")).Once() - res, err := dummyGRPCServer.GetNamespace(context.Background(), + mockedNamespaceService.EXPECT().Get(mock.AnythingOfType("context.todoCtx"), uint64(1)).Return(nil, errors.ErrNotFound.WithCausef("some error")).Once() + res, err := dummyGRPCServer.GetNamespace(context.TODO(), &sirenv1beta1.GetNamespaceRequest{Id: uint64(1)}) assert.Nil(t, res) assert.EqualError(t, err, "rpc error: code = NotFound desc = requested entity not found") @@ -195,9 +195,9 @@ func TestGRPCServer_GetNamespace(t *testing.T) { t.Run("should return error Internal if getting namespace fails", func(t *testing.T) { mockedNamespaceService := &mocks.NamespaceService{} dummyGRPCServer := v1beta1.NewGRPCServer(nil, log.NewNoop(), api.HeadersConfig{}, &api.Deps{NamespaceService: mockedNamespaceService}) - mockedNamespaceService.EXPECT().Get(mock.AnythingOfType("*context.emptyCtx"), uint64(1)). + mockedNamespaceService.EXPECT().Get(mock.AnythingOfType("context.todoCtx"), uint64(1)). Return(nil, errors.New("random error")).Once() - res, err := dummyGRPCServer.GetNamespace(context.Background(), + res, err := dummyGRPCServer.GetNamespace(context.TODO(), &sirenv1beta1.GetNamespaceRequest{Id: uint64(1)}) assert.Nil(t, res) assert.EqualError(t, err, "rpc error: code = Internal desc = some unexpected error occurred") @@ -218,8 +218,8 @@ func TestGRPCServer_GetNamespace(t *testing.T) { CreatedAt: time.Now(), UpdatedAt: time.Now(), } - mockedNamespaceService.EXPECT().Get(mock.AnythingOfType("*context.emptyCtx"), uint64(1)).Return(dummyResult, nil).Once() - res, err := dummyGRPCServer.GetNamespace(context.Background(), + mockedNamespaceService.EXPECT().Get(mock.AnythingOfType("context.todoCtx"), uint64(1)).Return(dummyResult, nil).Once() + res, err := dummyGRPCServer.GetNamespace(context.TODO(), &sirenv1beta1.GetNamespaceRequest{Id: uint64(1)}) assert.Nil(t, res) assert.EqualError(t, err, "rpc error: code = Internal desc = some unexpected error occurred") @@ -253,10 +253,10 @@ func TestGRPCServer_UpdateNamespace(t *testing.T) { t.Run("should update a namespace", func(t *testing.T) { mockedNamespaceService := &mocks.NamespaceService{} dummyGRPCServer := v1beta1.NewGRPCServer(nil, log.NewNoop(), api.HeadersConfig{}, &api.Deps{NamespaceService: mockedNamespaceService}) - mockedNamespaceService.EXPECT().Update(mock.AnythingOfType("*context.emptyCtx"), payload).Run(func(_a0 context.Context, _a1 *namespace.Namespace) { + mockedNamespaceService.EXPECT().Update(mock.AnythingOfType("context.todoCtx"), payload).Run(func(_a0 context.Context, _a1 *namespace.Namespace) { _a1.ID = payload.ID }).Return(nil).Once() - res, err := dummyGRPCServer.UpdateNamespace(context.Background(), request) + res, err := dummyGRPCServer.UpdateNamespace(context.TODO(), request) assert.Nil(t, err) assert.Equal(t, payload.ID, res.GetId()) mockedNamespaceService.AssertExpectations(t) @@ -265,9 +265,9 @@ func TestGRPCServer_UpdateNamespace(t *testing.T) { t.Run("should return error Invalid Argument if namespace service return err invalid", func(t *testing.T) { mockedNamespaceService := &mocks.NamespaceService{} dummyGRPCServer := v1beta1.NewGRPCServer(nil, log.NewNoop(), api.HeadersConfig{}, &api.Deps{NamespaceService: mockedNamespaceService}) - mockedNamespaceService.EXPECT().Update(mock.AnythingOfType("*context.emptyCtx"), payload).Return(errors.ErrInvalid).Once() + mockedNamespaceService.EXPECT().Update(mock.AnythingOfType("context.todoCtx"), payload).Return(errors.ErrInvalid).Once() - res, err := dummyGRPCServer.UpdateNamespace(context.Background(), request) + res, err := dummyGRPCServer.UpdateNamespace(context.TODO(), request) assert.Nil(t, res) assert.EqualError(t, err, "rpc error: code = InvalidArgument desc = request is not valid") }) @@ -275,9 +275,9 @@ func TestGRPCServer_UpdateNamespace(t *testing.T) { t.Run("should return error AlreadyExists if namespace service return err conflict", func(t *testing.T) { mockedNamespaceService := &mocks.NamespaceService{} dummyGRPCServer := v1beta1.NewGRPCServer(nil, log.NewNoop(), api.HeadersConfig{}, &api.Deps{NamespaceService: mockedNamespaceService}) - mockedNamespaceService.EXPECT().Update(mock.AnythingOfType("*context.emptyCtx"), payload).Return(errors.ErrConflict).Once() + mockedNamespaceService.EXPECT().Update(mock.AnythingOfType("context.todoCtx"), payload).Return(errors.ErrConflict).Once() - res, err := dummyGRPCServer.UpdateNamespace(context.Background(), request) + res, err := dummyGRPCServer.UpdateNamespace(context.TODO(), request) assert.Nil(t, res) assert.EqualError(t, err, "rpc error: code = AlreadyExists desc = an entity with conflicting identifier exists") }) @@ -286,9 +286,9 @@ func TestGRPCServer_UpdateNamespace(t *testing.T) { mockedNamespaceService := &mocks.NamespaceService{} dummyGRPCServer := v1beta1.NewGRPCServer(nil, log.NewNoop(), api.HeadersConfig{}, &api.Deps{NamespaceService: mockedNamespaceService}) - mockedNamespaceService.EXPECT().Update(mock.AnythingOfType("*context.emptyCtx"), payload).Return(errors.New("random error")).Once() + mockedNamespaceService.EXPECT().Update(mock.AnythingOfType("context.todoCtx"), payload).Return(errors.New("random error")).Once() - res, err := dummyGRPCServer.UpdateNamespace(context.Background(), request) + res, err := dummyGRPCServer.UpdateNamespace(context.TODO(), request) assert.Nil(t, res) assert.EqualError(t, err, "rpc error: code = Internal desc = some unexpected error occurred") mockedNamespaceService.AssertExpectations(t) @@ -304,8 +304,8 @@ func TestGRPCServer_DeleteNamespace(t *testing.T) { t.Run("should delete namespace object", func(t *testing.T) { mockedNamespaceService := &mocks.NamespaceService{} dummyGRPCServer := v1beta1.NewGRPCServer(nil, log.NewNoop(), api.HeadersConfig{}, &api.Deps{NamespaceService: mockedNamespaceService}) - mockedNamespaceService.EXPECT().Delete(mock.AnythingOfType("*context.emptyCtx"), namespaceId).Return(nil).Once() - res, err := dummyGRPCServer.DeleteNamespace(context.Background(), dummyReq) + mockedNamespaceService.EXPECT().Delete(mock.AnythingOfType("context.todoCtx"), namespaceId).Return(nil).Once() + res, err := dummyGRPCServer.DeleteNamespace(context.TODO(), dummyReq) assert.Nil(t, err) assert.Equal(t, "", res.String()) mockedNamespaceService.AssertExpectations(t) @@ -314,8 +314,8 @@ func TestGRPCServer_DeleteNamespace(t *testing.T) { t.Run("should return error Internal if deleting namespace failed", func(t *testing.T) { mockedNamespaceService := &mocks.NamespaceService{} dummyGRPCServer := v1beta1.NewGRPCServer(nil, log.NewNoop(), api.HeadersConfig{}, &api.Deps{NamespaceService: mockedNamespaceService}) - mockedNamespaceService.EXPECT().Delete(mock.AnythingOfType("*context.emptyCtx"), namespaceId).Return(errors.New("random error")).Once() - res, err := dummyGRPCServer.DeleteNamespace(context.Background(), dummyReq) + mockedNamespaceService.EXPECT().Delete(mock.AnythingOfType("context.todoCtx"), namespaceId).Return(errors.New("random error")).Once() + res, err := dummyGRPCServer.DeleteNamespace(context.TODO(), dummyReq) assert.Nil(t, res) assert.EqualError(t, err, "rpc error: code = Internal desc = some unexpected error occurred") }) diff --git a/internal/api/v1beta1/notification_test.go b/internal/api/v1beta1/notification_test.go index 3e09bb8f..d14169bd 100644 --- a/internal/api/v1beta1/notification_test.go +++ b/internal/api/v1beta1/notification_test.go @@ -95,7 +95,7 @@ func TestGRPCServer_NotifyReceiver(t *testing.T) { dummyGRPCServer := v1beta1.NewGRPCServer(nil, log.NewNoop(), api.HeadersConfig{ IdempotencyKey: idempotencyHeaderKey, }, &api.Deps{NotificationService: mockNotificationService}) - ctx := metadata.NewIncomingContext(context.Background(), metadata.New(map[string]string{ + ctx := metadata.NewIncomingContext(context.TODO(), metadata.New(map[string]string{ idempotencyHeaderKey: tc.idempotencyKey, })) _, err := dummyGRPCServer.NotifyReceiver(ctx, &sirenv1beta1.NotifyReceiverRequest{}) diff --git a/internal/api/v1beta1/provider_test.go b/internal/api/v1beta1/provider_test.go index e61084e8..215d66d6 100644 --- a/internal/api/v1beta1/provider_test.go +++ b/internal/api/v1beta1/provider_test.go @@ -42,7 +42,7 @@ func TestGRPCServer_ListProvider(t *testing.T) { }, } - mockedProviderService.EXPECT().List(mock.AnythingOfType("*context.emptyCtx"), provider.Filter{}).Return(dummyResult, nil).Once() + mockedProviderService.EXPECT().List(mock.AnythingOfType("context.todoCtx"), provider.Filter{}).Return(dummyResult, nil).Once() res, err := dummyGRPCServer.ListProviders(ctx, &sirenv1beta1.ListProvidersRequest{}) assert.Nil(t, err) assert.Equal(t, 1, len(res.GetProviders())) @@ -55,7 +55,7 @@ func TestGRPCServer_ListProvider(t *testing.T) { mockedProviderService := &mocks.ProviderService{} dummyGRPCServer := v1beta1.NewGRPCServer(nil, log.NewNoop(), api.HeadersConfig{}, &api.Deps{ProviderService: mockedProviderService}) - mockedProviderService.EXPECT().List(mock.AnythingOfType("*context.emptyCtx"), provider.Filter{}).Return(nil, errors.New("random error")).Once() + mockedProviderService.EXPECT().List(mock.AnythingOfType("context.todoCtx"), provider.Filter{}).Return(nil, errors.New("random error")).Once() res, err := dummyGRPCServer.ListProviders(ctx, &sirenv1beta1.ListProvidersRequest{}) assert.Nil(t, res) assert.EqualError(t, err, "rpc error: code = Internal desc = some unexpected error occurred") @@ -79,7 +79,7 @@ func TestGRPCServer_ListProvider(t *testing.T) { }, } - mockedProviderService.EXPECT().List(mock.AnythingOfType("*context.emptyCtx"), provider.Filter{}).Return(dummyResult, nil).Once() + mockedProviderService.EXPECT().List(mock.AnythingOfType("context.todoCtx"), provider.Filter{}).Return(dummyResult, nil).Once() res, err := dummyGRPCServer.ListProviders(ctx, &sirenv1beta1.ListProvidersRequest{}) assert.Nil(t, res) assert.EqualError(t, err, "rpc error: code = Internal desc = some unexpected error occurred") @@ -116,7 +116,7 @@ func TestGRPCServer_CreateProvider(t *testing.T) { mockedProviderService := &mocks.ProviderService{} dummyGRPCServer := v1beta1.NewGRPCServer(nil, log.NewNoop(), api.HeadersConfig{}, &api.Deps{ProviderService: mockedProviderService}) - mockedProviderService.EXPECT().Create(mock.AnythingOfType("*context.emptyCtx"), payload).Run(func(_a0 context.Context, _a1 *provider.Provider) { + mockedProviderService.EXPECT().Create(mock.AnythingOfType("context.todoCtx"), payload).Run(func(_a0 context.Context, _a1 *provider.Provider) { _a1.ID = testID }).Return(nil).Once() res, err := dummyGRPCServer.CreateProvider(ctx, dummyReq) @@ -128,7 +128,7 @@ func TestGRPCServer_CreateProvider(t *testing.T) { mockedProviderService := &mocks.ProviderService{} dummyGRPCServer := v1beta1.NewGRPCServer(nil, log.NewNoop(), api.HeadersConfig{}, &api.Deps{ProviderService: mockedProviderService}) - mockedProviderService.EXPECT().Create(mock.AnythingOfType("*context.emptyCtx"), payload).Return(errors.ErrInvalid).Once() + mockedProviderService.EXPECT().Create(mock.AnythingOfType("context.todoCtx"), payload).Return(errors.ErrInvalid).Once() res, err := dummyGRPCServer.CreateProvider(ctx, dummyReq) assert.Nil(t, res) assert.EqualError(t, err, "rpc error: code = InvalidArgument desc = request is not valid") @@ -138,7 +138,7 @@ func TestGRPCServer_CreateProvider(t *testing.T) { mockedProviderService := &mocks.ProviderService{} dummyGRPCServer := v1beta1.NewGRPCServer(nil, log.NewNoop(), api.HeadersConfig{}, &api.Deps{ProviderService: mockedProviderService}) - mockedProviderService.EXPECT().Create(mock.AnythingOfType("*context.emptyCtx"), payload).Return(errors.ErrConflict).Once() + mockedProviderService.EXPECT().Create(mock.AnythingOfType("context.todoCtx"), payload).Return(errors.ErrConflict).Once() res, err := dummyGRPCServer.CreateProvider(ctx, dummyReq) assert.Nil(t, res) assert.EqualError(t, err, "rpc error: code = AlreadyExists desc = an entity with conflicting identifier exists") @@ -148,7 +148,7 @@ func TestGRPCServer_CreateProvider(t *testing.T) { mockedProviderService := &mocks.ProviderService{} dummyGRPCServer := v1beta1.NewGRPCServer(nil, log.NewNoop(), api.HeadersConfig{}, &api.Deps{ProviderService: mockedProviderService}) - mockedProviderService.EXPECT().Create(mock.AnythingOfType("*context.emptyCtx"), payload).Return(errors.New("random error")).Once() + mockedProviderService.EXPECT().Create(mock.AnythingOfType("context.todoCtx"), payload).Return(errors.New("random error")).Once() res, err := dummyGRPCServer.CreateProvider(ctx, dummyReq) assert.Nil(t, res) assert.EqualError(t, err, "rpc error: code = Internal desc = some unexpected error occurred") @@ -181,7 +181,7 @@ func TestGRPCServer_GetProvider(t *testing.T) { UpdatedAt: time.Now(), } - mockedProviderService.EXPECT().Get(mock.AnythingOfType("*context.emptyCtx"), providerId).Return(dummyResult, nil).Once() + mockedProviderService.EXPECT().Get(mock.AnythingOfType("context.todoCtx"), providerId).Return(dummyResult, nil).Once() res, err := dummyGRPCServer.GetProvider(ctx, dummyReq) assert.Nil(t, err) @@ -195,7 +195,7 @@ func TestGRPCServer_GetProvider(t *testing.T) { mockedProviderService := &mocks.ProviderService{} dummyGRPCServer := v1beta1.NewGRPCServer(nil, log.NewNoop(), api.HeadersConfig{}, &api.Deps{ProviderService: mockedProviderService}) - mockedProviderService.EXPECT().Get(mock.AnythingOfType("*context.emptyCtx"), providerId). + mockedProviderService.EXPECT().Get(mock.AnythingOfType("context.todoCtx"), providerId). Return(nil, errors.ErrNotFound).Once() res, err := dummyGRPCServer.GetProvider(ctx, dummyReq) @@ -217,7 +217,7 @@ func TestGRPCServer_GetProvider(t *testing.T) { UpdatedAt: time.Now(), } - mockedProviderService.EXPECT().Get(mock.AnythingOfType("*context.emptyCtx"), providerId). + mockedProviderService.EXPECT().Get(mock.AnythingOfType("context.todoCtx"), providerId). Return(dummyResult, errors.New("random error")).Once() res, err := dummyGRPCServer.GetProvider(ctx, dummyReq) @@ -241,7 +241,7 @@ func TestGRPCServer_GetProvider(t *testing.T) { UpdatedAt: time.Now(), } - mockedProviderService.EXPECT().Get(mock.AnythingOfType("*context.emptyCtx"), providerId). + mockedProviderService.EXPECT().Get(mock.AnythingOfType("context.todoCtx"), providerId). Return(dummyResult, nil).Once() res, err := dummyGRPCServer.GetProvider(ctx, dummyReq) assert.Nil(t, res) @@ -279,7 +279,7 @@ func TestGRPCServer_UpdateProvider(t *testing.T) { mockedProviderService := &mocks.ProviderService{} dummyGRPCServer := v1beta1.NewGRPCServer(nil, log.NewNoop(), api.HeadersConfig{}, &api.Deps{ProviderService: mockedProviderService}) - mockedProviderService.EXPECT().Update(mock.AnythingOfType("*context.emptyCtx"), payload).Run(func(_a0 context.Context, _a1 *provider.Provider) { + mockedProviderService.EXPECT().Update(mock.AnythingOfType("context.todoCtx"), payload).Run(func(_a0 context.Context, _a1 *provider.Provider) { _a1.ID = testID }).Return(nil).Once() res, err := dummyGRPCServer.UpdateProvider(ctx, dummyReq) @@ -291,7 +291,7 @@ func TestGRPCServer_UpdateProvider(t *testing.T) { mockedProviderService := &mocks.ProviderService{} dummyGRPCServer := v1beta1.NewGRPCServer(nil, log.NewNoop(), api.HeadersConfig{}, &api.Deps{ProviderService: mockedProviderService}) - mockedProviderService.EXPECT().Update(mock.AnythingOfType("*context.emptyCtx"), payload).Return(errors.ErrInvalid).Once() + mockedProviderService.EXPECT().Update(mock.AnythingOfType("context.todoCtx"), payload).Return(errors.ErrInvalid).Once() res, err := dummyGRPCServer.UpdateProvider(ctx, dummyReq) assert.Nil(t, res) assert.EqualError(t, err, "rpc error: code = InvalidArgument desc = request is not valid") @@ -301,7 +301,7 @@ func TestGRPCServer_UpdateProvider(t *testing.T) { mockedProviderService := &mocks.ProviderService{} dummyGRPCServer := v1beta1.NewGRPCServer(nil, log.NewNoop(), api.HeadersConfig{}, &api.Deps{ProviderService: mockedProviderService}) - mockedProviderService.EXPECT().Update(mock.AnythingOfType("*context.emptyCtx"), payload).Return(errors.ErrConflict).Once() + mockedProviderService.EXPECT().Update(mock.AnythingOfType("context.todoCtx"), payload).Return(errors.ErrConflict).Once() res, err := dummyGRPCServer.UpdateProvider(ctx, dummyReq) assert.Nil(t, res) assert.EqualError(t, err, "rpc error: code = AlreadyExists desc = an entity with conflicting identifier exists") @@ -311,7 +311,7 @@ func TestGRPCServer_UpdateProvider(t *testing.T) { mockedProviderService := &mocks.ProviderService{} dummyGRPCServer := v1beta1.NewGRPCServer(nil, log.NewNoop(), api.HeadersConfig{}, &api.Deps{ProviderService: mockedProviderService}) - mockedProviderService.EXPECT().Update(mock.AnythingOfType("*context.emptyCtx"), payload).Return(errors.New("random error")).Once() + mockedProviderService.EXPECT().Update(mock.AnythingOfType("context.todoCtx"), payload).Return(errors.New("random error")).Once() res, err := dummyGRPCServer.UpdateProvider(ctx, dummyReq) assert.Nil(t, res) assert.EqualError(t, err, "rpc error: code = Internal desc = some unexpected error occurred") @@ -328,8 +328,8 @@ func TestGRPCServer_DeleteProvider(t *testing.T) { mockedProviderService := &mocks.ProviderService{} dummyGRPCServer := v1beta1.NewGRPCServer(nil, log.NewNoop(), api.HeadersConfig{}, &api.Deps{ProviderService: mockedProviderService}) - mockedProviderService.EXPECT().Delete(mock.AnythingOfType("*context.emptyCtx"), providerId).Return(nil).Once() - res, err := dummyGRPCServer.DeleteProvider(context.Background(), dummyReq) + mockedProviderService.EXPECT().Delete(mock.AnythingOfType("context.todoCtx"), providerId).Return(nil).Once() + res, err := dummyGRPCServer.DeleteProvider(context.TODO(), dummyReq) assert.Nil(t, err) assert.Equal(t, "", res.String()) }) @@ -338,8 +338,8 @@ func TestGRPCServer_DeleteProvider(t *testing.T) { mockedProviderService := &mocks.ProviderService{} dummyGRPCServer := v1beta1.NewGRPCServer(nil, log.NewNoop(), api.HeadersConfig{}, &api.Deps{ProviderService: mockedProviderService}) - mockedProviderService.EXPECT().Delete(mock.AnythingOfType("*context.emptyCtx"), providerId).Return(errors.New("random error")).Once() - res, err := dummyGRPCServer.DeleteProvider(context.Background(), dummyReq) + mockedProviderService.EXPECT().Delete(mock.AnythingOfType("context.todoCtx"), providerId).Return(errors.New("random error")).Once() + res, err := dummyGRPCServer.DeleteProvider(context.TODO(), dummyReq) assert.Nil(t, res) assert.EqualError(t, err, "rpc error: code = Internal desc = some unexpected error occurred") }) diff --git a/internal/api/v1beta1/receiver_test.go b/internal/api/v1beta1/receiver_test.go index b5cf7e53..c69babb7 100644 --- a/internal/api/v1beta1/receiver_test.go +++ b/internal/api/v1beta1/receiver_test.go @@ -37,10 +37,10 @@ func TestGRPCServer_ListReceiver(t *testing.T) { t.Run("should return list of all receiver", func(t *testing.T) { mockedReceiverService := &mocks.ReceiverService{} dummyGRPCServer := v1beta1.NewGRPCServer(nil, log.NewNoop(), api.HeadersConfig{}, &api.Deps{ReceiverService: mockedReceiverService}) - mockedReceiverService.EXPECT().List(mock.AnythingOfType("*context.emptyCtx"), receiver.Filter{}). + mockedReceiverService.EXPECT().List(mock.AnythingOfType("context.todoCtx"), receiver.Filter{}). Return(dummyResult, nil).Once() - res, err := dummyGRPCServer.ListReceivers(context.Background(), &sirenv1beta1.ListReceiversRequest{}) + res, err := dummyGRPCServer.ListReceivers(context.TODO(), &sirenv1beta1.ListReceiversRequest{}) assert.Nil(t, err) assert.Equal(t, 1, len(res.GetReceivers())) assert.Equal(t, uint64(1), res.GetReceivers()[0].GetId()) @@ -53,10 +53,10 @@ func TestGRPCServer_ListReceiver(t *testing.T) { t.Run("should return error Internal if getting providers failed", func(t *testing.T) { mockedReceiverService := &mocks.ReceiverService{} dummyGRPCServer := v1beta1.NewGRPCServer(nil, log.NewNoop(), api.HeadersConfig{}, &api.Deps{ReceiverService: mockedReceiverService}) - mockedReceiverService.EXPECT().List(mock.AnythingOfType("*context.emptyCtx"), receiver.Filter{}). + mockedReceiverService.EXPECT().List(mock.AnythingOfType("context.todoCtx"), receiver.Filter{}). Return(nil, errors.New("random error")) - res, err := dummyGRPCServer.ListReceivers(context.Background(), &sirenv1beta1.ListReceiversRequest{}) + res, err := dummyGRPCServer.ListReceivers(context.TODO(), &sirenv1beta1.ListReceiversRequest{}) assert.Nil(t, res) assert.EqualError(t, err, "rpc error: code = Internal desc = some unexpected error occurred") }) @@ -77,9 +77,9 @@ func TestGRPCServer_ListReceiver(t *testing.T) { }, } - mockedReceiverService.EXPECT().List(mock.AnythingOfType("*context.emptyCtx"), receiver.Filter{}). + mockedReceiverService.EXPECT().List(mock.AnythingOfType("context.todoCtx"), receiver.Filter{}). Return(dummyResult, nil) - res, err := dummyGRPCServer.ListReceivers(context.Background(), &sirenv1beta1.ListReceiversRequest{}) + res, err := dummyGRPCServer.ListReceivers(context.TODO(), &sirenv1beta1.ListReceiversRequest{}) assert.Nil(t, res) assert.EqualError(t, err, "rpc error: code = Internal desc = some unexpected error occurred") }) @@ -112,10 +112,10 @@ func TestGRPCServer_CreateReceiver(t *testing.T) { mockedReceiverService := &mocks.ReceiverService{} dummyGRPCServer := v1beta1.NewGRPCServer(nil, log.NewNoop(), api.HeadersConfig{}, &api.Deps{ReceiverService: mockedReceiverService}) - mockedReceiverService.EXPECT().Create(mock.AnythingOfType("*context.emptyCtx"), payload).Run(func(ctx context.Context, rcv *receiver.Receiver) { + mockedReceiverService.EXPECT().Create(mock.AnythingOfType("context.todoCtx"), payload).Run(func(ctx context.Context, rcv *receiver.Receiver) { rcv.ID = generatedID }).Return(nil).Once() - res, err := dummyGRPCServer.CreateReceiver(context.Background(), dummyReq) + res, err := dummyGRPCServer.CreateReceiver(context.TODO(), dummyReq) assert.Nil(t, err) assert.Equal(t, generatedID, res.GetId()) }) @@ -124,9 +124,9 @@ func TestGRPCServer_CreateReceiver(t *testing.T) { mockedReceiverService := &mocks.ReceiverService{} dummyGRPCServer := v1beta1.NewGRPCServer(nil, log.NewNoop(), api.HeadersConfig{}, &api.Deps{ReceiverService: mockedReceiverService}) - mockedReceiverService.EXPECT().Create(mock.AnythingOfType("*context.emptyCtx"), payload).Return(errors.ErrInvalid).Once() + mockedReceiverService.EXPECT().Create(mock.AnythingOfType("context.todoCtx"), payload).Return(errors.ErrInvalid).Once() - res, err := dummyGRPCServer.CreateReceiver(context.Background(), dummyReq) + res, err := dummyGRPCServer.CreateReceiver(context.TODO(), dummyReq) assert.EqualError(t, err, "rpc error: code = InvalidArgument desc = request is not valid") assert.Nil(t, res) @@ -136,9 +136,9 @@ func TestGRPCServer_CreateReceiver(t *testing.T) { mockedReceiverService := &mocks.ReceiverService{} dummyGRPCServer := v1beta1.NewGRPCServer(nil, log.NewNoop(), api.HeadersConfig{}, &api.Deps{ReceiverService: mockedReceiverService}) - mockedReceiverService.EXPECT().Create(mock.AnythingOfType("*context.emptyCtx"), payload).Return(errors.New("random error")).Once() + mockedReceiverService.EXPECT().Create(mock.AnythingOfType("context.todoCtx"), payload).Return(errors.New("random error")).Once() - res, err := dummyGRPCServer.CreateReceiver(context.Background(), dummyReq) + res, err := dummyGRPCServer.CreateReceiver(context.TODO(), dummyReq) assert.Nil(t, res) assert.EqualError(t, err, "rpc error: code = Internal desc = some unexpected error occurred") }) @@ -165,10 +165,10 @@ func TestGRPCServer_GetReceiver(t *testing.T) { t.Run("should return a receiver", func(t *testing.T) { mockedReceiverService := &mocks.ReceiverService{} dummyGRPCServer := v1beta1.NewGRPCServer(nil, log.NewNoop(), api.HeadersConfig{}, &api.Deps{ReceiverService: mockedReceiverService}) - mockedReceiverService.EXPECT().Get(mock.AnythingOfType("*context.emptyCtx"), receiverId, mock.AnythingOfType("receiver.GetOption")). + mockedReceiverService.EXPECT().Get(mock.AnythingOfType("context.todoCtx"), receiverId, mock.AnythingOfType("receiver.GetOption")). Return(payload, nil).Once() - res, err := dummyGRPCServer.GetReceiver(context.Background(), dummyReq) + res, err := dummyGRPCServer.GetReceiver(context.TODO(), dummyReq) assert.Nil(t, err) assert.Equal(t, "foo", res.GetReceiver().GetName()) assert.Equal(t, "bar", res.GetReceiver().GetType()) @@ -179,10 +179,10 @@ func TestGRPCServer_GetReceiver(t *testing.T) { t.Run("should return error Not Found if no receiver found", func(t *testing.T) { mockedReceiverService := &mocks.ReceiverService{} dummyGRPCServer := v1beta1.NewGRPCServer(nil, log.NewNoop(), api.HeadersConfig{}, &api.Deps{ReceiverService: mockedReceiverService}) - mockedReceiverService.EXPECT().Get(mock.AnythingOfType("*context.emptyCtx"), receiverId, mock.AnythingOfType("receiver.GetOption")). + mockedReceiverService.EXPECT().Get(mock.AnythingOfType("context.todoCtx"), receiverId, mock.AnythingOfType("receiver.GetOption")). Return(nil, errors.ErrNotFound).Once() - res, err := dummyGRPCServer.GetReceiver(context.Background(), dummyReq) + res, err := dummyGRPCServer.GetReceiver(context.TODO(), dummyReq) assert.Nil(t, res) assert.EqualError(t, err, "rpc error: code = NotFound desc = requested entity not found") }) @@ -190,10 +190,10 @@ func TestGRPCServer_GetReceiver(t *testing.T) { t.Run("should return error Internal if getting receiver failed", func(t *testing.T) { mockedReceiverService := &mocks.ReceiverService{} dummyGRPCServer := v1beta1.NewGRPCServer(nil, log.NewNoop(), api.HeadersConfig{}, &api.Deps{ReceiverService: mockedReceiverService}) - mockedReceiverService.EXPECT().Get(mock.AnythingOfType("*context.emptyCtx"), receiverId, mock.AnythingOfType("receiver.GetOption")). + mockedReceiverService.EXPECT().Get(mock.AnythingOfType("context.todoCtx"), receiverId, mock.AnythingOfType("receiver.GetOption")). Return(payload, errors.New("random error")).Once() - res, err := dummyGRPCServer.GetReceiver(context.Background(), dummyReq) + res, err := dummyGRPCServer.GetReceiver(context.TODO(), dummyReq) assert.Nil(t, res) assert.EqualError(t, err, "rpc error: code = Internal desc = some unexpected error occurred") }) @@ -210,9 +210,9 @@ func TestGRPCServer_GetReceiver(t *testing.T) { Configurations: configurations, } - mockedReceiverService.EXPECT().Get(mock.AnythingOfType("*context.emptyCtx"), receiverId, mock.AnythingOfType("receiver.GetOption")). + mockedReceiverService.EXPECT().Get(mock.AnythingOfType("context.todoCtx"), receiverId, mock.AnythingOfType("receiver.GetOption")). Return(payload, nil) - res, err := dummyGRPCServer.GetReceiver(context.Background(), dummyReq) + res, err := dummyGRPCServer.GetReceiver(context.TODO(), dummyReq) assert.Nil(t, res) assert.EqualError(t, err, "rpc error: code = Internal desc = some unexpected error occurred") }) @@ -230,9 +230,9 @@ func TestGRPCServer_GetReceiver(t *testing.T) { Data: data, } - mockedReceiverService.EXPECT().Get(mock.AnythingOfType("*context.emptyCtx"), receiverId, mock.AnythingOfType("receiver.GetOption")). + mockedReceiverService.EXPECT().Get(mock.AnythingOfType("context.todoCtx"), receiverId, mock.AnythingOfType("receiver.GetOption")). Return(payload, nil) - res, err := dummyGRPCServer.GetReceiver(context.Background(), dummyReq) + res, err := dummyGRPCServer.GetReceiver(context.TODO(), dummyReq) assert.Nil(t, res) assert.EqualError(t, err, "rpc error: code = Internal desc = some unexpected error occurred") }) @@ -265,11 +265,11 @@ func TestGRPCServer_UpdateReceiver(t *testing.T) { mockedReceiverService := &mocks.ReceiverService{} dummyGRPCServer := v1beta1.NewGRPCServer(nil, log.NewNoop(), api.HeadersConfig{}, &api.Deps{ReceiverService: mockedReceiverService}) - mockedReceiverService.EXPECT().Update(mock.AnythingOfType("*context.emptyCtx"), payload).Run(func(ctx context.Context, rcv *receiver.Receiver) { + mockedReceiverService.EXPECT().Update(mock.AnythingOfType("context.todoCtx"), payload).Run(func(ctx context.Context, rcv *receiver.Receiver) { rcv.ID = payload.ID }).Return(nil).Once() - res, err := dummyGRPCServer.UpdateReceiver(context.Background(), dummyReq) + res, err := dummyGRPCServer.UpdateReceiver(context.TODO(), dummyReq) assert.Nil(t, err) assert.Equal(t, payload.ID, res.GetId()) }) @@ -278,9 +278,9 @@ func TestGRPCServer_UpdateReceiver(t *testing.T) { mockedReceiverService := &mocks.ReceiverService{} dummyGRPCServer := v1beta1.NewGRPCServer(nil, log.NewNoop(), api.HeadersConfig{}, &api.Deps{ReceiverService: mockedReceiverService}) - mockedReceiverService.EXPECT().Update(mock.AnythingOfType("*context.emptyCtx"), payload).Return(errors.ErrInvalid).Once() + mockedReceiverService.EXPECT().Update(mock.AnythingOfType("context.todoCtx"), payload).Return(errors.ErrInvalid).Once() - res, err := dummyGRPCServer.UpdateReceiver(context.Background(), dummyReq) + res, err := dummyGRPCServer.UpdateReceiver(context.TODO(), dummyReq) assert.EqualError(t, err, "rpc error: code = InvalidArgument desc = request is not valid") assert.Nil(t, res) }) @@ -289,9 +289,9 @@ func TestGRPCServer_UpdateReceiver(t *testing.T) { mockedReceiverService := &mocks.ReceiverService{} dummyGRPCServer := v1beta1.NewGRPCServer(nil, log.NewNoop(), api.HeadersConfig{}, &api.Deps{ReceiverService: mockedReceiverService}) - mockedReceiverService.EXPECT().Update(mock.AnythingOfType("*context.emptyCtx"), payload).Return(errors.New("random error")) + mockedReceiverService.EXPECT().Update(mock.AnythingOfType("context.todoCtx"), payload).Return(errors.New("random error")) - res, err := dummyGRPCServer.UpdateReceiver(context.Background(), dummyReq) + res, err := dummyGRPCServer.UpdateReceiver(context.TODO(), dummyReq) assert.Nil(t, res) assert.EqualError(t, err, "rpc error: code = Internal desc = some unexpected error occurred") }) @@ -306,10 +306,10 @@ func TestGRPCServer_DeleteReceiver(t *testing.T) { t.Run("should delete receiver object", func(t *testing.T) { mockedReceiverService := &mocks.ReceiverService{} dummyGRPCServer := v1beta1.NewGRPCServer(nil, log.NewNoop(), api.HeadersConfig{}, &api.Deps{ReceiverService: mockedReceiverService}) - mockedReceiverService.EXPECT().Delete(mock.AnythingOfType("*context.emptyCtx"), providerId). + mockedReceiverService.EXPECT().Delete(mock.AnythingOfType("context.todoCtx"), providerId). Return(nil).Once() - res, err := dummyGRPCServer.DeleteReceiver(context.Background(), dummyReq) + res, err := dummyGRPCServer.DeleteReceiver(context.TODO(), dummyReq) assert.Nil(t, err) assert.Equal(t, "", res.String()) }) @@ -317,10 +317,10 @@ func TestGRPCServer_DeleteReceiver(t *testing.T) { t.Run("should return error Internal if deleting receiver failed", func(t *testing.T) { mockedReceiverService := &mocks.ReceiverService{} dummyGRPCServer := v1beta1.NewGRPCServer(nil, log.NewNoop(), api.HeadersConfig{}, &api.Deps{ReceiverService: mockedReceiverService}) - mockedReceiverService.EXPECT().Delete(mock.AnythingOfType("*context.emptyCtx"), providerId). + mockedReceiverService.EXPECT().Delete(mock.AnythingOfType("context.todoCtx"), providerId). Return(errors.New("random error")).Once() - res, err := dummyGRPCServer.DeleteReceiver(context.Background(), dummyReq) + res, err := dummyGRPCServer.DeleteReceiver(context.TODO(), dummyReq) assert.Nil(t, res) assert.EqualError(t, err, "rpc error: code = Internal desc = some unexpected error occurred") }) diff --git a/internal/api/v1beta1/rule_test.go b/internal/api/v1beta1/rule_test.go index 4243e724..c32035b0 100644 --- a/internal/api/v1beta1/rule_test.go +++ b/internal/api/v1beta1/rule_test.go @@ -26,7 +26,7 @@ func TestGRPCServer_ListRules(t *testing.T) { } t.Run("should return stored rules", func(t *testing.T) { - ctx := context.Background() + ctx := context.TODO() mockedRuleService := &mocks.RuleService{} dummyResult := []rule.Rule{ { @@ -70,7 +70,7 @@ func TestGRPCServer_ListRules(t *testing.T) { }) t.Run("should return error Internal if getting rules failed", func(t *testing.T) { - ctx := context.Background() + ctx := context.TODO() mockedRuleService := &mocks.RuleService{} dummyGRPCServer := v1beta1.NewGRPCServer(nil, log.NewNoop(), api.HeadersConfig{}, &api.Deps{RuleService: mockedRuleService}) @@ -122,7 +122,7 @@ func TestGRPCServer_UpdateRules(t *testing.T) { } t.Run("should update rule", func(t *testing.T) { - ctx := context.Background() + ctx := context.TODO() mockedRuleService := &mocks.RuleService{} dummyGRPCServer := v1beta1.NewGRPCServer(nil, log.NewNoop(), api.HeadersConfig{}, &api.Deps{RuleService: mockedRuleService}) dummyResult := &rule.Rule{} @@ -142,7 +142,7 @@ func TestGRPCServer_UpdateRules(t *testing.T) { }) t.Run("should return error AlreadyExist if update rules return err conflict", func(t *testing.T) { - ctx := context.Background() + ctx := context.TODO() mockedRuleService := &mocks.RuleService{} dummyGRPCServer := v1beta1.NewGRPCServer(nil, log.NewNoop(), api.HeadersConfig{}, &api.Deps{RuleService: mockedRuleService}) @@ -154,7 +154,7 @@ func TestGRPCServer_UpdateRules(t *testing.T) { }) t.Run("should return error Internal if getting rules failed", func(t *testing.T) { - ctx := context.Background() + ctx := context.TODO() mockedRuleService := &mocks.RuleService{} dummyGRPCServer := v1beta1.NewGRPCServer(nil, log.NewNoop(), api.HeadersConfig{}, &api.Deps{RuleService: mockedRuleService}) diff --git a/internal/api/v1beta1/silence_test.go b/internal/api/v1beta1/silence_test.go index 58502536..1ec8880c 100644 --- a/internal/api/v1beta1/silence_test.go +++ b/internal/api/v1beta1/silence_test.go @@ -39,7 +39,7 @@ func TestGRPCServer_CreateSilence(t *testing.T) { { name: "return silence id when successfully created silence", setup: func(ss *mocks.SilenceService) { - ss.EXPECT().Create(mock.AnythingOfType("*context.emptyCtx"), mockSilenceData).Return("123", nil) + ss.EXPECT().Create(mock.AnythingOfType("context.todoCtx"), mockSilenceData).Return("123", nil) }, req: &sirenv1beta1.CreateSilenceRequest{ NamespaceId: mockSilenceData.NamespaceID, @@ -57,7 +57,7 @@ func TestGRPCServer_CreateSilence(t *testing.T) { { name: "return error if service create return error", setup: func(ss *mocks.SilenceService) { - ss.EXPECT().Create(mock.AnythingOfType("*context.emptyCtx"), mockSilenceData).Return("", errors.New("some error")) + ss.EXPECT().Create(mock.AnythingOfType("context.todoCtx"), mockSilenceData).Return("", errors.New("some error")) }, req: &sirenv1beta1.CreateSilenceRequest{ NamespaceId: mockSilenceData.NamespaceID, @@ -111,7 +111,7 @@ func TestGRPCServer_ListSilences(t *testing.T) { { name: "return silences when successfully list silences", setup: func(ss *mocks.SilenceService) { - ss.EXPECT().List(mock.AnythingOfType("*context.emptyCtx"), mock.AnythingOfType("silence.Filter")).Return([]silence.Silence{ + ss.EXPECT().List(mock.AnythingOfType("context.todoCtx"), mock.AnythingOfType("silence.Filter")).Return([]silence.Silence{ mockSilenceData, }, nil) }, @@ -131,7 +131,7 @@ func TestGRPCServer_ListSilences(t *testing.T) { { name: "return error if service list return error", setup: func(ss *mocks.SilenceService) { - ss.EXPECT().List(mock.AnythingOfType("*context.emptyCtx"), mock.AnythingOfType("silence.Filter")).Return(nil, errors.New("some error")) + ss.EXPECT().List(mock.AnythingOfType("context.todoCtx"), mock.AnythingOfType("silence.Filter")).Return(nil, errors.New("some error")) }, wantErr: true, }, @@ -179,7 +179,7 @@ func TestGRPCServer_GetSilence(t *testing.T) { { name: "return silence when successfully get silence", setup: func(ss *mocks.SilenceService) { - ss.EXPECT().Get(mock.AnythingOfType("*context.emptyCtx"), mockSilenceData.ID).Return(mockSilenceData, nil) + ss.EXPECT().Get(mock.AnythingOfType("context.todoCtx"), mockSilenceData.ID).Return(mockSilenceData, nil) }, req: &sirenv1beta1.GetSilenceRequest{ Id: mockSilenceData.ID, @@ -198,7 +198,7 @@ func TestGRPCServer_GetSilence(t *testing.T) { { name: "return error if service get return error", setup: func(ss *mocks.SilenceService) { - ss.EXPECT().Get(mock.AnythingOfType("*context.emptyCtx"), mockSilenceData.ID).Return(silence.Silence{}, errors.New("some error")) + ss.EXPECT().Get(mock.AnythingOfType("context.todoCtx"), mockSilenceData.ID).Return(silence.Silence{}, errors.New("some error")) }, req: &sirenv1beta1.GetSilenceRequest{ Id: mockSilenceData.ID, @@ -248,7 +248,7 @@ func TestGRPCServer_ExpireSilence(t *testing.T) { { name: "return success when successfully deleted silence", setup: func(ss *mocks.SilenceService) { - ss.EXPECT().Delete(mock.AnythingOfType("*context.emptyCtx"), mockSilenceData.ID).Return(nil) + ss.EXPECT().Delete(mock.AnythingOfType("context.todoCtx"), mockSilenceData.ID).Return(nil) }, req: &sirenv1beta1.ExpireSilenceRequest{ Id: mockSilenceData.ID, @@ -258,7 +258,7 @@ func TestGRPCServer_ExpireSilence(t *testing.T) { { name: "return error if service delete return error", setup: func(ss *mocks.SilenceService) { - ss.EXPECT().Delete(mock.AnythingOfType("*context.emptyCtx"), mockSilenceData.ID).Return(errors.New("some error")) + ss.EXPECT().Delete(mock.AnythingOfType("context.todoCtx"), mockSilenceData.ID).Return(errors.New("some error")) }, req: &sirenv1beta1.ExpireSilenceRequest{ Id: mockSilenceData.ID, diff --git a/internal/api/v1beta1/subscription_test.go b/internal/api/v1beta1/subscription_test.go index 128da260..a9d2d543 100644 --- a/internal/api/v1beta1/subscription_test.go +++ b/internal/api/v1beta1/subscription_test.go @@ -57,8 +57,8 @@ func TestGRPCServer_ListSubscriptions(t *testing.T) { }, } - mockedSubscriptionService.EXPECT().List(context.Background(), subscription.Filter{}).Return(dummyResult, nil).Once() - res, err := dummyGRPCServer.ListSubscriptions(context.Background(), &sirenv1beta1.ListSubscriptionsRequest{}) + mockedSubscriptionService.EXPECT().List(context.TODO(), subscription.Filter{}).Return(dummyResult, nil).Once() + res, err := dummyGRPCServer.ListSubscriptions(context.TODO(), &sirenv1beta1.ListSubscriptionsRequest{}) assert.Nil(t, err) assert.Equal(t, 1, len(res.GetSubscriptions())) assert.Equal(t, uint64(1), res.GetSubscriptions()[0].GetId()) @@ -72,8 +72,8 @@ func TestGRPCServer_ListSubscriptions(t *testing.T) { dummyGRPCServer := v1beta1.NewGRPCServer(nil, log.NewNoop(), api.HeadersConfig{}, &api.Deps{SubscriptionService: mockedSubscriptionService}) - mockedSubscriptionService.EXPECT().List(context.Background(), subscription.Filter{}).Return(nil, errors.New("random error")).Once() - res, err := dummyGRPCServer.ListSubscriptions(context.Background(), &sirenv1beta1.ListSubscriptionsRequest{}) + mockedSubscriptionService.EXPECT().List(context.TODO(), subscription.Filter{}).Return(nil, errors.New("random error")).Once() + res, err := dummyGRPCServer.ListSubscriptions(context.TODO(), &sirenv1beta1.ListSubscriptionsRequest{}) assert.Nil(t, res) assert.EqualError(t, err, "rpc error: code = Internal desc = some unexpected error occurred") }) @@ -96,8 +96,8 @@ func TestGRPCServer_GetSubscription(t *testing.T) { UpdatedAt: time.Now(), } - mockedSubscriptionService.EXPECT().Get(context.Background(), uint64(1)).Return(dummyResult, nil).Once() - res, err := dummyGRPCServer.GetSubscription(context.Background(), &sirenv1beta1.GetSubscriptionRequest{Id: 1}) + mockedSubscriptionService.EXPECT().Get(context.TODO(), uint64(1)).Return(dummyResult, nil).Once() + res, err := dummyGRPCServer.GetSubscription(context.TODO(), &sirenv1beta1.GetSubscriptionRequest{Id: 1}) assert.Nil(t, err) assert.Equal(t, uint64(1), res.GetSubscription().GetId()) assert.Equal(t, "bar", res.GetSubscription().GetMatch()["foo"]) @@ -108,8 +108,8 @@ func TestGRPCServer_GetSubscription(t *testing.T) { t.Run("should return error Not Found if subscriptions not found", func(t *testing.T) { mockedSubscriptionService := &mocks.SubscriptionService{} dummyGRPCServer := v1beta1.NewGRPCServer(nil, log.NewNoop(), api.HeadersConfig{}, &api.Deps{SubscriptionService: mockedSubscriptionService}) - mockedSubscriptionService.EXPECT().Get(context.Background(), uint64(1)).Return(nil, errors.ErrNotFound).Once() - res, err := dummyGRPCServer.GetSubscription(context.Background(), &sirenv1beta1.GetSubscriptionRequest{Id: 1}) + mockedSubscriptionService.EXPECT().Get(context.TODO(), uint64(1)).Return(nil, errors.ErrNotFound).Once() + res, err := dummyGRPCServer.GetSubscription(context.TODO(), &sirenv1beta1.GetSubscriptionRequest{Id: 1}) assert.Nil(t, res) assert.EqualError(t, err, "rpc error: code = NotFound desc = requested entity not found") }) @@ -117,9 +117,9 @@ func TestGRPCServer_GetSubscription(t *testing.T) { t.Run("should return error Internal if getting subscription fails", func(t *testing.T) { mockedSubscriptionService := &mocks.SubscriptionService{} dummyGRPCServer := v1beta1.NewGRPCServer(nil, log.NewNoop(), api.HeadersConfig{}, &api.Deps{SubscriptionService: mockedSubscriptionService}) - mockedSubscriptionService.EXPECT().Get(context.Background(), uint64(1)). + mockedSubscriptionService.EXPECT().Get(context.TODO(), uint64(1)). Return(nil, errors.New("random error")).Once() - res, err := dummyGRPCServer.GetSubscription(context.Background(), &sirenv1beta1.GetSubscriptionRequest{Id: 1}) + res, err := dummyGRPCServer.GetSubscription(context.TODO(), &sirenv1beta1.GetSubscriptionRequest{Id: 1}) assert.Nil(t, res) assert.EqualError(t, err, "rpc error: code = Internal desc = some unexpected error occurred") }) @@ -156,11 +156,11 @@ func TestGRPCServer_CreateSubscription(t *testing.T) { mockedSubscriptionService := &mocks.SubscriptionService{} dummyGRPCServer := v1beta1.NewGRPCServer(nil, log.NewNoop(), api.HeadersConfig{}, &api.Deps{SubscriptionService: mockedSubscriptionService}) - mockedSubscriptionService.EXPECT().Create(context.Background(), payload).Run(func(_a0 context.Context, _a1 *subscription.Subscription) { + mockedSubscriptionService.EXPECT().Create(context.TODO(), payload).Run(func(_a0 context.Context, _a1 *subscription.Subscription) { _a1.ID = dummyResult.ID }).Return(nil).Once() - res, err := dummyGRPCServer.CreateSubscription(context.Background(), &sirenv1beta1.CreateSubscriptionRequest{ + res, err := dummyGRPCServer.CreateSubscription(context.TODO(), &sirenv1beta1.CreateSubscriptionRequest{ Namespace: 1, Urn: "foo", Receivers: []*sirenv1beta1.ReceiverMetadata{{Id: 1, Configuration: configMapPB}}, @@ -174,11 +174,11 @@ func TestGRPCServer_CreateSubscription(t *testing.T) { mockedSubscriptionService := &mocks.SubscriptionService{} dummyGRPCServer := v1beta1.NewGRPCServer(nil, log.NewNoop(), api.HeadersConfig{}, &api.Deps{SubscriptionService: mockedSubscriptionService}) - mockedSubscriptionService.EXPECT().Create(context.Background(), payload).Run(func(_a0 context.Context, _a1 *subscription.Subscription) { + mockedSubscriptionService.EXPECT().Create(context.TODO(), payload).Run(func(_a0 context.Context, _a1 *subscription.Subscription) { _a1.ID = dummyResult.ID }).Return(errors.ErrInvalid).Once() - res, err := dummyGRPCServer.CreateSubscription(context.Background(), &sirenv1beta1.CreateSubscriptionRequest{ + res, err := dummyGRPCServer.CreateSubscription(context.TODO(), &sirenv1beta1.CreateSubscriptionRequest{ Namespace: 1, Urn: "foo", Receivers: []*sirenv1beta1.ReceiverMetadata{{Id: 1, Configuration: configMapPB}}, @@ -192,11 +192,11 @@ func TestGRPCServer_CreateSubscription(t *testing.T) { mockedSubscriptionService := &mocks.SubscriptionService{} dummyGRPCServer := v1beta1.NewGRPCServer(nil, log.NewNoop(), api.HeadersConfig{}, &api.Deps{SubscriptionService: mockedSubscriptionService}) - mockedSubscriptionService.EXPECT().Create(context.Background(), payload).Run(func(_a0 context.Context, _a1 *subscription.Subscription) { + mockedSubscriptionService.EXPECT().Create(context.TODO(), payload).Run(func(_a0 context.Context, _a1 *subscription.Subscription) { _a1.ID = dummyResult.ID }).Return(errors.ErrConflict).Once() - res, err := dummyGRPCServer.CreateSubscription(context.Background(), &sirenv1beta1.CreateSubscriptionRequest{ + res, err := dummyGRPCServer.CreateSubscription(context.TODO(), &sirenv1beta1.CreateSubscriptionRequest{ Namespace: 1, Urn: "foo", Receivers: []*sirenv1beta1.ReceiverMetadata{{Id: 1, Configuration: configMapPB}}, @@ -210,11 +210,11 @@ func TestGRPCServer_CreateSubscription(t *testing.T) { mockedSubscriptionService := &mocks.SubscriptionService{} dummyGRPCServer := v1beta1.NewGRPCServer(nil, log.NewNoop(), api.HeadersConfig{}, &api.Deps{SubscriptionService: mockedSubscriptionService}) - mockedSubscriptionService.EXPECT().Create(context.Background(), payload).Run(func(_a0 context.Context, _a1 *subscription.Subscription) { + mockedSubscriptionService.EXPECT().Create(context.TODO(), payload).Run(func(_a0 context.Context, _a1 *subscription.Subscription) { _a1.ID = dummyResult.ID }).Return(errors.New("random error")).Once() - res, err := dummyGRPCServer.CreateSubscription(context.Background(), &sirenv1beta1.CreateSubscriptionRequest{ + res, err := dummyGRPCServer.CreateSubscription(context.TODO(), &sirenv1beta1.CreateSubscriptionRequest{ Namespace: 1, Urn: "foo", Receivers: []*sirenv1beta1.ReceiverMetadata{{Id: 1, Configuration: configMapPB}}, @@ -251,11 +251,11 @@ func TestGRPCServer_UpdateSubscription(t *testing.T) { mockedSubscriptionService := &mocks.SubscriptionService{} dummyGRPCServer := v1beta1.NewGRPCServer(nil, log.NewNoop(), api.HeadersConfig{}, &api.Deps{SubscriptionService: mockedSubscriptionService}) - mockedSubscriptionService.EXPECT().Update(context.Background(), payload).Run(func(_a0 context.Context, _a1 *subscription.Subscription) { + mockedSubscriptionService.EXPECT().Update(context.TODO(), payload).Run(func(_a0 context.Context, _a1 *subscription.Subscription) { _a1.ID = uint64(1) }).Return(nil).Once() - res, err := dummyGRPCServer.UpdateSubscription(context.Background(), &sirenv1beta1.UpdateSubscriptionRequest{ + res, err := dummyGRPCServer.UpdateSubscription(context.TODO(), &sirenv1beta1.UpdateSubscriptionRequest{ Id: 1, Namespace: 10, Urn: "foo", @@ -271,9 +271,9 @@ func TestGRPCServer_UpdateSubscription(t *testing.T) { t.Run("should return error Invalid Argument if updating subscriptions return err invalid", func(t *testing.T) { mockedSubscriptionService := &mocks.SubscriptionService{} dummyGRPCServer := v1beta1.NewGRPCServer(nil, log.NewNoop(), api.HeadersConfig{}, &api.Deps{SubscriptionService: mockedSubscriptionService}) - mockedSubscriptionService.EXPECT().Update(context.Background(), payload).Return(errors.ErrInvalid).Once() + mockedSubscriptionService.EXPECT().Update(context.TODO(), payload).Return(errors.ErrInvalid).Once() - res, err := dummyGRPCServer.UpdateSubscription(context.Background(), &sirenv1beta1.UpdateSubscriptionRequest{ + res, err := dummyGRPCServer.UpdateSubscription(context.TODO(), &sirenv1beta1.UpdateSubscriptionRequest{ Id: 1, Namespace: 10, Urn: "foo", @@ -289,9 +289,9 @@ func TestGRPCServer_UpdateSubscription(t *testing.T) { t.Run("should return error AlreadyExist if updating subscriptions return err conflict", func(t *testing.T) { mockedSubscriptionService := &mocks.SubscriptionService{} dummyGRPCServer := v1beta1.NewGRPCServer(nil, log.NewNoop(), api.HeadersConfig{}, &api.Deps{SubscriptionService: mockedSubscriptionService}) - mockedSubscriptionService.EXPECT().Update(context.Background(), payload).Return(errors.ErrConflict).Once() + mockedSubscriptionService.EXPECT().Update(context.TODO(), payload).Return(errors.ErrConflict).Once() - res, err := dummyGRPCServer.UpdateSubscription(context.Background(), &sirenv1beta1.UpdateSubscriptionRequest{ + res, err := dummyGRPCServer.UpdateSubscription(context.TODO(), &sirenv1beta1.UpdateSubscriptionRequest{ Id: 1, Namespace: 10, Urn: "foo", @@ -307,9 +307,9 @@ func TestGRPCServer_UpdateSubscription(t *testing.T) { t.Run("should return error Internal if updating subscriptions fails", func(t *testing.T) { mockedSubscriptionService := &mocks.SubscriptionService{} dummyGRPCServer := v1beta1.NewGRPCServer(nil, log.NewNoop(), api.HeadersConfig{}, &api.Deps{SubscriptionService: mockedSubscriptionService}) - mockedSubscriptionService.EXPECT().Update(context.Background(), payload).Return(errors.New("random error")).Once() + mockedSubscriptionService.EXPECT().Update(context.TODO(), payload).Return(errors.New("random error")).Once() - res, err := dummyGRPCServer.UpdateSubscription(context.Background(), &sirenv1beta1.UpdateSubscriptionRequest{ + res, err := dummyGRPCServer.UpdateSubscription(context.TODO(), &sirenv1beta1.UpdateSubscriptionRequest{ Id: 1, Namespace: 10, Urn: "foo", @@ -325,9 +325,9 @@ func TestGRPCServer_UpdateSubscription(t *testing.T) { t.Run("should return error Invalid for bad requests", func(t *testing.T) { mockedSubscriptionService := &mocks.SubscriptionService{} dummyGRPCServer := v1beta1.NewGRPCServer(nil, log.NewNoop(), api.HeadersConfig{}, &api.Deps{SubscriptionService: mockedSubscriptionService}) - mockedSubscriptionService.EXPECT().Update(context.Background(), payload).Return(errors.ErrInvalid).Once() + mockedSubscriptionService.EXPECT().Update(context.TODO(), payload).Return(errors.ErrInvalid).Once() - res, err := dummyGRPCServer.UpdateSubscription(context.Background(), &sirenv1beta1.UpdateSubscriptionRequest{ + res, err := dummyGRPCServer.UpdateSubscription(context.TODO(), &sirenv1beta1.UpdateSubscriptionRequest{ Id: 1, Namespace: 10, Urn: "foo", @@ -346,8 +346,8 @@ func TestGRPCServer_DeleteSubscription(t *testing.T) { mockedSubscriptionService := &mocks.SubscriptionService{} dummyGRPCServer := v1beta1.NewGRPCServer(nil, log.NewNoop(), api.HeadersConfig{}, &api.Deps{SubscriptionService: mockedSubscriptionService}) - mockedSubscriptionService.EXPECT().Delete(context.Background(), uint64(1)).Return(nil).Once() - res, err := dummyGRPCServer.DeleteSubscription(context.Background(), &sirenv1beta1.DeleteSubscriptionRequest{Id: 1}) + mockedSubscriptionService.EXPECT().Delete(context.TODO(), uint64(1)).Return(nil).Once() + res, err := dummyGRPCServer.DeleteSubscription(context.TODO(), &sirenv1beta1.DeleteSubscriptionRequest{Id: 1}) assert.Nil(t, err) assert.Equal(t, &sirenv1beta1.DeleteSubscriptionResponse{}, res) }) @@ -356,8 +356,8 @@ func TestGRPCServer_DeleteSubscription(t *testing.T) { mockedSubscriptionService := &mocks.SubscriptionService{} dummyGRPCServer := v1beta1.NewGRPCServer(nil, log.NewNoop(), api.HeadersConfig{}, &api.Deps{SubscriptionService: mockedSubscriptionService}) - mockedSubscriptionService.EXPECT().Delete(context.Background(), uint64(1)).Return(errors.New("random error")).Once() - res, err := dummyGRPCServer.DeleteSubscription(context.Background(), &sirenv1beta1.DeleteSubscriptionRequest{Id: 1}) + mockedSubscriptionService.EXPECT().Delete(context.TODO(), uint64(1)).Return(errors.New("random error")).Once() + res, err := dummyGRPCServer.DeleteSubscription(context.TODO(), &sirenv1beta1.DeleteSubscriptionRequest{Id: 1}) assert.EqualError(t, err, "rpc error: code = Internal desc = some unexpected error occurred") assert.Nil(t, res) }) diff --git a/internal/api/v1beta1/template_test.go b/internal/api/v1beta1/template_test.go index 05c71968..728668fb 100644 --- a/internal/api/v1beta1/template_test.go +++ b/internal/api/v1beta1/template_test.go @@ -39,9 +39,9 @@ func TestGRPCServer_ListTemplates(t *testing.T) { }, } - mockedTemplateService.EXPECT().List(mock.AnythingOfType("*context.emptyCtx"), template.Filter{}). + mockedTemplateService.EXPECT().List(mock.AnythingOfType("context.todoCtx"), template.Filter{}). Return(dummyResult, nil).Once() - res, err := dummyGRPCServer.ListTemplates(context.Background(), dummyReq) + res, err := dummyGRPCServer.ListTemplates(context.TODO(), dummyReq) assert.Nil(t, err) assert.Equal(t, 1, len(res.GetTemplates())) assert.Equal(t, "foo", res.GetTemplates()[0].GetName()) @@ -75,9 +75,9 @@ func TestGRPCServer_ListTemplates(t *testing.T) { }, } - mockedTemplateService.EXPECT().List(mock.AnythingOfType("*context.emptyCtx"), template.Filter{Tag: "foo"}). + mockedTemplateService.EXPECT().List(mock.AnythingOfType("context.todoCtx"), template.Filter{Tag: "foo"}). Return(dummyResult, nil).Once() - res, err := dummyGRPCServer.ListTemplates(context.Background(), dummyReq) + res, err := dummyGRPCServer.ListTemplates(context.TODO(), dummyReq) assert.Nil(t, err) assert.Equal(t, 1, len(res.GetTemplates())) assert.Equal(t, "foo", res.GetTemplates()[0].GetName()) @@ -93,9 +93,9 @@ func TestGRPCServer_ListTemplates(t *testing.T) { dummyReq := &sirenv1beta1.ListTemplatesRequest{ Tag: "foo", } - mockedTemplateService.EXPECT().List(mock.AnythingOfType("*context.emptyCtx"), template.Filter{Tag: "foo"}). + mockedTemplateService.EXPECT().List(mock.AnythingOfType("context.todoCtx"), template.Filter{Tag: "foo"}). Return(nil, errors.New("random error")).Once() - res, err := dummyGRPCServer.ListTemplates(context.Background(), dummyReq) + res, err := dummyGRPCServer.ListTemplates(context.TODO(), dummyReq) assert.Nil(t, res) assert.EqualError(t, err, "rpc error: code = Internal desc = some unexpected error occurred") mockedTemplateService.AssertExpectations(t) @@ -124,9 +124,9 @@ func TestGRPCServer_GetTemplate(t *testing.T) { }, } - mockedTemplateService.EXPECT().GetByName(mock.AnythingOfType("*context.emptyCtx"), "foo"). + mockedTemplateService.EXPECT().GetByName(mock.AnythingOfType("context.todoCtx"), "foo"). Return(dummyResult, nil).Once() - res, err := dummyGRPCServer.GetTemplate(context.Background(), dummyReq) + res, err := dummyGRPCServer.GetTemplate(context.TODO(), dummyReq) assert.Nil(t, err) assert.Equal(t, uint64(1), res.GetTemplate().GetId()) assert.Equal(t, "foo", res.GetTemplate().GetName()) @@ -141,9 +141,9 @@ func TestGRPCServer_GetTemplate(t *testing.T) { dummyReq := &sirenv1beta1.GetTemplateRequest{ Name: "foo", } - mockedTemplateService.EXPECT().GetByName(mock.AnythingOfType("*context.emptyCtx"), "foo"). + mockedTemplateService.EXPECT().GetByName(mock.AnythingOfType("context.todoCtx"), "foo"). Return(nil, errors.ErrNotFound).Once() - res, err := dummyGRPCServer.GetTemplate(context.Background(), dummyReq) + res, err := dummyGRPCServer.GetTemplate(context.TODO(), dummyReq) assert.Nil(t, res) assert.EqualError(t, err, "rpc error: code = NotFound desc = requested entity not found") mockedTemplateService.AssertExpectations(t) @@ -155,9 +155,9 @@ func TestGRPCServer_GetTemplate(t *testing.T) { dummyReq := &sirenv1beta1.GetTemplateRequest{ Name: "foo", } - mockedTemplateService.EXPECT().GetByName(mock.AnythingOfType("*context.emptyCtx"), "foo"). + mockedTemplateService.EXPECT().GetByName(mock.AnythingOfType("context.todoCtx"), "foo"). Return(nil, errors.New("random error")).Once() - res, err := dummyGRPCServer.GetTemplate(context.Background(), dummyReq) + res, err := dummyGRPCServer.GetTemplate(context.TODO(), dummyReq) assert.Nil(t, res) assert.EqualError(t, err, "rpc error: code = Internal desc = some unexpected error occurred") mockedTemplateService.AssertExpectations(t) @@ -198,10 +198,10 @@ func TestGRPCServer_UpsertTemplate(t *testing.T) { mockedTemplateService := &mocks.TemplateService{} dummyGRPCServer := v1beta1.NewGRPCServer(nil, log.NewNoop(), api.HeadersConfig{}, &api.Deps{TemplateService: mockedTemplateService}) - mockedTemplateService.EXPECT().Upsert(mock.AnythingOfType("*context.emptyCtx"), tmpl).Run(func(_a0 context.Context, _a1 *template.Template) { + mockedTemplateService.EXPECT().Upsert(mock.AnythingOfType("context.todoCtx"), tmpl).Run(func(_a0 context.Context, _a1 *template.Template) { _a1.ID = uint64(1) }).Return(nil).Once() - res, err := dummyGRPCServer.UpsertTemplate(context.Background(), dummyReq) + res, err := dummyGRPCServer.UpsertTemplate(context.TODO(), dummyReq) assert.Nil(t, err) assert.Equal(t, uint64(1), res.GetId()) mockedTemplateService.AssertExpectations(t) @@ -210,8 +210,8 @@ func TestGRPCServer_UpsertTemplate(t *testing.T) { t.Run("should return error AlreadyExists if upsert template return err conflict", func(t *testing.T) { mockedTemplateService := &mocks.TemplateService{} dummyGRPCServer := v1beta1.NewGRPCServer(nil, log.NewNoop(), api.HeadersConfig{}, &api.Deps{TemplateService: mockedTemplateService}) - mockedTemplateService.EXPECT().Upsert(mock.AnythingOfType("*context.emptyCtx"), tmpl).Return(errors.ErrConflict).Once() - res, err := dummyGRPCServer.UpsertTemplate(context.Background(), dummyReq) + mockedTemplateService.EXPECT().Upsert(mock.AnythingOfType("context.todoCtx"), tmpl).Return(errors.ErrConflict).Once() + res, err := dummyGRPCServer.UpsertTemplate(context.TODO(), dummyReq) assert.Nil(t, res) assert.EqualError(t, err, "rpc error: code = AlreadyExists desc = an entity with conflicting identifier exists") mockedTemplateService.AssertExpectations(t) @@ -220,8 +220,8 @@ func TestGRPCServer_UpsertTemplate(t *testing.T) { t.Run("should return error Internal if upsert template failed", func(t *testing.T) { mockedTemplateService := &mocks.TemplateService{} dummyGRPCServer := v1beta1.NewGRPCServer(nil, log.NewNoop(), api.HeadersConfig{}, &api.Deps{TemplateService: mockedTemplateService}) - mockedTemplateService.EXPECT().Upsert(mock.AnythingOfType("*context.emptyCtx"), tmpl).Return(errors.New("random error")).Once() - res, err := dummyGRPCServer.UpsertTemplate(context.Background(), dummyReq) + mockedTemplateService.EXPECT().Upsert(mock.AnythingOfType("context.todoCtx"), tmpl).Return(errors.New("random error")).Once() + res, err := dummyGRPCServer.UpsertTemplate(context.TODO(), dummyReq) assert.Nil(t, res) assert.EqualError(t, err, "rpc error: code = Internal desc = some unexpected error occurred") mockedTemplateService.AssertExpectations(t) @@ -236,9 +236,9 @@ func TestGRPCServer_DeleteTemplate(t *testing.T) { Name: "foo", } - mockedTemplateService.EXPECT().Delete(mock.AnythingOfType("*context.emptyCtx"), "foo"). + mockedTemplateService.EXPECT().Delete(mock.AnythingOfType("context.todoCtx"), "foo"). Return(nil).Once() - res, err := dummyGRPCServer.DeleteTemplate(context.Background(), dummyReq) + res, err := dummyGRPCServer.DeleteTemplate(context.TODO(), dummyReq) assert.Nil(t, err) assert.Equal(t, &sirenv1beta1.DeleteTemplateResponse{}, res) mockedTemplateService.AssertExpectations(t) @@ -250,9 +250,9 @@ func TestGRPCServer_DeleteTemplate(t *testing.T) { dummyReq := &sirenv1beta1.DeleteTemplateRequest{ Name: "foo", } - mockedTemplateService.EXPECT().Delete(mock.AnythingOfType("*context.emptyCtx"), "foo"). + mockedTemplateService.EXPECT().Delete(mock.AnythingOfType("context.todoCtx"), "foo"). Return(errors.New("random error")).Once() - res, err := dummyGRPCServer.DeleteTemplate(context.Background(), dummyReq) + res, err := dummyGRPCServer.DeleteTemplate(context.TODO(), dummyReq) assert.Nil(t, res) assert.EqualError(t, err, "rpc error: code = Internal desc = some unexpected error occurred") mockedTemplateService.AssertExpectations(t) @@ -271,9 +271,9 @@ func TestGRPCServer_RenderTemplate(t *testing.T) { mockedTemplateService := &mocks.TemplateService{} dummyGRPCServer := v1beta1.NewGRPCServer(nil, log.NewNoop(), api.HeadersConfig{}, &api.Deps{TemplateService: mockedTemplateService}) - mockedTemplateService.EXPECT().Render(mock.AnythingOfType("*context.emptyCtx"), "foo", dummyReq.GetVariables()). + mockedTemplateService.EXPECT().Render(mock.AnythingOfType("context.todoCtx"), "foo", dummyReq.GetVariables()). Return("random", nil).Once() - res, err := dummyGRPCServer.RenderTemplate(context.Background(), dummyReq) + res, err := dummyGRPCServer.RenderTemplate(context.TODO(), dummyReq) assert.Nil(t, err) assert.Equal(t, "random", res.GetBody()) mockedTemplateService.AssertExpectations(t) @@ -282,9 +282,9 @@ func TestGRPCServer_RenderTemplate(t *testing.T) { t.Run("should return error Internal if rendering template failed", func(t *testing.T) { mockedTemplateService := &mocks.TemplateService{} dummyGRPCServer := v1beta1.NewGRPCServer(nil, log.NewNoop(), api.HeadersConfig{}, &api.Deps{TemplateService: mockedTemplateService}) - mockedTemplateService.EXPECT().Render(mock.AnythingOfType("*context.emptyCtx"), "foo", dummyReq.GetVariables()). + mockedTemplateService.EXPECT().Render(mock.AnythingOfType("context.todoCtx"), "foo", dummyReq.GetVariables()). Return("", errors.New("random error")).Once() - res, err := dummyGRPCServer.RenderTemplate(context.Background(), dummyReq) + res, err := dummyGRPCServer.RenderTemplate(context.TODO(), dummyReq) assert.Empty(t, res) assert.EqualError(t, err, "rpc error: code = Internal desc = some unexpected error occurred") mockedTemplateService.AssertExpectations(t) diff --git a/internal/store/postgres/bootstrap_test.go b/internal/store/postgres/bootstrap_test.go index ef697f53..72053fde 100644 --- a/internal/store/postgres/bootstrap_test.go +++ b/internal/store/postgres/bootstrap_test.go @@ -85,12 +85,12 @@ func bootstrapProvider(client *pgc.Client) ([]provider.Provider, error) { } for _, d := range data { - if cerr := repo.Create(context.Background(), &d); cerr != nil { + if cerr := repo.Create(context.TODO(), &d); cerr != nil { return nil, cerr } } - providers, err := repo.List(context.Background(), provider.Filter{}) + providers, err := repo.List(context.TODO(), provider.Filter{}) if err != nil { return nil, err } @@ -118,12 +118,12 @@ func bootstrapNamespace(client *pgc.Client) ([]namespace.EncryptedNamespace, err Namespace: &d, CredentialString: fmt.Sprintf("%+v", d.Credentials), } - if cerr := repo.Create(context.Background(), &encryptedNS); cerr != nil { + if cerr := repo.Create(context.TODO(), &encryptedNS); cerr != nil { return nil, cerr } } - insertedData, err := repo.List(context.Background()) + insertedData, err := repo.List(context.TODO()) if err != nil { return nil, err } @@ -146,12 +146,12 @@ func bootstrapReceiver(client *pgc.Client) ([]receiver.Receiver, error) { } for _, d := range data { - if cerr := repo.Create(context.Background(), &d); cerr != nil { + if cerr := repo.Create(context.TODO(), &d); cerr != nil { return nil, cerr } } - insertedData, err := repo.List(context.Background(), receiver.Filter{Expanded: true}) + insertedData, err := repo.List(context.TODO(), receiver.Filter{Expanded: true}) if err != nil { return nil, err } @@ -175,7 +175,7 @@ func bootstrapAlert(client *pgc.Client) ([]alert.Alert, error) { var createdAlerts []alert.Alert for _, d := range data { - alrt, err := repo.Create(context.Background(), d) + alrt, err := repo.Create(context.TODO(), d) if err != nil { return nil, err } @@ -200,12 +200,12 @@ func bootstrapTemplate(client *pgc.Client) ([]template.Template, error) { repo := postgres.NewTemplateRepository(client) for _, d := range data { - if cerr := repo.Upsert(context.Background(), &d); cerr != nil { + if cerr := repo.Upsert(context.TODO(), &d); cerr != nil { return nil, cerr } } - insertedData, err := repo.List(context.Background(), template.Filter{}) + insertedData, err := repo.List(context.TODO(), template.Filter{}) if err != nil { return nil, err } @@ -228,7 +228,7 @@ func bootstrapRule(client *pgc.Client) ([]rule.Rule, error) { var insertedData []rule.Rule for _, d := range data { - err := repo.Upsert(context.Background(), &d) + err := repo.Upsert(context.TODO(), &d) if err != nil { return nil, err } @@ -255,7 +255,7 @@ func bootstrapSubscription(client *pgc.Client) ([]subscription.Subscription, err var insertedData []subscription.Subscription for _, d := range data { - err := repo.Create(context.Background(), &d) + err := repo.Create(context.TODO(), &d) if err != nil { return nil, err } @@ -282,7 +282,7 @@ func bootstrapNotification(client *pgc.Client) ([]notification.Notification, err var insertedData []notification.Notification for _, d := range data { - newD, err := repo.Create(context.Background(), d) + newD, err := repo.Create(context.TODO(), d) if err != nil { return nil, err } @@ -309,7 +309,7 @@ func bootstrapSilence(client *pgc.Client) ([]string, error) { var silenceIDs []string for _, d := range data { - id, err := repo.Create(context.Background(), d) + id, err := repo.Create(context.TODO(), d) if err != nil { return nil, err } @@ -363,7 +363,7 @@ func bootstrapNotificationLog( repo := postgres.NewLogRepository(client) - if err := repo.BulkCreate(context.Background(), data); err != nil { + if err := repo.BulkCreate(context.TODO(), data); err != nil { return err } diff --git a/internal/store/postgres/idempotency_test.go b/internal/store/postgres/idempotency_test.go index 1b5462a8..815b9eb0 100644 --- a/internal/store/postgres/idempotency_test.go +++ b/internal/store/postgres/idempotency_test.go @@ -86,7 +86,7 @@ func (s *IdempotencyRepositoryTestSuite) TestInsertReturnOnConflict() { Key: "key-1", } s.Run("should return the inserted idempotency data if not exist", func() { - res, err := s.repository.InsertOnConflictReturning(context.Background(), data1.Scope, data1.Key) + res, err := s.repository.InsertOnConflictReturning(context.TODO(), data1.Scope, data1.Key) s.Assert().NoError(err) data1 = res s.Assert().Equal("a-scope", data1.Scope) @@ -94,7 +94,7 @@ func (s *IdempotencyRepositoryTestSuite) TestInsertReturnOnConflict() { }) s.Run("should return the existing conflicted data if exist", func() { - res, err := s.repository.InsertOnConflictReturning(context.Background(), data1.Scope, data1.Key) + res, err := s.repository.InsertOnConflictReturning(context.TODO(), data1.Scope, data1.Key) s.Assert().NoError(err) if diff := cmp.Diff(data1, res, cmpopts.IgnoreFields(notification.Idempotency{}, "UpdatedAt")); diff != "" { @@ -108,7 +108,7 @@ func (s *IdempotencyRepositoryTestSuite) TestUpdateSuccess() { Scope: "a-scope", Key: "existing-key-1", } - res, err := s.repository.InsertOnConflictReturning(context.Background(), data.Scope, data.Key) + res, err := s.repository.InsertOnConflictReturning(context.TODO(), data.Scope, data.Key) s.Require().NoError(err) s.Require().Equal(data.Scope, res.Scope) s.Require().Equal(data.Key, res.Key) diff --git a/internal/store/postgres/namespace_test.go b/internal/store/postgres/namespace_test.go index 48e8d65f..da74f8d9 100644 --- a/internal/store/postgres/namespace_test.go +++ b/internal/store/postgres/namespace_test.go @@ -433,7 +433,7 @@ func (s *NamespaceRepositoryTestSuite) TestTransaction() { s.NoError(err) s.Len(fetchedNamespaces, 3) - ctx := s.repository.WithTransaction(context.Background()) + ctx := s.repository.WithTransaction(context.TODO()) err = s.repository.Create(ctx, &namespace.EncryptedNamespace{ Namespace: &namespace.Namespace{ Name: "instance-2-tx", @@ -459,7 +459,7 @@ func (s *NamespaceRepositoryTestSuite) TestTransaction() { s.NoError(err) s.Len(fetchedNamespaces, 4) - ctx := s.repository.WithTransaction(context.Background()) + ctx := s.repository.WithTransaction(context.TODO()) err = s.repository.Create(ctx, &namespace.EncryptedNamespace{ Namespace: &namespace.Namespace{ Name: "instance-2-tx-rb", diff --git a/internal/store/postgres/rule_test.go b/internal/store/postgres/rule_test.go index e3d51223..1fc39e67 100644 --- a/internal/store/postgres/rule_test.go +++ b/internal/store/postgres/rule_test.go @@ -345,7 +345,7 @@ func (s *RuleRepositoryTestSuite) TestUpsert() { func (s *RuleRepositoryTestSuite) TestTransaction() { s.Run("successfully commit transaction", func() { - ctx := s.repository.WithTransaction(context.Background()) + ctx := s.repository.WithTransaction(context.TODO()) err := s.repository.Upsert(ctx, &rule.Rule{ ID: 888, Name: "test-commit", @@ -369,7 +369,7 @@ func (s *RuleRepositoryTestSuite) TestTransaction() { }) s.Run("successfully rollback transaction", func() { - ctx := s.repository.WithTransaction(context.Background()) + ctx := s.repository.WithTransaction(context.TODO()) err := s.repository.Upsert(ctx, &rule.Rule{ ID: 999, Name: "test-rollback", diff --git a/plugins/providers/cortex/v1/mocks/cortex_caller.go b/plugins/providers/cortex/v1/mocks/cortex_caller.go index 92330cc0..83dd08e4 100644 --- a/plugins/providers/cortex/v1/mocks/cortex_caller.go +++ b/plugins/providers/cortex/v1/mocks/cortex_caller.go @@ -278,4 +278,4 @@ func NewCortexCaller(t interface { t.Cleanup(func() { mock.AssertExpectations(t) }) return mock -} +} \ No newline at end of file diff --git a/plugins/providers/cortex/v1/service.go b/plugins/providers/cortex/v1/service.go index 136af755..90f79fc8 100644 --- a/plugins/providers/cortex/v1/service.go +++ b/plugins/providers/cortex/v1/service.go @@ -9,6 +9,7 @@ import ( "time" "github.com/goto/siren/core/alert" + "github.com/goto/siren/core/namespace" "github.com/goto/siren/core/provider" "github.com/goto/siren/core/rule" "github.com/goto/siren/core/template" @@ -185,7 +186,7 @@ func (s *PluginService) SyncRuntimeConfig(ctx context.Context, namespaceID uint6 // UpsertRule manages upsert logic to cortex ruler. Cortex client API granularity is on the rule-group. // This function has a logic to work with rule-level granurality and adapt it to cortex logic. -func (s *PluginService) UpsertRule(ctx context.Context, namespaceURN string, prov provider.Provider, rl *rule.Rule, templateToUpdate *template.Template) error { +func (s *PluginService) UpsertRule(ctx context.Context, ns namespace.Namespace, prov provider.Provider, rl *rule.Rule, templateToUpdate *template.Template) error { inputValues := make(map[string]string) for _, v := range rl.Variables { inputValues[v.Name] = v.Value @@ -196,7 +197,7 @@ func (s *PluginService) UpsertRule(ctx context.Context, namespaceURN string, pro return err } - cortexClient, err := s.getCortexClient(prov.Host, namespaceURN) + cortexClient, err := s.getCortexClient(prov.Host, ns.URN) if err != nil { return err } diff --git a/plugins/providers/cortex/v1/service_test.go b/plugins/providers/cortex/v1/service_test.go index f164e7e2..bd34ebea 100644 --- a/plugins/providers/cortex/v1/service_test.go +++ b/plugins/providers/cortex/v1/service_test.go @@ -5,6 +5,7 @@ import ( "testing" "github.com/MakeNowJust/heredoc" + "github.com/goto/siren/core/namespace" "github.com/goto/siren/core/provider" "github.com/goto/siren/core/rule" "github.com/goto/siren/core/template" @@ -105,7 +106,7 @@ func TestService_UpsertRule(t *testing.T) { type args struct { rl *rule.Rule templateToUpdate *template.Template - namespaceURN string + ns namespace.Namespace } tests := []struct { name string @@ -123,7 +124,9 @@ func TestService_UpsertRule(t *testing.T) { copiedTemplate.Body = "[[x" return &copiedTemplate }(), - namespaceURN: "gotocompany", + ns: namespace.Namespace{ + URN: "gotocompany", + }, }, err: errors.New("template: parser:1: function \"x\" not defined"), }, @@ -137,27 +140,31 @@ func TestService_UpsertRule(t *testing.T) { copiedTemplate.Body = "name: a" return &copiedTemplate }(), - namespaceURN: "gotocompany", + ns: namespace.Namespace{ + URN: "gotocompany", + }, }, err: errors.New("cannot parse upserted rule"), }, { name: "should return error if getting rule group from cortexv1 return error", setup: func(cc *mocks.CortexCaller) { - cc.EXPECT().GetRuleGroup(mock.AnythingOfType("*context.emptyCtx"), mock.AnythingOfType("string"), mock.AnythingOfType("string")).Return(nil, errors.New("some error")) + cc.EXPECT().GetRuleGroup(mock.AnythingOfType("context.todoCtx"), mock.AnythingOfType("string"), mock.AnythingOfType("string")).Return(nil, errors.New("some error")) }, args: args{ rl: &sampleRule, templateToUpdate: &sampleTemplate, - namespaceURN: "gotocompany", + ns: namespace.Namespace{ + URN: "gotocompany", + }, }, err: errors.New("cannot get rule group from cortexv1 when upserting rules"), }, { name: "should return error if merge rule nodes return empty and delete rule group return error", setup: func(cc *mocks.CortexCaller) { - cc.EXPECT().GetRuleGroup(mock.AnythingOfType("*context.emptyCtx"), mock.AnythingOfType("string"), mock.AnythingOfType("string")).Return(&rwrulefmt.RuleGroup{}, nil) - cc.EXPECT().DeleteRuleGroup(mock.AnythingOfType("*context.emptyCtx"), mock.AnythingOfType("string"), mock.AnythingOfType("string")).Return(errors.New("some error")) + cc.EXPECT().GetRuleGroup(mock.AnythingOfType("context.todoCtx"), mock.AnythingOfType("string"), mock.AnythingOfType("string")).Return(&rwrulefmt.RuleGroup{}, nil) + cc.EXPECT().DeleteRuleGroup(mock.AnythingOfType("context.todoCtx"), mock.AnythingOfType("string"), mock.AnythingOfType("string")).Return(errors.New("some error")) }, args: args{ rl: func() *rule.Rule { @@ -166,33 +173,39 @@ func TestService_UpsertRule(t *testing.T) { return &copiedRule }(), templateToUpdate: &sampleTemplate, - namespaceURN: "gotocompany", + ns: namespace.Namespace{ + URN: "gotocompany", + }, }, err: errors.New("error calling cortexv1: some error"), }, { name: "should return nil if create rule group return error", setup: func(cc *mocks.CortexCaller) { - cc.EXPECT().GetRuleGroup(mock.AnythingOfType("*context.emptyCtx"), mock.AnythingOfType("string"), mock.AnythingOfType("string")).Return(&rwrulefmt.RuleGroup{}, nil) - cc.EXPECT().CreateRuleGroup(mock.AnythingOfType("*context.emptyCtx"), mock.AnythingOfType("string"), mock.AnythingOfType("rwrulefmt.RuleGroup")).Return(errors.New("some error")) + cc.EXPECT().GetRuleGroup(mock.AnythingOfType("context.todoCtx"), mock.AnythingOfType("string"), mock.AnythingOfType("string")).Return(&rwrulefmt.RuleGroup{}, nil) + cc.EXPECT().CreateRuleGroup(mock.AnythingOfType("context.todoCtx"), mock.AnythingOfType("string"), mock.AnythingOfType("rwrulefmt.RuleGroup")).Return(errors.New("some error")) }, args: args{ rl: &sampleRule, templateToUpdate: &sampleTemplate, - namespaceURN: "gotocompany", + ns: namespace.Namespace{ + URN: "gotocompany", + }, }, err: errors.New("error calling cortexv1: some error"), }, { name: "should return nil if create rule group return no error", setup: func(cc *mocks.CortexCaller) { - cc.EXPECT().GetRuleGroup(mock.AnythingOfType("*context.emptyCtx"), mock.AnythingOfType("string"), mock.AnythingOfType("string")).Return(&rwrulefmt.RuleGroup{}, nil) - cc.EXPECT().CreateRuleGroup(mock.AnythingOfType("*context.emptyCtx"), mock.AnythingOfType("string"), mock.AnythingOfType("rwrulefmt.RuleGroup")).Return(nil) + cc.EXPECT().GetRuleGroup(mock.AnythingOfType("context.todoCtx"), mock.AnythingOfType("string"), mock.AnythingOfType("string")).Return(&rwrulefmt.RuleGroup{}, nil) + cc.EXPECT().CreateRuleGroup(mock.AnythingOfType("context.todoCtx"), mock.AnythingOfType("string"), mock.AnythingOfType("rwrulefmt.RuleGroup")).Return(nil) }, args: args{ rl: &sampleRule, templateToUpdate: &sampleTemplate, - namespaceURN: "gotocompany", + ns: namespace.Namespace{ + URN: "gotocompany", + }, }, err: nil, }, @@ -202,7 +215,7 @@ func TestService_UpsertRule(t *testing.T) { mockcortexv1Client := new(mocks.CortexCaller) tc.setup(mockcortexv1Client) s := cortexv1plugin.NewPluginService(hclog.NewNullLogger(), cortexv1plugin.WithCortexClient(mockcortexv1Client)) - err := s.UpsertRule(context.Background(), tc.args.namespaceURN, provider.Provider{}, tc.args.rl, tc.args.templateToUpdate) + err := s.UpsertRule(context.TODO(), tc.args.ns, provider.Provider{}, tc.args.rl, tc.args.templateToUpdate) if err != nil && tc.err.Error() != err.Error() { t.Fatalf("got error %s, expected was %s", err.Error(), tc.err) } diff --git a/plugins/providers/service.go b/plugins/providers/service.go index 6e5bfd11..10704124 100644 --- a/plugins/providers/service.go +++ b/plugins/providers/service.go @@ -2,11 +2,12 @@ package providers import ( "context" - "html/template" "github.com/goto/siren/core/alert" + "github.com/goto/siren/core/namespace" "github.com/goto/siren/core/provider" "github.com/goto/siren/core/rule" + "github.com/goto/siren/core/template" "github.com/goto/siren/plugins" ) @@ -17,7 +18,7 @@ func (s *UnimplementedService) SyncRuntimeConfig(ctx context.Context, namespaceI return nil } -func (s *UnimplementedService) UpsertRule(ctx context.Context, namespaceURN string, prov provider.Provider, rl *rule.Rule, templateToUpdate *template.Template) error { +func (s *UnimplementedService) UpsertRule(ctx context.Context, ns namespace.Namespace, prov provider.Provider, rl *rule.Rule, templateToUpdate *template.Template) error { return plugins.ErrNotImplemented } diff --git a/plugins/providerv1beta1.go b/plugins/providerv1beta1.go index 0581d918..fa373132 100644 --- a/plugins/providerv1beta1.go +++ b/plugins/providerv1beta1.go @@ -7,6 +7,7 @@ import ( "strconv" "github.com/goto/siren/core/alert" + "github.com/goto/siren/core/namespace" "github.com/goto/siren/core/provider" "github.com/goto/siren/core/rule" "github.com/goto/siren/core/template" @@ -19,7 +20,7 @@ import ( type ProviderV1beta1 interface { SyncRuntimeConfig(ctx context.Context, namespaceID uint64, namespaceURN string, prov provider.Provider) error - UpsertRule(ctx context.Context, namespaceURN string, prov provider.Provider, rl *rule.Rule, templateToUpdate *template.Template) error + UpsertRule(ctx context.Context, ns namespace.Namespace, prov provider.Provider, rl *rule.Rule, templateToUpdate *template.Template) error SetConfig(ctx context.Context, configRaw string) error TransformToAlerts(ctx context.Context, providerID uint64, namespaceID uint64, body map[string]any) ([]alert.Alert, int, error) } @@ -40,8 +41,8 @@ func (c *GRPCClient) SyncRuntimeConfig(ctx context.Context, namespaceID uint64, return err } if _, err := c.client.SyncRuntimeConfig(ctx, &sirenproviderv1beta1.SyncRuntimeConfigRequest{ - NamespaceID: fmt.Sprintf("%d", namespaceID), - NamespaceURN: namespaceURN, + NamespaceId: fmt.Sprintf("%d", namespaceID), + NamespaceUrn: namespaceURN, Provider: protoProv, }); err != nil { return err @@ -49,16 +50,20 @@ func (c *GRPCClient) SyncRuntimeConfig(ctx context.Context, namespaceID uint64, return nil } -func (c *GRPCClient) UpsertRule(ctx context.Context, namespaceURN string, prov provider.Provider, rl *rule.Rule, templateToUpdate *template.Template) error { +func (c *GRPCClient) UpsertRule(ctx context.Context, ns namespace.Namespace, prov provider.Provider, rl *rule.Rule, templateToUpdate *template.Template) error { protoProv, err := prov.ToV1beta1Proto() if err != nil { return err } + protoNS, err := ns.ToV1beta1Proto() + if err != nil { + return err + } if _, err := c.client.UpsertRule(ctx, &sirenproviderv1beta1.UpsertRuleRequest{ - NamespaceURN: namespaceURN, - Provider: protoProv, - Rule: rl.ToV1beta1Proto(), - Template: templateToUpdate.ToV1beta1Proto(), + Namespace: protoNS, + Provider: protoProv, + Rule: rl.ToV1beta1Proto(), + Template: templateToUpdate.ToV1beta1Proto(), }); err != nil { return err } @@ -80,8 +85,8 @@ func (c *GRPCClient) TransformToAlerts(ctx context.Context, providerID uint64, n return nil, 0, fmt.Errorf("failed to transform body to structpb: %s", err.Error()) } resp, err := c.client.TransformToAlerts(ctx, &sirenproviderv1beta1.TransformToAlertsRequest{ - ProviderID: fmt.Sprintf("%d", providerID), - NamespaceID: fmt.Sprintf("%d", namespaceID), + ProviderId: fmt.Sprintf("%d", providerID), + NamespaceId: fmt.Sprintf("%d", namespaceID), Body: bodyPB, }) if err != nil { @@ -122,12 +127,12 @@ func (s *GRPCServer) SyncRuntimeConfig(ctx context.Context, req *sirenproviderv1 prov.UpdatedAt = grpcProvider.GetUpdatedAt().AsTime() } - namespaceIDUint64, err := strconv.ParseUint(req.GetNamespaceID(), 10, 64) + namespaceIDUint64, err := strconv.ParseUint(req.GetNamespaceId(), 10, 64) if err != nil { return nil, errors.New("error parsing namespace ID") } - return &sirenproviderv1beta1.SyncRuntimeConfigResponse{}, s.service.SyncRuntimeConfig(ctx, namespaceIDUint64, req.GetNamespaceURN(), prov) + return &sirenproviderv1beta1.SyncRuntimeConfigResponse{}, s.service.SyncRuntimeConfig(ctx, namespaceIDUint64, req.GetNamespaceUrn(), prov) } func (s *GRPCServer) UpsertRule(ctx context.Context, req *sirenproviderv1beta1.UpsertRuleRequest) (*sirenproviderv1beta1.UpsertRuleResponse, error) { @@ -146,6 +151,22 @@ func (s *GRPCServer) UpsertRule(ctx context.Context, req *sirenproviderv1beta1.U prov.UpdatedAt = grpcProvider.GetUpdatedAt().AsTime() } + ns := namespace.Namespace{} + if req.GetNamespace() != nil { + grpcNamespace := req.GetNamespace() + + ns.ID = grpcNamespace.GetId() + ns.URN = grpcNamespace.GetUrn() + ns.Name = grpcNamespace.GetName() + ns.Provider = provider.Provider{ + ID: grpcNamespace.GetProvider(), + } + ns.Credentials = grpcNamespace.GetCredentials().AsMap() + ns.Labels = grpcNamespace.GetLabels() + ns.CreatedAt = grpcNamespace.GetCreatedAt().AsTime() + ns.UpdatedAt = grpcNamespace.GetUpdatedAt().AsTime() + } + rl := rule.Rule{} if req.GetRule() != nil { grpcRule := req.GetRule() @@ -200,7 +221,7 @@ func (s *GRPCServer) UpsertRule(ctx context.Context, req *sirenproviderv1beta1.U tmplt.CreatedAt = grpcTemplate.GetCreatedAt().AsTime() tmplt.UpdatedAt = grpcTemplate.GetUpdatedAt().AsTime() } - return &sirenproviderv1beta1.UpsertRuleResponse{}, s.service.UpsertRule(ctx, req.GetNamespaceURN(), prov, &rl, &tmplt) + return &sirenproviderv1beta1.UpsertRuleResponse{}, s.service.UpsertRule(ctx, ns, prov, &rl, &tmplt) } func (s *GRPCServer) SetConfig(ctx context.Context, req *sirenproviderv1beta1.SetConfigRequest) (*sirenproviderv1beta1.SetConfigResponse, error) { @@ -208,11 +229,11 @@ func (s *GRPCServer) SetConfig(ctx context.Context, req *sirenproviderv1beta1.Se } func (s *GRPCServer) TransformToAlerts(ctx context.Context, req *sirenproviderv1beta1.TransformToAlertsRequest) (*sirenproviderv1beta1.TransformToAlertsResponse, error) { - providerIDUint64, err := strconv.ParseUint(req.GetProviderID(), 10, 64) + providerIDUint64, err := strconv.ParseUint(req.GetProviderId(), 10, 64) if err != nil { return nil, errors.New("error parsing provider ID") } - namespaceIDUint64, err := strconv.ParseUint(req.GetNamespaceID(), 10, 64) + namespaceIDUint64, err := strconv.ParseUint(req.GetNamespaceId(), 10, 64) if err != nil { return nil, errors.New("error parsing namespace ID") } diff --git a/plugins/queues/inmemory/queue_test.go b/plugins/queues/inmemory/queue_test.go index 5d93f0de..f9d8cb37 100644 --- a/plugins/queues/inmemory/queue_test.go +++ b/plugins/queues/inmemory/queue_test.go @@ -30,7 +30,7 @@ func TestQueue(t *testing.T) { } t.Run("should return no error if all messages are successfully processed", func(t *testing.T) { - ctx := context.Background() + ctx := context.TODO() logger := log.NewZap() q := inmemory.New(logger, 10) @@ -57,7 +57,7 @@ func TestQueue(t *testing.T) { }) t.Run("should return no error if all messages are successfully processed with different batch", func(t *testing.T) { - ctx := context.Background() + ctx := context.TODO() logger := log.NewZap() q := inmemory.New(logger, 10) @@ -84,7 +84,7 @@ func TestQueue(t *testing.T) { }) t.Run("should return an error if a message is failed to process", func(t *testing.T) { - ctx := context.Background() + ctx := context.TODO() logger := log.NewZap() q := inmemory.New(logger, 10) diff --git a/plugins/receivers/file/service_test.go b/plugins/receivers/file/service_test.go index f73bf029..da81d8a3 100644 --- a/plugins/receivers/file/service_test.go +++ b/plugins/receivers/file/service_test.go @@ -52,7 +52,7 @@ func TestService_Send(t *testing.T) { fr := file.NewPluginService() - got, err := fr.Send(context.Background(), tt.notificationMessage) + got, err := fr.Send(context.TODO(), tt.notificationMessage) if (err != nil) != tt.wantErr { t.Errorf("NotificationService.Publish() error = %v, wantErr %v", err, tt.wantErr) return diff --git a/plugins/receivers/httpreceiver/service_test.go b/plugins/receivers/httpreceiver/service_test.go index 577adeb2..71b01391 100644 --- a/plugins/receivers/httpreceiver/service_test.go +++ b/plugins/receivers/httpreceiver/service_test.go @@ -33,7 +33,7 @@ func TestService_Notify_WithoutRetrier(t *testing.T) { }, { name: "should return error if there is failure in http call", - ctx: context.Background(), + ctx: context.TODO(), apiURL: "xxx", wantErr: true, }, @@ -55,7 +55,7 @@ func TestService_Notify_HTTPCall(t *testing.T) { })) c := httpreceiver.NewPluginService(log.NewNoop(), httpreceiver.AppConfig{}) - err := c.Notify(context.Background(), testServer.URL, nil) + err := c.Notify(context.TODO(), testServer.URL, nil) assert.EqualError(t, err, "Too Many Requests") @@ -68,7 +68,7 @@ func TestService_Notify_HTTPCall(t *testing.T) { })) c := httpreceiver.NewPluginService(log.NewNoop(), httpreceiver.AppConfig{}) - err := c.Notify(context.Background(), testServer.URL, nil) + err := c.Notify(context.TODO(), testServer.URL, nil) assert.EqualError(t, err, "Bad Request") @@ -81,7 +81,7 @@ func TestService_Notify_HTTPCall(t *testing.T) { })) c := httpreceiver.NewPluginService(log.NewNoop(), httpreceiver.AppConfig{}) - err := c.Notify(context.Background(), testServer.URL, nil) + err := c.Notify(context.TODO(), testServer.URL, nil) assert.EqualError(t, err, "failed to read response body: unexpected EOF") @@ -94,7 +94,7 @@ func TestService_Notify_HTTPCall(t *testing.T) { })) c := httpreceiver.NewPluginService(log.NewNoop(), httpreceiver.AppConfig{}) - err := c.Notify(context.Background(), testServer.URL, nil) + err := c.Notify(context.TODO(), testServer.URL, nil) assert.EqualError(t, err, "failed to read response body: unexpected EOF") @@ -115,7 +115,7 @@ func TestService_Notify_WithRetrier(t *testing.T) { c := httpreceiver.NewPluginService(log.NewNoop(), httpreceiver.AppConfig{}, httpreceiver.WithRetrier(retry.New(retry.Config{Enable: true}))) - _ = c.Notify(context.Background(), testServer.URL, nil) + _ = c.Notify(context.TODO(), testServer.URL, nil) assert.Equal(t, expectedCounter, counter) @@ -132,7 +132,7 @@ func TestService_Notify_WithRetrier(t *testing.T) { c := httpreceiver.NewPluginService(log.NewNoop(), httpreceiver.AppConfig{}, httpreceiver.WithRetrier(retry.New(retry.Config{Enable: true}))) - _ = c.Notify(context.Background(), testServer.URL, nil) + _ = c.Notify(context.TODO(), testServer.URL, nil) assert.Equal(t, expectedCounter, counter) diff --git a/plugins/receivers/pagerduty/client_test.go b/plugins/receivers/pagerduty/client_test.go index 8f2157c0..898c819b 100644 --- a/plugins/receivers/pagerduty/client_test.go +++ b/plugins/receivers/pagerduty/client_test.go @@ -31,7 +31,7 @@ func TestClient_NotifyV1_WithoutRetrier(t *testing.T) { }, { name: "should return error if there is failure in http call", - ctx: context.Background(), + ctx: context.TODO(), cfg: pagerduty.AppConfig{APIHost: "xxx"}, wantErr: true, }, @@ -53,7 +53,7 @@ func TestClient_NotifyV1_HTTPCall(t *testing.T) { })) c := pagerduty.NewClient(pagerduty.AppConfig{APIHost: testServer.URL}) - err := c.NotifyV1(context.Background(), pagerduty.MessageV1{}) + err := c.NotifyV1(context.TODO(), pagerduty.MessageV1{}) assert.EqualError(t, err, "Too Many Requests") @@ -66,7 +66,7 @@ func TestClient_NotifyV1_HTTPCall(t *testing.T) { })) c := pagerduty.NewClient(pagerduty.AppConfig{APIHost: testServer.URL}) - err := c.NotifyV1(context.Background(), pagerduty.MessageV1{}) + err := c.NotifyV1(context.TODO(), pagerduty.MessageV1{}) assert.EqualError(t, err, "error with status code Bad Request and body ") @@ -79,7 +79,7 @@ func TestClient_NotifyV1_HTTPCall(t *testing.T) { })) c := pagerduty.NewClient(pagerduty.AppConfig{APIHost: testServer.URL}) - err := c.NotifyV1(context.Background(), pagerduty.MessageV1{}) + err := c.NotifyV1(context.TODO(), pagerduty.MessageV1{}) assert.EqualError(t, err, "failed to read response body: unexpected EOF") @@ -92,7 +92,7 @@ func TestClient_NotifyV1_HTTPCall(t *testing.T) { })) c := pagerduty.NewClient(pagerduty.AppConfig{APIHost: testServer.URL}) - err := c.NotifyV1(context.Background(), pagerduty.MessageV1{}) + err := c.NotifyV1(context.TODO(), pagerduty.MessageV1{}) assert.EqualError(t, err, "failed to read response body: unexpected EOF") @@ -105,7 +105,7 @@ func TestClient_NotifyV1_HTTPCall(t *testing.T) { })) c := pagerduty.NewClient(pagerduty.AppConfig{APIHost: testServer.URL}) - err := c.NotifyV1(context.Background(), pagerduty.MessageV1{}) + err := c.NotifyV1(context.TODO(), pagerduty.MessageV1{}) assert.EqualError(t, err, "failed to unmarshal response body: invalid character '/' looking for beginning of object key string") @@ -118,7 +118,7 @@ func TestClient_NotifyV1_HTTPCall(t *testing.T) { })) c := pagerduty.NewClient(pagerduty.AppConfig{APIHost: testServer.URL}) - err := c.NotifyV1(context.Background(), pagerduty.MessageV1{}) + err := c.NotifyV1(context.TODO(), pagerduty.MessageV1{}) assert.EqualError(t, err, "something wrong when sending pagerduty event: {failed }") @@ -131,7 +131,7 @@ func TestClient_NotifyV1_HTTPCall(t *testing.T) { })) c := pagerduty.NewClient(pagerduty.AppConfig{APIHost: testServer.URL}) - err := c.NotifyV1(context.Background(), pagerduty.MessageV1{}) + err := c.NotifyV1(context.TODO(), pagerduty.MessageV1{}) assert.NoError(t, err) @@ -153,7 +153,7 @@ func TestClient_NotifyV1_WithRetrier(t *testing.T) { c := pagerduty.NewClient(pagerduty.AppConfig{APIHost: testServer.URL}, pagerduty.ClientWithRetrier(retry.New(retry.Config{Enable: true})), ) - _ = c.NotifyV1(context.Background(), pagerduty.MessageV1{}) + _ = c.NotifyV1(context.TODO(), pagerduty.MessageV1{}) assert.Equal(t, expectedCounter, counter) @@ -171,7 +171,7 @@ func TestClient_NotifyV1_WithRetrier(t *testing.T) { c := pagerduty.NewClient(pagerduty.AppConfig{APIHost: testServer.URL}, pagerduty.ClientWithRetrier(retry.New(retry.Config{Enable: true})), ) - _ = c.NotifyV1(context.Background(), pagerduty.MessageV1{}) + _ = c.NotifyV1(context.TODO(), pagerduty.MessageV1{}) assert.Equal(t, expectedCounter, counter) diff --git a/plugins/receivers/pagerduty/service_test.go b/plugins/receivers/pagerduty/service_test.go index 9aa64572..fccea6d5 100644 --- a/plugins/receivers/pagerduty/service_test.go +++ b/plugins/receivers/pagerduty/service_test.go @@ -41,7 +41,7 @@ func TestService_Send_V1(t *testing.T) { { name: "should return error and not retryable if notify return error", setup: func(pd *mocks.PagerDutyCaller) { - pd.EXPECT().NotifyV1(mock.AnythingOfType("*context.emptyCtx"), mock.AnythingOfType("pagerduty.MessageV1")).Return(errors.New("some error")) + pd.EXPECT().NotifyV1(mock.AnythingOfType("context.todoCtx"), mock.AnythingOfType("pagerduty.MessageV1")).Return(errors.New("some error")) }, notificationMessage: notification.Message{ Configs: map[string]any{ @@ -57,7 +57,7 @@ func TestService_Send_V1(t *testing.T) { { name: "should return error and retryable if notify return retryable error", setup: func(sc *mocks.PagerDutyCaller) { - sc.EXPECT().NotifyV1(mock.AnythingOfType("*context.emptyCtx"), mock.AnythingOfType("pagerduty.MessageV1")).Return(retry.RetryableError{Err: errors.New("some error")}) + sc.EXPECT().NotifyV1(mock.AnythingOfType("context.todoCtx"), mock.AnythingOfType("pagerduty.MessageV1")).Return(retry.RetryableError{Err: errors.New("some error")}) }, notificationMessage: notification.Message{ Configs: map[string]any{ @@ -81,7 +81,7 @@ func TestService_Send_V1(t *testing.T) { pd := pagerduty.NewPluginService(pagerduty.AppConfig{}, pagerduty.WithPagerDutyClient(mockPDClient)) - got, err := pd.Send(context.Background(), tt.notificationMessage) + got, err := pd.Send(context.TODO(), tt.notificationMessage) if (err != nil) != tt.wantErr { t.Errorf("NotificationService.Send() error = %v, wantErr %v", err, tt.wantErr) return diff --git a/plugins/receivers/slack/client_test.go b/plugins/receivers/slack/client_test.go index 4ee5f960..62f558d7 100644 --- a/plugins/receivers/slack/client_test.go +++ b/plugins/receivers/slack/client_test.go @@ -23,7 +23,7 @@ func TestClient_GetWorkspaceChannels(t *testing.T) { })) c := slack.NewClient(slack.AppConfig{APIHost: testServer.URL}) - channels, err := c.GetWorkspaceChannels(context.Background(), token) + channels, err := c.GetWorkspaceChannels(context.TODO(), token) assert.EqualError(t, err, "failed to fetch joined channel list: slack server error: 502 Bad Gateway") assert.Empty(t, channels) @@ -55,7 +55,7 @@ func TestClient_GetWorkspaceChannels(t *testing.T) { })) c := slack.NewClient(slack.AppConfig{APIHost: testServer.URL}) - channels, err := c.GetWorkspaceChannels(context.Background(), token) + channels, err := c.GetWorkspaceChannels(context.TODO(), token) assert.NoError(t, err) assert.Equal(t, []slack.Channel{{ @@ -72,7 +72,7 @@ func TestClient_NotifyChannel(t *testing.T) { t.Run("return error when message receiver type is wrong", func(t *testing.T) { c := slack.NewClient(slack.AppConfig{}) - err := c.Notify(context.Background(), + err := c.Notify(context.TODO(), slack.NotificationConfig{ ReceiverConfig: slack.ReceiverConfig{ Token: token, @@ -90,7 +90,7 @@ func TestClient_NotifyChannel(t *testing.T) { c := slack.NewClient(slack.AppConfig{APIHost: testServer.URL}) err := c.Notify( - context.Background(), + context.TODO(), slack.NotificationConfig{ ReceiverConfig: slack.ReceiverConfig{ Token: token, @@ -134,7 +134,7 @@ func TestClient_NotifyChannel(t *testing.T) { c := slack.NewClient(slack.AppConfig{APIHost: testServer.URL}) err := c.Notify( - context.Background(), + context.TODO(), slack.NotificationConfig{ ReceiverConfig: slack.ReceiverConfig{ Token: token, @@ -178,7 +178,7 @@ func TestClient_NotifyChannel(t *testing.T) { c := slack.NewClient(slack.AppConfig{APIHost: testServer.URL}) err := c.Notify( - context.Background(), + context.TODO(), slack.NotificationConfig{ ReceiverConfig: slack.ReceiverConfig{ Token: token, @@ -223,7 +223,7 @@ func TestClient_NotifyChannel(t *testing.T) { c := slack.NewClient(slack.AppConfig{APIHost: testServer.URL}) err := c.Notify( - context.Background(), + context.TODO(), slack.NotificationConfig{ ReceiverConfig: slack.ReceiverConfig{ Token: token, @@ -252,7 +252,7 @@ func TestClient_NotifyUser(t *testing.T) { c := slack.NewClient(slack.AppConfig{APIHost: testServer.URL}) err := c.Notify( - context.Background(), + context.TODO(), slack.NotificationConfig{ ReceiverConfig: slack.ReceiverConfig{ Token: token, @@ -275,7 +275,7 @@ func TestClient_NotifyUser(t *testing.T) { c := slack.NewClient(slack.AppConfig{APIHost: testServer.URL}) err := c.Notify( - context.Background(), + context.TODO(), slack.NotificationConfig{ ReceiverConfig: slack.ReceiverConfig{ Token: token, @@ -302,7 +302,7 @@ func TestClient_NotifyUser(t *testing.T) { c := slack.NewClient(slack.AppConfig{APIHost: testServer.URL}) err := c.Notify( - context.Background(), + context.TODO(), slack.NotificationConfig{ ReceiverConfig: slack.ReceiverConfig{ Token: token, @@ -342,7 +342,7 @@ func TestClient_NotifyWithRetrier(t *testing.T) { c := slack.NewClient(slack.AppConfig{APIHost: testServer.URL}, slack.ClientWithRetrier(retry.New(retry.Config{Enable: true}))) _ = c.Notify( - context.Background(), + context.TODO(), slack.NotificationConfig{ ReceiverConfig: slack.ReceiverConfig{ Token: token, @@ -373,7 +373,7 @@ func TestClient_NotifyWithRetrier(t *testing.T) { c := slack.NewClient(slack.AppConfig{APIHost: testServer.URL}, slack.ClientWithRetrier(retry.New(retry.Config{Enable: true}))) _ = c.Notify( - context.Background(), + context.TODO(), slack.NotificationConfig{ ReceiverConfig: slack.ReceiverConfig{ Token: token, diff --git a/plugins/receivers/slack/service_test.go b/plugins/receivers/slack/service_test.go index b6e6f635..dc9aaa0f 100644 --- a/plugins/receivers/slack/service_test.go +++ b/plugins/receivers/slack/service_test.go @@ -33,7 +33,7 @@ func TestService_BuildData(t *testing.T) { { Description: "should return error if failed to get workspace channels with slack client", Setup: func(sc *mocks.SlackCaller, e *mocks.Encryptor) { - sc.EXPECT().GetWorkspaceChannels(mock.AnythingOfType("*context.emptyCtx"), mock.AnythingOfType("secret.MaskableString")).Return(nil, errors.New("some error")) + sc.EXPECT().GetWorkspaceChannels(mock.AnythingOfType("context.todoCtx"), mock.AnythingOfType("secret.MaskableString")).Return(nil, errors.New("some error")) }, Confs: map[string]any{ "token": secret.MaskableString("key"), @@ -44,7 +44,7 @@ func TestService_BuildData(t *testing.T) { { Description: "should return nil error if success populating receiver.Receiver", Setup: func(sc *mocks.SlackCaller, e *mocks.Encryptor) { - sc.EXPECT().GetWorkspaceChannels(mock.AnythingOfType("*context.emptyCtx"), mock.AnythingOfType("secret.MaskableString")).Return([]slack.Channel{ + sc.EXPECT().GetWorkspaceChannels(mock.AnythingOfType("context.todoCtx"), mock.AnythingOfType("secret.MaskableString")).Return([]slack.Channel{ { ID: "id", Name: "name", @@ -112,7 +112,7 @@ func TestService_Send(t *testing.T) { { name: "should return error and not retryable if notify return error", setup: func(sc *mocks.SlackCaller) { - sc.EXPECT().Notify(mock.AnythingOfType("*context.emptyCtx"), mock.AnythingOfType("slack.NotificationConfig"), mock.AnythingOfType("slack.Message")).Return(errors.New("some error")) + sc.EXPECT().Notify(mock.AnythingOfType("context.todoCtx"), mock.AnythingOfType("slack.NotificationConfig"), mock.AnythingOfType("slack.Message")).Return(errors.New("some error")) }, notificationMessage: notification.Message{ Configs: map[string]any{ @@ -128,7 +128,7 @@ func TestService_Send(t *testing.T) { { name: "should return error and retryable if notify return retryable error", setup: func(sc *mocks.SlackCaller) { - sc.EXPECT().Notify(mock.AnythingOfType("*context.emptyCtx"), mock.AnythingOfType("slack.NotificationConfig"), mock.AnythingOfType("slack.Message")).Return(retry.RetryableError{Err: errors.New("some error")}) + sc.EXPECT().Notify(mock.AnythingOfType("context.todoCtx"), mock.AnythingOfType("slack.NotificationConfig"), mock.AnythingOfType("slack.Message")).Return(retry.RetryableError{Err: errors.New("some error")}) }, notificationMessage: notification.Message{ Configs: map[string]any{ @@ -152,7 +152,7 @@ func TestService_Send(t *testing.T) { s := slack.NewPluginService(slack.AppConfig{}, nil, slack.WithSlackClient(mockSlackClient)) - got, err := s.Send(context.Background(), tt.notificationMessage) + got, err := s.Send(context.TODO(), tt.notificationMessage) if (err != nil) != tt.wantErr { t.Errorf("Service.Publish() error = %v, wantErr %v", err, tt.wantErr) return diff --git a/plugins/receivers/slackchannel/service_test.go b/plugins/receivers/slackchannel/service_test.go index 84917076..5fcd6a41 100644 --- a/plugins/receivers/slackchannel/service_test.go +++ b/plugins/receivers/slackchannel/service_test.go @@ -44,7 +44,7 @@ func TestService_Send(t *testing.T) { { name: "should return error and not retryable if notify return error", setup: func(sc *mocks.SlackCaller) { - sc.EXPECT().Notify(mock.AnythingOfType("*context.emptyCtx"), mock.AnythingOfType("slack.NotificationConfig"), mock.AnythingOfType("slack.Message")).Return(errors.New("some error")) + sc.EXPECT().Notify(mock.AnythingOfType("context.todoCtx"), mock.AnythingOfType("slack.NotificationConfig"), mock.AnythingOfType("slack.Message")).Return(errors.New("some error")) }, notificationMessage: notification.Message{ Configs: map[string]any{ @@ -60,7 +60,7 @@ func TestService_Send(t *testing.T) { { name: "should return error and retryable if notify return retryable error", setup: func(sc *mocks.SlackCaller) { - sc.EXPECT().Notify(mock.AnythingOfType("*context.emptyCtx"), mock.AnythingOfType("slack.NotificationConfig"), mock.AnythingOfType("slack.Message")).Return(retry.RetryableError{Err: errors.New("some error")}) + sc.EXPECT().Notify(mock.AnythingOfType("context.todoCtx"), mock.AnythingOfType("slack.NotificationConfig"), mock.AnythingOfType("slack.Message")).Return(retry.RetryableError{Err: errors.New("some error")}) }, notificationMessage: notification.Message{ Configs: map[string]any{ @@ -84,7 +84,7 @@ func TestService_Send(t *testing.T) { s := slackchannel.NewPluginService(slack.AppConfig{}, nil, slack.WithSlackClient(mockSlackClient)) - got, err := s.Send(context.Background(), tt.notificationMessage) + got, err := s.Send(context.TODO(), tt.notificationMessage) if (err != nil) != tt.wantErr { t.Errorf("Service.Publish() error = %v, wantErr %v", err, tt.wantErr) return diff --git a/proto/gotocompany/siren/provider/v1beta1/provider.pb.go b/proto/gotocompany/siren/provider/v1beta1/provider.pb.go index 479e5766..e38ef9ef 100644 --- a/proto/gotocompany/siren/provider/v1beta1/provider.pb.go +++ b/proto/gotocompany/siren/provider/v1beta1/provider.pb.go @@ -27,8 +27,8 @@ type SyncRuntimeConfigRequest struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - NamespaceID string `protobuf:"bytes,1,opt,name=namespaceID,proto3" json:"namespaceID,omitempty"` - NamespaceURN string `protobuf:"bytes,2,opt,name=namespaceURN,proto3" json:"namespaceURN,omitempty"` + NamespaceId string `protobuf:"bytes,1,opt,name=namespace_id,json=namespaceId,proto3" json:"namespace_id,omitempty"` + NamespaceUrn string `protobuf:"bytes,2,opt,name=namespace_urn,json=namespaceUrn,proto3" json:"namespace_urn,omitempty"` Provider *v1beta1.Provider `protobuf:"bytes,3,opt,name=provider,proto3" json:"provider,omitempty"` } @@ -64,16 +64,16 @@ func (*SyncRuntimeConfigRequest) Descriptor() ([]byte, []int) { return file_gotocompany_siren_provider_v1beta1_provider_proto_rawDescGZIP(), []int{0} } -func (x *SyncRuntimeConfigRequest) GetNamespaceID() string { +func (x *SyncRuntimeConfigRequest) GetNamespaceId() string { if x != nil { - return x.NamespaceID + return x.NamespaceId } return "" } -func (x *SyncRuntimeConfigRequest) GetNamespaceURN() string { +func (x *SyncRuntimeConfigRequest) GetNamespaceUrn() string { if x != nil { - return x.NamespaceURN + return x.NamespaceUrn } return "" } @@ -128,10 +128,10 @@ type UpsertRuleRequest struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - NamespaceURN string `protobuf:"bytes,1,opt,name=namespaceURN,proto3" json:"namespaceURN,omitempty"` - Provider *v1beta1.Provider `protobuf:"bytes,3,opt,name=provider,proto3" json:"provider,omitempty"` - Rule *v1beta1.Rule `protobuf:"bytes,4,opt,name=rule,proto3" json:"rule,omitempty"` - Template *v1beta1.Template `protobuf:"bytes,5,opt,name=template,proto3" json:"template,omitempty"` + Namespace *v1beta1.Namespace `protobuf:"bytes,1,opt,name=namespace,proto3" json:"namespace,omitempty"` + Provider *v1beta1.Provider `protobuf:"bytes,2,opt,name=provider,proto3" json:"provider,omitempty"` + Rule *v1beta1.Rule `protobuf:"bytes,3,opt,name=rule,proto3" json:"rule,omitempty"` + Template *v1beta1.Template `protobuf:"bytes,4,opt,name=template,proto3" json:"template,omitempty"` } func (x *UpsertRuleRequest) Reset() { @@ -166,11 +166,11 @@ func (*UpsertRuleRequest) Descriptor() ([]byte, []int) { return file_gotocompany_siren_provider_v1beta1_provider_proto_rawDescGZIP(), []int{2} } -func (x *UpsertRuleRequest) GetNamespaceURN() string { +func (x *UpsertRuleRequest) GetNamespace() *v1beta1.Namespace { if x != nil { - return x.NamespaceURN + return x.Namespace } - return "" + return nil } func (x *UpsertRuleRequest) GetProvider() *v1beta1.Provider { @@ -322,8 +322,8 @@ type TransformToAlertsRequest struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - ProviderID string `protobuf:"bytes,1,opt,name=providerID,proto3" json:"providerID,omitempty"` - NamespaceID string `protobuf:"bytes,2,opt,name=namespaceID,proto3" json:"namespaceID,omitempty"` + ProviderId string `protobuf:"bytes,1,opt,name=provider_id,json=providerId,proto3" json:"provider_id,omitempty"` + NamespaceId string `protobuf:"bytes,2,opt,name=namespace_id,json=namespaceId,proto3" json:"namespace_id,omitempty"` Body *structpb.Struct `protobuf:"bytes,3,opt,name=body,proto3" json:"body,omitempty"` } @@ -359,16 +359,16 @@ func (*TransformToAlertsRequest) Descriptor() ([]byte, []int) { return file_gotocompany_siren_provider_v1beta1_provider_proto_rawDescGZIP(), []int{6} } -func (x *TransformToAlertsRequest) GetProviderID() string { +func (x *TransformToAlertsRequest) GetProviderId() string { if x != nil { - return x.ProviderID + return x.ProviderId } return "" } -func (x *TransformToAlertsRequest) GetNamespaceID() string { +func (x *TransformToAlertsRequest) GetNamespaceId() string { if x != nil { - return x.NamespaceID + return x.NamespaceId } return "" } @@ -447,101 +447,103 @@ var file_gotocompany_siren_provider_v1beta1_provider_proto_rawDesc = []byte{ 0x70, 0x61, 0x6e, 0x79, 0x2f, 0x73, 0x69, 0x72, 0x65, 0x6e, 0x2f, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2f, 0x73, 0x69, 0x72, 0x65, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1c, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, - 0x73, 0x74, 0x72, 0x75, 0x63, 0x74, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xa1, 0x01, 0x0a, + 0x73, 0x74, 0x72, 0x75, 0x63, 0x74, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xa3, 0x01, 0x0a, 0x18, 0x53, 0x79, 0x6e, 0x63, 0x52, 0x75, 0x6e, 0x74, 0x69, 0x6d, 0x65, 0x43, 0x6f, 0x6e, 0x66, - 0x69, 0x67, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x20, 0x0a, 0x0b, 0x6e, 0x61, 0x6d, - 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x49, 0x44, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, - 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x49, 0x44, 0x12, 0x22, 0x0a, 0x0c, 0x6e, - 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x55, 0x52, 0x4e, 0x18, 0x02, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x0c, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x55, 0x52, 0x4e, 0x12, - 0x3f, 0x0a, 0x08, 0x70, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x18, 0x03, 0x20, 0x01, 0x28, + 0x69, 0x67, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x21, 0x0a, 0x0c, 0x6e, 0x61, 0x6d, + 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x0b, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x49, 0x64, 0x12, 0x23, 0x0a, 0x0d, + 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x5f, 0x75, 0x72, 0x6e, 0x18, 0x02, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x0c, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x55, 0x72, + 0x6e, 0x12, 0x3f, 0x0a, 0x08, 0x70, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x18, 0x03, 0x20, + 0x01, 0x28, 0x0b, 0x32, 0x23, 0x2e, 0x67, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6d, 0x70, 0x61, 0x6e, + 0x79, 0x2e, 0x73, 0x69, 0x72, 0x65, 0x6e, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, + 0x50, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x52, 0x08, 0x70, 0x72, 0x6f, 0x76, 0x69, 0x64, + 0x65, 0x72, 0x22, 0x1b, 0x0a, 0x19, 0x53, 0x79, 0x6e, 0x63, 0x52, 0x75, 0x6e, 0x74, 0x69, 0x6d, + 0x65, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, + 0x8e, 0x02, 0x0a, 0x11, 0x55, 0x70, 0x73, 0x65, 0x72, 0x74, 0x52, 0x75, 0x6c, 0x65, 0x52, 0x65, + 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x42, 0x0a, 0x09, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, + 0x63, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x24, 0x2e, 0x67, 0x6f, 0x74, 0x6f, 0x63, + 0x6f, 0x6d, 0x70, 0x61, 0x6e, 0x79, 0x2e, 0x73, 0x69, 0x72, 0x65, 0x6e, 0x2e, 0x76, 0x31, 0x62, + 0x65, 0x74, 0x61, 0x31, 0x2e, 0x4e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x52, 0x09, + 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x12, 0x3f, 0x0a, 0x08, 0x70, 0x72, 0x6f, + 0x76, 0x69, 0x64, 0x65, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x23, 0x2e, 0x67, 0x6f, + 0x74, 0x6f, 0x63, 0x6f, 0x6d, 0x70, 0x61, 0x6e, 0x79, 0x2e, 0x73, 0x69, 0x72, 0x65, 0x6e, 0x2e, + 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x50, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, + 0x52, 0x08, 0x70, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x12, 0x33, 0x0a, 0x04, 0x72, 0x75, + 0x6c, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1f, 0x2e, 0x67, 0x6f, 0x74, 0x6f, 0x63, + 0x6f, 0x6d, 0x70, 0x61, 0x6e, 0x79, 0x2e, 0x73, 0x69, 0x72, 0x65, 0x6e, 0x2e, 0x76, 0x31, 0x62, + 0x65, 0x74, 0x61, 0x31, 0x2e, 0x52, 0x75, 0x6c, 0x65, 0x52, 0x04, 0x72, 0x75, 0x6c, 0x65, 0x12, + 0x3f, 0x0a, 0x08, 0x74, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x23, 0x2e, 0x67, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6d, 0x70, 0x61, 0x6e, 0x79, 0x2e, - 0x73, 0x69, 0x72, 0x65, 0x6e, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x50, 0x72, - 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x52, 0x08, 0x70, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, - 0x22, 0x1b, 0x0a, 0x19, 0x53, 0x79, 0x6e, 0x63, 0x52, 0x75, 0x6e, 0x74, 0x69, 0x6d, 0x65, 0x43, - 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0xee, 0x01, - 0x0a, 0x11, 0x55, 0x70, 0x73, 0x65, 0x72, 0x74, 0x52, 0x75, 0x6c, 0x65, 0x52, 0x65, 0x71, 0x75, - 0x65, 0x73, 0x74, 0x12, 0x22, 0x0a, 0x0c, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, - 0x55, 0x52, 0x4e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x6e, 0x61, 0x6d, 0x65, 0x73, - 0x70, 0x61, 0x63, 0x65, 0x55, 0x52, 0x4e, 0x12, 0x3f, 0x0a, 0x08, 0x70, 0x72, 0x6f, 0x76, 0x69, - 0x64, 0x65, 0x72, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x23, 0x2e, 0x67, 0x6f, 0x74, 0x6f, + 0x73, 0x69, 0x72, 0x65, 0x6e, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x54, 0x65, + 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x52, 0x08, 0x74, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, + 0x22, 0x14, 0x0a, 0x12, 0x55, 0x70, 0x73, 0x65, 0x72, 0x74, 0x52, 0x75, 0x6c, 0x65, 0x52, 0x65, + 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x31, 0x0a, 0x10, 0x53, 0x65, 0x74, 0x43, 0x6f, 0x6e, + 0x66, 0x69, 0x67, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1d, 0x0a, 0x0a, 0x63, 0x6f, + 0x6e, 0x66, 0x69, 0x67, 0x5f, 0x72, 0x61, 0x77, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, + 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x52, 0x61, 0x77, 0x22, 0x13, 0x0a, 0x11, 0x53, 0x65, 0x74, + 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x8b, + 0x01, 0x0a, 0x18, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x66, 0x6f, 0x72, 0x6d, 0x54, 0x6f, 0x41, 0x6c, + 0x65, 0x72, 0x74, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1f, 0x0a, 0x0b, 0x70, + 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x0a, 0x70, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x49, 0x64, 0x12, 0x21, 0x0a, 0x0c, + 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x0b, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x49, 0x64, 0x12, + 0x2b, 0x0a, 0x04, 0x62, 0x6f, 0x64, 0x79, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x17, 0x2e, + 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, + 0x53, 0x74, 0x72, 0x75, 0x63, 0x74, 0x52, 0x04, 0x62, 0x6f, 0x64, 0x79, 0x22, 0x74, 0x0a, 0x19, + 0x54, 0x72, 0x61, 0x6e, 0x73, 0x66, 0x6f, 0x72, 0x6d, 0x54, 0x6f, 0x41, 0x6c, 0x65, 0x72, 0x74, + 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x38, 0x0a, 0x06, 0x61, 0x6c, 0x65, + 0x72, 0x74, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x20, 0x2e, 0x67, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6d, 0x70, 0x61, 0x6e, 0x79, 0x2e, 0x73, 0x69, 0x72, 0x65, 0x6e, 0x2e, 0x76, 0x31, - 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x50, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x52, 0x08, - 0x70, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x12, 0x33, 0x0a, 0x04, 0x72, 0x75, 0x6c, 0x65, - 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1f, 0x2e, 0x67, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6d, - 0x70, 0x61, 0x6e, 0x79, 0x2e, 0x73, 0x69, 0x72, 0x65, 0x6e, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, - 0x61, 0x31, 0x2e, 0x52, 0x75, 0x6c, 0x65, 0x52, 0x04, 0x72, 0x75, 0x6c, 0x65, 0x12, 0x3f, 0x0a, - 0x08, 0x74, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, - 0x23, 0x2e, 0x67, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6d, 0x70, 0x61, 0x6e, 0x79, 0x2e, 0x73, 0x69, - 0x72, 0x65, 0x6e, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x54, 0x65, 0x6d, 0x70, - 0x6c, 0x61, 0x74, 0x65, 0x52, 0x08, 0x74, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x22, 0x14, - 0x0a, 0x12, 0x55, 0x70, 0x73, 0x65, 0x72, 0x74, 0x52, 0x75, 0x6c, 0x65, 0x52, 0x65, 0x73, 0x70, - 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x31, 0x0a, 0x10, 0x53, 0x65, 0x74, 0x43, 0x6f, 0x6e, 0x66, 0x69, - 0x67, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1d, 0x0a, 0x0a, 0x63, 0x6f, 0x6e, 0x66, - 0x69, 0x67, 0x5f, 0x72, 0x61, 0x77, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x63, 0x6f, - 0x6e, 0x66, 0x69, 0x67, 0x52, 0x61, 0x77, 0x22, 0x13, 0x0a, 0x11, 0x53, 0x65, 0x74, 0x43, 0x6f, - 0x6e, 0x66, 0x69, 0x67, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x89, 0x01, 0x0a, - 0x18, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x66, 0x6f, 0x72, 0x6d, 0x54, 0x6f, 0x41, 0x6c, 0x65, 0x72, - 0x74, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1e, 0x0a, 0x0a, 0x70, 0x72, 0x6f, - 0x76, 0x69, 0x64, 0x65, 0x72, 0x49, 0x44, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x70, - 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x49, 0x44, 0x12, 0x20, 0x0a, 0x0b, 0x6e, 0x61, 0x6d, - 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x49, 0x44, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, - 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x49, 0x44, 0x12, 0x2b, 0x0a, 0x04, 0x62, - 0x6f, 0x64, 0x79, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x67, 0x6f, 0x6f, 0x67, - 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x53, 0x74, 0x72, 0x75, - 0x63, 0x74, 0x52, 0x04, 0x62, 0x6f, 0x64, 0x79, 0x22, 0x74, 0x0a, 0x19, 0x54, 0x72, 0x61, 0x6e, - 0x73, 0x66, 0x6f, 0x72, 0x6d, 0x54, 0x6f, 0x41, 0x6c, 0x65, 0x72, 0x74, 0x73, 0x52, 0x65, 0x73, - 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x38, 0x0a, 0x06, 0x61, 0x6c, 0x65, 0x72, 0x74, 0x73, 0x18, - 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x20, 0x2e, 0x67, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6d, 0x70, - 0x61, 0x6e, 0x79, 0x2e, 0x73, 0x69, 0x72, 0x65, 0x6e, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, - 0x31, 0x2e, 0x41, 0x6c, 0x65, 0x72, 0x74, 0x52, 0x06, 0x61, 0x6c, 0x65, 0x72, 0x74, 0x73, 0x12, - 0x1d, 0x0a, 0x0a, 0x66, 0x69, 0x72, 0x69, 0x6e, 0x67, 0x5f, 0x6e, 0x75, 0x6d, 0x18, 0x02, 0x20, - 0x01, 0x28, 0x04, 0x52, 0x09, 0x66, 0x69, 0x72, 0x69, 0x6e, 0x67, 0x4e, 0x75, 0x6d, 0x32, 0xae, - 0x04, 0x0a, 0x0f, 0x50, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x53, 0x65, 0x72, 0x76, 0x69, - 0x63, 0x65, 0x12, 0x90, 0x01, 0x0a, 0x11, 0x53, 0x79, 0x6e, 0x63, 0x52, 0x75, 0x6e, 0x74, 0x69, - 0x6d, 0x65, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x12, 0x3c, 0x2e, 0x67, 0x6f, 0x74, 0x6f, 0x63, - 0x6f, 0x6d, 0x70, 0x61, 0x6e, 0x79, 0x2e, 0x73, 0x69, 0x72, 0x65, 0x6e, 0x2e, 0x70, 0x72, 0x6f, - 0x76, 0x69, 0x64, 0x65, 0x72, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x53, 0x79, - 0x6e, 0x63, 0x52, 0x75, 0x6e, 0x74, 0x69, 0x6d, 0x65, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x52, - 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x3d, 0x2e, 0x67, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6d, - 0x70, 0x61, 0x6e, 0x79, 0x2e, 0x73, 0x69, 0x72, 0x65, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x76, 0x69, - 0x64, 0x65, 0x72, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x53, 0x79, 0x6e, 0x63, - 0x52, 0x75, 0x6e, 0x74, 0x69, 0x6d, 0x65, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x52, 0x65, 0x73, - 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x7b, 0x0a, 0x0a, 0x55, 0x70, 0x73, 0x65, 0x72, 0x74, 0x52, - 0x75, 0x6c, 0x65, 0x12, 0x35, 0x2e, 0x67, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6d, 0x70, 0x61, 0x6e, - 0x79, 0x2e, 0x73, 0x69, 0x72, 0x65, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, - 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x55, 0x70, 0x73, 0x65, 0x72, 0x74, 0x52, - 0x75, 0x6c, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x36, 0x2e, 0x67, 0x6f, 0x74, + 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x41, 0x6c, 0x65, 0x72, 0x74, 0x52, 0x06, 0x61, 0x6c, 0x65, + 0x72, 0x74, 0x73, 0x12, 0x1d, 0x0a, 0x0a, 0x66, 0x69, 0x72, 0x69, 0x6e, 0x67, 0x5f, 0x6e, 0x75, + 0x6d, 0x18, 0x02, 0x20, 0x01, 0x28, 0x04, 0x52, 0x09, 0x66, 0x69, 0x72, 0x69, 0x6e, 0x67, 0x4e, + 0x75, 0x6d, 0x32, 0xae, 0x04, 0x0a, 0x0f, 0x50, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x53, + 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x90, 0x01, 0x0a, 0x11, 0x53, 0x79, 0x6e, 0x63, 0x52, + 0x75, 0x6e, 0x74, 0x69, 0x6d, 0x65, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x12, 0x3c, 0x2e, 0x67, + 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6d, 0x70, 0x61, 0x6e, 0x79, 0x2e, 0x73, 0x69, 0x72, 0x65, 0x6e, + 0x2e, 0x70, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, + 0x31, 0x2e, 0x53, 0x79, 0x6e, 0x63, 0x52, 0x75, 0x6e, 0x74, 0x69, 0x6d, 0x65, 0x43, 0x6f, 0x6e, + 0x66, 0x69, 0x67, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x3d, 0x2e, 0x67, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6d, 0x70, 0x61, 0x6e, 0x79, 0x2e, 0x73, 0x69, 0x72, 0x65, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, - 0x55, 0x70, 0x73, 0x65, 0x72, 0x74, 0x52, 0x75, 0x6c, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, - 0x73, 0x65, 0x12, 0x78, 0x0a, 0x09, 0x53, 0x65, 0x74, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x12, - 0x34, 0x2e, 0x67, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6d, 0x70, 0x61, 0x6e, 0x79, 0x2e, 0x73, 0x69, - 0x72, 0x65, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x2e, 0x76, 0x31, 0x62, - 0x65, 0x74, 0x61, 0x31, 0x2e, 0x53, 0x65, 0x74, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x52, 0x65, - 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x35, 0x2e, 0x67, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6d, 0x70, - 0x61, 0x6e, 0x79, 0x2e, 0x73, 0x69, 0x72, 0x65, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x76, 0x69, 0x64, - 0x65, 0x72, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x53, 0x65, 0x74, 0x43, 0x6f, - 0x6e, 0x66, 0x69, 0x67, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x90, 0x01, 0x0a, - 0x11, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x66, 0x6f, 0x72, 0x6d, 0x54, 0x6f, 0x41, 0x6c, 0x65, 0x72, - 0x74, 0x73, 0x12, 0x3c, 0x2e, 0x67, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6d, 0x70, 0x61, 0x6e, 0x79, - 0x2e, 0x73, 0x69, 0x72, 0x65, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x2e, - 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x66, 0x6f, 0x72, - 0x6d, 0x54, 0x6f, 0x41, 0x6c, 0x65, 0x72, 0x74, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, - 0x1a, 0x3d, 0x2e, 0x67, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6d, 0x70, 0x61, 0x6e, 0x79, 0x2e, 0x73, - 0x69, 0x72, 0x65, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x2e, 0x76, 0x31, - 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x66, 0x6f, 0x72, 0x6d, 0x54, - 0x6f, 0x41, 0x6c, 0x65, 0x72, 0x74, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x42, - 0x8e, 0x01, 0x0a, 0x25, 0x63, 0x6f, 0x6d, 0x2e, 0x67, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6d, 0x70, - 0x61, 0x6e, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x6e, 0x2e, 0x73, 0x69, 0x72, 0x65, 0x6e, - 0x2e, 0x70, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x42, 0x0e, 0x53, 0x65, 0x72, 0x76, 0x69, - 0x63, 0x65, 0x4d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x72, 0x50, 0x01, 0x5a, 0x53, 0x67, 0x69, 0x74, - 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x67, 0x6f, 0x74, 0x6f, 0x2f, 0x73, 0x69, 0x72, - 0x65, 0x6e, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x67, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6d, - 0x70, 0x61, 0x6e, 0x79, 0x2f, 0x73, 0x69, 0x72, 0x65, 0x6e, 0x2f, 0x70, 0x72, 0x6f, 0x76, 0x69, - 0x64, 0x65, 0x72, 0x2f, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x3b, 0x73, 0x69, 0x72, 0x65, - 0x6e, 0x70, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, - 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x53, 0x79, 0x6e, 0x63, 0x52, 0x75, 0x6e, 0x74, 0x69, 0x6d, 0x65, 0x43, 0x6f, 0x6e, 0x66, 0x69, + 0x67, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x7b, 0x0a, 0x0a, 0x55, 0x70, 0x73, + 0x65, 0x72, 0x74, 0x52, 0x75, 0x6c, 0x65, 0x12, 0x35, 0x2e, 0x67, 0x6f, 0x74, 0x6f, 0x63, 0x6f, + 0x6d, 0x70, 0x61, 0x6e, 0x79, 0x2e, 0x73, 0x69, 0x72, 0x65, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x76, + 0x69, 0x64, 0x65, 0x72, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x55, 0x70, 0x73, + 0x65, 0x72, 0x74, 0x52, 0x75, 0x6c, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x36, + 0x2e, 0x67, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6d, 0x70, 0x61, 0x6e, 0x79, 0x2e, 0x73, 0x69, 0x72, + 0x65, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x2e, 0x76, 0x31, 0x62, 0x65, + 0x74, 0x61, 0x31, 0x2e, 0x55, 0x70, 0x73, 0x65, 0x72, 0x74, 0x52, 0x75, 0x6c, 0x65, 0x52, 0x65, + 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x78, 0x0a, 0x09, 0x53, 0x65, 0x74, 0x43, 0x6f, 0x6e, + 0x66, 0x69, 0x67, 0x12, 0x34, 0x2e, 0x67, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6d, 0x70, 0x61, 0x6e, + 0x79, 0x2e, 0x73, 0x69, 0x72, 0x65, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, + 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x53, 0x65, 0x74, 0x43, 0x6f, 0x6e, 0x66, + 0x69, 0x67, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x35, 0x2e, 0x67, 0x6f, 0x74, 0x6f, + 0x63, 0x6f, 0x6d, 0x70, 0x61, 0x6e, 0x79, 0x2e, 0x73, 0x69, 0x72, 0x65, 0x6e, 0x2e, 0x70, 0x72, + 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x53, + 0x65, 0x74, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, + 0x12, 0x90, 0x01, 0x0a, 0x11, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x66, 0x6f, 0x72, 0x6d, 0x54, 0x6f, + 0x41, 0x6c, 0x65, 0x72, 0x74, 0x73, 0x12, 0x3c, 0x2e, 0x67, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6d, + 0x70, 0x61, 0x6e, 0x79, 0x2e, 0x73, 0x69, 0x72, 0x65, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x76, 0x69, + 0x64, 0x65, 0x72, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x54, 0x72, 0x61, 0x6e, + 0x73, 0x66, 0x6f, 0x72, 0x6d, 0x54, 0x6f, 0x41, 0x6c, 0x65, 0x72, 0x74, 0x73, 0x52, 0x65, 0x71, + 0x75, 0x65, 0x73, 0x74, 0x1a, 0x3d, 0x2e, 0x67, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6d, 0x70, 0x61, + 0x6e, 0x79, 0x2e, 0x73, 0x69, 0x72, 0x65, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, + 0x72, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x66, + 0x6f, 0x72, 0x6d, 0x54, 0x6f, 0x41, 0x6c, 0x65, 0x72, 0x74, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, + 0x6e, 0x73, 0x65, 0x42, 0x8e, 0x01, 0x0a, 0x25, 0x63, 0x6f, 0x6d, 0x2e, 0x67, 0x6f, 0x74, 0x6f, + 0x63, 0x6f, 0x6d, 0x70, 0x61, 0x6e, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x6e, 0x2e, 0x73, + 0x69, 0x72, 0x65, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x42, 0x0e, 0x53, + 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x4d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x72, 0x50, 0x01, 0x5a, + 0x53, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x67, 0x6f, 0x74, 0x6f, + 0x2f, 0x73, 0x69, 0x72, 0x65, 0x6e, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x67, 0x6f, 0x74, + 0x6f, 0x63, 0x6f, 0x6d, 0x70, 0x61, 0x6e, 0x79, 0x2f, 0x73, 0x69, 0x72, 0x65, 0x6e, 0x2f, 0x70, + 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x2f, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x3b, + 0x73, 0x69, 0x72, 0x65, 0x6e, 0x70, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x76, 0x31, 0x62, + 0x65, 0x74, 0x61, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -567,31 +569,33 @@ var file_gotocompany_siren_provider_v1beta1_provider_proto_goTypes = []interface (*TransformToAlertsRequest)(nil), // 6: gotocompany.siren.provider.v1beta1.TransformToAlertsRequest (*TransformToAlertsResponse)(nil), // 7: gotocompany.siren.provider.v1beta1.TransformToAlertsResponse (*v1beta1.Provider)(nil), // 8: gotocompany.siren.v1beta1.Provider - (*v1beta1.Rule)(nil), // 9: gotocompany.siren.v1beta1.Rule - (*v1beta1.Template)(nil), // 10: gotocompany.siren.v1beta1.Template - (*structpb.Struct)(nil), // 11: google.protobuf.Struct - (*v1beta1.Alert)(nil), // 12: gotocompany.siren.v1beta1.Alert + (*v1beta1.Namespace)(nil), // 9: gotocompany.siren.v1beta1.Namespace + (*v1beta1.Rule)(nil), // 10: gotocompany.siren.v1beta1.Rule + (*v1beta1.Template)(nil), // 11: gotocompany.siren.v1beta1.Template + (*structpb.Struct)(nil), // 12: google.protobuf.Struct + (*v1beta1.Alert)(nil), // 13: gotocompany.siren.v1beta1.Alert } var file_gotocompany_siren_provider_v1beta1_provider_proto_depIdxs = []int32{ 8, // 0: gotocompany.siren.provider.v1beta1.SyncRuntimeConfigRequest.provider:type_name -> gotocompany.siren.v1beta1.Provider - 8, // 1: gotocompany.siren.provider.v1beta1.UpsertRuleRequest.provider:type_name -> gotocompany.siren.v1beta1.Provider - 9, // 2: gotocompany.siren.provider.v1beta1.UpsertRuleRequest.rule:type_name -> gotocompany.siren.v1beta1.Rule - 10, // 3: gotocompany.siren.provider.v1beta1.UpsertRuleRequest.template:type_name -> gotocompany.siren.v1beta1.Template - 11, // 4: gotocompany.siren.provider.v1beta1.TransformToAlertsRequest.body:type_name -> google.protobuf.Struct - 12, // 5: gotocompany.siren.provider.v1beta1.TransformToAlertsResponse.alerts:type_name -> gotocompany.siren.v1beta1.Alert - 0, // 6: gotocompany.siren.provider.v1beta1.ProviderService.SyncRuntimeConfig:input_type -> gotocompany.siren.provider.v1beta1.SyncRuntimeConfigRequest - 2, // 7: gotocompany.siren.provider.v1beta1.ProviderService.UpsertRule:input_type -> gotocompany.siren.provider.v1beta1.UpsertRuleRequest - 4, // 8: gotocompany.siren.provider.v1beta1.ProviderService.SetConfig:input_type -> gotocompany.siren.provider.v1beta1.SetConfigRequest - 6, // 9: gotocompany.siren.provider.v1beta1.ProviderService.TransformToAlerts:input_type -> gotocompany.siren.provider.v1beta1.TransformToAlertsRequest - 1, // 10: gotocompany.siren.provider.v1beta1.ProviderService.SyncRuntimeConfig:output_type -> gotocompany.siren.provider.v1beta1.SyncRuntimeConfigResponse - 3, // 11: gotocompany.siren.provider.v1beta1.ProviderService.UpsertRule:output_type -> gotocompany.siren.provider.v1beta1.UpsertRuleResponse - 5, // 12: gotocompany.siren.provider.v1beta1.ProviderService.SetConfig:output_type -> gotocompany.siren.provider.v1beta1.SetConfigResponse - 7, // 13: gotocompany.siren.provider.v1beta1.ProviderService.TransformToAlerts:output_type -> gotocompany.siren.provider.v1beta1.TransformToAlertsResponse - 10, // [10:14] is the sub-list for method output_type - 6, // [6:10] is the sub-list for method input_type - 6, // [6:6] is the sub-list for extension type_name - 6, // [6:6] is the sub-list for extension extendee - 0, // [0:6] is the sub-list for field type_name + 9, // 1: gotocompany.siren.provider.v1beta1.UpsertRuleRequest.namespace:type_name -> gotocompany.siren.v1beta1.Namespace + 8, // 2: gotocompany.siren.provider.v1beta1.UpsertRuleRequest.provider:type_name -> gotocompany.siren.v1beta1.Provider + 10, // 3: gotocompany.siren.provider.v1beta1.UpsertRuleRequest.rule:type_name -> gotocompany.siren.v1beta1.Rule + 11, // 4: gotocompany.siren.provider.v1beta1.UpsertRuleRequest.template:type_name -> gotocompany.siren.v1beta1.Template + 12, // 5: gotocompany.siren.provider.v1beta1.TransformToAlertsRequest.body:type_name -> google.protobuf.Struct + 13, // 6: gotocompany.siren.provider.v1beta1.TransformToAlertsResponse.alerts:type_name -> gotocompany.siren.v1beta1.Alert + 0, // 7: gotocompany.siren.provider.v1beta1.ProviderService.SyncRuntimeConfig:input_type -> gotocompany.siren.provider.v1beta1.SyncRuntimeConfigRequest + 2, // 8: gotocompany.siren.provider.v1beta1.ProviderService.UpsertRule:input_type -> gotocompany.siren.provider.v1beta1.UpsertRuleRequest + 4, // 9: gotocompany.siren.provider.v1beta1.ProviderService.SetConfig:input_type -> gotocompany.siren.provider.v1beta1.SetConfigRequest + 6, // 10: gotocompany.siren.provider.v1beta1.ProviderService.TransformToAlerts:input_type -> gotocompany.siren.provider.v1beta1.TransformToAlertsRequest + 1, // 11: gotocompany.siren.provider.v1beta1.ProviderService.SyncRuntimeConfig:output_type -> gotocompany.siren.provider.v1beta1.SyncRuntimeConfigResponse + 3, // 12: gotocompany.siren.provider.v1beta1.ProviderService.UpsertRule:output_type -> gotocompany.siren.provider.v1beta1.UpsertRuleResponse + 5, // 13: gotocompany.siren.provider.v1beta1.ProviderService.SetConfig:output_type -> gotocompany.siren.provider.v1beta1.SetConfigResponse + 7, // 14: gotocompany.siren.provider.v1beta1.ProviderService.TransformToAlerts:output_type -> gotocompany.siren.provider.v1beta1.TransformToAlertsResponse + 11, // [11:15] is the sub-list for method output_type + 7, // [7:11] is the sub-list for method input_type + 7, // [7:7] is the sub-list for extension type_name + 7, // [7:7] is the sub-list for extension extendee + 0, // [0:7] is the sub-list for field type_name } func init() { file_gotocompany_siren_provider_v1beta1_provider_proto_init() } diff --git a/proto/gotocompany/siren/provider/v1beta1/provider.pb.validate.go b/proto/gotocompany/siren/provider/v1beta1/provider.pb.validate.go index e2140d65..96a8e05f 100644 --- a/proto/gotocompany/siren/provider/v1beta1/provider.pb.validate.go +++ b/proto/gotocompany/siren/provider/v1beta1/provider.pb.validate.go @@ -57,9 +57,9 @@ func (m *SyncRuntimeConfigRequest) validate(all bool) error { var errors []error - // no validation rules for NamespaceID + // no validation rules for NamespaceId - // no validation rules for NamespaceURN + // no validation rules for NamespaceUrn if all { switch v := interface{}(m.GetProvider()).(type) { @@ -294,7 +294,34 @@ func (m *UpsertRuleRequest) validate(all bool) error { var errors []error - // no validation rules for NamespaceURN + if all { + switch v := interface{}(m.GetNamespace()).(type) { + case interface{ ValidateAll() error }: + if err := v.ValidateAll(); err != nil { + errors = append(errors, UpsertRuleRequestValidationError{ + field: "Namespace", + reason: "embedded message failed validation", + cause: err, + }) + } + case interface{ Validate() error }: + if err := v.Validate(); err != nil { + errors = append(errors, UpsertRuleRequestValidationError{ + field: "Namespace", + reason: "embedded message failed validation", + cause: err, + }) + } + } + } else if v, ok := interface{}(m.GetNamespace()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return UpsertRuleRequestValidationError{ + field: "Namespace", + reason: "embedded message failed validation", + cause: err, + } + } + } if all { switch v := interface{}(m.GetProvider()).(type) { @@ -791,9 +818,9 @@ func (m *TransformToAlertsRequest) validate(all bool) error { var errors []error - // no validation rules for ProviderID + // no validation rules for ProviderId - // no validation rules for NamespaceID + // no validation rules for NamespaceId if all { switch v := interface{}(m.GetBody()).(type) { diff --git a/test/e2e_test/cortex_alerting_test.go b/test/e2e_test/cortex_alerting_test.go index fecf0d2c..f13cb4e9 100644 --- a/test/e2e_test/cortex_alerting_test.go +++ b/test/e2e_test/cortex_alerting_test.go @@ -86,7 +86,7 @@ func (s *CortexAlertingTestSuite) SetupTest() { s.appConfig.Notification.MessageHandler.Enabled = true s.appConfig.Notification.DLQHandler.Enabled = true - ctx, cancel := context.WithCancel(context.Background()) + ctx, cancel := context.WithCancel(context.TODO()) s.cancelContext = cancel StartSirenServer(ctx, *s.appConfig) @@ -119,7 +119,7 @@ func (s *CortexAlertingTestSuite) TearDownTest() { } func (s *CortexAlertingTestSuite) TestAlerting() { - ctx := context.Background() + ctx := context.TODO() triggerAlertBody := ` [ { diff --git a/test/e2e_test/cortex_direct_notification_subscription_test.go b/test/e2e_test/cortex_direct_notification_subscription_test.go index 15158f97..1233c7a9 100644 --- a/test/e2e_test/cortex_direct_notification_subscription_test.go +++ b/test/e2e_test/cortex_direct_notification_subscription_test.go @@ -92,7 +92,7 @@ func (s *CortexDirectNotificationSubscriptionTestSuite) SetupTest() { s.appConfig.Notification.MessageHandler.Enabled = true s.appConfig.Notification.DLQHandler.Enabled = true - ctx, cancel := context.WithCancel(context.Background()) + ctx, cancel := context.WithCancel(context.TODO()) s.cancelContext = cancel StartSirenServer(ctx, *s.appConfig) @@ -125,7 +125,7 @@ func (s *CortexDirectNotificationSubscriptionTestSuite) TearDownTest() { } func (s *CortexDirectNotificationSubscriptionTestSuite) TestSendNotification() { - ctx := context.Background() + ctx := context.TODO() _, err := s.grpcClient.CreateNamespace(ctx, &sirenv1beta1.CreateNamespaceRequest{ Name: "new-gotocompany-1", diff --git a/test/e2e_test/cortex_namespace_test.go b/test/e2e_test/cortex_namespace_test.go index 6be9501a..b36fa27f 100644 --- a/test/e2e_test/cortex_namespace_test.go +++ b/test/e2e_test/cortex_namespace_test.go @@ -73,7 +73,7 @@ func (s *CortexNamespaceTestSuite) SetupTest() { }, } - ctx, cancel := context.WithCancel(context.Background()) + ctx, cancel := context.WithCancel(context.TODO()) s.cancelContext = cancel StartSirenServer(ctx, *s.appConfig) @@ -101,7 +101,7 @@ func (s *CortexNamespaceTestSuite) TearDownTest() { } func (s *CortexNamespaceTestSuite) TestNamespace() { - ctx := context.Background() + ctx := context.TODO() s.Run("initial state alert config not set, add a namespace will set config for the provider tenant", func() { _, err := s.client.CreateNamespace(ctx, &sirenv1beta1.CreateNamespaceRequest{ diff --git a/test/e2e_test/cortex_rule_test.go b/test/e2e_test/cortex_rule_test.go index f65f6662..aab28bd8 100644 --- a/test/e2e_test/cortex_rule_test.go +++ b/test/e2e_test/cortex_rule_test.go @@ -77,7 +77,7 @@ func (s *CortexRuleTestSuite) SetupTest() { }, } - ctx, cancel := context.WithCancel(context.Background()) + ctx, cancel := context.WithCancel(context.TODO()) s.cancelContext = cancel StartSirenServer(ctx, *s.appConfig) @@ -99,7 +99,7 @@ func (s *CortexRuleTestSuite) TearDownTest() { } func (s *CortexRuleTestSuite) TestRules() { - ctx := context.Background() + ctx := context.TODO() s.Run("initial state has no rule groups, upload rules and templates should return `testdata/cortex/expected-cortexrule-scenario-1.yaml`", func() { err := uploadTemplate(ctx, s.client, "testdata/cortex/template-rule-sample-1.yaml") diff --git a/test/e2e_test/cortex_webhook_test.go b/test/e2e_test/cortex_webhook_test.go index 587878d4..ffe4320b 100644 --- a/test/e2e_test/cortex_webhook_test.go +++ b/test/e2e_test/cortex_webhook_test.go @@ -98,7 +98,7 @@ func (s *CortexWebhookTestSuite) SetupTest() { s.appConfig.Notification.MessageHandler.Enabled = true s.appConfig.Notification.DLQHandler.Enabled = true - ctx, cancel := context.WithCancel(context.Background()) + ctx, cancel := context.WithCancel(context.TODO()) s.cancelContext = cancel StartSirenServer(ctx, *s.appConfig) @@ -132,7 +132,7 @@ func (s *CortexWebhookTestSuite) TearDownTest() { func (s *CortexWebhookTestSuite) TestIncomingHookAPI() { var ( - ctx = context.Background() + ctx = context.TODO() triggerAlertBody = ` { "receiver": "http_subscribe-http-receiver-notification_receiverId_2_idx_0", @@ -311,7 +311,7 @@ func (s *CortexWebhookTestSuite) TestIncomingHookAPI() { time.Sleep(5 * time.Second) - rows, err := s.dbClient.QueryxContext(context.Background(), `select * from notification_log`) + rows, err := s.dbClient.QueryxContext(context.TODO(), `select * from notification_log`) s.Require().NoError(err) var notificationLogs []log.Notification @@ -348,7 +348,7 @@ func (s *CortexWebhookTestSuite) TestIncomingHookAPI() { } s.Assert().True(silenceExist) - rows, err = s.dbClient.QueryxContext(context.Background(), `select * from alerts`) + rows, err = s.dbClient.QueryxContext(context.TODO(), `select * from alerts`) s.Require().NoError(err) var alerts []alert.Alert diff --git a/test/e2e_test/helper_test.go b/test/e2e_test/helper_test.go index 28168b14..62e03f62 100644 --- a/test/e2e_test/helper_test.go +++ b/test/e2e_test/helper_test.go @@ -59,7 +59,7 @@ func uploadTemplate(ctx context.Context, cl sirenv1beta1.SirenServiceClient, fil }) } - _, err = cl.UpsertTemplate(context.Background(), &sirenv1beta1.UpsertTemplateRequest{ + _, err = cl.UpsertTemplate(context.TODO(), &sirenv1beta1.UpsertTemplateRequest{ Name: t.Name, Body: string(body), Variables: variables, @@ -115,7 +115,7 @@ func uploadRule(ctx context.Context, cl sirenv1beta1.SirenServiceClient, filePat return errors.New("provider namespace is required") } - providersData, err := cl.ListProviders(context.Background(), &sirenv1beta1.ListProvidersRequest{ + providersData, err := cl.ListProviders(context.TODO(), &sirenv1beta1.ListProvidersRequest{ Urn: yamlBody.Provider, }) if err != nil { @@ -134,7 +134,7 @@ func uploadRule(ctx context.Context, cl sirenv1beta1.SirenServiceClient, filePat return errors.New("provider not found") } - res, err := cl.ListNamespaces(context.Background(), &sirenv1beta1.ListNamespacesRequest{}) + res, err := cl.ListNamespaces(context.TODO(), &sirenv1beta1.ListNamespacesRequest{}) if err != nil { return err } @@ -164,7 +164,7 @@ func uploadRule(ctx context.Context, cl sirenv1beta1.SirenServiceClient, filePat Enabled: v.Enabled, } - _, err = cl.UpdateRule(context.Background(), payload) + _, err = cl.UpdateRule(context.TODO(), payload) if err != nil { fmt.Println(fmt.Sprintf("rule %s/%s/%s upload error", payload.Namespace, payload.GroupName, payload.Template), err) @@ -185,7 +185,7 @@ func createConnection(ctx context.Context, host string) (*grpc.ClientConn, error } func CreateClient(ctx context.Context, host string) (sirenv1beta1.SirenServiceClient, func(), error) { - conn, err := createConnection(context.Background(), host) + conn, err := createConnection(context.TODO(), host) if err != nil { return nil, nil, err } diff --git a/test/e2e_test/notification_test.go b/test/e2e_test/notification_test.go index 71b30d9a..61e0b9d2 100644 --- a/test/e2e_test/notification_test.go +++ b/test/e2e_test/notification_test.go @@ -83,7 +83,7 @@ func (s *NotificationTestSuite) SetupTest() { }, } - ctx, cancel := context.WithCancel(context.Background()) + ctx, cancel := context.WithCancel(context.TODO()) s.cancelContext = cancel StartSirenServer(ctx, *s.appConfig) @@ -112,7 +112,7 @@ func (s *NotificationTestSuite) TearDownTest() { } func (s *NotificationTestSuite) TestSendNotification() { - ctx := context.Background() + ctx := context.TODO() controlChan := make(chan struct{}, 1)