fix: rename iam to instance (#3345)

* fix: rename iam command side to instance

* fix: rename iam command side to instance

* fix: rename iam command side to instance

* fix: rename iam command side to instance

* fix: rename orgiampolicy to domain policy

* fix: merge conflicts

* fix: protos

* fix: md files

* implement deprecated org iam policy again

Co-authored-by: Livio Amstutz <livio.a@gmail.com>
This commit is contained in:
Fabi
2022-03-24 17:21:34 +01:00
committed by GitHub
parent 504fe5b761
commit 9d4f296c62
274 changed files with 12073 additions and 11853 deletions

View File

@@ -8,7 +8,7 @@ import (
"github.com/caos/zitadel/internal/eventstore"
"github.com/caos/zitadel/internal/eventstore/handler"
"github.com/caos/zitadel/internal/eventstore/handler/crdb"
"github.com/caos/zitadel/internal/repository/iam"
"github.com/caos/zitadel/internal/repository/instance"
"github.com/caos/zitadel/internal/repository/org"
"github.com/caos/zitadel/internal/repository/policy"
)
@@ -82,14 +82,14 @@ func (p *PasswordComplexityProjection) reducers() []handler.AggregateReducer {
},
},
{
Aggregate: iam.AggregateType,
Aggregate: instance.AggregateType,
EventRedusers: []handler.EventReducer{
{
Event: iam.PasswordComplexityPolicyAddedEventType,
Event: instance.PasswordComplexityPolicyAddedEventType,
Reduce: p.reduceAdded,
},
{
Event: iam.PasswordComplexityPolicyChangedEventType,
Event: instance.PasswordComplexityPolicyChangedEventType,
Reduce: p.reduceChanged,
},
},
@@ -104,11 +104,11 @@ func (p *PasswordComplexityProjection) reduceAdded(event eventstore.Event) (*han
case *org.PasswordComplexityPolicyAddedEvent:
policyEvent = e.PasswordComplexityPolicyAddedEvent
isDefault = false
case *iam.PasswordComplexityPolicyAddedEvent:
case *instance.PasswordComplexityPolicyAddedEvent:
policyEvent = e.PasswordComplexityPolicyAddedEvent
isDefault = true
default:
return nil, errors.ThrowInvalidArgumentf(nil, "PROJE-KTHmJ", "reduce.wrong.event.type %v", []eventstore.EventType{org.PasswordComplexityPolicyAddedEventType, iam.PasswordComplexityPolicyAddedEventType})
return nil, errors.ThrowInvalidArgumentf(nil, "PROJE-KTHmJ", "reduce.wrong.event.type %v", []eventstore.EventType{org.PasswordComplexityPolicyAddedEventType, instance.PasswordComplexityPolicyAddedEventType})
}
return crdb.NewCreateStatement(
&policyEvent,
@@ -134,10 +134,10 @@ func (p *PasswordComplexityProjection) reduceChanged(event eventstore.Event) (*h
switch e := event.(type) {
case *org.PasswordComplexityPolicyChangedEvent:
policyEvent = e.PasswordComplexityPolicyChangedEvent
case *iam.PasswordComplexityPolicyChangedEvent:
case *instance.PasswordComplexityPolicyChangedEvent:
policyEvent = e.PasswordComplexityPolicyChangedEvent
default:
return nil, errors.ThrowInvalidArgumentf(nil, "PROJE-cf3Xb", "reduce.wrong.event.type %v", []eventstore.EventType{org.PasswordComplexityPolicyChangedEventType, iam.PasswordComplexityPolicyChangedEventType})
return nil, errors.ThrowInvalidArgumentf(nil, "PROJE-cf3Xb", "reduce.wrong.event.type %v", []eventstore.EventType{org.PasswordComplexityPolicyChangedEventType, instance.PasswordComplexityPolicyChangedEventType})
}
cols := []handler.Column{
handler.NewCol(ComplexityPolicyChangeDateCol, policyEvent.CreationDate()),