Summary
A mechanism is needed to trigger the risk score collection in ConfirmEdit when a blocked edit notice page is triggered from Core.
Specifically, we need a new BeforePageDisplayHookHandler hook handler in ConfirmEdit that loads the hCaptcha frontend module for block notices.
When an IP or range block is in place and the user attempts to edit, the handler:
- injects a wgHCaptchaIpBlockRiskScore JS config object containing the passive mode sitekey, a mode identifier, and the IDs of blocks applying to the current page
- then loads the ext.confirmEdit.hCaptcha frontend module in order to collect the risk score in the frontend.
Acceptance criteria:
- A BeforePageDisplay hook handler in ConfirmEdit is triggered for edit pages where the user has an active IP or range block
- The hook handler loads the hCaptcha frontend modules and passing the required config variables
- wgHCaptchaIpBlockRiskScore is present on blocked edit pages with the correct siteKey, mode, and blockIds values
- The sitekey provided for blocked edit pages comes from a different config param than the ones used for edits (since it needs to be the passive mode site key)
- The handler does not fire on non-edit pages, or when no block is present
- The handler ignores block types other than IP or IP range blocks
- The ext.confirmEdit.hCaptcha frontend module is loaded on blocked edit pages for IPs and IP range blocks