From 188938e937be3746b9d2b9c77e25c1041db652b3 Mon Sep 17 00:00:00 2001 From: Livio Amstutz Date: Fri, 9 Apr 2021 11:50:06 +0200 Subject: [PATCH] fix: remove app name check on ChangeAPIApplication (#1561) * fix: remove app name check on ChangeAPIApplication * fix APIConfigInvalid message --- internal/command/project_application_api.go | 2 +- .../command/project_application_api_test.go | 21 ------------------- internal/static/i18n/en.yaml | 2 +- 3 files changed, 2 insertions(+), 23 deletions(-) diff --git a/internal/command/project_application_api.go b/internal/command/project_application_api.go index 162daf06d4..35b2e7a8c7 100644 --- a/internal/command/project_application_api.go +++ b/internal/command/project_application_api.go @@ -69,7 +69,7 @@ func (c *Commands) addAPIApplication(ctx context.Context, projectAgg *eventstore } func (c *Commands) ChangeAPIApplication(ctx context.Context, apiApp *domain.APIApp, resourceOwner string) (*domain.APIApp, error) { - if !apiApp.IsValid() || apiApp.AppID == "" || apiApp.AggregateID == "" { + if apiApp.AppID == "" || apiApp.AggregateID == "" { return nil, caos_errs.ThrowInvalidArgument(nil, "COMMAND-1m900", "Errors.Project.App.APIConfigInvalid") } diff --git a/internal/command/project_application_api_test.go b/internal/command/project_application_api_test.go index d98930695c..a438b4f285 100644 --- a/internal/command/project_application_api_test.go +++ b/internal/command/project_application_api_test.go @@ -272,27 +272,6 @@ func TestCommandSide_ChangeAPIApplication(t *testing.T) { args args res res }{ - { - name: "invalid app, invalid argument error", - fields: fields{ - eventstore: eventstoreExpect( - t, - ), - }, - args: args{ - ctx: context.Background(), - apiApp: &domain.APIApp{ - ObjectRoot: models.ObjectRoot{ - AggregateID: "project1", - }, - AppID: "app1", - }, - resourceOwner: "org1", - }, - res: res{ - err: caos_errs.IsErrorInvalidArgument, - }, - }, { name: "missing appid, invalid argument error", fields: fields{ diff --git a/internal/static/i18n/en.yaml b/internal/static/i18n/en.yaml index 5eefed8f9f..7eeb74c66e 100644 --- a/internal/static/i18n/en.yaml +++ b/internal/static/i18n/en.yaml @@ -194,7 +194,7 @@ Errors: NotActive:: Application is not active NotInactive: Application is not inactive OIDCConfigInvalid: OIDC configuration is invalid - APIConfigInvalid: OIDC configuration is invalid + APIConfigInvalid: API configuration is invalid IsNotOIDC: Application is not type oidc IsNotAPI: Application is not type API OIDCAuthMethodNoSecret: Chosen OIDC Auth Method does not require a secret