Skip to content

feat(appconfig): Allow apps to validate/reject setting values via provisioning_api and occ - #66035

Open
nickvergessen wants to merge 3 commits into
masterfrom
feat/noid/config-validation
Open

nickvergessen wants to merge 3 commits into
masterfrom
feat/noid/config-validation

Conversation

@nickvergessen

Copy link
Copy Markdown
Member

Assisted-by: ClaudeCode:claude-opus-5-5

Summary

Checklist

AI (if applicable)

  • The content of this PR was partly or fully generated using AI

…visioning_api and occ

Assisted-by: ClaudeCode:claude-opus-5-5
Signed-off-by: Joas Schilling <coding@schilljs.com>
Signed-off-by: Joas Schilling <coding@schilljs.com>
@nickvergessen nickvergessen added this to the Nextcloud 36 milestone Oct 30, 2026
@nickvergessen nickvergessen self-assigned this Oct 30, 2026
@nickvergessen
nickvergessen requested a review from a team as a code owner October 30, 2026 09:51
@nickvergessen
nickvergessen requested review from a team, Altahrim, CarlSchwan, leftybournes and sudormant and removed request for a team October 30, 2026 09:51
Signed-off-by: Joas Schilling <coding@schilljs.com>
@ArtificialOwl

Copy link
Copy Markdown
Member

not doable deeper in the AppConfig API ?

@nickvergessen

Copy link
Copy Markdown
Member Author

not doable deeper in the AppConfig API ?

I actually don't want to do it inside there intentionally, so that apps can still temper with their own data and don't have to check when the event is triggered, if they are the one calling it.

E.g. follow up idea from me would be adding a listener in core that takes over this validation:

if (in_array($key, ['installed_version', 'enabled', 'types'], true)) {
throw new \InvalidArgumentException('The given key can not be set');
}
if ($app === 'core' && $key === 'encryption_enabled' && $value !== 'yes') {
throw new \InvalidArgumentException('The given key can not be set');
}
if ($app === 'core' && (strpos($key, 'public_') === 0 || strpos($key, 'remote_') === 0)) {
throw new \InvalidArgumentException('The given key can not be set');
}

But e.g. the installed_version and others still need to be able to be set with core functionality

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants