Repository navigation
Settings: "Active for" as a checkbox per part, with the Web Services API - #33
Merged
Merged
Conversation
"Active for" offers every combination of frontend, backend and the Web Services API (bit 4, see the plugin branch of the same name), default all three; the failed login list shows "API" as the origin of failed logins there. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01AFJFMPv7CSqgJJ93QJvYfL
Instead of a list of every combination of frontend, backend and Web Services API, the setting has a checkbox for each part; at least one has to be ticked. It is still stored as the bitmask the plugin reads (and 1.x stored): SettingsModel converts between the two, and a request without any valid part leaves the setting out, so the plugin's default (all parts) applies rather than none. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01AFJFMPv7CSqgJJ93QJvYfL
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.
This is the component half of protecting logins through Joomla's Web Services API (
api/index.php). The plugin half is codeling/bfstop#265 (branch of the same name), which also holds the tests and the language strings.Changes
required, values checked against the options).SettingsModelconverts it to the list of ticked boxes when loading the form (paramsForForm()) and back when saving (paramsForStorage()). The plugin, the update migration and settings saved earlier need no change for that.requiredrejects. If a crafted request still arrives with no valid part, the setting is left out of what is saved. The plugin's default then applies, which is all parts, not none.Testing
Run locally against Joomla 5.4.10 on PostgreSQL 16, with both branches deployed:
ComponentTest::testActiveForIsStoredAsABitmaskchecks the conversion in both directions and that the default applies when nothing was saved. It also checks that the form ticks the boxes of a stored bitmask (rendered with Joomla's checkboxes layout), and that a save of Backend + API stores6.testUnsavedSettingsAreWhatTheSettingsPageShowscompares the checkboxes' default1,2,4against the plugin default 7.check-language,check-zip,php -land xmllint all pass.🤖 Generated with Claude Code
https://claude.ai/code/session_01AFJFMPv7CSqgJJ93QJvYfL