Files
multica/server/internal/integrations/dingtalk/binding_test.go
YYClaw c3577cb04b feat(dingtalk): add DingTalk bot integration (MUL-3958) (#4829)
Adds a DingTalk (钉钉) bot integration on the bring-your-own-app model: a
workspace admin creates their own Stream-mode robot and pastes its AppKey /
AppSecret, so no public webhook or OAuth redirect is required. Each agent gets
its own bot identity, so several agents can be distinct, separately
@-mentionable contacts in one DingTalk organization.

Supports DMs, @-mentions in groups, inbound images, /issue quick-create, and
/new. Built on the shared channel engine (ForceFresh/BareFresh, MediaResolver /
MediaRef and the intent ledger) rather than a private implementation.

Off unless MULTICA_DINGTALK_SECRET_KEY is set. Docs in en/zh/ja/ko.

Closes #4791.

Community-maintained: @yyclaw is the code owner for
server/internal/integrations/dingtalk/.
2026-08-06 15:36:02 +08:00

18 lines
539 B
Go

package dingtalk
import (
"errors"
"testing"
db "github.com/multica-ai/multica/server/pkg/db/generated"
)
func TestValidateBindingTokenChannel(t *testing.T) {
if err := validateBindingTokenChannel(db.ChannelBindingToken{ChannelType: string(TypeDingTalk)}); err != nil {
t.Fatalf("DingTalk token rejected: %v", err)
}
if err := validateBindingTokenChannel(db.ChannelBindingToken{ChannelType: "slack"}); !errors.Is(err, ErrBindingTokenInvalid) {
t.Fatalf("cross-channel token error = %v, want ErrBindingTokenInvalid", err)
}
}