fix: actions (#2547)

* fix: external login

* fix: query flow types correct

* fix: queries of action statements

Co-authored-by: fabi <fabienne.gerschwiler@gmail.com>
This commit is contained in:
Livio Amstutz 2021-10-21 14:30:09 +02:00 committed by GitHub
parent b204ad2aca
commit b0bcefd202
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 7 additions and 13 deletions

View File

@ -114,9 +114,7 @@ func (q *Queries) GetActionByID(ctx context.Context, id string, orgID string) (*
stmt, scan := prepareActionQuery()
query, args, err := stmt.Where(
sq.Eq{
ActionColumnID.identifier(): id,
},
sq.Eq{
ActionColumnID.identifier(): id,
ActionColumnResourceOwner.identifier(): orgID,
}).ToSql()
if err != nil {

View File

@ -54,9 +54,7 @@ func (q *Queries) GetFlow(ctx context.Context, flowType domain.FlowType, orgID s
query, scan := q.prepareFlowQuery()
stmt, args, err := query.Where(
sq.Eq{
FlowsTriggersColumnFlowType.identifier(): flowType,
},
sq.Eq{
FlowsTriggersColumnFlowType.identifier(): flowType,
FlowsTriggersColumnResourceOwner.identifier(): orgID,
}).ToSql()
if err != nil {
@ -74,14 +72,11 @@ func (q *Queries) GetActionsByFlowAndTriggerType(ctx context.Context, flowType d
stmt, scan := q.prepareTriggerActionsQuery()
query, args, err := stmt.Where(
sq.Eq{
FlowsTriggersColumnFlowType.identifier(): flowType,
},
sq.Eq{
FlowsTriggersColumnTriggerType.identifier(): triggerType,
},
sq.Eq{
FlowsTriggersColumnFlowType.identifier(): flowType,
FlowsTriggersColumnTriggerType.identifier(): triggerType,
FlowsTriggersColumnResourceOwner.identifier(): orgID,
}).ToSql()
},
).ToSql()
if err != nil {
return nil, errors.ThrowInternal(err, "QUERY-Dgff3", "Errors.Query.SQLStatement")
}

View File

@ -142,6 +142,7 @@ func (l *Login) handleExternalLoginCallback(w http.ResponseWriter, r *http.Reque
return
}
l.handleExternalUserAuthenticated(w, r, authReq, idpConfig, userAgentID, tokens)
return
}
l.renderError(w, r, authReq, caos_errors.ThrowPreconditionFailed(nil, "RP-asff2", "Errors.ExternalIDP.IDPTypeNotImplemented"))
return