mirror of
https://github.com/memohai/Memoh.git
synced 2026-04-25 07:00:48 +09:00
24 lines
476 B
Go
24 lines
476 B
Go
package server
|
|
|
|
import "testing"
|
|
|
|
func TestShouldSkipJWT_FeishuWebhookPaths(t *testing.T) {
|
|
t.Parallel()
|
|
|
|
cases := []struct {
|
|
path string
|
|
want bool
|
|
}{
|
|
{path: "/channels/feishu/webhook/cfg-1", want: true},
|
|
{path: "/channels/feishu/webhook", want: false},
|
|
{path: "/api/channels/feishu/webhook", want: false},
|
|
}
|
|
|
|
for _, tc := range cases {
|
|
got := shouldSkipJWT(tc.path)
|
|
if got != tc.want {
|
|
t.Fatalf("path=%q want=%v got=%v", tc.path, tc.want, got)
|
|
}
|
|
}
|
|
}
|