forked from molecule-ai/molecule-core
Merge pull request #252 from Molecule-AI/fix/channels-discover-adminauth
fix(security): gate /channels/discover behind AdminAuth (#250)
This commit is contained in:
commit
3f7982777f
@ -381,7 +381,13 @@ func Setup(hub *ws.Hub, broadcaster *events.Broadcaster, prov *provisioner.Provi
|
||||
wsAuth.DELETE("/channels/:channelId", chh.Delete)
|
||||
wsAuth.POST("/channels/:channelId/send", chh.Send)
|
||||
wsAuth.POST("/channels/:channelId/test", chh.Test)
|
||||
r.POST("/channels/discover", chh.Discover)
|
||||
// #250: /channels/discover is an admin-setup helper (takes a bot
|
||||
// token, asks the vendor "what chats is this token a member of?").
|
||||
// Leaving it unauthenticated turned it into a bot-token oracle plus
|
||||
// a drive-by deleteWebhook side effect against any valid token an
|
||||
// attacker could probe. AdminAuth matches the intent — it's a
|
||||
// platform-operator helper, not a per-workspace route.
|
||||
r.POST("/channels/discover", middleware.AdminAuth(db.DB), chh.Discover)
|
||||
r.POST("/webhooks/:type", chh.Webhook)
|
||||
|
||||
// WebSocket
|
||||
|
||||
Loading…
Reference in New Issue
Block a user