feat(webhooknotify): add configurable API key authentication - #369
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
问题与背景
Webhook消息推送原先要求外部监控系统持有 MoviePilot 公共 API_TOKEN。公共凭据分发到多个外部系统后,泄露或轮换会影响其他 API 集成,需要为 Webhook 提供可独立管理的认证凭据。
原因分析
插件此前固定使用公共 Token 依赖,并使用
token查询参数。插件路由注册器本身已经支持通过X-API-KEY请求头或apikey查询参数校验公共 API_TOKEN,但插件没有根据自身配置切换认证目标。解决方案
APIKEY配置,使用密码输入框展示。X-API-KEY或apikey传递凭据,调用方无需切换字段名称。影响与风险
版本由
1.0升级为1.1,版本事实已同步到插件类、package.v2.json和插件 README。现有用户不配置 APIKEY 时继续使用公共 API_TOKEN,但请求字段由旧版token调整为X-API-KEY或apikey;建议优先使用请求头,避免凭据进入 URL 日志。无需配置或数据迁移。验证
.githooks/pre-pushpython -m json.tool package.v2.jsonpython -m compileall -q plugins.v2/webhooknotifygit diff --check发布
WebhookNotify v1.1新增 APIKEY 认证配置。