feat(feishu): add webhook inbound mode, region support, and callback/attachment enhancements (#107)

This commit is contained in:
Ringo.Typowriter
2026-02-23 21:57:34 +08:00
committed by GitHub
parent df12d94171
commit 29e76322cc
19 changed files with 1474 additions and 66 deletions
+14 -8
View File
@@ -47,14 +47,7 @@ func NewServer(log *slog.Logger, addr string, jwtSecret string,
},
}))
e.Use(auth.JWTMiddleware(jwtSecret, func(c echo.Context) bool {
path := c.Request().URL.Path
if path == "/ping" || path == "/health" || path == "/api/swagger.json" || path == "/auth/login" {
return true
}
if strings.HasPrefix(path, "/api/docs") {
return true
}
return false
return shouldSkipJWT(c.Request().URL.Path)
}))
for _, h := range handlers {
@@ -77,3 +70,16 @@ func (s *Server) Start() error {
func (s *Server) Stop(ctx context.Context) error {
return s.echo.Shutdown(ctx)
}
func shouldSkipJWT(path string) bool {
if path == "/ping" || path == "/health" || path == "/api/swagger.json" || path == "/auth/login" {
return true
}
if strings.HasPrefix(path, "/api/docs") {
return true
}
if strings.HasPrefix(path, "/channels/feishu/webhook/") {
return true
}
return false
}