mirror of
https://github.com/zitadel/zitadel.git
synced 2025-08-12 04:57:33 +00:00
fix(query): realtime data on defined requests (#3726)
* feat: directly specify factors on addCustomLoginPolicy and return on LoginPolicy responses * fix proto * update login policy * feat: directly specify idp on addCustomLoginPolicy and return on LoginPolicy responses * fix: tests * fix(projection): trigger bulk * refactor: clean projection pkg * instance should bulk * fix(query): should trigger bulk on id calls * tests * build prerelease * fix: add shouldTriggerBulk * fix: test Co-authored-by: Livio Amstutz <livio.a@gmail.com> Co-authored-by: Max Peintner <max@caos.ch>
This commit is contained in:
@@ -29,12 +29,12 @@ const (
|
||||
PrivacyPolicyHelpLinkCol = "help_link"
|
||||
)
|
||||
|
||||
type PrivacyPolicyProjection struct {
|
||||
type privacyPolicyProjection struct {
|
||||
crdb.StatementHandler
|
||||
}
|
||||
|
||||
func NewPrivacyPolicyProjection(ctx context.Context, config crdb.StatementHandlerConfig) *PrivacyPolicyProjection {
|
||||
p := new(PrivacyPolicyProjection)
|
||||
func newPrivacyPolicyProjection(ctx context.Context, config crdb.StatementHandlerConfig) *privacyPolicyProjection {
|
||||
p := new(privacyPolicyProjection)
|
||||
config.ProjectionName = PrivacyPolicyTable
|
||||
config.Reducers = p.reducers()
|
||||
config.InitCheck = crdb.NewTableCheck(
|
||||
@@ -58,7 +58,7 @@ func NewPrivacyPolicyProjection(ctx context.Context, config crdb.StatementHandle
|
||||
return p
|
||||
}
|
||||
|
||||
func (p *PrivacyPolicyProjection) reducers() []handler.AggregateReducer {
|
||||
func (p *privacyPolicyProjection) reducers() []handler.AggregateReducer {
|
||||
return []handler.AggregateReducer{
|
||||
{
|
||||
Aggregate: org.AggregateType,
|
||||
@@ -93,7 +93,7 @@ func (p *PrivacyPolicyProjection) reducers() []handler.AggregateReducer {
|
||||
}
|
||||
}
|
||||
|
||||
func (p *PrivacyPolicyProjection) reduceAdded(event eventstore.Event) (*handler.Statement, error) {
|
||||
func (p *privacyPolicyProjection) reduceAdded(event eventstore.Event) (*handler.Statement, error) {
|
||||
var policyEvent policy.PrivacyPolicyAddedEvent
|
||||
var isDefault bool
|
||||
switch e := event.(type) {
|
||||
@@ -123,7 +123,7 @@ func (p *PrivacyPolicyProjection) reduceAdded(event eventstore.Event) (*handler.
|
||||
}), nil
|
||||
}
|
||||
|
||||
func (p *PrivacyPolicyProjection) reduceChanged(event eventstore.Event) (*handler.Statement, error) {
|
||||
func (p *privacyPolicyProjection) reduceChanged(event eventstore.Event) (*handler.Statement, error) {
|
||||
var policyEvent policy.PrivacyPolicyChangedEvent
|
||||
switch e := event.(type) {
|
||||
case *org.PrivacyPolicyChangedEvent:
|
||||
@@ -154,7 +154,7 @@ func (p *PrivacyPolicyProjection) reduceChanged(event eventstore.Event) (*handle
|
||||
}), nil
|
||||
}
|
||||
|
||||
func (p *PrivacyPolicyProjection) reduceRemoved(event eventstore.Event) (*handler.Statement, error) {
|
||||
func (p *privacyPolicyProjection) reduceRemoved(event eventstore.Event) (*handler.Statement, error) {
|
||||
policyEvent, ok := event.(*org.PrivacyPolicyRemovedEvent)
|
||||
if !ok {
|
||||
return nil, errors.ThrowInvalidArgumentf(nil, "PROJE-FvtGO", "reduce.wrong.event.type %s", org.PrivacyPolicyRemovedEventType)
|
||||
|
Reference in New Issue
Block a user