Repository navigation
local_o365: only run notifysecretexpiry task for connected Microsoft IdP sites using client secret - #3772
local_o365: only run notifysecretexpiry task for connected Microsoft IdP sites using client secret#3772Lai Wei (weilai-irl) wants to merge 1 commit into
Conversation
…IdP sites using client secret The task now skips and succeeds unless the site uses a Microsoft IdP, the client secret authentication method, and a working Microsoft 365 connection. Remove the unused errorunsupportedsecretauthenticationmethod string.
There was a problem hiding this comment.
🟡 Changes recommended
The functional behavior change and lang-string removal are not accompanied by the conventional $plugin->version bump in local/o365/version.php, which this repo expects for plugin changes.
0 open findings
What changed in this PR
This PR narrows the conditions under which the local_o365 notifysecretexpiry scheduled task does real work. Instead of throwing exceptions (which surface as recurring task failures) when the site isn't connected or isn't using the client-secret auth method, the task now mtraces an explanatory message and returns true (success) when any precondition isn't met. This avoids noisy, false-positive task failures on sites that legitimately have no expiring client secret to monitor (e.g. certificate-based auth or disconnected integrations).
Changes:
- Added an early skip-and-succeed check for the client-secret auth method (
clientauthmethod != AUTH_OIDC_AUTH_METHOD_SECRET), moved ahead of the connection check. - Changed the "not connected" branch from throwing
error_not_connectedto skipping and returningtrue, and refreshed the "not configured" messaging. - Removed the now-unused
errorunsupportedsecretauthenticationmethodlanguage string.
| File | Description |
|---|---|
| local/o365/classes/task/notifysecretexpiry.php | Reorders preconditions and converts hard failures into graceful skips (return true) for non-secret auth and disconnected sites. |
| local/o365/lang/en/local_o365.php | Removes the orphaned errorunsupportedsecretauthenticationmethod string that the deleted exception used. |
🧠 Review effort: Balanced
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
The task now skips and succeeds unless the site uses a Microsoft IdP, the client secret authentication method, and a working Microsoft 365 connection. Remove the unused errorunsupportedsecretauthenticationmethod string.