Add Webhook recursion detection
Adds logging when: - recursive webhook calls are detected. - the total number of webhooks triggered by other webhooks within a sequence goes above a threshold. The detection uses a header, which is passed through from the request to the web hooks to track graphs of web hook requests. The feature is behind a feature flag. The next iteration will be to block the webhook from firing rather than log. https://gitlab.com/gitlab-org/gitlab/-/issues/329743 https://gitlab.com/gitlab-org/gitlab/-/merge_requests/75821
显示
- app/models/hooks/project_hook.rb 5 个添加, 0 个删除app/models/hooks/project_hook.rb
- app/models/hooks/service_hook.rb 4 个添加, 0 个删除app/models/hooks/service_hook.rb
- app/models/hooks/web_hook.rb 5 个添加, 0 个删除app/models/hooks/web_hook.rb
- app/services/web_hook_service.rb 32 个添加, 9 个删除app/services/web_hook_service.rb
- app/workers/web_hook_worker.rb 11 个添加, 1 个删除app/workers/web_hook_worker.rb
- config/feature_flags/development/webhook_recursion_detection.yml 8 个添加, 0 个删除...feature_flags/development/webhook_recursion_detection.yml
- config/initializers/webhook_recursion_detection.rb 5 个添加, 0 个删除config/initializers/webhook_recursion_detection.rb
- ee/app/models/hooks/group_hook.rb 5 个添加, 0 个删除ee/app/models/hooks/group_hook.rb
- ee/spec/models/hooks/group_hook_spec.rb 9 个添加, 0 个删除ee/spec/models/hooks/group_hook_spec.rb
- lib/api/ci/triggers.rb 1 个添加, 1 个删除lib/api/ci/triggers.rb
- lib/gitlab/middleware/webhook_recursion_detection.rb 19 个添加, 0 个删除lib/gitlab/middleware/webhook_recursion_detection.rb
- lib/gitlab/web_hooks.rb 7 个添加, 0 个删除lib/gitlab/web_hooks.rb
- lib/gitlab/web_hooks/recursion_detection.rb 102 个添加, 0 个删除lib/gitlab/web_hooks/recursion_detection.rb
- lib/gitlab/web_hooks/recursion_detection/uuid.rb 46 个添加, 0 个删除lib/gitlab/web_hooks/recursion_detection/uuid.rb
- spec/lib/gitlab/middleware/webhook_recursion_detection_spec.rb 42 个添加, 0 个删除...lib/gitlab/middleware/webhook_recursion_detection_spec.rb
- spec/lib/gitlab/web_hooks/recursion_detection_spec.rb 243 个添加, 0 个删除spec/lib/gitlab/web_hooks/recursion_detection_spec.rb
- spec/models/hooks/project_hook_spec.rb 9 个添加, 0 个删除spec/models/hooks/project_hook_spec.rb
- spec/models/hooks/service_hook_spec.rb 30 个添加, 0 个删除spec/models/hooks/service_hook_spec.rb
- spec/models/integrations/datadog_spec.rb 2 个添加, 2 个删除spec/models/integrations/datadog_spec.rb
- spec/requests/api/ci/triggers_spec.rb 1 个添加, 1 个删除spec/requests/api/ci/triggers_spec.rb
加载中
想要评论请 注册 或 登录