Skip to content

feat(ironclad): add Ironclad integration with OAuth#3795

Open
waleedlatif1 wants to merge 8 commits intostagingfrom
waleedlatif1/add-ironclad
Open

feat(ironclad): add Ironclad integration with OAuth#3795
waleedlatif1 wants to merge 8 commits intostagingfrom
waleedlatif1/add-ironclad

Conversation

@waleedlatif1
Copy link
Collaborator

Summary

  • Add full Ironclad integration with 12 tools (workflows + records CRUD, approvals, comments)
  • OAuth 2.0 auth with 10 scopes, centralized via getScopesForService/getCanonicalScopesForProvider
  • Block with operation dropdown, conditional fields, advanced mode pagination, wandConfig on complex inputs
  • Docs page with manual description section

Type of Change

  • New feature

Testing

Tested manually

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
Copy link

vercel bot commented Mar 26, 2026

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

1 Skipped Deployment
Project Deployment Actions Updated (UTC)
docs Skipped Skipped Mar 26, 2026 11:18pm

Request Review

@cursor
Copy link

cursor bot commented Mar 26, 2026

PR Summary

Medium Risk
Adds a new OAuth provider and a suite of outbound API tools against Ironclad, increasing surface area for auth/config and external API error/contract handling. Changes are mostly additive but touch authentication and tool registries used broadly.

Overview
Adds a new Ironclad integration end-to-end: new IroncladIcon, integration metadata for the landing page, and docs (tools/ironclad.mdx + meta.json) so it appears in docs and UI icon mappings.

Introduces an Ironclad block (blocks/blocks/ironclad.ts) with an operation dropdown and conditional inputs, mapping UI params (e.g., workflowIdironcladWorkflowId, pagination coercion) to 12 new Ironclad tools.

Extends the platform’s OAuth support to include Ironclad: new env vars (IRONCLAD_CLIENT_ID/SECRET), provider wiring in lib/auth/auth.ts, service/scopes registration in lib/oauth/oauth.ts + types.ts + utils.ts, and registers all new tool implementations in tools/registry.ts.

Written by Cursor Bugbot for commit 5d7bad0. Configure here.

@greptile-apps
Copy link
Contributor

greptile-apps bot commented Mar 26, 2026

Greptile Summary

This PR adds a full Ironclad CLM integration with 12 tools covering workflow CRUD, approvals, and comments, plus OAuth 2.0 authentication with 10 scopes. The implementation follows the established patterns in the codebase, prior review concerns around unguarded JSON.parse calls and response shape assumptions have been addressed in follow-up commits, and the block config correctly handles the pageSizeperPage renaming for the list workflows operation.\n\nKey changes:\n- 12 new tool files under apps/sim/tools/ironclad/ implementing the full Ironclad workflow and records API surface\n- OAuth provider registration in auth.ts and oauth.ts with 10 scopes and centralized scope descriptions\n- Block config in apps/sim/blocks/blocks/ironclad.ts with conditional fields, advanced mode pagination, and wandConfig on complex JSON inputs\n- Documentation page and icon/registry wiring across both apps/sim and apps/docs\n\nIssue to resolve:\n- All 12 tool API URLs and the OAuth authorizationUrl/tokenUrl/userInfoUrl in auth.ts hardcode https://na1.ironcladapp.com. Ironclad is multi-region — EU customers use eu1.ironcladapp.com. As written, non-NA customers cannot authenticate or make API calls through this integration.

Confidence Score: 4/5

Safe to merge for NA-region Ironclad customers; one targeted fix needed to unblock non-NA customers.

The implementation is well-structured, follows codebase patterns, and all previously raised concerns (unguarded JSON.parse, response shape fallbacks) were resolved in follow-up commits. The single remaining issue — hardcoded na1 region across all tool URLs and OAuth endpoints — is a real functional limitation but only affects EU/non-NA Ironclad customers. NA customers can use the integration as-is.

apps/sim/lib/auth/auth.ts (OAuth endpoints) and all 12 files under apps/sim/tools/ironclad/ (API base URL) need the na1 region replaced with a configurable value.

Important Files Changed

Filename Overview
apps/sim/tools/ironclad/create_workflow.ts Creates a workflow via POST; JSON.parse on attributes is correctly guarded with try/catch; base URL hardcodes na1 region, blocking non-NA customers.
apps/sim/lib/auth/auth.ts OAuth provider config added for Ironclad; all three OAuth endpoints (authorize, token, userinfo) hardcode na1.ironcladapp.com, preventing EU-region customers from authenticating.
apps/sim/blocks/blocks/ironclad.ts Block config maps pageSizeperPage for list_workflows correctly; workflowIdironcladWorkflowId rename is handled; all 12 operations wired.
apps/sim/lib/oauth/utils.ts All 10 Ironclad OAuth scope descriptions added to SCOPE_DESCRIPTIONS; correctly integrated with getScopesForService / getCanonicalScopesForProvider pattern.
apps/sim/tools/ironclad/types.ts Well-structured type definitions for all 12 tools; shared base params and summary types are clean.
apps/sim/tools/ironclad/list_workflows.ts Lists workflows with pagination; response fallback data.pageSize ?? data.perPage ?? 20 addresses prior review concern; na1 region hardcoded.
apps/sim/tools/ironclad/list_workflow_comments.ts Defensive fallback data.list ?? data.comments ?? data ?? [] correctly addresses prior review concern about response shape assumption.
apps/sim/tools/ironclad/update_workflow_metadata.ts JSON.parse on actions wrapped in try/catch; response handling correctly defers response.json() to avoid errors on empty 204 bodies.
apps/sim/tools/ironclad/create_record.ts JSON.parse on properties and links now correctly wrapped in try/catch per prior review; na1 region hardcoded.
apps/sim/tools/ironclad/update_record.ts JSON.parse on properties wrapped in try/catch; PATCH sends parsed JSON directly as body, which is correct for record update.

Reviews (5): Last reviewed commit: "lint" | Re-trigger Greptile

@waleedlatif1
Copy link
Collaborator Author

@greptile

@waleedlatif1
Copy link
Collaborator Author

@cursor review

@waleedlatif1
Copy link
Collaborator Author

@greptile

@waleedlatif1
Copy link
Collaborator Author

@cursor review

@waleedlatif1
Copy link
Collaborator Author

@greptile

@waleedlatif1
Copy link
Collaborator Author

@cursor review

@waleedlatif1
Copy link
Collaborator Author

@greptile

@waleedlatif1
Copy link
Collaborator Author

@cursor review

Copy link

@cursor cursor bot left a comment

Choose a reason for hiding this comment

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

✅ Bugbot reviewed your changes and found no new issues!

Comment @cursor review or bugbot run to trigger another review on this PR

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