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