Skip to content

Commit caf4974

Browse files
committed
2 parents 979624e + c5935ce commit caf4974

File tree

2 files changed

+23
-20
lines changed

2 files changed

+23
-20
lines changed

shared.go

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -14469,10 +14469,8 @@ func GetOpenIdUrl(request *http.Request, org Org, user User, mode string) (strin
1446914469
codeChallenge := verifier.CodeChallengeS256()
1447014470

1447114471
if !signIn {
14472-
// Initialize slice if needed
1447314472
user.InitSSOInfos()
1447414473

14475-
// Store SSO info per org (preserving existing Sub if present)
1447614474
existingSSOInfo, _ := user.GetSSOInfo(org.Id)
1447714475
user.SetSSOInfo(org.Id, SSOInfo{
1447814476
Sub: existingSSOInfo.Sub, // Keep existing Sub for this org
@@ -14482,7 +14480,7 @@ func GetOpenIdUrl(request *http.Request, org Org, user User, mode string) (strin
1448214480
})
1448314481

1448414482
ctx := context.Background()
14485-
err := SetUser(ctx, &user, false)
14483+
err := SetUser(ctx, &user, true)
1448614484
if err != nil {
1448714485
return "", err
1448814486
}
@@ -22597,6 +22595,7 @@ func HandleOpenId(resp http.ResponseWriter, request *http.Request) {
2259722595
continue
2259822596
}
2259922597
ssoInfo, exists := fullUser.GetSSOInfo(org.Id)
22598+
log.Printf("[DEBUG] SSOInfo exists: %t", exists)
2260022599
if exists && ssoInfo.CodeVerifier != "" {
2260122600
verifierObj := &CodeVerifier{Value: ssoInfo.CodeVerifier}
2260222601
if verifierObj.CodeChallengeS256() == foundChallenge {
@@ -22766,6 +22765,8 @@ func HandleOpenId(resp http.ResponseWriter, request *http.Request) {
2276622765
}
2276722766
}
2276822767

22768+
// don't be confused. "AutoProvision" acts like "DisableAutoProvision"
22769+
// it's super stupid.
2276922770
if (!foundOrgInUser || !foundUserInOrg) && org.SSOConfig.AutoProvision {
2277022771
log.Printf("[WARNING] User %s (%s) is not in org %s (%s). Please contact the administrator - (1)", user.Username, user.Id, org.Name, org.Id)
2277122772
resp.WriteHeader(401)
@@ -24623,7 +24624,7 @@ func PrepareWorkflowExecution(ctx context.Context, workflow Workflow, request *h
2462324624
}
2462424625

2462524626
// Handles agentic run continues
24626-
// This is if shuffler.io/agents => questions are answered
24627+
// This is if shuffler.io/agents => questions are answered
2462724628
if agentic {
2462824629
log.Printf("[INFO][%s] Should fix the decision by injecting the values and continuing to the next step! :3", oldExecution.ExecutionId)
2462924630

@@ -24656,7 +24657,7 @@ func PrepareWorkflowExecution(ctx context.Context, workflow Workflow, request *h
2465624657
findContinue = true
2465724658
}
2465824659

24659-
if debug {
24660+
if debug {
2466024661
log.Printf("[DEBUG][%s] Found decision '%s' inside the agentic workflow to update. Exec arg: %#v", workflowExecution.ExecutionId, decisionId, execArg)
2466124662
}
2466224663

@@ -24726,7 +24727,7 @@ func PrepareWorkflowExecution(ctx context.Context, workflow Workflow, request *h
2472624727
continue
2472724728
}
2472824729

24729-
if debug {
24730+
if debug {
2473024731
log.Printf("[DEBUG] Mapping field %d to value %s", fieldNumber, value)
2473124732
}
2473224733

@@ -24778,13 +24779,13 @@ func PrepareWorkflowExecution(ctx context.Context, workflow Workflow, request *h
2477824779
}
2477924780
}
2478024781

24781-
// This is a weird if statement, due to it being used for
24782+
// This is a weird if statement, due to it being used for
2478224783
// multiple purposes around field change & decision id finding
2478324784

2478424785
// FIXME: Not sure if this is correct to catch bad decision IDs
2478524786
//if !fieldsChanged && cleanupFailures {
2478624787
if !fieldsChanged {
24787-
//if cleanupFailures {
24788+
//if cleanupFailures {
2478824789
return workflowExecution, ExecInfo{}, fmt.Sprintf("Could not find fields for decision '%s'. Did you fill them in?", decisionId), errors.New(fmt.Sprintf("Could not find fields decision '%s'. Did you fill them in?", decisionId))
2478924790
}
2479024791

structs.go

Lines changed: 14 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -692,7 +692,7 @@ type SSOInfo struct {
692692
Sub string `json:"sub"`
693693
OrgID string `json:"org_id"`
694694
ClientID string `json:"client_id"`
695-
CodeVerifier string `json:"code_verifier"` // PKCE code verifier
695+
CodeVerifier string `json:"code_verifier"` // PKCE code verifier
696696
ChallengeExpiry time.Time `json:"challenge_expiry"`
697697
}
698698

@@ -3091,9 +3091,11 @@ type SSOConfig struct {
30913091
OpenIdAuthorization string `json:"openid_authorization" datastore:"openid_authorization"`
30923092
OpenIdToken string `json:"openid_token" datastore:"openid_token"`
30933093
SSORequired bool `json:"SSORequired" datastore:"SSORequired"`
3094-
AutoProvision bool `json:"auto_provision" datastore:"auto_provision"`
3095-
RoleRequired bool `json:"role_required" datastore:"role_required"`
3096-
SkipSSOForAdmins bool `json:"skip_sso_for_admins" datastore:"skip_sso_for_admins"`
3094+
// i have a distinct hatered for this name.
3095+
// says "auto_provision" but all logic treats it as disable_auto_provision.
3096+
AutoProvision bool `json:"auto_provision" datastore:"auto_provision"`
3097+
RoleRequired bool `json:"role_required" datastore:"role_required"`
3098+
SkipSSOForAdmins bool `json:"skip_sso_for_admins" datastore:"skip_sso_for_admins"`
30973099
}
30983100

30993101
type SamlRequest struct {
@@ -4579,15 +4581,15 @@ type AgentOutput struct {
45794581
// For easy testing
45804582
DecisionString string `json:"decision_string,omitempty" datastore:"decision_string"`
45814583
// For tracking of details parent<->child
4582-
StartedAt int64 `json:"started_at,omitempty" datastore:"started_at"`
4583-
CompletedAt int64 `json:"completed_at,omitempty" datastore:"completed_at"`
4584-
ExecutionId string `json:"execution_id,omitempty" datastore:"execution_id"`
4585-
NodeId string `json:"node_id,omitempty" datastore:"node_id"`
4586-
Memory string `json:"memory,omitempty" datastore:"memory"`
4587-
Input string `json:"input" datastore:"input"`
4588-
OriginalInput string `json:"original_input,omitempty" datastore:"original_input"`
4584+
StartedAt int64 `json:"started_at,omitempty" datastore:"started_at"`
4585+
CompletedAt int64 `json:"completed_at,omitempty" datastore:"completed_at"`
4586+
ExecutionId string `json:"execution_id,omitempty" datastore:"execution_id"`
4587+
NodeId string `json:"node_id,omitempty" datastore:"node_id"`
4588+
Memory string `json:"memory,omitempty" datastore:"memory"`
4589+
Input string `json:"input" datastore:"input"`
4590+
OriginalInput string `json:"original_input,omitempty" datastore:"original_input"`
45894591
AllowedActions []string `json:"allowed_actions,omitempty" datastore:"allowed_actions"`
4590-
Output string `json:"output,omitempty" datastore:"output"`
4592+
Output string `json:"output,omitempty" datastore:"output"`
45914593
}
45924594

45934595
type HTTPWrapper struct {

0 commit comments

Comments
 (0)