mirror of
https://github.com/zitadel/zitadel.git
synced 2025-08-12 07:57: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:
@@ -31,7 +31,7 @@ func TestAuthNKeyProjection_reduces(t *testing.T) {
|
||||
[]byte(`{"applicationId": "appId", "clientId":"clientId","keyId": "keyId", "type": 1, "expirationDate": "2021-11-30T15:00:00Z", "publicKey": "cHVibGljS2V5"}`),
|
||||
), project.ApplicationKeyAddedEventMapper),
|
||||
},
|
||||
reduce: (&AuthNKeyProjection{}).reduceAuthNKeyAdded,
|
||||
reduce: (&authNKeyProjection{}).reduceAuthNKeyAdded,
|
||||
want: wantReduce{
|
||||
projection: AuthNKeyTable,
|
||||
aggregateType: eventstore.AggregateType("project"),
|
||||
@@ -68,7 +68,7 @@ func TestAuthNKeyProjection_reduces(t *testing.T) {
|
||||
[]byte(`{"keyId": "keyId", "type": 1, "expirationDate": "2021-11-30T15:00:00Z", "publicKey": "cHVibGljS2V5"}`),
|
||||
), user.MachineKeyAddedEventMapper),
|
||||
},
|
||||
reduce: (&AuthNKeyProjection{}).reduceAuthNKeyAdded,
|
||||
reduce: (&authNKeyProjection{}).reduceAuthNKeyAdded,
|
||||
want: wantReduce{
|
||||
projection: AuthNKeyTable,
|
||||
aggregateType: eventstore.AggregateType("user"),
|
||||
@@ -105,7 +105,7 @@ func TestAuthNKeyProjection_reduces(t *testing.T) {
|
||||
[]byte(`{"keyId": "keyId"}`),
|
||||
), project.ApplicationKeyRemovedEventMapper),
|
||||
},
|
||||
reduce: (&AuthNKeyProjection{}).reduceAuthNKeyRemoved,
|
||||
reduce: (&authNKeyProjection{}).reduceAuthNKeyRemoved,
|
||||
want: wantReduce{
|
||||
projection: AuthNKeyTable,
|
||||
aggregateType: eventstore.AggregateType("project"),
|
||||
@@ -132,7 +132,7 @@ func TestAuthNKeyProjection_reduces(t *testing.T) {
|
||||
[]byte(`{"appId": "appId"}`),
|
||||
), project.APIConfigChangedEventMapper),
|
||||
},
|
||||
reduce: (&AuthNKeyProjection{}).reduceAuthNKeyEnabledChanged,
|
||||
reduce: (&authNKeyProjection{}).reduceAuthNKeyEnabledChanged,
|
||||
want: wantReduce{
|
||||
projection: AuthNKeyTable,
|
||||
aggregateType: eventstore.AggregateType("project"),
|
||||
@@ -152,7 +152,7 @@ func TestAuthNKeyProjection_reduces(t *testing.T) {
|
||||
[]byte(`{"appId": "appId", "authMethodType": 0}`),
|
||||
), project.APIConfigChangedEventMapper),
|
||||
},
|
||||
reduce: (&AuthNKeyProjection{}).reduceAuthNKeyEnabledChanged,
|
||||
reduce: (&authNKeyProjection{}).reduceAuthNKeyEnabledChanged,
|
||||
want: wantReduce{
|
||||
projection: AuthNKeyTable,
|
||||
aggregateType: eventstore.AggregateType("project"),
|
||||
@@ -180,7 +180,7 @@ func TestAuthNKeyProjection_reduces(t *testing.T) {
|
||||
[]byte(`{"appId": "appId", "authMethodType": 1}`),
|
||||
), project.APIConfigChangedEventMapper),
|
||||
},
|
||||
reduce: (&AuthNKeyProjection{}).reduceAuthNKeyEnabledChanged,
|
||||
reduce: (&authNKeyProjection{}).reduceAuthNKeyEnabledChanged,
|
||||
want: wantReduce{
|
||||
projection: AuthNKeyTable,
|
||||
aggregateType: eventstore.AggregateType("project"),
|
||||
@@ -208,7 +208,7 @@ func TestAuthNKeyProjection_reduces(t *testing.T) {
|
||||
[]byte(`{"keyId": "keyId"}`),
|
||||
), user.MachineKeyRemovedEventMapper),
|
||||
},
|
||||
reduce: (&AuthNKeyProjection{}).reduceAuthNKeyRemoved,
|
||||
reduce: (&authNKeyProjection{}).reduceAuthNKeyRemoved,
|
||||
want: wantReduce{
|
||||
projection: AuthNKeyTable,
|
||||
aggregateType: eventstore.AggregateType("user"),
|
||||
@@ -235,7 +235,7 @@ func TestAuthNKeyProjection_reduces(t *testing.T) {
|
||||
[]byte(`{"appId": "appId"}`),
|
||||
), project.OIDCConfigChangedEventMapper),
|
||||
},
|
||||
reduce: (&AuthNKeyProjection{}).reduceAuthNKeyEnabledChanged,
|
||||
reduce: (&authNKeyProjection{}).reduceAuthNKeyEnabledChanged,
|
||||
want: wantReduce{
|
||||
projection: AuthNKeyTable,
|
||||
aggregateType: eventstore.AggregateType("project"),
|
||||
@@ -255,7 +255,7 @@ func TestAuthNKeyProjection_reduces(t *testing.T) {
|
||||
[]byte(`{"appId": "appId", "authMethodType": 0}`),
|
||||
), project.OIDCConfigChangedEventMapper),
|
||||
},
|
||||
reduce: (&AuthNKeyProjection{}).reduceAuthNKeyEnabledChanged,
|
||||
reduce: (&authNKeyProjection{}).reduceAuthNKeyEnabledChanged,
|
||||
want: wantReduce{
|
||||
projection: AuthNKeyTable,
|
||||
aggregateType: eventstore.AggregateType("project"),
|
||||
@@ -283,7 +283,7 @@ func TestAuthNKeyProjection_reduces(t *testing.T) {
|
||||
[]byte(`{"appId": "appId", "authMethodType": 3}`),
|
||||
), project.OIDCConfigChangedEventMapper),
|
||||
},
|
||||
reduce: (&AuthNKeyProjection{}).reduceAuthNKeyEnabledChanged,
|
||||
reduce: (&authNKeyProjection{}).reduceAuthNKeyEnabledChanged,
|
||||
want: wantReduce{
|
||||
projection: AuthNKeyTable,
|
||||
aggregateType: eventstore.AggregateType("project"),
|
||||
@@ -311,7 +311,7 @@ func TestAuthNKeyProjection_reduces(t *testing.T) {
|
||||
[]byte(`{"keyId": "keyId"}`),
|
||||
), project.ApplicationKeyRemovedEventMapper),
|
||||
},
|
||||
reduce: (&AuthNKeyProjection{}).reduceAuthNKeyRemoved,
|
||||
reduce: (&authNKeyProjection{}).reduceAuthNKeyRemoved,
|
||||
want: wantReduce{
|
||||
projection: AuthNKeyTable,
|
||||
aggregateType: eventstore.AggregateType("project"),
|
||||
@@ -338,7 +338,7 @@ func TestAuthNKeyProjection_reduces(t *testing.T) {
|
||||
[]byte(`{"appId": "appId"}`),
|
||||
), project.ApplicationRemovedEventMapper),
|
||||
},
|
||||
reduce: (&AuthNKeyProjection{}).reduceAuthNKeyRemoved,
|
||||
reduce: (&authNKeyProjection{}).reduceAuthNKeyRemoved,
|
||||
want: wantReduce{
|
||||
projection: AuthNKeyTable,
|
||||
aggregateType: eventstore.AggregateType("project"),
|
||||
@@ -365,7 +365,7 @@ func TestAuthNKeyProjection_reduces(t *testing.T) {
|
||||
nil,
|
||||
), project.ProjectRemovedEventMapper),
|
||||
},
|
||||
reduce: (&AuthNKeyProjection{}).reduceAuthNKeyRemoved,
|
||||
reduce: (&authNKeyProjection{}).reduceAuthNKeyRemoved,
|
||||
want: wantReduce{
|
||||
projection: AuthNKeyTable,
|
||||
aggregateType: eventstore.AggregateType("project"),
|
||||
@@ -392,7 +392,7 @@ func TestAuthNKeyProjection_reduces(t *testing.T) {
|
||||
[]byte(`{"keyId": "keyId"}`),
|
||||
), user.MachineKeyRemovedEventMapper),
|
||||
},
|
||||
reduce: (&AuthNKeyProjection{}).reduceAuthNKeyRemoved,
|
||||
reduce: (&authNKeyProjection{}).reduceAuthNKeyRemoved,
|
||||
want: wantReduce{
|
||||
projection: AuthNKeyTable,
|
||||
aggregateType: eventstore.AggregateType("user"),
|
||||
@@ -419,7 +419,7 @@ func TestAuthNKeyProjection_reduces(t *testing.T) {
|
||||
[]byte(`{"keyId": "keyId"}`),
|
||||
), user.UserRemovedEventMapper),
|
||||
},
|
||||
reduce: (&AuthNKeyProjection{}).reduceAuthNKeyRemoved,
|
||||
reduce: (&authNKeyProjection{}).reduceAuthNKeyRemoved,
|
||||
want: wantReduce{
|
||||
projection: AuthNKeyTable,
|
||||
aggregateType: eventstore.AggregateType("user"),
|
||||
|
Reference in New Issue
Block a user