From 8448f88f94423a02b9998766038ee42520e04197 Mon Sep 17 00:00:00 2001 From: Fabi <38692350+hifabienne@users.noreply.github.com> Date: Thu, 28 Jul 2022 16:33:59 +0200 Subject: [PATCH] fix: remove user login must be domain check on machine users (#4065) * fix: remove user login must be domain check on machine users * fix: test Co-authored-by: Livio Spring --- internal/command/user_machine.go | 3 --- internal/command/user_machine_test.go | 29 --------------------------- 2 files changed, 32 deletions(-) diff --git a/internal/command/user_machine.go b/internal/command/user_machine.go index 38e8cff2a6..714f238eab 100644 --- a/internal/command/user_machine.go +++ b/internal/command/user_machine.go @@ -16,9 +16,6 @@ func (c *Commands) AddMachine(ctx context.Context, orgID string, machine *domain if err != nil { return nil, caos_errs.ThrowPreconditionFailed(err, "COMMAND-3M9fs", "Errors.Org.DomainPolicy.NotFound") } - if !domainPolicy.UserLoginMustBeDomain { - return nil, caos_errs.ThrowPreconditionFailed(nil, "COMMAND-6M0ds", "Errors.User.Invalid") - } userID, err := c.idGenerator.Next() if err != nil { return nil, err diff --git a/internal/command/user_machine_test.go b/internal/command/user_machine_test.go index 23e15859eb..e08ce98e10 100644 --- a/internal/command/user_machine_test.go +++ b/internal/command/user_machine_test.go @@ -76,35 +76,6 @@ func TestCommandSide_AddMachine(t *testing.T) { err: caos_errs.IsPreconditionFailed, }, }, - { - name: "org policy global, precondition error", - fields: fields{ - eventstore: eventstoreExpect( - t, - expectFilter( - eventFromEventPusher( - org.NewDomainPolicyAddedEvent(context.Background(), - &user.NewAggregate("user1", "org1").Aggregate, - false, - true, - true, - ), - ), - ), - ), - }, - args: args{ - ctx: context.Background(), - orgID: "org1", - machine: &domain.Machine{ - Username: "username", - Name: "name", - }, - }, - res: res{ - err: caos_errs.IsPreconditionFailed, - }, - }, { name: "add machine, ok", fields: fields{