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 <[email protected]>
This commit is contained in:
Fabi
2022-07-28 14:33:59 +00:00
committed by GitHub
co-authored by Livio Spring
parent f610d48569
commit 8448f88f94
2 changed files with 0 additions and 32 deletions
-3
View File
@@ -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
-29
View File
@@ -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{