Delete asks for confirmation, not a password - #1750
Merged
Merged
Conversation
An account that an OIDC provider creates has no local password. The delete password prompt refused it on every bulk delete. The prompt was meant to confirm intent. A password proves identity, not intent, and FOG already skipped it on the host edit-page delete and on the REST API. - Remove FOGBase::checkauth() and its six callers. - Remove the password field from every delete dialog. The dialog title is "Confirm delete", and the button still names the count. - $.deleteSelected always opens the dialog before it posts. With FOG_REAUTH_ON_DELETE off, it used to delete on the first click. - Rename $.reAuth to $.confirmDelete, and $.finishReAuth to $.finishConfirmDelete. - Schema step 437 deletes FOG_REAUTH_ON_DELETE and FOG_REAUTH_ON_EXPORT. No code read the export setting. - This also fixes the role and user group edit-page delete. It sent no password, so it answered 401 whenever the setting was on. Reported at https://forums.fogproject.org/topic/18239 Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_014kd8mRPpMPXsCgXwhH4Xzu
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.
Problem
An account that an OIDC provider creates has no local password. With
FOG_REAUTH_ON_DELETEon (the default), every bulk delete asks for the account password, so that account can never delete anything. Reported at https://forums.fogproject.org/topic/18239 (problem 2 of 2; problem 1 was #1749).Cause
The prompt was meant to confirm that somebody really wanted to delete many items. A password proves who is at the keyboard, not what they meant. The control was also partial: the host edit-page delete never asked (
FOGPage::delete()), and no REST API route calledcheckauth().Change
FOGBase::checkauth()and its six callers:FOGPage::deletemulti, the pending host and pending MAC deletes inHostManagement, anddelete/deletemultiinRoleManagementandUserGroupManagement.$.deleteSelectedalways opens the dialog before it posts, and posts nofogguipass. The 401 re-prompt is gone.$.reAuthis now$.confirmDelete, and$.finishReAuthis now$.finishConfirmDelete.FOG_REAUTH_ON_DELETEandFOG_REAUTH_ON_EXPORT. No code read the export setting.FOG_SCHEMAis 437 andFOG_BCACHE_VERis 367.Behavior changes
FOG_REAUTH_ON_DELETEoff now gets a confirm dialog on bulk delete. Before, the delete ran on the first click.No fog-plugins change: no plugin uses the delete password path.
Verification
tests/delete-confirms-without-password.test.php: 17 of 19 checks fail on the base, and 19 of 19 pass with the change.tests/apitoken-grid-and-scope.test.phpis updated for the rename and passes.FOG_SCHEMAheld at 436 in that copy, so nothing migrated.FOG_REAUTH_ON_DELETEis on in the lab.deletemulti, no password postedInvalid LoginDelete Successdelete, no password postedInvalid LoginThe browser click-through was not run. The request checks above cover what it would show.
🤖 Generated with Claude Code
https://claude.ai/code/session_014kd8mRPpMPXsCgXwhH4Xzu