mirror of
https://github.com/zitadel/zitadel.git
synced 2024-12-12 02:54:20 +00:00
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 <livio.a@gmail.com>
This commit is contained in:
parent
f610d48569
commit
8448f88f94
@ -16,9 +16,6 @@ func (c *Commands) AddMachine(ctx context.Context, orgID string, machine *domain
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, caos_errs.ThrowPreconditionFailed(err, "COMMAND-3M9fs", "Errors.Org.DomainPolicy.NotFound")
|
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()
|
userID, err := c.idGenerator.Next()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
|
@ -76,35 +76,6 @@ func TestCommandSide_AddMachine(t *testing.T) {
|
|||||||
err: caos_errs.IsPreconditionFailed,
|
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",
|
name: "add machine, ok",
|
||||||
fields: fields{
|
fields: fields{
|
||||||
|
Loading…
Reference in New Issue
Block a user