mirror of
https://github.com/zitadel/zitadel.git
synced 2025-08-11 21:17:32 +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 (
|
||||
AuthNKeyEnabledCol = "enabled"
|
||||
)
|
||||
|
||||
type AuthNKeyProjection struct {
|
||||
type authNKeyProjection struct {
|
||||
crdb.StatementHandler
|
||||
}
|
||||
|
||||
func NewAuthNKeyProjection(ctx context.Context, config crdb.StatementHandlerConfig) *AuthNKeyProjection {
|
||||
p := new(AuthNKeyProjection)
|
||||
func newAuthNKeyProjection(ctx context.Context, config crdb.StatementHandlerConfig) *authNKeyProjection {
|
||||
p := new(authNKeyProjection)
|
||||
config.ProjectionName = AuthNKeyTable
|
||||
config.Reducers = p.reducers()
|
||||
config.InitCheck = crdb.NewTableCheck(
|
||||
@@ -61,7 +61,7 @@ func NewAuthNKeyProjection(ctx context.Context, config crdb.StatementHandlerConf
|
||||
return p
|
||||
}
|
||||
|
||||
func (p *AuthNKeyProjection) reducers() []handler.AggregateReducer {
|
||||
func (p *authNKeyProjection) reducers() []handler.AggregateReducer {
|
||||
return []handler.AggregateReducer{
|
||||
{
|
||||
Aggregate: project.AggregateType,
|
||||
@@ -112,7 +112,7 @@ func (p *AuthNKeyProjection) reducers() []handler.AggregateReducer {
|
||||
}
|
||||
}
|
||||
|
||||
func (p *AuthNKeyProjection) reduceAuthNKeyAdded(event eventstore.Event) (*handler.Statement, error) {
|
||||
func (p *authNKeyProjection) reduceAuthNKeyAdded(event eventstore.Event) (*handler.Statement, error) {
|
||||
var authNKeyEvent struct {
|
||||
eventstore.BaseEvent
|
||||
keyID string
|
||||
@@ -162,7 +162,7 @@ func (p *AuthNKeyProjection) reduceAuthNKeyAdded(event eventstore.Event) (*handl
|
||||
), nil
|
||||
}
|
||||
|
||||
func (p *AuthNKeyProjection) reduceAuthNKeyEnabledChanged(event eventstore.Event) (*handler.Statement, error) {
|
||||
func (p *authNKeyProjection) reduceAuthNKeyEnabledChanged(event eventstore.Event) (*handler.Statement, error) {
|
||||
var appID string
|
||||
var enabled bool
|
||||
switch e := event.(type) {
|
||||
@@ -188,7 +188,7 @@ func (p *AuthNKeyProjection) reduceAuthNKeyEnabledChanged(event eventstore.Event
|
||||
), nil
|
||||
}
|
||||
|
||||
func (p *AuthNKeyProjection) reduceAuthNKeyRemoved(event eventstore.Event) (*handler.Statement, error) {
|
||||
func (p *authNKeyProjection) reduceAuthNKeyRemoved(event eventstore.Event) (*handler.Statement, error) {
|
||||
var condition handler.Condition
|
||||
switch e := event.(type) {
|
||||
case *project.ApplicationKeyRemovedEvent:
|
||||
|
Reference in New Issue
Block a user