feat(im): support custom endpoints for private WeCom deployments

Allow configuring custom WebSocket and API base URLs for WeCom
via optional credentials fields (ws_endpoint, api_base_url), enabling
integration with privately deployed WeCom instances.

Changes:
- LongConnClient and WebhookAdapter accept custom endpoint URLs
- Endpoint URLs validated at construction (scheme + SSRF check)
- Private deployment hostnames added to file download SSRF allowlist
- Frontend forms added for both WebSocket and Webhook modes
- i18n support for zh-CN, en-US, ru-RU, ko-KR

Uses default public cloud endpoints when not specified.
This commit is contained in:
nullkey
2026-04-13 20:43:17 +08:00
committed by lyingbug
parent d4edd374df
commit 30f349d06a
10 changed files with 144 additions and 53 deletions
+4 -1
View File
@@ -85,7 +85,10 @@ func TestLongConnClient_StripAtMention(t *testing.T) {
})
t.Run("NewLongConnClient with bot name", func(t *testing.T) {
c := NewLongConnClient("id", "secret", "My Bot", nil)
c, err := NewLongConnClient("id", "secret", "", "My Bot", nil)
if err != nil {
t.Fatal(err)
}
got := c.stripAtMention("@My Bot /help")
if got != "/help" {