fix: Correct userID propagation for agent-triggered workflows (#603)
This commit is contained in:
@@ -29,7 +29,7 @@ type CustomSQLRequest struct {
|
||||
SQL string
|
||||
Params []SQLParam
|
||||
IsDebugRun bool
|
||||
UserID int64
|
||||
UserID string
|
||||
ConnectorID int64
|
||||
}
|
||||
|
||||
@@ -91,7 +91,7 @@ type DeleteRequest struct {
|
||||
DatabaseInfoID int64
|
||||
ConditionGroup *ConditionGroup
|
||||
IsDebugRun bool
|
||||
UserID int64
|
||||
UserID string
|
||||
ConnectorID int64
|
||||
}
|
||||
|
||||
@@ -102,7 +102,7 @@ type QueryRequest struct {
|
||||
ConditionGroup *ConditionGroup
|
||||
OrderClauses []*OrderClause
|
||||
IsDebugRun bool
|
||||
UserID int64
|
||||
UserID string
|
||||
ConnectorID int64
|
||||
}
|
||||
|
||||
@@ -115,7 +115,7 @@ type UpdateRequest struct {
|
||||
ConditionGroup *ConditionGroup
|
||||
Fields map[string]any
|
||||
IsDebugRun bool
|
||||
UserID int64
|
||||
UserID string
|
||||
ConnectorID int64
|
||||
}
|
||||
|
||||
@@ -123,7 +123,7 @@ type InsertRequest struct {
|
||||
DatabaseInfoID int64
|
||||
Fields map[string]any
|
||||
IsDebugRun bool
|
||||
UserID int64
|
||||
UserID string
|
||||
ConnectorID int64
|
||||
}
|
||||
|
||||
|
||||
@@ -415,12 +415,16 @@ func isDebugExecute(ctx context.Context) bool {
|
||||
return execCtx.RootCtx.ExeCfg.Mode == vo.ExecuteModeDebug || execCtx.RootCtx.ExeCfg.Mode == vo.ExecuteModeNodeDebug
|
||||
}
|
||||
|
||||
func getExecUserID(ctx context.Context) int64 {
|
||||
func getExecUserID(ctx context.Context) string {
|
||||
execCtx := execute.GetExeCtx(ctx)
|
||||
if execCtx == nil {
|
||||
panic(fmt.Errorf("unable to get exe context"))
|
||||
}
|
||||
return execCtx.RootCtx.ExeCfg.Operator
|
||||
if execCtx.RootCtx.ExeCfg.AgentID != nil {
|
||||
return execCtx.RootCtx.ExeCfg.ConnectorUID
|
||||
}
|
||||
uIDStr := strconv.FormatInt(execCtx.RootCtx.ExeCfg.Operator, 10)
|
||||
return uIDStr
|
||||
}
|
||||
|
||||
func getConnectorID(ctx context.Context) int64 {
|
||||
|
||||
Reference in New Issue
Block a user