mirror of
https://github.com/zitadel/zitadel.git
synced 2025-08-12 01:47:33 +00:00
feat(queries): user IDP links (#2751)
This commit is contained in:
@@ -134,6 +134,7 @@ const (
|
||||
IDPStylingTypeCol = "styling_type"
|
||||
IDPOwnerTypeCol = "owner_type"
|
||||
IDPAutoRegisterCol = "auto_register"
|
||||
IDPTypeCol = "type"
|
||||
|
||||
OIDCConfigIDPIDCol = "idp_id"
|
||||
OIDCConfigClientIDCol = "client_id"
|
||||
@@ -311,6 +312,7 @@ func (p *IDPProjection) reduceOIDCConfigAdded(event eventstore.EventReader) (*ha
|
||||
[]handler.Column{
|
||||
handler.NewCol(IDPChangeDateCol, idpEvent.CreationDate()),
|
||||
handler.NewCol(IDPSequenceCol, idpEvent.Sequence()),
|
||||
handler.NewCol(IDPTypeCol, domain.IDPConfigTypeOIDC),
|
||||
},
|
||||
[]handler.Condition{
|
||||
handler.NewCond(IDPIDCol, idpEvent.IDPConfigID),
|
||||
@@ -413,6 +415,7 @@ func (p *IDPProjection) reduceJWTConfigAdded(event eventstore.EventReader) (*han
|
||||
[]handler.Column{
|
||||
handler.NewCol(IDPChangeDateCol, idpEvent.CreationDate()),
|
||||
handler.NewCol(IDPSequenceCol, idpEvent.Sequence()),
|
||||
handler.NewCol(IDPTypeCol, domain.IDPConfigTypeJWT),
|
||||
},
|
||||
[]handler.Condition{
|
||||
handler.NewCond(IDPIDCol, idpEvent.IDPConfigID),
|
||||
|
@@ -227,10 +227,11 @@ func TestIDPProjection_reduces(t *testing.T) {
|
||||
executer: &testExecuter{
|
||||
executions: []execution{
|
||||
{
|
||||
expectedStmt: "UPDATE zitadel.projections.idps SET (change_date, sequence) = ($1, $2) WHERE (id = $3)",
|
||||
expectedStmt: "UPDATE zitadel.projections.idps SET (change_date, sequence, type) = ($1, $2, $3) WHERE (id = $4)",
|
||||
expectedArgs: []interface{}{
|
||||
anyArg{},
|
||||
uint64(15),
|
||||
domain.IDPConfigTypeOIDC,
|
||||
"idp-config-id",
|
||||
},
|
||||
},
|
||||
@@ -353,10 +354,11 @@ func TestIDPProjection_reduces(t *testing.T) {
|
||||
executer: &testExecuter{
|
||||
executions: []execution{
|
||||
{
|
||||
expectedStmt: "UPDATE zitadel.projections.idps SET (change_date, sequence) = ($1, $2) WHERE (id = $3)",
|
||||
expectedStmt: "UPDATE zitadel.projections.idps SET (change_date, sequence, type) = ($1, $2, $3) WHERE (id = $4)",
|
||||
expectedArgs: []interface{}{
|
||||
anyArg{},
|
||||
uint64(15),
|
||||
domain.IDPConfigTypeJWT,
|
||||
"idp-config-id",
|
||||
},
|
||||
},
|
||||
@@ -643,10 +645,11 @@ func TestIDPProjection_reduces(t *testing.T) {
|
||||
executer: &testExecuter{
|
||||
executions: []execution{
|
||||
{
|
||||
expectedStmt: "UPDATE zitadel.projections.idps SET (change_date, sequence) = ($1, $2) WHERE (id = $3)",
|
||||
expectedStmt: "UPDATE zitadel.projections.idps SET (change_date, sequence, type) = ($1, $2, $3) WHERE (id = $4)",
|
||||
expectedArgs: []interface{}{
|
||||
anyArg{},
|
||||
uint64(15),
|
||||
domain.IDPConfigTypeOIDC,
|
||||
"idp-config-id",
|
||||
},
|
||||
},
|
||||
@@ -769,10 +772,11 @@ func TestIDPProjection_reduces(t *testing.T) {
|
||||
executer: &testExecuter{
|
||||
executions: []execution{
|
||||
{
|
||||
expectedStmt: "UPDATE zitadel.projections.idps SET (change_date, sequence) = ($1, $2) WHERE (id = $3)",
|
||||
expectedStmt: "UPDATE zitadel.projections.idps SET (change_date, sequence, type) = ($1, $2, $3) WHERE (id = $4)",
|
||||
expectedArgs: []interface{}{
|
||||
anyArg{},
|
||||
uint64(15),
|
||||
domain.IDPConfigTypeJWT,
|
||||
"idp-config-id",
|
||||
},
|
||||
},
|
||||
|
@@ -15,10 +15,6 @@ type IDPUserLinkProjection struct {
|
||||
crdb.StatementHandler
|
||||
}
|
||||
|
||||
const (
|
||||
IDPUserLinkTable = "zitadel.projections.idp_user_links"
|
||||
)
|
||||
|
||||
func NewIDPUserLinkProjection(ctx context.Context, config crdb.StatementHandlerConfig) *IDPUserLinkProjection {
|
||||
p := &IDPUserLinkProjection{}
|
||||
config.ProjectionName = IDPUserLinkTable
|
||||
@@ -50,6 +46,7 @@ func (p *IDPUserLinkProjection) reducers() []handler.AggregateReducer {
|
||||
}
|
||||
|
||||
const (
|
||||
IDPUserLinkTable = "zitadel.projections.idp_user_links"
|
||||
IDPUserLinkIDPIDCol = "idp_id"
|
||||
IDPUserLinkUserIDCol = "user_id"
|
||||
IDPUserLinkExternalUserIDCol = "external_user_id"
|
||||
|
Reference in New Issue
Block a user