occ config:app:set --value ignores --no-sensitive (and drops --sensitive for boolean values)
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 75/100
Research direction
Start with core/Command/Config/App/SetConfig.php and trace the --value handling for each supported type, then read lib/private/AppConfig.php and the existing cases in tests/Core/Command/Config/App/SetConfigTest.php. Add coverage for clearing sensitivity after confirmation and for boolean values with --sensitive. Done means both behaviors are covered and the focused test passes.
Written by the indexing model from the issue text.
Description
Bug description
occ config:app:set <app> <key> --value=… --no-sensitive asks for confirmation to change the sensitive flag, but the flag is never cleared:
The resulting $sensitive = false is passed to setValueString()/setValueInt()/…, but AppConfig::setTypedValue() keeps an existing sensitive flag (it only ever switches sensitivity from false to true):
https://github.com/nextcloud/server/blob/3a68340a6c806a18cdd0d9667a3b9ec5f096b135/lib/private/AppConfig.php#L872-L874
https://github.com/nextcloud/server/blob/3a68340a6c806a18cdd0d9667a3b9ec5f096b135/lib/private/AppConfig.php#L951-L953
Only the branch without --value calls updateSensitive(). In addition, the boolean case does not pass $sensitive at all, so --sensitive is silently ignored for --type=boolean:
Steps to reproduce
Found by code reading.
occ config:app:set myapp mykey --value=foo --sensitiveocc config:app:set myapp mykey --value=bar --no-sensitiveand confirm the questionocc config:app:get myapp mykey --detailsstill shows the key as sensitive.
Expected behavior
When the admin confirms the change, --no-sensitive clears the flag (e.g. by calling updateSensitive() after setting the value, like the branch without --value does), and --sensitive is honoured for boolean values too. A test in tests/Core/Command/Config/App/SetConfigTest.php should cover both. (The wrong "Config value was not updated" output for type-only changes is tracked separately in #60065.)
Nextcloud version
master
- Dominant language
- PHP
- Stars
- 37.6k
- Forks
- 5.4k
- Avg merge
- 1d 20h
- Merged PRs (30d)
- 605
Getting set up
Starts the project's dev container in your browser, under your own GitHub account.
- No Dockerfile or Docker Compose file
- Has a pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from nextcloud/server
-
Document lexicon.default.userconfig and lexicon.default.userconfig.enforced in config.sample.phpOpenenhancement feature: settings good first issue
Difficulty 1/5 1-3 hours Newbie friendliness 88/100
Maintainers usually reply within 1 day
-
bug feature: previews and thumbnails performance 🚀
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
Maintainers usually reply within 1 day
-
bug feature: TaskProcessing good first issue
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
Maintainers usually reply within 1 day
-
files_external occ commands crash with InvalidArgumentException for SMB mounts without credentialsOpenbug feature: external storage feature: occ good first issue
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Maintainers usually reply within 1 day
-
"Forwarded for headers" setup check trusts a client-sent Remote-Addr header and ignores CIDR proxiesOpenbug feature: settings
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
Maintainers usually reply within 1 day
All issues in nextcloud/server
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
nextcloud/integration_openai#480 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
Maintainers usually reply within 1 day
-
a11y
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
omeka/plugin-Contribution#84 ·
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
recca0120/vscode-phpunit#620 ·
Maintainers usually reply within 1 day
-
Validation rule generation for recursive Data objects is unbounded (O(payload depth))Possibly taken @irfanm96 claimed this today. Open
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
spatie/laravel-data#1226 ·