feat: Integrations model + HTTP_REQUEST workflow step type#18
Merged
feat: Integrations model + HTTP_REQUEST workflow step type#18
Conversation
…-type Feat/task template linked object type
…ine HTTP execution
- Add IntegrationAuthType enum (NONE, API_KEY, BEARER_TOKEN, BASIC_AUTH)
- Add Integration model (company-scoped, stores base_url + credentials JSON)
- Add HTTP_REQUEST value to StepActionType enum
- Add Company.integrations back-reference relationship
- Add IntegrationCreate/Update/Out Pydantic schemas with credential masking
- Add _resolve_template() for {{trigger.field}} / {{steps.UUID.field}} syntax
- Add _execute_http_request() to workflow engine (sync httpx, lazy imports)
- Alembic migration: create integration table + ALTER TYPE stepactiontype ADD VALUE
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- New Alembic revision d4e5f6a7b8c9 (chained from integration table migration c865c4c8e97a): inserts integrations.create/read/update/delete permissions and assigns them to ADMIN and MANAGER roles (all inserts are ON CONFLICT DO NOTHING — idempotent) - Update rbac_seed.py to include integrations.* permissions so fresh database initializations also receive them Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Integrationmodel (integrationtable) — company-scoped registry of external API connections. Storesname,base_url,auth_type(NONE / API_KEY / BEARER_TOKEN / BASIC_AUTH), andcredentialsJSON.IntegrationAuthTypeenum for the four supported auth strategies.HTTP_REQUESTadded toStepActionType— enables workflow steps to call external APIs.Company.integrationsback-reference added to the Company relationship chain (CASCADE delete).IntegrationCreate/Update/OutPydantic schemas —IntegrationOut.from_orm_masked()redactsapi_key,token, andpasswordvalues in GET responses._resolve_template()— recursively resolves{{trigger.resource_id}},{{trigger.after.FIELD}}, and{{steps.UUID.FIELD}}in HTTP request bodies and headers._execute_http_request()added to workflow engine — lazy-importshttpx(lives in backend-erp) andIntegration; applies auth headers perauth_type; storesstatus_code,response_body(≤10KB), andsuccessinWorkflowStepExecution.result.c865c4c8e97a— createsintegrationtable withintegrationauthtypeenum, and runsALTER TYPE stepactiontype ADD VALUE IF NOT EXISTS 'HTTP_REQUEST'.Test plan
integrationtable andintegrationauthtypeenum exist in dev DBstepactiontypeenum includesHTTP_REQUESTvalueIntegrationOut.from_orm_masked()returns***for sensitive credential keys_resolve_template()correctly resolves nested{{trigger.after.field}}and{{steps.UUID.field}}patternsHTTP_REQUESTstep and stores result inWorkflowStepExecution.result🤖 Generated with Claude Code