Commit Graph

19 Commits

Author SHA1 Message Date
9bbe63c1d8 Implement a ratelimit for Web App Form endpoints (vibe-kanban 033e0d0d)
Prevent adversaries from brute-frocing the form token.
2026-01-27 07:49:50 +08:00
b59713b980 Return the form expired error code in get form definition in WEbAPp Api (vibe-kanban 758765b0) 2026-01-26 16:14:02 +08:00
33a830cbc9 refactor(api): rename placeholder to default_value in various parts
Previously the fields / classes are named with `placeholder`. However,
the actual purpose is to use as default values. This commit addresses
this problem by correcting names for relevant fields / classes.

- FormInputPlaceholder
- FormInput.placeholder
- HumanInputRequiredResponse.resolved_placeholder_values
- HumanInputFormDefinition.resolved_placeholder_values
- FormCreateParams.resolved_placeholder_values
- HumanInputRequired.resolved_placeholder_values
- The `resolved_placeholder_values` argument of _create_human_input_delivery_test_form
- The `resolved_placeholder_values` inside _jsonify_form_definition
2026-01-23 15:05:18 +08:00
68d56415d0 Rename the placeholder_values to resolved_placeholder_values in HumanInputFormApi (vibe-kanban 4b9631d6)
Update tests accordingly. Ensure relevant tests are green.
2026-01-16 13:27:35 +08:00
e099a8de47 feat(api): simplify the FormDefinition API for web app 2026-01-16 09:49:45 +08:00
80139bdfb4 test(api): adjust tests for _resolve_human_input_email_delivery_enabled 2026-01-16 09:42:39 +08:00
915de2b8dd fix(api): submission return 404 for web app api 2026-01-15 18:01:13 +08:00
1114806978 fix(api): allow any form to be submitted via web app api 2026-01-15 13:37:59 +08:00
c45dd66bd7 The site field returned by HumanInputFormApi is inconsistent with the API docs (vibe-kanban e0fb38c9)
```javascript

Expected structure:

```json
{
    "site": {
        "app_id": "e9823576-d836-4f2b-b46f-bd4df1d82230",
        "end_user_id": "b7aa295d-1560-4d87-a828-77b3f39b30d0",
        "enable_site": true,
        "site": {
            "title": "wf",
            "chat_color_theme": null,
            "chat_color_theme_inverted": false,
            "icon_type": "emoji",
            "icon": "\ud83e\udd16",
            "icon_background": "#FFEAD5",
            "icon_url": null,
            "description": null,
            "copyright": null,
            "privacy_policy": null,
            "custom_disclaimer": "",
            "default_language": "en-US",
            "prompt_public": false,
            "show_workflow_steps": true,
            "use_icon_as_answer_icon": false
        },
        "model_config": null,
        "plan": "basic",
        "can_replace_logo": false,
        "custom_config": null
    },
    // ... other fields
}

```

The current implementation of HumanInputFormApi returns the following structure:

```json

{
    "site": {
        "title": "hitl-chatflow",
        "chat_color_theme": null,
        "chat_color_theme_inverted": false,
        "icon_type": "emoji",
        "icon": "🤖",
        "icon_background": "#FFEAD5",
        "icon_url": null,
        "description": null,
        "copyright": null,
        "privacy_policy": null,
        "custom_disclaimer": "",
        "default_language": "en-US",
        "prompt_public": false,
        "show_workflow_steps": true,
        "use_icon_as_answer_icon": false
    },

    // ... other fields
}

```

\`\`\`
2026-01-15 12:26:51 +08:00
ea90746ed7 feat(api): adjust /pause-details api, add backstage form token 2026-01-15 09:43:16 +08:00
f1b2e1cfb4 feat(api): Add app_id field to HumanInputForm model
This ensures that `HumanInputForm` could be associated to a specific
application without relying on `WorkflowRun`, providing us a smoother
migration path if we want to implement test form.
2026-01-14 16:58:17 +08:00
25cc2ab738 fix(api): missing site field in Web App Form Definition API 2026-01-14 14:25:57 +08:00
6bcd4ad740 fix(api): Ensure is_resumption for node_started event is correctly set 2026-01-13 09:25:44 +08:00
c1215ad9ef temp(api): disable auth for webapp api 2026-01-09 00:21:58 +08:00
184f7ab144 WIP: feat(api): always use form_token to submit human input form 2026-01-06 08:53:24 +08:00
c0f1aeddbe WIP: resume 2025-12-26 11:52:49 +08:00
c0e15b9e1b WIP: feat(api): human input service 2025-12-26 11:48:56 +08:00
43348ce1a6 WIP: P4 2025-12-26 11:39:28 +08:00
8b914d9116 WIP 2025-12-26 10:45:23 +08:00