Skip to content

feat(workflows): expose authenticated run subjects - #7088

Open
TheodoreSpeaks wants to merge 4 commits into
feat/credential-group-resource-policiesfrom
feat/subject-metadata-start
Open

feat(workflows): expose authenticated run subjects#7088
TheodoreSpeaks wants to merge 4 commits into
feat/credential-group-resource-policiesfrom
feat/subject-metadata-start

Conversation

@TheodoreSpeaks

Copy link
Copy Markdown
Collaborator

Summary

  • preserve authenticated principals across synchronous, queued, resumed, and nested workflow execution
  • expose normalized Sim user, chat email, and provider subjects through optional Start run metadata
  • keep actorless callers identity-free and enforce subject-scoped credential access

Type of Change

  • New feature

Testing

  • 771 tests across 31 changed test files
  • bun run lint
  • bun run check:audits (33 audits)

Checklist

  • Code follows project style guidelines
  • Self-reviewed my changes
  • Tests added/updated and passing
  • No new warnings introduced
  • I confirm that I have read and agree to the terms outlined in the Contributor License Agreement (CLA)

@vercel

vercel Bot commented Aug 26, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Actions Updated (UTC)
docs Skipped Skipped Aug 27, 2026 2:41am

Request Review

@greptile-apps

greptile-apps Bot commented Aug 26, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

The PR preserves authenticated workflow subjects across chat authentication, execution boundaries, and nested runs, then exposes normalized subject metadata to Start blocks.

  • Adds authenticated-email claims to signed deployment cookies and chat execution principals.
  • Propagates principals through queued, resumed, and nested workflow execution.
  • Exposes normalized Sim-user, authenticated-email, and external-provider subjects in optional Start metadata.
  • Enforces subject consistency for delegated credential access.

Confidence Score: 5/5

The PR appears safe to merge.

No blocking failure remains.

Important Files Changed

Filename Overview
apps/sim/app/api/chat/utils.test.ts Replaces the previously flagged ad-hoc cookie fixtures with typed NextRequest instances and real Cookie headers, resolving the prior review issue.
apps/sim/lib/core/security/deployment.ts Extends signed deployment-auth tokens with normalized authenticated-email claims while safely rejecting identity-free legacy email tokens.
apps/sim/lib/workflows/executor/start-run-identity.ts Normalizes supported principal subjects into the optional Start-block run metadata contract.
apps/sim/executor/handlers/workflow/workflow-handler.ts Preserves the original execution principal while updating nested-workflow delegation scope.
packages/auth/src/principal.ts Adds authenticated-email subjects and centralized subject resolution for supported workflow principals.

Sequence Diagram

sequenceDiagram
  participant Caller
  participant Auth as Deployment Auth
  participant Runner as Workflow Runner
  participant Queue as Queue/Snapshot
  participant Child as Nested Workflow
  participant Start as Start Block

  Caller->>Auth: Authenticate request
  Auth-->>Runner: Signed principal and subject
  Runner->>Queue: Serialize execution principal
  Queue-->>Runner: Restore execution principal
  Runner->>Child: Preserve caller principal and workflow scope
  Runner->>Start: Resolve normalized run subject
  Start-->>Caller: Optional trusted run metadata
Loading

Reviews (5): Last reviewed commit: "fix(workflows): remove duplicate run ema..." | Re-trigger Greptile

Comment thread apps/sim/app/api/chat/utils.test.ts Outdated

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All reported issues were addressed across 90 files

Reply with feedback, questions, or to request a fix.

Re-trigger cubic

Comment thread apps/sim/background/workflow-column-execution.ts
Comment thread apps/sim/app/api/mcp/serve/[serverId]/route.ts
Comment thread apps/sim/lib/credentials/application/resolve-managed-oauth-token.ts Outdated
Comment thread apps/sim/lib/auth/internal.ts Outdated
Comment thread apps/sim/lib/core/security/deployment.ts Outdated
Comment thread apps/sim/app/api/mcp/serve/[serverId]/route.test.ts
Comment thread apps/sim/app/api/workflows/[id]/execute/route.ts
Comment thread apps/sim/lib/webhooks/slack-dispatch.ts
Comment thread design/credential-group-authorization.md Outdated
@TheodoreSpeaks

Copy link
Copy Markdown
Collaborator Author

@greptile

@TheodoreSpeaks

Copy link
Copy Markdown
Collaborator Author

@cursor review

@cursor

cursor Bot commented Aug 26, 2026

Copy link
Copy Markdown

Skipping Bugbot: Bugbot is disabled for this repository. Visit the Bugbot dashboard to update your settings.

@TheodoreSpeaks
TheodoreSpeaks force-pushed the feat/subject-metadata-start branch from 531cb5b to e5e3a4a Compare August 27, 2026 01:39
@TheodoreSpeaks

Copy link
Copy Markdown
Collaborator Author

@cursor review

@TheodoreSpeaks

Copy link
Copy Markdown
Collaborator Author

@greptile

@cursor

cursor Bot commented Aug 27, 2026

Copy link
Copy Markdown

Skipping Bugbot: Bugbot is disabled for this repository. Visit the Bugbot dashboard to update your settings.

@TheodoreSpeaks
TheodoreSpeaks force-pushed the feat/subject-metadata-start branch from e5e3a4a to 68572ce Compare August 27, 2026 02:06
@TheodoreSpeaks
TheodoreSpeaks requested a review from a team as a code owner August 27, 2026 02:06
@TheodoreSpeaks
TheodoreSpeaks changed the base branch from feat/workspace-principal to feat/credential-group-resource-policies August 27, 2026 02:06
@TheodoreSpeaks

Copy link
Copy Markdown
Collaborator Author

@greptile

@TheodoreSpeaks

Copy link
Copy Markdown
Collaborator Author

@greptile

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant