feat(channels): add DingTalk Stream mode adapter#353
Open
tuzkier wants to merge 1 commit intoRightNow-AI:mainfrom
Open
feat(channels): add DingTalk Stream mode adapter#353tuzkier wants to merge 1 commit intoRightNow-AI:mainfrom
tuzkier wants to merge 1 commit intoRightNow-AI:mainfrom
Conversation
Adds a WebSocket-based DingTalk Stream channel adapter as an alternative to the existing webhook-based DingTalk adapter. DingTalk Stream Mode uses a long-lived WebSocket connection to the DingTalk Gateway, eliminating the need for a public webhook endpoint. Changes: - `openfang-types`: add `DingTalkStreamConfig` struct and wire into `ChannelsConfig` alongside the existing `DingTalkConfig` - `openfang-channels`: implement `DingTalkStreamAdapter` (WebSocket connection management, ping/pong, token refresh, send via batchSend API) - `openfang-api`: register `dingtalk_stream` in the channel registry, `is_channel_configured`, and `channel_config_values` - `openfang-api`: wire adapter startup in `channel_bridge.rs` - `openfang-cli`: add `dingtalk_stream` entry to the TUI channels list Configuration: ```toml [channels.dingtalk_stream] app_key_env = "DINGTALK_APP_KEY" # Enterprise Internal App Key app_secret_env = "DINGTALK_APP_SECRET" # Enterprise Internal App Secret robot_code_env = "DINGTALK_ROBOT_CODE" # optional, defaults to app_key ``` Requires an Enterprise Internal App in the DingTalk Open Platform with Stream Mode enabled. No public endpoint needed. Made-with: Cursor
6 tasks
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
Adds a WebSocket-based DingTalk Stream channel adapter as an alternative to the existing webhook-based DingTalk adapter.
DingTalk Stream Mode uses a long-lived WebSocket connection to the DingTalk Gateway, eliminating the need for a public webhook endpoint.
Changes
openfang-types: addDingTalkStreamConfigstruct and wire intoChannelsConfigalongside the existingDingTalkConfigopenfang-channels: implementDingTalkStreamAdapter— WebSocket connection management, auto-reconnect with exponential backoff, ping/pong keepalive, access token refresh, outbound via batchSend APIopenfang-api: registerdingtalk_streamin the channel registry,is_channel_configured, andchannel_config_values; wire adapter startup inchannel_bridge.rsopenfang-cli: adddingtalk_streamentry to the TUI channels listConfiguration
Requires an Enterprise Internal App in the DingTalk Open Platform with Stream Mode enabled. No public endpoint or webhook URL needed.
Testing
cargo clippy --workspace --all-targets -- -D warningspassescargo test --workspacepassesSecurity
Notes
[channels.dingtalk]webhook adapter is unchanged