Repository navigation
Reset a settings area and list the areas over HTTP - #3126
Merged
Merged
Conversation
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.
Closes #3098
The Management API can now reset a settings area and list the areas.
DELETE /settings/{area}andDELETE /settings/{area}/defaultscallResetAsync: the row goes, the level below shows through again, and a site inherits every secret of the defaults again, including when the defaults replace it later.GET /settingslists the areas the caller may manage in the site of the request and for the instance defaults, with the plugin that registers each, so the admin can draw its settings menu. Spec 4.10 and 4.13, the OpenAPI document and the AI assist README describe what was built.Dependencies
None.
Decisions
FCMS3130), and*is refused. The client sends the version it read."0"with no row changes nothing, raises nothing and answers 204. A row that has moved, or a version other than"0"when there is no row, isFCMS2808(412).FCMS2802), thenIf-Match./defaultsneeds a grant with no site limit.ETag. The next read shows what the reset uncovered.SettingsChangedEvent, so its activity row issettings.changed, asResetAsyncalready did. Log line 9803 calls it a reset. The activity row does not tell a reset from a write, because that would change the SDK event.{ "items": [{ "area", "plugin", "site", "defaults" }] }, ordered by area name.pluginis null for an area of core or of the host, not the stringcore, because a plugin may be namedcore. An area the caller may manage nowhere is left out. A caller with no settings permission gets an empty list, not a 403.AddSettings<T>()records the plugin inPluginContributions, the same way jobs and outbox handlers are recorded.[UnlistedSettings]is an internal attribute in core, and onlySeedingStatecarries it. It is not public in the SDK, soPublicAPIdoes not change, and a public marker can still be added later. The routes ofseedingstill answer a caller that hassettings.seeding.manage, as they did before. Only the list leaves the area out, since closing the routes would change behaviour beyond this issue./plugins.PublicAPIentries.Acceptance
aikey inherits the key of the defaults again after a reset, and keeps inheriting it when the defaults replace itsettings.{area}.manage, as a write does, and answers 204. It changes nothing when there is no documentIf-Matchis refused withFCMS2808GET /settingslists only the areas the caller may manageTests
SettingsResetAndListTests(new, SQLite). After a reset a site reads the secret of the defaults, follows them when they replace it, and keeps inheriting through a write that leaves the key out. A reset of the defaults gives the inherited secret its code default. The class also covers stale and missingIf-Match, a reset that changes nothing and records no activity, the permissions of the site and the instance, the list for Super Admin and for site, instance and unrelated roles, andseedingleft out.AiProviderTests.ASiteThatResetsItsSettingsInheritsTheKeyOfTheDefaultsAgain: the stub providers receive the site's key, then the defaults' key after the reset, then the replaced key.PluginContributionTests.TheListOfSettingsAreasNamesThePluginOfEachandOpenApiDocumentTests.TheListOfSettingsAreasAndTheResetsAreDocumented.dotnet build -c Release -warnaserror, the SDK, core and architecture tests, the Management, OpenAPI and seeding integration tests, the plugin contribution and AI provider tests, the data settings tests on SQLite, and markdownlint.