mirror of
https://github.com/zitadel/zitadel.git
synced 2025-08-11 20:57:31 +00:00
perf: remove owner removed columns from projections for oidc (#6925)
* fix: remove owner removed columns from login names projection * fix: remove owner removed columns from flow projection * fix: remove owner removed columns from project, projectgrant and member projections * fix: correct unit tests for session projection * fix: correct unit tests for session projection
This commit is contained in:
@@ -52,10 +52,6 @@ var (
|
||||
name: projection.FlowActionIDCol,
|
||||
table: flowsTriggersTable,
|
||||
}
|
||||
FlowsTriggersOwnerRemovedCol = Column{
|
||||
name: projection.FlowOwnerRemovedCol,
|
||||
table: flowsTriggersTable,
|
||||
}
|
||||
)
|
||||
|
||||
type Flow struct {
|
||||
@@ -67,7 +63,7 @@ type Flow struct {
|
||||
TriggerActions map[domain.TriggerType][]*Action
|
||||
}
|
||||
|
||||
func (q *Queries) GetFlow(ctx context.Context, flowType domain.FlowType, orgID string, withOwnerRemoved bool) (flow *Flow, err error) {
|
||||
func (q *Queries) GetFlow(ctx context.Context, flowType domain.FlowType, orgID string) (flow *Flow, err error) {
|
||||
ctx, span := tracing.NewSpan(ctx)
|
||||
defer func() { span.EndWithError(err) }()
|
||||
|
||||
@@ -77,9 +73,6 @@ func (q *Queries) GetFlow(ctx context.Context, flowType domain.FlowType, orgID s
|
||||
FlowsTriggersColumnResourceOwner.identifier(): orgID,
|
||||
FlowsTriggersColumnInstanceID.identifier(): authz.GetInstance(ctx).InstanceID(),
|
||||
}
|
||||
if !withOwnerRemoved {
|
||||
eq[FlowsTriggersOwnerRemovedCol.identifier()] = false
|
||||
}
|
||||
stmt, args, err := query.Where(eq).ToSql()
|
||||
if err != nil {
|
||||
return nil, errors.ThrowInvalidArgument(err, "QUERY-HBRh3", "Errors.Query.InvalidRequest")
|
||||
@@ -92,7 +85,7 @@ func (q *Queries) GetFlow(ctx context.Context, flowType domain.FlowType, orgID s
|
||||
return flow, err
|
||||
}
|
||||
|
||||
func (q *Queries) GetActiveActionsByFlowAndTriggerType(ctx context.Context, flowType domain.FlowType, triggerType domain.TriggerType, orgID string, withOwnerRemoved bool) (actions []*Action, err error) {
|
||||
func (q *Queries) GetActiveActionsByFlowAndTriggerType(ctx context.Context, flowType domain.FlowType, triggerType domain.TriggerType, orgID string) (actions []*Action, err error) {
|
||||
ctx, span := tracing.NewSpan(ctx)
|
||||
defer func() { span.EndWithError(err) }()
|
||||
|
||||
@@ -104,9 +97,6 @@ func (q *Queries) GetActiveActionsByFlowAndTriggerType(ctx context.Context, flow
|
||||
FlowsTriggersColumnInstanceID.identifier(): authz.GetInstance(ctx).InstanceID(),
|
||||
ActionColumnState.identifier(): domain.ActionStateActive,
|
||||
}
|
||||
if !withOwnerRemoved {
|
||||
eq[FlowsTriggersOwnerRemovedCol.identifier()] = false
|
||||
}
|
||||
query, args, err := stmt.Where(eq).ToSql()
|
||||
if err != nil {
|
||||
return nil, errors.ThrowInternal(err, "QUERY-Dgff3", "Errors.Query.SQLStatement")
|
||||
@@ -119,7 +109,7 @@ func (q *Queries) GetActiveActionsByFlowAndTriggerType(ctx context.Context, flow
|
||||
return actions, err
|
||||
}
|
||||
|
||||
func (q *Queries) GetFlowTypesOfActionID(ctx context.Context, actionID string, withOwnerRemoved bool) (types []domain.FlowType, err error) {
|
||||
func (q *Queries) GetFlowTypesOfActionID(ctx context.Context, actionID string) (types []domain.FlowType, err error) {
|
||||
ctx, span := tracing.NewSpan(ctx)
|
||||
defer func() { span.EndWithError(err) }()
|
||||
|
||||
@@ -128,9 +118,6 @@ func (q *Queries) GetFlowTypesOfActionID(ctx context.Context, actionID string, w
|
||||
FlowsTriggersColumnActionID.identifier(): actionID,
|
||||
FlowsTriggersColumnInstanceID.identifier(): authz.GetInstance(ctx).InstanceID(),
|
||||
}
|
||||
if !withOwnerRemoved {
|
||||
eq[FlowsTriggersOwnerRemovedCol.identifier()] = false
|
||||
}
|
||||
query, args, err := stmt.Where(eq).ToSql()
|
||||
if err != nil {
|
||||
return nil, errors.ThrowInvalidArgument(err, "QUERY-Dh311", "Errors.Query.InvalidRequest")
|
||||
|
Reference in New Issue
Block a user