mirror of
https://github.com/zitadel/zitadel.git
synced 2025-12-03 08:02:15 +00:00
fix: list IDPs on Org (#3141)
* fix: idp query * fix: remove failed events
This commit is contained in:
@@ -91,15 +91,11 @@ func listIDPsToModel(ctx context.Context, req *mgmt_pb.ListOrgIDPsRequest) (quer
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
iamQuery, err := query.NewIDPIDSearchQuery(domain.IAMID)
|
resourceOwnerQuery, err := query.NewIDPResourceOwnerListSearchQuery(domain.IAMID, authz.GetCtxData(ctx).OrgID)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
resourceOwnerQuery, err := query.NewIDPResourceOwnerSearchQuery(authz.GetCtxData(ctx).OrgID)
|
q = append(q, resourceOwnerQuery)
|
||||||
if err != nil {
|
|
||||||
return nil, err
|
|
||||||
}
|
|
||||||
q = append(q, resourceOwnerQuery, iamQuery)
|
|
||||||
return &query.IDPSearchQueries{
|
return &query.IDPSearchQueries{
|
||||||
SearchRequest: query.SearchRequest{
|
SearchRequest: query.SearchRequest{
|
||||||
Offset: offset,
|
Offset: offset,
|
||||||
|
|||||||
@@ -76,7 +76,9 @@ func (q *Queries) RemoveFailedEvent(ctx context.Context, projectionName string,
|
|||||||
Where(sq.Eq{
|
Where(sq.Eq{
|
||||||
failedEventsColumnProjectionName: projectionName,
|
failedEventsColumnProjectionName: projectionName,
|
||||||
failedEventsColumnFailedSequence: sequence,
|
failedEventsColumnFailedSequence: sequence,
|
||||||
}).ToSql()
|
}).
|
||||||
|
PlaceholderFormat(sq.Dollar).
|
||||||
|
ToSql()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return errors.ThrowInternal(err, "QUERY-DGgh3", "Errors.RemoveFailed")
|
return errors.ThrowInternal(err, "QUERY-DGgh3", "Errors.RemoveFailed")
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -7,11 +7,12 @@ import (
|
|||||||
"time"
|
"time"
|
||||||
|
|
||||||
sq "github.com/Masterminds/squirrel"
|
sq "github.com/Masterminds/squirrel"
|
||||||
|
"github.com/lib/pq"
|
||||||
|
|
||||||
"github.com/caos/zitadel/internal/crypto"
|
"github.com/caos/zitadel/internal/crypto"
|
||||||
"github.com/caos/zitadel/internal/domain"
|
"github.com/caos/zitadel/internal/domain"
|
||||||
"github.com/caos/zitadel/internal/errors"
|
"github.com/caos/zitadel/internal/errors"
|
||||||
"github.com/caos/zitadel/internal/query/projection"
|
"github.com/caos/zitadel/internal/query/projection"
|
||||||
"github.com/lib/pq"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
type IDP struct {
|
type IDP struct {
|
||||||
@@ -239,6 +240,14 @@ func NewIDPResourceOwnerSearchQuery(value string) (SearchQuery, error) {
|
|||||||
return NewTextQuery(IDPResourceOwnerCol, value, TextEquals)
|
return NewTextQuery(IDPResourceOwnerCol, value, TextEquals)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func NewIDPResourceOwnerListSearchQuery(ids ...string) (SearchQuery, error) {
|
||||||
|
list := make([]interface{}, len(ids))
|
||||||
|
for i, value := range ids {
|
||||||
|
list[i] = value
|
||||||
|
}
|
||||||
|
return NewListQuery(IDPResourceOwnerCol, list, ListIn)
|
||||||
|
}
|
||||||
|
|
||||||
func (q *IDPSearchQueries) toQuery(query sq.SelectBuilder) sq.SelectBuilder {
|
func (q *IDPSearchQueries) toQuery(query sq.SelectBuilder) sq.SelectBuilder {
|
||||||
query = q.SearchRequest.toQuery(query)
|
query = q.SearchRequest.toQuery(query)
|
||||||
for _, q := range q.Queries {
|
for _, q := range q.Queries {
|
||||||
|
|||||||
Reference in New Issue
Block a user