mirror of
https://github.com/zitadel/zitadel.git
synced 2025-08-11 21:47:32 +00:00
feat(fields): add instance domain (#9000)
# Which Problems Are Solved Instance domains are only computed on read side. This can cause missing domains if calls are executed shortly after a instance domain (or instance) was added. # How the Problems Are Solved The instance domain is added to the fields table which is filled on command side. # Additional Changes - added setup step to compute instance domains - instance by host uses fields table instead of instance_domains table # Additional Context - part of https://github.com/zitadel/zitadel/issues/8999
This commit is contained in:
@@ -3,6 +3,7 @@ package projection
|
||||
import (
|
||||
"github.com/zitadel/zitadel/internal/eventstore"
|
||||
"github.com/zitadel/zitadel/internal/eventstore/handler/v2"
|
||||
"github.com/zitadel/zitadel/internal/repository/instance"
|
||||
"github.com/zitadel/zitadel/internal/repository/org"
|
||||
"github.com/zitadel/zitadel/internal/repository/project"
|
||||
)
|
||||
@@ -10,6 +11,7 @@ import (
|
||||
const (
|
||||
fieldsProjectGrant = "project_grant_fields"
|
||||
fieldsOrgDomainVerified = "org_domain_verified_fields"
|
||||
fieldsInstanceDomain = "instance_domain_fields"
|
||||
)
|
||||
|
||||
func newFillProjectGrantFields(config handler.Config) *handler.FieldHandler {
|
||||
@@ -36,3 +38,17 @@ func newFillOrgDomainVerifiedFields(config handler.Config) *handler.FieldHandler
|
||||
},
|
||||
)
|
||||
}
|
||||
|
||||
func newFillInstanceDomainFields(config handler.Config) *handler.FieldHandler {
|
||||
return handler.NewFieldHandler(
|
||||
&config,
|
||||
fieldsInstanceDomain,
|
||||
map[eventstore.AggregateType][]eventstore.EventType{
|
||||
instance.AggregateType: {
|
||||
instance.InstanceDomainAddedEventType,
|
||||
instance.InstanceDomainRemovedEventType,
|
||||
instance.InstanceRemovedEventType,
|
||||
},
|
||||
},
|
||||
)
|
||||
}
|
||||
|
Reference in New Issue
Block a user