mirror of
https://github.com/zitadel/zitadel.git
synced 2025-08-12 00:57:33 +00:00
fixup! fixup! fixup! added first event
This commit is contained in:
@@ -22,10 +22,12 @@ CREATE TABLE zitadel.identity_providers (
|
||||
, state zitadel.idp_state NOT NULL DEFAULT 'active'
|
||||
, name TEXT NOT NULL CHECK (name <> '')
|
||||
, type zitadel.idp_type -- NOT NULL
|
||||
, auto_register BOOLEAN NOT NULL DEFAULT TRUE
|
||||
, allow_creation BOOLEAN NOT NULL DEFAULT TRUE
|
||||
, allow_auto_creation BOOLEAN NOT NULL DEFAULT TRUE
|
||||
, allow_auto_update BOOLEAN NOT NULL DEFAULT TRUE
|
||||
, allow_linking BOOLEAN NOT NULL DEFAULT TRUE
|
||||
, allow_auto_linking BOOLEAN NOT NULL DEFAULT TRUE
|
||||
, styling_type SMALLINT
|
||||
, payload JSONB
|
||||
|
||||
|
@@ -56,7 +56,7 @@ func TestServer_TestIDProviderReduces(t *testing.T) {
|
||||
assert.Equal(t, name, idp.Name)
|
||||
assert.Equal(t, instanceID, idp.InstanceID)
|
||||
assert.Equal(t, domain.IDPStateActive.String(), idp.State)
|
||||
assert.Equal(t, true, idp.AllowAutoCreation)
|
||||
assert.Equal(t, true, idp.AutoRegister)
|
||||
assert.Equal(t, int16(idp_grpc.IDPStylingType_STYLING_TYPE_GOOGLE), idp.StylingType)
|
||||
assert.WithinRange(t, idp.UpdatedAt, beforeCreate, afterCreate)
|
||||
assert.WithinRange(t, idp.CreatedAt, beforeCreate, afterCreate)
|
||||
@@ -93,7 +93,7 @@ func TestServer_TestIDProviderReduces(t *testing.T) {
|
||||
|
||||
idpRepo := repository.IDProviderRepository(pool)
|
||||
|
||||
retryDuration, tick := integration.WaitForAndTickWithMaxDuration(CTX, time.Minute)
|
||||
retryDuration, tick := integration.WaitForAndTickWithMaxDuration(CTX, time.Second*5)
|
||||
assert.EventuallyWithT(t, func(t *assert.CollectT) {
|
||||
idp, err := idpRepo.Get(CTX,
|
||||
idpRepo.NameCondition(name),
|
||||
@@ -105,7 +105,7 @@ func TestServer_TestIDProviderReduces(t *testing.T) {
|
||||
// event iam.idp.config.changed
|
||||
assert.Equal(t, addOIDC.IdpId, idp.ID)
|
||||
assert.Equal(t, name, idp.Name)
|
||||
assert.Equal(t, false, idp.AllowAutoCreation)
|
||||
assert.Equal(t, false, idp.AutoRegister)
|
||||
assert.Equal(t, int16(idp_grpc.IDPStylingType_STYLING_TYPE_UNSPECIFIED), idp.StylingType)
|
||||
assert.WithinRange(t, idp.UpdatedAt, beforeCreate, afterCreate)
|
||||
}, retryDuration, tick)
|
||||
|
@@ -191,6 +191,10 @@ func (idProvider) TypeColumn() database.Column {
|
||||
return database.NewColumn("type")
|
||||
}
|
||||
|
||||
func (idProvider) AutoRegisterColumn() database.Column {
|
||||
return database.NewColumn("auto_register")
|
||||
}
|
||||
|
||||
func (idProvider) AllowCreationColumn() database.Column {
|
||||
return database.NewColumn("allow_creation")
|
||||
}
|
||||
@@ -207,6 +211,10 @@ func (idProvider) AllowLinkingColumn() database.Column {
|
||||
return database.NewColumn("allow_linking")
|
||||
}
|
||||
|
||||
func (idProvider) AllowAutoLinkingColumn() database.Column {
|
||||
return database.NewColumn("allow_auto_linking")
|
||||
}
|
||||
|
||||
func (idProvider) StylingTypeColumn() database.Column {
|
||||
return database.NewColumn("styling_type")
|
||||
}
|
||||
@@ -254,6 +262,10 @@ func (i idProvider) TypeCondition(typee domain.IDPType) database.Condition {
|
||||
return database.NewTextCondition(i.TypeColumn(), database.TextOperationEqual, typee.String())
|
||||
}
|
||||
|
||||
func (i idProvider) AutoRegisterCondition(allow bool) database.Condition {
|
||||
return database.NewBooleanCondition(i.AutoRegisterColumn(), allow)
|
||||
}
|
||||
|
||||
func (i idProvider) AllowCreationCondition(allow bool) database.Condition {
|
||||
return database.NewBooleanCondition(i.AllowCreationColumn(), allow)
|
||||
}
|
||||
@@ -270,6 +282,10 @@ func (i idProvider) AllowLinkingCondition(allow bool) database.Condition {
|
||||
return database.NewBooleanCondition(i.AllowLinkingColumn(), allow)
|
||||
}
|
||||
|
||||
func (i idProvider) AllowAutoLinkingCondition(allow bool) database.Condition {
|
||||
return database.NewBooleanCondition(i.AllowAutoLinkingColumn(), allow)
|
||||
}
|
||||
|
||||
func (i idProvider) StylingTypeCondition(style int16) database.Condition {
|
||||
return database.NewNumberCondition(i.StylingTypeColumn(), database.NumberOperationEqual, style)
|
||||
}
|
||||
@@ -294,6 +310,10 @@ func (i idProvider) SetAllowCreation(allow bool) database.Change {
|
||||
return database.NewChange(i.AllowCreationColumn(), allow)
|
||||
}
|
||||
|
||||
func (i idProvider) SetAutoRegister(allow bool) database.Change {
|
||||
return database.NewChange(i.AutoRegisterColumn(), allow)
|
||||
}
|
||||
|
||||
func (i idProvider) SetAllowAutoCreation(allow bool) database.Change {
|
||||
return database.NewChange(i.AllowAutoCreationColumn(), allow)
|
||||
}
|
||||
@@ -306,6 +326,10 @@ func (i idProvider) SetAllowLinking(allow bool) database.Change {
|
||||
return database.NewChange(i.AllowLinkingColumn(), allow)
|
||||
}
|
||||
|
||||
func (i idProvider) SetAutoAllowLinking(allow bool) database.Change {
|
||||
return database.NewChange(i.AllowAutoLinkingColumn(), allow)
|
||||
}
|
||||
|
||||
func (i idProvider) SetStylingType(stylingType int16) database.Change {
|
||||
return database.NewChange(i.StylingTypeColumn(), stylingType)
|
||||
}
|
||||
|
Reference in New Issue
Block a user